[Groonga-commit] ranguba/rroonga at 64cc3e9 [master] context: add Groonga::Context#support_lz4? method

Back to archive index

Hiroshi Hatake null+****@clear*****
Mon Oct 27 21:07:45 JST 2014


Hiroshi Hatake	2014-10-27 21:07:45 +0900 (Mon, 27 Oct 2014)

  New Revision: 64cc3e9c23dfe2ebaaf46b4783bc7fdd741d0ec2
  https://github.com/ranguba/rroonga/commit/64cc3e9c23dfe2ebaaf46b4783bc7fdd741d0ec2

  Message:
    context: add Groonga::Context#support_lz4? method

  Modified files:
    ext/groonga/rb-grn-context.c

  Modified: ext/groonga/rb-grn-context.c (+24 -0)
===================================================================
--- ext/groonga/rb-grn-context.c    2014-10-27 21:05:22 +0900 (9d205ab)
+++ ext/groonga/rb-grn-context.c    2014-10-27 21:07:45 +0900 (497bb69)
@@ -683,6 +683,28 @@ rb_grn_context_support_lzo_p (VALUE self)
 }
 
 /*
+ * groongaがLZ4サポート付きでビルドされていれば +true+ 、そう
+ * でなければ +false+ を返す。
+ *
+ * @overload support_lz4?
+ */
+static VALUE
+rb_grn_context_support_lz4_p (VALUE self)
+{
+    VALUE rb_support_p;
+    grn_ctx *context;
+    grn_obj support_p;
+
+    context = SELF(self);
+    GRN_BOOL_INIT(&support_p, 0);
+    grn_obj_get_info(context, NULL, GRN_INFO_SUPPORT_LZ4, &support_p);
+    rb_support_p = CBOOL2RVAL(GRN_BOOL_VALUE(&support_p));
+    GRN_OBJ_FIN(context, &support_p);
+
+    return rb_support_p;
+}
+
+/*
  * コンテキストが使うデータベースを返す。
  *
  * @overload database
@@ -965,6 +987,8 @@ rb_grn_init_context (VALUE mGrn)
                      rb_grn_context_support_zlib_p, 0);
     rb_define_method(cGrnContext, "support_lzo?",
                      rb_grn_context_support_lzo_p, 0);
+    rb_define_method(cGrnContext, "support_lz4?",
+                     rb_grn_context_support_lz4_p, 0);
 
     rb_define_method(cGrnContext, "database", rb_grn_context_get_database, 0);
 
-------------- next part --------------
HTML����������������������������...
Télécharger 



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