diff options
-rw-r--r-- | tanja.c | 12 | ||||
-rw-r--r-- | tanja.h | 12 |
2 files changed, 12 insertions, 12 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) { @@ -102,14 +102,14 @@ int64_t tn_el_int(tn_el); int tn_el_numval(tn_el, double *); double tn_el_num(tn_el); char *tn_el_str(tn_el, char *); -tn_el tn_array_new(char *, ...); -void tn_array_append(tn_el *, char *, ...); -tn_el tn_map_new(int, char *, ...); -void tn_map_set(tn_el *, char *, ...); -tn_el tn_map_get(tn_el, const char *); +tn_el tn_array_new(const char *, ...); +void tn_array_append(tn_el *, const char *, ...); +tn_el tn_map_new(int, const char *, ...); +void tn_map_set(tn_el *, const char *, ...); +tn_el tn_map_get(tn_el, const const char *); void tn_tuple_ref(tn_tuple *); void tn_tuple_unref(tn_tuple *); -tn_tuple *tn_tuple_new(char *, ...); +tn_tuple *tn_tuple_new(const char *, ...); int tn_tuple_match(tn_tuple *, tn_tuple *); char *tn_json_fmt(tn_tuple *); |