diff options
Diffstat (limited to 'render/directory.c')
-rw-r--r-- | render/directory.c | 42 |
1 files changed, 13 insertions, 29 deletions
diff --git a/render/directory.c b/render/directory.c index 1363ad251..c2b343fbe 100644 --- a/render/directory.c +++ b/render/directory.c @@ -48,12 +48,10 @@ bool directory_create(struct content *c, const char *params[]) { /* html_create() must have broadcast MSG_ERROR already, so we * don't need to. */ return false; -#ifndef WITH_HUBBUB - htmlParseChunk(c->data.html.parser, header, sizeof(header) - 1, 0); -#else - hubbub_parser_parse_chunk(c->data.html.parser, - (uint8_t *) header, sizeof(header) - 1); -#endif + + binding_parse_chunk(c->data.html.parser_binding, + (uint8_t *) header, sizeof(header) - 1); + return true; } @@ -100,12 +98,9 @@ bool directory_convert(struct content *c, int width, int height) { "<body>\n<h1>\nIndex of %s</h1>\n<hr><pre>", nice_path, nice_path); free(nice_path); -#ifndef WITH_HUBBUB - htmlParseChunk(c->data.html.parser, buffer, strlen(buffer), 0); -#else - hubbub_parser_parse_chunk(c->data.html.parser, + + binding_parse_chunk(c->data.html.parser_binding, (uint8_t *) buffer, strlen(buffer)); -#endif res = url_parent(c->url, &up); if (res == URL_FUNC_OK) { @@ -113,14 +108,9 @@ bool directory_convert(struct content *c, int width, int height) { if ((res == URL_FUNC_OK) && !compare) { snprintf(buffer, sizeof(buffer), "<a href=\"..\">[..]</a>\n"); -#ifndef WITH_HUBBUB - htmlParseChunk(c->data.html.parser, buffer, - strlen(buffer), 0); -#else - hubbub_parser_parse_chunk(c->data.html.parser, - (uint8_t *) buffer, - strlen(buffer)); -#endif + + binding_parse_chunk(c->data.html.parser_binding, + (uint8_t *) buffer, strlen(buffer)); } free(up); } @@ -137,21 +127,15 @@ bool directory_convert(struct content *c, int width, int height) { snprintf(buffer, sizeof(buffer), "<a href=\"%s/%s\">%s</a>\n", c->url, entry->d_name, entry->d_name); -#ifndef WITH_HUBBUB - htmlParseChunk(c->data.html.parser, buffer, strlen(buffer), 0); -#else - hubbub_parser_parse_chunk(c->data.html.parser, + + binding_parse_chunk(c->data.html.parser_binding, (uint8_t *) buffer, strlen(buffer)); -#endif } closedir(parent); -#ifndef WITH_HUBBUB - htmlParseChunk(c->data.html.parser, footer, sizeof(footer) - 1, 0); -#else - hubbub_parser_parse_chunk(c->data.html.parser, + binding_parse_chunk(c->data.html.parser_binding, (uint8_t *) footer, sizeof(footer) - 1); -#endif + c->type = CONTENT_HTML; return html_convert(c, width, height); } |