Main Page | Modules | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

Optional Functions


Defines

#define APR_OPTIONAL_FN_TYPE(name)   apr_OFN_##name##_t
#define APR_DECLARE_OPTIONAL_FN(ret, name, args)   typedef ret (APR_OPTIONAL_FN_TYPE(name)) args
#define APR_REGISTER_OPTIONAL_FN(name)
#define APR_RETRIEVE_OPTIONAL_FN(name)   (APR_OPTIONAL_FN_TYPE(name) *)apr_dynamic_fn_retrieve(#name)

Typedefs

typedef void( apr_opt_fn_t )(void)

Functions

 APU_DECLARE_NONSTD (void) apr_dynamic_fn_register(const char *szName
 APU_DECLARE (apr_opt_fn_t *) apr_dynamic_fn_retrieve(const char *szName)
 APU_DECLARE_NONSTD (void)
 APU_DECLARE (apr_opt_fn_t *)

Variables

apr_opt_fn_tpfn

Detailed Description

Typesafe registration and retrieval of functions that may not be present (i.e. functions exported by optional modules)

Define Documentation

#define APR_DECLARE_OPTIONAL_FN ret,
name,
args   )     typedef ret (APR_OPTIONAL_FN_TYPE(name)) args
 

Declare an optional function.

Parameters:
ret The return type of the function
name The name of the function
args The function arguments (including brackets)

Definition at line 50 of file apr_optional.h.

#define APR_OPTIONAL_FN_TYPE name   )     apr_OFN_##name##_t
 

The type of an optional function.

Parameters:
name The name of the function

Definition at line 42 of file apr_optional.h.

Referenced by log_pre_config(), logio_pre_config(), main(), pre_config(), and ssl_var_log_config_register().

#define APR_REGISTER_OPTIONAL_FN name   ) 
 

Value:

do { \
  APR_OPTIONAL_FN_TYPE(name) *apu__opt = name; \
  apr_dynamic_fn_register(#name,(apr_opt_fn_t *)apu__opt); \
} while (0)
Register an optional function. This can be later retrieved, type-safely, by name. Like all global functions, the name must be unique. Note that, confusingly but correctly, the function itself can be static!
Parameters:
name The name of the function

Definition at line 74 of file apr_optional.h.

Referenced by ExportRegisterHooks(), register_hooks(), ssl_register_hooks(), and ssl_var_register().

#define APR_RETRIEVE_OPTIONAL_FN name   )     (APR_OPTIONAL_FN_TYPE(name) *)apr_dynamic_fn_retrieve(#name)
 

Retrieve an optional function. Returns NULL if the function is not present.

Parameters:
name The name of the function

Definition at line 91 of file apr_optional.h.

Referenced by cache_post_config(), cgi_post_config(), cgid_init(), core_post_config(), ImportFnRetrieve(), include_post_config(), log_pre_config(), logio_pre_config(), main(), post_config(), pre_config(), proxy_post_config(), and ssl_var_log_config_register().


Typedef Documentation

typedef void( apr_opt_fn_t)(void)
 

XXX: This doesn't belong here, then! Private function! DO NOT USE!

Definition at line 59 of file apr_optional.h.


Function Documentation

APU_DECLARE apr_opt_fn_t  ) 
 

Definition at line 373 of file apr_hooks.c.

References NULL.

APU_DECLARE apr_opt_fn_t  )  const
 

APU_DECLARE_NONSTD void   ) 
 

Free memory previously allocated with apr_bucket_alloc().

Parameters:
block The block of memory to be freed.

Definition at line 43 of file apr_buckets.c.

APU_DECLARE_NONSTD void   )  const
 


Variable Documentation

apr_opt_fn_t * pfn
 

Definition at line 66 of file apr_optional.h.

Referenced by APR_OPTIONAL_FN_TYPE(), and ImportFnRetrieve().