| 1 | /* |
| 2 | Copyright(C) 2009-2018 Brazil |
| 3 | Copyright(C) 2020-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 | #pragma once |
| 21 | |
| 22 | #include "grn.h"cxx . . $ `<file>/lib/grn.h`/ |
| 23 | |
| 24 | #ifdef GRN_WITH_MESSAGE_PACKcxx . . $ `build/config.h:108:9`! |
| 25 | # ifdef memcpy |
| 26 | # define GRN_WITH_CUSTOM_MEMCPY |
| 27 | # endif /* memcpy */ |
| 28 | # ifndef GRN_WITH_CUSTOM_MEMCPY |
| 29 | # define memcpycxx . . $ `lib/grn_msgpack.h:29:11`!(dest, src, n) grn_memcpycxx . . $ `include/groonga/portability.h:30:13`!(dest, src, n) |
| 30 | # endif /* GRN_WITH_CUSTOM_MEMCPY */ |
| 31 | # include <msgpack.h> |
| 32 | # ifndef GRN_WITH_CUSTOM_MEMCPY |
| 33 | # undef memcpycxx . . $ `lib/grn_msgpack.h:29:11`! |
| 34 | # endif /* GRN_WITH_CUSTOM_MEMCPY */ |
| 35 | |
| 36 | # if MSGPACK_VERSION_MAJORcxx . . $ `<external>/1534749831535503406/version_master.h:1:9`! < 1 |
| 37 | typedef unsigned int msgpack_size_t; |
| 38 | |
| 39 | # define msgpack_pack_str(packer, size) msgpack_pack_raw(packer, size) |
| 40 | # define msgpack_pack_str_body(packer, value, size) \ |
| 41 | msgpack_pack_raw_body(packer, value, size) |
| 42 | |
| 43 | # define MSGPACK_OBJECT_STR MSGPACK_OBJECT_RAW |
| 44 | # define MSGPACK_OBJECT_FLOAT64 MSGPACK_OBJECT_DOUBLE |
| 45 | |
| 46 | # define MSGPACK_OBJECT_STR_PTR(object) (object)->via.raw.ptr |
| 47 | # define MSGPACK_OBJECT_STR_SIZE(object) (object)->via.raw.size |
| 48 | |
| 49 | # define MSGPACK_OBJECT_FLOAT64_VALUE(object) (object)->via.dec |
| 50 | |
| 51 | # define MSGPACK_UNPACKER_NEXT(unpacker, unpacked) \ |
| 52 | msgpack_unpacker_next((unpacker), (unpacked)) |
| 53 | # else /* MSGPACK_VERSION_MAJOR < 1 */ |
| 54 | typedef size_t msgpack_size_tcxx . . $ msgpack_size_t#; |
| 55 | |
| 56 | # if MSGPACK_VERSION_MAJORcxx . . $ `<external>/1534749831535503406/version_master.h:1:9`! == 1 |
| 57 | # define MSGPACK_OBJECT_FLOAT64 MSGPACK_OBJECT_FLOAT |
| 58 | # elif MSGPACK_VERSION_MAJORcxx . . $ `<external>/1534749831535503406/version_master.h:1:9`! == 2 && MSGPACK_VERSION_MINORcxx . . $ `<external>/1534749831535503406/version_master.h:2:9`! < 1 |
| 59 | # define MSGPACK_OBJECT_FLOAT64 MSGPACK_OBJECT_DOUBLE |
| 60 | # else |
| 61 | # define MSGPACK_HAVE_FLOAT32cxx . . $ `lib/grn_msgpack.h:61:12`! |
| 62 | # endif |
| 63 | |
| 64 | # define MSGPACK_OBJECT_STR_PTRcxx . . $ `lib/grn_msgpack.h:64:11`!(object) (object)->via.str.ptr |
| 65 | # define MSGPACK_OBJECT_STR_SIZEcxx . . $ `lib/grn_msgpack.h:65:11`!(object) (object)->via.str.size |
| 66 | |
| 67 | # define MSGPACK_OBJECT_FLOAT32_VALUEcxx . . $ `lib/grn_msgpack.h:67:11`!(object) (object)->via.f64 |
| 68 | # define MSGPACK_OBJECT_FLOAT64_VALUEcxx . . $ `lib/grn_msgpack.h:68:11`!(object) (object)->via.f64 |
| 69 | |
| 70 | # define MSGPACK_UNPACKER_NEXTcxx . . $ `lib/grn_msgpack.h:70:11`!(unpacker, unpacked) \ |
| 71 | msgpack_unpacker_next((unpacker), (unpacked)) == MSGPACK_UNPACK_SUCCESS |
| 72 | # endif /* MSGPACK_VERSION_MAJOR < 1 */ |
| 73 | |
| 74 | const char * |
| 75 | grn_msgpack_object_type_to_stringcxx . . $ grn_msgpack_object_type_to_string(a3a51a59cd4edf18).(msgpack_object_typecxx . . $ msgpack_object_type# type); |
| 76 | |
| 77 | grn_rccxx . . $ grn_rc# grn_msgpack_pack_raw_internalcxx . . $ grn_msgpack_pack_raw_internal(c4f319d1123df4f9).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 78 | msgpack_packercxx . . $ msgpack_packer# *packer, |
| 79 | const char *value, |
| 80 | size_t value_size, |
| 81 | grn_idcxx . . $ grn_id# value_domain); |
| 82 | grn_rccxx . . $ grn_rc# grn_msgpack_pack_internalcxx . . $ grn_msgpack_pack_internal(97c3f6dcbd80c211).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 83 | msgpack_packercxx . . $ msgpack_packer# *packer, |
| 84 | grn_objcxx . . $ grn_obj# *value); |
| 85 | grn_rccxx . . $ grn_rc# grn_msgpack_unpack_array_internalcxx . . $ grn_msgpack_unpack_array_internal(2064671c2552b15a).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 86 | msgpack_object_arraycxx . . $ msgpack_object_array# *array, |
| 87 | grn_objcxx . . $ grn_obj# *vector); |
| 88 | # if MSGPACK_VERSION_MAJORcxx . . $ `<external>/1534749831535503406/version_master.h:1:9`! >= 1 |
| 89 | int64_tcxx . . $ int64_t# grn_msgpack_unpack_ext_time_internalcxx . . $ grn_msgpack_unpack_ext_time_internal(b5a3b184d2985a04).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 90 | msgpack_object_extcxx . . $ msgpack_object_ext# *ext); |
| 91 | # endif /* MSGPACK_VERSION_MAJOR >= 1 */ |
| 92 | |
| 93 | |
| 94 | #endif /* GRN_WITH_MESSAGE_PACK */ |