[Groonga-commit] groonga/groonga at c41f474 [master] Extract table normalizer inspection code

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Jun 19 15:04:49 JST 2013


Kouhei Sutou	2013-06-19 15:04:49 +0900 (Wed, 19 Jun 2013)

  New Revision: c41f47425af995cfee6b3c68c963d5e8b50780d8
  https://github.com/groonga/groonga/commit/c41f47425af995cfee6b3c68c963d5e8b50780d8

  Message:
    Extract table normalizer inspection code

  Modified files:
    lib/util.c

  Modified: lib/util.c (+19 -9)
===================================================================
--- lib/util.c    2013-06-19 15:03:28 +0900 (1262b94)
+++ lib/util.c    2013-06-19 15:04:49 +0900 (0874050)
@@ -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)
@@ -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,
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index