From efdd24c40d9d6ffa5207ddc369b03eba86e9e22e Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 28 Apr 2021 19:46:29 +0200 Subject: Simplify api, use const char* for input string --- tests/main.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'tests') 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; } -- cgit v1.2.3