Apache2
Collaboration diagram for Configuration:

Modules

 Allowed locations for configuration directives.
 
 Check command context
 
 Config Tree Package
 
 Module structure initializers
 

Data Structures

union  cmd_func
 
struct  command_struct
 
struct  ap_configfile_t
 
struct  cmd_parms_struct
 
struct  module_struct
 
struct  ap_module_symbol_t
 This structure is used to assign symbol names to module pointers. More...
 

Macros

#define AP_NO_ARGS   func.no_args
 
#define AP_RAW_ARGS   func.raw_args
 
#define AP_TAKE_ARGV   func.take_argv
 
#define AP_TAKE1   func.take1
 
#define AP_TAKE2   func.take2
 
#define AP_TAKE3   func.take3
 
#define AP_FLAG   func.flag
 
#define AP_INIT_NO_ARGS(directive, func, mconfig, where, help)    { directive, { .no_args=func }, mconfig, where, NO_ARGS, help }
 
#define AP_INIT_RAW_ARGS(directive, func, mconfig, where, help)    { directive, { .raw_args=func }, mconfig, where, RAW_ARGS, help }
 
#define AP_INIT_TAKE_ARGV(directive, func, mconfig, where, help)    { directive, { .take_argv=func }, mconfig, where, TAKE_ARGV, help }
 
#define AP_INIT_TAKE1(directive, func, mconfig, where, help)    { directive, { .take1=func }, mconfig, where, TAKE1, help }
 
#define AP_INIT_ITERATE(directive, func, mconfig, where, help)    { directive, { .take1=func }, mconfig, where, ITERATE, help }
 
#define AP_INIT_TAKE2(directive, func, mconfig, where, help)    { directive, { .take2=func }, mconfig, where, TAKE2, help }
 
#define AP_INIT_TAKE12(directive, func, mconfig, where, help)    { directive, { .take2=func }, mconfig, where, TAKE12, help }
 
#define AP_INIT_ITERATE2(directive, func, mconfig, where, help)    { directive, { .take2=func }, mconfig, where, ITERATE2, help }
 
#define AP_INIT_TAKE13(directive, func, mconfig, where, help)    { directive, { .take3=func }, mconfig, where, TAKE13, help }
 
#define AP_INIT_TAKE23(directive, func, mconfig, where, help)    { directive, { .take3=func }, mconfig, where, TAKE23, help }
 
#define AP_INIT_TAKE123(directive, func, mconfig, where, help)    { directive, { .take3=func }, mconfig, where, TAKE123, help }
 
#define AP_INIT_TAKE3(directive, func, mconfig, where, help)    { directive, { .take3=func }, mconfig, where, TAKE3, help }
 
#define AP_INIT_FLAG(directive, func, mconfig, where, help)    { directive, { .flag=func }, mconfig, where, FLAG, help }
 
#define DECLINE_CMD   "\a\b"
 
#define AP_MODULE_FLAG_NONE   (0)
 
#define AP_MODULE_FLAG_ALWAYS_MERGE   (1 << 0)
 
#define AP_MAYBE_UNUSED(x)   x
 
#define APLOG_USE_MODULE(foo)
 
#define AP_DECLARE_MODULE(foo)
 
#define AP_MODULE_FLAGS_MMN_MAJOR   20161018
 
#define AP_MODULE_FLAGS_MMN_MINOR   7
 
#define AP_MODULE_HAS_FLAGS(m)
 
#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))
 
#define ap_get_conn_logconf(c)
 
#define ap_get_conn_server_logconf(c, s)
 
#define ap_get_request_logconf(r)
 
#define ap_get_module_loglevel(l, i)
 
#define ap_get_server_module_loglevel(s, i)    (ap_get_module_loglevel(&(s)->log,i))
 
#define ap_get_conn_module_loglevel(c, i)    (ap_get_module_loglevel(ap_get_conn_logconf(c),i))
 
#define ap_get_conn_server_module_loglevel(c, s, i)    (ap_get_module_loglevel(ap_get_conn_server_logconf(c,s),i))
 
#define ap_get_request_module_loglevel(r, i)    (ap_get_module_loglevel(ap_get_request_logconf(r),i))
 

Typedefs

typedef struct cmd_parms_struct cmd_parms
 
typedef struct command_struct command_rec
 
typedef struct ap_configfile_t ap_configfile_t
 
typedef struct module_struct module
 
typedef struct ap_conf_vector_t ap_conf_vector_t
 

Enumerations

enum  cmd_how {
  RAW_ARGS , TAKE1 , TAKE2 , ITERATE ,
  ITERATE2 , FLAG , NO_ARGS , TAKE12 ,
  TAKE3 , TAKE23 , TAKE123 , TAKE13 ,
  TAKE_ARGV
}
 

Functions

void * ap_get_module_config (const ap_conf_vector_t *cv, const module *m)
 
void ap_set_module_config (ap_conf_vector_t *cv, const module *m, void *val)
 
int ap_get_module_flags (const module *m)
 
int ap_get_server_module_loglevel (const server_rec *s, int index)
 
int ap_get_conn_module_loglevel (const conn_rec *c, int index)
 
int ap_get_conn_server_module_loglevel (const conn_rec *c, const server_rec *s, int index)
 
int ap_get_request_module_loglevel (const request_rec *r, int index)
 
void ap_set_module_loglevel (apr_pool_t *p, struct ap_logconf *l, int index, int level)
 
void ap_reset_module_loglevels (struct ap_logconf *l, int val)
 
const char * ap_set_string_slot (cmd_parms *cmd, void *struct_ptr, const char *arg)
 
