void test_is_function_proc(gconstpointer data) { const gchar *name; grn_obj *object; name = gcut_data_get_string(data, "name"); object = grn_ctx_get(context, name, strlen(name)); if (gcut_data_get_string(data, "expected")) { cut_assert_true(grn_obj_is_function_proc(context, object)); } else { cut_assert_false(grn_obj_is_function_proc(context, object)); } }
grn_bool grn_obj_is_selector_proc(grn_ctx *ctx, grn_obj *obj) { grn_proc *proc; if (!grn_obj_is_function_proc(ctx, obj)) { return GRN_FALSE; } proc = (grn_proc *)obj; return proc->callbacks.function.selector != NULL; }