}
}
+/**
+ * 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).
+ * \return The resulting pointcut.
+ */
struct aop_pointcut *
aop_match_function_call ()
{
return pc;
}
+/**
+ * Filter a function call pointcut to only include calls to functions
+ * with a specified name.
+ * \param pc The function call pointcut to filter. Function call
+ * pointcuts are created with aop_match_function_call().
+ * \param name The name to filter by.
+ */
void
-aop_filter_function_call_pointcut (struct aop_pointcut *pc_function_call,
- const char *advice_function_call)
+aop_filter_call_pc_by_name (struct aop_pointcut *pc_function_call,
+ const char *name)
{
- pc_function_call->pc_call.function_name = advice_function_call;
+ pc_function_call->pc_call.function_name = name;
}
void
return return_value;
}
+/**
+ * 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_return_value() on any
+ * of its join points.
+ * \param pc The function call pointcut to filter. Function call
+ * pointcuts are created with aop_match_function_call().
+ * \param type The return type to filter by.
+ */
void
aop_filter_call_pc_by_return_type (struct aop_pointcut *pc,
const struct aop_type *type)
pc->pc_call.return_type = type;
}
+/**
+ * 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_return_value().
+ * \param jp A function call join point. Function call join points
+ * are obtained by joining on an aop_match_function_call() pointcut.
+ * \return A dynval with a type determined by
+ * aop_filter_call_pc_by_return_type().
+ */
struct aop_dynval *
aop_capture_return_value (struct aop_joinpoint *jp)
{
extern struct aop_pointcut *aop_match_function_call ();
-extern void aop_filter_function_call_pointcut (
- struct aop_pointcut *pc_function_call, const char *advice_function_call);
+extern void aop_filter_call_pc_by_name (struct aop_pointcut *pc_function_call,
+ const char *advice_function_call);
extern void aop_filter_call_pc_by_return_type (struct aop_pointcut *pc,
const struct aop_type *type);
extern void aop_filter_function_call_pointcut_by_param_index (