const char * ap_set_int_slot (cmd_parms *cmd, void *struct_ptr, const char *arg)
 
const char * ap_parse_log_level (const char *str, int *val)
 
int ap_method_is_limited (cmd_parms *cmd, const char *method)
 
const char * ap_set_string_slot_lower (cmd_parms *cmd, void *struct_ptr, const char *arg)
 
const char * ap_set_flag_slot (cmd_parms *cmd, void *struct_ptr, int arg)
 
const char * ap_set_flag_slot_char (cmd_parms *cmd, void *struct_ptr, int arg)
 
const char * ap_set_file_slot (cmd_parms *cmd, void *struct_ptr, const char *arg)
 
const char * ap_set_deprecated (cmd_parms *cmd, void *struct_ptr, const char *arg)
 
char * ap_server_root_relative (apr_pool_t *p, const char *fname)
 
char * ap_runtime_dir_relative (apr_pool_t *p, const char *fname)
 
char * ap_state_dir_relative (apr_pool_t *p, const char *fname)
 
const char * ap_add_module (module *m, apr_pool_t *p, const char *s)
 
void ap_remove_module (module *m)
 
const char * ap_add_loaded_module (module *mod, apr_pool_t *p, const char *s)
 
void ap_remove_loaded_module (module *mod)
 
const char * ap_find_module_name (module *m)
 
const char * ap_find_module_short_name (int module_index)
 
moduleap_find_linked_module (const char *name)
 
apr_status_t ap_pcfg_openfile (ap_configfile_t **ret_cfg, apr_pool_t *p, const char *name)
 
ap_configfile_tap_pcfg_open_custom (apr_pool_t *p, const char *descr, void *param, apr_status_t(*getc_func)(char *ch, void *param), apr_status_t(*gets_func)(void *buf, apr_size_t bufsiz, void *param), apr_status_t(*close_func)(void *param))
 
apr_status_t ap_cfg_getline (char *buf, apr_size_t bufsize, ap_configfile_t *cfp)
 
apr_status_t ap_cfg_getc (char *ch, ap_configfile_t *cfp)
 
int ap_cfg_closefile (ap_configfile_t *cfp)
 
const char * ap_pcfg_strerror (apr_pool_t *p, ap_configfile_t *cfp, apr_status_t rc)
 
const char * ap_soak_end_container (cmd_parms *cmd, const char *directive)
 
const char * ap_build_cont_config (apr_pool_t *p, apr_pool_t *temp_pool, cmd_parms *parms, ap_directive_t **current, ap_directive_t **curr_parent, const char *orig_directive)
 
const char * ap_build_config (cmd_parms *parms, apr_pool_t *conf_pool, apr_pool_t *temp_pool, ap_directive_t **conftree)
 
const char * ap_walk_config (ap_directive_t *conftree, cmd_parms *parms, ap_conf_vector_t *section_vector)
 
ap_dir_match_tap_dir_cfgmatch (cmd_parms *cmd, int flags, const char *(*cb)(ap_dir_match_t *w, const char *fname), void *ctx) __attribute__((nonnull(1
 
void ap_single_module_configure (apr_pool_t *p, server_rec *s, module *m)
 
const char * ap_setup_prelinked_modules (process_rec *process)
 
void ap_show_directives (void)
 
int ap_exists_directive (apr_pool_t *p, const char *name)
 
void ap_show_modules (void)
 
const char * ap_show_mpm (void)
 
server_recap_read_config (process_rec *process, apr_pool_t *temp_pool, const char *config_name, ap_directive_t **conftree)
 
void ap_run_rewrite_args (process_rec *process)
 
void ap_register_hooks (module *m, apr_pool_t *p)
 
void ap_fixup_virtual_hosts (apr_pool_t *p, server_rec *main_server)
 
void ap_reserve_module_slots (int count)
 
void ap_reserve_module_slots_directive (const char *directive)
 
ap_conf_vector_tap_create_request_config (apr_pool_t *p)
 
ap_conf_vector_tap_create_per_dir_config (apr_pool_t *p)
 
ap_conf_vector_tap_merge_per_dir_configs (apr_pool_t *p, ap_conf_vector_t *base, ap_conf_vector_t *new_conf)
 
struct ap_logconfap_new_log_config (apr_pool_t *p, const struct ap_logconf *old)
 
void ap_merge_log_config (const struct ap_logconf *old_conf, struct ap_logconf *new_conf)
 
ap_conf_vector_tap_create_conn_config (apr_pool_t *p)
 
int ap_parse_htaccess (ap_conf_vector_t **result, request_rec *r, int override, int override_opts, apr_table_t *override_list, const char *path, const char *access_name)
 
const char * ap_init_virtual_host (apr_pool_t *p, const char *hostname, server_rec *main_server, server_rec **ps)
 
const char * ap_process_resource_config (server_rec *s, const char *fname, ap_directive_t **conftree, apr_pool_t *p, apr_pool_t *ptemp)
 
const char * ap_process_fnmatch_configs (server_rec *s, const char *fname, ap_directive_t **conftree, apr_pool_t *p, apr_pool_t *ptemp, int optional)
 
int ap_process_config_tree (server_rec *s, ap_directive_t *conftree, apr_pool_t *p, apr_pool_t *ptemp)
 
void * ap_retained_data_create (const char *key, apr_size_t size)
 
void * ap_retained_data_get (const char *key)
 
int ap_invoke_handler (request_rec *r)
 
const command_recap_find_command (const char *name, const command_rec *cmds)
 
const command_recap_find_command_in_modules (const char *cmd_name, module **mod)
 
void * ap_set_config_vectors (server_rec *server, ap_conf_vector_t *section_vector, const char *section, module *mod, apr_pool_t *pconf)
 
apr_status_t ap_open_htaccess (request_rec *r, const char *dir_name, const char *access_name, ap_configfile_t **conffile, const char **full_name)
 
apr_status_t ap_pool_cleanup_set_null (void *data)
 

Variables

AP_DECLARE_DATA moduleap_top_module
 
AP_DECLARE_DATA moduleap_prelinked_modules []
 
AP_DECLARE_DATA ap_module_symbol_t ap_prelinked_module_symbols []
 
AP_DECLARE_DATA moduleap_preloaded_modules []
 
AP_DECLARE_DATA module ** ap_loaded_modules
 

Detailed Description

Macro Definition Documentation

◆ AP_DECLARE_MODULE

#define AP_DECLARE_MODULE (   foo)
Value:
module AP_MODULE_DECLARE_DATA foo##_module
#define APLOG_USE_MODULE(foo)
Definition: http_config.h:456
#define AP_MODULE_DECLARE_DATA
Definition: macros.h:16

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.

◆ AP_FLAG

#define AP_FLAG   func.flag

This configuration directive takes a flag (on/off) as a argument

◆ ap_get_conn_logconf

#define ap_get_conn_logconf (   c)
Value:
((c)->log ? (c)->log : \
&(c)->base_server->log)

◆ ap_get_conn_module_loglevel

#define ap_get_conn_module_loglevel (   c,
 
)     (ap_get_module_loglevel(ap_get_conn_logconf(c),i))

◆ ap_get_conn_server_logconf

#define ap_get_conn_server_logconf (   c,
  s 
)
Value:
( ( (c)->log != &(c)->base_server->log && (c)->log != NULL ) ? \
(c)->log : \
&(s)->log )
const char * s
Definition: mod_dav.h:1327

◆ ap_get_conn_server_module_loglevel

#define ap_get_conn_server_module_loglevel (   c,
  s,
 
)     (ap_get_module_loglevel(ap_get_conn_server_logconf(c,s),i))

