Navigation Menu

Skip to content

Commit

Permalink
mrb: bind grn_scan_info_get_op()
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 8, 2014
1 parent 66620e9 commit 87a5fe3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/expr.c
Expand Up @@ -4263,6 +4263,12 @@ grn_scan_info_set_logical_op(scan_info *si, grn_operator logical_op)
si->logical_op = logical_op;
}

grn_operator
grn_scan_info_get_op(scan_info *si)
{
return si->op;
}

void
grn_scan_info_set_op(scan_info *si, grn_operator op)
{
Expand Down
13 changes: 13 additions & 0 deletions lib/mrb/mrb_expr.c
Expand Up @@ -472,6 +472,17 @@ mrb_grn_scan_info_put_index(mrb_state *mrb, mrb_value self)
return self;
}

static mrb_value
mrb_grn_scan_info_get_op(mrb_state *mrb, mrb_value self)
{
scan_info *si;
grn_operator op;

si = DATA_PTR(self);
op = grn_scan_info_get_op(si);
return mrb_fixnum_value(op);
}

static mrb_value
mrb_grn_scan_info_set_op(mrb_state *mrb, mrb_value self)
{
Expand Down Expand Up @@ -532,6 +543,8 @@ grn_mrb_expr_init(grn_ctx *ctx)
mrb_grn_scan_info_initialize, MRB_ARGS_REQ(1));
mrb_define_method(mrb, klass, "put_index",
mrb_grn_scan_info_put_index, MRB_ARGS_REQ(3));
mrb_define_method(mrb, klass, "op",
mrb_grn_scan_info_get_op, MRB_ARGS_NONE());
mrb_define_method(mrb, klass, "op=",
mrb_grn_scan_info_set_op, MRB_ARGS_REQ(1));
mrb_define_method(mrb, klass, "end=",
Expand Down

0 comments on commit 87a5fe3

Please sign in to comment.