Apache HTTPD
Macros
ap_hooks.h File Reference

ap hook functions and macros More...

#include "apr.h"
#include "apr_hooks.h"
#include "apr_optional_hooks.h"

Go to the source code of this file.

Macros

#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_OPTIONAL_HOOK(name, fn, pre, succ, order)    APR_OPTIONAL_HOOK(ap,name,fn,pre,succ,order)
 

Detailed Description

ap hook functions and macros

Definition in file ap_hooks.h.

Macro Definition Documentation

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

Definition at line 74 of file ap_hooks.h.

◆ AP_IMPLEMENT_HOOK_BASE

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

Definition at line 78 of file ap_hooks.h.

◆ AP_IMPLEMENT_HOOK_RUN_ALL

#define AP_IMPLEMENT_HOOK_RUN_ALL (   ret,
  name,
  args_decl,
  args_use,
  ok,
  decline 
)
Value:
#define APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(ns, link, ret, name, args_decl, args_use, ok, decline)
Definition apr_hooks.h:222
apr_size_t size
apr_vformatter_buff_t const char va_list ap
Definition apr_lib.h:176
char * name

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) see APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL.

Definition at line 117 of file ap_hooks.h.

◆ AP_IMPLEMENT_HOOK_RUN_FIRST

#define AP_IMPLEMENT_HOOK_RUN_FIRST (   ret,
  name,
  args_decl,
  args_use,
  decline 
)
Value:
#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) see APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST.

Definition at line 137 of file ap_hooks.h.

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

Definition at line 94 of file ap_hooks.h.

◆ AP_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL

#define AP_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL (   ret,
  name,
  args_decl,
  args_use,
  ok,
  decline 
)
Value:
#define APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(ns, link, 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.

See also
AP_IMPLEMENT_HOOK_RUN_ALL

Definition at line 150 of file ap_hooks.h.

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

Definition at line 159 of file ap_hooks.h.