◆ ap_get_module_config

#define ap_get_module_config (   v,
 
)     (((void **)(v))[(m)->module_index])

◆ ap_get_module_loglevel

#define ap_get_module_loglevel (   l,
 
)
Value:
(((i) < 0 || (l)->module_levels == NULL || (l)->module_levels[i] < 0) ? \
(l)->level : \
(l)->module_levels[i])

◆ ap_get_request_logconf

#define ap_get_request_logconf (   r)
Value:
((r)->log ? (r)->log : \
(r)->connection->log ? (r)->connection->log : \
&(r)->server->log)
request_rec * r
Definition: mod_dav.h:518

◆ ap_get_request_module_loglevel

#define ap_get_request_module_loglevel (   r,
 
)     (ap_get_module_loglevel(ap_get_request_logconf(r),i))

◆ ap_get_server_module_loglevel

#define ap_get_server_module_loglevel (   s,
 
)     (ap_get_module_loglevel(&(s)->log,i))

◆ AP_INIT_FLAG

#define AP_INIT_FLAG (   directive,
  func,
  mconfig,
  where,
  help 
)     { directive, { .flag=func }, mconfig, where, FLAG, help }

mechanism for declaring a directive which takes a flag (on/off) argument

◆ AP_INIT_ITERATE

#define AP_INIT_ITERATE (   directive,
  func,
  mconfig,
  where,
  help 
)     { directive, { .take1=func }, mconfig, where, ITERATE, help }

mechanism for declaring a directive which takes multiple arguments

◆ AP_INIT_ITERATE2

#define AP_INIT_ITERATE2 (   directive,
  func,
  mconfig,
  where,
  help 
)     { directive, { .take2=func }, mconfig, where, ITERATE2, help }

mechanism for declaring a directive which takes multiple 2 arguments

◆ AP_INIT_NO_ARGS

#define AP_INIT_NO_ARGS (   directive,
  func,
  mconfig,
  where,
  help 
)     { directive, { .no_args=func }, mconfig, where, NO_ARGS, help }

mechanism for declaring a directive with no arguments

◆ AP_INIT_RAW_ARGS

#define AP_INIT_RAW_ARGS (   directive,
  func,
  mconfig,
  where,
  help 
)     { directive, { .raw_args=func }, mconfig, where, RAW_ARGS, help }

mechanism for declaring a directive with raw argument parsing

◆ AP_INIT_TAKE1

#define AP_INIT_TAKE1 (   directive,
  func,
  mconfig,
  where,
  help 
)     { directive, { .take1=func }, mconfig, where, TAKE1, help }

mechanism for declaring a directive which takes 1 argument

◆ AP_INIT_TAKE12

#define AP_INIT_TAKE12 (   directive,
  func,
  mconfig,
  where,
  help 
)     { directive, { .take2=func }, mconfig, where, TAKE12, help }

mechanism for declaring a directive which takes 1 or 2 arguments

◆ AP_INIT_TAKE123

#define AP_INIT_TAKE123 (   directive,
  func,
  mconfig,
  where,
  help 
)     { directive, { .take3=func }, mconfig, where, TAKE123, help }

mechanism for declaring a directive which takes 1 to 3 arguments

◆ AP_INIT_TAKE13

#define AP_INIT_TAKE13 (   directive,
  func,
  mconfig,
  where,
  help 
)     { directive, { .take3=func }, mconfig, where, TAKE13, help }

mechanism for declaring a directive which takes 1 or 3 arguments

