http_config.h revision c3f224381c60ae6566ced33d46637edca7a71d56
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen/* ====================================================================
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * The Apache Software License, Version 1.1
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * Redistribution and use in source and binary forms, with or without
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * modification, are permitted provided that the following conditions
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * 1. Redistributions of source code must retain the above copyright
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * notice, this list of conditions and the following disclaimer.
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * 2. Redistributions in binary form must reproduce the above copyright
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * notice, this list of conditions and the following disclaimer in
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * the documentation and/or other materials provided with the
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * distribution.
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * 3. The end-user documentation included with the redistribution,
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * if any, must include the following acknowledgment:
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * "This product includes software developed by the
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * Apache Software Foundation (http://www.apache.org/)."
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * Alternately, this acknowledgment may appear in the software itself,
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * if and wherever such third-party acknowledgments normally appear.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * 4. The names "Apache" and "Apache Software Foundation" must
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * not be used to endorse or promote products derived from this
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * software without prior written permission. For written
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * permission, please contact apache@apache.org.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * 5. Products derived from this software may not be called "Apache",
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * nor may "Apache" appear in their name, without prior written
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * permission of the Apache Software Foundation.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * ====================================================================
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * This software consists of voluntary contributions made by many
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * individuals on behalf of the Apache Software Foundation. For more
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * information on the Apache Software Foundation, please see
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * Portions of this software are based upon public domain software
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * originally written at the National Center for Supercomputing Applications,
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * University of Illinois, Urbana-Champaign.
12b42c76672a66c2d4ea7212c14f8f1b5a62b78dTom Gundersen * @package Apache Configuration
57e27ec0ada6775d85a5201cd25e989d92d0a1afZbigniew Jędrzejewski-Szmek * The central data structures around here...
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek/* Command dispatch structures... */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * How the directives arguments should be parsed.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @tip Note that for all of these except RAW_ARGS, the config routine is
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * passed a freshly allocated string which can be modified or stored
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * or whatever... it's only necessary to do pstrdup() stuff with
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * RAW_ARGS -- cmd_func parses command line itself
102bd40e1ed71c7ab980a90435a1c23d4c786c63Lennart Poettering * TAKE1 -- one argument only
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * TAKE2 -- two arguments only
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * ITERATE -- one argument, occuring multiple times
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * * (e.g., IndexIgnore)
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * ITERATE2 -- two arguments, 2nd occurs multiple times
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * * (e.g., AddIcon)
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * FLAG -- One of 'On' or 'Off'
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * NO_ARGS -- No args at all, e.g. </Directory>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * TAKE12 -- one or two arguments
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * TAKE3 -- three arguments only
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * TAKE23 -- two or three arguments
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * TAKE123 -- one, two or three arguments
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * TAKE13 -- one or three arguments
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @defvar enum cmd_how
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek RAW_ARGS, /* cmd_func parses command line itself */
5256e00e8b9015dd1a976d647fc71dc7efbd8cf8Tom Gundersen ITERATE, /* one argument, occuring multiple times
5256e00e8b9015dd1a976d647fc71dc7efbd8cf8Tom Gundersen * (e.g., IndexIgnore)
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek ITERATE2, /* two arguments, 2nd occurs multiple times
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * (e.g., AddIcon)
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek FLAG, /* One of 'On' or 'Off' */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek NO_ARGS, /* No args at all, e.g. </Directory> */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek TAKE12, /* one or two arguments */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek TAKE13 /* one or three arguments */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmektypedef struct cmd_parms_struct cmd_parms;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek const char *(*no_args) (cmd_parms *parms, void *mconfig);
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek const char *(*raw_args) (cmd_parms *parms, void *mconfig,
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek const char *(*take1) (cmd_parms *parms, void *mconfig, const char *w);
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek const char *(*take2) (cmd_parms *parms, void *mconfig, const char *w,
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek const char *(*take3) (cmd_parms *parms, void *mconfig, const char *w,
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek const char *w2, const char *w3);
5256e00e8b9015dd1a976d647fc71dc7efbd8cf8Tom Gundersen const char *(*flag) (cmd_parms *parms, void *mconfig, int on);
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek# define AP_RAW_ARGS func.raw_args
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek# define AP_INIT_NO_ARGS(directive, func, mconfig, where, help) \
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek { directive, { .no_args=func }, mconfig, where, RAW_ARGS, help }
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek# define AP_INIT_RAW_ARGS(directive, func, mconfig, where, help) \
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek { directive, { .raw_args=func }, mconfig, where, RAW_ARGS, help }
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek# define AP_INIT_TAKE1(directive, func, mconfig, where, help) \
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek { directive, { .take1=func }, mconfig, where, TAKE1, help }
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek# define AP_INIT_ITERATE(directive, func, mconfig, where, help) \
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek { directive, { .take1=func }, mconfig, where, ITERATE, help }
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek# define AP_INIT_TAKE2(directive, func, mconfig, where, help) \
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek { directive, { .take2=func }, mconfig, where, TAKE2, help }
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek# define AP_INIT_TAKE12(directive, func, mconfig, where, help) \
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek { directive, { .take2=func }, mconfig, where, TAKE12, help }
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek# define AP_INIT_ITERATE2(directive, func, mconfig, where, help) \
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek { directive, { .take2=func }, mconfig, where, ITERATE2, help }
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek# define AP_INIT_TAKE23(directive, func, mconfig, where, help) \
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek { directive, { .take3=func }, mconfig, where, TAKE23, help }
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek# define AP_INIT_TAKE3(directive, func, mconfig, where, help) \
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek { directive, { .take3=func }, mconfig, where, TAKE3, help }
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek# define AP_INIT_FLAG(directive, func, mconfig, where, help) \
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek { directive, { .flag=func }, mconfig, where, FLAG, help }
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmektypedef const char *(*cmd_func) ();
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek# define AP_INIT_NO_ARGS(directive, func, mconfig, where, help) \
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek { directive, func, mconfig, where, RAW_ARGS, help }
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek# define AP_INIT_RAW_ARGS(directive, func, mconfig, where, help) \
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek { directive, func, mconfig, where, RAW_ARGS, help }
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen# define AP_INIT_TAKE1(directive, func, mconfig, where, help) \
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek { directive, func, mconfig, where, TAKE1, help }
102bd40e1ed71c7ab980a90435a1c23d4c786c63Lennart Poettering# define AP_INIT_ITERATE(directive, func, mconfig, where, help) \
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek { directive, func, mconfig, where, ITERATE, help }
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek# define AP_INIT_TAKE2(directive, func, mconfig, where, help) \
102bd40e1ed71c7ab980a90435a1c23d4c786c63Lennart Poettering { directive, func, mconfig, where, TAKE2, help }
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek# define AP_INIT_TAKE12(directive, func, mconfig, where, help) \
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek { directive, func, mconfig, where, TAKE12, help }
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen# define AP_INIT_ITERATE2(directive, func, mconfig, where, help) \
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek { directive, func, mconfig, where, ITERATE2, help }
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek# define AP_INIT_TAKE23(directive, func, mconfig, where, help) \
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek { directive, func, mconfig, where, TAKE23, help }
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek# define AP_INIT_TAKE3(directive, func, mconfig, where, help) \
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek { directive, func, mconfig, where, TAKE3, help }
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek# define AP_INIT_FLAG(directive, func, mconfig, where, help) \
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek { directive, func, mconfig, where, FLAG, help }
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmektypedef struct command_struct command_rec;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * The command record structure. Each modules can define a table of these
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * to define the directives it will implement.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** Name of this command */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** The function to be called when this directive is parsed */
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen /** Extra data, for functions which implement multiple commands... */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** What overrides need to be allowed to enable this command. */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** What the command expects as arguments
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @defvar cmd_how args_how*/
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** 'usage' message, in case of syntax errors */
b938cb902c3b5bca807a94b277672c64d6767886Jan Engelhardt/* The allowed locations for a configuration directive are the union of
1c25683e0f40c6169676cc44fa1897082597feecTom Gundersen * those indicated by each set bit in the req_override mask.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * (req_override & RSRC_CONF) => *.conf outside <Directory> or <Location>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * (req_override & ACCESS_CONF) => *.conf inside <Directory> or <Location>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * (req_override & OR_AUTHCFG) => *.conf inside <Directory> or <Location>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * and .htaccess when AllowOverride AuthConfig
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * (req_override & OR_LIMIT) => *.conf inside <Directory> or <Location>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * and .htaccess when AllowOverride Limit
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * (req_override & OR_OPTIONS) => *.conf anywhere
b938cb902c3b5bca807a94b277672c64d6767886Jan Engelhardt * and .htaccess when AllowOverride Options
2e229e0c4c29e8a827be9ffe361741cf5e9aa7afTom Gundersen * (req_override & OR_FILEINFO) => *.conf anywhere
2e229e0c4c29e8a827be9ffe361741cf5e9aa7afTom Gundersen * and .htaccess when AllowOverride FileInfo
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * (req_override & OR_INDEXES) => *.conf anywhere
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * and .htaccess when AllowOverride Indexes
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek#define OR_ALL (OR_LIMIT|OR_OPTIONS|OR_FILEINFO|OR_AUTHCFG|OR_INDEXES)
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * This can be returned by a function if they don't wish to handle
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * a command. Make it something not likely someone will actually use
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * as an error code.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @defvar DECLINE_CMD "\a\b"
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmektypedef struct ap_configfile_t ap_configfile_t;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek/** Common structure for reading of config files / passwd files etc. */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** a getc()-like function
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @deffunc int getch(void *param) */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** a fgets()-like function
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @deffunc void *getstr(void *buf, size_t bufsize, void *param)*/
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek void *(*getstr) (void *buf, size_t bufsiz, void *param);
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** a close hander function
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * @deffunc int close(void *param)*/
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** the argument passed to getch/getstr/close */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** the filename / description */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** current line number, starting at 1 */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * This structure is passed to a command which is being invoked,
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * to carry a large variety of miscellaneous data which is all of
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * use to *somebody*...
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** Argument to command from cmd_table */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** Which allow-override bits are set */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** Which methods are <Limit>ed */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek apr_array_header_t *limited_xmethods;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** Config file structure. */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** the directive specifying this command */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** Pool to allocate new storage in */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** Pool for scratch memory; persists during configuration, but
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * wiped before the first request is served... */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** Server_rec being configured for */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** If configuring for a directory, pathname of that directory.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * NOPE! That's what it meant previous to the existance of <Files>,
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * <Location> and regex matching. Now the only usefulness that can be
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * derived from this field is whether a command is being called in a
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * server context (path == NULL) or being called in a dir context
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * (path != NULL). */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** configuration command */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** per_dir_config vector passed to handle_command */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek struct ap_conf_vector_t *context;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** directive with syntax error */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek const ap_directive_t *err_directive;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmektypedef struct module_struct module;
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * Module structures. Just about everything is dispatched through
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * these, directly or indirectly (through the command and handler
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** API version, *not* module version; check that module is
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * compatible with this version of the server.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** API minor version. Provides API feature milestones. Not checked
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * during module init */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** Index to this modules structures in config vectors. */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** The name of the module's C file */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** The handle for the DSO. Internal use only */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** A pointer to the next module in the list
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @defvar module_struct *next */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** Magic Cookie to identify a module structure; It's mainly
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * important for the DSO facility (see also mod_so). */
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** Function to allow MPMs to re-write command line arguments. This
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * hook is only available to MPMs.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @param The process that the server is running in.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @deffunc void rewrite_args(process_rec *process);
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek void (*rewrite_args) (process_rec *process);
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** Function to allow all modules to create per directory configuration
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @param p The pool to use for all allocations.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @param dir The directory currently being processed.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @return The per-directory structure created
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @deffunc void *create_dir_config(apr_pool_t *p, char *dir)
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek void *(*create_dir_config) (apr_pool_t *p, char *dir);
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** Function to allow all modules to merge the per directory configuration
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * structures for two directories.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @param p The pool to use for all allocations.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @param base_conf The directory structure created for the parent directory.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @param new_conf The directory structure currently being processed.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @return The new per-directory structure created
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @deffunc void *merge_dir_config(apr_pool_t *p, void *base_conf, void *new_conf)
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek void *(*merge_dir_config) (apr_pool_t *p, void *base_conf, void *new_conf);
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** Function to allow all modules to create per server configuration
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @param p The pool to use for all allocations.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @param s The server currently being processed.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @return The per-server structure created
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @deffunc void *create_server_config(apr_pool_t *p, server_rec *dir)
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek void *(*create_server_config) (apr_pool_t *p, server_rec *s);
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** Function to allow all modules to merge the per server configuration
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * structures for two servers.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @param p The pool to use for all allocations.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @param base_conf The directory structure created for the parent directory.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @param new_conf The directory structure currently being processed.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @return The new per-directory structure created
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * @deffunc void *merge_dir_config(apr_pool_t *p, void *base_conf, void *new_conf)
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek void *(*merge_server_config) (apr_pool_t *p, void *base_conf, void *new_conf);
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek /** A command_rec table that describes all of the directives this module
7abaad1ab099b077ebd6452b14ef351483831245poma /** A hook to allow modules to hook other points in the request processing.
7abaad1ab099b077ebd6452b14ef351483831245poma * In this function, modules should call the ap_hook_*() functions to
7abaad1ab099b077ebd6452b14ef351483831245poma * register an interest in a specific step in processing the current
7abaad1ab099b077ebd6452b14ef351483831245poma * request.
7abaad1ab099b077ebd6452b14ef351483831245poma * @param p the pool to use for all allocations
7abaad1ab099b077ebd6452b14ef351483831245poma * @deffunc void register_hooks(void)
7abaad1ab099b077ebd6452b14ef351483831245poma/* Initializer for the first few module slots, which are only
7abaad1ab099b077ebd6452b14ef351483831245poma * really set up once we start running. Note that the first two slots
7abaad1ab099b077ebd6452b14ef351483831245poma * provide a version check; this should allow us to deal with changes to
7abaad1ab099b077ebd6452b14ef351483831245poma * the API. The major number should reflect changes to the API handler table
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * itself or removal of functionality. The minor number should reflect
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * additions of functionality to the existing API. (the server can detect
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen * an old-format module, and either handle it back-compatibly, or at least
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek * signal an error). See src/include/ap_mmn.h for MMN version history.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek#define STANDARD_MODULE_STUFF this_module_needs_to_be_ported_to_apache_2_0
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek#define STANDARD20_MODULE_STUFF MODULE_MAGIC_NUMBER_MAJOR, \
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek#define MPM20_MODULE_STUFF MODULE_MAGIC_NUMBER_MAJOR, \
NULL, \
#ifdef AP_DEBUG
const module *m);
void *val);
#define ap_get_module_config(v,m) \
(((void **)(v))[(m)->module_index])
const char *arg);
AP_DECLARE_NONSTD(const char *) ap_set_file_slot(cmd_parms *cmd, void *struct_ptr, const char *arg);
* @deffunc apr_status_t ap_pcfg_openfile(ap_configfile_t **ret_cfg, apr_pool_t *p, const char *name)
AP_DECLARE(apr_status_t) ap_pcfg_openfile(ap_configfile_t **ret_cfg, apr_pool_t *p, const char *name);
* @deffunc ap_configfile_t *ap_pcfg_open_custom(apr_pool_t *p, const char *descr, void *param, int(*getc_func)(void*), void *(*gets_func) (void *buf, size_t bufsiz, void *param), int(*close_func)(void *param))
void *param,
int(*getc_func)(void*),
* @deffunc char *ap_build_cont_config(apr_pool_t *p, apr_pool_t *temp_pool, cmd_parms *parms, ap_directive_t **current, ap_directive_t **curr_parent, char *orig_directive)
char *orig_directive);
* @deffunc const char *ap_build_config(cmd_parms *parms, apr_pool_t *conf_pool, apr_pool_t *temp_pool, ap_directive_t **conftree)
* @deffunc const char *ap_walk_config(ap_directive_t *conftree, cmd_parms *parms, ap_conf_vector_t *section_vector)
#define NOT_IN_DIR_LOC_FILE (NOT_IN_DIRECTORY|NOT_IN_LOCATION|NOT_IN_FILES) /* <Directory>/<Location>/<Files>*/
#ifdef CORE_PRIVATE
/* For mod_so.c... */
module *m);
/* For http_main.c... */
* @deffunc server_rec *ap_read_config(process_rec *process, apr_pool_t *temp_pool, const char *config_name, ap_directive_t **conftree)
AP_DECLARE(server_rec *) ap_read_config(process_rec *process, apr_pool_t *temp_pool, const char *config_name, ap_directive_t **conftree);
/* For http_request.c... */
/* For http_connection.c... */
/* For http_core.c... (<Directory> command and virtual hosts) */
* @deffunc const char *ap_init_virtual_host(apr_pool_t *p, const char *hostname, server_rec *main_server, server_rec **ps)
/* Module-method dispatchers, also for http_request.c */
AP_CORE_DECLARE(const command_rec *) ap_find_command_in_modules(const char *cmd_name, module **mod);
* @deffunc void *ap_set_config_vectors(server_rec *server, ap_conf_vector_t *section_vector, const char *dir, module *mod, apr_pool_t *pconf)
const char *section,
* @deffunc void ap_run_post_config(apr_pool_t *pconf,apr_pool_t *plog,apr_pool_t *ptemp, server_rec *s)
* @deffunc void ap_run_open_logs(apr_pool_t *pconf,apr_pool_t *plog,apr_pool_t *ptemp, server_rec *s)
#ifdef __cplusplus