Navigation Menu

Skip to content

Commit

Permalink
Extract table normalizer inspection code
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 19, 2013
1 parent 922d5b9 commit c41f474
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions lib/util.c
Expand Up @@ -587,6 +587,23 @@ grn_table_default_tokenizer_inspect(grn_ctx *ctx, grn_obj *buf, grn_obj *obj)
return GRN_SUCCESS;
}

static grn_rc
grn_table_normalizer_inspect(grn_ctx *ctx, grn_obj *buf, grn_obj *obj)
{
grn_obj *normalizer;

GRN_TEXT_PUTS(ctx, buf, " normalizer:");
normalizer = grn_obj_get_info(ctx, obj, GRN_INFO_NORMALIZER, NULL);
if (normalizer) {
grn_inspect_name(ctx, buf, normalizer);
grn_obj_unlink(ctx, normalizer);
} else {
GRN_TEXT_PUTS(ctx, buf, "(nil)");
}

return GRN_SUCCESS;
}


static grn_rc
grn_table_inspect(grn_ctx *ctx, grn_obj *buf, grn_obj *obj)
Expand Down Expand Up @@ -627,19 +644,12 @@ grn_table_inspect(grn_ctx *ctx, grn_obj *buf, grn_obj *obj)
grn_table_ids_inspect(ctx, buf, obj);
} else {
grn_table_cursor *tc;
grn_obj *normalizer;

GRN_TEXT_PUTS(ctx, buf, " ");
grn_table_default_tokenizer_inspect(ctx, buf, obj);

GRN_TEXT_PUTS(ctx, buf, " normalizer:");
normalizer = grn_obj_get_info(ctx, obj, GRN_INFO_NORMALIZER, NULL);
if (normalizer) {
grn_inspect_name(ctx, buf, normalizer);
grn_obj_unlink(ctx, normalizer);
} else {
GRN_TEXT_PUTS(ctx, buf, "(nil)");
}
GRN_TEXT_PUTS(ctx, buf, " ");
grn_table_normalizer_inspect(ctx, buf, obj);

GRN_TEXT_PUTS(ctx, buf, " keys:[");
tc = grn_table_cursor_open(ctx, obj, NULL, 0, NULL, 0,
Expand Down

0 comments on commit c41f474

Please sign in to comment.