1 #ifndef __env_h
2 #define __env_h
3 
4 #include <stdlib.h>
5 
6 #include "str.h"
7 
env_get(const char * s)8 static char *env_get(const char *s)
9 {
10 	/* Clib */
11 	return getenv(s);
12 }
env_put(char * k,char * v)13 static void env_put(char *k, char *v)
14 {
15 	str_t s;
16 	str_init(s);
17 	str_copy(s, k);
18 	str_cat(s, "=");
19 	str_cat(s, v);
20 	/* Clib */
21 	if (putenv(str(s)) == -1) {
22 		cfatal("env_put:putenv: %s");
23 	}
24 }
25 
26 #endif
27