void test_is_proc(gconstpointer data) { const gchar *name; grn_obj *object; assert_send_command("table_create Users TABLE_HASH_KEY ShortText"); 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_proc(context, object)); } else { cut_assert_false(grn_obj_is_proc(context, object)); } }
grn_bool grn_obj_is_window_function_proc(grn_ctx *ctx, grn_obj *obj) { grn_proc *proc; if (!grn_obj_is_proc(ctx, obj)) { return GRN_FALSE; } proc = (grn_proc *)obj; return proc->type == GRN_PROC_WINDOW_FUNCTION; }
grn_bool grn_obj_is_token_filter_proc(grn_ctx *ctx, grn_obj *obj) { grn_proc *proc; if (!grn_obj_is_proc(ctx, obj)) { return GRN_FALSE; } proc = (grn_proc *)obj; return proc->type == GRN_PROC_TOKEN_FILTER; }
grn_bool grn_obj_is_scorer_proc(grn_ctx *ctx, grn_obj *obj) { grn_proc *proc; if (!grn_obj_is_proc(ctx, obj)) { return GRN_FALSE; } proc = (grn_proc *)obj; return proc->type == GRN_PROC_SCORER; }
grn_bool grn_obj_is_normalizer_proc(grn_ctx *ctx, grn_obj *obj) { grn_proc *proc; if (!grn_obj_is_proc(ctx, obj)) { return GRN_FALSE; } proc = (grn_proc *)obj; return proc->type == GRN_PROC_NORMALIZER; }