| 1 | /* |
| 2 | Copyright(C) 2018 Brazil |
| 3 | Copyright(C) 2019-2021 Sutou Kouhei <[email protected]> |
| 4 | |
| 5 | This library is free software; you can redistribute it and/or |
| 6 | modify it under the terms of the GNU Lesser General Public |
| 7 | License as published by the Free Software Foundation; either |
| 8 | version 2.1 of the License, or (at your option) any later version. |
| 9 | |
| 10 | This library is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | Lesser General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU Lesser General Public |
| 16 | License along with this library; if not, write to the Free Software |
| 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 19 | |
| 20 | #pragma once |
| 21 | |
| 22 | #include "grn.h" |
| 23 | |
| 24 | #ifdef __cplusplus |
| 25 | extern "C" { |
| 26 | #endif |
| 27 | |
| 28 | typedef struct { |
| 29 | grn_obj *proc; |
| 30 | void *options; |
| 31 | grn_option_revision options_revision; |
| 32 | grn_close_func options_close_func; |
| 33 | grn_critical_section lock; |
| 34 | } grn_table_module; |
| 35 | |
| 36 | void |
| 37 | grn_table_module_init(grn_ctx *ctx, grn_table_module *module, grn_id module_id); |
| 38 | void |
| 39 | grn_table_module_set_proc(grn_ctx *ctx, |
| 40 | grn_table_module *module, |
| 41 | grn_obj *proc); |
| 42 | void |
| 43 | grn_table_module_set_options(grn_ctx *ctx, |
| 44 | grn_table_module *module, |
| 45 | void *options, |
| 46 | grn_option_revision revision, |
| 47 | grn_close_func close_func); |
| 48 | void |
| 49 | grn_table_module_fin(grn_ctx *ctx, grn_table_module *module); |
| 50 | |
| 51 | void |
| 52 | grn_table_modules_init(grn_ctx *ctx, grn_obj *modules_buffer); |
| 53 | void |
| 54 | grn_table_modules_fin(grn_ctx *ctx, grn_obj *modules_buffer); |
| 55 | void |
| 56 | grn_table_modules_add(grn_ctx *ctx, grn_obj *modules_buffer, grn_obj *proc); |
| 57 | void |
| 58 | grn_table_modules_rewind(grn_ctx *ctx, grn_obj *modules_buffer); |
| 59 | grn_table_module * |
| 60 | grn_table_modules_get_module(grn_ctx *ctx, grn_obj *modules_buffer, size_t i); |
| 61 | grn_obj * |
| 62 | grn_table_modules_get_proc(grn_ctx *ctx, grn_obj *modules_buffer, size_t i); |
| 63 | |
| 64 | #ifdef __cplusplus |
| 65 | } |
| 66 | #endif |