Function Call Pointcut Functions

Functions

struct aop_pointcutaop_match_function_call ()
void aop_filter_call_pc_by_name (struct aop_pointcut *pc, const char *name)
void aop_filter_call_pc_by_param (struct aop_pointcut *pc, int n, const struct aop_type *type)
void aop_filter_call_pc_by_return_type (struct aop_pointcut *pc, const struct aop_type *type)
const char * aop_capture_called_function_name (struct aop_joinpoint *jp)
struct aop_dynvalaop_capture_call_return_value (struct aop_joinpoint *jp)
struct aop_dynvalaop_capture_call_return_value_by_type (struct aop_joinpoint *jp, const struct aop_type *type)
struct aop_dynvalaop_capture_call_param (struct aop_joinpoint *jp, int n)
struct aop_dynvalaop_capture_call_param_by_type (struct aop_joinpoint *jp, int n, const struct aop_type *type)

Function Documentation

struct aop_dynval* aop_capture_call_param ( struct aop_joinpoint jp,
int  n 
) [read]

Get a dynval representing parameter n passed to a function call. Note that you must use aop_filter_call_pc_by_param() to filter a pointcut by parameter type for any parameter you wish to capture with this function.

Parameters:
jp A function call join point. Function call join points are obtained by joining on an aop_match_function_call() pointcut.
n The index of the parameter to capture. Parameters are indexed from zero.
Returns:
A dynval with its type determined by aop_filter_call_pc_by_param().
Examples:
advice_header.c.
struct aop_dynval* aop_capture_call_param_by_type ( struct aop_joinpoint jp,
int  n,
const struct aop_type type 
) [read]

Get a dynval representing parameter n passed to a function call if there is a parameter n and it matches the specified type. This function makes it possible to capture a parameter even if yuo have not filtered on its type with aop_filter_call_pc_by_param(). However, it returns NULL if there is no parameter n or if parameter n does not match the specified type.

Parameters:
jp A function call join point. Function call join points are obtained by joining on an aop_match_function_call() pointcut.
n The index of the parameter to capture. Parameters are indexed from zero.
type This function verifies that the captured parameter matches the specified type.
Returns:
A dynval with its type determined by the specified type or NULL if there is no matching parameter n.
Examples:
advice_header.c.
struct aop_dynval* aop_capture_call_return_value ( struct aop_joinpoint jp  )  [read]

Get a dynval representing a function call's return value. Note that you must filter with aop_filter_call_pc_by_return_type() in order to capture the return value using aop_capture_call_return_value().

Note that it is illegal to pass the resulting aop_dynval to aop_insert_advice() with AOP_INSERT_BEFORE, as that would require the function's return value to be known before it exectues.

Parameters:
jp A function call join point. Function call join points are obtained by joining on an aop_match_function_call() pointcut.
Returns:
A dynval with its type determined by aop_filter_call_pc_by_return_type().
struct aop_dynval* aop_capture_call_return_value_by_type ( struct aop_joinpoint jp,
const struct aop_type type 
) [read]

Get a dynval representing a function call's return value if the return value matches the specified type. This function makes it possible to capture the return value of a function even if you have not filtered with aop_filter_call_pc_by_return_type(). However, it returns NULL if the return value does not match the specified type.

Parameters:
jp A function call join point. Function call join points are obtained by joining on an aop_match_function_call() pointcut.
type This function verifies that the return value's type matches this specified type.
Returns:
A dynval with its type determined by the specified type or NULL if the return value does not match the specified type.
const char* aop_capture_called_function_name ( struct aop_joinpoint jp  ) 

Get the name of the function called in a function call join point. Calls to function pointers do not have a name, so aop_capture_called_function_name() will return NULL instead.

Parameters:
jp A function call join point. Function call join points are obtained by joining on an aop_match_function_call() pointcut.
Returns:
Name of the called function or NULL if the call is to a function pointer.
void aop_filter_call_pc_by_name ( struct aop_pointcut pc,
const char *  name 
)

Filter a function call pointcut to only include calls to functions with a specified name.

Parameters:
pc The function call pointcut to filter. Function call pointcuts are created with aop_match_function_call().
name The name to filter by.
Examples:
advice_header.c.
void aop_filter_call_pc_by_param ( struct aop_pointcut pc,
int  n,
const struct aop_type type 
)

Filter a function call pointcut to only include calls with a parameter that matches a specified type. This filter removes join points when parameter n does not match type or when there is no parameter n.

Filters on the same parameter do not stack on top of each other. If multiple parameter filters with the same n are applied a pointcut, only the last one will have any effect.

Note that you must filter a parameter by its type in order to capture it with aop_capture_call_param().

Parameters:
pc The function call pointcut to filter. Function call pointcuts are created with aop_match_function_call().
n The index of the parameter to filter on. Parameters are indexed from zero.
type The parameter type to filter by.
Examples:
advice_header.c.
void aop_filter_call_pc_by_return_type ( struct aop_pointcut pc,
const struct aop_type type 
)

Filter a function call pointcut to only include calls to functions with a specified return type. Note that you must filter a pointcut by return type in order to call aop_capture_call_return_value() on any of its join points.

Parameters:
pc The function call pointcut to filter. Function call pointcuts are created with aop_match_function_call().
type The return type to filter by.
struct aop_pointcut* aop_match_function_call (  )  [read]

Return a pointcut that matches all function calls. Use filter functions on the resulting pointcut to produce a pointcut that matches calls to a narrower set of functions (or a single function).

Returns:
The resulting pointcut.
Examples:
advice_header.c.
Generated on Tue Jul 31 21:46:42 2012 for InterAspect by doxygen 1.6.1