[Groonga-commit] groonga/groonga at 1ae9163 [master] mrb expr: bind grn_expr_take_object()

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Sep 12 23:34:08 JST 2014


Kouhei Sutou	2014-09-12 23:34:08 +0900 (Fri, 12 Sep 2014)

  New Revision: 1ae9163c41eda64b753ebba3c5a6537a311531e0
  https://github.com/groonga/groonga/commit/1ae9163c41eda64b753ebba3c5a6537a311531e0

  Message:
    mrb expr: bind grn_expr_take_object()

  Modified files:
    lib/mrb/mrb_expr.c

  Modified: lib/mrb/mrb_expr.c (+18 -0)
===================================================================
--- lib/mrb/mrb_expr.c    2014-09-12 22:59:42 +0900 (a438630)
+++ lib/mrb/mrb_expr.c    2014-09-12 23:34:08 +0900 (2c4b5c5)
@@ -342,6 +342,22 @@ mrb_grn_expression_get_var_by_offset(mrb_state *mrb, mrb_value self)
 }
 
 static mrb_value
+mrb_grn_expression_take_object(mrb_state *mrb, mrb_value self)
+{
+  grn_ctx *ctx = (grn_ctx *)mrb->ud;
+  grn_obj *expr;
+  mrb_value mrb_object;
+  grn_obj *grn_object;
+
+  mrb_get_args(mrb, "o", &mrb_object);
+  expr = DATA_PTR(self);
+  grn_object = DATA_PTR(mrb_object);
+  grn_expr_take_obj(ctx, expr, grn_object);
+
+  return mrb_object;
+}
+
+static mrb_value
 mrb_grn_expression_allocate_constant(mrb_state *mrb, mrb_value self)
 {
   grn_ctx *ctx = (grn_ctx *)mrb->ud;
@@ -431,6 +447,8 @@ grn_mrb_expr_init(grn_ctx *ctx)
                     mrb_grn_expression_codes, MRB_ARGS_NONE());
   mrb_define_method(mrb, klass, "get_var_by_offset",
                     mrb_grn_expression_get_var_by_offset, MRB_ARGS_REQ(1));
+  mrb_define_method(mrb, klass, "take_object",
+                    mrb_grn_expression_take_object, MRB_ARGS_REQ(1));
   mrb_define_method(mrb, klass, "allocate_constant",
                     mrb_grn_expression_allocate_constant, MRB_ARGS_REQ(1));
 
-------------- next part --------------
HTML����������������������������...
下載 



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