diff options
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 36 |
1 files changed, 18 insertions, 18 deletions
| @@ -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; |