You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@locus.apache.org on 2000/06/20 13:31:56 UTC
cvs commit: apache-2.0/src/modules/standard mod_alias.c mod_autoindex.c mod_dir.c mod_imap.c mod_negotiation.c mod_userdir.c
trawick 00/06/20 04:31:55
Modified: src/modules/standard mod_alias.c mod_autoindex.c mod_dir.c
mod_imap.c mod_negotiation.c mod_userdir.c
Log:
Use the new command-handler initializer macros in some more modules.
Unfortunately, the resulting warnings are *not* all cleaned up. Ten or
so warnings spill over to non-AP_DEBUG builds (but that just means that
there is a bigger pool of folks to resolve them, right?).
Revision Changes Path
1.12 +26 -24 apache-2.0/src/modules/standard/mod_alias.c
Index: mod_alias.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_alias.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- mod_alias.c 2000/05/27 22:40:34 1.11
+++ mod_alias.c 2000/06/20 11:31:54 1.12
@@ -160,8 +160,8 @@
}
static const char *add_redirect_internal(cmd_parms *cmd, alias_dir_conf * dirconf,
- char *arg1, char *arg2, char *arg3,
- int use_regex)
+ const char *arg1, const char *arg2,
+ const char *arg3, int use_regex)
{
alias_entry *new;
server_rec *s = cmd->server;
@@ -216,8 +216,8 @@
return NULL;
}
-static const char *add_redirect(cmd_parms *cmd, alias_dir_conf * dirconf, char *arg1,
- char *arg2, char *arg3)
+static const char *add_redirect(cmd_parms *cmd, alias_dir_conf * dirconf,
+ const char *arg1, const char *arg2, const char *arg3)
{
return add_redirect_internal(cmd, dirconf, arg1, arg2, arg3, 0);
}
@@ -230,26 +230,28 @@
static const command_rec alias_cmds[] =
{
- {"Alias", add_alias, NULL, RSRC_CONF, TAKE2,
- "a fakename and a realname"},
- {"ScriptAlias", add_alias, "cgi-script", RSRC_CONF, TAKE2,
- "a fakename and a realname"},
- {"Redirect", add_redirect, (void *) HTTP_MOVED_TEMPORARILY,
- OR_FILEINFO, TAKE23,
- "an optional status, then document to be redirected and destination URL"},
- {"AliasMatch", add_alias_regex, NULL, RSRC_CONF, TAKE2,
- "a regular expression and a filename"},
- {"ScriptAliasMatch", add_alias_regex, "cgi-script", RSRC_CONF, TAKE2,
- "a regular expression and a filename"},
- {"RedirectMatch", add_redirect_regex, (void *) HTTP_MOVED_TEMPORARILY,
- OR_FILEINFO, TAKE23,
- "an optional status, then a regular expression and destination URL"},
- {"RedirectTemp", add_redirect, (void *) HTTP_MOVED_TEMPORARILY,
- OR_FILEINFO, TAKE2,
- "a document to be redirected, then the destination URL"},
- {"RedirectPermanent", add_redirect, (void *) HTTP_MOVED_PERMANENTLY,
- OR_FILEINFO, TAKE2,
- "a document to be redirected, then the destination URL"},
+ AP_INIT_TAKE2("Alias", add_alias, NULL, RSRC_CONF,
+ "a fakename and a realname"),
+ AP_INIT_TAKE2("ScriptAlias", add_alias, "cgi-script", RSRC_CONF,
+ "a fakename and a realname"),
+ AP_INIT_TAKE23("Redirect", add_redirect, (void *) HTTP_MOVED_TEMPORARILY,
+ OR_FILEINFO,
+ "an optional status, then document to be redirected and "
+ "destination URL"),
+ AP_INIT_TAKE2("AliasMatch", add_alias_regex, NULL, RSRC_CONF,
+ "a regular expression and a filename"),
+ AP_INIT_TAKE2("ScriptAliasMatch", add_alias_regex, "cgi-script", RSRC_CONF,
+ "a regular expression and a filename"),
+ AP_INIT_TAKE23("RedirectMatch", add_redirect_regex,
+ (void *) HTTP_MOVED_TEMPORARILY, OR_FILEINFO,
+ "an optional status, then a regular expression and "
+ "destination URL"),
+ AP_INIT_TAKE2("RedirectTemp", add_redirect, (void *) HTTP_MOVED_TEMPORARILY,
+ OR_FILEINFO,
+ "a document to be redirected, then the destination URL"),
+ AP_INIT_TAKE2("RedirectPermanent", add_redirect,
+ (void *) HTTP_MOVED_PERMANENTLY, OR_FILEINFO,
+ "a document to be redirected, then the destination URL"),
{NULL}
};
1.34 +37 -35 apache-2.0/src/modules/standard/mod_autoindex.c
Index: mod_autoindex.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_autoindex.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- mod_autoindex.c 2000/06/17 16:29:52 1.33
+++ mod_autoindex.c 2000/06/20 11:31:54 1.34
@@ -232,7 +232,7 @@
}
}
-static const char *add_alt(cmd_parms *cmd, void *d, char *alt, char *to)
+static const char *add_alt(cmd_parms *cmd, void *d, const char *alt, const char *to)
{
if (cmd->info == BY_PATH) {
if (!strcmp(to, "**DIRECTORY**")) {
@@ -248,7 +248,7 @@
return NULL;
}
-static const char *add_icon(cmd_parms *cmd, void *d, char *icon, char *to)
+static const char *add_icon(cmd_parms *cmd, void *d, const char *icon, const char *to)
{
char *iconbak = ap_pstrdup(cmd->pool, icon);
@@ -299,7 +299,7 @@
#define WILDCARDS_REQUIRED 0
#endif
-static const char *add_desc(cmd_parms *cmd, void *d, char *desc, char *to)
+static const char *add_desc(cmd_parms *cmd, void *d, const char *desc, const char *to)
{
autoindex_config_rec *dcfg = (autoindex_config_rec *) d;
ai_desc_t *desc_entry;
@@ -322,20 +322,20 @@
return NULL;
}
-static const char *add_ignore(cmd_parms *cmd, void *d, char *ext)
+static const char *add_ignore(cmd_parms *cmd, void *d, const char *ext)
{
push_item(((autoindex_config_rec *) d)->ign_list, 0, ext, cmd->path, NULL);
return NULL;
}
-static const char *add_header(cmd_parms *cmd, void *d, char *name)
+static const char *add_header(cmd_parms *cmd, void *d, const char *name)
{
push_item(((autoindex_config_rec *) d)->hdr_list, 0, NULL, cmd->path,
name);
return NULL;
}
-static const char *add_readme(cmd_parms *cmd, void *d, char *name)
+static const char *add_readme(cmd_parms *cmd, void *d, const char *name)
{
push_item(((autoindex_config_rec *) d)->rdme_list, 0, NULL, cmd->path,
name);
@@ -498,8 +498,8 @@
return NULL;
}
-static const char *set_default_order(cmd_parms *cmd, void *m, char *direction,
- char *key)
+static const char *set_default_order(cmd_parms *cmd, void *m, const char *direction,
+ const char *key)
{
char temp[4];
autoindex_config_rec *d_cfg = (autoindex_config_rec *) m;
@@ -544,33 +544,35 @@
static const command_rec autoindex_cmds[] =
{
- {"AddIcon", add_icon, BY_PATH, DIR_CMD_PERMS, ITERATE2,
- "an icon URL followed by one or more filenames"},
- {"AddIconByType", add_icon, BY_TYPE, DIR_CMD_PERMS, ITERATE2,
- "an icon URL followed by one or more MIME types"},
- {"AddIconByEncoding", add_icon, BY_ENCODING, DIR_CMD_PERMS, ITERATE2,
- "an icon URL followed by one or more content encodings"},
- {"AddAlt", add_alt, BY_PATH, DIR_CMD_PERMS, ITERATE2,
- "alternate descriptive text followed by one or more filenames"},
- {"AddAltByType", add_alt, BY_TYPE, DIR_CMD_PERMS, ITERATE2,
- "alternate descriptive text followed by one or more MIME types"},
- {"AddAltByEncoding", add_alt, BY_ENCODING, DIR_CMD_PERMS, ITERATE2,
- "alternate descriptive text followed by one or more content encodings"},
- {"IndexOptions", add_opts, NULL, DIR_CMD_PERMS, RAW_ARGS,
- "one or more index options"},
- {"IndexOrderDefault", set_default_order, NULL, DIR_CMD_PERMS, TAKE2,
- "{Ascending,Descending} {Name,Size,Description,Date}"},
- {"IndexIgnore", add_ignore, NULL, DIR_CMD_PERMS, ITERATE,
- "one or more file extensions"},
- {"AddDescription", add_desc, BY_PATH, DIR_CMD_PERMS, ITERATE2,
- "Descriptive text followed by one or more filenames"},
- {"HeaderName", add_header, NULL, DIR_CMD_PERMS, TAKE1, "a filename"},
- {"ReadmeName", add_readme, NULL, DIR_CMD_PERMS, TAKE1, "a filename"},
- {"FancyIndexing", fancy_indexing, NULL, DIR_CMD_PERMS, FLAG,
- "Limited to 'on' or 'off' (superseded by IndexOptions FancyIndexing)"},
- {"DefaultIcon", ap_set_string_slot,
- (void *) XtOffsetOf(autoindex_config_rec, default_icon),
- DIR_CMD_PERMS, TAKE1, "an icon URL"},
+ AP_INIT_ITERATE2("AddIcon", add_icon, BY_PATH, DIR_CMD_PERMS,
+ "an icon URL followed by one or more filenames"),
+ AP_INIT_ITERATE2("AddIconByType", add_icon, BY_TYPE, DIR_CMD_PERMS,
+ "an icon URL followed by one or more MIME types"),
+ AP_INIT_ITERATE2("AddIconByEncoding", add_icon, BY_ENCODING, DIR_CMD_PERMS,
+ "an icon URL followed by one or more content encodings"),
+ AP_INIT_ITERATE2("AddAlt", add_alt, BY_PATH, DIR_CMD_PERMS,
+ "alternate descriptive text followed by one or more filenames"),
+ AP_INIT_ITERATE2("AddAltByType", add_alt, BY_TYPE, DIR_CMD_PERMS,
+ "alternate descriptive text followed by one or more MIME types"),
+ AP_INIT_ITERATE2("AddAltByEncoding", add_alt, BY_ENCODING, DIR_CMD_PERMS,
+ "alternate descriptive text followed by one or more content encodings"),
+ AP_INIT_RAW_ARGS("IndexOptions", add_opts, NULL, DIR_CMD_PERMS,
+ "one or more index options"),
+ AP_INIT_TAKE2("IndexOrderDefault", set_default_order, NULL, DIR_CMD_PERMS,
+ "{Ascending,Descending} {Name,Size,Description,Date}"),
+ AP_INIT_ITERATE("IndexIgnore", add_ignore, NULL, DIR_CMD_PERMS,
+ "one or more file extensions"),
+ AP_INIT_ITERATE2("AddDescription", add_desc, BY_PATH, DIR_CMD_PERMS,
+ "Descriptive text followed by one or more filenames"),
+ AP_INIT_TAKE1("HeaderName", add_header, NULL, DIR_CMD_PERMS,
+ "a filename"),
+ AP_INIT_TAKE1("ReadmeName", add_readme, NULL, DIR_CMD_PERMS,
+ "a filename"),
+ AP_INIT_FLAG("FancyIndexing", fancy_indexing, NULL, DIR_CMD_PERMS,
+ "Limited to 'on' or 'off' (superseded by IndexOptions FancyIndexing)"),
+ AP_INIT_TAKE1("DefaultIcon", ap_set_string_slot,
+ (void *) XtOffsetOf(autoindex_config_rec, default_icon),
+ DIR_CMD_PERMS, "an icon URL"),
{NULL}
};
1.14 +3 -4 apache-2.0/src/modules/standard/mod_dir.c
Index: mod_dir.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_dir.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- mod_dir.c 2000/06/17 11:00:57 1.13
+++ mod_dir.c 2000/06/20 11:31:54 1.14
@@ -78,7 +78,7 @@
#define DIR_CMD_PERMS OR_INDEXES
-static const char *add_index(cmd_parms *cmd, void *dummy, char *arg)
+static const char *add_index(cmd_parms *cmd, void *dummy, const char *arg)
{
dir_config_rec *d = dummy;
@@ -91,9 +91,8 @@
static const command_rec dir_cmds[] =
{
- {"DirectoryIndex", add_index, NULL,
- DIR_CMD_PERMS, ITERATE,
- "a list of file names"},
+ AP_INIT_ITERATE("DirectoryIndex", add_index, NULL, DIR_CMD_PERMS,
+ "a list of file names"),
{NULL}
};
1.15 +11 -9 apache-2.0/src/modules/standard/mod_imap.c
Index: mod_imap.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_imap.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- mod_imap.c 2000/05/27 22:40:37 1.14
+++ mod_imap.c 2000/06/20 11:31:54 1.15
@@ -155,15 +155,17 @@
static const command_rec imap_cmds[] =
{
- {"ImapMenu", ap_set_string_slot,
- (void *) XtOffsetOf(imap_conf_rec, imap_menu), OR_INDEXES, TAKE1,
- "the type of menu generated: none, formatted, semiformatted, unformatted"},
- {"ImapDefault", ap_set_string_slot,
- (void *) XtOffsetOf(imap_conf_rec, imap_default), OR_INDEXES, TAKE1,
- "the action taken if no match: error, nocontent, referer, menu, URL"},
- {"ImapBase", ap_set_string_slot,
- (void *) XtOffsetOf(imap_conf_rec, imap_base), OR_INDEXES, TAKE1,
- "the base for all URL's: map, referer, URL (or start of)"},
+ AP_INIT_TAKE1("ImapMenu", ap_set_string_slot,
+ (void *) XtOffsetOf(imap_conf_rec, imap_menu), OR_INDEXES,
+ "the type of menu generated: none, formatted, semiformatted, "
+ "unformatted"),
+ AP_INIT_TAKE1("ImapDefault", ap_set_string_slot,
+ (void *) XtOffsetOf(imap_conf_rec, imap_default), OR_INDEXES,
+ "the action taken if no match: error, nocontent, referer, "
+ "menu, URL"),
+ AP_INIT_TAKE1("ImapBase", ap_set_string_slot,
+ (void *) XtOffsetOf(imap_conf_rec, imap_base), OR_INDEXES,
+ "the base for all URL's: map, referer, URL (or start of)"),
{NULL}
};
1.31 +5 -5 apache-2.0/src/modules/standard/mod_negotiation.c
Index: mod_negotiation.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_negotiation.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- mod_negotiation.c 2000/06/17 11:00:57 1.30
+++ mod_negotiation.c 2000/06/20 11:31:54 1.31
@@ -108,7 +108,7 @@
return new;
}
-static const char *set_language_priority(cmd_parms *cmd, void *n, char *lang)
+static const char *set_language_priority(cmd_parms *cmd, void *n, const char *lang)
{
ap_array_header_t *arr = ((neg_dir_config *) n)->language_priority;
char **langp = (char **) ap_push_array(arr);
@@ -134,10 +134,10 @@
static const command_rec negotiation_cmds[] =
{
- {"CacheNegotiatedDocs", cache_negotiated_docs, NULL, RSRC_CONF, FLAG,
- "Either 'on' or 'off' (default)"},
- {"LanguagePriority", set_language_priority, NULL, OR_FILEINFO, ITERATE,
- "space-delimited list of MIME language abbreviations"},
+ AP_INIT_FLAG("CacheNegotiatedDocs", cache_negotiated_docs, NULL, RSRC_CONF,
+ "Either 'on' or 'off' (default)"),
+ AP_INIT_ITERATE("LanguagePriority", set_language_priority, NULL, OR_FILEINFO,
+ "space-delimited list of MIME language abbreviations"),
{NULL}
};
1.12 +4 -2 apache-2.0/src/modules/standard/mod_userdir.c
Index: mod_userdir.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_userdir.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- mod_userdir.c 2000/04/26 07:14:39 1.11
+++ mod_userdir.c 2000/06/20 11:31:54 1.12
@@ -194,8 +194,10 @@
}
static const command_rec userdir_cmds[] = {
- {"UserDir", set_user_dir, NULL, RSRC_CONF, RAW_ARGS,
- "the public subdirectory in users' home directories, or 'disabled', or 'disabled username username...', or 'enabled username username...'"},
+ AP_INIT_RAW_ARGS("UserDir", set_user_dir, NULL, RSRC_CONF,
+ "the public subdirectory in users' home directories, or "
+ "'disabled', or 'disabled username username...', or "
+ "'enabled username username...'"),
{NULL}
};