diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-04-04 00:38:31 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-04-04 00:38:31 +0000 |
commit | a70196587f7213a6b25791b3faa6590674829ba1 (patch) | |
tree | f42b494d684b364f6c7a3ee6b853400625ba6014 | |
parent | a3afa7e6b09d01d1a7b6a8ab0b94217e392f7cb9 (diff) | |
download | libhubbub-a70196587f7213a6b25791b3faa6590674829ba1.tar.gz libhubbub-a70196587f7213a6b25791b3faa6590674829ba1.tar.bz2 |
hubbub_alloc -> hubbub_allocator_fn
svn path=/trunk/hubbub/; revision=7043
-rw-r--r-- | include/hubbub/functypes.h | 2 | ||||
-rw-r--r-- | include/hubbub/hubbub.h | 4 | ||||
-rw-r--r-- | include/hubbub/parser.h | 2 | ||||
-rw-r--r-- | src/hubbub.c | 6 | ||||
-rw-r--r-- | src/parser.c | 4 | ||||
-rw-r--r-- | src/tokeniser/entities.c | 4 | ||||
-rw-r--r-- | src/tokeniser/entities.h | 4 | ||||
-rw-r--r-- | src/tokeniser/tokeniser.c | 5 | ||||
-rw-r--r-- | src/tokeniser/tokeniser.h | 3 | ||||
-rw-r--r-- | src/treebuilder/internal.h | 2 | ||||
-rw-r--r-- | src/treebuilder/treebuilder.c | 3 | ||||
-rw-r--r-- | src/treebuilder/treebuilder.h | 3 | ||||
-rw-r--r-- | src/utils/dict.c | 4 | ||||
-rw-r--r-- | src/utils/dict.h | 2 |
14 files changed, 26 insertions, 22 deletions
diff --git a/include/hubbub/functypes.h b/include/hubbub/functypes.h index f7f2467..021c403 100644 --- a/include/hubbub/functypes.h +++ b/include/hubbub/functypes.h @@ -24,7 +24,7 @@ * \param pw Pointer to client data * \return Pointer to allocated object, or NULL on failure */ -typedef void *(*hubbub_alloc)(void *ptr, size_t size, void *pw); +typedef void *(*hubbub_allocator_fn)(void *ptr, size_t size, void *pw); /** * Type of token handling function diff --git a/include/hubbub/hubbub.h b/include/hubbub/hubbub.h index 8a15eca..7de7e5c 100644 --- a/include/hubbub/hubbub.h +++ b/include/hubbub/hubbub.h @@ -14,10 +14,10 @@ /* Initialise the Hubbub library for use */ hubbub_error hubbub_initialise(const char *aliases_file, - hubbub_alloc alloc, void *pw); + hubbub_allocator_fn alloc, void *pw); /* Clean up after Hubbub */ -hubbub_error hubbub_finalise(hubbub_alloc alloc, void *pw); +hubbub_error hubbub_finalise(hubbub_allocator_fn alloc, void *pw); #endif diff --git a/include/hubbub/parser.h b/include/hubbub/parser.h index 803ec21..5716d0d 100644 --- a/include/hubbub/parser.h +++ b/include/hubbub/parser.h @@ -57,7 +57,7 @@ typedef union hubbub_parser_optparams { /* Create a hubbub parser */ hubbub_error hubbub_parser_create(const char *enc, bool fix_enc, - hubbub_alloc alloc, void *pw, hubbub_parser **parser); + hubbub_allocator_fn alloc, void *pw, hubbub_parser **parser); /* Destroy a hubbub parser */ hubbub_error hubbub_parser_destroy(hubbub_parser *parser); diff --git a/src/hubbub.c b/src/hubbub.c index 32ef9ec..94d6a49 100644 --- a/src/hubbub.c +++ b/src/hubbub.c @@ -23,7 +23,7 @@ * \return HUBBUB_OK on success, applicable error otherwise. */ hubbub_error hubbub_initialise(const char *aliases_file, - hubbub_alloc alloc, void *pw) + hubbub_allocator_fn alloc, void *pw) { hubbub_error error; @@ -48,10 +48,10 @@ hubbub_error hubbub_initialise(const char *aliases_file, * Clean up after Hubbub * * \param alloc Pointer to (de)allocation function - * \param pw Pointer to client-specific private data (may be NULL) + * \param pw Pointer to client-specific private data (may be NULL) * \return HUBBUB_OK on success, applicable error otherwise. */ -hubbub_error hubbub_finalise(hubbub_alloc alloc, void *pw) +hubbub_error hubbub_finalise(hubbub_allocator_fn alloc, void *pw) { if (alloc == NULL) return HUBBUB_BADPARM; diff --git a/src/parser.c b/src/parser.c index 6cf1b77..79b10ab 100644 --- a/src/parser.c +++ b/src/parser.c @@ -26,7 +26,7 @@ struct hubbub_parser { hubbub_tokeniser *tok; /**< Tokeniser instance */ hubbub_treebuilder *tb; /**< Treebuilder instance */ - hubbub_alloc alloc; /**< Memory (de)allocation function */ + hubbub_allocator_fn alloc; /**< Memory (de)allocation function */ void *pw; /**< Client data */ }; @@ -44,7 +44,7 @@ struct hubbub_parser { * HUBBUB_BADENCODING if ::enc is unsupported */ hubbub_error hubbub_parser_create(const char *enc, bool fix_enc, - hubbub_alloc alloc, void *pw, hubbub_parser **parser) + hubbub_allocator_fn alloc, void *pw, hubbub_parser **parser) { parserutils_error perror; hubbub_error error; diff --git a/src/tokeniser/entities.c b/src/tokeniser/entities.c index 8bea1aa..b06ed28 100644 --- a/src/tokeniser/entities.c +++ b/src/tokeniser/entities.c @@ -2166,7 +2166,7 @@ static hubbub_dict *dict; * \param pw Pointer to client-specific private data (may be NULL) * \return HUBBUB_OK on success, appropriate error otherwise */ -hubbub_error hubbub_entities_create(hubbub_alloc alloc, void *pw) +hubbub_error hubbub_entities_create(hubbub_allocator_fn alloc, void *pw) { hubbub_error error; size_t i; @@ -2196,7 +2196,7 @@ hubbub_error hubbub_entities_create(hubbub_alloc alloc, void *pw) * \param alloc Memory (de)allocation function * \param pw Pointer to client-specific private data (may be NULL) */ -void hubbub_entities_destroy(hubbub_alloc alloc, void *pw) +void hubbub_entities_destroy(hubbub_allocator_fn alloc, void *pw) { UNUSED(alloc); UNUSED(pw); diff --git a/src/tokeniser/entities.h b/src/tokeniser/entities.h index efd1987..1cc091a 100644 --- a/src/tokeniser/entities.h +++ b/src/tokeniser/entities.h @@ -14,9 +14,9 @@ #include <hubbub/functypes.h> /* Create the entities dictionary */ -hubbub_error hubbub_entities_create(hubbub_alloc alloc, void *pw); +hubbub_error hubbub_entities_create(hubbub_allocator_fn alloc, void *pw); /* Destroy the entities dictionary */ -void hubbub_entities_destroy(hubbub_alloc alloc, void *pw); +void hubbub_entities_destroy(hubbub_allocator_fn alloc, void *pw); /* Step-wise search for an entity in the dictionary */ hubbub_error hubbub_entities_search_step(uint8_t c, uint32_t *result, diff --git a/src/tokeniser/tokeniser.c b/src/tokeniser/tokeniser.c index 3b2fa9e..5ef6ef8 100644 --- a/src/tokeniser/tokeniser.c +++ b/src/tokeniser/tokeniser.c @@ -178,7 +178,7 @@ struct hubbub_tokeniser { hubbub_error_handler error_handler; /**< Error handling callback */ void *error_pw; /**< Error handler data */ - hubbub_alloc alloc; /**< Memory (de)allocation function */ + hubbub_allocator_fn alloc; /**< Memory (de)allocation function */ void *alloc_pw; /**< Client private data */ }; @@ -284,7 +284,8 @@ static hubbub_error hubbub_tokeniser_emit_token(hubbub_tokeniser *tokeniser, * HUBBUB_NOMEM on memory exhaustion */ hubbub_error hubbub_tokeniser_create(parserutils_inputstream *input, - hubbub_alloc alloc, void *pw, hubbub_tokeniser **tokeniser) + hubbub_allocator_fn alloc, void *pw, + hubbub_tokeniser **tokeniser) { parserutils_error perror; hubbub_tokeniser *tok; diff --git a/src/tokeniser/tokeniser.h b/src/tokeniser/tokeniser.h index 0ccb7d1..4a9f362 100644 --- a/src/tokeniser/tokeniser.h +++ b/src/tokeniser/tokeniser.h @@ -52,7 +52,8 @@ typedef union hubbub_tokeniser_optparams { /* Create a hubbub tokeniser */ hubbub_error hubbub_tokeniser_create(parserutils_inputstream *input, - hubbub_alloc alloc, void *pw, hubbub_tokeniser **tokeniser); + hubbub_allocator_fn alloc, void *pw, + hubbub_tokeniser **tokeniser); /* Destroy a hubbub tokeniser */ hubbub_error hubbub_tokeniser_destroy(hubbub_tokeniser *tokeniser); diff --git a/src/treebuilder/internal.h b/src/treebuilder/internal.h index 823ed01..2b20fbf 100644 --- a/src/treebuilder/internal.h +++ b/src/treebuilder/internal.h @@ -124,7 +124,7 @@ struct hubbub_treebuilder hubbub_error_handler error_handler; /**< Error handler */ void *error_pw; /**< Error handler data */ - hubbub_alloc alloc; /**< Memory (de)allocation function */ + hubbub_allocator_fn alloc; /**< Memory (de)allocation function */ void *alloc_pw; /**< Client private data */ }; diff --git a/src/treebuilder/treebuilder.c b/src/treebuilder/treebuilder.c index 754d246..ec5f825 100644 --- a/src/treebuilder/treebuilder.c +++ b/src/treebuilder/treebuilder.c @@ -93,7 +93,8 @@ static bool is_form_associated(element_type type); * HUBBUB_NOMEM on memory exhaustion */ hubbub_error hubbub_treebuilder_create(hubbub_tokeniser *tokeniser, - hubbub_alloc alloc, void *pw, hubbub_treebuilder **treebuilder) + hubbub_allocator_fn alloc, void *pw, + hubbub_treebuilder **treebuilder) { hubbub_error error; hubbub_treebuilder *tb; diff --git a/src/treebuilder/treebuilder.h b/src/treebuilder/treebuilder.h index ba5db1a..ab87cea 100644 --- a/src/treebuilder/treebuilder.h +++ b/src/treebuilder/treebuilder.h @@ -48,7 +48,8 @@ typedef union hubbub_treebuilder_optparams { /* Create a hubbub treebuilder */ hubbub_error hubbub_treebuilder_create(hubbub_tokeniser *tokeniser, - hubbub_alloc alloc, void *pw, hubbub_treebuilder **treebuilder); + hubbub_allocator_fn alloc, void *pw, + hubbub_treebuilder **treebuilder); /* Destroy a hubbub treebuilder */ hubbub_error hubbub_treebuilder_destroy(hubbub_treebuilder *treebuilder); diff --git a/src/utils/dict.c b/src/utils/dict.c index 7bd2df7..8dd6adf 100644 --- a/src/utils/dict.c +++ b/src/utils/dict.c @@ -25,7 +25,7 @@ typedef struct hubbub_dict_node { struct hubbub_dict { hubbub_dict_node *dict; /**< Root of tree */ - hubbub_alloc alloc; /**< Memory (de)allocation function */ + hubbub_allocator_fn alloc; /**< Memory (de)allocation function */ void *pw; /**< Pointer to client data */ }; @@ -46,7 +46,7 @@ static hubbub_dict_node *hubbub_dict_insert_internal(hubbub_dict *dict, * HUBBUB_BADPARM on bad parameters, * HUBBUB_NOMEM on memory exhaustion */ -hubbub_error hubbub_dict_create(hubbub_alloc alloc, void *pw, +hubbub_error hubbub_dict_create(hubbub_allocator_fn alloc, void *pw, hubbub_dict **dict) { hubbub_dict *d; diff --git a/src/utils/dict.h b/src/utils/dict.h index 4ea4440..9718542 100644 --- a/src/utils/dict.h +++ b/src/utils/dict.h @@ -16,7 +16,7 @@ typedef struct hubbub_dict hubbub_dict; /* Create a dictionary */ -hubbub_error hubbub_dict_create(hubbub_alloc alloc, void *pw, +hubbub_error hubbub_dict_create(hubbub_allocator_fn alloc, void *pw, hubbub_dict **dict); /* Destroy a dictionary */ hubbub_error hubbub_dict_destroy(hubbub_dict *dict); |