Debian Codegraph @

lib/proc/proc_dump.c

raw symbols SCIP
1 /*
2 Copyright (C) 2009-2018 Brazil
3 Copyright (C) 2018-2026 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_proc.h"cxx . . $ `<file>/lib/grn_proc.h`/
21 #include "../grn_ctx_impl.h"cxx . . $ `<file>/lib/grn_ctx_impl.h`/
22 #include "../grn_db.h"cxx . . $ `<file>/lib/grn_db.h`/
23 #include "../grn_str.h"cxx . . $ `<file>/lib/grn_str.h`/
24
25 #include <groonga/plugin.h>cxx . . $ `<file>/include/groonga/plugin.h`/
26
27 static const size_t DUMP_FLUSH_THRESHOLD_SIZEcxx . . $ DUMP_FLUSH_THRESHOLD_SIZE. = 256 * 1024;
28
29 typedef structcxx . . $ $anonymous_type_32356ae70415b699_0# {
30 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! is_referredcxx . . $ $anonymous_type_32356ae70415b699_0#is_referred.;
31 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! have_data_columncxx . . $ $anonymous_type_32356ae70415b699_0#have_data_column.;
32 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! have_reference_columncxx . . $ $anonymous_type_32356ae70415b699_0#have_reference_column.;
33 } grn_dumper_table_statisticscxx . . $ grn_dumper_table_statistics#;
34
35 static void
36 grn_dumper_table_statistics_fincxx . . $ grn_dumper_table_statistics_fin(4e8d59a9cb2d43d5).(grn_ctxcxx . . $ grn_ctx# *ctx,
37 grn_dumper_table_statisticscxx . . $ grn_dumper_table_statistics# *statistics)
38 {
39 }
40
41 typedef structcxx . . $ $anonymous_type_32356ae70415b699_1# {
42 grn_objcxx . . $ grn_obj# *outputcxx . . $ $anonymous_type_32356ae70415b699_1#output.;
43 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.;
44 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! have_reference_columncxx . . $ $anonymous_type_32356ae70415b699_1#have_reference_column.;
45 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! have_index_columncxx . . $ $anonymous_type_32356ae70415b699_1#have_index_column.;
46 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! is_sort_hash_tablecxx . . $ $anonymous_type_32356ae70415b699_1#is_sort_hash_table.;
47 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! is_dump_pathscxx . . $ $anonymous_type_32356ae70415b699_1#is_dump_paths.;
48 grn_objcxx . . $ grn_obj# column_name_buffercxx . . $ $anonymous_type_32356ae70415b699_1#column_name_buffer.;
49 grn_hashcxx . . $ grn_hash# *table_statisticscxx . . $ $anonymous_type_32356ae70415b699_1#table_statistics.;
50 } grn_dumpercxx . . $ grn_dumper#;
51
52 static void
53 dumper_collect_statistics_tablecxx . . $ dumper_collect_statistics_table(f5c8d1b675cee56c).(grn_ctxcxx . . $ grn_ctx# *ctx,
54 grn_dumpercxx . . $ grn_dumper# *dumper,
55 grn_objcxx . . $ grn_obj# *table)
56 {
57 grn_dumper_table_statisticscxx . . $ grn_dumper_table_statistics# *statistics = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
58 void *value;
59 if (grn_hash_addcxx . . $ grn_hash_add(251a256fc515235e).(ctx,
60 dumper->table_statisticscxx . . $ $anonymous_type_32356ae70415b699_1#table_statistics.,
61 &(DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->idcxx . . $ $anonymous_type_4a7c1014017e4c5d_0#id.),
62 sizeof(grn_idcxx . . $ grn_id#),
63 &value,
64 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!) != GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!) {
65 statistics = value;
66 }
67
68 grn_hashcxx . . $ grn_hash# *columns = grn_hash_createcxx . . $ grn_hash_create(db1bba7e0d64660).(ctx,
69 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!,
70 sizeof(grn_idcxx . . $ grn_id#),
71 0,
72 GRN_OBJ_TABLE_HASH_KEYcxx . . $ `include/groonga/groonga.h:688:9`! | GRN_HASH_TINYcxx . . $ `include/groonga/hash.h:26:9`!);
73 if (!columns) {
74 return;
75 }
76
77 grn_table_columnscxx . . $ grn_table_columns(1e71eba22593aee7).(ctx, table, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, 0, (grn_objcxx . . $ grn_obj# *)columns);
78 GRN_HASH_EACH_BEGINcxx . . $ `include/groonga/hash.h:141:9`!(ctx, columns, cursor, id)
79 {
80 void *key;
81 grn_idcxx . . $ grn_id# column_id;
82 grn_objcxx . . $ grn_obj# *column;
83
84 grn_hash_cursor_get_keycxx . . $ grn_hash_cursor_get_key(248c0d78df691c42).(ctx, cursor, &key);
85 column_id = *((grn_idcxx . . $ grn_id# *)key);
86
87 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
88 grn_ctx_push_temporary_open_spacecxx . . $ grn_ctx_push_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
89 }
90
91 column = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, column_id);
92 if (!column) {
93 GRN_PLUGIN_CLEAR_ERRORcxx . . $ `include/groonga/plugin.h:148:9`!(ctx);
94 goto next_loop;
95 }
96
97 if (grn_obj_is_index_columncxx . . $ grn_obj_is_index_column(a5760e5c319a06ee).(ctx, column)) {
98 dumper->have_index_columncxx . . $ $anonymous_type_32356ae70415b699_1#have_index_column. = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
99 } else {
100 if (statistics) {
101 statistics->have_data_columncxx . . $ $anonymous_type_32356ae70415b699_0#have_data_column. = !grn_obj_is_token_columncxx . . $ grn_obj_is_token_column(a5760e5c319a06ee).(ctx, column);
102 }
103 if (grn_obj_is_reference_columncxx . . $ grn_obj_is_reference_column(a5760e5c319a06ee).(ctx, column)) {
104 dumper->have_reference_columncxx . . $ $anonymous_type_32356ae70415b699_1#have_reference_column. = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
105 if (statistics) {
106 statistics->have_reference_columncxx . . $ $anonymous_type_32356ae70415b699_0#have_reference_column. = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
107 }
108
109 void *value;
110 if (grn_hash_addcxx . . $ grn_hash_add(251a256fc515235e).(ctx,
111 dumper->table_statisticscxx . . $ $anonymous_type_32356ae70415b699_1#table_statistics.,
112 &(DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(column)->rangecxx . . $ $anonymous_type_4a7c1014017e4c5d_0#range.),
113 sizeof(grn_idcxx . . $ grn_id#),
114 &value,
115 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!) != GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!) {
116 grn_dumper_table_statisticscxx . . $ grn_dumper_table_statistics# *referred_statistics = value;
117 referred_statistics->is_referredcxx . . $ $anonymous_type_32356ae70415b699_0#is_referred. = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
118 }
119 }
120 }
121
122 next_loop:
123 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
124 grn_ctx_pop_temporary_open_spacecxx . . $ grn_ctx_pop_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
125 }
126 }
127 GRN_HASH_EACH_ENDcxx . . $ `include/groonga/hash.h:159:9`!(ctx, cursor);
128 grn_hash_closecxx . . $ grn_hash_close(c005d027d163fb0b).(ctx, columns);
129 }
130
131 static void
132 dumper_collect_statisticscxx . . $ dumper_collect_statistics(5306d516c392a7cf).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_dumpercxx . . $ grn_dumper# *dumper)
133 {
134 dumper->table_statisticscxx . . $ $anonymous_type_32356ae70415b699_1#table_statistics. =
135 grn_hash_createcxx . . $ grn_hash_create(db1bba7e0d64660).(ctx,
136 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!,
137 sizeof(grn_idcxx . . $ grn_id#),
138 sizeof(grn_dumper_table_statisticscxx . . $ grn_dumper_table_statistics#),
139 GRN_OBJ_TABLE_HASH_KEYcxx . . $ `include/groonga/groonga.h:688:9`! | GRN_HASH_TINYcxx . . $ `include/groonga/hash.h:26:9`!);
140
141 GRN_DB_EACH_BEGIN_BY_IDcxx . . $ `include/groonga/db.h:136:9`!(ctx, cursor, id)
142 {
143 void *name;
144 int name_size;
145 grn_objcxx . . $ grn_obj# *object;
146
147 if (grn_id_is_builtincxx . . $ grn_id_is_builtin(a2a496425acc5b40).(ctx, id)) {
148 continue;
149 }
150
151 name_size = grn_table_cursor_get_keycxx . . $ grn_table_cursor_get_key(7d620ebe94cee13a).(ctx, cursor, &name);
152 if (grn_obj_name_is_columncxx . . $ grn_obj_name_is_column(da3161f0ad1ba10a).(ctx, name, name_size)) {
153 continue;
154 }
155
156 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
157 grn_ctx_push_temporary_open_spacecxx . . $ grn_ctx_push_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
158 }
159
160 object = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, id);
161 if (!object) {
162 /* XXX: this clause is executed when MeCab tokenizer is enabled in
163 database but the groonga isn't supported MeCab.
164 We should return error message about it and error exit status
165 but it's too difficult for this architecture. :< */
166 GRN_PLUGIN_CLEAR_ERRORcxx . . $ `include/groonga/plugin.h:148:9`!(ctx);
167 goto next_loop;
168 }
169
170 if (!grn_obj_is_tablecxx . . $ grn_obj_is_table(a5760e5c319a06ee).(ctx, object)) {
171 goto next_loop;
172 }
173
174 dumper_collect_statistics_tablecxx . . $ dumper_collect_statistics_table(f5c8d1b675cee56c).(ctx, dumper, object);
175
176 next_loop:
177 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
178 grn_ctx_pop_temporary_open_spacecxx . . $ grn_ctx_pop_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
179 }
180 }
181 GRN_DB_EACH_ENDcxx . . $ `include/groonga/db.h:148:9`!(ctx, cursor);
182 }
183
184 static void
185 dump_value_rawcxx . . $ dump_value_raw(c88feed231e1aa6c).(grn_ctxcxx . . $ grn_ctx# *ctx,
186 grn_objcxx . . $ grn_obj# *output,
187 const char *value,
188 size_t value_len)
189 {
190 grn_objcxx . . $ grn_obj# escaped_value;
191 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&escaped_value, 0);
192 grn_text_esccxx . . $ grn_text_esc(4609c18fd87cf054).(ctx, &escaped_value, value, value_len);
193 /* is no character escaped? */
194 /* TODO false positive with spaces inside values */
195 if (GRN_TEXT_LENcxx . . $ `include/groonga/groonga.h:2786:9`!(&escaped_value) == (value_len + 2)) {
196 GRN_TEXT_PUTcxx . . $ `include/groonga/groonga.h:2773:9`!(ctx, output, value, value_len);
197 } else {
198 GRN_TEXT_PUTcxx . . $ `include/groonga/groonga.h:2773:9`!(ctx,
199 output,
200 GRN_TEXT_VALUEcxx . . $ `include/groonga/groonga.h:2785:9`!(&escaped_value),
201 GRN_TEXT_LENcxx . . $ `include/groonga/groonga.h:2786:9`!(&escaped_value));
202 }
203 grn_obj_closecxx . . $ grn_obj_close(4865d068a46d0f83).(ctx, &escaped_value);
204 }
205
206 static void
207 dump_valuecxx . . $ dump_value(dfc144edcd50b228).(grn_ctxcxx . . $ grn_ctx# *ctx,
208 grn_dumpercxx . . $ grn_dumper# *dumper,
209 const char *value,
210 size_t value_len)
211 {
212 dump_value_rawcxx . . $ dump_value_raw(c88feed231e1aa6c).(ctx, dumper->outputcxx . . $ $anonymous_type_32356ae70415b699_1#output., value, value_len);
213 }
214
215 static void
216 dump_configscxx . . $ dump_configs(5306d516c392a7cf).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_dumpercxx . . $ grn_dumper# *dumper)
217 {
218 grn_objcxx . . $ grn_obj# *config_cursor;
219
220 config_cursor = grn_config_cursor_opencxx . . $ grn_config_cursor_open(ddec8e3b1327ceae).(ctx);
221 if (!config_cursor) return;
222
223 while (grn_config_cursor_nextcxx . . $ grn_config_cursor_next(a5760e5c319a06ee).(ctx, config_cursor)) {
224 const char *key;
225 uint32_tcxx . . $ uint32_t# key_size;
226 const char *value;
227 uint32_tcxx . . $ uint32_t# value_size;
228
229 key_size = grn_config_cursor_get_keycxx . . $ grn_config_cursor_get_key(4d6594c229367d9b).(ctx, config_cursor, &key);
230 value_size = grn_config_cursor_get_valuecxx . . $ grn_config_cursor_get_value(4d6594c229367d9b).(ctx, config_cursor, &value);
231
232 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, dumper->output, "config_set ");
233 dump_valuecxx . . $ dump_value(dfc144edcd50b228).(ctx, dumper, key, key_size);
234 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, dumper->output, " ");
235 dump_valuecxx . . $ dump_value(dfc144edcd50b228).(ctx, dumper, value, value_size);
236 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, dumper->output, '\n');
237 }
238 grn_obj_closecxx . . $ grn_obj_close(4865d068a46d0f83).(ctx, config_cursor);
239 }
240
241 static void
242 dump_pluginscxx . . $ dump_plugins(5306d516c392a7cf).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_dumpercxx . . $ grn_dumper# *dumper)
243 {
244 grn_objcxx . . $ grn_obj# plugin_names;
245 unsigned int i, n;
246
247 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&plugin_names, GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!);
248
249 grn_plugin_get_namescxx . . $ grn_plugin_get_names(4865d068a46d0f83).(ctx, &plugin_names);
250
251 n = grn_vector_sizecxx . . $ grn_vector_size(8dd58acc9865e889).(ctx, &plugin_names);
252 if (n == 0) {
253 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &plugin_names);
254 return;
255 }
256
257 if (GRN_TEXT_LENcxx . . $ `include/groonga/groonga.h:2786:9`!(dumper->output) > 0) {
258 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, dumper->output, '\n');
259 grn_ctx_output_flushcxx . . $ grn_ctx_output_flush(55555b1fc84b4259).(ctx, 0);
260 }
261 for (i = 0; i < n; i++) {
262 const char *name;
263 unsigned int name_size;
264
265 name_size =
266 grn_vector_get_elementcxx . . $ grn_vector_get_element(744613554bd9830c).(ctx, &plugin_names, i, &name, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
267 grn_text_printfcxx . . $ grn_text_printf(34596149d4dc0292).(ctx,
268 dumper->outputcxx . . $ $anonymous_type_32356ae70415b699_1#output.,
269 "plugin_register %.*s\n",
270 (int)name_size,
271 name);
272 }
273
274 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &plugin_names);
275 }
276
277 static void
278 dump_obj_name_rawcxx . . $ dump_obj_name_raw(99eba0d3a8372d65).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *output, grn_objcxx . . $ grn_obj# *obj)
279 {
280 char name[GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!];
281 int name_len;
282 name_len = grn_obj_namecxx . . $ grn_obj_name(a51d1bff955f2f21).(ctx, obj, name, GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!);
283 dump_value_rawcxx . . $ dump_value_raw(c88feed231e1aa6c).(ctx, output, name, (size_t)name_len);
284 }
285
286 static void
287 dump_obj_namecxx . . $ dump_obj_name(f5c8d1b675cee56c).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_dumpercxx . . $ grn_dumper# *dumper, grn_objcxx . . $ grn_obj# *obj)
288 {
289 dump_obj_name_rawcxx . . $ dump_obj_name_raw(99eba0d3a8372d65).(ctx, dumper->outputcxx . . $ $anonymous_type_32356ae70415b699_1#output., obj);
290 }
291
292 static void
293 dump_column_namecxx . . $ dump_column_name(f5c8d1b675cee56c).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_dumpercxx . . $ grn_dumper# *dumper, grn_objcxx . . $ grn_obj# *column)
294 {
295 char name[GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!];
296 int name_len;
297 name_len = grn_column_namecxx . . $ grn_column_name(a51d1bff955f2f21).(ctx, column, name, GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!);
298 dump_valuecxx . . $ dump_value(dfc144edcd50b228).(ctx, dumper, name, (size_t)name_len);
299 }
300
301 static void
302 dump_column_sourcescxx . . $ dump_column_sources(f5c8d1b675cee56c).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_dumpercxx . . $ grn_dumper# *dumper, grn_objcxx . . $ grn_obj# *column)
303 {
304 grn_objcxx . . $ grn_obj# sources;
305 grn_idcxx . . $ grn_id# *source_ids;
306 size_t i, n;
307
308 GRN_OBJ_INITcxx . . $ `include/groonga/groonga.h:947:9`!(&sources, GRN_BULKcxx . . $ `include/groonga/groonga.h:868:9`!, 0, GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!);
309 grn_obj_get_infocxx . . $ grn_obj_get_info(333a81d4a8f20670).(ctx, column, GRN_INFO_SOURCEcxx . . $ GRN_INFO_SOURCE., &sources);
310
311 n = GRN_BULK_VSIZEcxx . . $ `include/groonga/groonga.h:2642:9`!(&sources) / sizeof(grn_idcxx . . $ grn_id#);
312 source_ids = (grn_idcxx . . $ grn_id# *)GRN_BULK_HEADcxx . . $ `include/groonga/groonga.h:2648:9`!(&sources);
313 if (n > 0) {
314 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, dumper->output, ' ');
315 }
316 for (i = 0; i < n; i++) {
317 grn_idcxx . . $ grn_id# source_id;
318 grn_objcxx . . $ grn_obj# *source;
319
320 source_id = *source_ids;
321 source_ids++;
322
323 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
324 grn_ctx_push_temporary_open_spacecxx . . $ grn_ctx_push_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
325 }
326
327 source = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, source_id);
328 if (!source) {
329 goto next_loop;
330 }
331
332 if (i) {
333 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, dumper->output, ',');
334 }
335 switch (source->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type.) {
336 case GRN_TABLE_PAT_KEYcxx . . $ `include/groonga/groonga.h:896:9`!:
337 case GRN_TABLE_DAT_KEYcxx . . $ `include/groonga/groonga.h:897:9`!:
338 case GRN_TABLE_HASH_KEYcxx . . $ `include/groonga/groonga.h:895:9`!:
339 GRN_TEXT_PUTcxx . . $ `include/groonga/groonga.h:2773:9`!(ctx,
340 dumper->output,
341 GRN_COLUMN_NAME_KEYcxx . . $ `include/groonga/column.h:63:9`!,
342 GRN_COLUMN_NAME_KEY_LENcxx . . $ `include/groonga/column.h:72:9`!);
343 break;
344 default:
345 dump_column_namecxx . . $ dump_column_name(f5c8d1b675cee56c).(ctx, dumper, source);
346 break;
347 }
348
349 next_loop:
350 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
351 grn_ctx_pop_temporary_open_spacecxx . . $ grn_ctx_pop_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
352 }
353 }
354 grn_obj_closecxx . . $ grn_obj_close(4865d068a46d0f83).(ctx, &sources);
355 }
356
357 static void
358 dump_stringcxx . . $ dump_string(f5c8d1b675cee56c).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_dumpercxx . . $ grn_dumper# *dumper, grn_objcxx . . $ grn_obj# *string)
359 {
360 const char *value = GRN_TEXT_VALUEcxx . . $ `include/groonga/groonga.h:2785:9`!(string);
361 size_t length = GRN_TEXT_LENcxx . . $ `include/groonga/groonga.h:2786:9`!(string);
362
363 if (grn_proc_text_include_special_charactercxx . . $ grn_proc_text_include_special_character(d50236b64f2b1e59).(ctx, value, length)) {
364 grn_text_otojcxx . . $ grn_text_otoj(1909183af06c6849).(ctx, dumper->outputcxx . . $ $anonymous_type_32356ae70415b699_1#output., string, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
365 } else {
366 GRN_TEXT_PUTcxx . . $ `include/groonga/groonga.h:2773:9`!(ctx, dumper->output, value, length);
367 }
368 }
369
370 static void
371 dump_column_generatorcxx . . $ dump_column_generator(f5c8d1b675cee56c).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_dumpercxx . . $ grn_dumper# *dumper, grn_objcxx . . $ grn_obj# *column)
372 {
373 grn_objcxx . . $ grn_obj# generator;
374 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&generator, 0);
375 grn_obj_get_infocxx . . $ grn_obj_get_info(333a81d4a8f20670).(ctx, column, GRN_INFO_GENERATORcxx . . $ GRN_INFO_GENERATOR., &generator);
376 if (GRN_TEXT_LENcxx . . $ `include/groonga/groonga.h:2786:9`!(&generator) > 0) {
377 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, dumper->output, " --generator ");
378 dump_stringcxx . . $ dump_string(f5c8d1b675cee56c).(ctx, dumper, &generator);
379 }
380 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &generator);
381 }
382
383 static void
384 dump_columncxx . . $ dump_column(b5626a230e3bf23c).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_dumpercxx . . $ grn_dumper# *dumper, grn_objcxx . . $ grn_obj# *table, grn_objcxx . . $ grn_obj# *column)
385 {
386 grn_idcxx . . $ grn_id# type_id;
387 grn_objcxx . . $ grn_obj# *type;
388 grn_column_flagscxx . . $ grn_column_flags# flags;
389 grn_column_flagscxx . . $ grn_column_flags# default_flags = GRN_OBJ_PERSISTENTcxx . . $ `include/groonga/groonga.h:827:9`!;
390
391 type_id = grn_obj_get_rangecxx . . $ grn_obj_get_range(8dd58acc9865e889).(ctx, column);
392 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
393 grn_ctx_push_temporary_open_spacecxx . . $ grn_ctx_push_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
394 }
395 type = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, type_id);
396 if (!type) {
397 /* ERR(GRN_RANGE_ERROR, "couldn't get column's type object"); */
398 goto exit;
399 }
400
401 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, dumper->output, "column_create ");
402 dump_obj_namecxx . . $ dump_obj_name(f5c8d1b675cee56c).(ctx, dumper, table);
403 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, dumper->output, ' ');
404 dump_column_namecxx . . $ dump_column_name(f5c8d1b675cee56c).(ctx, dumper, column);
405 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, dumper->output, ' ');
406 if (type->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type. == GRN_TYPEcxx . . $ `include/groonga/groonga.h:892:9`!) {
407 default_flags |= type->headercxx . . $ _grn_obj#header..flagscxx . . $ _grn_obj_header#flags.;
408 }
409 flags = grn_column_get_flagscxx . . $ grn_column_get_flags(8dd58acc9865e889).(ctx, column);
410 grn_dump_column_create_flagscxx . . $ grn_dump_column_create_flags(e6d1f76f34fc094d).(ctx, flags & ~default_flags, dumper->outputcxx . . $ $anonymous_type_32356ae70415b699_1#output.);
411 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, dumper->output, ' ');
412 dump_obj_namecxx . . $ dump_obj_name(f5c8d1b675cee56c).(ctx, dumper, type);
413 switch (column->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type.) {
414 case GRN_COLUMN_VAR_SIZEcxx . . $ `include/groonga/groonga.h:901:9`!:
415 case GRN_COLUMN_INDEXcxx . . $ `include/groonga/groonga.h:902:9`!:
416 dump_column_sourcescxx . . $ dump_column_sources(f5c8d1b675cee56c).(ctx, dumper, column);
417 break;
418 }
419 switch (column->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type.) {
420 case GRN_COLUMN_VAR_SIZEcxx . . $ `include/groonga/groonga.h:901:9`!:
421 dump_column_generatorcxx . . $ dump_column_generator(f5c8d1b675cee56c).(ctx, dumper, column);
422 break;
423 }
424 if ((flags & GRN_OBJ_CUSTOM_NAMEcxx . . $ `lib/grn_db.h:552:9`!) && dumper->is_dump_pathscxx . . $ $anonymous_type_32356ae70415b699_1#is_dump_paths.) {
425 grn_objcxx . . $ grn_obj# sub_output;
426 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, dumper->output, " --path ");
427 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&sub_output, GRN_OBJ_DO_SHALLOW_COPYcxx . . $ `include/groonga/groonga.h:2732:9`!);
428 const char *path = grn_obj_pathcxx . . $ grn_obj_path(ab3dda79dad54815).(ctx, column);
429 GRN_TEXT_SETScxx . . $ `include/groonga/groonga.h:2783:9`!(ctx, &sub_output, path);
430 dump_stringcxx . . $ dump_string(f5c8d1b675cee56c).(ctx, dumper, &sub_output);
431 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &sub_output);
432 }
433 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, dumper->output, '\n');
434
435 exit:
436 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
437 grn_ctx_pop_temporary_open_spacecxx . . $ grn_ctx_pop_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
438 }
439 }
440
441 static void
442 dump_columnscxx . . $ dump_columns(15a38d3eb9bde23c).(grn_ctxcxx . . $ grn_ctx# *ctx,
443 grn_dumpercxx . . $ grn_dumper# *dumper,
444 grn_objcxx . . $ grn_obj# *table,
445 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! dump_data_column,
446 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! dump_reference_column,
447 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! dump_index_column)
448 {
449 grn_hashcxx . . $ grn_hash# *columns;
450 columns = grn_hash_createcxx . . $ grn_hash_create(db1bba7e0d64660).(ctx,
451 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!,
452 sizeof(grn_idcxx . . $ grn_id#),
453 0,
454 GRN_OBJ_TABLE_HASH_KEYcxx . . $ `include/groonga/groonga.h:688:9`! | GRN_HASH_TINYcxx . . $ `include/groonga/hash.h:26:9`!);
455 if (!columns) {
456 GRN_PLUGIN_ERRORcxx . . $ `include/groonga/plugin.h:145:9`!(ctx,
457 GRN_NO_MEMORY_AVAILABLE,
458 "couldn't create a hash to hold columns");
459 return;
460 }
461
462 if (grn_table_columnscxx . . $ grn_table_columns(1e71eba22593aee7).(ctx, table, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, 0, (grn_objcxx . . $ grn_obj# *)columns) >= 0) {
463 GRN_HASH_EACH_BEGINcxx . . $ `include/groonga/hash.h:141:9`!(ctx, columns, cursor, id)
464 {
465 void *key;
466 grn_idcxx . . $ grn_id# column_id;
467 grn_objcxx . . $ grn_obj# *column;
468
469 grn_hash_cursor_get_keycxx . . $ grn_hash_cursor_get_key(248c0d78df691c42).(ctx, cursor, &key);
470 column_id = *((grn_idcxx . . $ grn_id# *)key);
471
472 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
473 grn_ctx_push_temporary_open_spacecxx . . $ grn_ctx_push_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
474 }
475
476 column = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, column_id);
477 if (!column) {
478 GRN_PLUGIN_CLEAR_ERRORcxx . . $ `include/groonga/plugin.h:148:9`!(ctx);
479 goto next_loop;
480 }
481
482 if (grn_obj_is_index_columncxx . . $ grn_obj_is_index_column(a5760e5c319a06ee).(ctx, column)) {
483 if (dump_index_column) {
484 dump_columncxx . . $ dump_column(b5626a230e3bf23c).(ctx, dumper, table, column);
485 GRN_PLUGIN_CLEAR_ERRORcxx . . $ `include/groonga/plugin.h:148:9`!(ctx);
486 }
487 } else if (grn_obj_is_reference_columncxx . . $ grn_obj_is_reference_column(a5760e5c319a06ee).(ctx, column)) {
488 if (dump_reference_column) {
489 dump_columncxx . . $ dump_column(b5626a230e3bf23c).(ctx, dumper, table, column);
490 GRN_PLUGIN_CLEAR_ERRORcxx . . $ `include/groonga/plugin.h:148:9`!(ctx);
491 }
492 } else {
493 if (dump_data_column) {
494 dump_columncxx . . $ dump_column(b5626a230e3bf23c).(ctx, dumper, table, column);
495 GRN_PLUGIN_CLEAR_ERRORcxx . . $ `include/groonga/plugin.h:148:9`!(ctx);
496 }
497 }
498
499 next_loop:
500 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
501 grn_ctx_pop_temporary_open_spacecxx . . $ grn_ctx_pop_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
502 }
503 }
504 GRN_HASH_EACH_ENDcxx . . $ `include/groonga/hash.h:159:9`!(ctx, cursor);
505 }
506 grn_hash_closecxx . . $ grn_hash_close(c005d027d163fb0b).(ctx, columns);
507 }
508
509 static void
510 dump_record_column_vectorcxx . . $ dump_record_column_vector(86025d7ec0561f65).(grn_ctxcxx . . $ grn_ctx# *ctx,
511 grn_dumpercxx . . $ grn_dumper# *dumper,
512 grn_idcxx . . $ grn_id# id,
513 grn_objcxx . . $ grn_obj# *column,
514 grn_idcxx . . $ grn_id# range_id,
515 grn_objcxx . . $ grn_obj# *buf)
516 {
517 grn_objcxx . . $ grn_obj# *range;
518 grn_obj_formatcxx . . $ grn_obj_format# *format_argument = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
519 grn_obj_formatcxx . . $ grn_obj_format# format;
520
521 range = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, range_id);
522 grn_column_flagscxx . . $ grn_column_flags# column_flags = grn_column_get_flagscxx . . $ grn_column_get_flags(8dd58acc9865e889).(ctx, column);
523 if (column_flags & GRN_OBJ_WITH_WEIGHTcxx . . $ `include/groonga/groonga.h:785:9`!) {
524 format.flagscxx . . $ _grn_obj_format#flags. = GRN_OBJ_FORMAT_WITH_WEIGHTcxx . . $ `include/groonga/output.h:33:9`!;
525 if (column_flags & (GRN_OBJ_WEIGHT_FLOAT32cxx . . $ `include/groonga/groonga.h:838:9`! | GRN_OBJ_WEIGHT_BFLOAT16cxx . . $ `include/groonga/groonga.h:796:9`!)) {
526 format.flagscxx . . $ _grn_obj_format#flags. |= GRN_OBJ_FORMAT_WEIGHT_FLOAT32cxx . . $ `include/groonga/output.h:36:9`!;
527 }
528 format_argument = &format;
529 }
530
531 if (grn_obj_is_tablecxx . . $ grn_obj_is_table(a5760e5c319a06ee).(ctx, range) ||
532 (range->headercxx . . $ _grn_obj#header..flagscxx . . $ _grn_obj_header#flags. & GRN_OBJ_KEY_VAR_SIZEcxx . . $ `include/groonga/groonga.h:820:9`!) == 0) {
533 GRN_OBJ_INITcxx . . $ `include/groonga/groonga.h:947:9`!(buf, GRN_UVECTORcxx . . $ `include/groonga/groonga.h:875:9`!, 0, range_id);
534 grn_obj_get_valuecxx . . $ grn_obj_get_value(6e06fec66698a6a).(ctx, column, id, buf);
535 grn_text_otojcxx . . $ grn_text_otoj(1909183af06c6849).(ctx, dumper->outputcxx . . $ $anonymous_type_32356ae70415b699_1#output., buf, format_argument);
536 } else {
537 GRN_OBJ_INITcxx . . $ `include/groonga/groonga.h:947:9`!(buf, GRN_VECTORcxx . . $ `include/groonga/groonga.h:877:9`!, 0, range_id);
538 grn_obj_get_valuecxx . . $ grn_obj_get_value(6e06fec66698a6a).(ctx, column, id, buf);
539 grn_text_otojcxx . . $ grn_text_otoj(1909183af06c6849).(ctx, dumper->outputcxx . . $ $anonymous_type_32356ae70415b699_1#output., buf, format_argument);
540 }
541
542 grn_obj_unlinkcxx . . $ grn_obj_unlink(4865d068a46d0f83).(ctx, range);
543 grn_obj_unlinkcxx . . $ grn_obj_unlink(4865d068a46d0f83).(ctx, buf);
544 }
545
546 static void
547 dump_recordcxx . . $ dump_record(b89f66b648a298da).(grn_ctxcxx . . $ grn_ctx# *ctx,
548 grn_dumpercxx . . $ grn_dumper# *dumper,
549 grn_objcxx . . $ grn_obj# *table,
550 grn_idcxx . . $ grn_id# id,
551 grn_objcxx . . $ grn_obj# *columns,
552 size_t n_columns)
553 {
554 size_t i;
555 grn_objcxx . . $ grn_obj# buf;
556 grn_objcxx . . $ grn_obj# *column_name = &(dumper->column_name_buffercxx . . $ $anonymous_type_32356ae70415b699_1#column_name_buffer.);
557
558 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, dumper->output, '[');
559 for (i = 0; i < n_columns; i++) {
560 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! is_value_column;
561 grn_idcxx . . $ grn_id# range;
562 grn_objcxx . . $ grn_obj# *column;
563 column = GRN_PTR_VALUE_ATcxx . . $ `include/groonga/groonga.h:3150:9`!(columns, i);
564 /* TODO: use grn_obj_is_value_accessor() */
565 GRN_BULK_REWINDcxx . . $ `include/groonga/groonga.h:2599:9`!(column_name);
566 grn_column_name_cxx . . $ grn_column_name_(d825b4ed5bf12304).(ctx, column, column_name);
567 if (GRN_TEXT_LENcxx . . $ `include/groonga/groonga.h:2786:9`!(column_name) == GRN_COLUMN_NAME_VALUE_LENcxx . . $ `include/groonga/column.h:93:9`! &&
568 !memcmpcxx . . $ memcmp(36f949851efa3055).(GRN_TEXT_VALUEcxx . . $ `include/groonga/groonga.h:2785:9`!(column_name),
569 GRN_COLUMN_NAME_VALUEcxx . . $ `include/groonga/column.h:84:9`!,
570 GRN_COLUMN_NAME_VALUE_LENcxx . . $ `include/groonga/column.h:93:9`!)) {
571 is_value_column = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
572 } else {
573 is_value_column = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
574 }
575 range = grn_obj_get_rangecxx . . $ grn_obj_get_range(8dd58acc9865e889).(ctx, column);
576
577 if (i > 0) {
578 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, dumper->output, ',');
579 }
580 switch (column->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type.) {
581 case GRN_COLUMN_VAR_SIZEcxx . . $ `include/groonga/groonga.h:901:9`!:
582 case GRN_COLUMN_FIX_SIZEcxx . . $ `include/groonga/groonga.h:900:9`!:
583 switch (column->headercxx . . $ _grn_obj#header..flagscxx . . $ _grn_obj_header#flags. & GRN_OBJ_COLUMN_TYPE_MASKcxx . . $ `include/groonga/groonga.h:726:9`!) {
584 case GRN_OBJ_COLUMN_VECTORcxx . . $ `include/groonga/groonga.h:736:9`!:
585 dump_record_column_vectorcxx . . $ dump_record_column_vector(86025d7ec0561f65).(ctx, dumper, id, column, range, &buf);
586 break;
587 case GRN_OBJ_COLUMN_SCALARcxx . . $ `include/groonga/groonga.h:731:9`!:
588 {
589 GRN_OBJ_INITcxx . . $ `include/groonga/groonga.h:947:9`!(&buf, GRN_BULKcxx . . $ `include/groonga/groonga.h:868:9`!, 0, range);
590 grn_obj_get_valuecxx . . $ grn_obj_get_value(6e06fec66698a6a).(ctx, column, id, &buf);
591 grn_text_otojcxx . . $ grn_text_otoj(1909183af06c6849).(ctx, dumper->outputcxx . . $ $anonymous_type_32356ae70415b699_1#output., &buf, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
592 grn_obj_unlinkcxx . . $ grn_obj_unlink(4865d068a46d0f83).(ctx, &buf);
593 }
594 break;
595 default:
596 GRN_PLUGIN_ERRORcxx . . $ `include/groonga/plugin.h:145:9`!(ctx,
597 GRN_OPERATION_NOT_SUPPORTED,
598 "unsupported column type: %#x",
599 column->header.type);
600 break;
601 }
602 break;
603 case GRN_COLUMN_INDEXcxx . . $ `include/groonga/groonga.h:902:9`!:
604 break;
605 case GRN_ACCESSORcxx . . $ `include/groonga/groonga.h:880:9`!:
606 {
607 GRN_OBJ_INITcxx . . $ `include/groonga/groonga.h:947:9`!(&buf, GRN_BULKcxx . . $ `include/groonga/groonga.h:868:9`!, 0, range);
608 grn_obj_get_valuecxx . . $ grn_obj_get_value(6e06fec66698a6a).(ctx, column, id, &buf);
609 /* XXX maybe, grn_obj_get_range() should not unconditionally return
610 GRN_DB_INT32 when column is GRN_ACCESSOR and
611 GRN_ACCESSOR_GET_VALUE */
612 if (is_value_column) {
613 buf.headercxx . . $ _grn_obj#header..domaincxx . . $ _grn_obj_header#domain. = grn_obj_get_rangecxx . . $ grn_obj_get_range(8dd58acc9865e889).(ctx, table);
614 }
615 grn_text_otojcxx . . $ grn_text_otoj(1909183af06c6849).(ctx, dumper->outputcxx . . $ $anonymous_type_32356ae70415b699_1#output., &buf, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
616 grn_obj_unlinkcxx . . $ grn_obj_unlink(4865d068a46d0f83).(ctx, &buf);
617 }
618 break;
619 default:
620 GRN_PLUGIN_ERRORcxx . . $ `include/groonga/plugin.h:145:9`!(ctx,
621 GRN_OPERATION_NOT_SUPPORTED,
622 "unsupported header type %#x",
623 column->header.type);
624 break;
625 }
626 }
627 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, dumper->output, ']');
628 if (GRN_TEXT_LENcxx . . $ `include/groonga/groonga.h:2786:9`!(dumper->output) >= DUMP_FLUSH_THRESHOLD_SIZEcxx . . $ DUMP_FLUSH_THRESHOLD_SIZE.) {
629 grn_ctx_output_flushcxx . . $ grn_ctx_output_flush(55555b1fc84b4259).(ctx, 0);
630 }
631 }
632
633 static void
634 dump_recordscxx . . $ dump_records(3695053725632923).(grn_ctxcxx . . $ grn_ctx# *ctx,
635 grn_dumpercxx . . $ grn_dumper# *dumper,
636 grn_objcxx . . $ grn_obj# *table,
637 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! dump_real_columns)
638 {
639 grn_table_cursorcxx . . $ grn_table_cursor# *cursor;
640 grn_objcxx . . $ grn_obj# columns;
641 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! have_auto_generated_value_column = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
642 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! have_data_column = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
643
644 if (grn_table_sizecxx . . $ grn_table_size(8dd58acc9865e889).(ctx, table) == 0) {
645 return;
646 }
647
648 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
649 grn_ctx_push_temporary_open_spacecxx . . $ grn_ctx_push_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
650 }
651
652 GRN_PTR_INITcxx . . $ `include/groonga/groonga.h:2869:9`!(&columns, GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!, GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!);
653
654 if (table->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type. == GRN_TABLE_NO_KEYcxx . . $ `include/groonga/groonga.h:898:9`!) {
655 grn_objcxx . . $ grn_obj# *id_accessor;
656 id_accessor =
657 grn_obj_columncxx . . $ grn_obj_column(c00e49795c44129a).(ctx, table, GRN_COLUMN_NAME_IDcxx . . $ `include/groonga/column.h:41:9`!, GRN_COLUMN_NAME_ID_LENcxx . . $ `include/groonga/column.h:50:9`!);
658 GRN_PTR_PUTcxx . . $ `include/groonga/groonga.h:3218:9`!(ctx, &columns, id_accessor);
659 } else if (table->headercxx . . $ _grn_obj#header..domaincxx . . $ _grn_obj_header#domain. != GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!) {
660 grn_objcxx . . $ grn_obj# *key_accessor;
661 key_accessor =
662 grn_obj_columncxx . . $ grn_obj_column(c00e49795c44129a).(ctx, table, GRN_COLUMN_NAME_KEYcxx . . $ `include/groonga/column.h:63:9`!, GRN_COLUMN_NAME_KEY_LENcxx . . $ `include/groonga/column.h:72:9`!);
663 GRN_PTR_PUTcxx . . $ `include/groonga/groonga.h:3218:9`!(ctx, &columns, key_accessor);
664 }
665
666 if (grn_obj_get_rangecxx . . $ grn_obj_get_range(8dd58acc9865e889).(ctx, table) != GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!) {
667 grn_objcxx . . $ grn_obj# *value_accessor;
668 value_accessor = grn_obj_columncxx . . $ grn_obj_column(c00e49795c44129a).(ctx,
669 table,
670 GRN_COLUMN_NAME_VALUEcxx . . $ `include/groonga/column.h:84:9`!,
671 GRN_COLUMN_NAME_VALUE_LENcxx . . $ `include/groonga/column.h:93:9`!);
672 GRN_PTR_PUTcxx . . $ `include/groonga/groonga.h:3218:9`!(ctx, &columns, value_accessor);
673 }
674
675 {
676 grn_hashcxx . . $ grn_hash# *real_columns;
677
678 real_columns = grn_hash_createcxx . . $ grn_hash_create(db1bba7e0d64660).(ctx,
679 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!,
680 sizeof(grn_idcxx . . $ grn_id#),
681 0,
682 GRN_OBJ_TABLE_HASH_KEYcxx . . $ `include/groonga/groonga.h:688:9`! | GRN_HASH_TINYcxx . . $ `include/groonga/hash.h:26:9`!);
683 grn_table_columnscxx . . $ grn_table_columns(1e71eba22593aee7).(ctx, table, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, 0, (grn_objcxx . . $ grn_obj# *)real_columns);
684 GRN_HASH_EACH_BEGINcxx . . $ `include/groonga/hash.h:141:9`!(ctx, real_columns, cursor, id)
685 {
686 void *key;
687 grn_idcxx . . $ grn_id# column_id;
688 grn_objcxx . . $ grn_obj# *column;
689
690 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
691 grn_ctx_push_temporary_open_spacecxx . . $ grn_ctx_push_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
692 }
693
694 grn_hash_cursor_get_keycxx . . $ grn_hash_cursor_get_key(248c0d78df691c42).(ctx, cursor, &key);
695 column_id = *((grn_idcxx . . $ grn_id# *)key);
696
697 column = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, column_id);
698 if (column) {
699 if (grn_obj_is_index_columncxx . . $ grn_obj_is_index_column(a5760e5c319a06ee).(ctx, column) ||
700 grn_obj_is_token_columncxx . . $ grn_obj_is_token_column(a5760e5c319a06ee).(ctx, column) ||
701 grn_obj_is_generated_columncxx . . $ grn_obj_is_generated_column(a5760e5c319a06ee).(ctx, column)) {
702 have_auto_generated_value_column = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
703 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
704 grn_ctx_pop_temporary_open_spacecxx . . $ grn_ctx_pop_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
705 }
706 } else {
707 have_data_column = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
708 if (dump_real_columns) {
709 GRN_PTR_PUTcxx . . $ `include/groonga/groonga.h:3218:9`!(ctx, &columns, column);
710 }
711 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
712 grn_ctx_merge_temporary_open_spacecxx . . $ grn_ctx_merge_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
713 }
714 }
715 } else {
716 GRN_PLUGIN_CLEAR_ERRORcxx . . $ `include/groonga/plugin.h:148:9`!(ctx);
717 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
718 grn_ctx_pop_temporary_open_spacecxx . . $ grn_ctx_pop_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
719 }
720 }
721 }
722 GRN_HASH_EACH_ENDcxx . . $ `include/groonga/hash.h:159:9`!(ctx, cursor);
723 grn_hash_closecxx . . $ grn_hash_close(c005d027d163fb0b).(ctx, real_columns);
724 }
725
726 size_t n_columns = GRN_BULK_VSIZEcxx . . $ `include/groonga/groonga.h:2642:9`!(&columns) / sizeof(grn_objcxx . . $ grn_obj# *);
727
728 if (have_auto_generated_value_column && !have_data_column) {
729 goto exit;
730 }
731
732 if (GRN_TEXT_LENcxx . . $ `include/groonga/groonga.h:2786:9`!(dumper->output) > 0) {
733 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, dumper->output, '\n');
734 }
735
736 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, dumper->output, "load --table ");
737 dump_obj_namecxx . . $ dump_obj_name(f5c8d1b675cee56c).(ctx, dumper, table);
738 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, dumper->output, "\n[\n");
739
740 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, dumper->output, '[');
741 size_t i;
742 for (i = 0; i < n_columns; i++) {
743 grn_objcxx . . $ grn_obj# *column;
744 grn_objcxx . . $ grn_obj# *column_name = &(dumper->column_name_buffercxx . . $ $anonymous_type_32356ae70415b699_1#column_name_buffer.);
745
746 column = GRN_PTR_VALUE_ATcxx . . $ `include/groonga/groonga.h:3150:9`!(&columns, i);
747 if (i) {
748 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, dumper->output, ',');
749 }
750 GRN_BULK_REWINDcxx . . $ `include/groonga/groonga.h:2599:9`!(column_name);
751 grn_column_name_cxx . . $ grn_column_name_(d825b4ed5bf12304).(ctx, column, column_name);
752 grn_text_otojcxx . . $ grn_text_otoj(1909183af06c6849).(ctx, dumper->outputcxx . . $ $anonymous_type_32356ae70415b699_1#output., column_name, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
753 }
754 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, dumper->output, "],\n");
755
756 if (table->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type. == GRN_TABLE_HASH_KEYcxx . . $ `include/groonga/groonga.h:895:9`! && dumper->is_sort_hash_tablecxx . . $ $anonymous_type_32356ae70415b699_1#is_sort_hash_table.) {
757 grn_objcxx . . $ grn_obj# *sorted;
758 grn_table_sort_keycxx . . $ grn_table_sort_key# sort_keys[1];
759 int n_sort_keys = 1;
760 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! is_first_record = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
761
762 sort_keys[0].keycxx . . $ _grn_table_sort_key#key. =
763 grn_obj_columncxx . . $ grn_obj_column(c00e49795c44129a).(ctx, table, GRN_COLUMN_NAME_KEYcxx . . $ `include/groonga/column.h:63:9`!, GRN_COLUMN_NAME_KEY_LENcxx . . $ `include/groonga/column.h:72:9`!);
764 sort_keys[0].flagscxx . . $ _grn_table_sort_key#flags. = GRN_TABLE_SORT_ASCcxx . . $ `include/groonga/table.h:679:9`!;
765 sort_keys[0].offsetcxx . . $ _grn_table_sort_key#offset. = 0;
766 sorted =
767 grn_table_createcxx . . $ grn_table_create(51df5019e8d3bdc1).(ctx, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, 0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, GRN_TABLE_NO_KEYcxx . . $ `include/groonga/groonga.h:898:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, table);
768 grn_table_sortcxx . . $ grn_table_sort(ae37406ac512253b).(ctx, table, 0, -1, sorted, sort_keys, n_sort_keys);
769 cursor = grn_table_cursor_opencxx . . $ grn_table_cursor_open(a4cddc3087c69e91).(ctx, sorted, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, 0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, 0, 0, -1, 0);
770 while (grn_table_cursor_nextcxx . . $ grn_table_cursor_next(8dd58acc9865e889).(ctx, cursor) != GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!) {
771 void *value_raw;
772 grn_idcxx . . $ grn_id# id;
773
774 grn_table_cursor_get_valuecxx . . $ grn_table_cursor_get_value(7d620ebe94cee13a).(ctx, cursor, &value_raw);
775 id = *((grn_idcxx . . $ grn_id# *)value_raw);
776
777 if (is_first_record) {
778 is_first_record = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
779 } else {
780 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, dumper->output, ",\n");
781 }
782 dump_recordcxx . . $ dump_record(b89f66b648a298da).(ctx, dumper, table, id, &columns, n_columns);
783 }
784 grn_table_cursor_closecxx . . $ grn_table_cursor_close(4865d068a46d0f83).(ctx, cursor);
785 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, dumper->output, "\n]\n");
786 grn_obj_closecxx . . $ grn_obj_close(4865d068a46d0f83).(ctx, sorted);
787 grn_obj_unlinkcxx . . $ grn_obj_unlink(4865d068a46d0f83).(ctx, sort_keys[0].keycxx . . $ _grn_table_sort_key#key.);
788 } else {
789 grn_objcxx . . $ grn_obj# delete_commands;
790 grn_idcxx . . $ grn_id# old_id = GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!;
791 grn_idcxx . . $ grn_id# id;
792
793 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&delete_commands, 0);
794 cursor = grn_table_cursor_opencxx . . $ grn_table_cursor_open(a4cddc3087c69e91).(ctx,
795 table,
796 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!,
797 0,
798 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!,
799 0,
800 0,
801 -1,
802 GRN_CURSOR_BY_KEYcxx . . $ `include/groonga/table.h:279:9`!);
803 while ((id = grn_table_cursor_nextcxx . . $ grn_table_cursor_next(8dd58acc9865e889).(ctx, cursor)) != GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!) {
804 if (old_id != GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!) {
805 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, dumper->output, ",\n");
806 }
807 if (table->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type. == GRN_TABLE_NO_KEYcxx . . $ `include/groonga/groonga.h:898:9`! && old_id + 1 < id) {
808 grn_idcxx . . $ grn_id# current_id;
809 for (current_id = old_id + 1; current_id < id; current_id++) {
810 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, dumper->output, "[],\n");
811 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, &delete_commands, "delete --table ");
812 dump_obj_name_rawcxx . . $ dump_obj_name_raw(99eba0d3a8372d65).(ctx, &delete_commands, table);
813 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, &delete_commands, " --id ");
814 grn_text_lltoacxx . . $ grn_text_lltoa(1b142823d3915b88).(ctx, &delete_commands, current_id);
815 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, &delete_commands, '\n');
816 }
817 }
818 dump_recordcxx . . $ dump_record(b89f66b648a298da).(ctx, dumper, table, id, &columns, n_columns);
819
820 old_id = id;
821 }
822 grn_table_cursor_closecxx . . $ grn_table_cursor_close(4865d068a46d0f83).(ctx, cursor);
823 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, dumper->output, "\n]\n");
824 GRN_TEXT_PUTcxx . . $ `include/groonga/groonga.h:2773:9`!(ctx,
825 dumper->output,
826 GRN_TEXT_VALUEcxx . . $ `include/groonga/groonga.h:2785:9`!(&delete_commands),
827 GRN_TEXT_LENcxx . . $ `include/groonga/groonga.h:2786:9`!(&delete_commands));
828 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &delete_commands);
829 }
830 exit:
831 for (i = 0; i < n_columns; i++) {
832 grn_objcxx . . $ grn_obj# *column;
833
834 column = GRN_PTR_VALUE_ATcxx . . $ `include/groonga/groonga.h:3150:9`!(&columns, i);
835 if (column->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type. == GRN_ACCESSORcxx . . $ `include/groonga/groonga.h:880:9`!) {
836 grn_obj_closecxx . . $ grn_obj_close(4865d068a46d0f83).(ctx, column);
837 }
838 }
839 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &columns);
840
841 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
842 grn_ctx_pop_temporary_open_spacecxx . . $ grn_ctx_pop_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
843 }
844 }
845
846 static void
847 dump_tablecxx . . $ dump_table(f5c8d1b675cee56c).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_dumpercxx . . $ grn_dumper# *dumper, grn_objcxx . . $ grn_obj# *table)
848 {
849 grn_objcxx . . $ grn_obj# *domain = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
850 grn_idcxx . . $ grn_id# range_id;
851 grn_objcxx . . $ grn_obj# *range = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
852 grn_table_flagscxx . . $ grn_table_flags# flags;
853 grn_table_flagscxx . . $ grn_table_flags# default_flags = GRN_OBJ_PERSISTENTcxx . . $ `include/groonga/groonga.h:827:9`!;
854 grn_objcxx . . $ grn_obj# *default_tokenizer;
855 grn_objcxx . . $ grn_obj# *normalizer;
856 grn_objcxx . . $ grn_obj# *token_filters;
857
858 switch (table->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type.) {
859 case GRN_TABLE_HASH_KEYcxx . . $ `include/groonga/groonga.h:895:9`!:
860 case GRN_TABLE_PAT_KEYcxx . . $ `include/groonga/groonga.h:896:9`!:
861 case GRN_TABLE_DAT_KEYcxx . . $ `include/groonga/groonga.h:897:9`!:
862 domain = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, table->headercxx . . $ _grn_obj#header..domaincxx . . $ _grn_obj_header#domain.);
863 break;
864 default:
865 break;
866 }
867
868 if (GRN_TEXT_LENcxx . . $ `include/groonga/groonga.h:2786:9`!(dumper->output) > 0) {
869 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, dumper->output, '\n');
870 grn_ctx_output_flushcxx . . $ grn_ctx_output_flush(55555b1fc84b4259).(ctx, 0);
871 }
872
873 grn_table_get_infocxx . . $ grn_table_get_info(a1e4a6d36d3aee7c).(ctx,
874 table,
875 &flags,
876 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!,
877 &default_tokenizer,
878 &normalizer,
879 &token_filters);
880
881 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, dumper->output, "table_create ");
882 dump_obj_namecxx . . $ dump_obj_name(f5c8d1b675cee56c).(ctx, dumper, table);
883 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, dumper->output, ' ');
884 grn_dump_table_create_flagscxx . . $ grn_dump_table_create_flags(e6d1f76f34fc094d).(ctx, flags & ~default_flags, dumper->outputcxx . . $ $anonymous_type_32356ae70415b699_1#output.);
885 if (domain) {
886 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, dumper->output, ' ');
887 dump_obj_namecxx . . $ dump_obj_name(f5c8d1b675cee56c).(ctx, dumper, domain);
888 }
889 range_id = grn_obj_get_rangecxx . . $ grn_obj_get_range(8dd58acc9865e889).(ctx, table);
890 if (range_id != GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!) {
891 range = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, range_id);
892 if (!range) {
893 // ERR(GRN_RANGE_ERROR, "couldn't get table's value_type object");
894 return;
895 }
896 if (table->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type. != GRN_TABLE_NO_KEYcxx . . $ `include/groonga/groonga.h:898:9`!) {
897 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, dumper->output, ' ');
898 } else {
899 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, dumper->output, " --value_type ");
900 }
901 dump_obj_namecxx . . $ dump_obj_name(f5c8d1b675cee56c).(ctx, dumper, range);
902 grn_obj_unlinkcxx . . $ grn_obj_unlink(4865d068a46d0f83).(ctx, range);
903 }
904 if (default_tokenizer) {
905 grn_objcxx . . $ grn_obj# sub_output;
906 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, dumper->output, " --default_tokenizer ");
907 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&sub_output, 0);
908 grn_table_get_default_tokenizer_stringcxx . . $ grn_table_get_default_tokenizer_string(d825b4ed5bf12304).(ctx, table, &sub_output);
909 dump_stringcxx . . $ dump_string(f5c8d1b675cee56c).(ctx, dumper, &sub_output);
910 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &sub_output);
911 }
912 if (normalizer) {
913 grn_objcxx . . $ grn_obj# normalizers;
914 GRN_PTR_INITcxx . . $ `include/groonga/groonga.h:2869:9`!(&normalizers, GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!, GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!);
915 grn_obj_get_infocxx . . $ grn_obj_get_info(333a81d4a8f20670).(ctx, table, GRN_INFO_NORMALIZERScxx . . $ GRN_INFO_NORMALIZERS., &normalizers);
916 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! multiple_normalizers = (GRN_PTR_VECTOR_SIZEcxx . . $ `include/groonga/groonga.h:3265:9`!(&normalizers) > 1);
917 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &normalizers);
918
919 grn_objcxx . . $ grn_obj# sub_output;
920 if (multiple_normalizers) {
921 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, dumper->output, " --normalizers ");
922 } else {
923 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, dumper->output, " --normalizer ");
924 }
925 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&sub_output, 0);
926 grn_table_get_normalizers_stringcxx . . $ grn_table_get_normalizers_string(d825b4ed5bf12304).(ctx, table, &sub_output);
927 dump_stringcxx . . $ dump_string(f5c8d1b675cee56c).(ctx, dumper, &sub_output);
928 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &sub_output);
929 }
930 if (token_filters && GRN_BULK_VSIZEcxx . . $ `include/groonga/groonga.h:2642:9`!(token_filters) > 0) {
931 grn_objcxx . . $ grn_obj# sub_output;
932 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, dumper->output, " --token_filters ");
933 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&sub_output, 0);
934 grn_table_get_token_filters_stringcxx . . $ grn_table_get_token_filters_string(d825b4ed5bf12304).(ctx, table, &sub_output);
935 dump_stringcxx . . $ dump_string(f5c8d1b675cee56c).(ctx, dumper, &sub_output);
936 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &sub_output);
937 }
938 if (domain) {
939 grn_objcxx . . $ grn_obj# sub_output;
940 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&sub_output, 0);
941 grn_table_get_extractors_stringcxx . . $ grn_table_get_extractors_string(d825b4ed5bf12304).(ctx, table, &sub_output);
942 if (GRN_TEXT_LENcxx . . $ `include/groonga/groonga.h:2786:9`!(&sub_output) > 0) {
943 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, dumper->output, " --extractors ");
944 dump_stringcxx . . $ dump_string(f5c8d1b675cee56c).(ctx, dumper, &sub_output);
945 }
946 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &sub_output);
947 }
948 if ((flags & GRN_OBJ_CUSTOM_NAMEcxx . . $ `lib/grn_db.h:552:9`!) && dumper->is_dump_pathscxx . . $ $anonymous_type_32356ae70415b699_1#is_dump_paths.) {
949 grn_objcxx . . $ grn_obj# sub_output;
950 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, dumper->output, " --path ");
951 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&sub_output, GRN_OBJ_DO_SHALLOW_COPYcxx . . $ `include/groonga/groonga.h:2732:9`!);
952 const char *path = grn_obj_pathcxx . . $ grn_obj_path(ab3dda79dad54815).(ctx, table);
953 GRN_TEXT_SETScxx . . $ `include/groonga/groonga.h:2783:9`!(ctx, &sub_output, path);
954 dump_stringcxx . . $ dump_string(f5c8d1b675cee56c).(ctx, dumper, &sub_output);
955 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &sub_output);
956 }
957
958 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, dumper->output, '\n');
959
960 dump_columnscxx . . $ dump_columns(15a38d3eb9bde23c).(ctx, dumper, table, truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!, falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!, falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!);
961 }
962
963 static void
964 dump_schemacxx . . $ dump_schema(5306d516c392a7cf).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_dumpercxx . . $ grn_dumper# *dumper)
965 {
966 GRN_DB_EACH_BEGIN_BY_KEYcxx . . $ `include/groonga/db.h:142:9`!(ctx, cursor, id)
967 {
968 void *name;
969 int name_size;
970 grn_objcxx . . $ grn_obj# *object;
971
972 if (grn_id_is_builtincxx . . $ grn_id_is_builtin(a2a496425acc5b40).(ctx, id)) {
973 continue;
974 }
975
976 name_size = grn_table_cursor_get_keycxx . . $ grn_table_cursor_get_key(7d620ebe94cee13a).(ctx, cursor, &name);
977 if (grn_obj_name_is_columncxx . . $ grn_obj_name_is_column(da3161f0ad1ba10a).(ctx, name, name_size)) {
978 continue;
979 }
980
981 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
982 grn_ctx_push_temporary_open_spacecxx . . $ grn_ctx_push_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
983 }
984
985 if ((object = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, id))) {
986 switch (object->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type.) {
987 case GRN_TABLE_HASH_KEYcxx . . $ `include/groonga/groonga.h:895:9`!:
988 case GRN_TABLE_PAT_KEYcxx . . $ `include/groonga/groonga.h:896:9`!:
989 case GRN_TABLE_DAT_KEYcxx . . $ `include/groonga/groonga.h:897:9`!:
990 case GRN_TABLE_NO_KEYcxx . . $ `include/groonga/groonga.h:898:9`!:
991 dump_tablecxx . . $ dump_table(f5c8d1b675cee56c).(ctx, dumper, object);
992 break;
993 default:
994 break;
995 }
996 } else {
997 /* XXX: this clause is executed when MeCab tokenizer is enabled in
998 database but the groonga isn't supported MeCab.
999 We should return error message about it and error exit status
1000 but it's too difficult for this architecture. :< */
1001 GRN_PLUGIN_CLEAR_ERRORcxx . . $ `include/groonga/plugin.h:148:9`!(ctx);
1002 }
1003
1004 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
1005 grn_ctx_pop_temporary_open_spacecxx . . $ grn_ctx_pop_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
1006 }
1007 }
1008 GRN_DB_EACH_ENDcxx . . $ `include/groonga/db.h:148:9`!(ctx, cursor);
1009
1010 if (!dumper->have_reference_columncxx . . $ $anonymous_type_32356ae70415b699_1#have_reference_column.) {
1011 return;
1012 }
1013
1014 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, dumper->output, '\n');
1015 grn_ctx_output_flushcxx . . $ grn_ctx_output_flush(55555b1fc84b4259).(ctx, 0);
1016
1017 GRN_DB_EACH_BEGIN_BY_KEYcxx . . $ `include/groonga/db.h:142:9`!(ctx, cursor, id)
1018 {
1019 void *name;
1020 int name_size;
1021 grn_objcxx . . $ grn_obj# *object;
1022
1023 if (grn_id_is_builtincxx . . $ grn_id_is_builtin(a2a496425acc5b40).(ctx, id)) {
1024 continue;
1025 }
1026
1027 name_size = grn_table_cursor_get_keycxx . . $ grn_table_cursor_get_key(7d620ebe94cee13a).(ctx, cursor, &name);
1028 if (grn_obj_name_is_columncxx . . $ grn_obj_name_is_column(da3161f0ad1ba10a).(ctx, name, name_size)) {
1029 continue;
1030 }
1031
1032 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
1033 grn_ctx_push_temporary_open_spacecxx . . $ grn_ctx_push_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
1034 }
1035
1036 if ((object = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, id))) {
1037 switch (object->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type.) {
1038 case GRN_TABLE_HASH_KEYcxx . . $ `include/groonga/groonga.h:895:9`!:
1039 case GRN_TABLE_PAT_KEYcxx . . $ `include/groonga/groonga.h:896:9`!:
1040 case GRN_TABLE_DAT_KEYcxx . . $ `include/groonga/groonga.h:897:9`!:
1041 case GRN_TABLE_NO_KEYcxx . . $ `include/groonga/groonga.h:898:9`!:
1042 dump_columnscxx . . $ dump_columns(15a38d3eb9bde23c).(ctx, dumper, object, falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!, truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!, falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!);
1043 break;
1044 default:
1045 break;
1046 }
1047 } else {
1048 /* XXX: this clause is executed when MeCab tokenizer is enabled in
1049 database but the groonga isn't supported MeCab.
1050 We should return error message about it and error exit status
1051 but it's too difficult for this architecture. :< */
1052 GRN_PLUGIN_CLEAR_ERRORcxx . . $ `include/groonga/plugin.h:148:9`!(ctx);
1053 }
1054
1055 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
1056 grn_ctx_pop_temporary_open_spacecxx . . $ grn_ctx_pop_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
1057 }
1058 }
1059 GRN_DB_EACH_ENDcxx . . $ `include/groonga/db.h:148:9`!(ctx, cursor);
1060 }
1061
1062 static void
1063 dump_records_maybe_defercxx . . $ dump_records_maybe_defer(b5626a230e3bf23c).(grn_ctxcxx . . $ grn_ctx# *ctx,
1064 grn_dumpercxx . . $ grn_dumper# *dumper,
1065 grn_objcxx . . $ grn_obj# *table,
1066 grn_objcxx . . $ grn_obj# *deferred_table_ids)
1067 {
1068 const grn_dumper_table_statisticscxx . . $ grn_dumper_table_statistics# *statistics = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
1069 void *value;
1070 if (grn_hash_getcxx . . $ grn_hash_get(4e868e5367e71b67).(ctx,
1071 dumper->table_statisticscxx . . $ $anonymous_type_32356ae70415b699_1#table_statistics.,
1072 &(DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->idcxx . . $ $anonymous_type_4a7c1014017e4c5d_0#id.),
1073 sizeof(grn_idcxx . . $ grn_id#),
1074 &value) != GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!) {
1075 statistics = (const grn_dumper_table_statisticscxx . . $ grn_dumper_table_statistics# *)value;
1076 }
1077 if (statistics) {
1078 if (statistics->is_referredcxx . . $ $anonymous_type_32356ae70415b699_0#is_referred. && grn_obj_is_table_with_keycxx . . $ grn_obj_is_table_with_key(a5760e5c319a06ee).(ctx, table)) {
1079 if (statistics->have_reference_columncxx . . $ $anonymous_type_32356ae70415b699_0#have_reference_column.) {
1080 dump_recordscxx . . $ dump_records(3695053725632923).(ctx, dumper, table, falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!);
1081 if (statistics->have_data_columncxx . . $ $anonymous_type_32356ae70415b699_0#have_data_column.) {
1082 GRN_UINT32_PUTcxx . . $ `include/groonga/groonga.h:3182:9`!(ctx, deferred_table_ids, DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->id);
1083 }
1084 } else {
1085 dump_recordscxx . . $ dump_records(3695053725632923).(ctx, dumper, table, truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!);
1086 }
1087 } else {
1088 if (statistics->have_reference_columncxx . . $ $anonymous_type_32356ae70415b699_0#have_reference_column.) {
1089 GRN_UINT32_PUTcxx . . $ `include/groonga/groonga.h:3182:9`!(ctx, deferred_table_ids, DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->id);
1090 } else {
1091 dump_recordscxx . . $ dump_records(3695053725632923).(ctx, dumper, table, truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!);
1092 }
1093 }
1094 } else {
1095 GRN_UINT32_PUTcxx . . $ `include/groonga/groonga.h:3182:9`!(ctx, deferred_table_ids, DB_OBJcxx . . $ `lib/grn_db.h:62:9`!(table)->id);
1096 }
1097 }
1098
1099 static void
1100 dump_records_deferredcxx . . $ dump_records_deferred(f5c8d1b675cee56c).(grn_ctxcxx . . $ grn_ctx# *ctx,
1101 grn_dumpercxx . . $ grn_dumper# *dumper,
1102 grn_objcxx . . $ grn_obj# *deferred_table_ids)
1103 {
1104 size_t n_deferred_table_ids = GRN_UINT32_VECTOR_SIZEcxx . . $ `include/groonga/groonga.h:3257:9`!(deferred_table_ids);
1105 size_t i;
1106 for (i = 0; i < n_deferred_table_ids; i++) {
1107 grn_idcxx . . $ grn_id# table_id = GRN_UINT32_VALUE_ATcxx . . $ `include/groonga/groonga.h:3136:9`!(deferred_table_ids, i);
1108 grn_objcxx . . $ grn_obj# *table = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, table_id);
1109 dump_recordscxx . . $ dump_records(3695053725632923).(ctx, dumper, table, truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!);
1110 grn_obj_unrefcxx . . $ grn_obj_unref(cda3a5f3c2e53c6b).(ctx, table);
1111 }
1112 }
1113
1114 static void
1115 dump_selected_tables_recordscxx . . $ dump_selected_tables_records(f5c8d1b675cee56c).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_dumpercxx . . $ grn_dumper# *dumper, grn_objcxx . . $ grn_obj# *tables)
1116 {
1117 grn_objcxx . . $ grn_obj# deferred_table_ids;
1118 GRN_UINT32_INITcxx . . $ `include/groonga/groonga.h:2854:9`!(&deferred_table_ids, GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!);
1119
1120 const char *p = GRN_TEXT_VALUEcxx . . $ `include/groonga/groonga.h:2785:9`!(tables);
1121 const char *e = p + GRN_TEXT_LENcxx . . $ `include/groonga/groonga.h:2786:9`!(tables);
1122 while (p < e) {
1123 int len;
1124 const char *token, *token_e;
1125
1126 if ((len = grn_isspacecxx . . $ grn_isspace(f8f88a86d74aa1ba).(p, ctx->encodingcxx . . $ _grn_ctx#encoding.))) {
1127 p += len;
1128 continue;
1129 }
1130
1131 token = p;
1132 if (!(('a' <= *p && *p <= 'z') || ('A' <= *p && *p <= 'Z') ||
1133 (*p == '_'))) {
1134 while (p < e && !grn_isspacecxx . . $ grn_isspace(f8f88a86d74aa1ba).(p, ctx->encodingcxx . . $ _grn_ctx#encoding.)) {
1135 p++;
1136 }
1137 GRN_LOGcxx . . $ `include/groonga/groonga.h:2493:9`!(ctx,
1138 GRN_LOG_WARNING,
1139 "invalid table name is ignored: <%.*s>\n",
1140 (int)(p - token),
1141 token);
1142 continue;
1143 }
1144 while (p < e && (('a' <= *p && *p <= 'z') || ('A' <= *p && *p <= 'Z') ||
1145 ('0' <= *p && *p <= '9') || (*p == '_'))) {
1146 p++;
1147 }
1148 token_e = p;
1149 while (p < e && (len = grn_isspacecxx . . $ grn_isspace(f8f88a86d74aa1ba).(p, ctx->encodingcxx . . $ _grn_ctx#encoding.))) {
1150 p += len;
1151 continue;
1152 }
1153 if (p < e && *p == ',') {
1154 p++;
1155 }
1156
1157 grn_objcxx . . $ grn_obj# *table = grn_ctx_getcxx . . $ grn_ctx_get(70fde0087014f9ea).(ctx, token, (int)(token_e - token));
1158 if (!table) {
1159 GRN_LOGcxx . . $ `include/groonga/groonga.h:2493:9`!(ctx,
1160 GRN_LOG_WARNING,
1161 "nonexistent table name is ignored: <%.*s>\n",
1162 (int)(token_e - token),
1163 token);
1164 continue;
1165 }
1166
1167 if (grn_obj_is_tablecxx . . $ grn_obj_is_table(a5760e5c319a06ee).(ctx, table)) {
1168 dump_records_maybe_defercxx . . $ dump_records_maybe_defer(b5626a230e3bf23c).(ctx, dumper, table, &deferred_table_ids);
1169 }
1170 grn_obj_unrefcxx . . $ grn_obj_unref(cda3a5f3c2e53c6b).(ctx, table);
1171 }
1172
1173 dump_records_deferredcxx . . $ dump_records_deferred(f5c8d1b675cee56c).(ctx, dumper, &deferred_table_ids);
1174 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &deferred_table_ids);
1175 }
1176
1177 static void
1178 dump_all_recordscxx . . $ dump_all_records(5306d516c392a7cf).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_dumpercxx . . $ grn_dumper# *dumper)
1179 {
1180 grn_objcxx . . $ grn_obj# deferred_table_ids;
1181 GRN_UINT32_INITcxx . . $ `include/groonga/groonga.h:2854:9`!(&deferred_table_ids, GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!);
1182
1183 GRN_DB_EACH_BEGIN_BY_KEYcxx . . $ `include/groonga/db.h:142:9`!(ctx, cursor, id)
1184 {
1185 void *name;
1186 int name_size;
1187
1188 if (grn_id_is_builtincxx . . $ grn_id_is_builtin(a2a496425acc5b40).(ctx, id)) {
1189 continue;
1190 }
1191
1192 name_size = grn_table_cursor_get_keycxx . . $ grn_table_cursor_get_key(7d620ebe94cee13a).(ctx, cursor, &name);
1193 if (grn_obj_name_is_columncxx . . $ grn_obj_name_is_column(da3161f0ad1ba10a).(ctx, name, name_size)) {
1194 continue;
1195 }
1196
1197 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
1198 grn_ctx_push_temporary_open_spacecxx . . $ grn_ctx_push_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
1199 }
1200
1201 grn_objcxx . . $ grn_obj# *table = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, id);
1202 if (!table) {
1203 /* XXX: this clause is executed when MeCab tokenizer is enabled in
1204 database but the groonga isn't supported MeCab.
1205 We should return error message about it and error exit status
1206 but it's too difficult for this architecture. :< */
1207 GRN_PLUGIN_CLEAR_ERRORcxx . . $ `include/groonga/plugin.h:148:9`!(ctx);
1208 goto next_loop;
1209 }
1210
1211 if (grn_obj_is_tablecxx . . $ grn_obj_is_table(a5760e5c319a06ee).(ctx, table)) {
1212 dump_records_maybe_defercxx . . $ dump_records_maybe_defer(b5626a230e3bf23c).(ctx, dumper, table, &deferred_table_ids);
1213 }
1214
1215 next_loop:
1216 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
1217 grn_ctx_pop_temporary_open_spacecxx . . $ grn_ctx_pop_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
1218 }
1219 }
1220 GRN_DB_EACH_ENDcxx . . $ `include/groonga/db.h:148:9`!(ctx, cursor);
1221
1222 dump_records_deferredcxx . . $ dump_records_deferred(f5c8d1b675cee56c).(ctx, dumper, &deferred_table_ids);
1223 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &deferred_table_ids);
1224 }
1225
1226 static void
1227 dump_indexescxx . . $ dump_indexes(5306d516c392a7cf).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_dumpercxx . . $ grn_dumper# *dumper)
1228 {
1229 if (!dumper->have_index_columncxx . . $ $anonymous_type_32356ae70415b699_1#have_index_column.) {
1230 return;
1231 }
1232
1233 if (GRN_TEXT_LENcxx . . $ `include/groonga/groonga.h:2786:9`!(dumper->output) > 0) {
1234 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, dumper->output, '\n');
1235 }
1236
1237 GRN_DB_EACH_BEGIN_BY_KEYcxx . . $ `include/groonga/db.h:142:9`!(ctx, cursor, id)
1238 {
1239 void *name;
1240 int name_size;
1241 grn_objcxx . . $ grn_obj# *object;
1242
1243 if (grn_id_is_builtincxx . . $ grn_id_is_builtin(a2a496425acc5b40).(ctx, id)) {
1244 continue;
1245 }
1246
1247 name_size = grn_table_cursor_get_keycxx . . $ grn_table_cursor_get_key(7d620ebe94cee13a).(ctx, cursor, &name);
1248 if (grn_obj_name_is_columncxx . . $ grn_obj_name_is_column(da3161f0ad1ba10a).(ctx, name, name_size)) {
1249 continue;
1250 }
1251
1252 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
1253 grn_ctx_push_temporary_open_spacecxx . . $ grn_ctx_push_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
1254 }
1255
1256 object = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, id);
1257 if (!object) {
1258 /* XXX: this clause is executed when MeCab tokenizer is enabled in
1259 database but the groonga isn't supported MeCab.
1260 We should return error message about it and error exit status
1261 but it's too difficult for this architecture. :< */
1262 GRN_PLUGIN_CLEAR_ERRORcxx . . $ `include/groonga/plugin.h:148:9`!(ctx);
1263 goto next_loop;
1264 }
1265
1266 if (grn_obj_is_tablecxx . . $ grn_obj_is_table(a5760e5c319a06ee).(ctx, object)) {
1267 dump_columnscxx . . $ dump_columns(15a38d3eb9bde23c).(ctx, dumper, object, falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!, falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!, truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!);
1268 }
1269
1270 next_loop:
1271 if (dumper->is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode.) {
1272 grn_ctx_pop_temporary_open_spacecxx . . $ grn_ctx_pop_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
1273 }
1274 }
1275 GRN_DB_EACH_ENDcxx . . $ `include/groonga/db.h:148:9`!(ctx, cursor);
1276 }
1277
1278 static grn_objcxx . . $ grn_obj# *
1279 command_dumpcxx . . $ command_dump(fd082858389c8bb0).(grn_ctxcxx . . $ grn_ctx# *ctx, int nargs, grn_objcxx . . $ grn_obj# **args, grn_user_datacxx . . $ grn_user_data# *user_data)
1280 {
1281 grn_dumpercxx . . $ grn_dumper# dumper;
1282 grn_objcxx . . $ grn_obj# *tables;
1283 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! is_dump_plugins;
1284 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! is_dump_schema;
1285 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! is_dump_records;
1286 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! is_dump_indexes;
1287 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! is_dump_configs;
1288
1289 dumper.outputcxx . . $ $anonymous_type_32356ae70415b699_1#output. = ctx->implcxx . . $ _grn_ctx#impl.->outputcxx . . $ _grn_ctx_impl#output..bufcxx . . $ _grn_ctx_impl#$anonymous_type_0#buf.;
1290 if (grn_thread_get_limitcxx . . $ grn_thread_get_limit(db52760e79bf9054).() == 1) {
1291 dumper.is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode. = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
1292 } else {
1293 dumper.is_close_opened_object_modecxx . . $ $anonymous_type_32356ae70415b699_1#is_close_opened_object_mode. = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1294 }
1295 dumper.have_reference_columncxx . . $ $anonymous_type_32356ae70415b699_1#have_reference_column. = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1296 dumper.have_index_columncxx . . $ $anonymous_type_32356ae70415b699_1#have_index_column. = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1297
1298 tables = grn_plugin_proc_get_varcxx . . $ grn_plugin_proc_get_var(3074f8d72b0d40ab).(ctx, user_data, "tables", -1);
1299 is_dump_plugins =
1300 grn_plugin_proc_get_var_boolcxx . . $ grn_plugin_proc_get_var_bool(544c966dc918f81a).(ctx, user_data, "dump_plugins", -1, truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!);
1301 is_dump_schema =
1302 grn_plugin_proc_get_var_boolcxx . . $ grn_plugin_proc_get_var_bool(544c966dc918f81a).(ctx, user_data, "dump_schema", -1, truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!);
1303 is_dump_records =
1304 grn_plugin_proc_get_var_boolcxx . . $ grn_plugin_proc_get_var_bool(544c966dc918f81a).(ctx, user_data, "dump_records", -1, truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!);
1305 is_dump_indexes =
1306 grn_plugin_proc_get_var_boolcxx . . $ grn_plugin_proc_get_var_bool(544c966dc918f81a).(ctx, user_data, "dump_indexes", -1, truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!);
1307 is_dump_configs =
1308 grn_plugin_proc_get_var_boolcxx . . $ grn_plugin_proc_get_var_bool(544c966dc918f81a).(ctx, user_data, "dump_configs", -1, truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!);
1309 dumper.is_sort_hash_tablecxx . . $ $anonymous_type_32356ae70415b699_1#is_sort_hash_table. =
1310 grn_plugin_proc_get_var_boolcxx . . $ grn_plugin_proc_get_var_bool(544c966dc918f81a).(ctx, user_data, "sort_hash_table", -1, falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!);
1311 dumper.is_dump_pathscxx . . $ $anonymous_type_32356ae70415b699_1#is_dump_paths. =
1312 grn_plugin_proc_get_var_boolcxx . . $ grn_plugin_proc_get_var_bool(544c966dc918f81a).(ctx, user_data, "dump_paths", -1, truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!);
1313 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&(dumper.column_name_buffer), 0);
1314
1315 grn_ctx_set_output_typecxx . . $ grn_ctx_set_output_type(885ce0395b04a95d).(ctx, GRN_CONTENT_GROONGA_COMMAND_LISTcxx . . $ GRN_CONTENT_GROONGA_COMMAND_LIST.);
1316
1317 dumper_collect_statisticscxx . . $ dumper_collect_statistics(5306d516c392a7cf).(ctx, &dumper);
1318
1319 if (is_dump_configs) {
1320 dump_configscxx . . $ dump_configs(5306d516c392a7cf).(ctx, &dumper);
1321 }
1322 if (is_dump_plugins) {
1323 dump_pluginscxx . . $ dump_plugins(5306d516c392a7cf).(ctx, &dumper);
1324 }
1325 if (is_dump_schema) {
1326 dump_schemacxx . . $ dump_schema(5306d516c392a7cf).(ctx, &dumper);
1327 }
1328 if (is_dump_records) {
1329 /* To update index columns correctly, we first create the whole schema, then
1330 load non-derivative records, while skipping records of index columns.
1331 That way, Groonga will silently do the job of updating index columns for
1332 us. */
1333 if (GRN_TEXT_LENcxx . . $ `include/groonga/groonga.h:2786:9`!(tables) > 0) {
1334 dump_selected_tables_recordscxx . . $ dump_selected_tables_records(f5c8d1b675cee56c).(ctx, &dumper, tables);
1335 } else {
1336 dump_all_recordscxx . . $ dump_all_records(5306d516c392a7cf).(ctx, &dumper);
1337 }
1338 }
1339 if (is_dump_indexes) {
1340 dump_indexescxx . . $ dump_indexes(5306d516c392a7cf).(ctx, &dumper);
1341 }
1342 /* remove the last newline because another one will be added by the caller.
1343 maybe, the caller of proc functions currently doesn't consider the
1344 possibility of multiple-line output from proc functions. */
1345 if (GRN_BULK_VSIZEcxx . . $ `include/groonga/groonga.h:2642:9`!(dumper.output) > 0) {
1346 grn_bulk_truncatecxx . . $ grn_bulk_truncate(f9a66385f261f61d).(ctx, dumper.outputcxx . . $ $anonymous_type_32356ae70415b699_1#output., GRN_BULK_VSIZEcxx . . $ `include/groonga/groonga.h:2642:9`!(dumper.output) - 1);
1347 }
1348
1349 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &(dumper.column_name_buffer));
1350 GRN_HASH_EACH_BEGINcxx . . $ `include/groonga/hash.h:141:9`!(ctx, dumper.table_statistics, cursor, id)
1351 {
1352 void *value;
1353 grn_hash_cursor_get_valuecxx . . $ grn_hash_cursor_get_value(248c0d78df691c42).(ctx, cursor, &value);
1354 grn_dumper_table_statistics_fincxx . . $ grn_dumper_table_statistics_fin(4e8d59a9cb2d43d5).(ctx, value);
1355 }
1356 GRN_HASH_EACH_ENDcxx . . $ `include/groonga/hash.h:159:9`!(ctx, cursor);
1357 grn_hash_closecxx . . $ grn_hash_close(c005d027d163fb0b).(ctx, dumper.table_statisticscxx . . $ $anonymous_type_32356ae70415b699_1#table_statistics.);
1358
1359 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
1360 }
1361
1362 void
1363 grn_proc_init_dumpcxx . . $ grn_proc_init_dump(b578cd6e53d5fe91).(grn_ctxcxx . . $ grn_ctx# *ctx)
1364 {
1365 grn_expr_varcxx . . $ grn_expr_var# vars[8];
1366
1367 grn_plugin_expr_var_initcxx . . $ grn_plugin_expr_var_init(680ef4125f11597f).(ctx, &(vars[0]), "tables", -1);
1368 grn_plugin_expr_var_initcxx . . $ grn_plugin_expr_var_init(680ef4125f11597f).(ctx, &(vars[1]), "dump_plugins", -1);
1369 grn_plugin_expr_var_initcxx . . $ grn_plugin_expr_var_init(680ef4125f11597f).(ctx, &(vars[2]), "dump_schema", -1);
1370 grn_plugin_expr_var_initcxx . . $ grn_plugin_expr_var_init(680ef4125f11597f).(ctx, &(vars[3]), "dump_records", -1);
1371 grn_plugin_expr_var_initcxx . . $ grn_plugin_expr_var_init(680ef4125f11597f).(ctx, &(vars[4]), "dump_indexes", -1);
1372 grn_plugin_expr_var_initcxx . . $ grn_plugin_expr_var_init(680ef4125f11597f).(ctx, &(vars[5]), "dump_configs", -1);
1373 grn_plugin_expr_var_initcxx . . $ grn_plugin_expr_var_init(680ef4125f11597f).(ctx, &(vars[6]), "sort_hash_table", -1);
1374 grn_plugin_expr_var_initcxx . . $ grn_plugin_expr_var_init(680ef4125f11597f).(ctx, &(vars[7]), "dump_paths", -1);
1375 grn_plugin_command_createcxx . . $ grn_plugin_command_create(2dfd920bb40f3149).(ctx,
1376 "dump",
1377 -1,
1378 command_dumpcxx . . $ command_dump(fd082858389c8bb0).,
1379 sizeof(vars) / sizeof(vars[0]),
1380 vars);
1381 }