Documented several functions.
authorJustin Seyster <jseyster@cs.sunysb.edu>
Thu, 1 Jul 2010 22:27:33 +0000 (18:27 -0400)
committerJustin Seyster <jseyster@cs.sunysb.edu>
Thu, 1 Jul 2010 22:27:33 +0000 (18:27 -0400)
src/aop-pc-fun-call.c
src/aop.h

index 922f3a9e4c176ef2faa682dbf06cf6b413c1db95..e142cefa5325217bad3d85ccd982eb3292de8340 100644 (file)
@@ -149,6 +149,13 @@ op_join_on_function_call (struct aop_pointcut *pc, join_callback cb,
     }
 }
 
+/**
+ * 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 ()
 {
@@ -167,11 +174,18 @@ 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
@@ -225,6 +239,15 @@ op_get_return_value (struct aop_dynval *dv)
   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)
@@ -232,6 +255,15 @@ aop_filter_call_pc_by_return_type (struct aop_pointcut *pc,
   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)
 {
index 505ce542f8748c6275e35701a20c855762697771..381d6350f8385527265c44cc8f701a56b3a9ac19 100644 (file)
--- a/src/aop.h
+++ b/src/aop.h
@@ -101,8 +101,8 @@ extern void aop_filter_entry_by_name(struct aop_pointcut *pc_function_entry,
 
 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 (