◆ AP_INIT_TAKE2

#define AP_INIT_TAKE2 (   directive,
  func,
  mconfig,
  where,
  help 
)     { directive, { .take2=func }, mconfig, where, TAKE2, help }

mechanism for declaring a directive which takes 2 arguments

◆ AP_INIT_TAKE23

#define AP_INIT_TAKE23 (   directive,
  func,
  mconfig,
  where,
  help 
)     { directive, { .take3=func }, mconfig, where, TAKE23, help }

mechanism for declaring a directive which takes 2 or 3 arguments

◆ AP_INIT_TAKE3

#define AP_INIT_TAKE3 (   directive,
  func,
  mconfig,
  where,
  help 
)     { directive, { .take3=func }, mconfig, where, TAKE3, help }

mechanism for declaring a directive which takes 3 arguments

◆ AP_INIT_TAKE_ARGV

#define AP_INIT_TAKE_ARGV (   directive,
  func,
  mconfig,
  where,
  help 
)     { directive, { .take_argv=func }, mconfig, where, TAKE_ARGV, help }

mechanism for declaring a directive with raw argument parsing

◆ AP_MAYBE_UNUSED

#define AP_MAYBE_UNUSED (   x)    x

The AP_MAYBE_UNUSED macro is used for variable declarations that might potentially exhibit "unused var" warnings on some compilers if left untreated. Since static initializers are not part of the C language (C89), making (void) usage is not possible. However many compiler have proprietary mechanism to suppress those warnings.

◆ AP_MODULE_FLAG_ALWAYS_MERGE

#define AP_MODULE_FLAG_ALWAYS_MERGE   (1 << 0)

◆ AP_MODULE_FLAG_NONE

#define AP_MODULE_FLAG_NONE   (0)

Flags associated with a module.

◆ AP_MODULE_FLAGS_MMN_MAJOR

#define AP_MODULE_FLAGS_MMN_MAJOR   20161018

When module flags have been introduced, and a way to check this.

◆ AP_MODULE_FLAGS_MMN_MINOR

#define AP_MODULE_FLAGS_MMN_MINOR   7

◆ AP_MODULE_HAS_FLAGS

#define AP_MODULE_HAS_FLAGS (   m)
Value:
#define AP_MODULE_FLAGS_MMN_MAJOR
Definition: http_config.h:539
#define AP_MODULE_FLAGS_MMN_MINOR
Definition: http_config.h:540
#define AP_MODULE_MAGIC_AT_LEAST(major, minor)
Definition: ap_mmn.h:752

◆ AP_NO_ARGS

#define AP_NO_ARGS   func.no_args

This configuration directive does not take any arguments

◆ AP_RAW_ARGS

#define AP_RAW_ARGS   func.raw_args

This configuration directive will handle its own parsing of arguments

◆ ap_set_module_config

#define ap_set_module_config (   v,
  m,
  val 
)     ((((void **)(v))[(m)->module_index]) = (val))

◆ AP_TAKE1

#define AP_TAKE1   func.take1

This configuration directive takes 1 argument

◆ AP_TAKE2

#define AP_TAKE2   func.take2

This configuration directive takes 2 arguments

◆ AP_TAKE3

#define AP_TAKE3   func.take3

This configuration directive takes 3 arguments

◆ AP_TAKE_ARGV

#define AP_TAKE_ARGV   func.take_argv

This configuration directive will handle its own parsing of arguments

◆ APLOG_USE_MODULE

