| 1 | /* |
| 2 | Copyright (C) 2009-2018 Brazil |
| 3 | Copyright (C) 2018-2026 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 | #ifdef __cplusplus |
| 23 | extern "C" { |
| 24 | #endif |
| 25 | |
| 26 | typedef void *(*grn_table_module_open_options_func)(grn_ctx *ctx, |
| 27 | grn_obj *proc, |
| 28 | grn_obj *values, |
| 29 | void *user_data); |
| 30 | /* Deprecated since 8.0.9. Use grn_table_module_option_options_func instead. */ |
| 31 | typedef grn_table_module_open_options_func grn_tokenizer_open_options_func; |
| 32 | |
| 33 | GRN_API grn_rc |
| 34 | grn_table_set_default_tokenizer_options(grn_ctx *ctx, |
| 35 | grn_obj *table, |
| 36 | grn_obj *options); |
| 37 | |
| 38 | GRN_API grn_rc |
| 39 | grn_table_get_default_tokenizer_options(grn_ctx *ctx, |
| 40 | grn_obj *table, |
| 41 | grn_obj *options); |
| 42 | |
| 43 | GRN_API void * |
| 44 | grn_table_cache_default_tokenizer_options( |
| 45 | grn_ctx *ctx, |
| 46 | grn_obj *table, |
| 47 | grn_table_module_open_options_func open_options_func, |
| 48 | grn_close_func close_options_func, |
| 49 | void *user_data); |
| 50 | |
| 51 | GRN_API grn_rc |
| 52 | grn_table_get_default_tokenizer_string(grn_ctx *ctx, |
| 53 | grn_obj *table, |
| 54 | grn_obj *output); |
| 55 | |
| 56 | /* Deprecated since 8.0.9. Use grn_table_module_open_options_func instead. */ |
| 57 | typedef grn_table_module_open_options_func grn_normalizer_open_options_func; |
| 58 | |
| 59 | GRN_API grn_rc |
| 60 | grn_table_set_normalizer_options(grn_ctx *ctx, |
| 61 | grn_obj *table, |
| 62 | grn_obj *options); |
| 63 | |
| 64 | GRN_API grn_rc |
| 65 | grn_table_get_normalizer_options(grn_ctx *ctx, |
| 66 | grn_obj *table, |
| 67 | grn_obj *options); |
| 68 | |
| 69 | /* TODO: Remove string argument. It's needless. */ |
| 70 | GRN_API void * |
| 71 | grn_table_cache_normalizer_options( |
| 72 | grn_ctx *ctx, |
| 73 | grn_obj *table, |
| 74 | grn_obj *string, |
| 75 | grn_table_module_open_options_func open_options_func, |
| 76 | grn_close_func close_options_func, |
| 77 | void *user_data); |
| 78 | |
| 79 | GRN_API grn_rc |
| 80 | grn_table_get_normalizer_string(grn_ctx *ctx, grn_obj *table, grn_obj *output); |
| 81 | |
| 82 | GRN_API grn_rc |
| 83 | grn_table_set_normalizers_options(grn_ctx *ctx, |
| 84 | grn_obj *table, |
| 85 | uint32_t i, |
| 86 | grn_obj *options); |
| 87 | |
| 88 | GRN_API grn_rc |
| 89 | grn_table_get_normalizers_options(grn_ctx *ctx, |
| 90 | grn_obj *table, |
| 91 | uint32_t i, |
| 92 | grn_obj *options); |
| 93 | |
| 94 | GRN_API void * |
| 95 | grn_table_cache_normalizers_options( |
| 96 | grn_ctx *ctx, |
| 97 | grn_obj *table, |
| 98 | uint32_t i, |
| 99 | grn_table_module_open_options_func open_options_func, |
| 100 | grn_close_func close_options_func, |
| 101 | void *user_data); |
| 102 | |
| 103 | GRN_API grn_rc |
| 104 | grn_table_get_normalizers_string(grn_ctx *ctx, grn_obj *table, grn_obj *output); |
| 105 | |
| 106 | /* Deprecated since 11.0.4. Use grn_table_set_token_filters_options() instead. |
| 107 | */ |
| 108 | GRN_API grn_rc |
| 109 | grn_table_set_token_filter_options(grn_ctx *ctx, |
| 110 | grn_obj *table, |
| 111 | unsigned int i, |
| 112 | grn_obj *options); |
| 113 | |
| 114 | GRN_API grn_rc |
| 115 | grn_table_set_token_filters_options(grn_ctx *ctx, |
| 116 | grn_obj *table, |
| 117 | uint32_t i, |
| 118 | grn_obj *options); |
| 119 | |
| 120 | /* Deprecated since 11.0.4. Use grn_table_get_token_filters_options() instead. |
| 121 | */ |
| 122 | GRN_API grn_rc |
| 123 | grn_table_get_token_filter_options(grn_ctx *ctx, |
| 124 | grn_obj *table, |
| 125 | unsigned int i, |
| 126 | grn_obj *options); |
| 127 | |
| 128 | GRN_API grn_rc |
| 129 | grn_table_get_token_filters_options(grn_ctx *ctx, |
| 130 | grn_obj *table, |
| 131 | uint32_t i, |
| 132 | grn_obj *options); |
| 133 | |
| 134 | /* Deprecated since 11.0.4. Use grn_table_cache_token_filters_options() instead. |
| 135 | */ |
| 136 | GRN_API void * |
| 137 | grn_table_cache_token_filter_options( |
| 138 | grn_ctx *ctx, |
| 139 | grn_obj *table, |
| 140 | unsigned int i, |
| 141 | grn_table_module_open_options_func open_options_func, |
| 142 | grn_close_func close_options_func, |
| 143 | void *user_data); |
| 144 | |
| 145 | GRN_API void * |
| 146 | grn_table_cache_token_filters_options( |
| 147 | grn_ctx *ctx, |
| 148 | grn_obj *table, |
| 149 | uint32_t i, |
| 150 | grn_table_module_open_options_func open_options_func, |
| 151 | grn_close_func close_options_func, |
| 152 | void *user_data); |
| 153 | |
| 154 | GRN_API grn_rc |
| 155 | grn_table_get_token_filters_string(grn_ctx *ctx, |
| 156 | grn_obj *table, |
| 157 | grn_obj *output); |
| 158 | |
| 159 | GRN_API grn_rc |
| 160 | grn_table_set_extractors_options(grn_ctx *ctx, |
| 161 | grn_obj *table, |
| 162 | uint32_t i, |
| 163 | grn_obj *options); |
| 164 | |
| 165 | GRN_API grn_rc |
| 166 | grn_table_get_extractors_options(grn_ctx *ctx, |
| 167 | grn_obj *table, |
| 168 | uint32_t i, |
| 169 | grn_obj *options); |
| 170 | |
| 171 | GRN_API void * |
| 172 | grn_table_cache_extractors_options( |
| 173 | grn_ctx *ctx, |
| 174 | grn_obj *table, |
| 175 | uint32_t i, |
| 176 | grn_table_module_open_options_func open_options_func, |
| 177 | grn_close_func close_options_func, |
| 178 | void *user_data); |
| 179 | |
| 180 | GRN_API grn_rc |
| 181 | grn_table_get_extractors_string(grn_ctx *ctx, grn_obj *table, grn_obj *output); |
| 182 | |
| 183 | #ifdef __cplusplus |
| 184 | } |
| 185 | #endif |