}
}
-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**")) {
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);
#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;
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);
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;
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}
};
}
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;
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);
}
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}
};
#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;
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}
};
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}
};
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);
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}
};
}
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}
};