diff options
Diffstat (limited to 'src/charset/codecs')
-rw-r--r-- | src/charset/codecs/codec_8859.c | 6 | ||||
-rw-r--r-- | src/charset/codecs/codec_ascii.c | 8 | ||||
-rw-r--r-- | src/charset/codecs/codec_ext8.c | 6 | ||||
-rw-r--r-- | src/charset/codecs/codec_impl.h | 4 | ||||
-rw-r--r-- | src/charset/codecs/codec_utf16.c | 8 | ||||
-rw-r--r-- | src/charset/codecs/codec_utf8.c | 6 |
6 files changed, 7 insertions, 31 deletions
diff --git a/src/charset/codecs/codec_8859.c b/src/charset/codecs/codec_8859.c index d323ca0..0ab4c32 100644 --- a/src/charset/codecs/codec_8859.c +++ b/src/charset/codecs/codec_8859.c @@ -64,7 +64,6 @@ typedef struct charset_8859_codec { static bool charset_8859_codec_handles_charset(const char *charset); static parserutils_error charset_8859_codec_create(const char *charset, - parserutils_alloc alloc, void *pw, parserutils_charset_codec **codec); static parserutils_error charset_8859_codec_destroy( parserutils_charset_codec *codec); @@ -123,15 +122,12 @@ bool charset_8859_codec_handles_charset(const char *charset) * Create an ISO-8859-n codec * * \param charset The charset to read from / write to - * \param alloc Memory (de)allocation function - * \param pw Pointer to client-specific private data (may be NULL) * \param codec Pointer to location to receive codec * \return PARSERUTILS_OK on success, * PARSERUTILS_BADPARM on bad parameters, * PARSERUTILS_NOMEM on memory exhausion */ parserutils_error charset_8859_codec_create(const char *charset, - parserutils_alloc alloc, void *pw, parserutils_charset_codec **codec) { uint32_t i; @@ -149,7 +145,7 @@ parserutils_error charset_8859_codec_create(const char *charset, assert(table != NULL); - c = alloc(NULL, sizeof(charset_8859_codec), pw); + c = malloc(sizeof(charset_8859_codec)); if (c == NULL) return PARSERUTILS_NOMEM; diff --git a/src/charset/codecs/codec_ascii.c b/src/charset/codecs/codec_ascii.c index b73280c..64991df 100644 --- a/src/charset/codecs/codec_ascii.c +++ b/src/charset/codecs/codec_ascii.c @@ -37,8 +37,7 @@ typedef struct charset_ascii_codec { static bool charset_ascii_codec_handles_charset(const char *charset); static parserutils_error charset_ascii_codec_create( - const char *charset, parserutils_alloc alloc, void *pw, - parserutils_charset_codec **codec); + const char *charset, parserutils_charset_codec **codec); static parserutils_error charset_ascii_codec_destroy( parserutils_charset_codec *codec); static parserutils_error charset_ascii_codec_encode( @@ -90,22 +89,19 @@ bool charset_ascii_codec_handles_charset(const char *charset) * Create a US-ASCII codec * * \param charset The charset to read from / write to - * \param alloc Memory (de)allocation function - * \param pw Pointer to client-specific private data (may be NULL) * \param codec Pointer to location to receive codec * \return PARSERUTILS_OK on success, * PARSERUTILS_BADPARM on bad parameters, * PARSERUTILS_NOMEM on memory exhausion */ parserutils_error charset_ascii_codec_create(const char *charset, - parserutils_alloc alloc, void *pw, parserutils_charset_codec **codec) { charset_ascii_codec *c; UNUSED(charset); - c = alloc(NULL, sizeof(charset_ascii_codec), pw); + c = malloc(sizeof(charset_ascii_codec)); if (c == NULL) return PARSERUTILS_NOMEM; diff --git a/src/charset/codecs/codec_ext8.c b/src/charset/codecs/codec_ext8.c index 5e7cb8a..eb9c898 100644 --- a/src/charset/codecs/codec_ext8.c +++ b/src/charset/codecs/codec_ext8.c @@ -58,7 +58,6 @@ typedef struct charset_ext8_codec { static bool charset_ext8_codec_handles_charset(const char *charset); static parserutils_error charset_ext8_codec_create(const char *charset, - parserutils_alloc alloc, void *pw, parserutils_charset_codec **codec); static parserutils_error charset_ext8_codec_destroy( parserutils_charset_codec *codec); @@ -117,15 +116,12 @@ bool charset_ext8_codec_handles_charset(const char *charset) * Create an extended 8bit codec * * \param charset The charset to read from / write to - * \param alloc Memory (de)allocation function - * \param pw Pointer to client-specific private data (may be NULL) * \param codec Pointer to location to receive codec * \return PARSERUTILS_OK on success, * PARSERUTILS_BADPARM on bad parameters, * PARSERUTILS_NOMEM on memory exhausion */ parserutils_error charset_ext8_codec_create(const char *charset, - parserutils_alloc alloc, void *pw, parserutils_charset_codec **codec) { uint32_t i; @@ -143,7 +139,7 @@ parserutils_error charset_ext8_codec_create(const char *charset, assert(table != NULL); - c = alloc(NULL, sizeof(charset_ext8_codec), pw); + c = malloc(sizeof(charset_ext8_codec)); if (c == NULL) return PARSERUTILS_NOMEM; diff --git a/src/charset/codecs/codec_impl.h b/src/charset/codecs/codec_impl.h index 09f622c..a14a3f6 100644 --- a/src/charset/codecs/codec_impl.h +++ b/src/charset/codecs/codec_impl.h @@ -21,9 +21,6 @@ struct parserutils_charset_codec { parserutils_charset_codec_errormode errormode; /**< error mode */ - parserutils_alloc alloc; /**< allocation function */ - void *alloc_pw; /**< private word */ - struct { parserutils_error (*destroy)(parserutils_charset_codec *codec); parserutils_error (*encode)(parserutils_charset_codec *codec, @@ -42,7 +39,6 @@ struct parserutils_charset_codec { typedef struct parserutils_charset_handler { bool (*handles_charset)(const char *charset); parserutils_error (*create)(const char *charset, - parserutils_alloc alloc, void *pw, parserutils_charset_codec **codec); } parserutils_charset_handler; diff --git a/src/charset/codecs/codec_utf16.c b/src/charset/codecs/codec_utf16.c index 8dbcae1..19d8bbb 100644 --- a/src/charset/codecs/codec_utf16.c +++ b/src/charset/codecs/codec_utf16.c @@ -42,8 +42,7 @@ typedef struct charset_utf16_codec { } charset_utf16_codec; static bool charset_utf16_codec_handles_charset(const char *charset); -static parserutils_error charset_utf16_codec_create( - const char *charset, parserutils_alloc alloc, void *pw, +static parserutils_error charset_utf16_codec_create(const char *charset, parserutils_charset_codec **codec); static parserutils_error charset_utf16_codec_destroy( parserutils_charset_codec *codec); @@ -82,22 +81,19 @@ bool charset_utf16_codec_handles_charset(const char *charset) * Create a UTF-16 codec * * \param charset The charset to read from / write to - * \param alloc Memory (de)allocation function - * \param pw Pointer to client-specific private data (may be NULL) * \param codec Pointer to location to receive codec * \return PARSERUTILS_OK on success, * PARSERUTILS_BADPARM on bad parameters, * PARSERUTILS_NOMEM on memory exhausion */ parserutils_error charset_utf16_codec_create(const char *charset, - parserutils_alloc alloc, void *pw, parserutils_charset_codec **codec) { charset_utf16_codec *c; UNUSED(charset); - c = alloc(NULL, sizeof(charset_utf16_codec), pw); + c = malloc(sizeof(charset_utf16_codec)); if (c == NULL) return PARSERUTILS_NOMEM; diff --git a/src/charset/codecs/codec_utf8.c b/src/charset/codecs/codec_utf8.c index ceae951..4de7273 100644 --- a/src/charset/codecs/codec_utf8.c +++ b/src/charset/codecs/codec_utf8.c @@ -43,7 +43,6 @@ typedef struct charset_utf8_codec { static bool charset_utf8_codec_handles_charset(const char *charset); static parserutils_error charset_utf8_codec_create(const char *charset, - parserutils_alloc alloc, void *pw, parserutils_charset_codec **codec); static parserutils_error charset_utf8_codec_destroy( parserutils_charset_codec *codec); @@ -83,22 +82,19 @@ bool charset_utf8_codec_handles_charset(const char *charset) * Create a UTF-8 codec * * \param charset The charset to read from / write to - * \param alloc Memory (de)allocation function - * \param pw Pointer to client-specific private data (may be NULL) * \param codec Pointer to location to receive codec * \return PARSERUTILS_OK on success, * PARSERUTILS_BADPARM on bad parameters, * PARSERUTILS_NOMEM on memory exhausion */ parserutils_error charset_utf8_codec_create(const char *charset, - parserutils_alloc alloc, void *pw, parserutils_charset_codec **codec) { charset_utf8_codec *c; UNUSED(charset); - c = alloc(NULL, sizeof(charset_utf8_codec), pw); + c = malloc(sizeof(charset_utf8_codec)); if (c == NULL) return PARSERUTILS_NOMEM; |