From 258850feac51cab378461331f820d584dfa6d948 Mon Sep 17 00:00:00 2001 From: default Date: Wed, 22 Nov 2023 13:07:19 +0100 Subject: [PATCH] Backport from xs. --- html.c | 2 +- xs_html.h | 12 ++++++------ xs_version.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/html.c b/html.c index daa73ab..2c807ef 100644 --- a/html.c +++ b/html.c @@ -2270,7 +2270,7 @@ int html_get_handler(const xs_dict *req, const char *q_path, xs_html_text(content)))); } - *body = _xs_html_render(rss, xs_dup("\n")); + *body = xs_html_render_s(rss, xs_dup("\n")); *b_size = strlen(*body); *ctype = "application/rss+xml; charset=utf-8"; status = 200; diff --git a/xs_html.h b/xs_html.h index d34a7e0..254ba20 100644 --- a/xs_html.h +++ b/xs_html.h @@ -21,8 +21,8 @@ xs_html *_xs_html_tag(char *tag, xs_html *var[]); xs_html *_xs_html_sctag(char *tag, xs_html *var[]); #define xs_html_sctag(tag, ...) _xs_html_sctag(tag, (xs_html *[]) { __VA_ARGS__, NULL }) -xs_str *_xs_html_render(xs_html *h, xs_str *s); -#define xs_html_render(h) _xs_html_render(h, xs_str_new(NULL)) +xs_str *xs_html_render_s(xs_html *h, xs_str *s); +#define xs_html_render(h) xs_html_render_s(h, xs_str_new(NULL)) #ifdef XS_IMPLEMENTATION @@ -187,8 +187,8 @@ xs_html *_xs_html_sctag(char *tag, xs_html *var[]) } -xs_str *_xs_html_render(xs_html *h, xs_str *s) -/* renders the tag and its subtags */ +xs_str *xs_html_render_s(xs_html *h, xs_str *s) +/* renders the tag and its subtags into s */ { xs_html *st; @@ -201,7 +201,7 @@ xs_str *_xs_html_render(xs_html *h, xs_str *s) st = h->f_attr; while (st) { xs_html *nst = st->next; - s = _xs_html_render(st, s); + s = xs_html_render_s(st, s); st = nst; } @@ -216,7 +216,7 @@ xs_str *_xs_html_render(xs_html *h, xs_str *s) st = h->f_tag; while (st) { xs_html *nst = st->next; - s = _xs_html_render(st, s); + s = xs_html_render_s(st, s); st = nst; } diff --git a/xs_version.h b/xs_version.h index fd4dd8f..3aac89b 100644 --- a/xs_version.h +++ b/xs_version.h @@ -1 +1 @@ -/* d9404322f5bad91811bc0ad13d63360b586919cc 2023-11-20T20:13:34+01:00 */ +/* 2adde1fad4fabb223639e4002a7ff3ec8c1982d7 2023-11-22T13:05:51+01:00 */