Author: joes Date: Mon Nov 29 14:20:32 2004 New Revision: 106960 URL: http://svn.apache.org/viewcvs?view=rev&rev=106960 Log:
Drop internal apreq_parser_fcn struct. It is simpler to work with a pointer-to-function-pointer, which is (void *)- compatible (even though function-pointers are not). Modified: httpd/apreq/trunk/src/apreq_parsers.c Modified: httpd/apreq/trunk/src/apreq_parsers.c Url: http://svn.apache.org/viewcvs/httpd/apreq/trunk/src/apreq_parsers.c?view=diff&rev=106960&p1=httpd/apreq/trunk/src/apreq_parsers.c&r1=106959&p2=httpd/apreq/trunk/src/apreq_parsers.c&r2=106960 ============================================================================== --- httpd/apreq/trunk/src/apreq_parsers.c (original) +++ httpd/apreq/trunk/src/apreq_parsers.c Mon Nov 29 14:20:32 2004 @@ -109,11 +109,11 @@ APREQ_DECLARE(void) apreq_register_parser(const char *enctype, apr_status_t (*parser) (APREQ_PARSER_ARGS)) { - struct apreq_parser_fcn *f = NULL; + apr_status_t (**f) (APREQ_PARSER_ARGS) = NULL; apreq_parser_initialize(); if (parser != NULL) { f = apr_palloc(default_parser_pool, sizeof *f); - f->parser = parser; + *f = parser; } apr_hash_set(default_parsers, apr_pstrdup(default_parser_pool, enctype), APR_HASH_KEY_STRING, f); @@ -122,10 +122,10 @@ APREQ_DECLARE(apreq_parser_t *)apreq_parser(void *env, apreq_hook_t *hook) { + apr_status_t (**f) (APREQ_PARSER_ARGS); apr_pool_t *pool = apreq_env_pool(env); const char *type = apreq_env_content_type(env); apr_ssize_t tlen; - struct apreq_parser_fcn *f; if (type == NULL || default_parsers == NULL) return NULL; @@ -137,7 +137,7 @@ f = apr_hash_get(default_parsers, type, tlen); if (f != NULL) - return apreq_make_parser(pool, type, f->parser, hook, NULL); + return apreq_make_parser(pool, type, *f, hook, NULL); else return NULL; }
