hooks.c File Reference

#include "hooks.h"
Include dependency graph for hooks.c:

Functions

htp_hook_thook_create (void)
htp_hook_thook_copy (htp_hook_t *hook)
void hook_destroy (htp_hook_t *hook)
int hook_register (htp_hook_t **hook, htp_callback_fn_t callback_fn)
int hook_run_all (htp_hook_t *hook, void *data)
int hook_run_one (htp_hook_t *hook, void *data)

Detailed Description

Author:
Ivan Ristic <ivanr@webkreator.com>

Function Documentation

htp_hook_t* hook_copy ( htp_hook_t hook  ) 

Creates a copy of the provided hook. The hook is allowed to be NULL, in which case this function simply returns a NULL.

Parameters:
hook 
Returns:
A copy of the hook, or NULL (if the provided hook was NULL or, if it wasn't, if there was a memory allocation problem while constructing a copy).

Here is the call graph for this function:

Here is the caller graph for this function:

htp_hook_t* hook_create ( void   ) 

Creates a new hook.

Returns:
New htp_hook_t structure on success, NULL on failure

Here is the call graph for this function:

Here is the caller graph for this function:

void hook_destroy ( htp_hook_t hook  ) 

Destroys an existing hook. It is all right to send a NULL to this method because it will simply return straight away.

Parameters:
hook 

Here is the caller graph for this function:

int hook_register ( htp_hook_t **  hook,
htp_callback_fn_t  callback_fn 
)

Registers a new callback with the hook.

Parameters:
hook 
callback_fn 
Returns:
1 on success, -1 on memory allocation error

Here is the call graph for this function:

Here is the caller graph for this function:

int hook_run_all ( htp_hook_t hook,
void *  data 
)

Runs all the callbacks associated with a given hook. Only stops if one of the callbacks returns an error (HOOK_ERROR).

Parameters:
hook 
data 
Returns:
HOOK_OK or HOOK_ERROR

Here is the caller graph for this function:

int hook_run_one ( htp_hook_t hook,
void *  data 
)

Run callbacks until one of them accepts to service the hook.

Parameters:
hook 
data 
Returns:
HOOK_OK on success, HOOK_DECLINED if no callback wanted to run and HOOK_ERROR on error.

Generated on 28 Jan 2013 for HTP by  doxygen 1.6.1