summaryrefslogtreecommitdiff
path: root/examples/dom-structure-dump.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/dom-structure-dump.c')
-rw-r--r--examples/dom-structure-dump.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/examples/dom-structure-dump.c b/examples/dom-structure-dump.c
index e6af3b76..0e691e0e 100644
--- a/examples/dom-structure-dump.c
+++ b/examples/dom-structure-dump.c
@@ -46,21 +46,6 @@
#include <dom/dom.h>
#include <dom/bindings/hubbub/parser.h>
-#define UNUSED(x) ((x)=(x))
-
-void test_msg(uint32_t severity, void *ctx, const char *msg, ...)
-{
- va_list l;
-
- UNUSED(ctx);
-
- va_start(l, msg);
-
- fprintf(stderr, "%d: ", severity);
- vfprintf(stderr, msg, l);
- fprintf(stderr, "\n");
-}
-
/**
* Generate a LibDOM document DOM from an HTML file
@@ -79,8 +64,8 @@ dom_document *create_doc_dom_from_file(char *file)
unsigned char buffer[buffer_size];
/* Create Hubbub parser */
- parser = dom_hubbub_parser_create(NULL, true, false, test_msg, NULL,
- NULL, NULL);
+ parser = dom_hubbub_parser_create(NULL, true, false, NULL, NULL,
+ NULL, &doc);
if (parser == NULL) {
printf("Can't create Hubbub Parser\n");
return NULL;
@@ -115,9 +100,6 @@ dom_document *create_doc_dom_from_file(char *file)
return NULL;
}
- /* Get the document */
- doc = dom_hubbub_parser_get_document(parser);
-
/* Finished with parser */
dom_hubbub_parser_destroy(parser);