Skip to content

Commit

Permalink
context: add Groonga::Context#support_lz4? method
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmo0920 committed Oct 28, 2014
1 parent aaba394 commit 64cc3e9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions ext/groonga/rb-grn-context.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,28 @@ rb_grn_context_support_lzo_p (VALUE self)
return Qfalse;
}

/*
* 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;
}

/*
* コンテキストが使うデータベースを返す。
*
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 64cc3e9

Please sign in to comment.