Apache HTTPD
Macros | Typedefs | Functions | Variables
Optional Functions

Macros

#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)
 

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)

Macro Definition Documentation

◆ APR_DECLARE_OPTIONAL_FN

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

Declare an optional function.

Parameters
retThe return type of the function
nameThe name of the function
argsThe function arguments (including brackets)

Definition at line 50 of file apr_optional.h.

◆ APR_OPTIONAL_FN_TYPE

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

The type of an optional function.

Parameters
nameThe name of the function

Definition at line 42 of file apr_optional.h.

◆ APR_REGISTER_OPTIONAL_FN

#define APR_REGISTER_OPTIONAL_FN (   name)
Value:
do { \
} while (0)
void() apr_opt_fn_t(void)
apr_size_t size
char * name

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
nameThe name of the function

Definition at line 70 of file apr_optional.h.

◆ APR_RETRIEVE_OPTIONAL_FN

#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
nameThe name of the function

Definition at line 84 of file apr_optional.h.

Typedef Documentation

◆ apr_opt_fn_t

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()

APU_DECLARE ( apr_opt_fn_t ) const

◆ APU_DECLARE_NONSTD()

APU_DECLARE_NONSTD ( void  ) const

Variable Documentation

◆ pfn

Definition at line 62 of file apr_optional.h.