Loading...
Searching...
No Matches
Hook probe capability
APR Utility Functions » Hook Functions
Collaboration diagram for Hook probe capability:

## Macros

#define | APR_HOOK_INT_DCL_UD
#define | APR_HOOK_PROBE_ENTRY(ud, ns, name, args)
#define | APR_HOOK_PROBE_RETURN(ud, ns, name, rv, args)
#define | APR_HOOK_PROBE_INVOKE(ud, ns, name, src, args)
#define | APR_HOOK_PROBE_COMPLETE(ud, ns, name, src, rv, args)

## Detailed Description

APR hooks provide a trace probe capability for capturing the flow of control and return values with hooks.

In order to use this facility, the application must define the symbol APR_HOOK_PROBES_ENABLED and the four APR_HOOK_PROBE_ macros described below before including apr_hooks.h in files that use the APR_IMPLEMENT_EXTERNAL_HOOK_* macros.

This probe facility is not provided for APR optional hooks.

## Macro Definition Documentation

## APR_HOOK_INT_DCL_UD

#define APR_HOOK_INT_DCL_UD

internal implementation detail to avoid the ud declaration when hook probes are not used

## APR_HOOK_PROBE_COMPLETE

#define APR_HOOK_PROBE_COMPLETE | ( |  | ud,
|  |  | ns,
|  |  | name,
|  |  | src,
|  |  | rv,
|  |  | args )

User-defined hook probe macro that is invoked after calling a hook function.

Parameters

  ud | A void * user data field that was filled in by the user- provided APR_HOOK_PROBE_ENTRY().
  ns | The namespace prefix of the hook functions
  name | The name of the hook
  src | The value of apr_hook_debug_current at the time the function was hooked (usually the source file implementing the hook function).
  rv | The return value of the hook function, or 0 if the hook is void.
  args | The argument list to the hook functions, with enclosing parens.

## APR_HOOK_PROBE_ENTRY

#define APR_HOOK_PROBE_ENTRY | ( |  | ud,
|  |  | ns,
|  |  | name,
|  |  | args )

User-defined hook probe macro that is invoked when the hook is run, before calling any hook functions.

Parameters

  ud | A void * user data field that should be filled in by this macro, and will be provided to the other hook probe macros.
  ns | The namespace prefix of the hook functions
  name | The name of the hook
  args | The argument list to the hook functions, with enclosing parens.

## APR_HOOK_PROBE_INVOKE

#define APR_HOOK_PROBE_INVOKE | ( |  | ud,
|  |  | ns,
|  |  | name,
|  |  | src,
|  |  | args )

User-defined hook probe macro that is invoked before calling a hook function.

Parameters

  ud | A void * user data field that was filled in by the user- provided APR_HOOK_PROBE_ENTRY().
  ns | The namespace prefix of the hook functions
  name | The name of the hook
  src | The value of apr_hook_debug_current at the time the function was hooked (usually the source file implementing the hook function).
  args | The argument list to the hook functions, with enclosing parens.

## APR_HOOK_PROBE_RETURN

#define APR_HOOK_PROBE_RETURN | ( |  | ud,
|  |  | ns,
|  |  | name,
|  |  | rv,
|  |  | args )

User-defined hook probe macro that is invoked after the hook has run.

Parameters

  ud | A void * user data field that was filled in by the user- provided APR_HOOK_PROBE_ENTRY().
  ns | The namespace prefix of the hook functions
  name | The name of the hook
  rv | The return value of the hook, or 0 if the hook is void.
  args | The argument list to the hook functions, with enclosing parens.