diff options
Diffstat (limited to 'tanja.c')
-rw-r--r-- | tanja.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -308,7 +308,7 @@ char *tn_el_str(tn_el el, char *buf) { } -tn_el tn_array_new(char *lst, ...) { +tn_el tn_array_new(const char *lst, ...) { tn_el a; a.count = a.size = strlen(lst); a.type = TN_VT_AR; @@ -336,7 +336,7 @@ static inline void tn_array_grow(tn_el *a, int new) { } -void tn_array_append(tn_el *a, char *lst, ...) { +void tn_array_append(tn_el *a, const char *lst, ...) { assert(a && a->type == TN_VT_AR); int n = strlen(lst); @@ -410,7 +410,7 @@ static inline void tn_map_set_one(tn_el *m, char *key, tn_el val) { } -tn_el tn_map_new(int s, char *lst, ...) { +tn_el tn_map_new(int s, const char *lst, ...) { tn_el a; a.type = TN_VT_MAP; a.v.m = NULL; @@ -433,7 +433,7 @@ tn_el tn_map_new(int s, char *lst, ...) { } -void tn_map_set(tn_el *m, char *lst, ...) { +void tn_map_set(tn_el *m, const char *lst, ...) { assert(m && m->type == TN_VT_MAP); int len = strlen(lst); tn_map_grow(m, len); @@ -476,7 +476,7 @@ void tn_tuple_unref(tn_tuple *tup) { } -tn_tuple *tn_tuple_new(char *lst, ...) { +tn_tuple *tn_tuple_new(const char *lst, ...) { tn_tuple *t = malloc(offsetof(tn_tuple, e) + strlen(lst)*sizeof(tn_el)); t->n = strlen(lst); t->ref = 1; @@ -529,7 +529,7 @@ int tn_tuple_match(tn_tuple *p, tn_tuple *t) { lbuf_append((*buf), _s, _len);\ } while(0) -static inline void json_fmt_string(char *str, lbuf *buf) { +static inline void json_fmt_string(const char *str, lbuf *buf) { ac('\"'); while(*str) { switch(*str) { |