You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by be...@locus.apache.org on 2000/06/17 18:53:51 UTC
cvs commit: apache-2.0/src/modules/standard mod_env.c mod_log_config.c
ben 00/06/17 09:53:50
Modified: src/include http_config.h
src/modules/standard mod_env.c mod_log_config.c
Log:
More command handler updates.
Revision Changes Path
1.34 +2 -0 apache-2.0/src/include/http_config.h
Index: http_config.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/include/http_config.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- http_config.h 2000/06/17 12:29:53 1.33
+++ http_config.h 2000/06/17 16:53:50 1.34
@@ -131,6 +131,8 @@
{ directive, { .take2=func }, mconfig, where, TAKE2, help }
# define AP_INIT_TAKE12(directive, func, mconfig, where, help) \
{ directive, { .take2=func }, mconfig, where, TAKE12, help }
+# define AP_INIT_TAKE23(directive, func, mconfig, where, help) \
+ { directive, { .take3=func }, mconfig, where, TAKE23, help }
# define AP_INIT_FLAG(directive, func, mconfig, where, help) \
{ directive, { .flag=func }, mconfig, where, FLAG, help }
1.12 +15 -14 apache-2.0/src/modules/standard/mod_env.c
Index: mod_env.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_env.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- mod_env.c 2000/05/27 22:40:36 1.11
+++ mod_env.c 2000/06/17 16:53:50 1.12
@@ -109,7 +109,7 @@
typedef struct {
ap_table_t *vars;
- char *unsetenv;
+ const char *unsetenv;
int vars_present;
} env_dir_config_rec;
@@ -172,10 +172,10 @@
return new;
}
-static const char *add_env_module_vars_passed(cmd_parms *cmd,
- env_dir_config_rec *sconf,
+static const char *add_env_module_vars_passed(cmd_parms *cmd, void *sconf_,
const char *arg)
{
+ env_dir_config_rec *sconf=sconf_;
ap_table_t *vars = sconf->vars;
char *env_var;
char *name_ptr;
@@ -191,10 +191,10 @@
return NULL;
}
-static const char *add_env_module_vars_set(cmd_parms *cmd,
- env_dir_config_rec *sconf,
+static const char *add_env_module_vars_set(cmd_parms *cmd, void *sconf_,
const char *arg)
{
+ env_dir_config_rec *sconf=sconf_;
ap_table_t *vars = sconf->vars;
char *name, *value;
@@ -216,10 +216,11 @@
return NULL;
}
-static const char *add_env_module_vars_unset(cmd_parms *cmd,
- env_dir_config_rec *sconf,
- char *arg)
+static const char *add_env_module_vars_unset(cmd_parms *cmd, void *sconf_,
+ const char *arg)
{
+ env_dir_config_rec *sconf=sconf_;
+
sconf->unsetenv = sconf->unsetenv ?
ap_pstrcat(cmd->pool, sconf->unsetenv, " ", arg, NULL) :
arg;
@@ -228,12 +229,12 @@
static const command_rec env_module_cmds[] =
{
- {"PassEnv", add_env_module_vars_passed, NULL,
- OR_FILEINFO, RAW_ARGS, "a list of environment variables to pass to CGI."},
- {"SetEnv", add_env_module_vars_set, NULL,
- OR_FILEINFO, RAW_ARGS, "an environment variable name and a value to pass to CGI."},
- {"UnsetEnv", add_env_module_vars_unset, NULL,
- OR_FILEINFO, RAW_ARGS, "a list of variables to remove from the CGI environment."},
+AP_INIT_RAW_ARGS("PassEnv", add_env_module_vars_passed, NULL,
+ OR_FILEINFO, "a list of environment variables to pass to CGI."),
+AP_INIT_RAW_ARGS("SetEnv", add_env_module_vars_set, NULL,
+ OR_FILEINFO, "an environment variable name and a value to pass to CGI."),
+AP_INIT_RAW_ARGS("UnsetEnv", add_env_module_vars_unset, NULL,
+ OR_FILEINFO, "a list of variables to remove from the CGI environment."),
{NULL},
};
1.26 +18 -17 apache-2.0/src/modules/standard/mod_log_config.c
Index: mod_log_config.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_log_config.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- mod_log_config.c 2000/06/12 23:03:00 1.25
+++ mod_log_config.c 2000/06/17 16:53:50 1.26
@@ -219,7 +219,7 @@
*/
typedef struct {
- char *default_format_string;
+ const char *default_format_string;
ap_array_header_t *default_format;
ap_array_header_t *config_logs;
ap_array_header_t *server_config_logs;
@@ -236,8 +236,8 @@
*/
typedef struct {
- char *fname;
- char *format_string;
+ const char *fname;
+ const char *format_string;
ap_array_header_t *format;
ap_file_t *log_fd;
char *condition_var;
@@ -917,8 +917,8 @@
/*
* Set the default logfile format, or define a nickname for a format string.
*/
-static const char *log_format(cmd_parms *cmd, void *dummy, char *fmt,
- char *name)
+static const char *log_format(cmd_parms *cmd, void *dummy, const char *fmt,
+ const char *name)
{
const char *err_string = NULL;
multi_log_state *mls = ap_get_module_config(cmd->server->module_config,
@@ -943,8 +943,8 @@
}
-static const char *add_custom_log(cmd_parms *cmd, void *dummy, char *fn,
- char *fmt, char *envclause)
+static const char *add_custom_log(cmd_parms *cmd, void *dummy, const char *fn,
+ const char *fmt, const char *envclause)
{
const char *err_string = NULL;
multi_log_state *mls = ap_get_module_config(cmd->server->module_config,
@@ -977,27 +977,28 @@
return err_string;
}
-static const char *set_transfer_log(cmd_parms *cmd, void *dummy, char *fn)
+static const char *set_transfer_log(cmd_parms *cmd, void *dummy,
+ const char *fn)
{
return add_custom_log(cmd, dummy, fn, NULL, NULL);
}
-static const char *set_cookie_log(cmd_parms *cmd, void *dummy, char *fn)
+static const char *set_cookie_log(cmd_parms *cmd, void *dummy, const char *fn)
{
return add_custom_log(cmd, dummy, fn, "%{Cookie}n \"%r\" %t", NULL);
}
static const command_rec config_log_cmds[] =
{
- {"CustomLog", add_custom_log, NULL, RSRC_CONF, TAKE23,
+AP_INIT_TAKE23("CustomLog", add_custom_log, NULL, RSRC_CONF,
"a file name, a custom log format string or format name, "
- "and an optional \"env=\" clause (see docs)"},
- {"TransferLog", set_transfer_log, NULL, RSRC_CONF, TAKE1,
- "the filename of the access log"},
- {"LogFormat", log_format, NULL, RSRC_CONF, TAKE12,
- "a log format string (see docs) and an optional format name"},
- {"CookieLog", set_cookie_log, NULL, RSRC_CONF, TAKE1,
- "the filename of the cookie log"},
+ "and an optional \"env=\" clause (see docs)"),
+AP_INIT_TAKE1("TransferLog", set_transfer_log, NULL, RSRC_CONF,
+ "the filename of the access log"),
+AP_INIT_TAKE12("LogFormat", log_format, NULL, RSRC_CONF,
+ "a log format string (see docs) and an optional format name"),
+AP_INIT_TAKE1("CookieLog", set_cookie_log, NULL, RSRC_CONF,
+ "the filename of the cookie log"),
{NULL}
};