*) Introduce "ap_conf_vector_t" type to assist with legibility and provide

some type safety. (unfortunately, our old "void*" is type-safe with the
   new one, but over time we should be better)

*) Propagate the new type to all appropriate functions.

*) Random cleaning, whitespace, stylistic nits.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88225 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Greg Stein
2001-02-18 02:58:53 +00:00
parent 19d4d315ef
commit dd9b08e321
16 changed files with 277 additions and 262 deletions

View File

@ -60,42 +60,61 @@
#include "apr_want.h"
#include "httpd.h"
#include "http_config.h"
#ifdef AP_DEBUG
# undef strchr
/* get rid of the macros we defined in httpd.h */
#undef strchr
#undef strrchr
#undef strstr
char *ap_strchr(char *s, int c)
{
return strchr(s,c);
}
const char *ap_strchr_c(const char *s, int c)
{
return strchr(s,c);
}
# undef strrchr
char *ap_strrchr(char *s, int c)
{
return strrchr(s,c);
}
const char *ap_strrchr_c(const char *s, int c)
{
return strrchr(s,c);
}
#undef strstr
char *ap_strstr(char *s, char *c)
{
return strstr(s,c);
}
const char *ap_strstr_c(const char *s, const char *c)
{
return strstr(s,c);
}
AP_DECLARE(void *) ap_get_module_config(const ap_conf_vector_t *cv,
const module *m)
{
return ((void **)cv)[m->module_index];
}
/**
* Generic accessors for other modules to set at their own module-specific
* data
* @param conf_vector The vector in which the modules configuration is stored.
* usually r->per_dir_config or s->module_config
* @param m The module to set the data for.
* @param val The module-specific data to set
* @deffunc void ap_set_module_config(ap_conf_vector_t *cv, const module *m, void *val)
*/
AP_DECLARE(void) ap_set_module_config(ap_conf_vector_t *cv, const module *m,
void *val)
{
((void **)cv)[m->module_index] = val;
}
#endif /* AP_DEBUG */