http_config.h revision 6f3d07d3152232d46eda8f3d97a511bcb1c82d3d
* All the types of functions that can be used in directives /** function to call for a no-args */ /** function to call for a raw-args */ /** function to call for a take1 */ /** function to call for a take2 */ /** function to call for a take3 */ const char *
w2,
const char *
w3);
/** function to call for a flag */ /** This configuration directive does not take any arguments */ /** This configuration directive will handle its own parsing of arguments*/ /** This configuration directive will handle its own parsing of arguments*/ /** This configuration directive takes 1 argument*/ /** This configuration directive takes 2 arguments */ /** This configuration directive takes 3 arguments */ /** This configuration directive takes a flag (on/off) as a argument*/ /** mechanism for declaring a directive with no arguments */ /** mechanism for declaring a directive with raw argument parsing */ /** mechanism for declaring a directive with raw argument parsing */ /** mechanism for declaring a directive which takes 1 argument */ /** mechanism for declaring a directive which takes multiple arguments */ /** mechanism for declaring a directive which takes 2 arguments */ /** mechanism for declaring a directive which takes 1 or 2 arguments */ /** mechanism for declaring a directive which takes multiple 2 arguments */ /** mechanism for declaring a directive which takes 1 or 3 arguments */ /** mechanism for declaring a directive which takes 2 or 3 arguments */ /** mechanism for declaring a directive which takes 1 to 3 arguments */ /** mechanism for declaring a directive which takes 3 arguments */ /** mechanism for declaring a directive which takes a flag (on/off) argument */ #
else /* AP_HAVE_DESIGNATED_INITIALIZER */#
endif /* AP_HAVE_DESIGNATED_INITIALIZER */ * The command record structure. Each modules can define a table of these * to define the directives it will implement. /** Name of this command */ /** The function to be called when this directive is parsed */ /** Extra data, for functions which implement multiple commands... */ /** What overrides need to be allowed to enable this command. */ /** What the command expects as arguments */ /** 'usage' message, in case of syntax errors */ * @defgroup ConfigDirectives Allowed locations for configuration directives. * The allowed locations for a configuration directive are the union of * those indicated by each set bit in the req_override mask. #
define OR_NONE 0
/**< *.conf is not available anywhere in this override */#
define OR_LIMIT 1 /**< *.conf inside <Directory> or <Location> and .htaccess when AllowOverride Limit */ and .htaccess when AllowOverride Options */ and .htaccess when AllowOverride FileInfo */ #
define OR_AUTHCFG 8 /**< *.conf inside <Directory> or <Location> and .htaccess when AllowOverride AuthConfig */ and .htaccess when AllowOverride Indexes */ #
define OR_UNSET 32 /**< bit to indicate that AllowOverride has not been set */#
define ACCESS_CONF 64 /**< *.conf inside <Directory> or <Location> */#
define RSRC_CONF 128 /**< *.conf outside <Directory> or <Location> */#
define EXEC_ON_READ 256 /**< force directive to execute a command which would modify the configuration (like including another /** this directive can be placed anywhere */ * This can be returned by a function if they don't wish to handle * a command. Make it something not likely someone will actually use /** Common structure for reading of config files / passwd files etc. */ /**< an apr_file_getc()-like function */ /**< an apr_file_gets()-like function */ /**< a close handler function */ /**< the filename / description */ /**< current line number, starting at 1 */ * This structure is passed to a command which is being invoked, * to carry a large variety of miscellaneous data which is all of /** Argument to command from cmd_table */ /** Which allow-override bits are set */ /** Which allow-override-opts bits are set */ /** Table of directives allowed per AllowOverrideList */ /** Which methods are <Limit>ed */ /** methods which are limited */ /** methods which are xlimited */ /** Config file structure. */ /** the directive specifying this command */ /** Pool to allocate new storage in */ /** Pool for scratch memory; persists during configuration, but * wiped before the first request is served... */ /** Server_rec being configured for */ /** If configuring for a directory, pathname of that directory. * NOPE! That's what it meant previous to the existence 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 /** configuration command */ /** per_dir_config vector passed to handle_command */ /** directive with syntax error */ * Module structures. Just about everything is dispatched through * these, directly or indirectly (through the command and handler /** API version, *not* module version; check that module is * compatible with this version of the server. /** API minor version. Provides API feature milestones. Not checked /** Index to this modules structures in config vectors. */ /** The name of the module's C file */ /** The handle for the DSO. Internal use only */ /** A pointer to the next module in the list * @var module_struct *next /** Magic Cookie to identify a module structure; It's mainly * important for the DSO facility (see also mod_so). */ /** Function to allow MPMs to re-write command line arguments. This * hook is only available to MPMs. * @param The process that the server is running in. /** Function to allow all modules to create per directory configuration * @param p The pool to use for all allocations. * @param dir The directory currently being processed. * @return The per-directory structure created /** Function to allow all modules to merge the per directory configuration * structures for two directories. * @param p The pool to use for all allocations. * @param base_conf The directory structure created for the parent directory. * @param new_conf The directory structure currently being processed. * @return The new per-directory structure created /** Function to allow all modules to create per server configuration * @param p The pool to use for all allocations. * @param s The server currently being processed. * @return The per-server structure created /** Function to allow all modules to merge the per server configuration * structures for two servers. * @param p The pool to use for all allocations. * @param base_conf The directory structure created for the parent directory. * @param new_conf The directory structure currently being processed. * @return The new per-directory structure created /** A command_rec table that describes all of the directives this module /** A hook to allow modules to hook other points in the request processing. * In this function, modules should call the ap_hook_*() functions to * register an interest in a specific step in processing the current * @param p the pool to use for all allocations * The APLOG_USE_MODULE macro is used choose which module a file belongs to. * This is necessary to allow per-module loglevel configuration. * APLOG_USE_MODULE indirectly sets APLOG_MODULE_INDEX and APLOG_MARK. * If a module should be backward compatible with versions before 2.3.6, * APLOG_USE_MODULE needs to be enclosed in a ifdef APLOG_USE_MODULE block. * @param foo name of the module symbol of the current module, without the * trailing "_module" part * AP_DECLARE_MODULE is a convenience macro that combines a call of * APLOG_USE_MODULE with the definition of the module symbol. * If a module should be backward compatible with versions before 2.3.6, * APLOG_USE_MODULE should be used explicitly instead of AP_DECLARE_MODULE. * @defgroup ModuleInit Module structure initializers * 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 /** The one used in Apache 1.3, which will deliberately cause an error */ /** Use this in all standard modules */ NULL /* rewrite args spot */ /** Use this only in MPMs */ /* CONFIGURATION VECTOR FUNCTIONS */ /** configuration vector structure */ * Generic accessors for other modules to get at their own module-specific * @param cv The vector in which the modules configuration is stored. * usually r->per_dir_config or s->module_config * @param m The module to get the data for. * @return The module-specific data * Generic accessors for other modules to set at their own module-specific * @param cv The vector in which the modules configuration is stored. * usually r->per_dir_config or s->module_config * @param m The module to set the data for. * @param val The module-specific data to set * Generic accessor for modules to get the module-specific loglevel * @param s The server from which to get the loglevel. * @param index The module_index of the module to get the loglevel for. * @return The module-specific loglevel * Generic accessor for modules the module-specific loglevel * @param c The connection from which to get the loglevel. * @param index The module_index of the module to get the loglevel for. * @return The module-specific loglevel * Generic accessor for modules the module-specific loglevel * @param c The connection from which to get the loglevel. * @param s The server from which to get the loglevel if c does not have a * specific loglevel configuration. * @param index The module_index of the module to get the loglevel for. * @return The module-specific loglevel * Generic accessor for modules to get the module-specific loglevel * @param r The request from which to get the loglevel. * @param index The module_index of the module to get the loglevel for. * @return The module-specific loglevel * Accessor to set module-specific loglevel * @param l The ap_logconf struct to modify. * @param index The module_index of the module to set the loglevel for. * @param level The new log level * Set all module-specific loglevels to val * @param l The log config for which to set the loglevels. * @param val the value to set all loglevels to * Generic command handling function for strings * @param cmd The command parameters for this directive * @param struct_ptr pointer into a given type * @param arg The argument to the directive * @return An error string or NULL on success * Generic command handling function for integers * @param cmd The command parameters for this directive * @param struct_ptr pointer into a given type * @param arg The argument to the directive * @return An error string or NULL on success * Parsing function for log level * @param str The string to parse * @param val The parsed log level * @return An error string or NULL on success * Return true if the specified method is limited by being listed in * a <Limit> container, or by *not* being listed in a <LimitExcept> * @param method Pointer to a string specifying the method to check. * @param cmd Pointer to the cmd_parms structure passed to the * @return 0 if the method is not limited in the current scope * Generic command handling function for strings, always sets the value * @param cmd The command parameters for this directive * @param struct_ptr pointer into a given type * @param arg The argument to the directive * @return An error string or NULL on success * Generic command handling function for flags stored in an int * @param cmd The command parameters for this directive * @param struct_ptr pointer into a given type * @param arg The argument to the directive (either 1 or 0) * @return An error string or NULL on success * Generic command handling function for flags stored in a char * @param cmd The command parameters for this directive * @param struct_ptr pointer into a given type * @param arg The argument to the directive (either 1 or 0) * @return An error string or NULL on success * Generic command handling function for files * @param cmd The command parameters for this directive * @param struct_ptr pointer into a given type * @param arg The argument to the directive * @return An error string or NULL on success * Generic command handling function to respond with cmd->help as an error * @param cmd The command parameters for this directive * @param struct_ptr pointer into a given type * @param arg The argument to the directive * @return The cmd->help value as the error string * @note This allows simple declarations such as: * AP_INIT_RAW_ARGS("Foo", ap_set_deprecated, NULL, OR_ALL, * "The Foo directive is no longer supported, use Bar"), * For modules which need to read config files, open logs, etc. this returns * the canonical form of fname made absolute to ap_server_root. * @param p pool to allocate data from * @param fname The file name /* Finally, the hook for dynamically loading modules in... */ * Add a module to the server * @param m The module structure of the module to add * @param p The pool of the same lifetime as the module * @param s The module's symbol name (used for logging) * Remove a module from the server. There are some caveats: * when the module is removed, its slot is lost so all the current * per-dir and per-server configurations are invalid. So we should * only ever call this function when you are invalidating almost * all our current data. I.e. when doing a restart. * @param m the module structure of the module to remove * Add a module to the chained modules list and the list of loaded modules * @param mod The module structure of the module to add * @param p The pool with the same lifetime as the module * @param s The module's symbol name (used for logging) * Remove a module fromthe chained modules list and the list of loaded modules * @param mod the module structure of the module to remove * Find the name of the specified module * @param m The module to get the name for * @return the name of the module * Find the short name of the module identified by the specified module index * @param module_index The module index to get the name for * @return the name of the module, NULL if not found * Find a module based on the name of the module * @param name the name of the module * @return the module structure if found, NULL otherwise * Open a ap_configfile_t as apr_file_t * @param ret_cfg open ap_configfile_t struct pointer * @param p The pool to allocate the structure from * @param name the name of the file to open * Allocate a ap_configfile_t handle with user defined functions and params * @param p The pool to allocate from * @param descr The name of the file * @param getc_func The getch function * @param gets_func The getstr function * @param close_func The close function * Read one line from open ap_configfile_t, strip leading and trailing * whitespace, increase line number * @param buf place to store the line read * @param bufsize size of the buffer * @param cfp File to read from * @return error status, APR_ENOSPC if bufsize is too small for the line * Read one char from open configfile_t, increase line number upon LF * @param ch place to store the char read * @param cfp The file to read from * Detach from open ap_configfile_t, calling the close handler * @param cfp The file to close * @return 1 on sucess, 0 on failure * Convert a return value from ap_cfg_getline or ap_cfg_getc to a user friendly * @param p The pool to allocate the string from * @param cfp The config file * @param rc The return value to convert * @return The error string, NULL if rc == APR_SUCCESS * Read all data between the current <foo> and the matching </foo>. All * of this data is forgotten immediately. * @param cmd The cmd_parms to pass to the directives inside the container * @param directive The directive name to read until * @return Error string on failure, NULL on success * @note If cmd->pool == cmd->temp_pool, ap_soak_end_container() will assume * .htaccess context and use a lower maximum line length. * Read all data between the current <foo> and the matching </foo> and build * @param p pool to allocate from * @param temp_pool Temporary pool to allocate from * @param parms The cmd_parms to pass to all directives read * @param current The current node in the tree * @param curr_parent The current parent node * @param orig_directive The directive to read until hit. * @return Error string on failure, NULL on success * @note If p == temp_pool, ap_build_cont_config() will assume .htaccess * context and use a lower maximum line length. * Build a config tree from a config file * @param parms The cmd_parms to pass to all of the directives in the file * @param conf_pool The pconf pool * @param temp_pool The temporary pool * @param conftree Place to store the root node of the config tree * @return Error string on erro, NULL otherwise * @note If conf_pool == temp_pool, ap_build_config() will assume .htaccess * context and use a lower maximum line length. * Walk a config tree and setup the server's internal structures * @param conftree The config tree to walk * @param parms The cmd_parms to pass to all functions * @param section_vector The per-section config vector. * @return Error string on error, NULL otherwise * @defgroup ap_check_cmd_context Check command context * Check the context a command is used in. * @param cmd The command to check * @param forbidden Where the command is forbidden. * @return Error string on error, NULL on success #
define NOT_IN_LIMIT 0x02 /**< Forbidden in <Limit> */#
define NOT_IN_FILES 0x10 /**< Forbidden in <Files> *//** Forbidden in <Directory>/<Location>/<Files>*/ /** Forbidden in <VirtualHost>/<Limit>/<Directory>/<Location>/<Files> */ * @brief This structure is used to assign symbol names to module pointers * The topmost module in the list * @var module *ap_top_module * Array of all statically linked modules * @var module *ap_prelinked_modules[] * Array of all statically linked modulenames (symbols) * @var ap_module_symbol_t ap_prelinked_module_symbols[] * Array of all preloaded modules * @var module *ap_preloaded_modules[] * Array of all loaded modules * @var module **ap_loaded_modules /** Run a single module's two create_config hooks * @param p the pool to allocate from * @param s The server to configure for. * @param m The module to configure * Add all of the prelinked modules into the loaded module list * @param process The process that is currently running the server * Show the preloaded configuration directives, the help string explaining * the directive arguments, in what module they are handled, and in * what parts of the configuration they are allowed. Used for httpd -h. * Show the preloaded module names. Used for httpd -l. * Show the MPM name. Used in reporting modules such as mod_info to * provide extra information to the user * Read all config files and setup the server * @param process The process running the server * @param temp_pool A pool to allocate temporary data from. * @param config_name The name of the config file * @param conftree Place to store the root of the config tree * @return The setup server_rec list. * Run all rewrite args hooks for loaded modules * @param process The process currently running the server * Run the register hooks function for a specified module * @param m The module to run the register hooks function fo * @param p The pool valid for the lifetime of the module * Setup all virtual hosts * @param p The pool to allocate from * @param main_server The head of the server_rec list * Reserve some modules slots for modules loaded by other means than * EXEC_ON_READ directives. * Relevant modules should call this in the pre_config stage. * @param count The number of slots to reserve. * Reserve some modules slots for modules loaded by a specific * non-EXEC_ON_READ config directive. * This counts how often the given directive is used in the config and calls * ap_reserve_module_slots() accordingly. * @param directive The name of the directive * Setup the config vector for a request_rec * @param p The pool to allocate the config vector from * @return The config vector * Setup the config vector for per dir module configs * @param p The pool to allocate the config vector from * @return The config vector * Run all of the modules merge per dir config functions * @param p The pool to pass to the merge functions * @param base The base directory config structure * @param new_conf The new directory config structure * Allocate new ap_logconf and make (deep) copy of old ap_logconf * @param p The pool to alloc from * @param old The ap_logconf to copy (may be NULL) * @return The new ap_logconf struct * Merge old ap_logconf into new ap_logconf. * old and new must have the same life time. * @param old_conf The ap_logconf to merge from * @param new_conf The ap_logconf to merge into * Setup the config vector for a connection_rec * @param p The pool to allocate the config vector from * @return The config vector /* For http_core.c... (<Directory> command and virtual hosts) */ * @param result htaccess_result * @param r The request currently being served * @param override Which overrides are active * @param override_opts Which allow-override-opts bits are set * @param override_list Table of directives allowed for override * @param path The path to the htaccess file * @param access_name The list of possible names for .htaccess files * int The status of the current request * @param p The pool to allocate all memory from * @param hostname The hostname of the virtual hsot * @param main_server The main server for this Apache configuration * @param ps Place to store the new server_rec * return Error string on error, NULL on success * Process a config file for Apache * @param s The server rec to use for the command parms * @param fname The name of the config file * @param conftree The root node of the created config tree * @param p Pool for general allocation * @param ptemp Pool for temporary allocation * Process all matching files as Apache configs * @param s The server rec to use for the command parms * @param fname The filename pattern of the config file * @param conftree The root node of the created config tree * @param p Pool for general allocation * @param ptemp Pool for temporary allocation * @param optional Whether a no-match wildcard is allowed * @see apr_fnmatch for pattern handling * Process all directives in the config tree * @param s The server rec to use in the command parms * @param conftree The config tree to process * @param p The pool for general allocation * @param ptemp The pool for temporary allocations * @return OK if no problems * Store data which will be retained across unload/load of modules * @param key The unique key associated with this module's retained data * @param size in bytes of the retained data (to be allocated) * @return Address of new retained data structure, initially cleared * Retrieve data which was stored by ap_retained_data_create() * @param key The unique key associated with this module's retained data * @return Address of previously retained data structure, or NULL if not yet saved * Run the handler phase of each module until a module accepts the * responsibility of serving the request * @param r The current request * @return The status of the current request * Find a given directive in a command_rec table * @param name The directive to search for * @param cmds The table to search * @return The directive definition of the specified directive * Find a given directive in a list of modules. * @param cmd_name The directive to search for * @param mod Pointer to the first module in the linked list; will be set to * the module providing cmd_name * @return The directive definition of the specified directive. * *mod will be changed to point to the module containing the * Ask a module to create per-server and per-section (dir/loc/file) configs * (if it hasn't happened already). The results are stored in the server's * config, and the specified per-section config vector. * @param server The server to operate upon. * @param section_vector The per-section config vector. * @param section Which section to create a config for. * @param mod The module which is defining the config data. * @param pconf A pool for all configuration allocations. * @return The (new) per-section config data. * Run the header parser functions for each module * @param r The current request * Run the pre_config function for each module * @param pconf The config pool * @param plog The logging streams pool * @param ptemp The temporary pool * @return OK or DECLINED on success anything else is a error * Run the check_config function for each module * @param pconf The config pool * @param plog The logging streams pool * @param ptemp The temporary pool * @param s the server to operate upon * @return OK or DECLINED on success anything else is a error * Run the test_config function for each module; this hook is run * only if the server was invoked to test the configuration syntax. * @param pconf The config pool * @param s The list of server_recs * @note To avoid reordering problems due to different buffering, hook * functions should only apr_file_*() to print to stdout/stderr and * not simple printf()/fprintf(). * Run the post_config function for each module * @param pconf The config pool * @param plog The logging streams pool * @param ptemp The temporary pool * @param s The list of server_recs * @return OK or DECLINED on success anything else is a error * Run the open_logs functions for each module * @param pconf The config pool * @param plog The logging streams pool * @param ptemp The temporary pool * @param s The list of server_recs * @return OK or DECLINED on success anything else is a error * Run the child_init functions for each module * @param pchild The child pool * @param s The list of server_recs in this server * Run the handler functions for each module * @param r The request_rec * @remark non-wildcard handlers should HOOK_MIDDLE, wildcard HOOK_LAST * Run the quick handler functions for each module. The quick_handler * is run before any other requests hooks are called (location_walk, * directory_walk, access checking, et. al.). This hook was added * to provide a quick way to serve content from a URI keyed cache. * @param r The request_rec * @param lookup_uri Controls whether the caller actually wants content or not. * lookup is set when the quick_handler is called out of * ap_sub_req_lookup_uri() * Retrieve the optional functions for each module. * This is run immediately before the server starts. Optional functions should * be registered during the hook registration phase. * A generic pool cleanup that will reset a pointer to NULL. For use with * apr_pool_cleanup_register. * @param data The address of the pointer #
endif /* !APACHE_HTTP_CONFIG_H */