diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-04-28 19:46:29 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-04-28 19:46:32 +0200 |
commit | efdd24c40d9d6ffa5207ddc369b03eba86e9e22e (patch) | |
tree | f7b5e80a4a1a28430eecfdf84f6bf3440f31297c /tests | |
parent | 4a2f50f00529aa0894486a099b721826add9205b (diff) |
Simplify api, use const char* for input string
Diffstat (limited to 'tests')
-rw-r--r-- | tests/main.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/main.c b/tests/main.c index 6d84cfa..de37c9a 100644 --- a/tests/main.c +++ b/tests/main.c @@ -23,10 +23,10 @@ char* file_get_content(const char *path, long *filesize) { static void html_parse_callback(HtmlParser *html_parser, HtmlParseType parse_type, void *userdata_any) { switch(parse_type) { case HTML_PARSE_TAG_START: - printf("tag start: %.*s\n", html_parser->tag_name.size, html_parser->tag_name.data); + printf("tag start: %.*s\n", (int)html_parser->tag_name.size, html_parser->tag_name.data); break; case HTML_PARSE_TAG_END: - printf("tag end: %.*s\n", html_parser->tag_name.size, html_parser->tag_name.data); + printf("tag end: %.*s\n", (int)html_parser->tag_name.size, html_parser->tag_name.data); break; } } @@ -39,10 +39,7 @@ int main() { return 1; } - HtmlParser html_parser; - html_parser_init(&html_parser, file_data, filesize, html_parse_callback, NULL); - html_parser_parse(&html_parser); - html_parser_deinit(&html_parser); + html_parser_parse(file_data, filesize, html_parse_callback, NULL); free(file_data); return 0; } |