aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-04-28 19:46:29 +0200
committerdec05eba <dec05eba@protonmail.com>2021-04-28 19:46:32 +0200
commitefdd24c40d9d6ffa5207ddc369b03eba86e9e22e (patch)
treef7b5e80a4a1a28430eecfdf84f6bf3440f31297c /include
parent4a2f50f00529aa0894486a099b721826add9205b (diff)
Simplify api, use const char* for input string
Diffstat (limited to 'include')
-rw-r--r--include/HtmlParser.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/include/HtmlParser.h b/include/HtmlParser.h
index 6a295aa..0bd7203 100644
--- a/include/HtmlParser.h
+++ b/include/HtmlParser.h
@@ -9,7 +9,7 @@
#include <stddef.h>
typedef struct {
- char *data;
+ const char *data;
size_t size;
} HtmlStringView;
@@ -28,7 +28,7 @@ typedef void (*HtmlParseCallback)(HtmlParser *html_parser, HtmlParseType parse_t
#define UNCLOSED_TAGS_SIZE 2048
struct HtmlParser {
- char *source;
+ const char *source;
size_t source_len;
size_t offset;
HtmlParseCallback parse_callback;
@@ -50,9 +50,6 @@ struct HtmlParser {
};
/* Note: HTML_PARSE_TAG_START is guaranteed to be called for a tag before HTML_PARSE_TAG_END */
-void html_parser_init(HtmlParser *self, char *html_source, size_t len, HtmlParseCallback parse_callback, void *userdata);
-void html_parser_deinit(HtmlParser *self);
-
-void html_parser_parse(HtmlParser *self);
+void html_parser_parse(const char *html_source, size_t len, HtmlParseCallback parse_callback, void *userdata);
#endif /* HTML_PARSER_H */