#define APLOG_USE_MODULE (   foo)
Value:
extern module AP_MODULE_DECLARE_DATA foo##_module; \
AP_MAYBE_UNUSED(static int * const aplog_module_index) = &(foo##_module.module_index)
Definition: http_config.h:348

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.

Parameters
fooname of the module symbol of the current module, without the trailing "_module" part
See also
APLOG_MARK

◆ DECLINE_CMD

#define DECLINE_CMD   "\a\b"

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 as an error code.

Typedef Documentation

◆ ap_conf_vector_t

configuration vector structure

◆ ap_configfile_t

Common structure for reading of config files / passwd files etc.

◆ cmd_parms

typedef struct cmd_parms_struct cmd_parms

This structure is passed to a command which is being invoked, to carry a large variety of miscellaneous data which is all of use to somebody...

◆ command_rec

typedef struct command_struct command_rec

The command record structure. Modules can define a table of these to define the directives it will implement.

◆ module

typedef struct module_struct module

Module structures. Just about everything is dispatched through these, directly or indirectly (through the command and handler tables).

Enumeration Type Documentation

◆ cmd_how

enum cmd_how

How the directives arguments should be parsed.

Remarks
Note that for all of these except RAW_ARGS, the config routine is passed a freshly allocated string which can be modified or stored or whatever...
Enumerator
RAW_ARGS 

cmd_func parses command line itself

TAKE1 

one argument only

TAKE2 

two arguments only

ITERATE 

one argument, occurring multiple times (e.g., IndexIgnore)

ITERATE2 

two arguments, 2nd occurs multiple times (e.g., AddIcon)

FLAG 

One of 'On' or 'Off'

NO_ARGS 

No args at all, e.g. </Directory>

TAKE12 

one or two arguments

TAKE3 

three arguments only

TAKE23 

two or three arguments

TAKE123 

one, two or three arguments

TAKE13 

one or three arguments

TAKE_ARGV 

an argc and argv are passed

Function Documentation

◆ ap_add_loaded_module()

const char* ap_add_loaded_module ( module mod,
apr_pool_t p,
const char *  s 
)

Add a module to the chained modules list and the list of loaded modules

Parameters
modThe module structure of the module to add
pThe pool with the same lifetime as the module
sThe module's symbol name (used for logging)

◆ ap_add_module()

const char* ap_add_module ( module m,
apr_pool_t p,
const char *  s 
)

Add a module to the server

Parameters
mThe module structure of the module to add
pThe pool of the same lifetime as the module
sThe module's symbol name (used for logging)

◆ ap_build_config()

const char* ap_build_config ( cmd_parms parms,
apr_pool_t conf_pool,
apr_pool_t temp_pool,
ap_directive_t **  conftree 
)

Build a config tree from a config file

Parameters
parmsThe cmd_parms to pass to all of the directives in the file
conf_poolThe pconf pool
temp_poolThe temporary pool
conftreePlace to store the root node of the config tree
Returns
Error string on error, NULL otherwise
Note
If conf_pool == temp_pool, ap_build_config() will assume .htaccess context and use a lower maximum line length.

◆ ap_build_cont_config()

const char* ap_build_cont_config ( apr_pool_t p,
apr_pool_t temp_pool,
cmd_parms parms,
ap_directive_t **  current,
ap_directive_t **  curr_parent,
const char *  orig_directive 
)

Read all data between the current <foo> and the matching </foo> and build a config tree from it

Parameters
ppool to allocate from
temp_poolTemporary pool to allocate from
parmsThe cmd_parms to pass to all directives read
currentThe current node in the tree
curr_parentThe current parent node
orig_directiveThe directive to read until hit.
Returns
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.

◆ ap_cfg_closefile()

int ap_cfg_closefile ( ap_configfile_t cfp)

Detach from open ap_configfile_t, calling the close handler

Parameters
cfpThe file to close
Returns
1 on success, 0 on failure

◆ ap_cfg_getc()

apr_status_t ap_cfg_getc ( char *  ch,
ap_configfile_t cfp 
)

Read one char from open configfile_t, increase line number upon LF

Parameters
chplace to store the char read
cfpThe file to read from
Returns
error status

◆ ap_cfg_getline()

apr_status_t ap_cfg_getline ( char *  buf,
apr_size_t  bufsize,
ap_configfile_t cfp 
)

Read one line from open ap_configfile_t, strip leading and trailing whitespace, increase line number

Parameters
bufplace to store the line read
bufsizesize of the buffer
cfpFile to read from
Returns
error status, APR_ENOSPC if bufsize is too small for the line

◆ ap_create_conn_config()

ap_conf_vector_t* ap_create_conn_config ( apr_pool_t p)

Setup the config vector for a connection_rec

Parameters
pThe pool to allocate the config vector from
Returns
The config vector

◆ ap_create_per_dir_config()

ap_conf_vector_t* ap_create_per_dir_config ( apr_pool_t p)

Setup the config vector for per dir module configs

Parameters
pThe pool to allocate the config vector from
Returns
The config vector

◆ ap_create_request_config()

ap_conf_vector_t* ap_create_request_config ( apr_pool_t p)

Setup the config vector for a request_rec

Parameters
pThe pool to allocate the config vector from
Returns
The config vector

◆ ap_dir_cfgmatch()

ap_dir_match_t* ap_dir_cfgmatch ( cmd_parms cmd,
int  flags,
const char *(*)(ap_dir_match_t *w, const char *fname)  cb,
void *  ctx 
)

Convenience function to create a ap_dir_match_t structure from a cmd_parms.

Parameters
cmdThe command.
flagsFlags to indicate whether optional or recursive.
cbCallback for each file found that matches the wildcard. Return NULL on success, an error string on error.
ctxContext for the callback.
Returns
Structure ap_dir_match_t with fields populated, allocated from the cmd->temp_pool.

◆ ap_exists_directive()

int ap_exists_directive ( apr_pool_t p,
const char *  name 
)

Returns non-zero if a configuration directive of the given name has been registered by a module at the time of calling.

Parameters
pPool for temporary allocations
nameDirective name

◆ ap_find_command()

const command_rec* ap_find_command ( const char *  name,
const command_rec cmds 
)

Find a given directive in a command_rec table

Parameters
nameThe directive to search for
cmdsThe table to search
Returns
The directive definition of the specified directive

◆ ap_find_command_in_modules()

const command_rec* ap_find_command_in_modules ( const char *  cmd_name,
module **  mod 
)

Find a given directive in a list of modules.

Parameters
cmd_nameThe directive to search for
modPointer to the first module in the linked list; will be set to the module providing cmd_name
Returns
The directive definition of the specified directive. *mod will be changed to point to the module containing the directive.

◆ ap_find_linked_module()

module* ap_find_linked_module ( const char *  name)

Find a module based on the name of the module

Parameters
namethe name of the module
Returns
the module structure if found, NULL otherwise

◆ ap_find_module_name()

const char* ap_find_module_name ( module m)

Find the name of the specified module

Parameters
mThe module to get the name for
Returns
the name of the module

◆ ap_find_module_short_name()

const char* ap_find_module_short_name ( int  module_index)

Find the short name of the module identified by the specified module index

Parameters
module_indexThe module index to get the name for
Returns
the name of the module, NULL if not found

◆ ap_fixup_virtual_hosts()

void ap_fixup_virtual_hosts ( apr_pool_t p,
server_rec main_server 
)

Setup all virtual hosts

Parameters
pThe pool to allocate from
main_serverThe head of the server_rec list

◆ ap_get_conn_module_loglevel()

int ap_get_conn_module_loglevel ( const conn_rec c,
int  index 
)

Generic accessor for modules the module-specific loglevel

Parameters
cThe connection from which to get the loglevel.
indexThe module_index of the module to get the loglevel for.
Returns
The module-specific loglevel

◆ ap_get_conn_server_module_loglevel()

int ap_get_conn_server_module_loglevel ( const conn_rec c,
const server_rec s,
int  index 
)

Generic accessor for modules the module-specific loglevel

Parameters
cThe connection from which to get the loglevel.
sThe server from which to get the loglevel if c does not have a specific loglevel configuration.
indexThe module_index of the module to get the loglevel for.
Returns
The module-specific loglevel

◆ ap_get_module_config()

void* ap_get_module_config ( const ap_conf_vector_t cv,
const module m 
)

Generic accessors for other modules to get at their own module-specific data

Parameters
cvThe vector in which the modules configuration is stored. usually r->per_dir_config or s->module_config
mThe module to get the data for.
Returns
The module-specific data

◆ ap_get_module_flags()

int ap_get_module_flags ( const module m)

Generic accessor for the module's flags

Parameters
mThe module to get the flags from.
Returns
The module-specific flags

◆ ap_get_request_module_loglevel()

int ap_get_request_module_loglevel ( const request_rec r,
int  index 
)

Generic accessor for modules to get the module-specific loglevel

Parameters
rThe request from which to get the loglevel.
indexThe module_index of the module to get the loglevel for.
Returns
The module-specific loglevel

◆ ap_get_server_module_loglevel()

int ap_get_server_module_loglevel ( const server_rec s,
int  index 
)

Generic accessor for modules to get the module-specific loglevel

Parameters
sThe server from which to get the loglevel.
indexThe module_index of the module to get the loglevel for.
Returns
The module-specific loglevel

◆ ap_init_virtual_host()

const char* ap_init_virtual_host ( apr_pool_t p,
const char *  hostname,
server_rec main_server,
server_rec **  ps 
)

Setup a virtual host

Parameters
pThe pool to allocate all memory from
hostnameThe hostname of the virtual hsot
main_serverThe main server for this Apache configuration
psPlace to store the new server_rec return Error string on error, NULL on success

◆ ap_invoke_handler()

int ap_invoke_handler ( request_rec r)

Run the handler phase of each module until a module accepts the responsibility of serving the request

Parameters
rThe current request
Returns
The status of the current request

◆ ap_merge_log_config()

void ap_merge_log_config ( const struct ap_logconf old_conf,
struct ap_logconf new_conf 
)

Merge old ap_logconf into new ap_logconf. old and new must have the same life time.

Parameters
old_confThe ap_logconf to merge from
new_confThe ap_logconf to merge into

◆ ap_merge_per_dir_configs()

ap_conf_vector_t* ap_merge_per_dir_configs ( apr_pool_t p,
ap_conf_vector_t base,
ap_conf_vector_t new_conf 
)

Run all of the modules merge per dir config functions

Parameters
pThe pool to pass to the merge functions
baseThe base directory config structure
new_confThe new directory config structure

◆ ap_method_is_limited()

int ap_method_is_limited ( cmd_parms cmd,
const char *  method 
)

Return true if the specified method is limited by being listed in a <Limit> container, or by not being listed in a <LimitExcept> container.

Parameters
methodPointer to a string specifying the method to check.
cmdPointer to the cmd_parms structure passed to the directive handler.
Returns
0 if the method is not limited in the current scope

◆ ap_new_log_config()

struct ap_logconf* ap_new_log_config ( apr_pool_t p,
const struct ap_logconf old 
)

Allocate new ap_logconf and make (deep) copy of old ap_logconf

Parameters
pThe pool to alloc from
oldThe ap_logconf to copy (may be NULL)
Returns
The new ap_logconf struct

◆ ap_open_htaccess()

apr_status_t ap_open_htaccess ( request_rec r,
const char *  dir_name,
const char *  access_name,
ap_configfile_t **  conffile,
const char **  full_name 
)

Core internal function, use ap_run_open_htaccess() instead.

◆ ap_parse_htaccess()

int ap_parse_htaccess ( ap_conf_vector_t **  result,
request_rec r,
int  override,
int  override_opts,
apr_table_t override_list,
const char *  path,
const char *  access_name 
)

parse an htaccess file

Parameters
resulthtaccess_result
rThe request currently being served
overrideWhich overrides are active
override_optsWhich allow-override-opts bits are set
override_listTable of directives allowed for override
pathThe path to the htaccess file
access_nameThe list of possible names for .htaccess files int The status of the current request

◆ ap_parse_log_level()

const char* ap_parse_log_level ( const char *  str,
int val 
)

Parsing function for log level

Parameters
strThe string to parse
valThe parsed log level
Returns
An error string or NULL on success

◆ ap_pcfg_open_custom()

ap_configfile_t* ap_pcfg_open_custom ( apr_pool_t p,
const char *  descr,
void *  param,
apr_status_t(*)(char *ch, void *param)  getc_func,
apr_status_t(*)(void *buf, apr_size_t bufsiz, void *param)  gets_func,
apr_status_t(*)(void *param)  close_func 
)

Allocate a ap_configfile_t handle with user defined functions and params

Parameters
pThe pool to allocate from
descrThe name of the file
paramThe argument passed to getch/getstr/close
getc_funcThe getch function
gets_funcThe getstr function
close_funcThe close function

◆ ap_pcfg_openfile()

apr_status_t ap_pcfg_openfile ( ap_configfile_t **  ret_cfg,
apr_pool_t p,
const char *  name 
)

Open a ap_configfile_t as apr_file_t

Parameters
ret_cfgopen ap_configfile_t struct pointer
pThe pool to allocate the structure from
namethe name of the file to open

◆ ap_pcfg_strerror()

const char* ap_pcfg_strerror ( apr_pool_t p,
ap_configfile_t cfp,
apr_status_t  rc 
)

Convert a return value from ap_cfg_getline or ap_cfg_getc to a user friendly string.

Parameters
pThe pool to allocate the string from
cfpThe config file
rcThe return value to convert
Returns
The error string, NULL if rc == APR_SUCCESS

◆ ap_pool_cleanup_set_null()

apr_status_t ap_pool_cleanup_set_null ( void *  data)

A generic pool cleanup that will reset a pointer to NULL. For use with apr_pool_cleanup_register.

Parameters
dataThe address of the pointer
Returns
APR_SUCCESS

◆ ap_process_config_tree()

int ap_process_config_tree ( server_rec s,
ap_directive_t conftree,
apr_pool_t p,
apr_pool_t ptemp 
)

Process all directives in the config tree

Parameters
sThe server rec to use in the command parms
conftreeThe config tree to process
pThe pool for general allocation
ptempThe pool for temporary allocations
Returns
OK if no problems

◆ ap_process_fnmatch_configs()

const char* ap_process_fnmatch_configs ( server_rec s,
const char *  fname,
ap_directive_t **  conftree,
apr_pool_t p,
apr_pool_t ptemp,
int  optional 
)

Process all matching files as Apache configs

Parameters
sThe server rec to use for the command parms
fnameThe filename pattern of the config file
conftreeThe root node of the created config tree
pPool for general allocation
ptempPool for temporary allocation
optionalWhether a no-match wildcard is allowed
See also
apr_fnmatch for pattern handling

◆ ap_process_resource_config()

const char* ap_process_resource_config ( server_rec s,
const char *  fname,
ap_directive_t **  conftree,
apr_pool_t p,
apr_pool_t ptemp 
)

Process a config file for Apache

Parameters
sThe server rec to use for the command parms
fnameThe name of the config file
conftreeThe root node of the created config tree
pPool for general allocation
ptempPool for temporary allocation

◆ ap_read_config()

server_rec* ap_read_config ( process_rec process,
apr_pool_t temp_pool,
const char *  config_name,
ap_directive_t **  conftree 
)

Read all config files and setup the server

Parameters
processThe process running the server
temp_poolA pool to allocate temporary data from.
config_nameThe name of the config file
conftreePlace to store the root of the config tree
Returns
The setup server_rec list.

◆ ap_register_hooks()

void ap_register_hooks ( module m,
apr_pool_t p 
)

Run the register hooks function for a specified module

Parameters
mThe module to run the register hooks function from
pThe pool valid for the lifetime of the module

◆ ap_remove_loaded_module()

void ap_remove_loaded_module ( module mod)

Remove a module from the chained modules list and the list of loaded modules

Parameters
modthe module structure of the module to remove

◆ ap_remove_module()

void ap_remove_module ( module m)

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.

Parameters
mthe module structure of the module to remove

◆ ap_reserve_module_slots()

void ap_reserve_module_slots ( int  count)

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.

Parameters
countThe number of slots to reserve.

◆ ap_reserve_module_slots_directive()

void ap_reserve_module_slots_directive ( const char *  directive)

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.

Parameters
directiveThe name of the directive

◆ ap_reset_module_loglevels()

void ap_reset_module_loglevels ( struct ap_logconf l,
int  val 
)

Set all module-specific loglevels to val

Parameters
lThe log config for which to set the loglevels.
valthe value to set all loglevels to

◆ ap_retained_data_create()

void* ap_retained_data_create ( const char *  key,
apr_size_t  size 
)

Store data which will be retained across unload/load of modules

Parameters
keyThe unique key associated with this module's retained data
sizein bytes of the retained data (to be allocated)
Returns
Address of new retained data structure, initially cleared

◆ ap_retained_data_get()

void* ap_retained_data_get ( const char *  key)

Retrieve data which was stored by ap_retained_data_create()

Parameters
keyThe unique key associated with this module's retained data
Returns
Address of previously retained data structure, or NULL if not yet saved

◆ ap_run_rewrite_args()

void ap_run_rewrite_args ( process_rec process)

Run all rewrite args hooks for loaded modules

Parameters
processThe process currently running the server

◆ ap_runtime_dir_relative()

char* ap_runtime_dir_relative ( apr_pool_t p,
const char *  fname 
)

Compute the name of a run-time file (e.g., shared memory "file") relative to the appropriate run-time directory. Absolute paths are returned as-is. The run-time directory is configured via the DefaultRuntimeDir directive or at build time.

◆ ap_server_root_relative()

char* ap_server_root_relative ( apr_pool_t p,
const char *  fname 
)

For modules which need to read config files, open logs, etc. this returns the canonical form of fname made absolute to ap_server_root.

Parameters
ppool to allocate data from
fnameThe file name

◆ ap_set_config_vectors()

void* ap_set_config_vectors ( server_rec server,
ap_conf_vector_t section_vector,
const char *  section,
module mod,
apr_pool_t pconf 
)

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.

Parameters
serverThe server to operate upon.
section_vectorThe per-section config vector.
sectionWhich section to create a config for.
modThe module which is defining the config data.
pconfA pool for all configuration allocations.
Returns
The (new) per-section config data.

◆ ap_set_deprecated()

const char* ap_set_deprecated ( cmd_parms cmd,
void *  struct_ptr,
const char *  arg 
)

Generic command handling function to respond with cmd->help as an error

Parameters
cmdThe command parameters for this directive
struct_ptrpointer into a given type
argThe argument to the directive
Returns
The cmd->help value as the error string
Note
This allows simple declarations such as:
"The Foo directive is no longer supported, use Bar"),
#define AP_INIT_RAW_ARGS(directive, func, mconfig, where, help)
Definition: http_config.h:122
const char * ap_set_deprecated(cmd_parms *cmd, void *struct_ptr, const char *arg)
#define OR_ALL
Definition: http_config.h:255

