From 8f01ec2bca9024fd535b1e363e5b7a6c783a2d86 Mon Sep 17 00:00:00 2001 From: Justin Seyster Date: Wed, 27 Oct 2010 16:56:23 -0400 Subject: [PATCH] Renamed capture_param functions to capture_call_param. This is to strengthen the separation between call_param and in_param. --- src/aop-pc-fun-call.c | 8 ++++---- src/aop-pointcut.c | 2 +- src/aop.h | 6 +++--- test/plugin-float-types.c | 2 +- test/plugin-int-types.c | 2 +- test/plugin-pointer-types.c | 2 +- test/plugin-reinst1.c | 4 ++-- test/plugin-reinst2.c | 2 +- test/plugin-struct-types.c | 2 +- workspace/advice_header.c | 4 ++-- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/aop-pc-fun-call.c b/src/aop-pc-fun-call.c index e76d905..8e094f8 100644 --- a/src/aop-pc-fun-call.c +++ b/src/aop-pc-fun-call.c @@ -337,7 +337,7 @@ aop_filter_call_pc_by_name (struct aop_pointcut *pc, const char *name) * 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_param(). + * capture it with aop_capture_call_param(). * \param pc The function call pointcut to filter. Function call * pointcuts are created with aop_match_function_call(). * \param n The index of the parameter to filter on. Parameters are @@ -546,7 +546,7 @@ op_get_param (struct aop_dynval *dv) * aop_filter_call_pc_by_param(). */ struct aop_dynval * -aop_capture_param (struct aop_joinpoint *jp, int n) +aop_capture_call_param (struct aop_joinpoint *jp, int n) { struct aop_pointcut *pc; struct aop_dynval *dv; @@ -594,8 +594,8 @@ aop_capture_param (struct aop_joinpoint *jp, int n) * NULL if there is no matching parameter n. */ struct aop_dynval * -aop_capture_param_by_type (struct aop_joinpoint *jp, int n, - const struct aop_type *type) +aop_capture_call_param_by_type (struct aop_joinpoint *jp, int n, + const struct aop_type *type) { struct aop_pointcut *pc; struct aop_dynval *dv; diff --git a/src/aop-pointcut.c b/src/aop-pointcut.c index ca1cae8..fe35f73 100644 --- a/src/aop-pointcut.c +++ b/src/aop-pointcut.c @@ -185,7 +185,7 @@ check_in_params (struct aop_pointcut *pc) * fuction. Be careful not to capture the in_param of * the current function when you actually intend to capture the * call_param being passed to a function call join point. - * (For the latter, use aop_capture_param() instead). + * (For the latter, use aop_capture_call_param() instead). * * Note that you must use aop_filter_by_in_param() to filter a * pointcut by parameter type for any parameter you wish to capture diff --git a/src/aop.h b/src/aop.h index a4fae70..c0108e9 100644 --- a/src/aop.h +++ b/src/aop.h @@ -357,9 +357,9 @@ extern const char *aop_capture_called_function_name(struct aop_joinpoint *jp); extern struct aop_dynval *aop_capture_return_value (struct aop_joinpoint *jp); extern struct aop_dynval *aop_capture_return_value_by_type ( struct aop_joinpoint *jp, const struct aop_type *type); -extern struct aop_dynval *aop_capture_param (struct aop_joinpoint *jp, - int param_index); -extern struct aop_dynval *aop_capture_param_by_type ( +extern struct aop_dynval *aop_capture_call_param (struct aop_joinpoint *jp, + int param_index); +extern struct aop_dynval *aop_capture_call_param_by_type ( struct aop_joinpoint *jp, int n, const struct aop_type *type); extern struct aop_pointcut *aop_match_assignment_by_type ( diff --git a/test/plugin-float-types.c b/test/plugin-float-types.c index e8e82b8..49877b2 100644 --- a/test/plugin-float-types.c +++ b/test/plugin-float-types.c @@ -11,7 +11,7 @@ static void plugin_join_on_call(struct aop_joinpoint *jp, void *data) struct aop_dynval *n; name = aop_capture_called_function_name(jp); - n = aop_capture_param(jp, 0); + n = aop_capture_call_param(jp, 0); aop_insert_advice(jp, advice_name, AOP_INSERT_BEFORE, AOP_STR_CST(name), AOP_DYNVAL(n), AOP_DYNVAL(n), AOP_TERM_ARG); } diff --git a/test/plugin-int-types.c b/test/plugin-int-types.c index f5bec2a..eac06b9 100644 --- a/test/plugin-int-types.c +++ b/test/plugin-int-types.c @@ -11,7 +11,7 @@ static void plugin_join_on_call(struct aop_joinpoint *jp, void *data) struct aop_dynval *n; name = aop_capture_called_function_name(jp); - n = aop_capture_param(jp, 0); + n = aop_capture_call_param(jp, 0); aop_insert_advice(jp, advice_name, AOP_INSERT_BEFORE, AOP_STR_CST(name), AOP_DYNVAL(n), AOP_DYNVAL(n), AOP_TERM_ARG); } diff --git a/test/plugin-pointer-types.c b/test/plugin-pointer-types.c index 06468ea..d65f834 100644 --- a/test/plugin-pointer-types.c +++ b/test/plugin-pointer-types.c @@ -18,7 +18,7 @@ static void plugin_join_on_call(struct aop_joinpoint *jp, void *data) called = aop_capture_called_function_name(jp); if (called == NULL || *called != '_') { - p = aop_capture_param(jp, 0); + p = aop_capture_call_param(jp, 0); aop_insert_advice(jp, advice_name, AOP_INSERT_BEFORE, AOP_STR_CST(called), AOP_DYNVAL(p), AOP_TERM_ARG); } } diff --git a/test/plugin-reinst1.c b/test/plugin-reinst1.c index a9e150f..e72c36d 100644 --- a/test/plugin-reinst1.c +++ b/test/plugin-reinst1.c @@ -8,7 +8,7 @@ static void plugin_join_on_foo(struct aop_joinpoint *jp, void *data) { struct aop_dynval *n; - n = aop_capture_param(jp, 1); + n = aop_capture_call_param(jp, 1); aop_insert_advice(jp, "_advice_foo", AOP_INSERT_BEFORE, AOP_DYNVAL(n), AOP_TERM_ARG); } @@ -16,7 +16,7 @@ static void plugin_join_on_advice(struct aop_joinpoint *jp, void *data) { struct aop_dynval *n; - n = aop_capture_param(jp, 0); + n = aop_capture_call_param(jp, 0); aop_insert_advice(jp, "_advice_hook_bad", AOP_INSERT_BEFORE, AOP_DYNVAL(n), AOP_TERM_ARG); } diff --git a/test/plugin-reinst2.c b/test/plugin-reinst2.c index ca43799..d2c1f3c 100644 --- a/test/plugin-reinst2.c +++ b/test/plugin-reinst2.c @@ -11,7 +11,7 @@ static void plugin_join_on_advice(struct aop_joinpoint *jp, void *data) { struct aop_dynval *n; - n = aop_capture_param(jp, 0); + n = aop_capture_call_param(jp, 0); aop_insert_advice(jp, "_advice_hook_good", AOP_INSERT_BEFORE, AOP_DYNVAL(n), AOP_TERM_ARG); } diff --git a/test/plugin-struct-types.c b/test/plugin-struct-types.c index a4f808f..cc49192 100644 --- a/test/plugin-struct-types.c +++ b/test/plugin-struct-types.c @@ -11,7 +11,7 @@ static void plugin_join_on_call(struct aop_joinpoint *jp, void *data) struct aop_dynval *n; name = aop_capture_called_function_name(jp); - n = aop_capture_param(jp, 0); + n = aop_capture_call_param(jp, 0); aop_insert_advice(jp, advice_name, AOP_INSERT_BEFORE, AOP_STR_CST(name), AOP_DYNVAL(n), AOP_DYNVAL(n), AOP_TERM_ARG); } diff --git a/workspace/advice_header.c b/workspace/advice_header.c index 875f4c0..f234c9a 100644 --- a/workspace/advice_header.c +++ b/workspace/advice_header.c @@ -21,8 +21,8 @@ static void join_on_printf(struct aop_joinpoint *jp, void *data) struct aop_dynval *format; struct aop_dynval *int_arg; - format = aop_capture_param(jp, 0); - int_arg = aop_capture_param_by_type(jp, 1, aop_t_all_signed()); + format = aop_capture_call_param(jp, 0); + int_arg = aop_capture_call_param_by_type(jp, 1, aop_t_all_signed()); if (int_arg == NULL) { /* Second argument is not a signed integer. */ -- 2.34.1