[Groonga-commit] groonga/groonga at bcfee51 [master] Add a new predicate: grn_obj_is_number_family_bulk()

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Jun 12 15:30:57 JST 2018


Kouhei Sutou	2018-06-12 15:30:57 +0900 (Tue, 12 Jun 2018)

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

  Message:
    Add a new predicate: grn_obj_is_number_family_bulk()

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

  Modified: include/groonga/obj.h (+1 -0)
===================================================================
--- include/groonga/obj.h    2018-06-12 11:15:16 +0900 (61e194d3c)
+++ include/groonga/obj.h    2018-06-12 15:30:57 +0900 (51dff63db)
@@ -35,6 +35,7 @@ GRN_API grn_bool grn_obj_is_true(grn_ctx *ctx, grn_obj *obj);
 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_number_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);

  Modified: lib/obj.c (+10 -0)
===================================================================
--- lib/obj.c    2018-06-12 11:15:16 +0900 (e3a71b980)
+++ lib/obj.c    2018-06-12 15:30:57 +0900 (ed8945637)
@@ -100,6 +100,16 @@ grn_obj_is_text_family_bulk(grn_ctx *ctx, grn_obj *obj)
 }
 
 grn_bool
+grn_obj_is_number_family_bulk(grn_ctx *ctx, grn_obj *obj)
+{
+  if (!grn_obj_is_bulk(ctx, obj)) {
+    return GRN_FALSE;
+  }
+
+  return grn_type_id_is_number_family(ctx, obj->header.domain);
+}
+
+grn_bool
 grn_obj_is_table(grn_ctx *ctx, grn_obj *obj)
 {
   grn_bool is_table = GRN_FALSE;
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180612/6aad3511/attachment-0001.htm 



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