◆ ap_set_file_slot()

const char* ap_set_file_slot ( cmd_parms cmd,
void *  struct_ptr,
const char *  arg 
)

Generic command handling function for files

Parameters
cmdThe command parameters for this directive
struct_ptrpointer into a given type
argThe argument to the directive
Returns
An error string or NULL on success

◆ ap_set_flag_slot()

const char* ap_set_flag_slot ( cmd_parms cmd,
void *  struct_ptr,
int  arg 
)

Generic command handling function for flags stored in an int

Parameters
cmdThe command parameters for this directive
struct_ptrpointer into a given type
argThe argument to the directive (either 1 or 0)
Returns
An error string or NULL on success

◆ ap_set_flag_slot_char()

const char* ap_set_flag_slot_char ( cmd_parms cmd,
void *  struct_ptr,
int  arg 
)

Generic command handling function for flags stored in a char

Parameters
cmdThe command parameters for this directive
struct_ptrpointer into a given type
argThe argument to the directive (either 1 or 0)
Returns
An error string or NULL on success

◆ ap_set_int_slot()

const char* ap_set_int_slot ( cmd_parms cmd,
void *  struct_ptr,
const char *  arg 
)

Generic command handling function for integers

Parameters
cmdThe command parameters for this directive
struct_ptrpointer into a given type
argThe argument to the directive
Returns
An error string or NULL on success

