Debian Codegraph @

lib/mrb/mrb_table_cursor_flags.c

raw symbols SCIP
1 /*
2 Copyright(C) 2014 Brazil
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this library; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19 #include "../grn_ctx_impl.h"
20
21 #ifdef GRN_WITH_MRUBY
22 #include <mruby.h>
23 #include <mruby/class.h>
24
25 #include "mrb_table_cursor_flags.h"
26
27 void
28 grn_mrb_table_cursor_flags_init(grn_ctx *ctx)
29 {
30 grn_mrb_data *data = &(ctx->impl->mrb);
31 mrb_state *mrb = data->state;
32 struct RClass *module = data->module;
33 struct RClass *flags_module;
34
35 flags_module = mrb_define_module_under(mrb, module, "TableCursorFlags");
36
37 mrb_define_const(mrb, flags_module, "ASCENDING",
38 mrb_int_value(mrb, GRN_CURSOR_ASCENDING));
39 mrb_define_const(mrb, flags_module, "DESCENDING",
40 mrb_int_value(mrb, GRN_CURSOR_DESCENDING));
41 mrb_define_const(mrb, flags_module, "GE",
42 mrb_int_value(mrb, GRN_CURSOR_GE));
43 mrb_define_const(mrb, flags_module, "GT",
44 mrb_int_value(mrb, GRN_CURSOR_GT));
45 mrb_define_const(mrb, flags_module, "LE",
46 mrb_int_value(mrb, GRN_CURSOR_LE));
47 mrb_define_const(mrb, flags_module, "LT",
48 mrb_int_value(mrb, GRN_CURSOR_LT));
49 mrb_define_const(mrb, flags_module, "BY_KEY",
50 mrb_int_value(mrb, GRN_CURSOR_BY_KEY));
51 mrb_define_const(mrb, flags_module, "BY_ID",
52 mrb_int_value(mrb, GRN_CURSOR_BY_ID));
53 mrb_define_const(mrb, flags_module, "PREFIX",
54 mrb_int_value(mrb, GRN_CURSOR_PREFIX));
55 mrb_define_const(mrb, flags_module, "SIZE_BY_BIT",
56 mrb_int_value(mrb, GRN_CURSOR_SIZE_BY_BIT));
57 mrb_define_const(mrb, flags_module, "RK",
58 mrb_int_value(mrb, GRN_CURSOR_RK));
59 }
60 #endif