| 1 | /* |
| 2 | Copyright (C) 2012-2018 Brazil |
| 3 | Copyright (C) 2018-2024 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 | #include "grn_token.h"cxx . . $ `<file>/lib/grn_token.h`/ |
| 21 | #include "grn_token_metadata.h"cxx . . $ `<file>/lib/grn_token_metadata.h`/ |
| 22 | |
| 23 | static inline grn_rccxx . . $ grn_rc# |
| 24 | grn_token_init_internalcxx . . $ grn_token_init_internal(e1c7767f8d607145).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token, boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! deep) |
| 25 | { |
| 26 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 27 | GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&(token->data), deep ? 0 : GRN_OBJ_DO_SHALLOW_COPYcxx . . $ `include/groonga/groonga.h:2732:9`!); |
| 28 | token->statuscxx . . $ _grn_token#status. = GRN_TOKEN_CONTINUEcxx . . $ `include/groonga/token.h:76:9`!; |
| 29 | token->source_offsetcxx . . $ _grn_token#source_offset. = 0; |
| 30 | token->source_lengthcxx . . $ _grn_token#source_length. = 0; |
| 31 | token->source_first_character_lengthcxx . . $ _grn_token#source_first_character_length. = 0; |
| 32 | token->have_overlapcxx . . $ _grn_token#have_overlap. = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!; |
| 33 | grn_token_metadata_initcxx . . $ grn_token_metadata_init(cda3a5f3c2e53c6b).(ctx, &(token->metadatacxx . . $ _grn_token#metadata.)); |
| 34 | token->force_prefix_searchcxx . . $ _grn_token#force_prefix_search. = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!; |
| 35 | token->positioncxx . . $ _grn_token#position. = 0; |
| 36 | token->weightcxx . . $ _grn_token#weight. = 0; |
| 37 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc); |
| 38 | } |
| 39 | |
| 40 | grn_rccxx . . $ grn_rc# |
| 41 | grn_token_initcxx . . $ grn_token_init(c8f3c42adffbb855).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token) |
| 42 | { |
| 43 | return grn_token_init_internalcxx . . $ grn_token_init_internal(e1c7767f8d607145).(ctx, token, falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!); |
| 44 | } |
| 45 | |
| 46 | grn_rccxx . . $ grn_rc# |
| 47 | grn_token_init_deepcxx . . $ grn_token_init_deep(c8f3c42adffbb855).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token) |
| 48 | { |
| 49 | return grn_token_init_internalcxx . . $ grn_token_init_internal(e1c7767f8d607145).(ctx, token, truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!); |
| 50 | } |
| 51 | |
| 52 | grn_rccxx . . $ grn_rc# |
| 53 | grn_token_fincxx . . $ grn_token_fin(c8f3c42adffbb855).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token) |
| 54 | { |
| 55 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 56 | grn_token_metadata_fincxx . . $ grn_token_metadata_fin(cda3a5f3c2e53c6b).(ctx, &(token->metadatacxx . . $ _grn_token#metadata.)); |
| 57 | GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &(token->data)); |
| 58 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc); |
| 59 | } |
| 60 | |
| 61 | grn_objcxx . . $ grn_obj# * |
| 62 | grn_token_get_datacxx . . $ grn_token_get_data(fa6b3ffdb9b18cb).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token) |
| 63 | { |
| 64 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 65 | if (!token) { |
| 66 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, "[token][data][get] token must not be NULL"); |
| 67 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 68 | } |
| 69 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(&(token->data)); |
| 70 | } |
| 71 | |
| 72 | const char * |
| 73 | grn_token_get_data_rawcxx . . $ grn_token_get_data_raw(a860c6b46bade933).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token, size_tcxx . . $ size_t# *length) |
| 74 | { |
| 75 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 76 | if (!token) { |
| 77 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, "[token][data][get][raw] token must not be NULL"); |
| 78 | if (length) { |
| 79 | *length = 0; |
| 80 | } |
| 81 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 82 | } |
| 83 | if (length) { |
| 84 | *length = GRN_TEXT_LENcxx . . $ `include/groonga/groonga.h:2786:9`!(&(token->data)); |
| 85 | } |
| 86 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(GRN_TEXT_VALUEcxx . . $ `include/groonga/groonga.h:2785:9`!(&(token->data))); |
| 87 | } |
| 88 | |
| 89 | grn_rccxx . . $ grn_rc# |
| 90 | grn_token_set_datacxx . . $ grn_token_set_data(6ab8cb5e36c467ee).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 91 | grn_tokencxx . . $ grn_token# *token, |
| 92 | const char *str_ptr, |
| 93 | int str_length) |
| 94 | { |
| 95 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 96 | if (!token) { |
| 97 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, "[token][data][set] token must not be NULL"); |
| 98 | goto exit; |
| 99 | } |
| 100 | if (str_length == -1) { |
| 101 | str_length = (int)strlencxx . . $ strlen(751346f8406fd082).(str_ptr); |
| 102 | } |
| 103 | GRN_TEXT_SETcxx . . $ `include/groonga/groonga.h:2761:9`!(ctx, &(token->data), str_ptr, str_length); |
| 104 | exit: |
| 105 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc); |
| 106 | } |
| 107 | |
| 108 | grn_idcxx . . $ grn_id# |
| 109 | grn_token_get_domaincxx . . $ grn_token_get_domain(e181e4c8cedfccbf).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token) |
| 110 | { |
| 111 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 112 | grn_idcxx . . $ grn_id# domain = GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!; |
| 113 | if (!token) { |
| 114 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, "[token][data][set] token must not be NULL"); |
| 115 | goto exit; |
| 116 | } |
| 117 | domain = token->datacxx . . $ _grn_token#data..headercxx . . $ _grn_obj#header..domaincxx . . $ _grn_obj_header#domain.; |
| 118 | exit: |
| 119 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(domain); |
| 120 | } |
| 121 | |
| 122 | grn_rccxx . . $ grn_rc# |
| 123 | grn_token_set_domaincxx . . $ grn_token_set_domain(ab0ad35a1c0de1a).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token, grn_idcxx . . $ grn_id# domain) |
| 124 | { |
| 125 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 126 | if (!token) { |
| 127 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, "[token][data][set] token must not be NULL"); |
| 128 | goto exit; |
| 129 | } |
| 130 | token->datacxx . . $ _grn_token#data..headercxx . . $ _grn_obj#header..domaincxx . . $ _grn_obj_header#domain. = domain; |
| 131 | exit: |
| 132 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc); |
| 133 | } |
| 134 | |
| 135 | grn_token_statuscxx . . $ grn_token_status# |
| 136 | grn_token_get_statuscxx . . $ grn_token_get_status(e181e4c8cedfccbf).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token) |
| 137 | { |
| 138 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 139 | if (!token) { |
| 140 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, "[token][status][get] token must not be NULL"); |
| 141 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(GRN_TOKEN_CONTINUEcxx . . $ `include/groonga/token.h:76:9`!); |
| 142 | } |
| 143 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(token->status); |
| 144 | } |
| 145 | |
| 146 | grn_rccxx . . $ grn_rc# |
| 147 | grn_token_set_statuscxx . . $ grn_token_set_status(ab0ad35a1c0de1a).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token, grn_token_statuscxx . . $ grn_token_status# status) |
| 148 | { |
| 149 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 150 | if (!token) { |
| 151 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, "[token][status][set] token must not be NULL"); |
| 152 | goto exit; |
| 153 | } |
| 154 | token->statuscxx . . $ _grn_token#status. = status; |
| 155 | exit: |
| 156 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc); |
| 157 | } |
| 158 | |
| 159 | grn_rccxx . . $ grn_rc# |
| 160 | grn_token_add_statuscxx . . $ grn_token_add_status(ab0ad35a1c0de1a).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token, grn_token_statuscxx . . $ grn_token_status# status) |
| 161 | { |
| 162 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 163 | if (!token) { |
| 164 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, "[token][status][add] token must not be NULL"); |
| 165 | goto exit; |
| 166 | } |
| 167 | token->statuscxx . . $ _grn_token#status. |= status; |
| 168 | exit: |
| 169 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc); |
| 170 | } |
| 171 | |
| 172 | grn_rccxx . . $ grn_rc# |
| 173 | grn_token_remove_statuscxx . . $ grn_token_remove_status(ab0ad35a1c0de1a).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token, grn_token_statuscxx . . $ grn_token_status# status) |
| 174 | { |
| 175 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 176 | if (!token) { |
| 177 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, "[token][status][remove] token must not be NULL"); |
| 178 | goto exit; |
| 179 | } |
| 180 | token->statuscxx . . $ _grn_token#status. &= ~status; |
| 181 | exit: |
| 182 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc); |
| 183 | } |
| 184 | |
| 185 | uint64_tcxx . . $ uint64_t# |
| 186 | grn_token_get_source_offsetcxx . . $ grn_token_get_source_offset(6b88337da967ca79).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token) |
| 187 | { |
| 188 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 189 | if (!token) { |
| 190 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, |
| 191 | "[token][source-offset][get] token must not be NULL"); |
| 192 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(0); |
| 193 | } |
| 194 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(token->source_offset); |
| 195 | } |
| 196 | |
| 197 | grn_rccxx . . $ grn_rc# |
| 198 | grn_token_set_source_offsetcxx . . $ grn_token_set_source_offset(16cfc2f76706454).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token, uint64_tcxx . . $ uint64_t# offset) |
| 199 | { |
| 200 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 201 | if (!token) { |
| 202 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, |
| 203 | "[token][source-offset][set] token must not be NULL"); |
| 204 | goto exit; |
| 205 | } |
| 206 | token->source_offsetcxx . . $ _grn_token#source_offset. = offset; |
| 207 | exit: |
| 208 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc); |
| 209 | } |
| 210 | |
| 211 | uint32_tcxx . . $ uint32_t# |
| 212 | grn_token_get_source_lengthcxx . . $ grn_token_get_source_length(e181e4c8cedfccbf).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token) |
| 213 | { |
| 214 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 215 | if (!token) { |
| 216 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, |
| 217 | "[token][source-length][get] token must not be NULL"); |
| 218 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(0); |
| 219 | } |
| 220 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(token->source_length); |
| 221 | } |
| 222 | |
| 223 | grn_rccxx . . $ grn_rc# |
| 224 | grn_token_set_source_lengthcxx . . $ grn_token_set_source_length(ab0ad35a1c0de1a).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token, uint32_tcxx . . $ uint32_t# length) |
| 225 | { |
| 226 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 227 | if (!token) { |
| 228 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, |
| 229 | "[token][source-length][set] token must not be NULL"); |
| 230 | goto exit; |
| 231 | } |
| 232 | token->source_lengthcxx . . $ _grn_token#source_length. = length; |
| 233 | exit: |
| 234 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc); |
| 235 | } |
| 236 | |
| 237 | uint32_tcxx . . $ uint32_t# |
| 238 | grn_token_get_source_first_character_lengthcxx . . $ grn_token_get_source_first_character_length(e181e4c8cedfccbf).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token) |
| 239 | { |
| 240 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 241 | if (!token) { |
| 242 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, |
| 243 | "[token][source-first-character-length][get] token must not be NULL"); |
| 244 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(0); |
| 245 | } |
| 246 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(token->source_first_character_length); |
| 247 | } |
| 248 | |
| 249 | grn_rccxx . . $ grn_rc# |
| 250 | grn_token_set_source_first_character_lengthcxx . . $ grn_token_set_source_first_character_length(ab0ad35a1c0de1a).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 251 | grn_tokencxx . . $ grn_token# *token, |
| 252 | uint32_tcxx . . $ uint32_t# length) |
| 253 | { |
| 254 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 255 | if (!token) { |
| 256 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, |
| 257 | "[token][source-first-character-length][set] token must not be NULL"); |
| 258 | goto exit; |
| 259 | } |
| 260 | token->source_first_character_lengthcxx . . $ _grn_token#source_first_character_length. = length; |
| 261 | exit: |
| 262 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc); |
| 263 | } |
| 264 | |
| 265 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! |
| 266 | grn_token_have_overlapcxx . . $ grn_token_have_overlap(5548dc6ca4c05dee).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token) |
| 267 | { |
| 268 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 269 | if (!token) { |
| 270 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, "[token][overlap][have] token must not be NULL"); |
| 271 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!); |
| 272 | } |
| 273 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(token->have_overlap); |
| 274 | } |
| 275 | |
| 276 | grn_rccxx . . $ grn_rc# |
| 277 | grn_token_set_overlapcxx . . $ grn_token_set_overlap(e1c7767f8d607145).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token, boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! have_overlap) |
| 278 | { |
| 279 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 280 | if (!token) { |
| 281 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, "[token][overlap][set] token must not be NULL"); |
| 282 | goto exit; |
| 283 | } |
| 284 | token->have_overlapcxx . . $ _grn_token#have_overlap. = have_overlap; |
| 285 | exit: |
| 286 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc); |
| 287 | } |
| 288 | |
| 289 | grn_objcxx . . $ grn_obj# * |
| 290 | grn_token_get_metadatacxx . . $ grn_token_get_metadata(fa6b3ffdb9b18cb).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token) |
| 291 | { |
| 292 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 293 | if (!token) { |
| 294 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, "[token][metadata][get] token must not be NULL"); |
| 295 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 296 | } |
| 297 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(&(token->metadata)); |
| 298 | } |
| 299 | |
| 300 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! |
| 301 | grn_token_get_force_prefix_searchcxx . . $ grn_token_get_force_prefix_search(5548dc6ca4c05dee).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token) |
| 302 | { |
| 303 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 304 | if (!token) { |
| 305 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, |
| 306 | "[token][force-prefix-search][get] token must not be NULL"); |
| 307 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!); |
| 308 | } |
| 309 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(token->force_prefix_search); |
| 310 | } |
| 311 | |
| 312 | grn_rccxx . . $ grn_rc# |
| 313 | grn_token_set_force_prefix_searchcxx . . $ grn_token_set_force_prefix_search(e1c7767f8d607145).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token, boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! force) |
| 314 | { |
| 315 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 316 | if (!token) { |
| 317 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, |
| 318 | "[token][force-prefix-search][set] token must not be NULL"); |
| 319 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc); |
| 320 | } |
| 321 | token->force_prefix_searchcxx . . $ _grn_token#force_prefix_search. = force; |
| 322 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc); |
| 323 | } |
| 324 | |
| 325 | uint32_tcxx . . $ uint32_t# |
| 326 | grn_token_get_positioncxx . . $ grn_token_get_position(e181e4c8cedfccbf).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token) |
| 327 | { |
| 328 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 329 | if (!token) { |
| 330 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, "[token][position][get] token must not be NULL"); |
| 331 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(0); |
| 332 | } |
| 333 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(token->position); |
| 334 | } |
| 335 | |
| 336 | grn_rccxx . . $ grn_rc# |
| 337 | grn_token_set_positioncxx . . $ grn_token_set_position(ab0ad35a1c0de1a).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token, uint32_tcxx . . $ uint32_t# position) |
| 338 | { |
| 339 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 340 | if (!token) { |
| 341 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, "[token][position][set] token must not be NULL"); |
| 342 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc); |
| 343 | } |
| 344 | token->positioncxx . . $ _grn_token#position. = position; |
| 345 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc); |
| 346 | } |
| 347 | |
| 348 | float |
| 349 | grn_token_get_weightcxx . . $ grn_token_get_weight(92787578964708a1).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token) |
| 350 | { |
| 351 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 352 | if (!token) { |
| 353 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, "[token][weight][get] token must not be NULL"); |
| 354 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(0.0); |
| 355 | } |
| 356 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(token->weight); |
| 357 | } |
| 358 | |
| 359 | grn_rccxx . . $ grn_rc# |
| 360 | grn_token_set_weightcxx . . $ grn_token_set_weight(9f65769602e0c4d6).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token, float weight) |
| 361 | { |
| 362 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 363 | if (!token) { |
| 364 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, "[token][float][set] token must not be NULL"); |
| 365 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc); |
| 366 | } |
| 367 | token->weightcxx . . $ _grn_token#weight. = weight; |
| 368 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc); |
| 369 | } |
| 370 | |
| 371 | grn_rccxx . . $ grn_rc# |
| 372 | grn_token_resetcxx . . $ grn_token_reset(c8f3c42adffbb855).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token) |
| 373 | { |
| 374 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 375 | if (!token) { |
| 376 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, "[token][reset] token must not be NULL"); |
| 377 | goto exit; |
| 378 | } |
| 379 | GRN_BULK_REWINDcxx . . $ `include/groonga/groonga.h:2599:9`!(&(token->data)); |
| 380 | token->statuscxx . . $ _grn_token#status. = GRN_TOKEN_CONTINUEcxx . . $ `include/groonga/token.h:76:9`!; |
| 381 | token->source_offsetcxx . . $ _grn_token#source_offset. = 0; |
| 382 | token->source_lengthcxx . . $ _grn_token#source_length. = 0; |
| 383 | token->source_first_character_lengthcxx . . $ _grn_token#source_first_character_length. = 0; |
| 384 | token->have_overlapcxx . . $ _grn_token#have_overlap. = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!; |
| 385 | grn_token_metadata_resetcxx . . $ grn_token_metadata_reset(cda3a5f3c2e53c6b).(ctx, &(token->metadatacxx . . $ _grn_token#metadata.)); |
| 386 | token->force_prefix_searchcxx . . $ _grn_token#force_prefix_search. = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!; |
| 387 | token->positioncxx . . $ _grn_token#position. = 0; |
| 388 | token->weightcxx . . $ _grn_token#weight. = 0.0; |
| 389 | exit: |
| 390 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc); |
| 391 | } |
| 392 | |
| 393 | grn_rccxx . . $ grn_rc# |
| 394 | grn_token_copycxx . . $ grn_token_copy(d8752d628fc40805).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_tokencxx . . $ grn_token# *token, grn_tokencxx . . $ grn_token# *source) |
| 395 | { |
| 396 | GRN_API_ENTERcxx . . $ `lib/grn_ctx.h:41:9`!; |
| 397 | if (!token) { |
| 398 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_INVALID_ARGUMENT, "[token][copy] token must not be NULL"); |
| 399 | goto exit; |
| 400 | } |
| 401 | GRN_TEXT_SETcxx . . $ `include/groonga/groonga.h:2761:9`!(ctx, |
| 402 | &(token->data), |
| 403 | GRN_TEXT_VALUEcxx . . $ `include/groonga/groonga.h:2785:9`!(&(source->data)), |
| 404 | GRN_TEXT_LENcxx . . $ `include/groonga/groonga.h:2786:9`!(&(source->data))); |
| 405 | token->statuscxx . . $ _grn_token#status. = source->statuscxx . . $ _grn_token#status.; |
| 406 | token->source_offsetcxx . . $ _grn_token#source_offset. = source->source_offsetcxx . . $ _grn_token#source_offset.; |
| 407 | token->source_lengthcxx . . $ _grn_token#source_length. = source->source_lengthcxx . . $ _grn_token#source_length.; |
| 408 | token->source_first_character_lengthcxx . . $ _grn_token#source_first_character_length. = source->source_first_character_lengthcxx . . $ _grn_token#source_first_character_length.; |
| 409 | token->have_overlapcxx . . $ _grn_token#have_overlap. = source->have_overlapcxx . . $ _grn_token#have_overlap.; |
| 410 | grn_token_metadata_resetcxx . . $ grn_token_metadata_reset(cda3a5f3c2e53c6b).(ctx, &(token->metadatacxx . . $ _grn_token#metadata.)); |
| 411 | grn_token_metadata_copycxx . . $ grn_token_metadata_copy(99eba0d3a8372d65).(ctx, &(token->metadatacxx . . $ _grn_token#metadata.), &(source->metadatacxx . . $ _grn_token#metadata.)); |
| 412 | token->force_prefix_searchcxx . . $ _grn_token#force_prefix_search. = source->force_prefix_searchcxx . . $ _grn_token#force_prefix_search.; |
| 413 | token->positioncxx . . $ _grn_token#position. = source->positioncxx . . $ _grn_token#position.; |
| 414 | token->weightcxx . . $ _grn_token#weight. = source->weightcxx . . $ _grn_token#weight.; |
| 415 | exit: |
| 416 | GRN_API_RETURNcxx . . $ `lib/grn_ctx.h:56:9`!(ctx->rc); |
| 417 | } |