Kouhei Sutou
null+****@clear*****
Wed May 28 22:45:34 JST 2014
Kouhei Sutou 2014-05-28 22:45:34 +0900 (Wed, 28 May 2014) New Revision: 89c4ed4b1584f555c9cfbbece682126d6281608d https://github.com/groonga/groonga/commit/89c4ed4b1584f555c9cfbbece682126d6281608d Message: mrb: bind variable size column Added files: lib/mrb/mrb_variable_size_column.c lib/mrb/mrb_variable_size_column.h Modified files: lib/ctx_impl_mrb.c lib/mrb/sources.am Modified: lib/ctx_impl_mrb.c (+2 -0) =================================================================== --- lib/ctx_impl_mrb.c 2014-05-28 22:43:30 +0900 (0c7371b) +++ lib/ctx_impl_mrb.c 2014-05-28 22:45:34 +0900 (c5fdc98) @@ -24,6 +24,7 @@ #include "mrb/mrb_obj.h" #include "mrb/mrb_column.h" #include "mrb/mrb_fixed_size_column.h" +#include "mrb/mrb_variable_size_column.h" #include "mrb/mrb_expr.h" #include "mrb/mrb_accessor.h" #include "mrb/mrb_index_info.h" @@ -41,6 +42,7 @@ grn_ctx_impl_mrb_init_bindings(grn_ctx *ctx) grn_mrb_obj_init(ctx); grn_mrb_column_init(ctx); grn_mrb_fixed_size_column_init(ctx); + grn_mrb_variable_size_column_init(ctx); grn_mrb_expr_init(ctx); grn_mrb_accessor_init(ctx); grn_mrb_index_info_init(ctx); Added: lib/mrb/mrb_variable_size_column.c (+41 -0) 100644 =================================================================== --- /dev/null +++ lib/mrb/mrb_variable_size_column.c 2014-05-28 22:45:34 +0900 (b782ad6) @@ -0,0 +1,41 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2014 Brazil + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License version 2.1 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "../ctx_impl.h" + +#ifdef GRN_WITH_MRUBY +#include <mruby.h> +#include <mruby/class.h> + +#include "mrb_variable_size_column.h" + +void +grn_mrb_variable_size_column_init(grn_ctx *ctx) +{ + grn_mrb_data *data = &(ctx->impl->mrb); + mrb_state *mrb = data->state; + struct RClass *module = data->module; + struct RClass *column_class; + struct RClass *klass; + + column_class = mrb_class_get_under(mrb, module, "Column"); + klass = mrb_define_class_under(mrb, module, + "VariableSizeColumn", column_class); + MRB_SET_INSTANCE_TT(klass, MRB_TT_DATA); +} +#endif Added: lib/mrb/mrb_variable_size_column.h (+34 -0) 100644 =================================================================== --- /dev/null +++ lib/mrb/mrb_variable_size_column.h 2014-05-28 22:45:34 +0900 (d120f73) @@ -0,0 +1,34 @@ +/* -*- c-basic-offset: 2 -*- */ +/* + Copyright(C) 2014 Brazil + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License version 2.1 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef GRN_MRB_VARIABLE_SIZE_COLUMN_H +#define GRN_MRB_VARIABLE_SIZE_COLUMN_H + +#include "../ctx.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void grn_mrb_variable_size_column_init(grn_ctx *ctx); + +#ifdef __cplusplus +} +#endif + +#endif /* GRN_MRB_VARIABLE_SIZE_COLUMN_H */ Modified: lib/mrb/sources.am (+3 -1) =================================================================== --- lib/mrb/sources.am 2014-05-28 22:43:30 +0900 (7be8f72) +++ lib/mrb/sources.am 2014-05-28 22:45:34 +0900 (310c5fa) @@ -14,4 +14,6 @@ libgrnmrb_la_SOURCES = \ mrb_index_info.c \ mrb_index_info.h \ mrb_obj.c \ - mrb_obj.h + mrb_obj.h \ + mrb_variable_size_column.c \ + mrb_variable_size_column.h -------------- next part -------------- HTML����������������������������...下载