| 1 | /* |
| 2 | Copyright (C) 2016-2018 Brazil |
| 3 | Copyright (C) 2019-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 | #ifdef __cplusplus |
| 23 | extern "C" { |
| 24 | #endif |
| 25 | |
| 26 | #define GRN_RAW_STRING_INITcxx . . $ `include/groonga/raw_string.h:26:9`!(string) do { \ |
| 27 | string.value = NULL; \ |
| 28 | string.length = 0; \ |
| 29 | } while (false) |
| 30 | |
| 31 | #define GRN_RAW_STRING_SETcxx . . $ `include/groonga/raw_string.h:31:9`!(string, bulk) do { \ |
| 32 | if (bulk && GRN_TEXT_LEN(bulk) > 0) { \ |
| 33 | string.value = GRN_TEXT_VALUE(bulk); \ |
| 34 | string.length = GRN_TEXT_LEN(bulk); \ |
| 35 | } else { \ |
| 36 | string.value = NULL; \ |
| 37 | string.length = 0; \ |
| 38 | } \ |
| 39 | } while (false) |
| 40 | |
| 41 | #define GRN_RAW_STRING_SET_CSTRINGcxx . . $ `include/groonga/raw_string.h:41:9`!(string, cstring) do { \ |
| 42 | string.value = cstring; \ |
| 43 | string.length = (cstring == NULL) ? 0 : strlen(cstring); \ |
| 44 | } while (false) |
| 45 | |
| 46 | #define GRN_RAW_STRING_FILLcxx . . $ `include/groonga/raw_string.h:46:9`!(string, bulk) do { \ |
| 47 | if (bulk && GRN_TEXT_LEN(bulk) > 0) { \ |
| 48 | string.value = GRN_TEXT_VALUE(bulk); \ |
| 49 | string.length = GRN_TEXT_LEN(bulk); \ |
| 50 | } \ |
| 51 | } while (false) |
| 52 | |
| 53 | #define GRN_RAW_STRING_EQUALcxx . . $ `include/groonga/raw_string.h:53:9`!(string, other_string) \ |
| 54 | (string.length == other_string.length && \ |
| 55 | memcmp(string.value, other_string.value, string.length) == 0) |
| 56 | |
| 57 | #define GRN_RAW_STRING_EQUAL_CSTRINGcxx . . $ `include/groonga/raw_string.h:57:9`!(string, cstring) \ |
| 58 | (cstring == NULL ? \ |
| 59 | (string.length == 0) : \ |
| 60 | (string.length == strlen(cstring) && \ |
| 61 | memcmp(string.value, cstring, string.length) == 0)) |
| 62 | |
| 63 | #define GRN_RAW_STRING_EQUAL_CSTRING_CIcxx . . $ `include/groonga/raw_string.h:63:9`!(string, cstring) \ |
| 64 | (cstring == NULL ? \ |
| 65 | (string.length == 0) : \ |
| 66 | (string.length == strlen(cstring) && \ |
| 67 | grn_strncasecmp(string.value, cstring, string.length) == 0)) |
| 68 | |
| 69 | #define GRN_RAW_STRING_START_WITH_CSTRINGcxx . . $ `include/groonga/raw_string.h:69:9`!(string, cstring) \ |
| 70 | (cstring == NULL ? \ |
| 71 | true : \ |
| 72 | (string.length >= strlen(cstring) && \ |
| 73 | memcmp(string.value, cstring, strlen(cstring)) == 0)) |
| 74 | |
| 75 | #define GRN_RAW_STRING_END_WITH_CSTRINGcxx . . $ `include/groonga/raw_string.h:75:9`!(string, cstring) \ |
| 76 | (cstring == NULL ? \ |
| 77 | true : \ |
| 78 | (string.length >= strlen(cstring) && \ |
| 79 | memcmp(string.value + string.length - strlen(cstring), \ |
| 80 | cstring, \ |
| 81 | strlen(cstring)) == 0)) |
| 82 | |
| 83 | typedef structcxx . . $ $anonymous_type_7f733dd816802915_0# { |
| 84 | const char *valuecxx . . $ $anonymous_type_7f733dd816802915_0#value.; |
| 85 | size_t lengthcxx . . $ $anonymous_type_7f733dd816802915_0#length.; |
| 86 | } grn_raw_stringcxx . . $ grn_raw_string#; |
| 87 | |
| 88 | GRN_APIcxx . . $ `lib/grn.h:84:13`! void grn_raw_string_lstripcxx . . $ grn_raw_string_lstrip(f337a808b82abe1c).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_raw_stringcxx . . $ grn_raw_string# *string); |
| 89 | GRN_APIcxx . . $ `lib/grn.h:84:13`! boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! |
| 90 | grn_raw_string_have_sub_stringcxx . . $ grn_raw_string_have_sub_string(96682bdc7a1a05f5).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 91 | grn_raw_stringcxx . . $ grn_raw_string# *string, |
| 92 | grn_raw_stringcxx . . $ grn_raw_string# *sub_string); |
| 93 | GRN_APIcxx . . $ `lib/grn.h:84:13`! boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! |
| 94 | grn_raw_string_have_sub_string_cstringcxx . . $ grn_raw_string_have_sub_string_cstring(a56e835ce94c1aaf).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 95 | grn_raw_stringcxx . . $ grn_raw_string# *string, |
| 96 | const char *sub_cstring); |
| 97 | GRN_APIcxx . . $ `lib/grn.h:84:13`! grn_raw_stringcxx . . $ grn_raw_string# |
| 98 | grn_raw_string_substringcxx . . $ grn_raw_string_substring(e1fbc62d3c6092da).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 99 | const grn_raw_stringcxx . . $ grn_raw_string# *string, |
| 100 | size_t start, |
| 101 | int64_tcxx . . $ int64_t# length); |
| 102 | |
| 103 | #ifdef __cplusplus |
| 104 | } |
| 105 | #endif |