return dv;
}
+/**
+ * Get a dynval representing the value returned at a function exit
+ * join point if the function's return value matches the specified
+ * type. This function makes it possible to capture the return value
+ * from an exit join point even if you have not filtered it with
+ * aop_filter_exit_by_return_type(). However, it returns NULL if the
+ * return value does not match the specified type.
+ * \param jp A function exit join point. Function exit join points
+ * are obtained by joining on an aop_match_function_exit() pointcut.
+ * \param type A dynval with its type determined by the specified type
+ * or NULL if the return value does not match the specified type.
+ */
+struct aop_dynval *
+aop_capture_exit_return_value_by_type (struct aop_joinpoint *jp,
+ const struct aop_type *type)
+{
+ struct aop_pointcut *pc;
+ struct aop_dynval *dv;
+
+ pc = jp->pc;
+ if (pc->kind != ATP_EXIT)
+ fatal_error ("(InterAspect) Attempt to capture return value from an"
+ " unsupported join point.");
+
+ /* Does this join points match the specified type? */
+ if (!return_type_matches (type))
+ return NULL;
+
+ dv = ggc_alloc (sizeof (struct aop_dynval));
+ dv->kind = ADV_EXIT_RETVAL;
+ dv->type = type;
+ dv->jp = jp;
+ dv->get_dynval = op_get_exit_return_value;
+ return dv;
+}
+
/* Close Doxygen defgroup block. */
/**
* \}
extern struct aop_pointcut *aop_match_function_exit ();
extern void aop_filter_exit_by_return_type (struct aop_pointcut *pc,
const struct aop_type *type);
-struct aop_dynval *aop_capture_exit_return_value (struct aop_joinpoint *jp);
-
+extern struct aop_dynval *aop_capture_exit_return_value (
+ struct aop_joinpoint *jp);
+extern struct aop_dynval *aop_capture_exit_return_value_by_type (
+ struct aop_joinpoint *jp, const struct aop_type *type);
extern struct aop_pointcut *aop_match_function_call ();