| 1 | /* |
| 2 | Copyright (C) 2018 Brazil |
| 3 | Copyright (C) 2021-2022 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_db.h"cxx . . $ `<file>/lib/grn_db.h`/ |
| 21 | #include "grn_msgpack.h"cxx . . $ `<file>/lib/grn_msgpack.h`/ |
| 22 | #include "grn_options.h"cxx . . $ `<file>/lib/grn_options.h`/ |
| 23 | #include "grn_util.h"cxx . . $ `<file>/lib/grn_util.h`/ |
| 24 | |
| 25 | #include <stdio.h> |
| 26 | |
| 27 | #ifdef GRN_WITH_MESSAGE_PACKcxx . . $ `build/config.h:108:9`! |
| 28 | # include <groonga/msgpack.h>cxx . . $ `<file>/include/groonga/msgpack.h`/ |
| 29 | #endif /* GRN_WITH_MESSAGE_PACK */ |
| 30 | |
| 31 | struct _grn_optionscxx . . $ _grn_options# { |
| 32 | grn_jacxx . . $ grn_ja# *valuescxx . . $ _grn_options#values.; |
| 33 | }; |
| 34 | |
| 35 | static const char *GRN_OPTIONS_PATH_FORMATcxx . . $ GRN_OPTIONS_PATH_FORMAT. = "%s.options"; |
| 36 | static const unsigned int GRN_OPTIONS_MAX_VALUE_SIZEcxx . . $ GRN_OPTIONS_MAX_VALUE_SIZE. = 65536; |
| 37 | |
| 38 | grn_optionscxx . . $ grn_options# * |
| 39 | grn_options_createcxx . . $ grn_options_create(3d889195b6216345).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 40 | const char *path, |
| 41 | const char *context_tag) |
| 42 | { |
| 43 | char *options_path; |
| 44 | char options_path_buffer[PATH_MAXcxx . . $ `<external>/6347054901304145714/limits.h:13:9`!]; |
| 45 | grn_optionscxx . . $ grn_options# *options; |
| 46 | uint32_tcxx . . $ uint32_t# flags = 0; |
| 47 | |
| 48 | if (path) { |
| 49 | grn_snprintfcxx . . $ `include/groonga/portability.h:137:11`!(options_path_buffer, |
| 50 | PATH_MAX, |
| 51 | PATH_MAXcxx . . $ `<external>/6347054901304145714/limits.h:13:9`!, |
| 52 | GRN_OPTIONS_PATH_FORMAT, |
| 53 | path); |
| 54 | options_path = options_path_buffer; |
| 55 | } else { |
| 56 | options_path = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 57 | } |
| 58 | |
| 59 | options = GRN_CALLOCcxx . . $ `lib/grn_alloc.h:42:9`!(sizeof(grn_options)); |
| 60 | if (!options) { |
| 61 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_NO_MEMORY_AVAILABLE, |
| 62 | "%s failed to allocate memory for options: <%s>", |
| 63 | context_tag, |
| 64 | options_path ? options_path : "(temporary)"); |
| 65 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 66 | } |
| 67 | |
| 68 | options->valuescxx . . $ _grn_options#values. = grn_ja_createcxx . . $ grn_ja_create(8e06967be2729ebb).(ctx, |
| 69 | options_path, |
| 70 | GRN_OPTIONS_MAX_VALUE_SIZEcxx . . $ GRN_OPTIONS_MAX_VALUE_SIZE., |
| 71 | flags); |
| 72 | if (!options->valuescxx . . $ _grn_options#values.) { |
| 73 | GRN_FREEcxx . . $ `lib/grn_alloc.h:49:9`!(options); |
| 74 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_NO_MEMORY_AVAILABLE, |
| 75 | "%s failed to create data store for options: <%s>", |
| 76 | context_tag, |
| 77 | options_path ? options_path : "(temporary)"); |
| 78 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 79 | } |
| 80 | |
| 81 | return options; |
| 82 | } |
| 83 | |
| 84 | grn_optionscxx . . $ grn_options# * |
| 85 | grn_options_opencxx . . $ grn_options_open(3d889195b6216345).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 86 | const char *path, |
| 87 | const char *context_tag) |
| 88 | { |
| 89 | char options_path[PATH_MAXcxx . . $ `<external>/6347054901304145714/limits.h:13:9`!]; |
| 90 | grn_optionscxx . . $ grn_options# *options; |
| 91 | |
| 92 | grn_snprintfcxx . . $ `include/groonga/portability.h:137:11`!(options_path, |
| 93 | PATH_MAX, |
| 94 | PATH_MAXcxx . . $ `<external>/6347054901304145714/limits.h:13:9`!, |
| 95 | GRN_OPTIONS_PATH_FORMAT, |
| 96 | path); |
| 97 | if (!grn_path_existcxx . . $ grn_path_exist(c5f7da30cbc0f4e9).(options_path)) { |
| 98 | return grn_options_createcxx . . $ grn_options_create(3d889195b6216345).(ctx, path, context_tag); |
| 99 | } |
| 100 | |
| 101 | options = GRN_CALLOCcxx . . $ `lib/grn_alloc.h:42:9`!(sizeof(grn_options)); |
| 102 | if (!options) { |
| 103 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_NO_MEMORY_AVAILABLE, |
| 104 | "%s failed to allocate memory for options: <%s>", |
| 105 | context_tag, |
| 106 | options_path); |
| 107 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 108 | } |
| 109 | |
| 110 | options->valuescxx . . $ _grn_options#values. = grn_ja_opencxx . . $ grn_ja_open(26b27a6ad48eb6db).(ctx, options_path); |
| 111 | if (!options->valuescxx . . $ _grn_options#values.) { |
| 112 | GRN_FREEcxx . . $ `lib/grn_alloc.h:49:9`!(options); |
| 113 | ERRcxx . . $ `lib/grn_error.h:156:9`!(GRN_NO_MEMORY_AVAILABLE, |
| 114 | "%s failed to open data store for options: <%s>", |
| 115 | context_tag, |
| 116 | options_path); |
| 117 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 118 | } |
| 119 | |
| 120 | return options; |
| 121 | } |
| 122 | |
| 123 | grn_rccxx . . $ grn_rc# |
| 124 | grn_options_closecxx . . $ grn_options_close(2e8db6ae9aefbd21).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_optionscxx . . $ grn_options# *options) |
| 125 | { |
| 126 | grn_rccxx . . $ grn_rc# rc; |
| 127 | |
| 128 | if (!options) { |
| 129 | return GRN_SUCCESScxx . . $ GRN_SUCCESS.; |
| 130 | } |
| 131 | |
| 132 | rc = grn_ja_closecxx . . $ grn_ja_close(9f990ad2d2754423).(ctx, options->valuescxx . . $ _grn_options#values.); |
| 133 | GRN_FREEcxx . . $ `lib/grn_alloc.h:49:9`!(options); |
| 134 | |
| 135 | return rc; |
| 136 | } |
| 137 | |
| 138 | grn_rccxx . . $ grn_rc# |
| 139 | grn_options_removecxx . . $ grn_options_remove(cae1c943be750b4c).(grn_ctxcxx . . $ grn_ctx# *ctx, const char *path) |
| 140 | { |
| 141 | char options_path[PATH_MAXcxx . . $ `<external>/6347054901304145714/limits.h:13:9`!]; |
| 142 | |
| 143 | grn_snprintfcxx . . $ `include/groonga/portability.h:137:11`!(options_path, |
| 144 | PATH_MAX, |
| 145 | PATH_MAXcxx . . $ `<external>/6347054901304145714/limits.h:13:9`!, |
| 146 | GRN_OPTIONS_PATH_FORMAT, |
| 147 | path); |
| 148 | return grn_ja_removecxx . . $ grn_ja_remove(cae1c943be750b4c).(ctx, options_path); |
| 149 | } |
| 150 | |
| 151 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! |
| 152 | grn_options_is_lockedcxx . . $ grn_options_is_locked(79ad59236f5ba547).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_optionscxx . . $ grn_options# *options) |
| 153 | { |
| 154 | return grn_obj_is_lockedcxx . . $ grn_obj_is_locked(8dd58acc9865e889).(ctx, (grn_objcxx . . $ grn_obj# *)(options->valuescxx . . $ _grn_options#values.)); |
| 155 | } |
| 156 | |
| 157 | grn_rccxx . . $ grn_rc# |
| 158 | grn_options_clear_lockcxx . . $ grn_options_clear_lock(2e8db6ae9aefbd21).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_optionscxx . . $ grn_options# *options) |
| 159 | { |
| 160 | return grn_obj_clear_lockcxx . . $ grn_obj_clear_lock(4865d068a46d0f83).(ctx, (grn_objcxx . . $ grn_obj# *)(options->valuescxx . . $ _grn_options#values.)); |
| 161 | } |
| 162 | |
| 163 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! |
| 164 | grn_options_is_corruptcxx . . $ grn_options_is_corrupt(79ad59236f5ba547).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_optionscxx . . $ grn_options# *options) |
| 165 | { |
| 166 | return grn_obj_is_corruptcxx . . $ grn_obj_is_corrupt(a5760e5c319a06ee).(ctx, (grn_objcxx . . $ grn_obj# *)(options->valuescxx . . $ _grn_options#values.)); |
| 167 | } |
| 168 | |
| 169 | grn_rccxx . . $ grn_rc# |
| 170 | grn_options_flushcxx . . $ grn_options_flush(2e8db6ae9aefbd21).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_optionscxx . . $ grn_options# *options) |
| 171 | { |
| 172 | return grn_obj_flushcxx . . $ grn_obj_flush(4865d068a46d0f83).(ctx, (grn_objcxx . . $ grn_obj# *)(options->valuescxx . . $ _grn_options#values.)); |
| 173 | } |
| 174 | |
| 175 | #ifdef GRN_WITH_MESSAGE_PACKcxx . . $ `build/config.h:108:9`! |
| 176 | typedef structcxx . . $ $anonymous_type_effdf67dfefb40e3_0# { |
| 177 | grn_ctxcxx . . $ grn_ctx# *ctxcxx . . $ $anonymous_type_effdf67dfefb40e3_0#ctx.; |
| 178 | grn_objcxx . . $ grn_obj# *buffercxx . . $ $anonymous_type_effdf67dfefb40e3_0#buffer.; |
| 179 | } grn_options_msgpack_write_datacxx . . $ grn_options_msgpack_write_data#; |
| 180 | |
| 181 | static int |
| 182 | grn_options_msgpack_writecxx . . $ grn_options_msgpack_write(886e92dd2af22b63).(void *data, const char *buf, msgpack_size_tcxx . . $ msgpack_size_t# len) |
| 183 | { |
| 184 | grn_options_msgpack_write_datacxx . . $ grn_options_msgpack_write_data# *write_data = data; |
| 185 | return grn_bulk_writecxx . . $ grn_bulk_write(4609c18fd87cf054).(write_data->ctxcxx . . $ $anonymous_type_effdf67dfefb40e3_0#ctx., |
| 186 | write_data->buffercxx . . $ $anonymous_type_effdf67dfefb40e3_0#buffer., |
| 187 | buf, |
| 188 | len); |
| 189 | } |
| 190 | #endif /* GRN_WITH_MESSAGE_PACK */ |
| 191 | |
| 192 | grn_rccxx . . $ grn_rc# |
| 193 | grn_options_setcxx . . $ grn_options_set(f0c6074d310dc72c).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 194 | grn_optionscxx . . $ grn_options# *options, |
| 195 | grn_idcxx . . $ grn_id# id, |
| 196 | const char *name, |
| 197 | int name_length, |
| 198 | grn_objcxx . . $ grn_obj# *values) |
| 199 | { |
| 200 | #ifdef GRN_WITH_MESSAGE_PACKcxx . . $ `build/config.h:108:9`! |
| 201 | msgpack_packercxx . . $ msgpack_packer# packer; |
| 202 | grn_options_msgpack_write_datacxx . . $ grn_options_msgpack_write_data# data; |
| 203 | grn_objcxx . . $ grn_obj# buffer; |
| 204 | grn_io_wincxx . . $ grn_io_win# iw; |
| 205 | void *raw_value; |
| 206 | uint32_tcxx . . $ uint32_t# length; |
| 207 | unsigned int i, n; |
| 208 | |
| 209 | if (name_length < 0) { |
| 210 | name_length = (int)strlencxx . . $ strlen(751346f8406fd082).(name); |
| 211 | } |
| 212 | |
| 213 | GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&buffer, 0); |
| 214 | data.ctxcxx . . $ $anonymous_type_effdf67dfefb40e3_0#ctx. = ctx; |
| 215 | data.buffercxx . . $ $anonymous_type_effdf67dfefb40e3_0#buffer. = &buffer; |
| 216 | |
| 217 | msgpack_packer_initcxx . . $ msgpack_packer_init(ccefff34c31f5eba).(&packer, &data, grn_options_msgpack_writecxx . . $ grn_options_msgpack_write(886e92dd2af22b63).); |
| 218 | |
| 219 | raw_value = grn_ja_refcxx . . $ grn_ja_ref(e22c1a9426972524).(ctx, options->valuescxx . . $ _grn_options#values., id, &iw, &length); |
| 220 | if (raw_value) { |
| 221 | msgpack_unpackercxx . . $ msgpack_unpacker# unpacker; |
| 222 | msgpack_unpackedcxx . . $ msgpack_unpacked# unpacked; |
| 223 | |
| 224 | msgpack_unpacker_initcxx . . $ msgpack_unpacker_init(6c95f8b173ec7073).(&unpacker, MSGPACK_UNPACKER_INIT_BUFFER_SIZEcxx . . $ `<external>/4309055989589654100/unpack.h:69:9`!); |
| 225 | msgpack_unpacked_initcxx . . $ msgpack_unpacked_init(9c732d3404233bc4).(&unpacked); |
| 226 | |
| 227 | msgpack_unpacker_reserve_buffercxx . . $ msgpack_unpacker_reserve_buffer(6c95f8b173ec7073).(&unpacker, length); |
| 228 | grn_memcpycxx . . $ `include/groonga/portability.h:32:13`!(msgpack_unpacker_buffer(&unpacker), raw_value, length); |
| 229 | msgpack_unpacker_buffer_consumedcxx . . $ msgpack_unpacker_buffer_consumed(b40f60c934d2e91b).(&unpacker, length); |
| 230 | while (MSGPACK_UNPACKER_NEXTcxx . . $ `lib/grn_msgpack.h:70:11`!(&unpacker, &unpacked)) { |
| 231 | msgpack_objectcxx . . $ msgpack_object# *object = &(unpacked.datacxx . . $ msgpack_unpacked#data.); |
| 232 | if (object->typecxx . . $ msgpack_object#type. == MSGPACK_OBJECT_MAPcxx . . $ MSGPACK_OBJECT_MAP.) { |
| 233 | msgpack_object_mapcxx . . $ msgpack_object_map# *map = &(object->viacxx . . $ msgpack_object#via..mapcxx . . $ $anonymous_type_71e4b58492bceb77_6#map.); |
| 234 | uint32_tcxx . . $ uint32_t# i; |
| 235 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! have_same_key = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!; |
| 236 | uint32_tcxx . . $ uint32_t# same_key_index = 0; |
| 237 | |
| 238 | for (i = 0; i < map->sizecxx . . $ $anonymous_type_71e4b58492bceb77_2#size.; i++) { |
| 239 | msgpack_object_kvcxx . . $ msgpack_object_kv# *kv = &(map->ptrcxx . . $ $anonymous_type_71e4b58492bceb77_2#ptr.[i]); |
| 240 | msgpack_objectcxx . . $ msgpack_object# *key = &(kv->keycxx . . $ msgpack_object_kv#key.); |
| 241 | if (key->typecxx . . $ msgpack_object#type. == MSGPACK_OBJECT_STRcxx . . $ MSGPACK_OBJECT_STR. && |
| 242 | MSGPACK_OBJECT_STR_SIZEcxx . . $ `lib/grn_msgpack.h:65:11`!(key) == (size_t)name_length && |
| 243 | memcmpcxx . . $ memcmp(36f949851efa3055).(name, MSGPACK_OBJECT_STR_PTRcxx . . $ `lib/grn_msgpack.h:64:11`!(key), (size_t)name_length) == 0) { |
| 244 | have_same_key = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!; |
| 245 | same_key_index = i; |
| 246 | break; |
| 247 | } |
| 248 | } |
| 249 | if (have_same_key) { |
| 250 | msgpack_pack_mapcxx . . $ msgpack_pack_map(6e0902513ae6b58a).(&packer, map->sizecxx . . $ $anonymous_type_71e4b58492bceb77_2#size.); |
| 251 | } else { |
| 252 | msgpack_pack_mapcxx . . $ msgpack_pack_map(6e0902513ae6b58a).(&packer, map->sizecxx . . $ $anonymous_type_71e4b58492bceb77_2#size. + 1); |
| 253 | } |
| 254 | for (i = 0; i < map->sizecxx . . $ $anonymous_type_71e4b58492bceb77_2#size.; i++) { |
| 255 | msgpack_object_kvcxx . . $ msgpack_object_kv# *kv = &(map->ptrcxx . . $ $anonymous_type_71e4b58492bceb77_2#ptr.[i]); |
| 256 | if (have_same_key && i == same_key_index) { |
| 257 | continue; |
| 258 | } |
| 259 | msgpack_pack_objectcxx . . $ msgpack_pack_object(9116a1e870fe19b6).(&packer, kv->keycxx . . $ msgpack_object_kv#key.); |
| 260 | msgpack_pack_objectcxx . . $ msgpack_pack_object(9116a1e870fe19b6).(&packer, kv->valcxx . . $ msgpack_object_kv#val.); |
| 261 | } |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | msgpack_unpacked_destroycxx . . $ msgpack_unpacked_destroy(9c732d3404233bc4).(&unpacked); |
| 266 | msgpack_unpacker_destroycxx . . $ msgpack_unpacker_destroy(3d3acab2ef92945a).(&unpacker); |
| 267 | |
| 268 | grn_ja_unrefcxx . . $ grn_ja_unref(2a637fdbe33921a9).(ctx, &iw); |
| 269 | } else { |
| 270 | msgpack_pack_mapcxx . . $ msgpack_pack_map(6e0902513ae6b58a).(&packer, 1); |
| 271 | } |
| 272 | |
| 273 | msgpack_pack_strcxx . . $ msgpack_pack_str(6e0902513ae6b58a).(&packer, (size_t)name_length); |
| 274 | msgpack_pack_str_bodycxx . . $ msgpack_pack_str_body(d0afe27fff0c7a6c).(&packer, name, (size_t)name_length); |
| 275 | |
| 276 | n = grn_vector_sizecxx . . $ grn_vector_size(8dd58acc9865e889).(ctx, values); |
| 277 | msgpack_pack_arraycxx . . $ msgpack_pack_array(6e0902513ae6b58a).(&packer, n); |
| 278 | for (i = 0; i < n; i++) { |
| 279 | const char *value; |
| 280 | unsigned int value_size; |
| 281 | grn_idcxx . . $ grn_id# value_domain; |
| 282 | |
| 283 | value_size = grn_vector_get_elementcxx . . $ grn_vector_get_element(744613554bd9830c).(ctx, |
| 284 | values, |
| 285 | i, |
| 286 | &value, |
| 287 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, |
| 288 | &value_domain); |
| 289 | grn_msgpack_pack_raw_internalcxx . . $ grn_msgpack_pack_raw_internal(c4f319d1123df4f9).(ctx, &packer, value, value_size, value_domain); |
| 290 | if (ctx->rccxx . . $ _grn_ctx#rc. != GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 291 | break; |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | if (ctx->rccxx . . $ _grn_ctx#rc. == GRN_SUCCESScxx . . $ GRN_SUCCESS.) { |
| 296 | grn_ja_putcxx . . $ grn_ja_put(35c973a3630485be).(ctx, |
| 297 | options->valuescxx . . $ _grn_options#values., |
| 298 | id, |
| 299 | GRN_TEXT_VALUEcxx . . $ `include/groonga/groonga.h:2785:9`!(&buffer), |
| 300 | (uint32_tcxx . . $ uint32_t#)GRN_TEXT_LENcxx . . $ `include/groonga/groonga.h:2786:9`!(&buffer), |
| 301 | GRN_OBJ_SETcxx . . $ `include/groonga/groonga.h:1466:9`!, |
| 302 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 303 | } |
| 304 | GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &buffer); |
| 305 | #else /* GRN_WITH_MESSAGE_PACK */ |
| 306 | ERR(GRN_FUNCTION_NOT_IMPLEMENTED, "[options] MessagePack is required"); |
| 307 | #endif /* GRN_WITH_MESSAGE_PACK */ |
| 308 | return ctx->rccxx . . $ _grn_ctx#rc.; |
| 309 | } |
| 310 | |
| 311 | grn_option_revisioncxx . . $ grn_option_revision# |
| 312 | grn_options_getcxx . . $ grn_options_get(aa8c194dfc5d7720).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 313 | grn_optionscxx . . $ grn_options# *options, |
| 314 | grn_idcxx . . $ grn_id# id, |
| 315 | const char *name, |
| 316 | int name_length, |
| 317 | grn_option_revisioncxx . . $ grn_option_revision# revision, |
| 318 | grn_objcxx . . $ grn_obj# *value) |
| 319 | { |
| 320 | #ifdef GRN_WITH_MESSAGE_PACKcxx . . $ `build/config.h:108:9`! |
| 321 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! found = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!; |
| 322 | grn_io_wincxx . . $ grn_io_win# iw; |
| 323 | void *raw_value; |
| 324 | uint32_tcxx . . $ uint32_t# length; |
| 325 | msgpack_unpackercxx . . $ msgpack_unpacker# unpacker; |
| 326 | msgpack_unpackedcxx . . $ msgpack_unpacked# unpacked; |
| 327 | |
| 328 | raw_value = grn_ja_refcxx . . $ grn_ja_ref(e22c1a9426972524).(ctx, options->valuescxx . . $ _grn_options#values., id, &iw, &length); |
| 329 | if (!raw_value) { |
| 330 | return GRN_OPTION_REVISION_NONEcxx . . $ `include/groonga/option.h:26:9`!; |
| 331 | } |
| 332 | |
| 333 | if (raw_value == revision) { |
| 334 | grn_ja_unrefcxx . . $ grn_ja_unref(2a637fdbe33921a9).(ctx, &iw); |
| 335 | return GRN_OPTION_REVISION_UNCHANGEDcxx . . $ `include/groonga/option.h:27:9`!; |
| 336 | } |
| 337 | |
| 338 | if (name_length < 0) { |
| 339 | name_length = (int)strlencxx . . $ strlen(751346f8406fd082).(name); |
| 340 | } |
| 341 | |
| 342 | msgpack_unpacker_initcxx . . $ msgpack_unpacker_init(6c95f8b173ec7073).(&unpacker, MSGPACK_UNPACKER_INIT_BUFFER_SIZEcxx . . $ `<external>/4309055989589654100/unpack.h:69:9`!); |
| 343 | msgpack_unpacker_reserve_buffercxx . . $ msgpack_unpacker_reserve_buffer(6c95f8b173ec7073).(&unpacker, length); |
| 344 | msgpack_unpacked_initcxx . . $ msgpack_unpacked_init(9c732d3404233bc4).(&unpacked); |
| 345 | grn_memcpycxx . . $ `include/groonga/portability.h:32:13`!(msgpack_unpacker_buffer(&unpacker), |
| 346 | iw.addr, |
| 347 | length); |
| 348 | msgpack_unpacker_buffer_consumedcxx . . $ msgpack_unpacker_buffer_consumed(b40f60c934d2e91b).(&unpacker, length); |
| 349 | while (MSGPACK_UNPACKER_NEXTcxx . . $ `lib/grn_msgpack.h:70:11`!(&unpacker, &unpacked)) { |
| 350 | msgpack_objectcxx . . $ msgpack_object# *object = &(unpacked.datacxx . . $ msgpack_unpacked#data.); |
| 351 | if (object->typecxx . . $ msgpack_object#type. == MSGPACK_OBJECT_MAPcxx . . $ MSGPACK_OBJECT_MAP.) { |
| 352 | msgpack_object_mapcxx . . $ msgpack_object_map# *map = &(object->viacxx . . $ msgpack_object#via..mapcxx . . $ $anonymous_type_71e4b58492bceb77_6#map.); |
| 353 | uint32_tcxx . . $ uint32_t# i; |
| 354 | for (i = 0; i < map->sizecxx . . $ $anonymous_type_71e4b58492bceb77_2#size.; i++) { |
| 355 | msgpack_object_kvcxx . . $ msgpack_object_kv# *kv = &(map->ptrcxx . . $ $anonymous_type_71e4b58492bceb77_2#ptr.[i]); |
| 356 | if (kv->keycxx . . $ msgpack_object_kv#key..typecxx . . $ msgpack_object#type. == MSGPACK_OBJECT_STRcxx . . $ MSGPACK_OBJECT_STR. && |
| 357 | MSGPACK_OBJECT_STR_SIZEcxx . . $ `lib/grn_msgpack.h:65:11`!(&(kv->key)) == (size_t)name_length && |
| 358 | memcmpcxx . . $ memcmp(36f949851efa3055).(MSGPACK_OBJECT_STR_PTRcxx . . $ `lib/grn_msgpack.h:64:11`!(&(kv->key)), name, |
| 359 | (size_t)name_length) == 0) { |
| 360 | if (kv->valcxx . . $ msgpack_object_kv#val..typecxx . . $ msgpack_object#type. == MSGPACK_OBJECT_ARRAYcxx . . $ MSGPACK_OBJECT_ARRAY.) { |
| 361 | grn_msgpack_unpack_array_internalcxx . . $ grn_msgpack_unpack_array_internal(2064671c2552b15a).(ctx, |
| 362 | &(kv->valcxx . . $ msgpack_object_kv#val..viacxx . . $ msgpack_object#via..arraycxx . . $ $anonymous_type_71e4b58492bceb77_6#array.), |
| 363 | value); |
| 364 | found = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!; |
| 365 | } |
| 366 | break; |
| 367 | } |
| 368 | } |
| 369 | } |
| 370 | } |
| 371 | msgpack_unpacked_destroycxx . . $ msgpack_unpacked_destroy(9c732d3404233bc4).(&unpacked); |
| 372 | msgpack_unpacker_destroycxx . . $ msgpack_unpacker_destroy(3d3acab2ef92945a).(&unpacker); |
| 373 | |
| 374 | grn_ja_unrefcxx . . $ grn_ja_unref(2a637fdbe33921a9).(ctx, &iw); |
| 375 | |
| 376 | return raw_value; |
| 377 | #else /* GRN_WITH_MESSAGE_PACK */ |
| 378 | return GRN_OPTION_REVISION_NONE; |
| 379 | #endif /* GRN_WITH_MESSAGE_PACK */ |
| 380 | } |
| 381 | |
| 382 | grn_rccxx . . $ grn_rc# |
| 383 | grn_options_clearcxx . . $ grn_options_clear(c6e04362ad695e19).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 384 | grn_optionscxx . . $ grn_options# *options, |
| 385 | grn_idcxx . . $ grn_id# id) |
| 386 | { |
| 387 | return grn_ja_putcxx . . $ grn_ja_put(35c973a3630485be).(ctx, options->valuescxx . . $ _grn_options#values., id, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, 0, GRN_OBJ_SETcxx . . $ `include/groonga/groonga.h:1466:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 388 | } |
| 389 | |
| 390 | grn_rccxx . . $ grn_rc# |
| 391 | grn_options_wal_recovercxx . . $ grn_options_wal_recover(2e8db6ae9aefbd21).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_optionscxx . . $ grn_options# *options) |
| 392 | { |
| 393 | return grn_ja_wal_recovercxx . . $ grn_ja_wal_recover(9f990ad2d2754423).(ctx, options->valuescxx . . $ _grn_options#values.); |
| 394 | } |
| 395 | |
| 396 | grn_rccxx . . $ grn_rc# |
| 397 | grn_options_warmcxx . . $ grn_options_warm(2e8db6ae9aefbd21).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_optionscxx . . $ grn_options# *options) |
| 398 | { |
| 399 | return grn_ja_warmcxx . . $ grn_ja_warm(9f990ad2d2754423).(ctx, options->valuescxx . . $ _grn_options#values.); |
| 400 | } |