summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2000-08-07 00:38:23 +0200
committerJeff Trawick <trawick@apache.org>2000-08-07 00:38:23 +0200
commitc30e232c7c0d7238b6e9e6648beb92e7a5bc886f (patch)
treed98e45f4213952fc02e074dd5d25b1e0f96e5a9d /modules
parentRemove some values that aren't needed anymore. These were used at one time (diff)
downloadapache2-c30e232c7c0d7238b6e9e6648beb92e7a5bc886f.tar.xz
apache2-c30e232c7c0d7238b6e9e6648beb92e7a5bc886f.zip
Use AP_INIT_* macros for command_rec [] in a few more modules.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86014 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
-rw-r--r--modules/metadata/mod_cern_meta.c30
-rw-r--r--modules/metadata/mod_expires.c24
-rw-r--r--modules/metadata/mod_usertrack.c18
3 files changed, 42 insertions, 30 deletions
diff --git a/modules/metadata/mod_cern_meta.c b/modules/metadata/mod_cern_meta.c
index 6cbc64ac63..ac719ee852 100644
--- a/modules/metadata/mod_cern_meta.c
+++ b/modules/metadata/mod_cern_meta.c
@@ -170,9 +170,9 @@
module MODULE_VAR_EXPORT cern_meta_module;
typedef struct {
- char *metadir;
- char *metasuffix;
- char *metafiles;
+ const char *metadir;
+ const char *metasuffix;
+ int metafiles;
} cern_meta_dir_config;
static void *create_cern_meta_dir_config(apr_pool_t *p, char *dummy)
@@ -201,20 +201,26 @@ static void *merge_cern_meta_dir_configs(apr_pool_t *p, void *basev, void *addv)
return new;
}
-static const char *set_metadir(cmd_parms *parms, cern_meta_dir_config * dconf, char *arg)
+static const char *set_metadir(cmd_parms *parms, void *in_dconf, const char *arg)
{
+ cern_meta_dir_config *dconf = in_dconf;
+
dconf->metadir = arg;
return NULL;
}
-static const char *set_metasuffix(cmd_parms *parms, cern_meta_dir_config * dconf, char *arg)
+static const char *set_metasuffix(cmd_parms *parms, void *in_dconf, const char *arg)
{
+ cern_meta_dir_config *dconf = in_dconf;
+
dconf->metasuffix = arg;
return NULL;
}
-static const char *set_metafiles(cmd_parms *parms, cern_meta_dir_config * dconf, char *arg)
+static const char *set_metafiles(cmd_parms *parms, void *in_dconf, int arg)
{
+ cern_meta_dir_config *dconf = in_dconf;
+
dconf->metafiles = arg;
return NULL;
}
@@ -222,12 +228,12 @@ static const char *set_metafiles(cmd_parms *parms, cern_meta_dir_config * dconf,
static const command_rec cern_meta_cmds[] =
{
- {"MetaFiles", set_metafiles, NULL, DIR_CMD_PERMS, FLAG,
- "Limited to 'on' or 'off'"},
- {"MetaDir", set_metadir, NULL, DIR_CMD_PERMS, TAKE1,
- "the name of the directory containing meta files"},
- {"MetaSuffix", set_metasuffix, NULL, DIR_CMD_PERMS, TAKE1,
- "the filename suffix for meta files"},
+ AP_INIT_FLAG("MetaFiles", set_metafiles, NULL, DIR_CMD_PERMS,
+ "Limited to 'on' or 'off'"),
+ AP_INIT_TAKE1("MetaDir", set_metadir, NULL, DIR_CMD_PERMS,
+ "the name of the directory containing meta files"),
+ AP_INIT_TAKE1("MetaSuffix", set_metasuffix, NULL, DIR_CMD_PERMS,
+ "the filename suffix for meta files"),
{NULL}
};
diff --git a/modules/metadata/mod_expires.c b/modules/metadata/mod_expires.c
index 5b7342555a..a8bc4a3ca9 100644
--- a/modules/metadata/mod_expires.c
+++ b/modules/metadata/mod_expires.c
@@ -229,8 +229,10 @@ static void *create_dir_expires_config(apr_pool_t *p, char *dummy)
return (void *) new;
}
-static const char *set_expiresactive(cmd_parms *cmd, expires_dir_config * dir_config, int arg)
+static const char *set_expiresactive(cmd_parms *cmd, void *in_dir_config, int arg)
{
+ expires_dir_config *dir_config = in_dir_config;
+
/* if we're here at all it's because someone explicitly
* set the active flag
*/
@@ -347,8 +349,10 @@ static char *check_code(apr_pool_t *p, const char *code, char **real_code)
return NULL;
}
-static const char *set_expiresbytype(cmd_parms *cmd, expires_dir_config * dir_config, char *mime, char *code)
+static const char *set_expiresbytype(cmd_parms *cmd, void *in_dir_config,
+ const char *mime, const char *code)
{
+ expires_dir_config *dir_config = in_dir_config;
char *response, *real_code;
if ((response = check_code(cmd->pool, code, &real_code)) == NULL) {
@@ -359,8 +363,10 @@ static const char *set_expiresbytype(cmd_parms *cmd, expires_dir_config * dir_co
"'ExpiresByType ", mime, " ", code, "': ", response, NULL);
}
-static const char *set_expiresdefault(cmd_parms *cmd, expires_dir_config * dir_config, char *code)
+static const char *set_expiresdefault(cmd_parms *cmd, void *in_dir_config,
+ const char *code)
{
+ expires_dir_config * dir_config = in_dir_config;
char *response, *real_code;
if ((response = check_code(cmd->pool, code, &real_code)) == NULL) {
@@ -373,12 +379,12 @@ static const char *set_expiresdefault(cmd_parms *cmd, expires_dir_config * dir_c
static const command_rec expires_cmds[] =
{
- {"ExpiresActive", set_expiresactive, NULL, DIR_CMD_PERMS, FLAG,
- "Limited to 'on' or 'off'"},
- {"ExpiresBytype", set_expiresbytype, NULL, DIR_CMD_PERMS, TAKE2,
- "a MIME type followed by an expiry date code"},
- {"ExpiresDefault", set_expiresdefault, NULL, DIR_CMD_PERMS, TAKE1,
- "an expiry date code"},
+ AP_INIT_FLAG("ExpiresActive", set_expiresactive, NULL, DIR_CMD_PERMS,
+ "Limited to 'on' or 'off'"),
+ AP_INIT_TAKE2("ExpiresBytype", set_expiresbytype, NULL, DIR_CMD_PERMS,
+ "a MIME type followed by an expiry date code"),
+ AP_INIT_TAKE1("ExpiresDefault", set_expiresdefault, NULL, DIR_CMD_PERMS,
+ "an expiry date code"),
{NULL}
};
diff --git a/modules/metadata/mod_usertrack.c b/modules/metadata/mod_usertrack.c
index d21c586d63..12b9f8836a 100644
--- a/modules/metadata/mod_usertrack.c
+++ b/modules/metadata/mod_usertrack.c
@@ -167,14 +167,14 @@ static int spot_cookie(request_rec *r)
cookie_dir_rec *dcfg = ap_get_module_config(r->per_dir_config,
&usertrack_module);
const char *cookie;
- char *value;
+ const char *value;
if (!dcfg->enabled) {
return DECLINED;
}
if ((cookie = apr_table_get(r->headers_in, "Cookie")))
- if ((value = strstr(cookie, dcfg->cookie_name))) {
+ if ((value = ap_strstr_c(cookie, dcfg->cookie_name))) {
char *cookiebuf, *cookieend;
value += strlen(dcfg->cookie_name) + 1; /* Skip over the '=' */
@@ -287,7 +287,7 @@ static const char *set_cookie_exp(cmd_parms *parms, void *dummy, const char *arg
return NULL;
}
-static const char *set_cookie_name(cmd_parms *cmd, void *mconfig, char *name)
+static const char *set_cookie_name(cmd_parms *cmd, void *mconfig, const char *name)
{
cookie_dir_rec *dcfg = (cookie_dir_rec *) mconfig;
@@ -296,12 +296,12 @@ static const char *set_cookie_name(cmd_parms *cmd, void *mconfig, char *name)
}
static const command_rec cookie_log_cmds[] = {
- {"CookieExpires", set_cookie_exp, NULL, RSRC_CONF, TAKE1,
- "an expiry date code"},
- {"CookieTracking", set_cookie_enable, NULL, OR_FILEINFO, FLAG,
- "whether or not to enable cookies"},
- {"CookieName", set_cookie_name, NULL, OR_FILEINFO, TAKE1,
- "name of the tracking cookie"},
+ AP_INIT_TAKE1("CookieExpires", set_cookie_exp, NULL, RSRC_CONF,
+ "an expiry date code"),
+ AP_INIT_FLAG("CookieTracking", set_cookie_enable, NULL, OR_FILEINFO,
+ "whether or not to enable cookies"),
+ AP_INIT_TAKE1("CookieName", set_cookie_name, NULL, OR_FILEINFO,
+ "name of the tracking cookie"),
{NULL}
};
static void register_hooks(void)