http_config.h revision 30c289e6bc6d28d210b21edd800ab2cfc78a8381
d29201dd5328b88140ce050100693c501852657dChristian Maeder/* ====================================================================
51846950b4b1f31342008cf17f667859a5f21949Christian Maeder * The Apache Software License, Version 1.1
51846950b4b1f31342008cf17f667859a5f21949Christian Maeder *
7165a916d2fa1bf87c4741ec63b253413eebbf69Karl Luc * Copyright (c) 2000 The Apache Software Foundation. All rights
cacbb5e3100fb85d23d1614cace3a8662801f2e6Eugen Kuksa * reserved.
98890889ffb2e8f6f722b00e265a211f13b5a861Corneliu-Claudiu Prodescu *
51846950b4b1f31342008cf17f667859a5f21949Christian Maeder * Redistribution and use in source and binary forms, with or without
cacbb5e3100fb85d23d1614cace3a8662801f2e6Eugen Kuksa * modification, are permitted provided that the following conditions
51846950b4b1f31342008cf17f667859a5f21949Christian Maeder * are met:
51846950b4b1f31342008cf17f667859a5f21949Christian Maeder *
51846950b4b1f31342008cf17f667859a5f21949Christian Maeder * 1. Redistributions of source code must retain the above copyright
7165a916d2fa1bf87c4741ec63b253413eebbf69Karl Luc * notice, this list of conditions and the following disclaimer.
51846950b4b1f31342008cf17f667859a5f21949Christian Maeder *
51846950b4b1f31342008cf17f667859a5f21949Christian Maeder * 2. Redistributions in binary form must reproduce the above copyright
51846950b4b1f31342008cf17f667859a5f21949Christian Maeder * notice, this list of conditions and the following disclaimer in
51846950b4b1f31342008cf17f667859a5f21949Christian Maeder * the documentation and/or other materials provided with the
7165a916d2fa1bf87c4741ec63b253413eebbf69Karl Luc * distribution.
51846950b4b1f31342008cf17f667859a5f21949Christian Maeder *
51846950b4b1f31342008cf17f667859a5f21949Christian Maeder * 3. The end-user documentation included with the redistribution,
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc * if any, must include the following acknowledgment:
51846950b4b1f31342008cf17f667859a5f21949Christian Maeder * "This product includes software developed by the
7165a916d2fa1bf87c4741ec63b253413eebbf69Karl Luc * Apache Software Foundation (http://www.apache.org/)."
7165a916d2fa1bf87c4741ec63b253413eebbf69Karl Luc * Alternately, this acknowledgment may appear in the software itself,
59ec6aa4da4c93d0d4ef53ed74fdf866d0654539Eugen Kuksa * if and wherever such third-party acknowledgments normally appear.
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc *
de03ed90ff6efbbc4751301bcf6b50d9790c1afbKarl Luc * 4. The names "Apache" and "Apache Software Foundation" must
d75d2d11170f1339ebe37d9d9c06aff148637b13Christian Maeder * not be used to endorse or promote products derived from this
f6eb05386b068f5968180b21cc225ef0d7d836e7Eugen Kuksa * software without prior written permission. For written
66977d201b3ff7ee9c1f992c0f3f701b69eac2c9Karl Luc * permission, please contact apache@apache.org.
51846950b4b1f31342008cf17f667859a5f21949Christian Maeder *
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc * 5. Products derived from this software may not be called "Apache",
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc * nor may "Apache" appear in their name, without prior written
0ac66bed6456d7900a657269e36107ca7bec4756Iulia Ignatov * permission of the Apache Software Foundation.
0ac66bed6456d7900a657269e36107ca7bec4756Iulia Ignatov *
0ac66bed6456d7900a657269e36107ca7bec4756Iulia Ignatov * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
a35bacbc16daf5c10f9accfdfadc4971e9d6f648Iulia Ignatov * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
51846950b4b1f31342008cf17f667859a5f21949Christian Maeder * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
51846950b4b1f31342008cf17f667859a5f21949Christian Maeder * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
51846950b4b1f31342008cf17f667859a5f21949Christian Maeder * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3831cf8a3b0ea144a80d13fe0314cc2752e32107Christian Maeder * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
7165a916d2fa1bf87c4741ec63b253413eebbf69Karl Luc * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
51846950b4b1f31342008cf17f667859a5f21949Christian Maeder * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc * SUCH DAMAGE.
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc * ====================================================================
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc *
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc * This software consists of voluntary contributions made by many
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc * individuals on behalf of the Apache Software Foundation. For more
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc * information on the Apache Software Foundation, please see
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc * <http://www.apache.org/>.
7165a916d2fa1bf87c4741ec63b253413eebbf69Karl Luc *
1ea7fb6b0f66210bc0d3cb995f1b655277b33884Eugen Kuksa * Portions of this software are based upon public domain software
d6ce032cac688f3698be7133d27f53d3967e6749Christian Maeder * originally written at the National Center for Supercomputing Applications,
7165a916d2fa1bf87c4741ec63b253413eebbf69Karl Luc * University of Illinois, Urbana-Champaign.
de03ed90ff6efbbc4751301bcf6b50d9790c1afbKarl Luc */
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc
551f1476dea3f969775527cb15fd512e86279307Karl Luc#ifndef APACHE_HTTP_CONFIG_H
9e5811a3323b00d6ff8d3fe91a185de1ab31150bChristian Maeder#define APACHE_HTTP_CONFIG_H
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc#include "ap_hooks.h"
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc#include "util_cfgtree.h"
59ec6aa4da4c93d0d4ef53ed74fdf866d0654539Eugen Kuksa
59ec6aa4da4c93d0d4ef53ed74fdf866d0654539Eugen Kuksa#ifdef __cplusplus
7165a916d2fa1bf87c4741ec63b253413eebbf69Karl Lucextern "C" {
7165a916d2fa1bf87c4741ec63b253413eebbf69Karl Luc#endif
c51d1f5ff88cce030fe543e271ca6b85625b70d8Karl Luc
037be4e5b0e867dd148db2ea89640d8edf009053Eugen Kuksa/*
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc * The central data structures around here...
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc */
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc
037be4e5b0e867dd148db2ea89640d8edf009053Eugen Kuksa/* Command dispatch structures... */
037be4e5b0e867dd148db2ea89640d8edf009053Eugen Kuksa
51846950b4b1f31342008cf17f667859a5f21949Christian Maeder/* Note that for all of these except RAW_ARGS, the config routine is
3831cf8a3b0ea144a80d13fe0314cc2752e32107Christian Maeder * passed a freshly allocated string which can be modified or stored
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa * or whatever... it's only necessary to do pstrdup() stuff with
c51d1f5ff88cce030fe543e271ca6b85625b70d8Karl Luc * RAW_ARGS.
1ea7fb6b0f66210bc0d3cb995f1b655277b33884Eugen Kuksa */
037be4e5b0e867dd148db2ea89640d8edf009053Eugen Kuksaenum cmd_how {
2c10bceb28a74fc291959697e023f22a66753655Eugen Kuksa RAW_ARGS, /* cmd_func parses command line itself */
7165a916d2fa1bf87c4741ec63b253413eebbf69Karl Luc TAKE1, /* one argument only */
d6ce032cac688f3698be7133d27f53d3967e6749Christian Maeder TAKE2, /* two arguments only */
de03ed90ff6efbbc4751301bcf6b50d9790c1afbKarl Luc ITERATE, /* one argument, occuring multiple times
de03ed90ff6efbbc4751301bcf6b50d9790c1afbKarl Luc * (e.g., IndexIgnore)
cacbb5e3100fb85d23d1614cace3a8662801f2e6Eugen Kuksa */
551f1476dea3f969775527cb15fd512e86279307Karl Luc ITERATE2, /* two arguments, 2nd occurs multiple times
5e6915f767bd46767306abbfbb39ebcbc10a2a33Christian Maeder * (e.g., AddIcon)
7b1111ca3b126f71cce47e60ce4b56e6f92422e9Karl Luc */
7b1111ca3b126f71cce47e60ce4b56e6f92422e9Karl Luc FLAG, /* One of 'On' or 'Off' */
0ac66bed6456d7900a657269e36107ca7bec4756Iulia Ignatov NO_ARGS, /* No args at all, e.g. </Directory> */
0ac66bed6456d7900a657269e36107ca7bec4756Iulia Ignatov TAKE12, /* one or two arguments */
0ac66bed6456d7900a657269e36107ca7bec4756Iulia Ignatov TAKE3, /* three arguments only */
0ac66bed6456d7900a657269e36107ca7bec4756Iulia Ignatov TAKE23, /* two or three arguments */
0ac66bed6456d7900a657269e36107ca7bec4756Iulia Ignatov TAKE123, /* one, two or three arguments */
0ac66bed6456d7900a657269e36107ca7bec4756Iulia Ignatov TAKE13 /* one or three arguments */
51846950b4b1f31342008cf17f667859a5f21949Christian Maeder};
3831cf8a3b0ea144a80d13fe0314cc2752e32107Christian Maeder
c51d1f5ff88cce030fe543e271ca6b85625b70d8Karl Luctypedef struct command_struct {
1ea7fb6b0f66210bc0d3cb995f1b655277b33884Eugen Kuksa const char *name; /* Name of this command */
037be4e5b0e867dd148db2ea89640d8edf009053Eugen Kuksa const char *(*func) (); /* Function invoked */
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc void *cmd_data; /* Extra data, for functions which
de03ed90ff6efbbc4751301bcf6b50d9790c1afbKarl Luc * implement multiple commands...
7165a916d2fa1bf87c4741ec63b253413eebbf69Karl Luc */
de03ed90ff6efbbc4751301bcf6b50d9790c1afbKarl Luc int req_override; /* What overrides need to be allowed to
de03ed90ff6efbbc4751301bcf6b50d9790c1afbKarl Luc * enable this command.
7165a916d2fa1bf87c4741ec63b253413eebbf69Karl Luc */
9e5811a3323b00d6ff8d3fe91a185de1ab31150bChristian Maeder enum cmd_how args_how; /* What the command expects as arguments */
9e5811a3323b00d6ff8d3fe91a185de1ab31150bChristian Maeder
9e5811a3323b00d6ff8d3fe91a185de1ab31150bChristian Maeder const char *errmsg; /* 'usage' message, in case of syntax errors */
9e5811a3323b00d6ff8d3fe91a185de1ab31150bChristian Maeder} command_rec;
9e5811a3323b00d6ff8d3fe91a185de1ab31150bChristian Maeder
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc/* The allowed locations for a configuration directive are the union of
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc * those indicated by each set bit in the req_override mask.
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc *
c96c73387a0c41614ba325f737edad6abbf07e79Eugen Kuksa * (req_override & RSRC_CONF) => *.conf outside <Directory> or <Location>
c96c73387a0c41614ba325f737edad6abbf07e79Eugen Kuksa * (req_override & ACCESS_CONF) => *.conf inside <Directory> or <Location>
9e5811a3323b00d6ff8d3fe91a185de1ab31150bChristian Maeder * (req_override & OR_AUTHCFG) => *.conf inside <Directory> or <Location>
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc * and .htaccess when AllowOverride AuthConfig
9e5811a3323b00d6ff8d3fe91a185de1ab31150bChristian Maeder * (req_override & OR_LIMIT) => *.conf inside <Directory> or <Location>
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc * and .htaccess when AllowOverride Limit
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc * (req_override & OR_OPTIONS) => *.conf anywhere
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc * and .htaccess when AllowOverride Options
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc * (req_override & OR_FILEINFO) => *.conf anywhere
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc * and .htaccess when AllowOverride FileInfo
75067b1beba1380cde707c30e7fc050d86f6927fKarl Luc * (req_override & OR_INDEXES) => *.conf anywhere
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa * and .htaccess when AllowOverride Indexes
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa */
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa#define OR_NONE 0
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa#define OR_LIMIT 1
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa#define OR_OPTIONS 2
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa#define OR_FILEINFO 4
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa#define OR_AUTHCFG 8
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa#define OR_INDEXES 16
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa#define OR_UNSET 32
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa#define ACCESS_CONF 64
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa#define RSRC_CONF 128
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa#define EXEC_ON_READ 256
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa#define OR_ALL (OR_LIMIT|OR_OPTIONS|OR_FILEINFO|OR_AUTHCFG|OR_INDEXES)
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa/* This can be returned by a function if they don't wish to handle
1ea7fb6b0f66210bc0d3cb995f1b655277b33884Eugen Kuksa * a command. Make it something not likely someone will actually use
1ea7fb6b0f66210bc0d3cb995f1b655277b33884Eugen Kuksa * as an error code.
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa */
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa#define DECLINE_CMD "\a\b"
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa/* Common structure for reading of config files / passwd files etc. */
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksatypedef struct {
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa int (*getch) (void *param); /* a getc()-like function */
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa void *(*getstr) (void *buf, size_t bufsiz, void *param); /* a fgets()-like function */
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa int (*close) (void *param); /* a close hander function */
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa void *param; /* the argument passed to getch/getstr/close */
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa const char *name; /* the filename / description */
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa unsigned line_number; /* current line number, starting at 1 */
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa} configfile_t;
037be4e5b0e867dd148db2ea89640d8edf009053Eugen Kuksa
037be4e5b0e867dd148db2ea89640d8edf009053Eugen Kuksa/*
037be4e5b0e867dd148db2ea89640d8edf009053Eugen Kuksa * This structure is passed to a command which is being invoked,
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa * to carry a large variety of miscellaneous data which is all of
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa * use to *somebody*...
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa */
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksatypedef struct {
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa void *info; /* Argument to command from cmd_table */
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa int override; /* Which allow-override bits are set */
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa int limited; /* Which methods are <Limit>ed */
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa
037be4e5b0e867dd148db2ea89640d8edf009053Eugen Kuksa configfile_t *config_file; /* Config file structure. */
037be4e5b0e867dd148db2ea89640d8edf009053Eugen Kuksa ap_directive_t *directive; /* the directive specifying this command */
037be4e5b0e867dd148db2ea89640d8edf009053Eugen Kuksa
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa ap_pool_t *pool; /* Pool to allocate new storage in */
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa ap_pool_t *temp_pool; /* Pool for scratch memory; persists during
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa * configuration, but wiped before the first
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa * request is served...
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa */
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa server_rec *server; /* Server_rec being configured for */
99a1bfbb82c875580410b4745617fea2297fdc2bEugen Kuksa char *path; /* If configuring for a directory,
5e6915f767bd46767306abbfbb39ebcbc10a2a33Christian Maeder * pathname of that directory.
* NOPE! That's what it meant previous to the
* existance of <Files>, <Location> and regex
* matching. Now the only usefulness that can
* be derived from this field is whether a command
* is being called in a server context (path == NULL)
* or being called in a dir context (path != NULL).
*/
const command_rec *cmd; /* configuration command */
void *context; /* per_dir_config vector passed
* to handle_command */
} cmd_parms;
/* This structure records the existence of handlers in a module... */
typedef struct {
const char *content_type; /* MUST be all lower case */
int (*handler) (request_rec *);
} handler_rec;
/*
* Module structures. Just about everything is dispatched through
* these, directly or indirectly (through the command and handler
* tables).
*/
typedef struct module_struct {
int version; /* API version, *not* module version;
* check that module is compatible with this
* version of the server.
*/
int minor_version; /* API minor version. Provides API feature
* milestones. Not checked during module init
*/
int module_index; /* Index to this modules structures in
* config vectors.
*/
const char *name;
void *dynamic_load_handle;
struct module_struct *next;
unsigned long magic; /* Magic Cookie to identify a module structure;
* It's mainly important for the DSO facility
* (see also mod_so).
*/
void (*pre_config) (ap_pool_t *p, ap_pool_t *plog, ap_pool_t *ptemp);
void *(*create_dir_config) (ap_pool_t *p, char *dir);
void *(*merge_dir_config) (ap_pool_t *p, void *base_conf, void *new_conf);
void *(*create_server_config) (ap_pool_t *p, server_rec *s);
void *(*merge_server_config) (ap_pool_t *p, void *base_conf, void *new_conf);
const command_rec *cmds;
const handler_rec *handlers;
/* Hooks for getting into the middle of server ops...
* translate_handler --- translate URI to filename
* access_checker --- check access by host address, etc. All of these
* run; if all decline, that's still OK.
* check_user_id --- get and validate user id from the HTTP request
* auth_checker --- see if the user (from check_user_id) is OK *here*.
* If all of *these* decline, the request is rejected
* (as a SERVER_ERROR, since the module which was
* supposed to handle this was configured wrong).
* type_checker --- Determine MIME type of the requested entity;
* sets content_type, _encoding and _language fields.
*/
void (*register_hooks) (void);
} module;
/* Initializer for the first few module slots, which are only
* really set up once we start running. Note that the first two slots
* provide a version check; this should allow us to deal with changes to
* the API. The major number should reflect changes to the API handler table
* itself or removal of functionality. The minor number should reflect
* additions of functionality to the existing API. (the server can detect
* an old-format module, and either handle it back-compatibly, or at least
* signal an error). See src/include/ap_mmn.h for MMN version history.
*/
#define STANDARD_MODULE_STUFF this_module_needs_to_be_ported_to_apache_2_0
#define STANDARD20_MODULE_STUFF MODULE_MAGIC_NUMBER_MAJOR, \
MODULE_MAGIC_NUMBER_MINOR, \
-1, \
__FILE__, \
NULL, \
NULL, \
MODULE_MAGIC_COOKIE, \
NULL
#define MPM20_MODULE_STUFF MODULE_MAGIC_NUMBER_MAJOR, \
MODULE_MAGIC_NUMBER_MINOR, \
-1, \
__FILE__, \
NULL, \
NULL, \
MODULE_MAGIC_COOKIE
/* Generic accessors for other modules to get at their own module-specific
* data
*/
API_EXPORT(void *) ap_get_module_config(void *conf_vector, module *m);
API_EXPORT(void) ap_set_module_config(void *conf_vector, module *m, void *val);
#define ap_get_module_config(v,m) \
(((void **)(v))[(m)->module_index])
#define ap_set_module_config(v,m,val) \
((((void **)(v))[(m)->module_index]) = (val))
/* Generic command handling function... */
API_EXPORT_NONSTD(const char *) ap_set_string_slot(cmd_parms *, char *, char *);
API_EXPORT_NONSTD(const char *) ap_set_string_slot_lower(cmd_parms *, char *, char *);
API_EXPORT_NONSTD(const char *) ap_set_flag_slot(cmd_parms *, char *, int);
API_EXPORT_NONSTD(const char *) ap_set_file_slot(cmd_parms *, char *, char *);
/* For modules which need to read config files, open logs, etc. ...
* this returns the fname argument if it begins with '/'; otherwise
* it relativizes it wrt server_root.
*/
API_EXPORT(const char *) ap_server_root_relative(ap_pool_t *p, const char *fname);
/* Finally, the hook for dynamically loading modules in... */
API_EXPORT(void) ap_add_module(module *m);
API_EXPORT(void) ap_remove_module(module *m);
API_EXPORT(void) ap_add_loaded_module(module *mod);
API_EXPORT(void) ap_remove_loaded_module(module *mod);
API_EXPORT(int) ap_add_named_module(const char *name);
API_EXPORT(void) ap_clear_module_list(void);
API_EXPORT(const char *) ap_find_module_name(module *m);
API_EXPORT(module *) ap_find_linked_module(const char *name);
/* Open a configfile_t as FILE, return open configfile_t struct pointer */
API_EXPORT(ap_status_t) ap_pcfg_openfile(configfile_t **, ap_pool_t *p, const char *name);
/* Allocate a configfile_t handle with user defined functions and params */
API_EXPORT(configfile_t *) ap_pcfg_open_custom(ap_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));
/* Read one line from open configfile_t, strip LF, increase line number */
API_EXPORT(int) ap_cfg_getline(char *buf, size_t bufsize, configfile_t *cfp);
/* Read one char from open configfile_t, increase line number upon LF */
API_EXPORT(int) ap_cfg_getc(configfile_t *cfp);
/* Detach from open configfile_t, calling the close handler */
API_EXPORT(int) ap_cfg_closefile(configfile_t *cfp);
/* for implementing subconfigs and customized config files */
API_EXPORT(const char *) ap_soak_end_container(cmd_parms *cmd, char *directive);
const char * ap_build_cont_config(ap_pool_t *p, ap_pool_t *temp_pool,
cmd_parms *parms,
ap_directive_t **current,
ap_directive_t **curr_parent,
char *orig_directive);
API_EXPORT(const char *) ap_build_config(cmd_parms *parms,
ap_pool_t *conf_pool,
ap_pool_t *temp_pool,
ap_directive_t **conftree);
API_EXPORT(const char *) ap_walk_config(ap_directive_t *conftree,
cmd_parms *parms, void *config);
/* ap_check_cmd_context() definitions: */
API_EXPORT(const char *) ap_check_cmd_context(cmd_parms *cmd, unsigned forbidden);
/* ap_check_cmd_context(): Forbidden in: */
#define NOT_IN_VIRTUALHOST 0x01 /* <Virtualhost> */
#define NOT_IN_LIMIT 0x02 /* <Limit> */
#define NOT_IN_DIRECTORY 0x04 /* <Directory> */
#define NOT_IN_LOCATION 0x08 /* <Location> */
#define NOT_IN_FILES 0x10 /* <Files> */
#define NOT_IN_DIR_LOC_FILE (NOT_IN_DIRECTORY|NOT_IN_LOCATION|NOT_IN_FILES) /* <Directory>/<Location>/<Files>*/
#define GLOBAL_ONLY (NOT_IN_VIRTUALHOST|NOT_IN_LIMIT|NOT_IN_DIR_LOC_FILE)
#ifdef CORE_PRIVATE
extern API_EXPORT_VAR module *top_module;
extern module *ap_prelinked_modules[];
extern module *ap_preloaded_modules[];
extern API_EXPORT_VAR module **ap_loaded_modules;
/* For mod_so.c... */
void ap_single_module_configure(ap_pool_t *p, server_rec *s, module *m);
/* For http_main.c... */
void ap_setup_prelinked_modules(process_rec *process);
void ap_show_directives(void);
void ap_show_modules(void);
server_rec *ap_read_config(process_rec *process, ap_pool_t *temp_pool, const char *config_name);
void ap_post_config_hook(ap_pool_t *pconf, ap_pool_t *plog, ap_pool_t *ptemp, server_rec *s);
void ap_child_init_hook(ap_pool_t *pchild, server_rec *s);
void ap_run_pre_config(ap_pool_t *p, ap_pool_t *plog, ap_pool_t *ptemp);
void ap_register_hooks(module *m);
/* For http_request.c... */
void *ap_create_request_config(ap_pool_t *p);
CORE_EXPORT(void *) ap_create_per_dir_config(ap_pool_t *p);
void *ap_merge_per_dir_configs(ap_pool_t *p, void *base, void *new);
/* For http_connection.c... */
void *ap_create_conn_config(ap_pool_t *p);
/* For http_core.c... (<Directory> command and virtual hosts) */
int ap_parse_htaccess(void **result, request_rec *r, int override,
const char *path, const char *access_name);
CORE_EXPORT(const char *) ap_init_virtual_host(ap_pool_t *p, const char *hostname,
server_rec *main_server, server_rec **);
void ap_process_resource_config(server_rec *s, const char *fname, ap_pool_t *p, ap_pool_t *ptemp);
/* Module-method dispatchers, also for http_request.c */
int ap_translate_name(request_rec *);
int ap_check_user_id(request_rec *); /* obtain valid username from client auth */
int ap_invoke_handler(request_rec *);
/* for mod_perl */
CORE_EXPORT(const command_rec *) ap_find_command(const char *name, const command_rec *cmds);
CORE_EXPORT(const command_rec *) ap_find_command_in_modules(const char *cmd_name, module **mod);
CORE_EXPORT(void *) ap_set_config_vectors(cmd_parms *parms, void *config, module *mod);
CORE_EXPORT(const char *) ap_handle_command(cmd_parms *parms, void *config, const char *l);
#endif
/* Hooks */
AP_DECLARE_HOOK(API_EXPORT,int,header_parser,(request_rec *))
AP_DECLARE_HOOK(API_EXPORT,void,post_config,
(ap_pool_t *pconf,ap_pool_t *plog,ap_pool_t *ptemp,server_rec *s))
AP_DECLARE_HOOK(API_EXPORT,void,open_logs,
(ap_pool_t *pconf,ap_pool_t *plog,ap_pool_t *ptemp,server_rec *s))
AP_DECLARE_HOOK(API_EXPORT,void,child_init,(ap_pool_t *pchild, server_rec *s))
#ifdef __cplusplus
}
#endif
#endif /* !APACHE_HTTP_CONFIG_H */