Blame include/http_config.h

Packit 90a5c9
/* Licensed to the Apache Software Foundation (ASF) under one or more
Packit 90a5c9
 * contributor license agreements.  See the NOTICE file distributed with
Packit 90a5c9
 * this work for additional information regarding copyright ownership.
Packit 90a5c9
 * The ASF licenses this file to You under the Apache License, Version 2.0
Packit 90a5c9
 * (the "License"); you may not use this file except in compliance with
Packit 90a5c9
 * the License.  You may obtain a copy of the License at
Packit 90a5c9
 *
Packit 90a5c9
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit 90a5c9
 *
Packit 90a5c9
 * Unless required by applicable law or agreed to in writing, software
Packit 90a5c9
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit 90a5c9
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 90a5c9
 * See the License for the specific language governing permissions and
Packit 90a5c9
 * limitations under the License.
Packit 90a5c9
 */
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * @file http_config.h
Packit 90a5c9
 * @brief Apache Configuration
Packit 90a5c9
 *
Packit 90a5c9
 * @defgroup APACHE_CORE_CONFIG Configuration
Packit 90a5c9
 * @ingroup  APACHE_CORE
Packit 90a5c9
 * @{
Packit 90a5c9
 */
Packit 90a5c9
Packit 90a5c9
#ifndef APACHE_HTTP_CONFIG_H
Packit 90a5c9
#define APACHE_HTTP_CONFIG_H
Packit 90a5c9
Packit 90a5c9
#include "util_cfgtree.h"
Packit 90a5c9
#include "ap_config.h"
Packit 90a5c9
#include "apr_tables.h"
Packit 90a5c9
Packit 90a5c9
#ifdef __cplusplus
Packit 90a5c9
extern "C" {
Packit 90a5c9
#endif
Packit 90a5c9
Packit 90a5c9
/*
Packit 90a5c9
 * The central data structures around here...
Packit 90a5c9
 */
Packit 90a5c9
Packit 90a5c9
/* Command dispatch structures... */
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * How the directives arguments should be parsed.
Packit 90a5c9
 * @remark Note that for all of these except RAW_ARGS, the config routine is
Packit 90a5c9
 *      passed a freshly allocated string which can be modified or stored
Packit 90a5c9
 *      or whatever...
Packit 90a5c9
 */
Packit 90a5c9
enum cmd_how {
Packit 90a5c9
    RAW_ARGS,           /**< cmd_func parses command line itself */
Packit 90a5c9
    TAKE1,              /**< one argument only */
Packit 90a5c9
    TAKE2,              /**< two arguments only */
Packit 90a5c9
    ITERATE,            /**< one argument, occurring multiple times
Packit 90a5c9
                         * (e.g., IndexIgnore)
Packit 90a5c9
                         */
Packit 90a5c9
    ITERATE2,           /**< two arguments, 2nd occurs multiple times
Packit 90a5c9
                         * (e.g., AddIcon)
Packit 90a5c9
                         */
Packit 90a5c9
    FLAG,               /**< One of 'On' or 'Off' */
Packit 90a5c9
    NO_ARGS,            /**< No args at all, e.g. </Directory> */
Packit 90a5c9
    TAKE12,             /**< one or two arguments */
Packit 90a5c9
    TAKE3,              /**< three arguments only */
Packit 90a5c9
    TAKE23,             /**< two or three arguments */
Packit 90a5c9
    TAKE123,            /**< one, two or three arguments */
Packit 90a5c9
    TAKE13,             /**< one or three arguments */
Packit 90a5c9
    TAKE_ARGV           /**< an argc and argv are passed */
Packit 90a5c9
};
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * This structure is passed to a command which is being invoked,
Packit 90a5c9
 * to carry a large variety of miscellaneous data which is all of
Packit 90a5c9
 * use to *somebody*...
Packit 90a5c9
 */
Packit 90a5c9
typedef struct cmd_parms_struct cmd_parms;
Packit 90a5c9
Packit 90a5c9
#if defined(AP_HAVE_DESIGNATED_INITIALIZER) || defined(DOXYGEN)
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * All the types of functions that can be used in directives
Packit 90a5c9
 * @internal
Packit 90a5c9
 */
Packit 90a5c9
typedef union {
Packit 90a5c9
    /** function to call for a no-args */
Packit 90a5c9
    const char *(*no_args) (cmd_parms *parms, void *mconfig);
Packit 90a5c9
    /** function to call for a raw-args */
Packit 90a5c9
    const char *(*raw_args) (cmd_parms *parms, void *mconfig,
Packit 90a5c9
                             const char *args);
Packit 90a5c9
    /** function to call for a argv/argc */
Packit 90a5c9
    const char *(*take_argv) (cmd_parms *parms, void *mconfig,
Packit 90a5c9
                             int argc, char *const argv[]);
Packit 90a5c9
    /** function to call for a take1 */
Packit 90a5c9
    const char *(*take1) (cmd_parms *parms, void *mconfig, const char *w);
Packit 90a5c9
    /** function to call for a take2 */
Packit 90a5c9
    const char *(*take2) (cmd_parms *parms, void *mconfig, const char *w,
Packit 90a5c9
                          const char *w2);
Packit 90a5c9
    /** function to call for a take3 */
Packit 90a5c9
    const char *(*take3) (cmd_parms *parms, void *mconfig, const char *w,
Packit 90a5c9
                          const char *w2, const char *w3);
Packit 90a5c9
    /** function to call for a flag */
Packit 90a5c9
    const char *(*flag) (cmd_parms *parms, void *mconfig, int on);
Packit 90a5c9
} cmd_func;
Packit 90a5c9
Packit 90a5c9
/** This configuration directive does not take any arguments */
Packit 90a5c9
# define AP_NO_ARGS     func.no_args
Packit 90a5c9
/** This configuration directive will handle its own parsing of arguments*/
Packit 90a5c9
# define AP_RAW_ARGS    func.raw_args
Packit 90a5c9
/** This configuration directive will handle its own parsing of arguments*/
Packit 90a5c9
# define AP_TAKE_ARGV   func.take_argv
Packit 90a5c9
/** This configuration directive takes 1 argument*/
Packit 90a5c9
# define AP_TAKE1       func.take1
Packit 90a5c9
/** This configuration directive takes 2 arguments */
Packit 90a5c9
# define AP_TAKE2       func.take2
Packit 90a5c9
/** This configuration directive takes 3 arguments */
Packit 90a5c9
# define AP_TAKE3       func.take3
Packit 90a5c9
/** This configuration directive takes a flag (on/off) as a argument*/
Packit 90a5c9
# define AP_FLAG        func.flag
Packit 90a5c9
Packit 90a5c9
/** mechanism for declaring a directive with no arguments */
Packit 90a5c9
# define AP_INIT_NO_ARGS(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, { .no_args=func }, mconfig, where, RAW_ARGS, help }
Packit 90a5c9
/** mechanism for declaring a directive with raw argument parsing */
Packit 90a5c9
# define AP_INIT_RAW_ARGS(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, { .raw_args=func }, mconfig, where, RAW_ARGS, help }
Packit 90a5c9
/** mechanism for declaring a directive with raw argument parsing */
Packit 90a5c9
# define AP_INIT_TAKE_ARGV(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, { .take_argv=func }, mconfig, where, TAKE_ARGV, help }
Packit 90a5c9
/** mechanism for declaring a directive which takes 1 argument */
Packit 90a5c9
# define AP_INIT_TAKE1(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, { .take1=func }, mconfig, where, TAKE1, help }
Packit 90a5c9
/** mechanism for declaring a directive which takes multiple arguments */
Packit 90a5c9
# define AP_INIT_ITERATE(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, { .take1=func }, mconfig, where, ITERATE, help }
Packit 90a5c9
/** mechanism for declaring a directive which takes 2 arguments */
Packit 90a5c9
# define AP_INIT_TAKE2(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, { .take2=func }, mconfig, where, TAKE2, help }
Packit 90a5c9
/** mechanism for declaring a directive which takes 1 or 2 arguments */
Packit 90a5c9
# define AP_INIT_TAKE12(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, { .take2=func }, mconfig, where, TAKE12, help }
Packit 90a5c9
/** mechanism for declaring a directive which takes multiple 2 arguments */
Packit 90a5c9
# define AP_INIT_ITERATE2(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, { .take2=func }, mconfig, where, ITERATE2, help }
Packit 90a5c9
/** mechanism for declaring a directive which takes 1 or 3 arguments */
Packit 90a5c9
# define AP_INIT_TAKE13(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, { .take3=func }, mconfig, where, TAKE13, help }
Packit 90a5c9
/** mechanism for declaring a directive which takes 2 or 3 arguments */
Packit 90a5c9
# define AP_INIT_TAKE23(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, { .take3=func }, mconfig, where, TAKE23, help }
Packit 90a5c9
/** mechanism for declaring a directive which takes 1 to 3 arguments */
Packit 90a5c9
# define AP_INIT_TAKE123(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, { .take3=func }, mconfig, where, TAKE123, help }
Packit 90a5c9
/** mechanism for declaring a directive which takes 3 arguments */
Packit 90a5c9
# define AP_INIT_TAKE3(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, { .take3=func }, mconfig, where, TAKE3, help }
Packit 90a5c9
/** mechanism for declaring a directive which takes a flag (on/off) argument */
Packit 90a5c9
# define AP_INIT_FLAG(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, { .flag=func }, mconfig, where, FLAG, help }
Packit 90a5c9
Packit 90a5c9
#else /* AP_HAVE_DESIGNATED_INITIALIZER */
Packit 90a5c9
Packit 90a5c9
typedef const char *(*cmd_func) ();
Packit 90a5c9
Packit 90a5c9
# define AP_NO_ARGS  func
Packit 90a5c9
# define AP_RAW_ARGS func
Packit 90a5c9
# define AP_TAKE_ARGV func
Packit 90a5c9
# define AP_TAKE1    func
Packit 90a5c9
# define AP_TAKE2    func
Packit 90a5c9
# define AP_TAKE3    func
Packit 90a5c9
# define AP_FLAG     func
Packit 90a5c9
Packit 90a5c9
# define AP_INIT_NO_ARGS(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, func, mconfig, where, RAW_ARGS, help }
Packit 90a5c9
# define AP_INIT_RAW_ARGS(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, func, mconfig, where, RAW_ARGS, help }
Packit 90a5c9
# define AP_INIT_TAKE_ARGV(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, func, mconfig, where, TAKE_ARGV, help }
Packit 90a5c9
# define AP_INIT_TAKE1(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, func, mconfig, where, TAKE1, help }
Packit 90a5c9
# define AP_INIT_ITERATE(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, func, mconfig, where, ITERATE, help }
Packit 90a5c9
# define AP_INIT_TAKE2(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, func, mconfig, where, TAKE2, help }
Packit 90a5c9
# define AP_INIT_TAKE12(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, func, mconfig, where, TAKE12, help }
Packit 90a5c9
# define AP_INIT_ITERATE2(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, func, mconfig, where, ITERATE2, help }
Packit 90a5c9
# define AP_INIT_TAKE13(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, func, mconfig, where, TAKE13, help }
Packit 90a5c9
# define AP_INIT_TAKE23(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, func, mconfig, where, TAKE23, help }
Packit 90a5c9
# define AP_INIT_TAKE123(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, func, mconfig, where, TAKE123, help }
Packit 90a5c9
# define AP_INIT_TAKE3(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, func, mconfig, where, TAKE3, help }
Packit 90a5c9
# define AP_INIT_FLAG(directive, func, mconfig, where, help) \
Packit 90a5c9
    { directive, func, mconfig, where, FLAG, help }
Packit 90a5c9
Packit 90a5c9
#endif /* AP_HAVE_DESIGNATED_INITIALIZER */
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * The command record structure.  Modules can define a table of these
Packit 90a5c9
 * to define the directives it will implement.
Packit 90a5c9
 */
Packit 90a5c9
typedef struct command_struct command_rec;
Packit 90a5c9
struct command_struct {
Packit 90a5c9
    /** Name of this command */
Packit 90a5c9
    const char *name;
Packit 90a5c9
    /** The function to be called when this directive is parsed */
Packit 90a5c9
    cmd_func func;
Packit 90a5c9
    /** Extra data, for functions which implement multiple commands... */
Packit 90a5c9
    void *cmd_data;
Packit 90a5c9
    /** What overrides need to be allowed to enable this command. */
Packit 90a5c9
    int req_override;
Packit 90a5c9
    /** What the command expects as arguments */
Packit 90a5c9
    enum cmd_how args_how;
Packit 90a5c9
Packit 90a5c9
    /** 'usage' message, in case of syntax errors */
Packit 90a5c9
    const char *errmsg;
Packit 90a5c9
};
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * @defgroup ConfigDirectives Allowed locations for configuration directives.
Packit 90a5c9
 *
Packit 90a5c9
 * The allowed locations for a configuration directive are the union of
Packit 90a5c9
 * those indicated by each set bit in the req_override mask.
Packit 90a5c9
 *
Packit 90a5c9
 * @{
Packit 90a5c9
 */
Packit 90a5c9
#define OR_NONE 0             /**< *.conf is not available anywhere in this override */
Packit 90a5c9
#define OR_LIMIT 1           /**< *.conf inside <Directory> or <Location>
Packit 90a5c9
                                and .htaccess when AllowOverride Limit */
Packit 90a5c9
#define OR_OPTIONS 2         /**< *.conf anywhere
Packit 90a5c9
                                and .htaccess when AllowOverride Options */
Packit 90a5c9
#define OR_FILEINFO 4        /**< *.conf anywhere
Packit 90a5c9
                                and .htaccess when AllowOverride FileInfo */
Packit 90a5c9
#define OR_AUTHCFG 8         /**< *.conf inside <Directory> or <Location>
Packit 90a5c9
                                and .htaccess when AllowOverride AuthConfig */
Packit 90a5c9
#define OR_INDEXES 16        /**< *.conf anywhere
Packit 90a5c9
                                and .htaccess when AllowOverride Indexes */
Packit 90a5c9
#define OR_UNSET 32          /**< bit to indicate that AllowOverride has not been set */
Packit 90a5c9
#define ACCESS_CONF 64       /**< *.conf inside <Directory> or <Location> */
Packit 90a5c9
#define RSRC_CONF 128        /**< *.conf outside <Directory> or <Location> */
Packit 90a5c9
#define EXEC_ON_READ 256     /**< force directive to execute a command
Packit 90a5c9
                which would modify the configuration (like including another
Packit 90a5c9
                file, or IFModule */
Packit 90a5c9
/* Flags to determine whether syntax errors in .htaccess should be
Packit 90a5c9
 * treated as nonfatal (log and ignore errors)
Packit 90a5c9
 */
Packit 90a5c9
#define NONFATAL_OVERRIDE 512    /* Violation of AllowOverride rule */
Packit 90a5c9
#define NONFATAL_UNKNOWN 1024    /* Unrecognised directive */
Packit 90a5c9
#define NONFATAL_ALL (NONFATAL_OVERRIDE|NONFATAL_UNKNOWN)
Packit 90a5c9
Packit 90a5c9
#define PROXY_CONF 2048      /**< *.conf inside <Proxy> only */
Packit 90a5c9
Packit 90a5c9
/** this directive can be placed anywhere */
Packit 90a5c9
#define OR_ALL (OR_LIMIT|OR_OPTIONS|OR_FILEINFO|OR_AUTHCFG|OR_INDEXES)
Packit 90a5c9
Packit 90a5c9
/** @} */
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * This can be returned by a function if they don't wish to handle
Packit 90a5c9
 * a command. Make it something not likely someone will actually use
Packit 90a5c9
 * as an error code.
Packit 90a5c9
 */
Packit 90a5c9
#define DECLINE_CMD "\a\b"
Packit 90a5c9
Packit 90a5c9
/** Common structure for reading of config files / passwd files etc. */
Packit 90a5c9
typedef struct ap_configfile_t ap_configfile_t;
Packit 90a5c9
struct ap_configfile_t {
Packit 90a5c9
    /**< an apr_file_getc()-like function */
Packit 90a5c9
    apr_status_t (*getch) (char *ch, void *param);
Packit 90a5c9
    /**< an apr_file_gets()-like function */
Packit 90a5c9
    apr_status_t (*getstr) (void *buf, apr_size_t bufsiz, void *param);
Packit 90a5c9
    /**< a close handler function */
Packit 90a5c9
    apr_status_t (*close) (void *param);
Packit 90a5c9
    /**< the argument passed to getch/getstr/close */
Packit 90a5c9
    void *param;
Packit 90a5c9
    /**< the filename / description */
Packit 90a5c9
    const char *name;
Packit 90a5c9
    /**< current line number, starting at 1 */
Packit 90a5c9
    unsigned line_number;
Packit 90a5c9
};
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * This structure is passed to a command which is being invoked,
Packit 90a5c9
 * to carry a large variety of miscellaneous data which is all of
Packit 90a5c9
 * use to *somebody*...
Packit 90a5c9
 */
Packit 90a5c9
struct cmd_parms_struct {
Packit 90a5c9
    /** Argument to command from cmd_table */
Packit 90a5c9
    void *info;
Packit 90a5c9
    /** Which allow-override bits are set */
Packit 90a5c9
    int override;
Packit 90a5c9
    /** Which allow-override-opts bits are set */
Packit 90a5c9
    int override_opts;
Packit 90a5c9
    /** Table of directives allowed per AllowOverrideList */
Packit 90a5c9
    apr_table_t *override_list;
Packit 90a5c9
    /** Which methods are <Limit>ed */
Packit 90a5c9
    apr_int64_t limited;
Packit 90a5c9
    /** methods which are limited */
Packit 90a5c9
    apr_array_header_t *limited_xmethods;
Packit 90a5c9
    /** methods which are xlimited */
Packit 90a5c9
    ap_method_list_t *xlimited;
Packit 90a5c9
Packit 90a5c9
    /** Config file structure. */
Packit 90a5c9
    ap_configfile_t *config_file;
Packit 90a5c9
    /** the directive specifying this command */
Packit 90a5c9
    ap_directive_t *directive;
Packit 90a5c9
Packit 90a5c9
    /** Pool to allocate new storage in */
Packit 90a5c9
    apr_pool_t *pool;
Packit 90a5c9
    /** Pool for scratch memory; persists during configuration, but
Packit 90a5c9
     *  wiped before the first request is served...  */
Packit 90a5c9
    apr_pool_t *temp_pool;
Packit 90a5c9
    /** Server_rec being configured for */
Packit 90a5c9
    server_rec *server;
Packit 90a5c9
    /** If configuring for a directory, pathname of that directory.
Packit 90a5c9
     *  NOPE!  That's what it meant previous to the existence of <Files>,
Packit 90a5c9
     * <Location> and regex matching.  Now the only usefulness that can be
Packit 90a5c9
     * derived from this field is whether a command is being called in a
Packit 90a5c9
     * server context (path == NULL) or being called in a dir context
Packit 90a5c9
     * (path != NULL).  */
Packit 90a5c9
    char *path;
Packit 90a5c9
    /** configuration command */
Packit 90a5c9
    const command_rec *cmd;
Packit 90a5c9
Packit 90a5c9
    /** per_dir_config vector passed to handle_command */
Packit 90a5c9
    struct ap_conf_vector_t *context;
Packit 90a5c9
    /** directive with syntax error */
Packit 90a5c9
    const ap_directive_t *err_directive;
Packit 90a5c9
Packit 90a5c9
};
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Flags associated with a module.
Packit 90a5c9
 */
Packit 90a5c9
#define AP_MODULE_FLAG_NONE         (0)
Packit 90a5c9
#define AP_MODULE_FLAG_ALWAYS_MERGE (1 << 0)
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Module structures.  Just about everything is dispatched through
Packit 90a5c9
 * these, directly or indirectly (through the command and handler
Packit 90a5c9
 * tables).
Packit 90a5c9
 */
Packit 90a5c9
typedef struct module_struct module;
Packit 90a5c9
struct module_struct {
Packit 90a5c9
    /** API version, *not* module version; check that module is
Packit 90a5c9
     * compatible with this version of the server.
Packit 90a5c9
     */
Packit 90a5c9
    int version;
Packit 90a5c9
    /** API minor version. Provides API feature milestones. Not checked
Packit 90a5c9
     *  during module init */
Packit 90a5c9
    int minor_version;
Packit 90a5c9
    /** Index to this modules structures in config vectors.  */
Packit 90a5c9
    int module_index;
Packit 90a5c9
Packit 90a5c9
    /** The name of the module's C file */
Packit 90a5c9
    const char *name;
Packit 90a5c9
    /** The handle for the DSO.  Internal use only */
Packit 90a5c9
    void *dynamic_load_handle;
Packit 90a5c9
Packit 90a5c9
    /** A pointer to the next module in the list
Packit 90a5c9
     *  @var module_struct *next
Packit 90a5c9
     */
Packit 90a5c9
    struct module_struct *next;
Packit 90a5c9
Packit 90a5c9
    /** Magic Cookie to identify a module structure;  It's mainly
Packit 90a5c9
     *  important for the DSO facility (see also mod_so).  */
Packit 90a5c9
    unsigned long magic;
Packit 90a5c9
Packit 90a5c9
    /** Function to allow MPMs to re-write command line arguments.  This
Packit 90a5c9
     *  hook is only available to MPMs.
Packit 90a5c9
     *  @param The process that the server is running in.
Packit 90a5c9
     */
Packit 90a5c9
    void (*rewrite_args) (process_rec *process);
Packit 90a5c9
    /** Function to allow all modules to create per directory configuration
Packit 90a5c9
     *  structures.
Packit 90a5c9
     *  @param p The pool to use for all allocations.
Packit 90a5c9
     *  @param dir The directory currently being processed.
Packit 90a5c9
     *  @return The per-directory structure created
Packit 90a5c9
     */
Packit 90a5c9
    void *(*create_dir_config) (apr_pool_t *p, char *dir);
Packit 90a5c9
    /** Function to allow all modules to merge the per directory configuration
Packit 90a5c9
     *  structures for two directories.
Packit 90a5c9
     *  @param p The pool to use for all allocations.
Packit 90a5c9
     *  @param base_conf The directory structure created for the parent directory.
Packit 90a5c9
     *  @param new_conf The directory structure currently being processed.
Packit 90a5c9
     *  @return The new per-directory structure created
Packit 90a5c9
     */
Packit 90a5c9
    void *(*merge_dir_config) (apr_pool_t *p, void *base_conf, void *new_conf);
Packit 90a5c9
    /** Function to allow all modules to create per server configuration
Packit 90a5c9
     *  structures.
Packit 90a5c9
     *  @param p The pool to use for all allocations.
Packit 90a5c9
     *  @param s The server currently being processed.
Packit 90a5c9
     *  @return The per-server structure created
Packit 90a5c9
     */
Packit 90a5c9
    void *(*create_server_config) (apr_pool_t *p, server_rec *s);
Packit 90a5c9
    /** Function to allow all modules to merge the per server configuration
Packit 90a5c9
     *  structures for two servers.
Packit 90a5c9
     *  @param p The pool to use for all allocations.
Packit 90a5c9
     *  @param base_conf The directory structure created for the parent directory.
Packit 90a5c9
     *  @param new_conf The directory structure currently being processed.
Packit 90a5c9
     *  @return The new per-directory structure created
Packit 90a5c9
     */
Packit 90a5c9
    void *(*merge_server_config) (apr_pool_t *p, void *base_conf,
Packit 90a5c9
                                  void *new_conf);
Packit 90a5c9
Packit 90a5c9
    /** A command_rec table that describes all of the directives this module
Packit 90a5c9
     * defines. */
Packit 90a5c9
    const command_rec *cmds;
Packit 90a5c9
Packit 90a5c9
    /** A hook to allow modules to hook other points in the request processing.
Packit 90a5c9
     *  In this function, modules should call the ap_hook_*() functions to
Packit 90a5c9
     *  register an interest in a specific step in processing the current
Packit 90a5c9
     *  request.
Packit 90a5c9
     *  @param p the pool to use for all allocations
Packit 90a5c9
     */
Packit 90a5c9
    void (*register_hooks) (apr_pool_t *p);
Packit 90a5c9
Packit 90a5c9
    /** A bitmask of AP_MODULE_FLAG_* */
Packit 90a5c9
    int flags;
Packit 90a5c9
};
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * The AP_MAYBE_UNUSED macro is used for variable declarations that
Packit 90a5c9
 * might potentially exhibit "unused var" warnings on some compilers if
Packit 90a5c9
 * left untreated.
Packit 90a5c9
 * Since static intializers are not part of the C language (C89), making
Packit 90a5c9
 * (void) usage is not possible. However many compiler have proprietary 
Packit 90a5c9
 * mechanism to suppress those warnings.  
Packit 90a5c9
 */
Packit 90a5c9
#ifdef AP_MAYBE_UNUSED
Packit 90a5c9
#elif defined(__GNUC__)
Packit 90a5c9
# define AP_MAYBE_UNUSED(x) x __attribute__((unused)) 
Packit 90a5c9
#elif defined(__LCLINT__)
Packit 90a5c9
# define AP_MAYBE_UNUSED(x) /*@unused@*/ x  
Packit 90a5c9
#else
Packit 90a5c9
# define AP_MAYBE_UNUSED(x) x
Packit 90a5c9
#endif
Packit 90a5c9
    
Packit 90a5c9
/**
Packit 90a5c9
 * The APLOG_USE_MODULE macro is used choose which module a file belongs to.
Packit 90a5c9
 * This is necessary to allow per-module loglevel configuration.
Packit 90a5c9
 *
Packit 90a5c9
 * APLOG_USE_MODULE indirectly sets APLOG_MODULE_INDEX and APLOG_MARK.
Packit 90a5c9
 *
Packit 90a5c9
 * If a module should be backward compatible with versions before 2.3.6,
Packit 90a5c9
 * APLOG_USE_MODULE needs to be enclosed in a ifdef APLOG_USE_MODULE block.
Packit 90a5c9
 *
Packit 90a5c9
 * @param foo name of the module symbol of the current module, without the
Packit 90a5c9
 *            trailing "_module" part
Packit 90a5c9
 * @see APLOG_MARK
Packit 90a5c9
 */
Packit 90a5c9
#define APLOG_USE_MODULE(foo) \
Packit 90a5c9
    extern module AP_MODULE_DECLARE_DATA foo##_module;                  \
Packit 90a5c9
    AP_MAYBE_UNUSED(static int * const aplog_module_index) = &(foo##_module.module_index)
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * AP_DECLARE_MODULE is a convenience macro that combines a call of
Packit 90a5c9
 * APLOG_USE_MODULE with the definition of the module symbol.
Packit 90a5c9
 *
Packit 90a5c9
 * If a module should be backward compatible with versions before 2.3.6,
Packit 90a5c9
 * APLOG_USE_MODULE should be used explicitly instead of AP_DECLARE_MODULE.
Packit 90a5c9
 */
Packit 90a5c9
#define AP_DECLARE_MODULE(foo) \
Packit 90a5c9
    APLOG_USE_MODULE(foo);                         \
Packit 90a5c9
    module AP_MODULE_DECLARE_DATA foo##_module
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * @defgroup ModuleInit Module structure initializers
Packit 90a5c9
 *
Packit 90a5c9
 * Initializer for the first few module slots, which are only
Packit 90a5c9
 * really set up once we start running.  Note that the first two slots
Packit 90a5c9
 * provide a version check; this should allow us to deal with changes to
Packit 90a5c9
 * the API. The major number should reflect changes to the API handler table
Packit 90a5c9
 * itself or removal of functionality. The minor number should reflect
Packit 90a5c9
 * additions of functionality to the existing API. (the server can detect
Packit 90a5c9
 * an old-format module, and either handle it back-compatibly, or at least
Packit 90a5c9
 * signal an error). See src/include/ap_mmn.h for MMN version history.
Packit 90a5c9
 * @{
Packit 90a5c9
 */
Packit 90a5c9
Packit 90a5c9
/** The one used in Apache 1.3, which will deliberately cause an error */
Packit 90a5c9
#define STANDARD_MODULE_STUFF   this_module_needs_to_be_ported_to_apache_2_0
Packit 90a5c9
Packit 90a5c9
/** Use this in all standard modules */
Packit 90a5c9
#define STANDARD20_MODULE_STUFF MODULE_MAGIC_NUMBER_MAJOR, \
Packit 90a5c9
                                MODULE_MAGIC_NUMBER_MINOR, \
Packit 90a5c9
                                -1, \
Packit 90a5c9
                                __FILE__, \
Packit 90a5c9
                                NULL, \
Packit 90a5c9
                                NULL, \
Packit 90a5c9
                                MODULE_MAGIC_COOKIE, \
Packit 90a5c9
                                NULL      /* rewrite args spot */
Packit 90a5c9
Packit 90a5c9
/** Use this only in MPMs */
Packit 90a5c9
#define MPM20_MODULE_STUFF      MODULE_MAGIC_NUMBER_MAJOR, \
Packit 90a5c9
                                MODULE_MAGIC_NUMBER_MINOR, \
Packit 90a5c9
                                -1, \
Packit 90a5c9
                                __FILE__, \
Packit 90a5c9
                                NULL, \
Packit 90a5c9
                                NULL, \
Packit 90a5c9
                                MODULE_MAGIC_COOKIE
Packit 90a5c9
Packit 90a5c9
/** @} */
Packit 90a5c9
Packit 90a5c9
/* CONFIGURATION VECTOR FUNCTIONS */
Packit 90a5c9
Packit 90a5c9
/** configuration vector structure */
Packit 90a5c9
typedef struct ap_conf_vector_t ap_conf_vector_t;
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Generic accessors for other modules to get at their own module-specific
Packit 90a5c9
 * data
Packit 90a5c9
 * @param cv The vector in which the modules configuration is stored.
Packit 90a5c9
 *        usually r->per_dir_config or s->module_config
Packit 90a5c9
 * @param m The module to get the data for.
Packit 90a5c9
 * @return The module-specific data
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void *) ap_get_module_config(const ap_conf_vector_t *cv,
Packit 90a5c9
                                        const module *m);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Generic accessors for other modules to set their own module-specific
Packit 90a5c9
 * data
Packit 90a5c9
 * @param cv The vector in which the modules configuration is stored.
Packit 90a5c9
 *        usually r->per_dir_config or s->module_config
Packit 90a5c9
 * @param m The module to set the data for.
Packit 90a5c9
 * @param val The module-specific data to set
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_set_module_config(ap_conf_vector_t *cv, const module *m,
Packit 90a5c9
                                      void *val);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * When module flags have been introduced, and a way to check this.
Packit 90a5c9
 */
Packit 90a5c9
#define AP_MODULE_FLAGS_MMN_MAJOR 20120211
Packit 90a5c9
#define AP_MODULE_FLAGS_MMN_MINOR 70
Packit 90a5c9
#define AP_MODULE_HAS_FLAGS(m) \
Packit 90a5c9
        AP_MODULE_MAGIC_AT_LEAST(AP_MODULE_FLAGS_MMN_MAJOR, \
Packit 90a5c9
                                 AP_MODULE_FLAGS_MMN_MINOR)
Packit 90a5c9
/**
Packit 90a5c9
 * Generic accessor for the module's flags
Packit 90a5c9
 * @param m The module to get the flags from.
Packit 90a5c9
 * @return The module-specific flags
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(int) ap_get_module_flags(const module *m);
Packit 90a5c9
Packit 90a5c9
#if !defined(AP_DEBUG)
Packit 90a5c9
Packit 90a5c9
#define ap_get_module_config(v,m)       \
Packit 90a5c9
    (((void **)(v))[(m)->module_index])
Packit 90a5c9
#define ap_set_module_config(v,m,val)   \
Packit 90a5c9
    ((((void **)(v))[(m)->module_index]) = (val))
Packit 90a5c9
Packit 90a5c9
#endif /* AP_DEBUG */
Packit 90a5c9
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Generic accessor for modules to get the module-specific loglevel
Packit 90a5c9
 * @param s The server from which to get the loglevel.
Packit 90a5c9
 * @param index The module_index of the module to get the loglevel for.
Packit 90a5c9
 * @return The module-specific loglevel
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(int) ap_get_server_module_loglevel(const server_rec *s, int index);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Generic accessor for modules the module-specific loglevel
Packit 90a5c9
 * @param c The connection from which to get the loglevel.
Packit 90a5c9
 * @param index The module_index of the module to get the loglevel for.
Packit 90a5c9
 * @return The module-specific loglevel
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(int) ap_get_conn_module_loglevel(const conn_rec *c, int index);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Generic accessor for modules the module-specific loglevel
Packit 90a5c9
 * @param c The connection from which to get the loglevel.
Packit 90a5c9
 * @param s The server from which to get the loglevel if c does not have a
Packit 90a5c9
 *          specific loglevel configuration.
Packit 90a5c9
 * @param index The module_index of the module to get the loglevel for.
Packit 90a5c9
 * @return The module-specific loglevel
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(int) ap_get_conn_server_module_loglevel(const conn_rec *c,
Packit 90a5c9
                                                   const server_rec *s,
Packit 90a5c9
                                                   int index);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Generic accessor for modules to get the module-specific loglevel
Packit 90a5c9
 * @param r The request from which to get the loglevel.
Packit 90a5c9
 * @param index The module_index of the module to get the loglevel for.
Packit 90a5c9
 * @return The module-specific loglevel
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(int) ap_get_request_module_loglevel(const request_rec *r, int index);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Accessor to set module-specific loglevel
Packit 90a5c9
 * @param p A pool
Packit 90a5c9
 * @param l The ap_logconf struct to modify.
Packit 90a5c9
 * @param index The module_index of the module to set the loglevel for.
Packit 90a5c9
 * @param level The new log level
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_set_module_loglevel(apr_pool_t *p, struct ap_logconf *l,
Packit 90a5c9
                                        int index, int level);
Packit 90a5c9
Packit 90a5c9
#if !defined(AP_DEBUG)
Packit 90a5c9
Packit 90a5c9
#define ap_get_conn_logconf(c)                     \
Packit 90a5c9
    ((c)->log             ? (c)->log             : \
Packit 90a5c9
     &(c)->base_server->log)
Packit 90a5c9
Packit 90a5c9
#define ap_get_conn_server_logconf(c,s)                             \
Packit 90a5c9
    ( ( (c)->log != &(c)->base_server->log && (c)->log != NULL )  ? \
Packit 90a5c9
      (c)->log                                                    : \
Packit 90a5c9
      &(s)->log )
Packit 90a5c9
Packit 90a5c9
#define ap_get_request_logconf(r)                  \
Packit 90a5c9
    ((r)->log             ? (r)->log             : \
Packit 90a5c9
     (r)->connection->log ? (r)->connection->log : \
Packit 90a5c9
     &(r)->server->log)
Packit 90a5c9
Packit 90a5c9
#define ap_get_module_loglevel(l,i)                                     \
Packit 90a5c9
    (((i) < 0 || (l)->module_levels == NULL || (l)->module_levels[i] < 0) ?  \
Packit 90a5c9
     (l)->level :                                                         \
Packit 90a5c9
     (l)->module_levels[i])
Packit 90a5c9
Packit 90a5c9
#define ap_get_server_module_loglevel(s,i)  \
Packit 90a5c9
    (ap_get_module_loglevel(&(s)->log,i))
Packit 90a5c9
Packit 90a5c9
#define ap_get_conn_module_loglevel(c,i)  \
Packit 90a5c9
    (ap_get_module_loglevel(ap_get_conn_logconf(c),i))
Packit 90a5c9
Packit 90a5c9
#define ap_get_conn_server_module_loglevel(c,s,i)  \
Packit 90a5c9
    (ap_get_module_loglevel(ap_get_conn_server_logconf(c,s),i))
Packit 90a5c9
Packit 90a5c9
#define ap_get_request_module_loglevel(r,i)  \
Packit 90a5c9
    (ap_get_module_loglevel(ap_get_request_logconf(r),i))
Packit 90a5c9
Packit 90a5c9
#endif /* AP_DEBUG */
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Set all module-specific loglevels to val
Packit 90a5c9
 * @param l The log config for which to set the loglevels.
Packit 90a5c9
 * @param val the value to set all loglevels to
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_reset_module_loglevels(struct ap_logconf *l, int val);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Generic command handling function for strings
Packit 90a5c9
 * @param cmd The command parameters for this directive
Packit 90a5c9
 * @param struct_ptr pointer into a given type
Packit 90a5c9
 * @param arg The argument to the directive
Packit 90a5c9
 * @return An error string or NULL on success
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_NONSTD(const char *) ap_set_string_slot(cmd_parms *cmd,
Packit 90a5c9
                                                   void *struct_ptr,
Packit 90a5c9
                                                   const char *arg);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Generic command handling function for integers
Packit 90a5c9
 * @param cmd The command parameters for this directive
Packit 90a5c9
 * @param struct_ptr pointer into a given type
Packit 90a5c9
 * @param arg The argument to the directive
Packit 90a5c9
 * @return An error string or NULL on success
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_NONSTD(const char *) ap_set_int_slot(cmd_parms *cmd,
Packit 90a5c9
                                                void *struct_ptr,
Packit 90a5c9
                                                const char *arg);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Parsing function for log level
Packit 90a5c9
 * @param str The string to parse
Packit 90a5c9
 * @param val The parsed log level
Packit 90a5c9
 * @return An error string or NULL on success
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(const char *) ap_parse_log_level(const char *str, int *val);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Return true if the specified method is limited by being listed in
Packit 90a5c9
 * a <Limit> container, or by *not* being listed in a <LimitExcept>
Packit 90a5c9
 * container.
Packit 90a5c9
 *
Packit 90a5c9
 * @param   method  Pointer to a string specifying the method to check.
Packit 90a5c9
 * @param   cmd     Pointer to the cmd_parms structure passed to the
Packit 90a5c9
 *                  directive handler.
Packit 90a5c9
 * @return  0 if the method is not limited in the current scope
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(int) ap_method_is_limited(cmd_parms *cmd, const char *method);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Generic command handling function for strings, always sets the value
Packit 90a5c9
 * to a lowercase string
Packit 90a5c9
 * @param cmd The command parameters for this directive
Packit 90a5c9
 * @param struct_ptr pointer into a given type
Packit 90a5c9
 * @param arg The argument to the directive
Packit 90a5c9
 * @return An error string or NULL on success
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_NONSTD(const char *) ap_set_string_slot_lower(cmd_parms *cmd,
Packit 90a5c9
                                                         void *struct_ptr,
Packit 90a5c9
                                                         const char *arg);
Packit 90a5c9
/**
Packit 90a5c9
 * Generic command handling function for flags stored in an int
Packit 90a5c9
 * @param cmd The command parameters for this directive
Packit 90a5c9
 * @param struct_ptr pointer into a given type
Packit 90a5c9
 * @param arg The argument to the directive (either 1 or 0)
Packit 90a5c9
 * @return An error string or NULL on success
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_NONSTD(const char *) ap_set_flag_slot(cmd_parms *cmd,
Packit 90a5c9
                                                 void *struct_ptr,
Packit 90a5c9
                                                 int arg);
Packit 90a5c9
/**
Packit 90a5c9
 * Generic command handling function for flags stored in a char
Packit 90a5c9
 * @param cmd The command parameters for this directive
Packit 90a5c9
 * @param struct_ptr pointer into a given type
Packit 90a5c9
 * @param arg The argument to the directive (either 1 or 0)
Packit 90a5c9
 * @return An error string or NULL on success
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_NONSTD(const char *) ap_set_flag_slot_char(cmd_parms *cmd,
Packit 90a5c9
                                                      void *struct_ptr,
Packit 90a5c9
                                                      int arg);
Packit 90a5c9
/**
Packit 90a5c9
 * Generic command handling function for files
Packit 90a5c9
 * @param cmd The command parameters for this directive
Packit 90a5c9
 * @param struct_ptr pointer into a given type
Packit 90a5c9
 * @param arg The argument to the directive
Packit 90a5c9
 * @return An error string or NULL on success
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_NONSTD(const char *) ap_set_file_slot(cmd_parms *cmd,
Packit 90a5c9
                                                 void *struct_ptr,
Packit 90a5c9
                                                 const char *arg);
Packit 90a5c9
/**
Packit 90a5c9
 * Generic command handling function to respond with cmd->help as an error
Packit 90a5c9
 * @param cmd The command parameters for this directive
Packit 90a5c9
 * @param struct_ptr pointer into a given type
Packit 90a5c9
 * @param arg The argument to the directive
Packit 90a5c9
 * @return The cmd->help value as the error string
Packit 90a5c9
 * @note This allows simple declarations such as:
Packit 90a5c9
 * @code
Packit 90a5c9
 *     AP_INIT_RAW_ARGS("Foo", ap_set_deprecated, NULL, OR_ALL,
Packit 90a5c9
 *         "The Foo directive is no longer supported, use Bar"),
Packit 90a5c9
 * @endcode
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_NONSTD(const char *) ap_set_deprecated(cmd_parms *cmd,
Packit 90a5c9
                                                  void *struct_ptr,
Packit 90a5c9
                                                  const char *arg);
Packit 90a5c9
/**
Packit 90a5c9
 * For modules which need to read config files, open logs, etc. this returns
Packit 90a5c9
 * the canonical form of fname made absolute to ap_server_root.
Packit 90a5c9
 * @param p pool to allocate data from
Packit 90a5c9
 * @param fname The file name
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(char *) ap_server_root_relative(apr_pool_t *p, const char *fname);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Compute the name of a run-time file (e.g., shared memory "file") relative
Packit 90a5c9
 * to the appropriate run-time directory.  Absolute paths are returned as-is.
Packit 90a5c9
 * The run-time directory is configured via the DefaultRuntimeDir directive or
Packit 90a5c9
 * at build time.
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(char *) ap_runtime_dir_relative(apr_pool_t *p, const char *fname);
Packit 90a5c9
Packit 90a5c9
/* Finally, the hook for dynamically loading modules in... */
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Add a module to the server
Packit 90a5c9
 * @param m The module structure of the module to add
Packit 90a5c9
 * @param p The pool of the same lifetime as the module
Packit 90a5c9
 * @param s The module's symbol name (used for logging)
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(const char *) ap_add_module(module *m, apr_pool_t *p,
Packit 90a5c9
                                       const char *s);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Remove a module from the server.  There are some caveats:
Packit 90a5c9
 * when the module is removed, its slot is lost so all the current
Packit 90a5c9
 * per-dir and per-server configurations are invalid. So we should
Packit 90a5c9
 * only ever call this function when you are invalidating almost
Packit 90a5c9
 * all our current data. I.e. when doing a restart.
Packit 90a5c9
 * @param m the module structure of the module to remove
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_remove_module(module *m);
Packit 90a5c9
/**
Packit 90a5c9
 * Add a module to the chained modules list and the list of loaded modules
Packit 90a5c9
 * @param mod The module structure of the module to add
Packit 90a5c9
 * @param p The pool with the same lifetime as the module
Packit 90a5c9
 * @param s The module's symbol name (used for logging)
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(const char *) ap_add_loaded_module(module *mod, apr_pool_t *p,
Packit 90a5c9
                                              const char *s);
Packit 90a5c9
/**
Packit 90a5c9
 * Remove a module fromthe chained modules list and the list of loaded modules
Packit 90a5c9
 * @param mod the module structure of the module to remove
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_remove_loaded_module(module *mod);
Packit 90a5c9
/**
Packit 90a5c9
 * Find the name of the specified module
Packit 90a5c9
 * @param m The module to get the name for
Packit 90a5c9
 * @return the name of the module
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(const char *) ap_find_module_name(module *m);
Packit 90a5c9
/**
Packit 90a5c9
 * Find the short name of the module identified by the specified module index
Packit 90a5c9
 * @param module_index The module index to get the name for
Packit 90a5c9
 * @return the name of the module, NULL if not found
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(const char *) ap_find_module_short_name(int module_index);
Packit 90a5c9
/**
Packit 90a5c9
 * Find a module based on the name of the module
Packit 90a5c9
 * @param name the name of the module
Packit 90a5c9
 * @return the module structure if found, NULL otherwise
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(module *) ap_find_linked_module(const char *name);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Open a ap_configfile_t as apr_file_t
Packit 90a5c9
 * @param ret_cfg open ap_configfile_t struct pointer
Packit 90a5c9
 * @param p The pool to allocate the structure from
Packit 90a5c9
 * @param name the name of the file to open
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(apr_status_t) ap_pcfg_openfile(ap_configfile_t **ret_cfg,
Packit 90a5c9
                                          apr_pool_t *p, const char *name);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Allocate a ap_configfile_t handle with user defined functions and params
Packit 90a5c9
 * @param p The pool to allocate from
Packit 90a5c9
 * @param descr The name of the file
Packit 90a5c9
 * @param param The argument passed to getch/getstr/close
Packit 90a5c9
 * @param getc_func The getch function
Packit 90a5c9
 * @param gets_func The getstr function
Packit 90a5c9
 * @param close_func The close function
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(ap_configfile_t *) ap_pcfg_open_custom(apr_pool_t *p,
Packit 90a5c9
    const char *descr,
Packit 90a5c9
    void *param,
Packit 90a5c9
    apr_status_t (*getc_func) (char *ch, void *param),
Packit 90a5c9
    apr_status_t (*gets_func) (void *buf, apr_size_t bufsiz, void *param),
Packit 90a5c9
    apr_status_t (*close_func) (void *param));
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Read one line from open ap_configfile_t, strip leading and trailing
Packit 90a5c9
 * whitespace, increase line number
Packit 90a5c9
 * @param buf place to store the line read
Packit 90a5c9
 * @param bufsize size of the buffer
Packit 90a5c9
 * @param cfp File to read from
Packit 90a5c9
 * @return error status, APR_ENOSPC if bufsize is too small for the line
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(apr_status_t) ap_cfg_getline(char *buf, apr_size_t bufsize, ap_configfile_t *cfp);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Read one char from open configfile_t, increase line number upon LF
Packit 90a5c9
 * @param ch place to store the char read
Packit 90a5c9
 * @param cfp The file to read from
Packit 90a5c9
 * @return error status
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(apr_status_t) ap_cfg_getc(char *ch, ap_configfile_t *cfp);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Detach from open ap_configfile_t, calling the close handler
Packit 90a5c9
 * @param cfp The file to close
Packit 90a5c9
 * @return 1 on success, 0 on failure
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(int) ap_cfg_closefile(ap_configfile_t *cfp);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Convert a return value from ap_cfg_getline or ap_cfg_getc to a user friendly
Packit 90a5c9
 * string.
Packit 90a5c9
 * @param p The pool to allocate the string from
Packit 90a5c9
 * @param cfp The config file
Packit 90a5c9
 * @param rc The return value to convert
Packit 90a5c9
 * @return The error string, NULL if rc == APR_SUCCESS
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(const char *) ap_pcfg_strerror(apr_pool_t *p, ap_configfile_t *cfp,
Packit 90a5c9
                                          apr_status_t rc);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Read all data between the current <foo> and the matching </foo>.  All
Packit 90a5c9
 * of this data is forgotten immediately.
Packit 90a5c9
 * @param cmd The cmd_parms to pass to the directives inside the container
Packit 90a5c9
 * @param directive The directive name to read until
Packit 90a5c9
 * @return Error string on failure, NULL on success
Packit 90a5c9
 * @note If cmd->pool == cmd->temp_pool, ap_soak_end_container() will assume
Packit 90a5c9
 *       .htaccess context and use a lower maximum line length.
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(const char *) ap_soak_end_container(cmd_parms *cmd, char *directive);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Read all data between the current <foo> and the matching </foo> and build
Packit 90a5c9
 * a config tree from it
Packit 90a5c9
 * @param p pool to allocate from
Packit 90a5c9
 * @param temp_pool Temporary pool to allocate from
Packit 90a5c9
 * @param parms The cmd_parms to pass to all directives read
Packit 90a5c9
 * @param current The current node in the tree
Packit 90a5c9
 * @param curr_parent The current parent node
Packit 90a5c9
 * @param orig_directive The directive to read until hit.
Packit 90a5c9
 * @return Error string on failure, NULL on success
Packit 90a5c9
 * @note If p == temp_pool, ap_build_cont_config() will assume .htaccess
Packit 90a5c9
 *       context and use a lower maximum line length.
Packit 90a5c9
*/
Packit 90a5c9
AP_DECLARE(const char *) ap_build_cont_config(apr_pool_t *p,
Packit 90a5c9
                                              apr_pool_t *temp_pool,
Packit 90a5c9
                                              cmd_parms *parms,
Packit 90a5c9
                                              ap_directive_t **current,
Packit 90a5c9
                                              ap_directive_t **curr_parent,
Packit 90a5c9
                                              char *orig_directive);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Build a config tree from a config file
Packit 90a5c9
 * @param parms The cmd_parms to pass to all of the directives in the file
Packit 90a5c9
 * @param conf_pool The pconf pool
Packit 90a5c9
 * @param temp_pool The temporary pool
Packit 90a5c9
 * @param conftree Place to store the root node of the config tree
Packit 90a5c9
 * @return Error string on erro, NULL otherwise
Packit 90a5c9
 * @note If conf_pool == temp_pool, ap_build_config() will assume .htaccess
Packit 90a5c9
 *       context and use a lower maximum line length.
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(const char *) ap_build_config(cmd_parms *parms,
Packit 90a5c9
                                         apr_pool_t *conf_pool,
Packit 90a5c9
                                         apr_pool_t *temp_pool,
Packit 90a5c9
                                         ap_directive_t **conftree);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Walk a config tree and setup the server's internal structures
Packit 90a5c9
 * @param conftree The config tree to walk
Packit 90a5c9
 * @param parms The cmd_parms to pass to all functions
Packit 90a5c9
 * @param section_vector The per-section config vector.
Packit 90a5c9
 * @return Error string on error, NULL otherwise
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(const char *) ap_walk_config(ap_directive_t *conftree,
Packit 90a5c9
                                        cmd_parms *parms,
Packit 90a5c9
                                        ap_conf_vector_t *section_vector);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * @defgroup ap_check_cmd_context Check command context
Packit 90a5c9
 * @{
Packit 90a5c9
 */
Packit 90a5c9
/**
Packit 90a5c9
 * Check the context a command is used in.
Packit 90a5c9
 * @param cmd The command to check
Packit 90a5c9
 * @param forbidden Where the command is forbidden.
Packit 90a5c9
 * @return Error string on error, NULL on success
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(const char *) ap_check_cmd_context(cmd_parms *cmd,
Packit 90a5c9
                                              unsigned forbidden);
Packit 90a5c9
Packit 90a5c9
#define  NOT_IN_VIRTUALHOST     0x01 /**< Forbidden in <VirtualHost> */
Packit 90a5c9
#define  NOT_IN_LIMIT           0x02 /**< Forbidden in <Limit> */
Packit 90a5c9
#define  NOT_IN_DIRECTORY       0x04 /**< Forbidden in <Directory> */
Packit 90a5c9
#define  NOT_IN_LOCATION        0x08 /**< Forbidden in <Location> */
Packit 90a5c9
#define  NOT_IN_FILES           0x10 /**< Forbidden in <Files> or <If>*/
Packit 90a5c9
#define  NOT_IN_HTACCESS        0x20 /**< Forbidden in .htaccess files */
Packit 90a5c9
#define  NOT_IN_PROXY           0x40 /**< Forbidden in <Proxy> */
Packit 90a5c9
/** Forbidden in <Directory>/<Location>/<Files><If>*/
Packit 90a5c9
#define  NOT_IN_DIR_LOC_FILE    (NOT_IN_DIRECTORY|NOT_IN_LOCATION|NOT_IN_FILES)
Packit 90a5c9
/** Forbidden in <Directory>/<Location>/<Files><If><Proxy>*/
Packit 90a5c9
#define  NOT_IN_DIR_CONTEXT     (NOT_IN_LIMIT|NOT_IN_DIR_LOC_FILE|NOT_IN_PROXY)
Packit 90a5c9
/** Forbidden in <VirtualHost>/<Limit>/<Directory>/<Location>/<Files>/<If><Proxy>*/
Packit 90a5c9
#define  GLOBAL_ONLY            (NOT_IN_VIRTUALHOST|NOT_IN_DIR_CONTEXT)
Packit 90a5c9
Packit 90a5c9
/** @} */
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * @brief This structure is used to assign symbol names to module pointers
Packit 90a5c9
 */
Packit 90a5c9
typedef struct {
Packit 90a5c9
    const char *name;
Packit 90a5c9
    module *modp;
Packit 90a5c9
} ap_module_symbol_t;
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * The topmost module in the list
Packit 90a5c9
 * @var module *ap_top_module
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_DATA extern module *ap_top_module;
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Array of all statically linked modules
Packit 90a5c9
 * @var module *ap_prelinked_modules[]
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_DATA extern module *ap_prelinked_modules[];
Packit 90a5c9
/**
Packit 90a5c9
 * Array of all statically linked modulenames (symbols)
Packit 90a5c9
 * @var ap_module_symbol_t ap_prelinked_module_symbols[]
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_DATA extern ap_module_symbol_t ap_prelinked_module_symbols[];
Packit 90a5c9
/**
Packit 90a5c9
 * Array of all preloaded modules
Packit 90a5c9
 * @var module *ap_preloaded_modules[]
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_DATA extern module *ap_preloaded_modules[];
Packit 90a5c9
/**
Packit 90a5c9
 * Array of all loaded modules
Packit 90a5c9
 * @var module **ap_loaded_modules
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_DATA extern module **ap_loaded_modules;
Packit 90a5c9
Packit 90a5c9
/* For mod_so.c... */
Packit 90a5c9
/** Run a single module's two create_config hooks
Packit 90a5c9
 *  @param p the pool to allocate from
Packit 90a5c9
 *  @param s The server to configure for.
Packit 90a5c9
 *  @param m The module to configure
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_single_module_configure(apr_pool_t *p, server_rec *s,
Packit 90a5c9
                                            module *m);
Packit 90a5c9
Packit 90a5c9
/* For http_main.c... */
Packit 90a5c9
/**
Packit 90a5c9
 * Add all of the prelinked modules into the loaded module list
Packit 90a5c9
 * @param process The process that is currently running the server
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(const char *) ap_setup_prelinked_modules(process_rec *process);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Show the preloaded configuration directives, the help string explaining
Packit 90a5c9
 * the directive arguments, in what module they are handled, and in
Packit 90a5c9
 * what parts of the configuration they are allowed.  Used for httpd -h.
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_show_directives(void);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Returns non-zero if a configuration directive of the given name has
Packit 90a5c9
 * been registered by a module at the time of calling.
Packit 90a5c9
 * @param p Pool for temporary allocations
Packit 90a5c9
 * @param name Directive name
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(int) ap_exists_directive(apr_pool_t *p, const char *name);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Show the preloaded module names.  Used for httpd -l.
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_show_modules(void);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Show the MPM name.  Used in reporting modules such as mod_info to
Packit 90a5c9
 * provide extra information to the user
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(const char *) ap_show_mpm(void);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Read all config files and setup the server
Packit 90a5c9
 * @param process The process running the server
Packit 90a5c9
 * @param temp_pool A pool to allocate temporary data from.
Packit 90a5c9
 * @param config_name The name of the config file
Packit 90a5c9
 * @param conftree Place to store the root of the config tree
Packit 90a5c9
 * @return The setup server_rec list.
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(server_rec *) ap_read_config(process_rec *process,
Packit 90a5c9
                                        apr_pool_t *temp_pool,
Packit 90a5c9
                                        const char *config_name,
Packit 90a5c9
                                        ap_directive_t **conftree);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Run all rewrite args hooks for loaded modules
Packit 90a5c9
 * @param process The process currently running the server
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_run_rewrite_args(process_rec *process);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Run the register hooks function for a specified module
Packit 90a5c9
 * @param m The module to run the register hooks function fo
Packit 90a5c9
 * @param p The pool valid for the lifetime of the module
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_register_hooks(module *m, apr_pool_t *p);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Setup all virtual hosts
Packit 90a5c9
 * @param p The pool to allocate from
Packit 90a5c9
 * @param main_server The head of the server_rec list
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_fixup_virtual_hosts(apr_pool_t *p,
Packit 90a5c9
                                        server_rec *main_server);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Reserve some modules slots for modules loaded by other means than
Packit 90a5c9
 * EXEC_ON_READ directives.
Packit 90a5c9
 * Relevant modules should call this in the pre_config stage.
Packit 90a5c9
 * @param count The number of slots to reserve.
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_reserve_module_slots(int count);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Reserve some modules slots for modules loaded by a specific
Packit 90a5c9
 * non-EXEC_ON_READ config directive.
Packit 90a5c9
 * This counts how often the given directive is used in the config and calls
Packit 90a5c9
 * ap_reserve_module_slots() accordingly.
Packit 90a5c9
 * @param directive The name of the directive
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_reserve_module_slots_directive(const char *directive);
Packit 90a5c9
Packit 90a5c9
/* For http_request.c... */
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Setup the config vector for a request_rec
Packit 90a5c9
 * @param p The pool to allocate the config vector from
Packit 90a5c9
 * @return The config vector
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(ap_conf_vector_t*) ap_create_request_config(apr_pool_t *p);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Setup the config vector for per dir module configs
Packit 90a5c9
 * @param p The pool to allocate the config vector from
Packit 90a5c9
 * @return The config vector
Packit 90a5c9
 */
Packit 90a5c9
AP_CORE_DECLARE(ap_conf_vector_t *) ap_create_per_dir_config(apr_pool_t *p);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Run all of the modules merge per dir config functions
Packit 90a5c9
 * @param p The pool to pass to the merge functions
Packit 90a5c9
 * @param base The base directory config structure
Packit 90a5c9
 * @param new_conf The new directory config structure
Packit 90a5c9
 */
Packit 90a5c9
AP_CORE_DECLARE(ap_conf_vector_t*) ap_merge_per_dir_configs(apr_pool_t *p,
Packit 90a5c9
                                           ap_conf_vector_t *base,
Packit 90a5c9
                                           ap_conf_vector_t *new_conf);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Allocate new ap_logconf and make (deep) copy of old ap_logconf
Packit 90a5c9
 * @param p The pool to alloc from
Packit 90a5c9
 * @param old The ap_logconf to copy (may be NULL)
Packit 90a5c9
 * @return The new ap_logconf struct
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(struct ap_logconf *) ap_new_log_config(apr_pool_t *p,
Packit 90a5c9
                                                  const struct ap_logconf *old);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Merge old ap_logconf into new ap_logconf.
Packit 90a5c9
 * old and new must have the same life time.
Packit 90a5c9
 * @param old_conf The ap_logconf to merge from
Packit 90a5c9
 * @param new_conf The ap_logconf to merge into
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void) ap_merge_log_config(const struct ap_logconf *old_conf,
Packit 90a5c9
                                     struct ap_logconf *new_conf);
Packit 90a5c9
Packit 90a5c9
/* For http_connection.c... */
Packit 90a5c9
/**
Packit 90a5c9
 * Setup the config vector for a connection_rec
Packit 90a5c9
 * @param p The pool to allocate the config vector from
Packit 90a5c9
 * @return The config vector
Packit 90a5c9
 */
Packit 90a5c9
AP_CORE_DECLARE(ap_conf_vector_t*) ap_create_conn_config(apr_pool_t *p);
Packit 90a5c9
Packit 90a5c9
/* For http_core.c... (<Directory> command and virtual hosts) */
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * parse an htaccess file
Packit 90a5c9
 * @param result htaccess_result
Packit 90a5c9
 * @param r The request currently being served
Packit 90a5c9
 * @param override Which overrides are active
Packit 90a5c9
 * @param override_opts Which allow-override-opts bits are set
Packit 90a5c9
 * @param override_list Table of directives allowed for override
Packit 90a5c9
 * @param path The path to the htaccess file
Packit 90a5c9
 * @param access_name The list of possible names for .htaccess files
Packit 90a5c9
 * int The status of the current request
Packit 90a5c9
 */
Packit 90a5c9
AP_CORE_DECLARE(int) ap_parse_htaccess(ap_conf_vector_t **result,
Packit 90a5c9
                                       request_rec *r,
Packit 90a5c9
                                       int override,
Packit 90a5c9
                                       int override_opts,
Packit 90a5c9
                                       apr_table_t *override_list,
Packit 90a5c9
                                       const char *path,
Packit 90a5c9
                                       const char *access_name);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Setup a virtual host
Packit 90a5c9
 * @param p The pool to allocate all memory from
Packit 90a5c9
 * @param hostname The hostname of the virtual hsot
Packit 90a5c9
 * @param main_server The main server for this Apache configuration
Packit 90a5c9
 * @param ps Place to store the new server_rec
Packit 90a5c9
 * return Error string on error, NULL on success
Packit 90a5c9
 */
Packit 90a5c9
AP_CORE_DECLARE(const char *) ap_init_virtual_host(apr_pool_t *p,
Packit 90a5c9
                                                   const char *hostname,
Packit 90a5c9
                                                   server_rec *main_server,
Packit 90a5c9
                                                   server_rec **ps);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Process a config file for Apache
Packit 90a5c9
 * @param s The server rec to use for the command parms
Packit 90a5c9
 * @param fname The name of the config file
Packit 90a5c9
 * @param conftree The root node of the created config tree
Packit 90a5c9
 * @param p Pool for general allocation
Packit 90a5c9
 * @param ptemp Pool for temporary allocation
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(const char *) ap_process_resource_config(server_rec *s,
Packit 90a5c9
                                                    const char *fname,
Packit 90a5c9
                                                    ap_directive_t **conftree,
Packit 90a5c9
                                                    apr_pool_t *p,
Packit 90a5c9
                                                    apr_pool_t *ptemp);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Process all matching files as Apache configs
Packit 90a5c9
 * @param s The server rec to use for the command parms
Packit 90a5c9
 * @param fname The filename pattern of the config file
Packit 90a5c9
 * @param conftree The root node of the created config tree
Packit 90a5c9
 * @param p Pool for general allocation
Packit 90a5c9
 * @param ptemp Pool for temporary allocation
Packit 90a5c9
 * @param optional Whether a no-match wildcard is allowed
Packit 90a5c9
 * @see apr_fnmatch for pattern handling
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(const char *) ap_process_fnmatch_configs(server_rec *s,
Packit 90a5c9
                                                    const char *fname,
Packit 90a5c9
                                                    ap_directive_t **conftree,
Packit 90a5c9
                                                    apr_pool_t *p,
Packit 90a5c9
                                                    apr_pool_t *ptemp,
Packit 90a5c9
                                                    int optional);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Process all directives in the config tree
Packit 90a5c9
 * @param s The server rec to use in the command parms
Packit 90a5c9
 * @param conftree The config tree to process
Packit 90a5c9
 * @param p The pool for general allocation
Packit 90a5c9
 * @param ptemp The pool for temporary allocations
Packit 90a5c9
 * @return OK if no problems
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(int) ap_process_config_tree(server_rec *s,
Packit 90a5c9
                                       ap_directive_t *conftree,
Packit 90a5c9
                                       apr_pool_t *p,
Packit 90a5c9
                                       apr_pool_t *ptemp);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Store data which will be retained across unload/load of modules
Packit 90a5c9
 * @param key The unique key associated with this module's retained data
Packit 90a5c9
 * @param size in bytes of the retained data (to be allocated)
Packit 90a5c9
 * @return Address of new retained data structure, initially cleared
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void *) ap_retained_data_create(const char *key, apr_size_t size);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Retrieve data which was stored by ap_retained_data_create()
Packit 90a5c9
 * @param key The unique key associated with this module's retained data
Packit 90a5c9
 * @return Address of previously retained data structure, or NULL if not yet saved
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE(void *) ap_retained_data_get(const char *key);
Packit 90a5c9
Packit 90a5c9
/* Module-method dispatchers, also for http_request.c */
Packit 90a5c9
/**
Packit 90a5c9
 * Run the handler phase of each module until a module accepts the
Packit 90a5c9
 * responsibility of serving the request
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 * @return The status of the current request
Packit 90a5c9
 */
Packit 90a5c9
AP_CORE_DECLARE(int) ap_invoke_handler(request_rec *r);
Packit 90a5c9
Packit 90a5c9
/* for mod_perl */
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Find a given directive in a command_rec table
Packit 90a5c9
 * @param name The directive to search for
Packit 90a5c9
 * @param cmds The table to search
Packit 90a5c9
 * @return The directive definition of the specified directive
Packit 90a5c9
 */
Packit 90a5c9
AP_CORE_DECLARE(const command_rec *) ap_find_command(const char *name,
Packit 90a5c9
                                                     const command_rec *cmds);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Find a given directive in a list of modules.
Packit 90a5c9
 * @param cmd_name The directive to search for
Packit 90a5c9
 * @param mod Pointer to the first module in the linked list; will be set to
Packit 90a5c9
 *            the module providing cmd_name
Packit 90a5c9
 * @return The directive definition of the specified directive.
Packit 90a5c9
 *         *mod will be changed to point to the module containing the
Packit 90a5c9
 *         directive.
Packit 90a5c9
 */
Packit 90a5c9
AP_CORE_DECLARE(const command_rec *) ap_find_command_in_modules(const char *cmd_name,
Packit 90a5c9
                                                                module **mod);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Ask a module to create per-server and per-section (dir/loc/file) configs
Packit 90a5c9
 * (if it hasn't happened already). The results are stored in the server's
Packit 90a5c9
 * config, and the specified per-section config vector.
Packit 90a5c9
 * @param server The server to operate upon.
Packit 90a5c9
 * @param section_vector The per-section config vector.
Packit 90a5c9
 * @param section Which section to create a config for.
Packit 90a5c9
 * @param mod The module which is defining the config data.
Packit 90a5c9
 * @param pconf A pool for all configuration allocations.
Packit 90a5c9
 * @return The (new) per-section config data.
Packit 90a5c9
 */
Packit 90a5c9
AP_CORE_DECLARE(void *) ap_set_config_vectors(server_rec *server,
Packit 90a5c9
                                              ap_conf_vector_t *section_vector,
Packit 90a5c9
                                              const char *section,
Packit 90a5c9
                                              module *mod, apr_pool_t *pconf);
Packit 90a5c9
Packit 90a5c9
  /* Hooks */
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Run the header parser functions for each module
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 * @return OK or DECLINED
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(int,header_parser,(request_rec *r))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Run the pre_config function for each module
Packit 90a5c9
 * @param pconf The config pool
Packit 90a5c9
 * @param plog The logging streams pool
Packit 90a5c9
 * @param ptemp The temporary pool
Packit 90a5c9
 * @return OK or DECLINED on success anything else is a error
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(int,pre_config,(apr_pool_t *pconf,apr_pool_t *plog,
Packit 90a5c9
                                apr_pool_t *ptemp))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Run the check_config function for each module
Packit 90a5c9
 * @param pconf The config pool
Packit 90a5c9
 * @param plog The logging streams pool
Packit 90a5c9
 * @param ptemp The temporary pool
Packit 90a5c9
 * @param s the server to operate upon
Packit 90a5c9
 * @return OK or DECLINED on success anything else is a error
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(int,check_config,(apr_pool_t *pconf, apr_pool_t *plog,
Packit 90a5c9
                                  apr_pool_t *ptemp, server_rec *s))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Run the test_config function for each module; this hook is run
Packit 90a5c9
 * only if the server was invoked to test the configuration syntax.
Packit 90a5c9
 * @param pconf The config pool
Packit 90a5c9
 * @param s The list of server_recs
Packit 90a5c9
 * @note To avoid reordering problems due to different buffering, hook
Packit 90a5c9
 *       functions should only apr_file_*() to print to stdout/stderr and
Packit 90a5c9
 *       not simple printf()/fprintf().
Packit 90a5c9
 *     
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(void,test_config,(apr_pool_t *pconf, server_rec *s))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Run the post_config function for each module
Packit 90a5c9
 * @param pconf The config pool
Packit 90a5c9
 * @param plog The logging streams pool
Packit 90a5c9
 * @param ptemp The temporary pool
Packit 90a5c9
 * @param s The list of server_recs
Packit 90a5c9
 * @return OK or DECLINED on success anything else is a error
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(int,post_config,(apr_pool_t *pconf,apr_pool_t *plog,
Packit 90a5c9
                                 apr_pool_t *ptemp,server_rec *s))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Run the open_logs functions for each module
Packit 90a5c9
 * @param pconf The config pool
Packit 90a5c9
 * @param plog The logging streams pool
Packit 90a5c9
 * @param ptemp The temporary pool
Packit 90a5c9
 * @param s The list of server_recs
Packit 90a5c9
 * @return OK or DECLINED on success anything else is a error
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(int,open_logs,(apr_pool_t *pconf,apr_pool_t *plog,
Packit 90a5c9
                               apr_pool_t *ptemp,server_rec *s))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Run the child_init functions for each module
Packit 90a5c9
 * @param pchild The child pool
Packit 90a5c9
 * @param s The list of server_recs in this server
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(void,child_init,(apr_pool_t *pchild, server_rec *s))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Run the handler functions for each module
Packit 90a5c9
 * @param r The request_rec
Packit 90a5c9
 * @remark non-wildcard handlers should HOOK_MIDDLE, wildcard HOOK_LAST
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(int,handler,(request_rec *r))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Run the quick handler functions for each module. The quick_handler
Packit 90a5c9
 * is run before any other requests hooks are called (location_walk,
Packit 90a5c9
 * directory_walk, access checking, et. al.). This hook was added
Packit 90a5c9
 * to provide a quick way to serve content from a URI keyed cache.
Packit 90a5c9
 *
Packit 90a5c9
 * @param r The request_rec
Packit 90a5c9
 * @param lookup_uri Controls whether the caller actually wants content or not.
Packit 90a5c9
 * lookup is set when the quick_handler is called out of
Packit 90a5c9
 * ap_sub_req_lookup_uri()
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(int,quick_handler,(request_rec *r, int lookup_uri))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Retrieve the optional functions for each module.
Packit 90a5c9
 * This is run immediately before the server starts. Optional functions should
Packit 90a5c9
 * be registered during the hook registration phase.
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(void,optional_fn_retrieve,(void))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Allow modules to open htaccess files or perform operations before doing so
Packit 90a5c9
 * @param r The current request
Packit 90a5c9
 * @param dir_name The directory for which the htaccess file should be opened
Packit 90a5c9
 * @param access_name The filename  for which the htaccess file should be opened
Packit 90a5c9
 * @param conffile Where the pointer to the opened ap_configfile_t must be
Packit 90a5c9
 *        stored
Packit 90a5c9
 * @param full_name Where the full file name of the htaccess file must be
Packit 90a5c9
 *        stored.
Packit 90a5c9
 * @return APR_SUCCESS on success,
Packit 90a5c9
 *         APR_ENOENT or APR_ENOTDIR if no htaccess file exists,
Packit 90a5c9
 *         AP_DECLINED to let later modules do the opening,
Packit 90a5c9
 *         any other error code on error.
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_HOOK(apr_status_t,open_htaccess,
Packit 90a5c9
                (request_rec *r, const char *dir_name, const char *access_name,
Packit 90a5c9
                 ap_configfile_t **conffile, const char **full_name))
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * Core internal function, use ap_run_open_htaccess() instead.
Packit 90a5c9
 */
Packit 90a5c9
apr_status_t ap_open_htaccess(request_rec *r, const char *dir_name,
Packit 90a5c9
        const char *access_name, ap_configfile_t **conffile,
Packit 90a5c9
        const char **full_name);
Packit 90a5c9
Packit 90a5c9
/**
Packit 90a5c9
 * A generic pool cleanup that will reset a pointer to NULL. For use with
Packit 90a5c9
 * apr_pool_cleanup_register.
Packit 90a5c9
 * @param data The address of the pointer
Packit 90a5c9
 * @return APR_SUCCESS
Packit 90a5c9
 */
Packit 90a5c9
AP_DECLARE_NONSTD(apr_status_t) ap_pool_cleanup_set_null(void *data);
Packit 90a5c9
Packit 90a5c9
#ifdef __cplusplus
Packit 90a5c9
}
Packit 90a5c9
#endif
Packit 90a5c9
Packit 90a5c9
#endif  /* !APACHE_HTTP_CONFIG_H */
Packit 90a5c9
/** @} */