Apache2
ap_hooks.h File Reference

ap hook functions and macros More...

#include "apr.h"
#include "apr_hooks.h"
#include "apr_optional_hooks.h"
Include dependency graph for ap_hooks.h:
This graph shows which files directly or indirectly include this file:

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)
 

Detailed Description

ap hook functions and macros

Macro Definition Documentation

◆ AP_DECLARE_EXPORT

#define AP_DECLARE_EXPORT

AP_DECLARE_EXPORT is defined when building the Apache Core dynamic library, so that all public symbols are exported.

See also
AP_DECLARE_STATIC

◆ AP_DECLARE_HOOK

#define AP_DECLARE_HOOK (   ret,
  name,
  args 
)     APR_DECLARE_EXTERNAL_HOOK(ap,AP,ret,name,args)

Declare a hook function

Parameters
retThe return type of the hook
nameThe hook's name (as a literal)
argsThe arguments the hook function takes, in brackets.

◆ AP_DECLARE_STATIC

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

See also
AP_DECLARE_EXPORT

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.

◆ AP_IMPLEMENT_HOOK_BASE

#define AP_IMPLEMENT_HOOK_BASE (   name)     APR_IMPLEMENT_EXTERNAL_HOOK_BASE(ap,AP,name)

◆ AP_IMPLEMENT_HOOK_RUN_ALL

#define AP_IMPLEMENT_HOOK_RUN_ALL (   ret,
  name,
  args_decl,
  args_use,
  ok,
  decline 
)
Value:
args_use,ok,decline)
#define APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(ns, link, ret, name, args_decl, args_use, ok, decline)
Definition: apr_hooks.h:222
const char * name
Definition: mod_dav.h:805

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.

Parameters
retThe return type of the hook (and the hook runner)
nameThe name of the hook
args_declThe declaration of the arguments for the hook, for example "(int x,void *y)"
args_useThe arguments for the hook as used in a call, for example "(x,y)"
okThe "ok" return value
declineThe "decline" return value
Returns
ok, decline or an error.
Note
If IMPLEMENTing a hook that is not linked into the Apache core, (e.g. within a dso) use AP_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL instead.

◆ AP_IMPLEMENT_HOOK_RUN_FIRST

#define AP_IMPLEMENT_HOOK_RUN_FIRST (   ret,
  name,
  args_decl,
  args_use,
  decline 
)
Value:
args_use,decline)
#define APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(ns, link, ret, name, args_decl, args_use, decline)
Definition: apr_hooks.h:267

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.

Parameters
retThe return type of the hook (and the hook runner)
nameThe name of the hook
args_declThe declaration of the arguments for the hook, for example "(int x,void *y)"
args_useThe arguments for the hook as used in a call, for example "(x,y)"
declineThe "decline" return value
Returns
decline or an error.
Note
If IMPLEMENTing a hook that is not linked into the Apache core (e.g. within a dso) use AP_IMPLEMENT_OPTIONAL_HOOK_RUN_FIRST instead.

◆ AP_IMPLEMENT_HOOK_VOID

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

Parameters
nameThe name of the hook
args_declThe declaration of the arguments for the hook, for example "(int x,void *y)"
args_useThe arguments for the hook as used in a call, for example "(x,y)"
Note
If IMPLEMENTing a hook that is not linked into the Apache core, (e.g. within a dso) see APR_IMPLEMENT_EXTERNAL_HOOK_VOID.

◆ AP_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL

#define AP_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL (   ret,
  name,
  args_decl,
  args_use,
  ok,
  decline 
)
Value:
args_use,ok,decline)
#define APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(ns, link, ret, name, args_decl, args_use, ok, decline)
Definition: apr_optional_hooks.h:89

Implement an optional hook. This is exactly the same as a standard hook implementation, except the hook is optional.

See also
AP_IMPLEMENT_HOOK_RUN_ALL

◆ AP_IMPLEMENT_OPTIONAL_HOOK_RUN_FIRST

#define AP_IMPLEMENT_OPTIONAL_HOOK_RUN_FIRST (   ret,
  name,
  args_decl,
  args_use,
  decline 
)
Value:
APR_IMPLEMENT_OPTIONAL_HOOK_RUN_FIRST(ap,AP,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.

See also
AP_IMPLEMENT_HOOK_RUN_FIRST

◆ AP_OPTIONAL_HOOK

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