diff options
| author | 2024-05-23 10:01:37 +0200 | |
|---|---|---|
| committer | 2024-05-23 10:01:37 +0200 | |
| commit | 8cf7559a7e21c5757455b948814d61e6e96f08f1 (patch) | |
| tree | c9a9d6d637977f97ebfc83ba36ae794fe5f9d8c1 | |
| parent | Also return an application/ld+json object in webfinger. (diff) | |
| download | snac2-8cf7559a7e21c5757455b948814d61e6e96f08f1.tar.gz snac2-8cf7559a7e21c5757455b948814d61e6e96f08f1.tar.xz snac2-8cf7559a7e21c5757455b948814d61e6e96f08f1.zip | |
Added more const.
| -rw-r--r-- | activitypub.c | 39 | ||||
| -rw-r--r-- | data.c | 58 | ||||
| -rw-r--r-- | format.c | 11 | ||||
| -rw-r--r-- | html.c | 36 | ||||
| -rw-r--r-- | http.c | 6 | ||||
| -rw-r--r-- | httpd.c | 9 | ||||
| -rw-r--r-- | main.c | 2 | ||||
| -rw-r--r-- | mastoapi.c | 50 | ||||
| -rw-r--r-- | upgrade.c | 37 | ||||
| -rw-r--r-- | utils.c | 10 | ||||
| -rw-r--r-- | webfinger.c | 2 | ||||
| -rw-r--r-- | xs.h | 34 | ||||
| -rw-r--r-- | xs_curl.h | 4 | ||||
| -rw-r--r-- | xs_fcgi.h | 4 | ||||
| -rw-r--r-- | xs_httpd.h | 4 | ||||
| -rw-r--r-- | xs_json.h | 4 | ||||
| -rw-r--r-- | xs_regex.h | 4 | ||||
| -rw-r--r-- | xs_set.h | 3 | ||||
| -rw-r--r-- | xs_url.h | 2 | ||||
| -rw-r--r-- | xs_version.h | 2 |
20 files changed, 171 insertions, 150 deletions
diff --git a/activitypub.c b/activitypub.c index f4b4eac..6e40a88 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -163,7 +163,7 @@ const char *get_atto(const xs_dict *msg) | |||
| 163 | if (xs_type(actor) == XSTYPE_LIST) { | 163 | if (xs_type(actor) == XSTYPE_LIST) { |
| 164 | const xs_list *p = actor; | 164 | const xs_list *p = actor; |
| 165 | int c = 0; | 165 | int c = 0; |
| 166 | xs_dict *v; | 166 | const xs_dict *v; |
| 167 | actor = NULL; | 167 | actor = NULL; |
| 168 | 168 | ||
| 169 | while (actor == NULL && xs_list_next(p, &v, &c)) { | 169 | while (actor == NULL && xs_list_next(p, &v, &c)) { |
| @@ -192,7 +192,7 @@ xs_list *get_attachments(const xs_dict *msg) | |||
| 192 | /* try first the attachments list */ | 192 | /* try first the attachments list */ |
| 193 | if (!xs_is_null(p = xs_dict_get(msg, "attachment"))) { | 193 | if (!xs_is_null(p = xs_dict_get(msg, "attachment"))) { |
| 194 | xs *attach = NULL; | 194 | xs *attach = NULL; |
| 195 | xs_val *v; | 195 | const xs_val *v; |
| 196 | 196 | ||
| 197 | /* ensure it's a list */ | 197 | /* ensure it's a list */ |
| 198 | if (xs_type(p) == XSTYPE_DICT) { | 198 | if (xs_type(p) == XSTYPE_DICT) { |
| @@ -257,7 +257,7 @@ xs_list *get_attachments(const xs_dict *msg) | |||
| 257 | const char *href = NULL; | 257 | const char *href = NULL; |
| 258 | const char *type = NULL; | 258 | const char *type = NULL; |
| 259 | int c = 0; | 259 | int c = 0; |
| 260 | xs_val *v; | 260 | const xs_val *v; |
| 261 | 261 | ||
| 262 | while (href == NULL && xs_list_next(p, &v, &c)) { | 262 | while (href == NULL && xs_list_next(p, &v, &c)) { |
| 263 | if (xs_type(v) == XSTYPE_DICT) { | 263 | if (xs_type(v) == XSTYPE_DICT) { |
| @@ -271,7 +271,7 @@ xs_list *get_attachments(const xs_dict *msg) | |||
| 271 | strcmp(mtype, "application/x-mpegURL") == 0 && | 271 | strcmp(mtype, "application/x-mpegURL") == 0 && |
| 272 | xs_type(tag) == XSTYPE_LIST) { | 272 | xs_type(tag) == XSTYPE_LIST) { |
| 273 | /* now iterate the tag list, looking for a video URL */ | 273 | /* now iterate the tag list, looking for a video URL */ |
| 274 | xs_dict *d; | 274 | const xs_dict *d; |
| 275 | int c = 0; | 275 | int c = 0; |
| 276 | 276 | ||
| 277 | while (href == NULL && xs_list_next(tag, &d, &c)) { | 277 | while (href == NULL && xs_list_next(tag, &d, &c)) { |
| @@ -482,7 +482,7 @@ xs_list *recipient_list(snac *snac, const xs_dict *msg, int expand_public) | |||
| 482 | const xs_list *lists[] = { to, cc, NULL }; | 482 | const xs_list *lists[] = { to, cc, NULL }; |
| 483 | for (n = 0; lists[n]; n++) { | 483 | for (n = 0; lists[n]; n++) { |
| 484 | xs_list *l = (xs_list *)lists[n]; | 484 | xs_list *l = (xs_list *)lists[n]; |
| 485 | char *v; | 485 | const char *v; |
| 486 | xs *tl = NULL; | 486 | xs *tl = NULL; |
| 487 | 487 | ||
| 488 | /* if it's a string, create a list with only one element */ | 488 | /* if it's a string, create a list with only one element */ |
| @@ -497,7 +497,7 @@ xs_list *recipient_list(snac *snac, const xs_dict *msg, int expand_public) | |||
| 497 | if (expand_public && strcmp(v, public_address) == 0) { | 497 | if (expand_public && strcmp(v, public_address) == 0) { |
| 498 | /* iterate the followers and add them */ | 498 | /* iterate the followers and add them */ |
| 499 | xs *fwers = follower_list(snac); | 499 | xs *fwers = follower_list(snac); |
| 500 | char *actor; | 500 | const char *actor; |
| 501 | 501 | ||
| 502 | char *p = fwers; | 502 | char *p = fwers; |
| 503 | while (xs_list_iter(&p, &actor)) | 503 | while (xs_list_iter(&p, &actor)) |
| @@ -628,7 +628,7 @@ int is_msg_for_me(snac *snac, const xs_dict *c_msg) | |||
| 628 | const xs_dict *msg = xs_dict_get(c_msg, "object"); | 628 | const xs_dict *msg = xs_dict_get(c_msg, "object"); |
| 629 | xs *rcpts = recipient_list(snac, msg, 0); | 629 | xs *rcpts = recipient_list(snac, msg, 0); |
| 630 | xs_list *p = rcpts; | 630 | xs_list *p = rcpts; |
| 631 | xs_str *v; | 631 | const xs_str *v; |
| 632 | 632 | ||
| 633 | xs *actor_followers = NULL; | 633 | xs *actor_followers = NULL; |
| 634 | 634 | ||
| @@ -693,7 +693,7 @@ xs_str *process_tags(snac *snac, const char *content, xs_list **tag) | |||
| 693 | xs_list *tl = *tag; | 693 | xs_list *tl = *tag; |
| 694 | xs *split; | 694 | xs *split; |
| 695 | xs_list *p; | 695 | xs_list *p; |
| 696 | xs_val *v; | 696 | const xs_val *v; |
| 697 | int n = 0; | 697 | int n = 0; |
| 698 | 698 | ||
| 699 | /* create a default server for incomplete mentions */ | 699 | /* create a default server for incomplete mentions */ |
| @@ -1205,8 +1205,8 @@ xs_dict *msg_actor(snac *snac) | |||
| 1205 | const xs_dict *metadata = xs_dict_get(snac->config, "metadata"); | 1205 | const xs_dict *metadata = xs_dict_get(snac->config, "metadata"); |
| 1206 | if (xs_type(metadata) == XSTYPE_DICT) { | 1206 | if (xs_type(metadata) == XSTYPE_DICT) { |
| 1207 | xs *attach = xs_list_new(); | 1207 | xs *attach = xs_list_new(); |
| 1208 | xs_str *k; | 1208 | const xs_str *k; |
| 1209 | xs_str *v; | 1209 | const xs_str *v; |
| 1210 | 1210 | ||
| 1211 | int c = 0; | 1211 | int c = 0; |
| 1212 | while (xs_dict_next(metadata, &k, &v, &c)) { | 1212 | while (xs_dict_next(metadata, &k, &v, &c)) { |
| @@ -1351,7 +1351,7 @@ xs_dict *msg_note(snac *snac, const xs_str *content, const xs_val *rcpts, | |||
| 1351 | xs *atls = xs_list_new(); | 1351 | xs *atls = xs_list_new(); |
| 1352 | xs_dict *msg = msg_base(snac, "Note", id, NULL, "@now", NULL); | 1352 | xs_dict *msg = msg_base(snac, "Note", id, NULL, "@now", NULL); |
| 1353 | xs_list *p; | 1353 | xs_list *p; |
| 1354 | xs_val *v; | 1354 | const xs_val *v; |
| 1355 | 1355 | ||
| 1356 | if (rcpts == NULL) | 1356 | if (rcpts == NULL) |
| 1357 | to = xs_list_new(); | 1357 | to = xs_list_new(); |
| @@ -1528,7 +1528,7 @@ xs_dict *msg_question(snac *user, const char *content, xs_list *attach, | |||
| 1528 | 1528 | ||
| 1529 | xs *o = xs_list_new(); | 1529 | xs *o = xs_list_new(); |
| 1530 | xs_list *p = (xs_list *)opts; | 1530 | xs_list *p = (xs_list *)opts; |
| 1531 | xs_str *v; | 1531 | const xs_str *v; |
| 1532 | xs *replies = xs_json_loads("{\"type\":\"Collection\",\"totalItems\":0}"); | 1532 | xs *replies = xs_json_loads("{\"type\":\"Collection\",\"totalItems\":0}"); |
| 1533 | 1533 | ||
| 1534 | xs_set_init(&seen); | 1534 | xs_set_init(&seen); |
| @@ -1576,7 +1576,7 @@ int update_question(snac *user, const char *id) | |||
| 1576 | xs *lopts = xs_list_new(); | 1576 | xs *lopts = xs_list_new(); |
| 1577 | const xs_list *opts; | 1577 | const xs_list *opts; |
| 1578 | xs_list *p; | 1578 | xs_list *p; |
| 1579 | xs_val *v; | 1579 | const xs_val *v; |
| 1580 | 1580 | ||
| 1581 | /* get the object */ | 1581 | /* get the object */ |
| 1582 | if (!valid_status(object_get(id, &msg))) | 1582 | if (!valid_status(object_get(id, &msg))) |
| @@ -2190,7 +2190,7 @@ void process_user_queue_item(snac *snac, xs_dict *q_item) | |||
| 2190 | xs *rcpts = recipient_list(snac, msg, 1); | 2190 | xs *rcpts = recipient_list(snac, msg, 1); |
| 2191 | xs_set inboxes; | 2191 | xs_set inboxes; |
| 2192 | xs_list *p; | 2192 | xs_list *p; |
| 2193 | xs_str *actor; | 2193 | const xs_str *actor; |
| 2194 | 2194 | ||
| 2195 | xs_set_init(&inboxes); | 2195 | xs_set_init(&inboxes); |
| 2196 | 2196 | ||
| @@ -2212,7 +2212,7 @@ void process_user_queue_item(snac *snac, xs_dict *q_item) | |||
| 2212 | if (is_msg_public(msg)) { | 2212 | if (is_msg_public(msg)) { |
| 2213 | if (xs_type(xs_dict_get(srv_config, "disable_inbox_collection")) != XSTYPE_TRUE) { | 2213 | if (xs_type(xs_dict_get(srv_config, "disable_inbox_collection")) != XSTYPE_TRUE) { |
| 2214 | xs *shibx = inbox_list(); | 2214 | xs *shibx = inbox_list(); |
| 2215 | xs_str *inbox; | 2215 | const xs_str *inbox; |
| 2216 | 2216 | ||
| 2217 | p = shibx; | 2217 | p = shibx; |
| 2218 | while (xs_list_iter(&p, &inbox)) { | 2218 | while (xs_list_iter(&p, &inbox)) { |
| @@ -2304,7 +2304,7 @@ int process_user_queue(snac *snac) | |||
| 2304 | xs *list = user_queue(snac); | 2304 | xs *list = user_queue(snac); |
| 2305 | 2305 | ||
| 2306 | xs_list *p = list; | 2306 | xs_list *p = list; |
| 2307 | xs_str *fn; | 2307 | const xs_str *fn; |
| 2308 | 2308 | ||
| 2309 | while (xs_list_iter(&p, &fn)) { | 2309 | while (xs_list_iter(&p, &fn)) { |
| 2310 | xs *q_item = dequeue(fn); | 2310 | xs *q_item = dequeue(fn); |
| @@ -2511,7 +2511,7 @@ void process_queue_item(xs_dict *q_item) | |||
| 2511 | 2511 | ||
| 2512 | xs *users = user_list(); | 2512 | xs *users = user_list(); |
| 2513 | xs_list *p = users; | 2513 | xs_list *p = users; |
| 2514 | char *v; | 2514 | const char *v; |
| 2515 | int cnt = 0; | 2515 | int cnt = 0; |
| 2516 | 2516 | ||
| 2517 | while (xs_list_iter(&p, &v)) { | 2517 | while (xs_list_iter(&p, &v)) { |
| @@ -2554,7 +2554,7 @@ int process_queue(void) | |||
| 2554 | xs *list = queue(); | 2554 | xs *list = queue(); |
| 2555 | 2555 | ||
| 2556 | xs_list *p = list; | 2556 | xs_list *p = list; |
| 2557 | xs_str *fn; | 2557 | const xs_str *fn; |
| 2558 | 2558 | ||
| 2559 | while (xs_list_iter(&p, &fn)) { | 2559 | while (xs_list_iter(&p, &fn)) { |
| 2560 | xs *q_item = dequeue(fn); | 2560 | xs *q_item = dequeue(fn); |
| @@ -2616,7 +2616,8 @@ int activitypub_get_handler(const xs_dict *req, const char *q_path, | |||
| 2616 | xs *elems = timeline_simple_list(&snac, "public", 0, 20); | 2616 | xs *elems = timeline_simple_list(&snac, "public", 0, 20); |
| 2617 | xs *list = xs_list_new(); | 2617 | xs *list = xs_list_new(); |
| 2618 | msg = msg_collection(&snac, id); | 2618 | msg = msg_collection(&snac, id); |
| 2619 | char *p, *v; | 2619 | char *p; |
| 2620 | const char *v; | ||
| 2620 | 2621 | ||
| 2621 | p = elems; | 2622 | p = elems; |
| 2622 | while (xs_list_iter(&p, &v)) { | 2623 | while (xs_list_iter(&p, &v)) { |
| @@ -193,7 +193,7 @@ int user_open(snac *user, const char *uid) | |||
| 193 | xs *lcuid = xs_tolower_i(xs_dup(uid)); | 193 | xs *lcuid = xs_tolower_i(xs_dup(uid)); |
| 194 | xs *ulist = user_list(); | 194 | xs *ulist = user_list(); |
| 195 | xs_list *p = ulist; | 195 | xs_list *p = ulist; |
| 196 | xs_str *v; | 196 | const xs_str *v; |
| 197 | 197 | ||
| 198 | while (xs_list_iter(&p, &v)) { | 198 | while (xs_list_iter(&p, &v)) { |
| 199 | xs *v2 = xs_tolower_i(xs_dup(v)); | 199 | xs *v2 = xs_tolower_i(xs_dup(v)); |
| @@ -289,7 +289,7 @@ int user_open_by_md5(snac *snac, const char *md5) | |||
| 289 | { | 289 | { |
| 290 | xs *ulist = user_list(); | 290 | xs *ulist = user_list(); |
| 291 | xs_list *p = ulist; | 291 | xs_list *p = ulist; |
| 292 | xs_str *v; | 292 | const xs_str *v; |
| 293 | 293 | ||
| 294 | while (xs_list_iter(&p, &v)) { | 294 | while (xs_list_iter(&p, &v)) { |
| 295 | user_open(snac, v); | 295 | user_open(snac, v); |
| @@ -772,7 +772,8 @@ int object_del_by_md5(const char *md5) | |||
| 772 | xs *spec = xs_dup(fn); | 772 | xs *spec = xs_dup(fn); |
| 773 | spec = xs_replace_i(spec, ".json", "*.idx"); | 773 | spec = xs_replace_i(spec, ".json", "*.idx"); |
| 774 | xs *files = xs_glob(spec, 0, 0); | 774 | xs *files = xs_glob(spec, 0, 0); |
| 775 | char *p, *v; | 775 | char *p; |
| 776 | const char *v; | ||
| 776 | 777 | ||
| 777 | p = files; | 778 | p = files; |
| 778 | while (xs_list_iter(&p, &v)) { | 779 | while (xs_list_iter(&p, &v)) { |
| @@ -1033,7 +1034,8 @@ xs_list *follower_list(snac *snac) | |||
| 1033 | { | 1034 | { |
| 1034 | xs *list = object_user_cache_list(snac, "followers", XS_ALL, 0); | 1035 | xs *list = object_user_cache_list(snac, "followers", XS_ALL, 0); |
| 1035 | xs_list *fwers = xs_list_new(); | 1036 | xs_list *fwers = xs_list_new(); |
| 1036 | char *p, *v; | 1037 | char *p; |
| 1038 | const char *v; | ||
| 1037 | 1039 | ||
| 1038 | /* resolve the list of md5 to be a list of actors */ | 1040 | /* resolve the list of md5 to be a list of actors */ |
| 1039 | p = list; | 1041 | p = list; |
| @@ -1196,7 +1198,7 @@ xs_list *timeline_top_level(snac *snac, const xs_list *list) | |||
| 1196 | /* returns the top level md5 entries from this index */ | 1198 | /* returns the top level md5 entries from this index */ |
| 1197 | { | 1199 | { |
| 1198 | xs_set seen; | 1200 | xs_set seen; |
| 1199 | xs_str *v; | 1201 | const xs_str *v; |
| 1200 | 1202 | ||
| 1201 | xs_set_init(&seen); | 1203 | xs_set_init(&seen); |
| 1202 | 1204 | ||
| @@ -1367,7 +1369,7 @@ xs_list *following_list(snac *snac) | |||
| 1367 | xs *spec = xs_fmt("%s/following/" "*.json", snac->basedir); | 1369 | xs *spec = xs_fmt("%s/following/" "*.json", snac->basedir); |
| 1368 | xs *glist = xs_glob(spec, 0, 0); | 1370 | xs *glist = xs_glob(spec, 0, 0); |
| 1369 | xs_list *p; | 1371 | xs_list *p; |
| 1370 | xs_str *v; | 1372 | const xs_str *v; |
| 1371 | xs_list *list = xs_list_new(); | 1373 | xs_list *list = xs_list_new(); |
| 1372 | 1374 | ||
| 1373 | /* iterate the list of files */ | 1375 | /* iterate the list of files */ |
| @@ -1537,7 +1539,8 @@ void hide(snac *snac, const char *id) | |||
| 1537 | 1539 | ||
| 1538 | /* hide all the children */ | 1540 | /* hide all the children */ |
| 1539 | xs *chld = object_children(id); | 1541 | xs *chld = object_children(id); |
| 1540 | char *p, *v; | 1542 | char *p; |
| 1543 | const char *v; | ||
| 1541 | 1544 | ||
| 1542 | p = chld; | 1545 | p = chld; |
| 1543 | while (xs_list_iter(&p, &v)) { | 1546 | while (xs_list_iter(&p, &v)) { |
| @@ -1694,7 +1697,7 @@ void tag_index(const char *id, const xs_dict *obj) | |||
| 1694 | 1697 | ||
| 1695 | mkdirx(g_tag_dir); | 1698 | mkdirx(g_tag_dir); |
| 1696 | 1699 | ||
| 1697 | xs_dict *v; | 1700 | const xs_dict *v; |
| 1698 | int ct = 0; | 1701 | int ct = 0; |
| 1699 | while (xs_list_next(tags, &v, &ct)) { | 1702 | while (xs_list_next(tags, &v, &ct)) { |
| 1700 | const char *type = xs_dict_get(v, "type"); | 1703 | const char *type = xs_dict_get(v, "type"); |
| @@ -1758,7 +1761,7 @@ xs_val *list_maint(snac *user, const char *list, int op) | |||
| 1758 | xs *spec = xs_fmt("%s/list/" "*.id", user->basedir); | 1761 | xs *spec = xs_fmt("%s/list/" "*.id", user->basedir); |
| 1759 | xs *ls = xs_glob(spec, 0, 0); | 1762 | xs *ls = xs_glob(spec, 0, 0); |
| 1760 | int c = 0; | 1763 | int c = 0; |
| 1761 | char *v; | 1764 | const char *v; |
| 1762 | 1765 | ||
| 1763 | l = xs_list_new(); | 1766 | l = xs_list_new(); |
| 1764 | 1767 | ||
| @@ -1784,7 +1787,7 @@ xs_val *list_maint(snac *user, const char *list, int op) | |||
| 1784 | { | 1787 | { |
| 1785 | xs *lol = list_maint(user, NULL, 0); | 1788 | xs *lol = list_maint(user, NULL, 0); |
| 1786 | int c = 0; | 1789 | int c = 0; |
| 1787 | xs_list *v; | 1790 | const xs_list *v; |
| 1788 | int add = 1; | 1791 | int add = 1; |
| 1789 | 1792 | ||
| 1790 | /* check if this list name already exists */ | 1793 | /* check if this list name already exists */ |
| @@ -1925,7 +1928,7 @@ void list_distribute(snac *user, const char *who, const xs_dict *post) | |||
| 1925 | xs *spec = xs_fmt("%s/list/" "*.lst", user->basedir); | 1928 | xs *spec = xs_fmt("%s/list/" "*.lst", user->basedir); |
| 1926 | xs *ls = xs_glob(spec, 0, 0); | 1929 | xs *ls = xs_glob(spec, 0, 0); |
| 1927 | int c = 0; | 1930 | int c = 0; |
| 1928 | char *v; | 1931 | const char *v; |
| 1929 | 1932 | ||
| 1930 | while (xs_list_next(ls, &v, &c)) { | 1933 | while (xs_list_next(ls, &v, &c)) { |
| 1931 | /* is the actor in this list? */ | 1934 | /* is the actor in this list? */ |
| @@ -2183,7 +2186,7 @@ xs_list *inbox_list(void) | |||
| 2183 | xs *spec = xs_fmt("%s/inbox/" "*", srv_basedir); | 2186 | xs *spec = xs_fmt("%s/inbox/" "*", srv_basedir); |
| 2184 | xs *files = xs_glob(spec, 0, 0); | 2187 | xs *files = xs_glob(spec, 0, 0); |
| 2185 | xs_list *p = files; | 2188 | xs_list *p = files; |
| 2186 | xs_val *v; | 2189 | const xs_val *v; |
| 2187 | 2190 | ||
| 2188 | while (xs_list_iter(&p, &v)) { | 2191 | while (xs_list_iter(&p, &v)) { |
| 2189 | FILE *f; | 2192 | FILE *f; |
| @@ -2329,8 +2332,8 @@ xs_list *content_search(snac *user, const char *regex, | |||
| 2329 | 2332 | ||
| 2330 | /* iterate all timelines simultaneously */ | 2333 | /* iterate all timelines simultaneously */ |
| 2331 | xs_list *tls[3] = {0}; | 2334 | xs_list *tls[3] = {0}; |
| 2332 | char *md5s[3] = {0}; | 2335 | const char *md5s[3] = {0}; |
| 2333 | int c[3] = {0}; | 2336 | int c[3] = {0}; |
| 2334 | 2337 | ||
| 2335 | tls[0] = timeline_simple_list(user, "public", 0, XS_ALL); /* public */ | 2338 | tls[0] = timeline_simple_list(user, "public", 0, XS_ALL); /* public */ |
| 2336 | tls[1] = timeline_instance_list(0, XS_ALL); /* instance */ | 2339 | tls[1] = timeline_instance_list(0, XS_ALL); /* instance */ |
| @@ -2368,7 +2371,7 @@ xs_list *content_search(snac *user, const char *regex, | |||
| 2368 | if (newest == -1) | 2371 | if (newest == -1) |
| 2369 | break; | 2372 | break; |
| 2370 | 2373 | ||
| 2371 | char *md5 = md5s[newest]; | 2374 | const char *md5 = md5s[newest]; |
| 2372 | 2375 | ||
| 2373 | /* advance the chosen timeline */ | 2376 | /* advance the chosen timeline */ |
| 2374 | if (!xs_list_next(tls[newest], &md5s[newest], &c[newest])) | 2377 | if (!xs_list_next(tls[newest], &md5s[newest], &c[newest])) |
| @@ -2534,7 +2537,7 @@ xs_list *notify_list(snac *snac, int skip, int show) | |||
| 2534 | xs *spec = xs_fmt("%s/notify/" "*.json", snac->basedir); | 2537 | xs *spec = xs_fmt("%s/notify/" "*.json", snac->basedir); |
| 2535 | xs *lst = xs_glob(spec, 1, 0); | 2538 | xs *lst = xs_glob(spec, 1, 0); |
| 2536 | xs_list *p = lst; | 2539 | xs_list *p = lst; |
| 2537 | char *v; | 2540 | const char *v; |
| 2538 | 2541 | ||
| 2539 | while (xs_list_iter(&p, &v)) { | 2542 | while (xs_list_iter(&p, &v)) { |
| 2540 | char *p = strrchr(v, '.'); | 2543 | char *p = strrchr(v, '.'); |
| @@ -2562,7 +2565,7 @@ int notify_new_num(snac *snac) | |||
| 2562 | int cnt = 0; | 2565 | int cnt = 0; |
| 2563 | 2566 | ||
| 2564 | xs_list *p = lst; | 2567 | xs_list *p = lst; |
| 2565 | xs_str *v; | 2568 | const xs_str *v; |
| 2566 | 2569 | ||
| 2567 | while (xs_list_iter(&p, &v)) { | 2570 | while (xs_list_iter(&p, &v)) { |
| 2568 | xs *id = xs_strip_i(xs_dup(v)); | 2571 | xs *id = xs_strip_i(xs_dup(v)); |
| @@ -2584,7 +2587,7 @@ void notify_clear(snac *snac) | |||
| 2584 | xs *spec = xs_fmt("%s/notify/" "*", snac->basedir); | 2587 | xs *spec = xs_fmt("%s/notify/" "*", snac->basedir); |
| 2585 | xs *lst = xs_glob(spec, 0, 0); | 2588 | xs *lst = xs_glob(spec, 0, 0); |
| 2586 | xs_list *p = lst; | 2589 | xs_list *p = lst; |
| 2587 | xs_str *v; | 2590 | const xs_str *v; |
| 2588 | 2591 | ||
| 2589 | while (xs_list_iter(&p, &v)) | 2592 | while (xs_list_iter(&p, &v)) |
| 2590 | unlink(v); | 2593 | unlink(v); |
| @@ -2842,7 +2845,7 @@ int was_question_voted(snac *user, const char *id) | |||
| 2842 | xs *children = object_children(id); | 2845 | xs *children = object_children(id); |
| 2843 | int voted = 0; | 2846 | int voted = 0; |
| 2844 | xs_list *p; | 2847 | xs_list *p; |
| 2845 | xs_str *md5; | 2848 | const xs_str *md5; |
| 2846 | 2849 | ||
| 2847 | p = children; | 2850 | p = children; |
| 2848 | while (xs_list_iter(&p, &md5)) { | 2851 | while (xs_list_iter(&p, &md5)) { |
| @@ -2869,7 +2872,7 @@ xs_list *user_queue(snac *snac) | |||
| 2869 | xs_list *list = xs_list_new(); | 2872 | xs_list *list = xs_list_new(); |
| 2870 | time_t t = time(NULL); | 2873 | time_t t = time(NULL); |
| 2871 | xs_list *p; | 2874 | xs_list *p; |
| 2872 | xs_val *v; | 2875 | const xs_val *v; |
| 2873 | 2876 | ||
| 2874 | xs *fns = xs_glob(spec, 0, 0); | 2877 | xs *fns = xs_glob(spec, 0, 0); |
| 2875 | 2878 | ||
| @@ -2898,7 +2901,7 @@ xs_list *queue(void) | |||
| 2898 | xs_list *list = xs_list_new(); | 2901 | xs_list *list = xs_list_new(); |
| 2899 | time_t t = time(NULL); | 2902 | time_t t = time(NULL); |
| 2900 | xs_list *p; | 2903 | xs_list *p; |
| 2901 | xs_val *v; | 2904 | const xs_val *v; |
| 2902 | 2905 | ||
| 2903 | xs *fns = xs_glob(spec, 0, 0); | 2906 | xs *fns = xs_glob(spec, 0, 0); |
| 2904 | 2907 | ||
| @@ -2974,7 +2977,7 @@ static void _purge_dir(const char *dir, int days) | |||
| 2974 | xs *spec = xs_fmt("%s/" "*", dir); | 2977 | xs *spec = xs_fmt("%s/" "*", dir); |
| 2975 | xs *list = xs_glob(spec, 0, 0); | 2978 | xs *list = xs_glob(spec, 0, 0); |
| 2976 | xs_list *p; | 2979 | xs_list *p; |
| 2977 | xs_str *v; | 2980 | const xs_str *v; |
| 2978 | 2981 | ||
| 2979 | p = list; | 2982 | p = list; |
| 2980 | while (xs_list_iter(&p, &v)) | 2983 | while (xs_list_iter(&p, &v)) |
| @@ -3000,7 +3003,7 @@ void purge_server(void) | |||
| 3000 | xs *spec = xs_fmt("%s/object/??", srv_basedir); | 3003 | xs *spec = xs_fmt("%s/object/??", srv_basedir); |
| 3001 | xs *dirs = xs_glob(spec, 0, 0); | 3004 | xs *dirs = xs_glob(spec, 0, 0); |
| 3002 | xs_list *p; | 3005 | xs_list *p; |
| 3003 | xs_str *v; | 3006 | const xs_str *v; |
| 3004 | int cnt = 0; | 3007 | int cnt = 0; |
| 3005 | int icnt = 0; | 3008 | int icnt = 0; |
| 3006 | 3009 | ||
| @@ -3009,7 +3012,7 @@ void purge_server(void) | |||
| 3009 | p = dirs; | 3012 | p = dirs; |
| 3010 | while (xs_list_iter(&p, &v)) { | 3013 | while (xs_list_iter(&p, &v)) { |
| 3011 | xs_list *p2; | 3014 | xs_list *p2; |
| 3012 | xs_str *v2; | 3015 | const xs_str *v2; |
| 3013 | 3016 | ||
| 3014 | { | 3017 | { |
| 3015 | xs *spec2 = xs_fmt("%s/" "*.json", v); | 3018 | xs *spec2 = xs_fmt("%s/" "*.json", v); |
| @@ -3088,7 +3091,7 @@ void purge_server(void) | |||
| 3088 | xs *spec2 = xs_fmt("%s/" "*.idx", v); | 3091 | xs *spec2 = xs_fmt("%s/" "*.idx", v); |
| 3089 | xs *files = xs_glob(spec2, 0, 0); | 3092 | xs *files = xs_glob(spec2, 0, 0); |
| 3090 | xs_list *p2; | 3093 | xs_list *p2; |
| 3091 | xs_str *v2; | 3094 | const xs_str *v2; |
| 3092 | 3095 | ||
| 3093 | p2 = files; | 3096 | p2 = files; |
| 3094 | while (xs_list_iter(&p2, &v2)) { | 3097 | while (xs_list_iter(&p2, &v2)) { |
| @@ -3152,7 +3155,7 @@ void purge_user(snac *snac) | |||
| 3152 | xs *spec = xs_fmt("%s/list/" "*.idx", snac->basedir); | 3155 | xs *spec = xs_fmt("%s/list/" "*.idx", snac->basedir); |
| 3153 | xs *lol = xs_glob(spec, 0, 0); | 3156 | xs *lol = xs_glob(spec, 0, 0); |
| 3154 | int c = 0; | 3157 | int c = 0; |
| 3155 | char *v; | 3158 | const char *v; |
| 3156 | 3159 | ||
| 3157 | while (xs_list_next(lol, &v, &c)) { | 3160 | while (xs_list_next(lol, &v, &c)) { |
| 3158 | int gc = index_gc(v); | 3161 | int gc = index_gc(v); |
| @@ -3170,7 +3173,8 @@ void purge_all(void) | |||
| 3170 | { | 3173 | { |
| 3171 | snac snac; | 3174 | snac snac; |
| 3172 | xs *list = user_list(); | 3175 | xs *list = user_list(); |
| 3173 | char *p, *uid; | 3176 | char *p; |
| 3177 | const char *uid; | ||
| 3174 | 3178 | ||
| 3175 | p = list; | 3179 | p = list; |
| 3176 | while (xs_list_iter(&p, &uid)) { | 3180 | while (xs_list_iter(&p, &uid)) { |
| @@ -82,7 +82,8 @@ static xs_str *format_line(const char *line, xs_list **attach) | |||
| 82 | /* formats a line */ | 82 | /* formats a line */ |
| 83 | { | 83 | { |
| 84 | xs_str *s = xs_str_new(NULL); | 84 | xs_str *s = xs_str_new(NULL); |
| 85 | char *p, *v; | 85 | char *p; |
| 86 | const char *v; | ||
| 86 | 87 | ||
| 87 | /* split by markup */ | 88 | /* split by markup */ |
| 88 | xs *sm = xs_regex_split(line, | 89 | xs *sm = xs_regex_split(line, |
| @@ -155,7 +156,8 @@ xs_str *not_really_markdown(const char *content, xs_list **attach, xs_list **tag | |||
| 155 | int in_pre = 0; | 156 | int in_pre = 0; |
| 156 | int in_blq = 0; | 157 | int in_blq = 0; |
| 157 | xs *list; | 158 | xs *list; |
| 158 | char *p, *v; | 159 | char *p; |
| 160 | const char *v; | ||
| 159 | 161 | ||
| 160 | /* work by lines */ | 162 | /* work by lines */ |
| 161 | list = xs_split(content, "\n"); | 163 | list = xs_split(content, "\n"); |
| @@ -234,7 +236,7 @@ xs_str *not_really_markdown(const char *content, xs_list **attach, xs_list **tag | |||
| 234 | /* traditional emoticons */ | 236 | /* traditional emoticons */ |
| 235 | xs *d = emojis(); | 237 | xs *d = emojis(); |
| 236 | int c = 0; | 238 | int c = 0; |
| 237 | char *k, *v; | 239 | const char *k, *v; |
| 238 | 240 | ||
| 239 | while (xs_dict_next(d, &k, &v, &c)) { | 241 | while (xs_dict_next(d, &k, &v, &c)) { |
| 240 | const char *t = NULL; | 242 | const char *t = NULL; |
| @@ -280,7 +282,8 @@ xs_str *sanitize(const char *content) | |||
| 280 | xs_str *s = xs_str_new(NULL); | 282 | xs_str *s = xs_str_new(NULL); |
| 281 | xs *sl; | 283 | xs *sl; |
| 282 | int n = 0; | 284 | int n = 0; |
| 283 | char *p, *v; | 285 | char *p; |
| 286 | const char *v; | ||
| 284 | 287 | ||
| 285 | sl = xs_regex_split(content, "</?[^>]+>"); | 288 | sl = xs_regex_split(content, "</?[^>]+>"); |
| 286 | 289 | ||
| @@ -57,7 +57,7 @@ xs_str *replace_shortnames(xs_str *s, const xs_list *tag, int ems) | |||
| 57 | 57 | ||
| 58 | xs *style = xs_fmt("height: %dem; width: %dem; vertical-align: middle;", ems, ems); | 58 | xs *style = xs_fmt("height: %dem; width: %dem; vertical-align: middle;", ems, ems); |
| 59 | 59 | ||
| 60 | char *v; | 60 | const char *v; |
| 61 | int c = 0; | 61 | int c = 0; |
| 62 | 62 | ||
| 63 | while (xs_list_next(tag_list, &v, &c)) { | 63 | while (xs_list_next(tag_list, &v, &c)) { |
| @@ -461,7 +461,7 @@ static xs_html *html_base_head(void) | |||
| 461 | xs *f; | 461 | xs *f; |
| 462 | f = xs_fmt("%s/favicon.ico", srv_baseurl); | 462 | f = xs_fmt("%s/favicon.ico", srv_baseurl); |
| 463 | const xs_list *p = xs_dict_get(srv_config, "cssurls"); | 463 | const xs_list *p = xs_dict_get(srv_config, "cssurls"); |
| 464 | char *v; | 464 | const char *v; |
| 465 | int c = 0; | 465 | int c = 0; |
| 466 | 466 | ||
| 467 | while (xs_list_next(p, &v, &c)) { | 467 | while (xs_list_next(p, &v, &c)) { |
| @@ -801,8 +801,8 @@ static xs_html *html_user_body(snac *user, int read_only) | |||
| 801 | 801 | ||
| 802 | const xs_dict *metadata = xs_dict_get(user->config, "metadata"); | 802 | const xs_dict *metadata = xs_dict_get(user->config, "metadata"); |
| 803 | if (xs_type(metadata) == XSTYPE_DICT) { | 803 | if (xs_type(metadata) == XSTYPE_DICT) { |
| 804 | xs_str *k; | 804 | const xs_str *k; |
| 805 | xs_str *v; | 805 | const xs_str *v; |
| 806 | 806 | ||
| 807 | xs_dict *val_links = user->links; | 807 | xs_dict *val_links = user->links; |
| 808 | if (xs_is_null(val_links)) | 808 | if (xs_is_null(val_links)) |
| @@ -974,8 +974,8 @@ xs_html *html_top_controls(snac *snac) | |||
| 974 | 974 | ||
| 975 | xs *metadata = xs_str_new(NULL); | 975 | xs *metadata = xs_str_new(NULL); |
| 976 | const xs_dict *md = xs_dict_get(snac->config, "metadata"); | 976 | const xs_dict *md = xs_dict_get(snac->config, "metadata"); |
| 977 | xs_str *k; | 977 | const xs_str *k; |
| 978 | xs_str *v; | 978 | const xs_str *v; |
| 979 | 979 | ||
| 980 | int c = 0; | 980 | int c = 0; |
| 981 | while (xs_dict_next(md, &k, &v, &c)) { | 981 | while (xs_dict_next(md, &k, &v, &c)) { |
| @@ -1161,7 +1161,7 @@ xs_str *build_mentions(snac *snac, const xs_dict *msg) | |||
| 1161 | { | 1161 | { |
| 1162 | xs_str *s = xs_str_new(NULL); | 1162 | xs_str *s = xs_str_new(NULL); |
| 1163 | const char *list = xs_dict_get(msg, "tag"); | 1163 | const char *list = xs_dict_get(msg, "tag"); |
| 1164 | char *v; | 1164 | const char *v; |
| 1165 | int c = 0; | 1165 | int c = 0; |
| 1166 | 1166 | ||
| 1167 | while (xs_list_next(list, &v, &c)) { | 1167 | while (xs_list_next(list, &v, &c)) { |
| @@ -1372,7 +1372,7 @@ xs_html *html_entry_controls(snac *snac, const char *actor, | |||
| 1372 | 1372 | ||
| 1373 | 1373 | ||
| 1374 | xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | 1374 | xs_html *html_entry(snac *user, xs_dict *msg, int read_only, |
| 1375 | int level, char *md5, int hide_children) | 1375 | int level, const char *md5, int hide_children) |
| 1376 | { | 1376 | { |
| 1377 | const char *id = xs_dict_get(msg, "id"); | 1377 | const char *id = xs_dict_get(msg, "id"); |
| 1378 | const char *type = xs_dict_get(msg, "type"); | 1378 | const char *type = xs_dict_get(msg, "type"); |
| @@ -1670,7 +1670,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 1670 | const xs_list *oo = xs_dict_get(msg, "oneOf"); | 1670 | const xs_list *oo = xs_dict_get(msg, "oneOf"); |
| 1671 | const xs_list *ao = xs_dict_get(msg, "anyOf"); | 1671 | const xs_list *ao = xs_dict_get(msg, "anyOf"); |
| 1672 | const xs_list *p; | 1672 | const xs_list *p; |
| 1673 | xs_dict *v; | 1673 | const xs_dict *v; |
| 1674 | int closed = 0; | 1674 | int closed = 0; |
| 1675 | const char *f_closed = NULL; | 1675 | const char *f_closed = NULL; |
| 1676 | 1676 | ||
| @@ -1827,7 +1827,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 1827 | content_attachments); | 1827 | content_attachments); |
| 1828 | 1828 | ||
| 1829 | int c = 0; | 1829 | int c = 0; |
| 1830 | xs_dict *a; | 1830 | const xs_dict *a; |
| 1831 | while (xs_list_next(attach, &a, &c)) { | 1831 | while (xs_list_next(attach, &a, &c)) { |
| 1832 | const char *type = xs_dict_get(a, "type"); | 1832 | const char *type = xs_dict_get(a, "type"); |
| 1833 | const char *href = xs_dict_get(a, "href"); | 1833 | const char *href = xs_dict_get(a, "href"); |
| @@ -1945,7 +1945,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 1945 | } | 1945 | } |
| 1946 | 1946 | ||
| 1947 | xs_list *p = children; | 1947 | xs_list *p = children; |
| 1948 | char *cmd5; | 1948 | const char *cmd5; |
| 1949 | int cnt = 0; | 1949 | int cnt = 0; |
| 1950 | int o_cnt = 0; | 1950 | int o_cnt = 0; |
| 1951 | 1951 | ||
| @@ -2021,7 +2021,7 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only, | |||
| 2021 | /* returns the HTML for the timeline */ | 2021 | /* returns the HTML for the timeline */ |
| 2022 | { | 2022 | { |
| 2023 | xs_list *p = (xs_list *)list; | 2023 | xs_list *p = (xs_list *)list; |
| 2024 | char *v; | 2024 | const char *v; |
| 2025 | double t = ftime(); | 2025 | double t = ftime(); |
| 2026 | 2026 | ||
| 2027 | xs *desc = NULL; | 2027 | xs *desc = NULL; |
| @@ -2130,7 +2130,7 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only, | |||
| 2130 | 2130 | ||
| 2131 | xs *list = history_list(user); | 2131 | xs *list = history_list(user); |
| 2132 | xs_list *p = list; | 2132 | xs_list *p = list; |
| 2133 | char *v; | 2133 | const char *v; |
| 2134 | 2134 | ||
| 2135 | while (xs_list_iter(&p, &v)) { | 2135 | while (xs_list_iter(&p, &v)) { |
| 2136 | xs *fn = xs_replace(v, ".html", ""); | 2136 | xs *fn = xs_replace(v, ".html", ""); |
| @@ -2203,7 +2203,7 @@ xs_html *html_people_list(snac *snac, xs_list *list, char *header, char *t) | |||
| 2203 | xs_html_text("...")))); | 2203 | xs_html_text("...")))); |
| 2204 | 2204 | ||
| 2205 | xs_list *p = list; | 2205 | xs_list *p = list; |
| 2206 | char *actor_id; | 2206 | const char *actor_id; |
| 2207 | 2207 | ||
| 2208 | while (xs_list_iter(&p, &actor_id)) { | 2208 | while (xs_list_iter(&p, &actor_id)) { |
| 2209 | xs *md5 = xs_md5_hex(actor_id, strlen(actor_id)); | 2209 | xs *md5 = xs_md5_hex(actor_id, strlen(actor_id)); |
| @@ -2363,7 +2363,7 @@ xs_str *html_notifications(snac *user, int skip, int show) | |||
| 2363 | xs_html *noti_seen = NULL; | 2363 | xs_html *noti_seen = NULL; |
| 2364 | 2364 | ||
| 2365 | xs_list *p = n_list; | 2365 | xs_list *p = n_list; |
| 2366 | xs_str *v; | 2366 | const xs_str *v; |
| 2367 | while (xs_list_iter(&p, &v)) { | 2367 | while (xs_list_iter(&p, &v)) { |
| 2368 | xs *noti = notify_get(user, v); | 2368 | xs *noti = notify_get(user, v); |
| 2369 | 2369 | ||
| @@ -3232,7 +3232,7 @@ int html_post_handler(const xs_dict *req, const char *q_path, | |||
| 3232 | xs_dict *md = xs_dict_new(); | 3232 | xs_dict *md = xs_dict_new(); |
| 3233 | xs *l = xs_split(v, "\n"); | 3233 | xs *l = xs_split(v, "\n"); |
| 3234 | xs_list *p = l; | 3234 | xs_list *p = l; |
| 3235 | xs_str *kp; | 3235 | const xs_str *kp; |
| 3236 | 3236 | ||
| 3237 | while (xs_list_iter(&p, &kp)) { | 3237 | while (xs_list_iter(&p, &kp)) { |
| 3238 | xs *kpl = xs_split_n(kp, "=", 1); | 3238 | xs *kpl = xs_split_n(kp, "=", 1); |
| @@ -3333,7 +3333,7 @@ int html_post_handler(const xs_dict *req, const char *q_path, | |||
| 3333 | } | 3333 | } |
| 3334 | 3334 | ||
| 3335 | xs_list *p = ls; | 3335 | xs_list *p = ls; |
| 3336 | xs_str *v; | 3336 | const xs_str *v; |
| 3337 | 3337 | ||
| 3338 | while (xs_list_iter(&p, &v)) { | 3338 | while (xs_list_iter(&p, &v)) { |
| 3339 | xs *msg = msg_note(&snac, "", actor, irt, NULL, 1); | 3339 | xs *msg = msg_note(&snac, "", actor, irt, NULL, 1); |
| @@ -3405,7 +3405,7 @@ xs_str *timeline_to_rss(snac *user, const xs_list *timeline, char *title, char * | |||
| 3405 | xs_html_add(rss, channel); | 3405 | xs_html_add(rss, channel); |
| 3406 | 3406 | ||
| 3407 | int c = 0; | 3407 | int c = 0; |
| 3408 | char *v; | 3408 | const char *v; |
| 3409 | 3409 | ||
| 3410 | while (xs_list_next(timeline, &v, &c)) { | 3410 | while (xs_list_next(timeline, &v, &c)) { |
| 3411 | xs *msg = NULL; | 3411 | xs *msg = NULL; |
| @@ -26,7 +26,7 @@ xs_dict *http_signed_request_raw(const char *keyid, const char *seckey, | |||
| 26 | xs *hdrs = NULL; | 26 | xs *hdrs = NULL; |
| 27 | const char *host; | 27 | const char *host; |
| 28 | const char *target; | 28 | const char *target; |
| 29 | char *k, *v; | 29 | const char *k, *v; |
| 30 | xs_dict *response; | 30 | xs_dict *response; |
| 31 | 31 | ||
| 32 | date = xs_str_utctime(0, "%a, %d %b %Y %H:%M:%S GMT"); | 32 | date = xs_str_utctime(0, "%a, %d %b %Y %H:%M:%S GMT"); |
| @@ -144,7 +144,7 @@ int check_signature(const xs_dict *req, xs_str **err) | |||
| 144 | /* extract the values */ | 144 | /* extract the values */ |
| 145 | xs *l = xs_split(sig_hdr, ","); | 145 | xs *l = xs_split(sig_hdr, ","); |
| 146 | int c = 0; | 146 | int c = 0; |
| 147 | xs_val *v; | 147 | const xs_val *v; |
| 148 | 148 | ||
| 149 | while (xs_list_next(l, &v, &c)) { | 149 | while (xs_list_next(l, &v, &c)) { |
| 150 | xs *kv = xs_split_n(v, "=", 1); | 150 | xs *kv = xs_split_n(v, "=", 1); |
| @@ -205,7 +205,7 @@ int check_signature(const xs_dict *req, xs_str **err) | |||
| 205 | { | 205 | { |
| 206 | xs *l = xs_split(headers, " "); | 206 | xs *l = xs_split(headers, " "); |
| 207 | xs_list *p; | 207 | xs_list *p; |
| 208 | xs_val *v; | 208 | const xs_val *v; |
| 209 | 209 | ||
| 210 | p = l; | 210 | p = l; |
| 211 | while (xs_list_iter(&p, &v)) { | 211 | while (xs_list_iter(&p, &v)) { |
| @@ -75,7 +75,7 @@ xs_str *nodeinfo_2_0(void) | |||
| 75 | int n_posts = 0; | 75 | int n_posts = 0; |
| 76 | xs *users = user_list(); | 76 | xs *users = user_list(); |
| 77 | xs_list *p = users; | 77 | xs_list *p = users; |
| 78 | char *v; | 78 | const char *v; |
| 79 | double now = (double)time(NULL); | 79 | double now = (double)time(NULL); |
| 80 | 80 | ||
| 81 | while (xs_list_iter(&p, &v)) { | 81 | while (xs_list_iter(&p, &v)) { |
| @@ -128,7 +128,7 @@ static xs_str *greeting_html(void) | |||
| 128 | const char *host = xs_dict_get(srv_config, "host"); | 128 | const char *host = xs_dict_get(srv_config, "host"); |
| 129 | xs *list = user_list(); | 129 | xs *list = user_list(); |
| 130 | xs_list *p = list; | 130 | xs_list *p = list; |
| 131 | xs_str *uid; | 131 | const xs_str *uid; |
| 132 | 132 | ||
| 133 | xs_html *ul = xs_html_tag("ul", | 133 | xs_html *ul = xs_html_tag("ul", |
| 134 | xs_html_attr("class", "snac-user-list")); | 134 | xs_html_attr("class", "snac-user-list")); |
| @@ -413,7 +413,7 @@ void httpd_connection(FILE *f) | |||
| 413 | /* if there are any additional headers, add them */ | 413 | /* if there are any additional headers, add them */ |
| 414 | const xs_dict *more_headers = xs_dict_get(srv_config, "http_headers"); | 414 | const xs_dict *more_headers = xs_dict_get(srv_config, "http_headers"); |
| 415 | if (xs_type(more_headers) == XSTYPE_DICT) { | 415 | if (xs_type(more_headers) == XSTYPE_DICT) { |
| 416 | char *k, *v; | 416 | const char *k, *v; |
| 417 | int c = 0; | 417 | int c = 0; |
| 418 | while (xs_dict_next(more_headers, &k, &v, &c)) | 418 | while (xs_dict_next(more_headers, &k, &v, &c)) |
| 419 | headers = xs_dict_set(headers, k, v); | 419 | headers = xs_dict_set(headers, k, v); |
| @@ -590,7 +590,8 @@ static void *background_thread(void *arg) | |||
| 590 | 590 | ||
| 591 | { | 591 | { |
| 592 | xs *list = user_list(); | 592 | xs *list = user_list(); |
| 593 | char *p, *uid; | 593 | char *p; |
| 594 | const char *uid; | ||
| 594 | 595 | ||
| 595 | /* process queues for all users */ | 596 | /* process queues for all users */ |
| 596 | p = list; | 597 | p = list; |
| @@ -382,7 +382,7 @@ int main(int argc, char *argv[]) | |||
| 382 | xs *r = content_search(&snac, url, 1, 0, XS_ALL, 10, &to); | 382 | xs *r = content_search(&snac, url, 1, 0, XS_ALL, 10, &to); |
| 383 | 383 | ||
| 384 | int c = 0; | 384 | int c = 0; |
| 385 | char *v; | 385 | const char *v; |
| 386 | 386 | ||
| 387 | /* print results as standalone links */ | 387 | /* print results as standalone links */ |
| 388 | while (xs_list_next(r, &v, &c)) { | 388 | while (xs_list_next(r, &v, &c)) { |
| @@ -599,7 +599,7 @@ xs_dict *mastoapi_account(const xs_dict *actor) | |||
| 599 | const xs_list *p; | 599 | const xs_list *p; |
| 600 | if (!xs_is_null(p = xs_dict_get(actor, "tag"))) { | 600 | if (!xs_is_null(p = xs_dict_get(actor, "tag"))) { |
| 601 | xs *eml = xs_list_new(); | 601 | xs *eml = xs_list_new(); |
| 602 | xs_dict *v; | 602 | const xs_dict *v; |
| 603 | int c = 0; | 603 | int c = 0; |
| 604 | 604 | ||
| 605 | while (xs_list_next(p, &v, &c)) { | 605 | while (xs_list_next(p, &v, &c)) { |
| @@ -637,7 +637,7 @@ xs_dict *mastoapi_account(const xs_dict *actor) | |||
| 637 | 637 | ||
| 638 | xs *fields = xs_list_new(); | 638 | xs *fields = xs_list_new(); |
| 639 | p = xs_dict_get(actor, "attachment"); | 639 | p = xs_dict_get(actor, "attachment"); |
| 640 | xs_dict *v; | 640 | const xs_dict *v; |
| 641 | 641 | ||
| 642 | /* dict of validated links */ | 642 | /* dict of validated links */ |
| 643 | xs_dict *val_links = NULL; | 643 | xs_dict *val_links = NULL; |
| @@ -713,7 +713,7 @@ xs_dict *mastoapi_poll(snac *snac, const xs_dict *msg) | |||
| 713 | xs_dict *poll = xs_dict_new(); | 713 | xs_dict *poll = xs_dict_new(); |
| 714 | xs *mid = mastoapi_id(msg); | 714 | xs *mid = mastoapi_id(msg); |
| 715 | const xs_list *opts = NULL; | 715 | const xs_list *opts = NULL; |
| 716 | xs_val *v; | 716 | const xs_val *v; |
| 717 | int num_votes = 0; | 717 | int num_votes = 0; |
| 718 | xs *options = xs_list_new(); | 718 | xs *options = xs_list_new(); |
| 719 | 719 | ||
| @@ -849,7 +849,7 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg) | |||
| 849 | 849 | ||
| 850 | { | 850 | { |
| 851 | xs_list *p = attach; | 851 | xs_list *p = attach; |
| 852 | xs_dict *v; | 852 | const xs_dict *v; |
| 853 | 853 | ||
| 854 | xs *matt = xs_list_new(); | 854 | xs *matt = xs_list_new(); |
| 855 | 855 | ||
| @@ -898,7 +898,7 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg) | |||
| 898 | tag_list = xs_list_new(); | 898 | tag_list = xs_list_new(); |
| 899 | 899 | ||
| 900 | tag = tag_list; | 900 | tag = tag_list; |
| 901 | xs_dict *v; | 901 | const xs_dict *v; |
| 902 | 902 | ||
| 903 | int c = 0; | 903 | int c = 0; |
| 904 | while (xs_list_next(tag, &v, &c)) { | 904 | while (xs_list_next(tag, &v, &c)) { |
| @@ -1210,8 +1210,8 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1210 | const xs_dict *metadata = xs_dict_get(snac1.config, "metadata"); | 1210 | const xs_dict *metadata = xs_dict_get(snac1.config, "metadata"); |
| 1211 | if (xs_type(metadata) == XSTYPE_DICT) { | 1211 | if (xs_type(metadata) == XSTYPE_DICT) { |
| 1212 | xs *fields = xs_list_new(); | 1212 | xs *fields = xs_list_new(); |
| 1213 | xs_str *k; | 1213 | const xs_str *k; |
| 1214 | xs_str *v; | 1214 | const xs_str *v; |
| 1215 | 1215 | ||
| 1216 | xs_dict *val_links = snac1.links; | 1216 | xs_dict *val_links = snac1.links; |
| 1217 | if (xs_is_null(val_links)) | 1217 | if (xs_is_null(val_links)) |
| @@ -1334,7 +1334,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1334 | xs *wers = follower_list(&snac1); | 1334 | xs *wers = follower_list(&snac1); |
| 1335 | xs *ulst = user_list(); | 1335 | xs *ulst = user_list(); |
| 1336 | xs_list *p; | 1336 | xs_list *p; |
| 1337 | xs_str *v; | 1337 | const xs_str *v; |
| 1338 | xs_set seen; | 1338 | xs_set seen; |
| 1339 | 1339 | ||
| 1340 | xs_set_init(&seen); | 1340 | xs_set_init(&seen); |
| @@ -1410,7 +1410,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1410 | /* the public list of posts of a user */ | 1410 | /* the public list of posts of a user */ |
| 1411 | xs *timeline = timeline_simple_list(&snac2, "public", 0, 256); | 1411 | xs *timeline = timeline_simple_list(&snac2, "public", 0, 256); |
| 1412 | xs_list *p = timeline; | 1412 | xs_list *p = timeline; |
| 1413 | xs_str *v; | 1413 | const xs_str *v; |
| 1414 | 1414 | ||
| 1415 | out = xs_list_new(); | 1415 | out = xs_list_new(); |
| 1416 | 1416 | ||
| @@ -1475,7 +1475,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1475 | 1475 | ||
| 1476 | xs *out = xs_list_new(); | 1476 | xs *out = xs_list_new(); |
| 1477 | xs_list *p = timeline; | 1477 | xs_list *p = timeline; |
| 1478 | xs_str *v; | 1478 | const xs_str *v; |
| 1479 | 1479 | ||
| 1480 | while (xs_list_iter(&p, &v) && cnt < limit) { | 1480 | while (xs_list_iter(&p, &v) && cnt < limit) { |
| 1481 | xs *msg = NULL; | 1481 | xs *msg = NULL; |
| @@ -1579,7 +1579,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1579 | xs *timeline = timeline_instance_list(0, limit); | 1579 | xs *timeline = timeline_instance_list(0, limit); |
| 1580 | xs *out = xs_list_new(); | 1580 | xs *out = xs_list_new(); |
| 1581 | xs_list *p = timeline; | 1581 | xs_list *p = timeline; |
| 1582 | xs_str *md5; | 1582 | const xs_str *md5; |
| 1583 | 1583 | ||
| 1584 | snac *user = NULL; | 1584 | snac *user = NULL; |
| 1585 | if (logged_in) | 1585 | if (logged_in) |
| @@ -1633,7 +1633,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1633 | xs *timeline = tag_search(tag, 0, limit); | 1633 | xs *timeline = tag_search(tag, 0, limit); |
| 1634 | xs *out = xs_list_new(); | 1634 | xs *out = xs_list_new(); |
| 1635 | xs_list *p = timeline; | 1635 | xs_list *p = timeline; |
| 1636 | xs_str *md5; | 1636 | const xs_str *md5; |
| 1637 | 1637 | ||
| 1638 | while (xs_list_iter(&p, &md5) && cnt < limit) { | 1638 | while (xs_list_iter(&p, &md5) && cnt < limit) { |
| 1639 | xs *msg = NULL; | 1639 | xs *msg = NULL; |
| @@ -1673,7 +1673,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1673 | xs *timeline = list_timeline(&snac1, list, 0, 2048); | 1673 | xs *timeline = list_timeline(&snac1, list, 0, 2048); |
| 1674 | xs *out = xs_list_new(); | 1674 | xs *out = xs_list_new(); |
| 1675 | int c = 0; | 1675 | int c = 0; |
| 1676 | char *md5; | 1676 | const char *md5; |
| 1677 | 1677 | ||
| 1678 | while (xs_list_next(timeline, &md5, &c)) { | 1678 | while (xs_list_next(timeline, &md5, &c)) { |
| 1679 | xs *msg = NULL; | 1679 | xs *msg = NULL; |
| @@ -1747,7 +1747,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1747 | xs *l = notify_list(&snac1, 0, 64); | 1747 | xs *l = notify_list(&snac1, 0, 64); |
| 1748 | xs *out = xs_list_new(); | 1748 | xs *out = xs_list_new(); |
| 1749 | xs_list *p = l; | 1749 | xs_list *p = l; |
| 1750 | xs_dict *v; | 1750 | const xs_dict *v; |
| 1751 | const xs_list *excl = xs_dict_get(args, "exclude_types[]"); | 1751 | const xs_list *excl = xs_dict_get(args, "exclude_types[]"); |
| 1752 | 1752 | ||
| 1753 | while (xs_list_iter(&p, &v)) { | 1753 | while (xs_list_iter(&p, &v)) { |
| @@ -1858,7 +1858,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1858 | xs *lol = list_maint(&snac1, NULL, 0); | 1858 | xs *lol = list_maint(&snac1, NULL, 0); |
| 1859 | xs *l = xs_list_new(); | 1859 | xs *l = xs_list_new(); |
| 1860 | int c = 0; | 1860 | int c = 0; |
| 1861 | xs_list *li; | 1861 | const xs_list *li; |
| 1862 | 1862 | ||
| 1863 | while (xs_list_next(lol, &li, &c)) { | 1863 | while (xs_list_next(lol, &li, &c)) { |
| 1864 | xs *d = xs_dict_new(); | 1864 | xs *d = xs_dict_new(); |
| @@ -1890,7 +1890,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1890 | xs *actors = list_content(&snac1, p, NULL, 0); | 1890 | xs *actors = list_content(&snac1, p, NULL, 0); |
| 1891 | xs *out = xs_list_new(); | 1891 | xs *out = xs_list_new(); |
| 1892 | int c = 0; | 1892 | int c = 0; |
| 1893 | char *v; | 1893 | const char *v; |
| 1894 | 1894 | ||
| 1895 | while (xs_list_next(actors, &v, &c)) { | 1895 | while (xs_list_next(actors, &v, &c)) { |
| 1896 | xs *actor = NULL; | 1896 | xs *actor = NULL; |
| @@ -1911,7 +1911,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1911 | xs *out = xs_list_new(); | 1911 | xs *out = xs_list_new(); |
| 1912 | xs *lol = list_maint(&snac1, NULL, 0); | 1912 | xs *lol = list_maint(&snac1, NULL, 0); |
| 1913 | int c = 0; | 1913 | int c = 0; |
| 1914 | xs_list *v; | 1914 | const xs_list *v; |
| 1915 | 1915 | ||
| 1916 | while (xs_list_next(lol, &v, &c)) { | 1916 | while (xs_list_next(lol, &v, &c)) { |
| 1917 | const char *id = xs_list_get(v, 0); | 1917 | const char *id = xs_list_get(v, 0); |
| @@ -2105,7 +2105,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 2105 | xs *anc = xs_list_new(); | 2105 | xs *anc = xs_list_new(); |
| 2106 | xs *des = xs_list_new(); | 2106 | xs *des = xs_list_new(); |
| 2107 | xs_list *p; | 2107 | xs_list *p; |
| 2108 | xs_str *v; | 2108 | const xs_str *v; |
| 2109 | char pid[64]; | 2109 | char pid[64]; |
| 2110 | 2110 | ||
| 2111 | /* build the [grand]parent list, moving up */ | 2111 | /* build the [grand]parent list, moving up */ |
| @@ -2159,7 +2159,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 2159 | l = object_likes(xs_dict_get(msg, "id")); | 2159 | l = object_likes(xs_dict_get(msg, "id")); |
| 2160 | 2160 | ||
| 2161 | xs_list *p = l; | 2161 | xs_list *p = l; |
| 2162 | xs_str *v; | 2162 | const xs_str *v; |
| 2163 | 2163 | ||
| 2164 | while (xs_list_iter(&p, &v)) { | 2164 | while (xs_list_iter(&p, &v)) { |
| 2165 | xs *actor2 = NULL; | 2165 | xs *actor2 = NULL; |
| @@ -2267,7 +2267,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 2267 | int cnt = 40; | 2267 | int cnt = 40; |
| 2268 | xs *tl = content_search(&snac1, q, 1, 0, cnt, 0, &to); | 2268 | xs *tl = content_search(&snac1, q, 1, 0, cnt, 0, &to); |
| 2269 | int c = 0; | 2269 | int c = 0; |
| 2270 | char *v; | 2270 | const char *v; |
| 2271 | 2271 | ||
| 2272 | while (xs_list_next(tl, &v, &c) && --cnt) { | 2272 | while (xs_list_next(tl, &v, &c) && --cnt) { |
| 2273 | xs *post = NULL; | 2273 | xs *post = NULL; |
| @@ -2433,7 +2433,7 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, | |||
| 2433 | } | 2433 | } |
| 2434 | 2434 | ||
| 2435 | xs_list *p = mi; | 2435 | xs_list *p = mi; |
| 2436 | xs_str *v; | 2436 | const xs_str *v; |
| 2437 | 2437 | ||
| 2438 | while (xs_list_iter(&p, &v)) { | 2438 | while (xs_list_iter(&p, &v)) { |
| 2439 | xs *l = xs_list_new(); | 2439 | xs *l = xs_list_new(); |
| @@ -2783,7 +2783,7 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, | |||
| 2783 | choices = xs_dict_get(args, "choices"); | 2783 | choices = xs_dict_get(args, "choices"); |
| 2784 | 2784 | ||
| 2785 | if (xs_type(choices) == XSTYPE_LIST) { | 2785 | if (xs_type(choices) == XSTYPE_LIST) { |
| 2786 | xs_str *v; | 2786 | const xs_str *v; |
| 2787 | 2787 | ||
| 2788 | int c = 0; | 2788 | int c = 0; |
| 2789 | while (xs_list_next(choices, &v, &c)) { | 2789 | while (xs_list_next(choices, &v, &c)) { |
| @@ -2855,7 +2855,7 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, | |||
| 2855 | if (strcmp(op, "accounts") == 0) { | 2855 | if (strcmp(op, "accounts") == 0) { |
| 2856 | const xs_list *accts = xs_dict_get(args, "account_ids[]"); | 2856 | const xs_list *accts = xs_dict_get(args, "account_ids[]"); |
| 2857 | int c = 0; | 2857 | int c = 0; |
| 2858 | char *v; | 2858 | const char *v; |
| 2859 | 2859 | ||
| 2860 | while (xs_list_next(accts, &v, &c)) { | 2860 | while (xs_list_next(accts, &v, &c)) { |
| 2861 | list_content(&snac, id, v, 1); | 2861 | list_content(&snac, id, v, 1); |
| @@ -2934,7 +2934,7 @@ int mastoapi_delete_handler(const xs_dict *req, const char *q_path, | |||
| 2934 | p = xs_list_get(l, -2); | 2934 | p = xs_list_get(l, -2); |
| 2935 | const xs_list *accts = xs_dict_get(args, "account_ids[]"); | 2935 | const xs_list *accts = xs_dict_get(args, "account_ids[]"); |
| 2936 | int c = 0; | 2936 | int c = 0; |
| 2937 | char *v; | 2937 | const char *v; |
| 2938 | 2938 | ||
| 2939 | while (xs_list_next(accts, &v, &c)) { | 2939 | while (xs_list_next(accts, &v, &c)) { |
| 2940 | list_content(&snac, p, v, 2); | 2940 | list_content(&snac, p, v, 2); |
| @@ -3083,7 +3083,7 @@ void mastoapi_purge(void) | |||
| 3083 | xs *spec = xs_fmt("%s/app/" "*.json", srv_basedir); | 3083 | xs *spec = xs_fmt("%s/app/" "*.json", srv_basedir); |
| 3084 | xs *files = xs_glob(spec, 1, 0); | 3084 | xs *files = xs_glob(spec, 1, 0); |
| 3085 | xs_list *p = files; | 3085 | xs_list *p = files; |
| 3086 | xs_str *v; | 3086 | const xs_str *v; |
| 3087 | 3087 | ||
| 3088 | time_t mt = time(NULL) - 3600; | 3088 | time_t mt = time(NULL) - 3600; |
| 3089 | 3089 | ||
| @@ -43,7 +43,8 @@ int snac_upgrade(xs_str **error) | |||
| 43 | else | 43 | else |
| 44 | if (f < 2.2) { | 44 | if (f < 2.2) { |
| 45 | xs *users = user_list(); | 45 | xs *users = user_list(); |
| 46 | char *p, *v; | 46 | char *p; |
| 47 | const char *v; | ||
| 47 | 48 | ||
| 48 | p = users; | 49 | p = users; |
| 49 | while (xs_list_iter(&p, &v)) { | 50 | while (xs_list_iter(&p, &v)) { |
| @@ -52,7 +53,8 @@ int snac_upgrade(xs_str **error) | |||
| 52 | if (user_open(&snac, v)) { | 53 | if (user_open(&snac, v)) { |
| 53 | xs *spec = xs_fmt("%s/actors/" "*.json", snac.basedir); | 54 | xs *spec = xs_fmt("%s/actors/" "*.json", snac.basedir); |
| 54 | xs *list = xs_glob(spec, 0, 0); | 55 | xs *list = xs_glob(spec, 0, 0); |
| 55 | char *g, *fn; | 56 | char *g; |
| 57 | const char *fn; | ||
| 56 | 58 | ||
| 57 | g = list; | 59 | g = list; |
| 58 | while (xs_list_iter(&g, &fn)) { | 60 | while (xs_list_iter(&g, &fn)) { |
| @@ -77,14 +79,16 @@ int snac_upgrade(xs_str **error) | |||
| 77 | else | 79 | else |
| 78 | if (f < 2.3) { | 80 | if (f < 2.3) { |
| 79 | xs *users = user_list(); | 81 | xs *users = user_list(); |
| 80 | char *p, *v; | 82 | char *p; |
| 83 | const char *v; | ||
| 81 | 84 | ||
| 82 | p = users; | 85 | p = users; |
| 83 | while (xs_list_iter(&p, &v)) { | 86 | while (xs_list_iter(&p, &v)) { |
| 84 | snac snac; | 87 | snac snac; |
| 85 | 88 | ||
| 86 | if (user_open(&snac, v)) { | 89 | if (user_open(&snac, v)) { |
| 87 | char *p, *v; | 90 | char *p; |
| 91 | const char *v; | ||
| 88 | xs *dir = xs_fmt("%s/hidden", snac.basedir); | 92 | xs *dir = xs_fmt("%s/hidden", snac.basedir); |
| 89 | 93 | ||
| 90 | /* create the hidden directory */ | 94 | /* create the hidden directory */ |
| @@ -109,7 +113,8 @@ int snac_upgrade(xs_str **error) | |||
| 109 | else | 113 | else |
| 110 | if (f < 2.4) { | 114 | if (f < 2.4) { |
| 111 | xs *users = user_list(); | 115 | xs *users = user_list(); |
| 112 | char *p, *v; | 116 | char *p; |
| 117 | const char *v; | ||
| 113 | 118 | ||
| 114 | p = users; | 119 | p = users; |
| 115 | while (xs_list_iter(&p, &v)) { | 120 | while (xs_list_iter(&p, &v)) { |
| @@ -132,7 +137,8 @@ int snac_upgrade(xs_str **error) | |||
| 132 | if (f < 2.5) { | 137 | if (f < 2.5) { |
| 133 | /* upgrade followers */ | 138 | /* upgrade followers */ |
| 134 | xs *users = user_list(); | 139 | xs *users = user_list(); |
| 135 | char *p, *v; | 140 | char *p; |
| 141 | const char *v; | ||
| 136 | 142 | ||
| 137 | p = users; | 143 | p = users; |
| 138 | while (xs_list_iter(&p, &v)) { | 144 | while (xs_list_iter(&p, &v)) { |
| @@ -141,7 +147,8 @@ int snac_upgrade(xs_str **error) | |||
| 141 | if (user_open(&snac, v)) { | 147 | if (user_open(&snac, v)) { |
| 142 | xs *spec = xs_fmt("%s/followers/" "*.json", snac.basedir); | 148 | xs *spec = xs_fmt("%s/followers/" "*.json", snac.basedir); |
| 143 | xs *dir = xs_glob(spec, 0, 0); | 149 | xs *dir = xs_glob(spec, 0, 0); |
| 144 | char *p, *v; | 150 | char *p; |
| 151 | const char *v; | ||
| 145 | 152 | ||
| 146 | p = dir; | 153 | p = dir; |
| 147 | while (xs_list_iter(&p, &v)) { | 154 | while (xs_list_iter(&p, &v)) { |
| @@ -175,7 +182,8 @@ int snac_upgrade(xs_str **error) | |||
| 175 | if (f < 2.6) { | 182 | if (f < 2.6) { |
| 176 | /* upgrade local/ to public/ */ | 183 | /* upgrade local/ to public/ */ |
| 177 | xs *users = user_list(); | 184 | xs *users = user_list(); |
| 178 | char *p, *v; | 185 | char *p; |
| 186 | const char *v; | ||
| 179 | 187 | ||
| 180 | p = users; | 188 | p = users; |
| 181 | while (xs_list_iter(&p, &v)) { | 189 | while (xs_list_iter(&p, &v)) { |
| @@ -184,7 +192,8 @@ int snac_upgrade(xs_str **error) | |||
| 184 | if (user_open(&snac, v)) { | 192 | if (user_open(&snac, v)) { |
| 185 | xs *spec = xs_fmt("%s/local/" "*.json", snac.basedir); | 193 | xs *spec = xs_fmt("%s/local/" "*.json", snac.basedir); |
| 186 | xs *dir = xs_glob(spec, 0, 0); | 194 | xs *dir = xs_glob(spec, 0, 0); |
| 187 | char *p, *v; | 195 | char *p; |
| 196 | const char *v; | ||
| 188 | 197 | ||
| 189 | p = dir; | 198 | p = dir; |
| 190 | while (xs_list_iter(&p, &v)) { | 199 | while (xs_list_iter(&p, &v)) { |
| @@ -206,7 +215,7 @@ int snac_upgrade(xs_str **error) | |||
| 206 | /* if it's from us, add to public */ | 215 | /* if it's from us, add to public */ |
| 207 | if (xs_startswith(id, snac.actor)) { | 216 | if (xs_startswith(id, snac.actor)) { |
| 208 | const xs_list *p; | 217 | const xs_list *p; |
| 209 | char *v; | 218 | const char *v; |
| 210 | int c; | 219 | int c; |
| 211 | 220 | ||
| 212 | object_user_cache_add(&snac, id, "public"); | 221 | object_user_cache_add(&snac, id, "public"); |
| @@ -241,7 +250,8 @@ int snac_upgrade(xs_str **error) | |||
| 241 | if (f < 2.7) { | 250 | if (f < 2.7) { |
| 242 | /* upgrade timeline/ to private/ */ | 251 | /* upgrade timeline/ to private/ */ |
| 243 | xs *users = user_list(); | 252 | xs *users = user_list(); |
| 244 | char *p, *v; | 253 | char *p; |
| 254 | const char *v; | ||
| 245 | 255 | ||
| 246 | p = users; | 256 | p = users; |
| 247 | while (xs_list_iter(&p, &v)) { | 257 | while (xs_list_iter(&p, &v)) { |
| @@ -250,7 +260,8 @@ int snac_upgrade(xs_str **error) | |||
| 250 | if (user_open(&snac, v)) { | 260 | if (user_open(&snac, v)) { |
| 251 | xs *spec = xs_fmt("%s/timeline/" "*.json", snac.basedir); | 261 | xs *spec = xs_fmt("%s/timeline/" "*.json", snac.basedir); |
| 252 | xs *dir = xs_glob(spec, 0, 0); | 262 | xs *dir = xs_glob(spec, 0, 0); |
| 253 | char *p, *v; | 263 | char *p; |
| 264 | const char *v; | ||
| 254 | 265 | ||
| 255 | p = dir; | 266 | p = dir; |
| 256 | while (xs_list_iter(&p, &v)) { | 267 | while (xs_list_iter(&p, &v)) { |
| @@ -271,7 +282,7 @@ int snac_upgrade(xs_str **error) | |||
| 271 | 282 | ||
| 272 | { | 283 | { |
| 273 | const xs_list *p; | 284 | const xs_list *p; |
| 274 | char *v; | 285 | const char *v; |
| 275 | int c = 0; | 286 | int c = 0; |
| 276 | 287 | ||
| 277 | object_user_cache_add(&snac, id, "private"); | 288 | object_user_cache_add(&snac, id, "private"); |
| @@ -358,7 +358,7 @@ void rm_rf(const char *dir) | |||
| 358 | xs *d = xs_str_cat(xs_dup(dir), "/" "*"); | 358 | xs *d = xs_str_cat(xs_dup(dir), "/" "*"); |
| 359 | xs *l = xs_glob(d, 0, 0); | 359 | xs *l = xs_glob(d, 0, 0); |
| 360 | xs_list *p = l; | 360 | xs_list *p = l; |
| 361 | xs_str *v; | 361 | const xs_str *v; |
| 362 | 362 | ||
| 363 | if (dbglevel >= 1) | 363 | if (dbglevel >= 1) |
| 364 | printf("Deleting directory %s\n", dir); | 364 | printf("Deleting directory %s\n", dir); |
| @@ -393,7 +393,7 @@ int deluser(snac *user) | |||
| 393 | int ret = 0; | 393 | int ret = 0; |
| 394 | xs *fwers = following_list(user); | 394 | xs *fwers = following_list(user); |
| 395 | xs_list *p = fwers; | 395 | xs_list *p = fwers; |
| 396 | xs_str *v; | 396 | const xs_str *v; |
| 397 | 397 | ||
| 398 | while (xs_list_iter(&p, &v)) { | 398 | while (xs_list_iter(&p, &v)) { |
| 399 | xs *object = NULL; | 399 | xs *object = NULL; |
| @@ -419,7 +419,7 @@ void verify_links(snac *user) | |||
| 419 | /* verifies a user's links */ | 419 | /* verifies a user's links */ |
| 420 | { | 420 | { |
| 421 | const xs_dict *p = xs_dict_get(user->config, "metadata"); | 421 | const xs_dict *p = xs_dict_get(user->config, "metadata"); |
| 422 | char *k, *v; | 422 | const char *k, *v; |
| 423 | int changed = 0; | 423 | int changed = 0; |
| 424 | 424 | ||
| 425 | xs *headers = xs_dict_new(); | 425 | xs *headers = xs_dict_new(); |
| @@ -449,7 +449,7 @@ void verify_links(snac *user) | |||
| 449 | xs *ls = xs_regex_select(payload, "< *(a|link) +[^>]+>"); | 449 | xs *ls = xs_regex_select(payload, "< *(a|link) +[^>]+>"); |
| 450 | 450 | ||
| 451 | xs_list *lp = ls; | 451 | xs_list *lp = ls; |
| 452 | char *ll; | 452 | const char *ll; |
| 453 | int vfied = 0; | 453 | int vfied = 0; |
| 454 | 454 | ||
| 455 | while (!vfied && xs_list_iter(&lp, &ll)) { | 455 | while (!vfied && xs_list_iter(&lp, &ll)) { |
| @@ -463,7 +463,7 @@ void verify_links(snac *user) | |||
| 463 | xs *href = NULL; | 463 | xs *href = NULL; |
| 464 | int is_rel_me = 0; | 464 | int is_rel_me = 0; |
| 465 | xs_list *pr = r; | 465 | xs_list *pr = r; |
| 466 | char *ar; | 466 | const char *ar; |
| 467 | 467 | ||
| 468 | while (xs_list_iter(&pr, &ar)) { | 468 | while (xs_list_iter(&pr, &ar)) { |
| 469 | xs *nq = xs_dup(ar); | 469 | xs *nq = xs_dup(ar); |
diff --git a/webfinger.c b/webfinger.c index b1d85e9..c79fd44 100644 --- a/webfinger.c +++ b/webfinger.c | |||
| @@ -96,7 +96,7 @@ int webfinger_request_signed(snac *snac, const char *qs, char **actor, char **us | |||
| 96 | if (actor != NULL) { | 96 | if (actor != NULL) { |
| 97 | const xs_list *list = xs_dict_get(obj, "links"); | 97 | const xs_list *list = xs_dict_get(obj, "links"); |
| 98 | int c = 0; | 98 | int c = 0; |
| 99 | char *v; | 99 | const char *v; |
| 100 | 100 | ||
| 101 | while (xs_list_next(list, &v, &c)) { | 101 | while (xs_list_next(list, &v, &c)) { |
| 102 | if (xs_type(v) == XSTYPE_DICT) { | 102 | if (xs_type(v) == XSTYPE_DICT) { |
| @@ -94,8 +94,8 @@ xs_list *xs_list_new(void); | |||
| 94 | xs_list *xs_list_append_m(xs_list *list, const char *mem, int dsz); | 94 | xs_list *xs_list_append_m(xs_list *list, const char *mem, int dsz); |
| 95 | xs_list *_xs_list_append(xs_list *list, const xs_val *vals[]); | 95 | xs_list *_xs_list_append(xs_list *list, const xs_val *vals[]); |
| 96 | #define xs_list_append(list, ...) _xs_list_append(list, (const xs_val *[]){ __VA_ARGS__, NULL }) | 96 | #define xs_list_append(list, ...) _xs_list_append(list, (const xs_val *[]){ __VA_ARGS__, NULL }) |
| 97 | int xs_list_iter(xs_list **list, xs_val **value); | 97 | int xs_list_iter(xs_list **list, const xs_val **value); |
| 98 | int xs_list_next(const xs_list *list, xs_val **value, int *ctxt); | 98 | int xs_list_next(const xs_list *list, const xs_val **value, int *ctxt); |
| 99 | int xs_list_len(const xs_list *list); | 99 | int xs_list_len(const xs_list *list); |
| 100 | const xs_val *xs_list_get(const xs_list *list, int num); | 100 | const xs_val *xs_list_get(const xs_list *list, int num); |
| 101 | xs_list *xs_list_del(xs_list *list, int num); | 101 | xs_list *xs_list_del(xs_list *list, int num); |
| @@ -118,7 +118,7 @@ xs_keyval *xs_keyval_make(xs_keyval *keyval, const xs_str *key, const xs_val *va | |||
| 118 | xs_dict *xs_dict_new(void); | 118 | xs_dict *xs_dict_new(void); |
| 119 | xs_dict *xs_dict_append(xs_dict *dict, const xs_str *key, const xs_val *value); | 119 | xs_dict *xs_dict_append(xs_dict *dict, const xs_str *key, const xs_val *value); |
| 120 | xs_dict *xs_dict_prepend(xs_dict *dict, const xs_str *key, const xs_val *value); | 120 | xs_dict *xs_dict_prepend(xs_dict *dict, const xs_str *key, const xs_val *value); |
| 121 | int xs_dict_next(const xs_dict *dict, xs_str **key, xs_val **value, int *ctxt); | 121 | int xs_dict_next(const xs_dict *dict, const xs_str **key, const xs_val **value, int *ctxt); |
| 122 | const xs_val *xs_dict_get_def(const xs_dict *dict, const xs_str *key, const xs_val *def); | 122 | const xs_val *xs_dict_get_def(const xs_dict *dict, const xs_str *key, const xs_val *def); |
| 123 | #define xs_dict_get(dict, key) xs_dict_get_def(dict, key, NULL) | 123 | #define xs_dict_get(dict, key) xs_dict_get_def(dict, key, NULL) |
| 124 | xs_dict *xs_dict_del(xs_dict *dict, const xs_str *key); | 124 | xs_dict *xs_dict_del(xs_dict *dict, const xs_str *key); |
| @@ -726,7 +726,7 @@ xs_list *_xs_list_append(xs_list *list, const xs_val *vals[]) | |||
| 726 | } | 726 | } |
| 727 | 727 | ||
| 728 | 728 | ||
| 729 | int xs_list_iter(xs_list **list, xs_val **value) | 729 | int xs_list_iter(xs_list **list, const xs_val **value) |
| 730 | /* iterates a list value */ | 730 | /* iterates a list value */ |
| 731 | { | 731 | { |
| 732 | int goon = 1; | 732 | int goon = 1; |
| @@ -757,7 +757,7 @@ int xs_list_iter(xs_list **list, xs_val **value) | |||
| 757 | } | 757 | } |
| 758 | 758 | ||
| 759 | 759 | ||
| 760 | int xs_list_next(const xs_list *list, xs_val **value, int *ctxt) | 760 | int xs_list_next(const xs_list *list, const xs_val **value, int *ctxt) |
| 761 | /* iterates a list, with context */ | 761 | /* iterates a list, with context */ |
| 762 | { | 762 | { |
| 763 | if (xs_type(list) != XSTYPE_LIST) | 763 | if (xs_type(list) != XSTYPE_LIST) |
| @@ -765,7 +765,7 @@ int xs_list_next(const xs_list *list, xs_val **value, int *ctxt) | |||
| 765 | 765 | ||
| 766 | int goon = 1; | 766 | int goon = 1; |
| 767 | 767 | ||
| 768 | char *p = (char *)list; | 768 | const char *p = list; |
| 769 | 769 | ||
| 770 | /* skip the start of the list */ | 770 | /* skip the start of the list */ |
| 771 | if (*ctxt == 0) | 771 | if (*ctxt == 0) |
| @@ -800,7 +800,7 @@ int xs_list_len(const xs_list *list) | |||
| 800 | 800 | ||
| 801 | int c = 0; | 801 | int c = 0; |
| 802 | xs_list *p = (xs_list *)list; | 802 | xs_list *p = (xs_list *)list; |
| 803 | xs_val *v; | 803 | const xs_val *v; |
| 804 | 804 | ||
| 805 | while (xs_list_iter(&p, &v)) | 805 | while (xs_list_iter(&p, &v)) |
| 806 | c++; | 806 | c++; |
| @@ -819,7 +819,7 @@ const xs_val *xs_list_get(const xs_list *list, int num) | |||
| 819 | 819 | ||
| 820 | int c = 0; | 820 | int c = 0; |
| 821 | xs_list *p = (xs_list *)list; | 821 | xs_list *p = (xs_list *)list; |
| 822 | xs_val *v; | 822 | const xs_val *v; |
| 823 | 823 | ||
| 824 | while (xs_list_iter(&p, &v)) { | 824 | while (xs_list_iter(&p, &v)) { |
| 825 | if (c == num) | 825 | if (c == num) |
| @@ -881,7 +881,7 @@ xs_list *xs_list_dequeue(xs_list *list, xs_val **data, int last) | |||
| 881 | XS_ASSERT_TYPE(list, XSTYPE_LIST); | 881 | XS_ASSERT_TYPE(list, XSTYPE_LIST); |
| 882 | 882 | ||
| 883 | xs_list *p = list; | 883 | xs_list *p = list; |
| 884 | xs_val *v = NULL; | 884 | const xs_val *v = NULL; |
| 885 | 885 | ||
| 886 | if (!last) { | 886 | if (!last) { |
| 887 | /* get the first */ | 887 | /* get the first */ |
| @@ -910,7 +910,7 @@ int xs_list_in(const xs_list *list, const xs_val *val) | |||
| 910 | 910 | ||
| 911 | int n = 0; | 911 | int n = 0; |
| 912 | xs_list *p = (xs_list *)list; | 912 | xs_list *p = (xs_list *)list; |
| 913 | xs_val *v; | 913 | const xs_val *v; |
| 914 | int sz = xs_size(val); | 914 | int sz = xs_size(val); |
| 915 | 915 | ||
| 916 | while (xs_list_iter(&p, &v)) { | 916 | while (xs_list_iter(&p, &v)) { |
| @@ -931,7 +931,7 @@ xs_str *xs_join(const xs_list *list, const char *sep) | |||
| 931 | 931 | ||
| 932 | xs_str *s = NULL; | 932 | xs_str *s = NULL; |
| 933 | xs_list *p = (xs_list *)list; | 933 | xs_list *p = (xs_list *)list; |
| 934 | xs_val *v; | 934 | const xs_val *v; |
| 935 | int c = 0; | 935 | int c = 0; |
| 936 | int offset = 0; | 936 | int offset = 0; |
| 937 | int ssz = strlen(sep); | 937 | int ssz = strlen(sep); |
| @@ -1087,7 +1087,7 @@ xs_dict *xs_dict_prepend(xs_dict *dict, const xs_str *key, const xs_val *value) | |||
| 1087 | } | 1087 | } |
| 1088 | 1088 | ||
| 1089 | 1089 | ||
| 1090 | int xs_dict_next(const xs_dict *dict, xs_str **key, xs_val **value, int *ctxt) | 1090 | int xs_dict_next(const xs_dict *dict, const xs_str **key, const xs_val **value, int *ctxt) |
| 1091 | /* iterates a dict, with context */ | 1091 | /* iterates a dict, with context */ |
| 1092 | { | 1092 | { |
| 1093 | if (xs_type(dict) != XSTYPE_DICT) | 1093 | if (xs_type(dict) != XSTYPE_DICT) |
| @@ -1131,8 +1131,8 @@ const xs_val *xs_dict_get_def(const xs_dict *dict, const xs_str *key, const xs_v | |||
| 1131 | XS_ASSERT_TYPE(dict, XSTYPE_DICT); | 1131 | XS_ASSERT_TYPE(dict, XSTYPE_DICT); |
| 1132 | XS_ASSERT_TYPE(key, XSTYPE_STRING); | 1132 | XS_ASSERT_TYPE(key, XSTYPE_STRING); |
| 1133 | 1133 | ||
| 1134 | xs_str *k; | 1134 | const xs_str *k; |
| 1135 | xs_val *v; | 1135 | const xs_val *v; |
| 1136 | int c = 0; | 1136 | int c = 0; |
| 1137 | 1137 | ||
| 1138 | while (xs_dict_next(dict, &k, &v, &c)) { | 1138 | while (xs_dict_next(dict, &k, &v, &c)) { |
| @@ -1150,14 +1150,14 @@ xs_dict *xs_dict_del(xs_dict *dict, const xs_str *key) | |||
| 1150 | XS_ASSERT_TYPE(dict, XSTYPE_DICT); | 1150 | XS_ASSERT_TYPE(dict, XSTYPE_DICT); |
| 1151 | XS_ASSERT_TYPE(key, XSTYPE_STRING); | 1151 | XS_ASSERT_TYPE(key, XSTYPE_STRING); |
| 1152 | 1152 | ||
| 1153 | xs_str *k; | 1153 | const xs_str *k; |
| 1154 | xs_val *v; | 1154 | const xs_val *v; |
| 1155 | int c = 0; | 1155 | int c = 0; |
| 1156 | 1156 | ||
| 1157 | while (xs_dict_next(dict, &k, &v, &c)) { | 1157 | while (xs_dict_next(dict, &k, &v, &c)) { |
| 1158 | if (strcmp(k, key) == 0) { | 1158 | if (strcmp(k, key) == 0) { |
| 1159 | /* the address of the item is just behind the key */ | 1159 | /* the address of the item is just behind the key */ |
| 1160 | char *i = k - 1; | 1160 | char *i = (char *)k - 1; |
| 1161 | 1161 | ||
| 1162 | dict = xs_collapse(dict, i - dict, xs_size(i)); | 1162 | dict = xs_collapse(dict, i - dict, xs_size(i)); |
| 1163 | break; | 1163 | break; |
| @@ -93,8 +93,8 @@ xs_dict *xs_http_request(const char *method, const char *url, | |||
| 93 | xs_dict *response; | 93 | xs_dict *response; |
| 94 | CURL *curl; | 94 | CURL *curl; |
| 95 | struct curl_slist *list = NULL; | 95 | struct curl_slist *list = NULL; |
| 96 | xs_str *k; | 96 | const xs_str *k; |
| 97 | xs_val *v; | 97 | const xs_val *v; |
| 98 | long lstatus = 0; | 98 | long lstatus = 0; |
| 99 | struct _payload_data pd; | 99 | struct _payload_data pd; |
| 100 | 100 | ||
| @@ -293,8 +293,8 @@ void xs_fcgi_response(FILE *f, int status, xs_dict *headers, xs_str *body, int b | |||
| 293 | struct fcgi_record_header hdr = {0}; | 293 | struct fcgi_record_header hdr = {0}; |
| 294 | struct fcgi_end_request ereq = {0}; | 294 | struct fcgi_end_request ereq = {0}; |
| 295 | xs *out = xs_str_new(NULL); | 295 | xs *out = xs_str_new(NULL); |
| 296 | xs_str *k; | 296 | const xs_str *k; |
| 297 | xs_str *v; | 297 | const xs_str *v; |
| 298 | 298 | ||
| 299 | /* no previous id? it's an error */ | 299 | /* no previous id? it's an error */ |
| 300 | if (fcgi_id == -1) | 300 | if (fcgi_id == -1) |
| @@ -99,8 +99,8 @@ void xs_httpd_response(FILE *f, int status, xs_dict *headers, xs_str *body, int | |||
| 99 | /* sends an httpd response */ | 99 | /* sends an httpd response */ |
| 100 | { | 100 | { |
| 101 | xs *proto; | 101 | xs *proto; |
| 102 | xs_str *k; | 102 | const xs_str *k; |
| 103 | xs_val *v; | 103 | const xs_val *v; |
| 104 | 104 | ||
| 105 | proto = xs_fmt("HTTP/1.1 %d %s", status, status / 100 == 2 ? "OK" : "ERROR"); | 105 | proto = xs_fmt("HTTP/1.1 %d %s", status, status / 100 == 2 ? "OK" : "ERROR"); |
| 106 | fprintf(f, "%s\r\n", proto); | 106 | fprintf(f, "%s\r\n", proto); |
| @@ -76,7 +76,7 @@ static void _xs_json_dump(const xs_val *data, int level, int indent, FILE *f) | |||
| 76 | { | 76 | { |
| 77 | int c = 0; | 77 | int c = 0; |
| 78 | int ct = 0; | 78 | int ct = 0; |
| 79 | xs_val *v; | 79 | const xs_val *v; |
| 80 | 80 | ||
| 81 | switch (xs_type(data)) { | 81 | switch (xs_type(data)) { |
| 82 | case XSTYPE_NULL: | 82 | case XSTYPE_NULL: |
| @@ -116,7 +116,7 @@ static void _xs_json_dump(const xs_val *data, int level, int indent, FILE *f) | |||
| 116 | case XSTYPE_DICT: | 116 | case XSTYPE_DICT: |
| 117 | fputc('{', f); | 117 | fputc('{', f); |
| 118 | 118 | ||
| 119 | xs_str *k; | 119 | const xs_str *k; |
| 120 | 120 | ||
| 121 | while (xs_dict_next(data, &k, &v, &ct)) { | 121 | while (xs_dict_next(data, &k, &v, &ct)) { |
| 122 | if (c != 0) | 122 | if (c != 0) |
| @@ -64,7 +64,7 @@ xs_list *xs_regex_select_n(const char *str, const char *rx, int count) | |||
| 64 | { | 64 | { |
| 65 | xs_list *list = xs_list_new(); | 65 | xs_list *list = xs_list_new(); |
| 66 | xs *split = NULL; | 66 | xs *split = NULL; |
| 67 | xs_val *v; | 67 | const xs_val *v; |
| 68 | int n = 0; | 68 | int n = 0; |
| 69 | int c = 0; | 69 | int c = 0; |
| 70 | 70 | ||
| @@ -89,7 +89,7 @@ xs_list *xs_regex_replace_in(xs_str *str, const char *rx, const char *rep, int c | |||
| 89 | { | 89 | { |
| 90 | xs_str *s = xs_str_new(NULL); | 90 | xs_str *s = xs_str_new(NULL); |
| 91 | xs *split = xs_regex_split_n(str, rx, count); | 91 | xs *split = xs_regex_split_n(str, rx, count); |
| 92 | xs_val *v; | 92 | const xs_val *v; |
| 93 | int n = 0; | 93 | int n = 0; |
| 94 | int c = 0; | 94 | int c = 0; |
| 95 | int pholder = !!strchr(rep, '&'); | 95 | int pholder = !!strchr(rep, '&'); |
| @@ -85,7 +85,8 @@ int xs_set_add(xs_set *s, const xs_val *data) | |||
| 85 | { | 85 | { |
| 86 | /* is it 'full'? */ | 86 | /* is it 'full'? */ |
| 87 | if (s->used >= s->elems / 2) { | 87 | if (s->used >= s->elems / 2) { |
| 88 | char *p, *v; | 88 | char *p; |
| 89 | const xs_val *v; | ||
| 89 | 90 | ||
| 90 | /* expand! */ | 91 | /* expand! */ |
| 91 | s->elems *= 2; | 92 | s->elems *= 2; |
| @@ -52,7 +52,7 @@ xs_dict *xs_url_vars(const char *str) | |||
| 52 | xs *args = xs_split(str, "&"); | 52 | xs *args = xs_split(str, "&"); |
| 53 | 53 | ||
| 54 | xs_list *l; | 54 | xs_list *l; |
| 55 | xs_val *v; | 55 | const xs_val *v; |
| 56 | 56 | ||
| 57 | l = args; | 57 | l = args; |
| 58 | while (xs_list_iter(&l, &v)) { | 58 | while (xs_list_iter(&l, &v)) { |
diff --git a/xs_version.h b/xs_version.h index 9ecf9b8..9fb70ef 100644 --- a/xs_version.h +++ b/xs_version.h | |||
| @@ -1 +1 @@ | |||
| /* 34850dcdec50b669a2c0bbe9f16f6d9c4b16eafd 2024-05-21T14:06:02+02:00 */ | /* 65265483c102909393287bfb173d1a7ae9c3be00 2024-05-23T09:57:20+02:00 */ | ||