Apache2
|
ap hook functions and macros More...
Go to the source code of this file.
Macros | |
#define | AP_DECLARE_STATIC |
#define | AP_DECLARE_EXPORT |
#define | AP_DECLARE_HOOK(ret, name, args) APR_DECLARE_EXTERNAL_HOOK(ap,AP,ret,name,args) |
#define | AP_IMPLEMENT_HOOK_BASE(name) APR_IMPLEMENT_EXTERNAL_HOOK_BASE(ap,AP,name) |
#define | AP_IMPLEMENT_HOOK_VOID(name, args_decl, args_use) APR_IMPLEMENT_EXTERNAL_HOOK_VOID(ap,AP,name,args_decl,args_use) |
#define | AP_IMPLEMENT_HOOK_RUN_ALL(ret, name, args_decl, args_use, ok, decline) |
#define | AP_IMPLEMENT_HOOK_RUN_FIRST(ret, name, args_decl, args_use, decline) |
#define | AP_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(ret, name, args_decl, args_use, ok, decline) |
#define | AP_IMPLEMENT_OPTIONAL_HOOK_RUN_FIRST(ret, name, args_decl, args_use, decline) |
#define | AP_OPTIONAL_HOOK(name, fn, pre, succ, order) APR_OPTIONAL_HOOK(ap,name,fn,pre,succ,order) |
ap hook functions and macros
#define AP_DECLARE_EXPORT |
AP_DECLARE_EXPORT is defined when building the Apache Core dynamic library, so that all public symbols are exported.
#define AP_DECLARE_HOOK | ( | ret, | |
name, | |||
args | |||
) | APR_DECLARE_EXTERNAL_HOOK(ap,AP,ret,name,args) |
Declare a hook function
ret | The return type of the hook |
name | The hook's name (as a literal) |
args | The arguments the hook function takes, in brackets. |
#define AP_DECLARE_STATIC |
AP_DECLARE_STATIC is defined when including Apache's Core headers, to provide static linkage when the dynamic library may be unavailable.
AP_DECLARE_STATIC and AP_DECLARE_EXPORT are left undefined when including Apache's Core headers, to import and link the symbols from the dynamic Apache Core library and assure appropriate indirection and calling conventions at compile time.
#define AP_IMPLEMENT_HOOK_BASE | ( | name | ) | APR_IMPLEMENT_EXTERNAL_HOOK_BASE(ap,AP,name) |
#define AP_IMPLEMENT_HOOK_RUN_ALL | ( | ret, | |
name, | |||
args_decl, | |||
args_use, | |||
ok, | |||
decline | |||
) |
Implement an Apache core hook that runs until one of the functions returns something other than ok or decline. That return value is then returned from the hook runner. If the hooks run to completion, then ok is returned. Note that if no hook runs it would probably be more correct to return decline, but this currently does not do so. The implementation is called ap_run_name.
ret | The return type of the hook (and the hook runner) |
name | The name of the hook |
args_decl | The declaration of the arguments for the hook, for example "(int x,void *y)" |
args_use | The arguments for the hook as used in a call, for example "(x,y)" |
ok | The "ok" return value |
decline | The "decline" return value |
#define AP_IMPLEMENT_HOOK_RUN_FIRST | ( | ret, | |
name, | |||
args_decl, | |||
args_use, | |||
decline | |||
) |
Implement a hook that runs until a function returns something other than decline. If all functions return decline, the hook runner returns decline. The implementation is called ap_run_name.
ret | The return type of the hook (and the hook runner) |
name | The name of the hook |
args_decl | The declaration of the arguments for the hook, for example "(int x,void *y)" |
args_use | The arguments for the hook as used in a call, for example "(x,y)" |
decline | The "decline" return value |
#define AP_IMPLEMENT_HOOK_VOID | ( | name, | |
args_decl, | |||
args_use | |||
) | APR_IMPLEMENT_EXTERNAL_HOOK_VOID(ap,AP,name,args_decl,args_use) |
Implement an Apache core hook that has no return code, and therefore runs all of the registered functions. The implementation is called ap_run_name.
name | The name of the hook |
args_decl | The declaration of the arguments for the hook, for example "(int x,void *y)" |
args_use | The arguments for the hook as used in a call, for example "(x,y)" |
#define AP_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL | ( | ret, | |
name, | |||
args_decl, | |||
args_use, | |||
ok, | |||
decline | |||
) |
Implement an optional hook. This is exactly the same as a standard hook implementation, except the hook is optional.
#define AP_IMPLEMENT_OPTIONAL_HOOK_RUN_FIRST | ( | ret, | |
name, | |||
args_decl, | |||
args_use, | |||
decline | |||
) |
Implement an optional hook. This is exactly the same as a standard hook implementation, except the hook is optional.
#define AP_OPTIONAL_HOOK | ( | name, | |
fn, | |||
pre, | |||
succ, | |||
order | |||
) | APR_OPTIONAL_HOOK(ap,name,fn,pre,succ,order) |
Hook an optional hook. Unlike static hooks, this uses a macro instead of a function.