◆ ap_set_module_config()

void ap_set_module_config ( ap_conf_vector_t cv,
const module m,
void *  val 
)

Generic accessors for other modules to set their own module-specific data

Parameters
cvThe vector in which the modules configuration is stored. usually r->per_dir_config or s->module_config
mThe module to set the data for.
valThe module-specific data to set

◆ ap_set_module_loglevel()

void ap_set_module_loglevel ( apr_pool_t p,
struct ap_logconf l,
int  index,
int  level 
)

Accessor to set module-specific loglevel

Parameters
pA pool
lThe ap_logconf struct to modify.
indexThe module_index of the module to set the loglevel for.
levelThe new log level

◆ ap_set_string_slot()

const char* ap_set_string_slot ( cmd_parms cmd,
void *  struct_ptr,
const char *  arg 
)

Generic command handling function for strings

Parameters
cmdThe command parameters for this directive
struct_ptrpointer into a given type
argThe argument to the directive
Returns
An error string or NULL on success

◆ ap_set_string_slot_lower()

const char* ap_set_string_slot_lower ( cmd_parms cmd,
void *  struct_ptr,
const char *  arg 
)

Generic command handling function for strings, always sets the value to a lowercase string

Parameters
cmdThe command parameters for this directive
struct_ptrpointer into a given type
argThe argument to the directive
Returns
An error string or NULL on success

