[Groonga-commit] groonga/groonga at 1c43757 [master] Add grn_obj_is_lexicon

Zurück zum Archiv-Index

Kouhei Sutou null+****@clear*****
Thu Apr 5 18:16:58 JST 2018


Kouhei Sutou	2018-04-05 18:16:58 +0900 (Thu, 05 Apr 2018)

  New Revision: 1c43757a867115323acde8e16e481bb3feac5ad6
  https://github.com/groonga/groonga/commit/1c43757a867115323acde8e16e481bb3feac5ad6

  Message:
    Add grn_obj_is_lexicon

  Modified files:
    include/groonga/obj.h
    lib/obj.c

  Modified: include/groonga/obj.h (+1 -0)
===================================================================
--- include/groonga/obj.h    2018-04-05 18:08:18 +0900 (2ab37ee42)
+++ include/groonga/obj.h    2018-04-05 18:16:58 +0900 (61e194d3c)
@@ -36,6 +36,7 @@ GRN_API grn_bool grn_obj_is_builtin(grn_ctx *ctx, grn_obj *obj);
 GRN_API grn_bool grn_obj_is_bulk(grn_ctx *ctx, grn_obj *obj);
 GRN_API grn_bool grn_obj_is_text_family_bulk(grn_ctx *ctx, grn_obj *obj);
 GRN_API grn_bool grn_obj_is_table(grn_ctx *ctx, grn_obj *obj);
+GRN_API grn_bool grn_obj_is_lexicon(grn_ctx *ctx, grn_obj *obj);
 GRN_API grn_bool grn_obj_is_column(grn_ctx *ctx, grn_obj *obj);
 GRN_API grn_bool grn_obj_is_scalar_column(grn_ctx *ctx, grn_obj *obj);
 GRN_API grn_bool grn_obj_is_vector_column(grn_ctx *ctx, grn_obj *obj);

  Modified: lib/obj.c (+21 -0)
===================================================================
--- lib/obj.c    2018-04-05 18:08:18 +0900 (e0c6a7e1b)
+++ lib/obj.c    2018-04-05 18:16:58 +0900 (e1bed6354)
@@ -121,6 +121,27 @@ grn_obj_is_table(grn_ctx *ctx, grn_obj *obj)
 }
 
 grn_bool
+grn_obj_is_lexicon(grn_ctx *ctx, grn_obj *obj)
+{
+  grn_bool is_lexicon = GRN_FALSE;
+
+  if (!obj) {
+    return GRN_FALSE;
+  }
+
+  switch (obj->header.type) {
+  case GRN_TABLE_HASH_KEY :
+  case GRN_TABLE_PAT_KEY :
+  case GRN_TABLE_DAT_KEY :
+    is_lexicon = GRN_TRUE;
+  default :
+    break;
+  }
+
+  return is_lexicon;
+}
+
+grn_bool
 grn_obj_is_column(grn_ctx *ctx, grn_obj *obj)
 {
   grn_bool is_column = GRN_FALSE;
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180405/b1f6a47f/attachment.htm 



More information about the Groonga-commit mailing list
Zurück zum Archiv-Index