| 1 | /* |
| 2 | Copyright (C) 2009-2017 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 | #pragma once |
| 21 | |
| 22 | #include "grn.h"cxx . . $ `<file>/lib/grn.h`/ |
| 23 | |
| 24 | #ifdef __cplusplus |
| 25 | extern "C" { |
| 26 | #endif |
| 27 | |
| 28 | #define GRN_JSON_LOAD_OPEN_BRACKETcxx . . $ `lib/grn_load.h:28:9`! 0x40000000 |
| 29 | #define GRN_JSON_LOAD_OPEN_BRACEcxx . . $ `lib/grn_load.h:29:9`! 0x40000001 |
| 30 | |
| 31 | typedef struct grn_load_input_cxx . . $ grn_load_input_# { |
| 32 | grn_content_typecxx . . $ grn_content_type# typecxx . . $ grn_load_input_#type.; |
| 33 | grn_raw_stringcxx . . $ grn_raw_string# tablecxx . . $ grn_load_input_#table.; |
| 34 | grn_raw_stringcxx . . $ grn_raw_string# columnscxx . . $ grn_load_input_#columns.; |
| 35 | grn_raw_stringcxx . . $ grn_raw_string# valuescxx . . $ grn_load_input_#values.; |
| 36 | grn_raw_stringcxx . . $ grn_raw_string# if_existscxx . . $ grn_load_input_#if_exists.; |
| 37 | grn_raw_stringcxx . . $ grn_raw_string# eachcxx . . $ grn_load_input_#each.; |
| 38 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! output_idscxx . . $ grn_load_input_#output_ids.; |
| 39 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! output_errorscxx . . $ grn_load_input_#output_errors.; |
| 40 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! lock_tablecxx . . $ grn_load_input_#lock_table.; |
| 41 | uint32_tcxx . . $ uint32_t# emit_levelcxx . . $ grn_load_input_#emit_level.; |
| 42 | } grn_load_inputcxx . . $ grn_load_input#; |
| 43 | |
| 44 | void |
| 45 | grn_load_internalcxx . . $ grn_load_internal(31cfdf7af6a9a4ca).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_load_inputcxx . . $ grn_load_input# *input); |
| 46 | |
| 47 | typedef enumcxx . . $ $anonymous_type_504cda2014046ec0_0# { |
| 48 | GRN_LOADER_BEGINcxx . . $ GRN_LOADER_BEGIN. = 0, |
| 49 | GRN_LOADER_TOKENcxx . . $ GRN_LOADER_TOKEN., |
| 50 | GRN_LOADER_STRINGcxx . . $ GRN_LOADER_STRING., |
| 51 | GRN_LOADER_SYMBOLcxx . . $ GRN_LOADER_SYMBOL., |
| 52 | GRN_LOADER_NUMBERcxx . . $ GRN_LOADER_NUMBER., |
| 53 | GRN_LOADER_STRING_ESCcxx . . $ GRN_LOADER_STRING_ESC., |
| 54 | GRN_LOADER_UNICODE0cxx . . $ GRN_LOADER_UNICODE0., |
| 55 | GRN_LOADER_UNICODE1cxx . . $ GRN_LOADER_UNICODE1., |
| 56 | GRN_LOADER_UNICODE2cxx . . $ GRN_LOADER_UNICODE2., |
| 57 | GRN_LOADER_UNICODE3cxx . . $ GRN_LOADER_UNICODE3., |
| 58 | GRN_LOADER_ENDcxx . . $ GRN_LOADER_END. |
| 59 | } grn_loader_statcxx . . $ grn_loader_stat#; |
| 60 | |
| 61 | /* |
| 62 | * Status of target columns used in Format 1. |
| 63 | * Target columns are specified via --columns or the first array in a Format 1 |
| 64 | * JSON object. |
| 65 | */ |
| 66 | typedef enumcxx . . $ $anonymous_type_504cda2014046ec0_1# { |
| 67 | GRN_LOADER_COLUMNS_UNSETcxx . . $ GRN_LOADER_COLUMNS_UNSET. = 0, /* Columns are not available. */ |
| 68 | GRN_LOADER_COLUMNS_SETcxx . . $ GRN_LOADER_COLUMNS_SET., /* Columns are available. */ |
| 69 | GRN_LOADER_COLUMNS_BROKENcxx . . $ GRN_LOADER_COLUMNS_BROKEN. /* Columns are specified but broken. */ |
| 70 | } grn_loader_columns_statuscxx . . $ grn_loader_columns_status#; |
| 71 | |
| 72 | typedef structcxx . . $ $anonymous_type_504cda2014046ec0_2# { |
| 73 | grn_objcxx . . $ grn_obj# valuescxx . . $ $anonymous_type_504cda2014046ec0_2#values.; |
| 74 | grn_objcxx . . $ grn_obj# levelcxx . . $ $anonymous_type_504cda2014046ec0_2#level.; |
| 75 | grn_hashcxx . . $ grn_hash# *columnscxx . . $ $anonymous_type_504cda2014046ec0_2#columns.; |
| 76 | grn_objcxx . . $ grn_obj# rangescxx . . $ $anonymous_type_504cda2014046ec0_2#ranges.; |
| 77 | grn_objcxx . . $ grn_obj# indexescxx . . $ $anonymous_type_504cda2014046ec0_2#indexes.; |
| 78 | grn_objcxx . . $ grn_obj# idscxx . . $ $anonymous_type_504cda2014046ec0_2#ids.; |
| 79 | grn_objcxx . . $ grn_obj# return_codescxx . . $ $anonymous_type_504cda2014046ec0_2#return_codes.; |
| 80 | grn_objcxx . . $ grn_obj# error_messagescxx . . $ $anonymous_type_504cda2014046ec0_2#error_messages.; |
| 81 | uint32_tcxx . . $ uint32_t# emit_levelcxx . . $ $anonymous_type_504cda2014046ec0_2#emit_level.; |
| 82 | int32_tcxx . . $ int32_t# id_offsetcxx . . $ $anonymous_type_504cda2014046ec0_2#id_offset.; /* Position of _id in values or -1 if _id is N/A. */ |
| 83 | int32_tcxx . . $ int32_t# key_offsetcxx . . $ $anonymous_type_504cda2014046ec0_2#key_offset.; /* Position of _key in values or -1 if _key is N/A. */ |
| 84 | grn_objcxx . . $ grn_obj# *lastcxx . . $ $anonymous_type_504cda2014046ec0_2#last.; |
| 85 | grn_objcxx . . $ grn_obj# *tablecxx . . $ $anonymous_type_504cda2014046ec0_2#table.; |
| 86 | grn_objcxx . . $ grn_obj# *ifexistscxx . . $ $anonymous_type_504cda2014046ec0_2#ifexists.; |
| 87 | grn_objcxx . . $ grn_obj# *eachcxx . . $ $anonymous_type_504cda2014046ec0_2#each.; |
| 88 | uint32_tcxx . . $ uint32_t# unicharcxx . . $ $anonymous_type_504cda2014046ec0_2#unichar.; |
| 89 | uint32_tcxx . . $ uint32_t# unichar_hicxx . . $ $anonymous_type_504cda2014046ec0_2#unichar_hi.; |
| 90 | uint32_tcxx . . $ uint32_t# values_sizecxx . . $ $anonymous_type_504cda2014046ec0_2#values_size.; |
| 91 | uint32_tcxx . . $ uint32_t# n_recordscxx . . $ $anonymous_type_504cda2014046ec0_2#n_records.; |
| 92 | uint32_tcxx . . $ uint32_t# n_record_errorscxx . . $ $anonymous_type_504cda2014046ec0_2#n_record_errors.; |
| 93 | uint32_tcxx . . $ uint32_t# n_column_errorscxx . . $ $anonymous_type_504cda2014046ec0_2#n_column_errors.; |
| 94 | grn_loader_statcxx . . $ grn_loader_stat# statcxx . . $ $anonymous_type_504cda2014046ec0_2#stat.; |
| 95 | grn_content_typecxx . . $ grn_content_type# input_typecxx . . $ $anonymous_type_504cda2014046ec0_2#input_type.; |
| 96 | grn_loader_columns_statuscxx . . $ grn_loader_columns_status# columns_statuscxx . . $ $anonymous_type_504cda2014046ec0_2#columns_status.; |
| 97 | structcxx . . $ $anonymous_type_504cda2014046ec0_2#$anonymous_type_3# { |
| 98 | grn_rccxx . . $ grn_rc# rccxx . . $ $anonymous_type_504cda2014046ec0_2#$anonymous_type_3#rc.; |
| 99 | char buffercxx . . $ $anonymous_type_504cda2014046ec0_2#$anonymous_type_3#buffer.[GRN_CTX_MSGSIZEcxx . . $ `include/groonga/groonga.h:334:9`!]; |
| 100 | uint32_tcxx . . $ uint32_t# linecxx . . $ $anonymous_type_504cda2014046ec0_2#$anonymous_type_3#line.; |
| 101 | const char *filecxx . . $ $anonymous_type_504cda2014046ec0_2#$anonymous_type_3#file.; |
| 102 | const char *funccxx . . $ $anonymous_type_504cda2014046ec0_2#$anonymous_type_3#func.; |
| 103 | } errorcxx . . $ $anonymous_type_504cda2014046ec0_2#error.; |
| 104 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! output_idscxx . . $ $anonymous_type_504cda2014046ec0_2#output_ids.; |
| 105 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! output_errorscxx . . $ $anonymous_type_504cda2014046ec0_2#output_errors.; |
| 106 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! lock_tablecxx . . $ $anonymous_type_504cda2014046ec0_2#lock_table.; |
| 107 | } grn_loadercxx . . $ grn_loader#; |
| 108 | |
| 109 | typedef structcxx . . $ $anonymous_type_504cda2014046ec0_4# { |
| 110 | grn_objcxx . . $ grn_obj# *tablecxx . . $ $anonymous_type_504cda2014046ec0_4#table.; |
| 111 | uint32_tcxx . . $ uint32_t# depthcxx . . $ $anonymous_type_504cda2014046ec0_4#depth.; |
| 112 | grn_objcxx . . $ grn_obj# *record_valuecxx . . $ $anonymous_type_504cda2014046ec0_4#record_value.; |
| 113 | grn_idcxx . . $ grn_id# idcxx . . $ $anonymous_type_504cda2014046ec0_4#id.; |
| 114 | grn_objcxx . . $ grn_obj# *keycxx . . $ $anonymous_type_504cda2014046ec0_4#key.; |
| 115 | structcxx . . $ $anonymous_type_504cda2014046ec0_4#$anonymous_type_5# { |
| 116 | const char *column_namecxx . . $ $anonymous_type_504cda2014046ec0_4#$anonymous_type_5#column_name.; |
| 117 | uint32_tcxx . . $ uint32_t# column_name_sizecxx . . $ $anonymous_type_504cda2014046ec0_4#$anonymous_type_5#column_name_size.; |
| 118 | grn_objcxx . . $ grn_obj# *columncxx . . $ $anonymous_type_504cda2014046ec0_4#$anonymous_type_5#column.; |
| 119 | grn_objcxx . . $ grn_obj# *valuecxx . . $ $anonymous_type_504cda2014046ec0_4#$anonymous_type_5#value.; |
| 120 | } currentcxx . . $ $anonymous_type_504cda2014046ec0_4#current.; |
| 121 | } grn_loader_add_record_datacxx . . $ grn_loader_add_record_data#; |
| 122 | |
| 123 | void |
| 124 | grn_loader_save_errorcxx . . $ grn_loader_save_error(4e8e4ed50d4bb15).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_loadercxx . . $ grn_loader# *loader); |
| 125 | void |
| 126 | grn_loader_on_record_addedcxx . . $ grn_loader_on_record_added(e9b016172514d9b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_loadercxx . . $ grn_loader# *loader, grn_idcxx . . $ grn_id# id); |
| 127 | void |
| 128 | grn_loader_on_column_setcxx . . $ grn_loader_on_column_set(73ac9b8657a38d1d).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 129 | grn_loadercxx . . $ grn_loader# *loader, |
| 130 | grn_loader_add_record_datacxx . . $ grn_loader_add_record_data# *data); |
| 131 | void |
| 132 | grn_loader_on_no_identifier_errorcxx . . $ grn_loader_on_no_identifier_error(df34f5a449543ed6).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 133 | grn_loadercxx . . $ grn_loader# *loader, |
| 134 | grn_objcxx . . $ grn_obj# *table); |
| 135 | void |
| 136 | grn_loader_mergecxx . . $ grn_loader_merge(5ebbd2847b8db70e).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_loadercxx . . $ grn_loader# *loader, grn_loadercxx . . $ grn_loader# *loader_other); |
| 137 | grn_idcxx . . $ grn_id# |
| 138 | grn_loader_add_recordcxx . . $ grn_loader_add_record(450b3b927d098ef4).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 139 | grn_loadercxx . . $ grn_loader# *loader, |
| 140 | grn_loader_add_record_datacxx . . $ grn_loader_add_record_data# *data); |
| 141 | grn_objcxx . . $ grn_obj# * |
| 142 | grn_loader_get_columncxx . . $ grn_loader_get_column(dc36a02eec0a0be5).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 143 | grn_loadercxx . . $ grn_loader# *loader, |
| 144 | const char *name, |
| 145 | size_t name_length); |
| 146 | void |
| 147 | grn_loader_apply_eachcxx . . $ grn_loader_apply_each(e9b016172514d9b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_loadercxx . . $ grn_loader# *loader, grn_idcxx . . $ grn_id# id); |
| 148 | |
| 149 | void |
| 150 | grn_p_loadercxx . . $ grn_p_loader(4e8e4ed50d4bb15).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_loadercxx . . $ grn_loader# *loader); |
| 151 | |
| 152 | #ifdef __cplusplus |
| 153 | } |
| 154 | #endif |