aboutsummaryrefslogtreecommitdiff
path: root/include/quickmedia
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-05-25 03:58:20 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-06 06:55:04 +0200
commitbc0b7338ed2d4c126c15eaf57aeb84655e0e1cc3 (patch)
tree0cb334708717bc6304d32320356df64df8f2778c /include/quickmedia
parent2f9cf2385a90920b1bcbe6cefa899f33c615e2a5 (diff)
Allow reusing doc for multiple xpath searches
Diffstat (limited to 'include/quickmedia')
-rw-r--r--include/quickmedia/HtmlSearch.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/quickmedia/HtmlSearch.h b/include/quickmedia/HtmlSearch.h
index e3bea33..568e101 100644
--- a/include/quickmedia/HtmlSearch.h
+++ b/include/quickmedia/HtmlSearch.h
@@ -13,6 +13,10 @@ typedef struct {
void *text;
} QuickMediaHtmlNode;
+typedef struct {
+ const void *doc;
+} QuickMediaHtmlSearch;
+
/* Returns NULL if attribute doesn't exist or if it doesn't have any value */
const char* quickmedia_html_node_get_attribute_value(QuickMediaHtmlNode *self, const char *attribute_name);
@@ -22,7 +26,10 @@ const QuickMediaStringView quickmedia_html_node_get_text(QuickMediaHtmlNode *sel
/* @node is only valid within the callback function scope */
typedef void (*QuickMediaHtmlSearchResultCallback)(QuickMediaHtmlNode *node, void *userdata);
-int quickmedia_html_find_nodes_xpath(const char *html_source, const char *xpath, QuickMediaHtmlSearchResultCallback result_callback, void *userdata);
+int quickmedia_html_search_init(QuickMediaHtmlSearch *self, const char *html_source);
+void quickmedia_html_search_deinit(QuickMediaHtmlSearch *self);
+
+int quickmedia_html_find_nodes_xpath(QuickMediaHtmlSearch *self, const char *xpath, QuickMediaHtmlSearchResultCallback result_callback, void *userdata);
#ifdef __cplusplus
}