◆ ap_setup_prelinked_modules()

const char* ap_setup_prelinked_modules ( process_rec process)

Add all of the prelinked modules into the loaded module list

Parameters
processThe process that is currently running the server

◆ ap_show_directives()

void ap_show_directives ( void  )

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.

◆ ap_show_modules()

void ap_show_modules ( void  )

Show the preloaded module names. Used for httpd -l.

◆ ap_show_mpm()

const char* ap_show_mpm ( void  )

Show the MPM name. Used in reporting modules such as mod_info to provide extra information to the user

◆ ap_single_module_configure()

void ap_single_module_configure ( apr_pool_t p,
server_rec s,
module m 
)

Run a single module's two create_config hooks

Parameters
pthe pool to allocate from
sThe server to configure for.
mThe module to configure

◆ ap_soak_end_container()

const char* ap_soak_end_container ( cmd_parms cmd,
const char *  directive 
)

Read all data between the current <foo> and the matching </foo>. All of this data is forgotten immediately.

Parameters
cmdThe cmd_parms to pass to the directives inside the container
directiveThe directive name to read until
Returns
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.

◆ ap_state_dir_relative()

char* ap_state_dir_relative ( apr_pool_t p,
const char *  fname 
)

Compute the name of a persistent state file (e.g. a database or long-lived cache) relative to the appropriate state directory. Absolute paths are returned as-is. The state directory is configured via the DefaultStateDir directive or at build time.

◆ ap_walk_config()

const char* ap_walk_config ( ap_directive_t conftree,
cmd_parms parms,
ap_conf_vector_t section_vector 
)

Walk a config tree and setup the server's internal structures

Parameters
conftreeThe config tree to walk
parmsThe cmd_parms to pass to all functions
section_vectorThe per-section config vector.
Returns
Error string on error, NULL otherwise

Variable Documentation

◆ ap_loaded_modules

module ** ap_loaded_modules
extern

Array of all loaded modules

◆ ap_prelinked_module_symbols

ap_module_symbol_t ap_prelinked_module_symbols[]
extern

Array of all statically linked modulenames (symbols)

◆ ap_prelinked_modules

module * ap_prelinked_modules[]
extern

Array of all statically linked modules

◆ ap_preloaded_modules

module * ap_preloaded_modules[]
extern

Array of all preloaded modules

◆ ap_top_module

module * ap_top_module
extern

The topmost module in the list