[Groonga-commit] groonga/groonga at 5e938dd [master] mrb: add Database#dirty?

Back to archive index

Kouhei Sutou null+****@clear*****
Wed May 11 11:15:43 JST 2016


Kouhei Sutou	2016-05-11 11:15:43 +0900 (Wed, 11 May 2016)

  New Revision: 5e938ddbe98a2266f0573b45063f0bcea7ee8d4d
  https://github.com/groonga/groonga/commit/5e938ddbe98a2266f0573b45063f0bcea7ee8d4d

  Message:
    mrb: add Database#dirty?

  Modified files:
    lib/mrb/mrb_database.c

  Modified: lib/mrb/mrb_database.c (+13 -0)
===================================================================
--- lib/mrb/mrb_database.c    2016-05-11 11:15:28 +0900 (8a7d598)
+++ lib/mrb/mrb_database.c    2016-05-11 11:15:43 +0900 (95e0d04)
@@ -112,6 +112,17 @@ mrb_grn_database_get_last_modified(mrb_state *mrb, mrb_value self)
                      mrb_float_value(mrb, last_modified));
 }
 
+static mrb_value
+mrb_grn_database_is_dirty(mrb_state *mrb, mrb_value self)
+{
+  grn_ctx *ctx = (grn_ctx *)mrb->ud;
+  grn_bool is_dirty;
+
+  is_dirty = grn_db_is_dirty(ctx, DATA_PTR(self));
+
+  return mrb_bool_value(is_dirty);
+}
+
 void
 grn_mrb_database_init(grn_ctx *ctx)
 {
@@ -139,5 +150,7 @@ grn_mrb_database_init(grn_ctx *ctx)
                     mrb_grn_database_is_locked, MRB_ARGS_NONE());
   mrb_define_method(mrb, klass, "last_modified",
                     mrb_grn_database_get_last_modified, MRB_ARGS_NONE());
+  mrb_define_method(mrb, klass, "dirty?",
+                    mrb_grn_database_is_dirty, MRB_ARGS_NONE());
 }
 #endif
-------------- next part --------------
HTML����������������������������...
Download 



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