11 char *whitespace = " \t\r\n";
18 setmalloctag(v, getcallerpc(&n));
27 setmalloctag(s, getcallerpc(&s));
32 nstrcpy(char *to, char *from, int n)
39 addkey(Key *h, char *key, char *val)
47 k = emalloc(sizeof(*k) + n + strlen(val)+1);
56 delkey(Key *h, char *key)
60 for(p = nil, k = h; k; p = k, k = k->next){
61 if(!cistrcmp(k->key, key)){
66 memset(k->val, 0, strlen(k->val));
75 getkey(Key *k, char *key)
78 if(!cistrcmp(k->key, key))
86 lookkey(Key *k, char *key)
88 if(k = getkey(k, key))
101 while(v >= s && strchr(whitespace, *v))
103 if(v = strchr(s, ':')){
105 while(*v == ' ' || *v == '\t')
108 return addkey(0, s, v);
114 unquote(char *s, char **ps)
119 p = strpbrk(s, " \t\r\n");
129 if(*p == '\\' && *(p+1)){
134 memmove(s, s+1, p-(s+1));