[Groonga-commit] groonga/groonga at a860d78 [master] mrb: Add Groonga::Bulk#true?

Back to archive index
Kouhei Sutou null+****@clear*****
Sat Apr 20 08:55:29 JST 2019


Kouhei Sutou	2019-04-20 08:55:29 +0900 (Sat, 20 Apr 2019)

  Revision: a860d78a76b0898b68582fd3087cb1519175f32b
  https://github.com/groonga/groonga/commit/a860d78a76b0898b68582fd3087cb1519175f32b

  Message:
    mrb: Add Groonga::Bulk#true?

  Modified files:
    lib/mrb/mrb_bulk.c
    lib/mrb/mrb_object.c
    lib/mrb/mrb_object.h

  Modified: lib/mrb/mrb_bulk.c (+2 -0)
===================================================================
--- lib/mrb/mrb_bulk.c    2019-04-18 14:50:44 +0900 (4e5fe6a34)
+++ lib/mrb/mrb_bulk.c    2019-04-20 08:55:29 +0900 (2159110ed)
@@ -391,6 +391,8 @@ grn_mrb_bulk_init(grn_ctx *ctx)
                     mrb_grn_bulk_get_domain, MRB_ARGS_NONE());
   mrb_define_method(mrb, klass, "value",
                     mrb_grn_bulk_get_value, MRB_ARGS_NONE());
+  mrb_define_method(mrb, klass, "true?",
+                    grn_mrb_object_is_true, MRB_ARGS_NONE());
   mrb_define_method(mrb, klass, "==",
                     mrb_grn_bulk_equal, MRB_ARGS_REQ(1));
   mrb_define_method(mrb, klass, "inspect",

  Modified: lib/mrb/mrb_object.c (+5 -3)
===================================================================
--- lib/mrb/mrb_object.c    2019-04-18 14:50:44 +0900 (c44e6006f)
+++ lib/mrb/mrb_object.c    2019-04-20 08:55:29 +0900 (5dd6ed958)
@@ -1,6 +1,7 @@
 /* -*- c-basic-offset: 2 -*- */
 /*
   Copyright(C) 2013-2018 Brazil
+  Copyright(C) 2019 Kouhei Sutou <kou****@clear*****>
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -280,8 +281,8 @@ object_is_persistent(mrb_state *mrb, mrb_value self)
   return mrb_bool_value((flags & GRN_OBJ_PERSISTENT) == GRN_OBJ_PERSISTENT);
 }
 
-static mrb_value
-object_is_true(mrb_state *mrb, mrb_value self)
+mrb_value
+grn_mrb_object_is_true(mrb_state *mrb, mrb_value self)
 {
   grn_ctx *ctx = (grn_ctx *)mrb->ud;
   grn_obj *object;
@@ -348,7 +349,8 @@ grn_mrb_object_init(grn_ctx *ctx)
   mrb_define_method(mrb, klass, "persistent?", object_is_persistent,
                     MRB_ARGS_NONE());
 
-  mrb_define_method(mrb, klass, "true?", object_is_true, MRB_ARGS_NONE());
+  mrb_define_method(mrb, klass, "true?", grn_mrb_object_is_true,
+                    MRB_ARGS_NONE());
 
   mrb_define_method(mrb, klass, "check_corrupt", object_check_corrupt,
                     MRB_ARGS_NONE());

  Modified: lib/mrb/mrb_object.h (+2 -0)
===================================================================
--- lib/mrb/mrb_object.h    2019-04-18 14:50:44 +0900 (80dd13ddb)
+++ lib/mrb/mrb_object.h    2019-04-20 08:55:29 +0900 (355a67756)
@@ -1,6 +1,7 @@
 /* -*- c-basic-offset: 2 -*- */
 /*
   Copyright(C) 2013-2018 Brazil
+  Copyright(C) 2019 Kouhei Sutou <kou****@clear*****>
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -29,6 +30,7 @@ void grn_mrb_object_init(grn_ctx *ctx);
 mrb_value grn_mrb_object_inspect(mrb_state *mrb, mrb_value self);
 mrb_value grn_mrb_object_close(mrb_state *mrb, mrb_value self);
 mrb_value grn_mrb_object_is_closed(mrb_state *mrb, mrb_value self);
+mrb_value grn_mrb_object_is_true(mrb_state *mrb, mrb_value self);
 
 #ifdef __cplusplus
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20190420/645d82fc/attachment-0001.html>


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