Kouhei Sutou
null+****@clear*****
Wed May 28 22:51:24 JST 2014
Kouhei Sutou 2014-05-28 22:51:24 +0900 (Wed, 28 May 2014) New Revision: a8739bc129212df1793d7dbe1bc2a6d3aabca918 https://github.com/groonga/groonga/commit/a8739bc129212df1793d7dbe1bc2a6d3aabca918 Message: mrb: bind GRN_PROC Added files: lib/mrb/mrb_procedure.c lib/mrb/mrb_procedure.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:46:31 +0900 (c5fdc98) +++ lib/ctx_impl_mrb.c 2014-05-28 22:51:24 +0900 (2f63f56) @@ -28,6 +28,7 @@ #include "mrb/mrb_expr.h" #include "mrb/mrb_accessor.h" #include "mrb/mrb_index_info.h" +#include "mrb/mrb_procedure.h" #ifdef GRN_WITH_MRUBY static void @@ -46,6 +47,7 @@ grn_ctx_impl_mrb_init_bindings(grn_ctx *ctx) grn_mrb_expr_init(ctx); grn_mrb_accessor_init(ctx); grn_mrb_index_info_init(ctx); + grn_mrb_procedure_init(ctx); } static void Added: lib/mrb/mrb_procedure.c (+41 -0) 100644 =================================================================== --- /dev/null +++ lib/mrb/mrb_procedure.c 2014-05-28 22:51:24 +0900 (ad4b4db) @@ -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 <mruby/data.h> + +#include "mrb_procedure.h" +#include "mrb_index_info.h" + +void +grn_mrb_procedure_init(grn_ctx *ctx) +{ + grn_mrb_data *data = &(ctx->impl->mrb); + mrb_state *mrb = data->state; + struct RClass *module = data->module; + struct RClass *object_class = data->object_class; + struct RClass *klass; + + klass = mrb_define_class_under(mrb, module, "Procedure", object_class); + MRB_SET_INSTANCE_TT(klass, MRB_TT_DATA); +} +#endif Added: lib/mrb/mrb_procedure.h (+34 -0) 100644 =================================================================== --- /dev/null +++ lib/mrb/mrb_procedure.h 2014-05-28 22:51:24 +0900 (16a4b32) @@ -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_PROCEDURE_H +#define GRN_MRB_PROCEDURE_H + +#include "../ctx.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void grn_mrb_procedure_init(grn_ctx *ctx); + +#ifdef __cplusplus +} +#endif + +#endif /* GRN_MRB_PROCEDURE_H */ Modified: lib/mrb/sources.am (+2 -0) =================================================================== --- lib/mrb/sources.am 2014-05-28 22:46:31 +0900 (310c5fa) +++ lib/mrb/sources.am 2014-05-28 22:51:24 +0900 (d2a1055) @@ -15,5 +15,7 @@ libgrnmrb_la_SOURCES = \ mrb_index_info.h \ mrb_obj.c \ mrb_obj.h \ + mrb_procedure.c \ + mrb_procedure.h \ mrb_variable_size_column.c \ mrb_variable_size_column.h -------------- next part -------------- HTML����������������������������... Download