From 04e5f38a5e8e471db41dd010e2c7c0ae9b016601 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Tue, 11 Mar 2008 22:03:28 +0000 Subject: More treebuilder (8.2.4.8) Make tree_handler a pointer rather than value. Check for tree_handler's presence in hubbub_treebuilder_token_handler rather than scattering checks all over the treebuilder code. Add test driver (doesn't actually build a tree but will exercise the core code correctly and verify that the treebuilder code releases all the node references it gains) Enhance quirks mode reporting to distinguish between standards, limited, and full quirks modes. svn path=/trunk/hubbub/; revision=3939 --- include/hubbub/functypes.h | 2 +- include/hubbub/parser.h | 2 +- include/hubbub/types.h | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/hubbub/functypes.h b/include/hubbub/functypes.h index ee8c429..ce95303 100644 --- a/include/hubbub/functypes.h +++ b/include/hubbub/functypes.h @@ -95,7 +95,7 @@ typedef int (*hubbub_tree_clone_node)(void *ctx, void *node, bool deep, /** * Type of tree quirks mode notification function */ -typedef int (*hubbub_tree_set_quirks_mode)(void *ctx, bool quirky); +typedef int (*hubbub_tree_set_quirks_mode)(void *ctx, hubbub_quirks_mode mode); #endif diff --git a/include/hubbub/parser.h b/include/hubbub/parser.h index 5565f63..f7d8e1e 100644 --- a/include/hubbub/parser.h +++ b/include/hubbub/parser.h @@ -52,7 +52,7 @@ typedef union hubbub_parser_optparams { hubbub_content_model model; } content_model; - hubbub_tree_handler tree_handler; + hubbub_tree_handler *tree_handler; void *document_node; } hubbub_parser_optparams; diff --git a/include/hubbub/types.h b/include/hubbub/types.h index 57518ae..922bdbb 100644 --- a/include/hubbub/types.h +++ b/include/hubbub/types.h @@ -32,6 +32,15 @@ typedef enum hubbub_content_model { HUBBUB_CONTENT_MODEL_PLAINTEXT } hubbub_content_model; +/** + * Quirks mode flag + */ +typedef enum hubbub_quirks_mode { + HUBBUB_QUIRKS_MODE_NONE, + HUBBUB_QUIRKS_MODE_LIMITED, + HUBBUB_QUIRKS_MODE_FULL +} hubbub_quirks_mode; + /** * Type of an emitted token */ -- cgit v1.2.3