Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/lexborisov/Modest.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'examples/myhtml/get_title_low_level.c')
-rw-r--r--examples/myhtml/get_title_low_level.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/myhtml/get_title_low_level.c b/examples/myhtml/get_title_low_level.c
index 9c918d2..996911c 100644
--- a/examples/myhtml/get_title_low_level.c
+++ b/examples/myhtml/get_title_low_level.c
@@ -23,6 +23,8 @@
#include <myhtml/myhtml.h>
#include <myhtml/serialization.h>
+#include "example.h"
+
struct res_html {
char *html;
size_t size;
@@ -61,7 +63,7 @@ struct res_html load_html_file(const char* filename)
size_t nread = fread(html, 1, size, fh);
if (nread != size) {
- fprintf(stderr, "could not read %ld bytes (%zu bytes done)\n", size, nread);
+ fprintf(stderr, "could not read %ld bytes (" MyCORE_FMT_Z " bytes done)\n", size, nread);
exit(EXIT_FAILURE);
}
@@ -94,18 +96,18 @@ int main(int argc, const char * argv[])
myhtml_tree_init(tree, myhtml);
// parse html
- myhtml_parse(tree, MyHTML_ENCODING_UTF_8, res.html, res.size);
+ myhtml_parse(tree, MyENCODING_UTF_8, res.html, res.size);
// get title from index
myhtml_collection_t *titles_list = myhtml_get_nodes_by_tag_id(tree, NULL, MyHTML_TAG_TITLE, NULL);
if(titles_list && titles_list->length != 0 && titles_list->list[0]->child) {
- myhtml_string_raw_t str = {0};
+ mycore_string_raw_t str = {0};
myhtml_serialization_node(titles_list->list[0]->child, &str);
printf("%s\n", str.data);
- myhtml_string_raw_destroy(&str, false);
+ mycore_string_raw_destroy(&str, false);
}
// release resources