Debian Codegraph @

lib/proc/proc_schema.c

raw symbols SCIP
1 /*
2 Copyright (C) 2015-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
22 #include "../grn_db.h"cxx . . $ `<file>/lib/grn_db.h`/
23
24 #include <groonga/plugin.h>cxx . . $ `<file>/include/groonga/plugin.h`/
25
26 typedef structcxx . . $ $anonymous_type_793223df1636df93_0# {
27 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! is_close_opened_object_modecxx . . $ $anonymous_type_793223df1636df93_0#is_close_opened_object_mode.;
28 } grn_schema_datacxx . . $ grn_schema_data#;
29
30 static void
31 command_schema_output_idcxx . . $ command_schema_output_id(cda3a5f3c2e53c6b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *obj)
32 {
33 if (obj) {
34 grn_idcxx . . $ grn_id# id;
35 id = grn_obj_idcxx . . $ grn_obj_id(8dd58acc9865e889).(ctx, obj);
36 grn_ctx_output_uint64cxx . . $ grn_ctx_output_uint64(150f498c5f9d24bd).(ctx, id);
37 } else {
38 grn_ctx_output_nullcxx . . $ grn_ctx_output_null(b578cd6e53d5fe91).(ctx);
39 }
40 }
41
42 static void
43 command_schema_output_namecxx . . $ command_schema_output_name(cda3a5f3c2e53c6b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *obj)
44 {
45 if (obj) {
46 char name[GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!];
47 int name_size;
48 name_size = grn_obj_namecxx . . $ grn_obj_name(a51d1bff955f2f21).(ctx, obj, name, GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!);
49 grn_ctx_output_strcxx . . $ grn_ctx_output_str(bd29ebb5071afc4b).(ctx, name, (size_t)name_size);
50 } else {
51 grn_ctx_output_nullcxx . . $ grn_ctx_output_null(b578cd6e53d5fe91).(ctx);
52 }
53 }
54
55 static void
56 command_schema_output_column_namecxx . . $ command_schema_output_column_name(cda3a5f3c2e53c6b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *column)
57 {
58 char name[GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!];
59 int name_size;
60 name_size = grn_column_namecxx . . $ grn_column_name(a51d1bff955f2f21).(ctx, column, name, GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!);
61 grn_ctx_output_strcxx . . $ grn_ctx_output_str(bd29ebb5071afc4b).(ctx, name, (size_t)name_size);
62 }
63
64 static void
65 command_schema_output_typecxx . . $ command_schema_output_type(bff8cce4b2bec01a).(grn_ctxcxx . . $ grn_ctx# *ctx, const char *type_label, grn_objcxx . . $ grn_obj# *type)
66 {
67 if (!type) {
68 grn_ctx_output_nullcxx . . $ grn_ctx_output_null(b578cd6e53d5fe91).(ctx);
69 return;
70 }
71
72 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, type_label, 3);
73
74 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "id");
75 command_schema_output_idcxx . . $ command_schema_output_id(cda3a5f3c2e53c6b).(ctx, type);
76
77 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "name");
78 command_schema_output_namecxx . . $ command_schema_output_name(cda3a5f3c2e53c6b).(ctx, type);
79
80 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "type");
81 if (grn_obj_is_tablecxx . . $ grn_obj_is_table(a5760e5c319a06ee).(ctx, type)) {
82 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "reference");
83 } else {
84 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "type");
85 }
86 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
87 }
88
89 static void
90 command_schema_output_key_typecxx . . $ command_schema_output_key_type(cda3a5f3c2e53c6b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *key_type)
91 {
92 command_schema_output_typecxx . . $ command_schema_output_type(bff8cce4b2bec01a).(ctx, "key_type", key_type);
93 }
94
95 static void
96 command_schema_output_value_typecxx . . $ command_schema_output_value_type(cda3a5f3c2e53c6b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *value_type)
97 {
98 command_schema_output_typecxx . . $ command_schema_output_type(bff8cce4b2bec01a).(ctx, "value_type", value_type);
99 }
100
101 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`!
102 grn_proc_text_include_special_charactercxx . . $ grn_proc_text_include_special_character(d50236b64f2b1e59).(grn_ctxcxx . . $ grn_ctx# *ctx,
103 const char *text,
104 size_t size)
105 {
106 const char *end = text + size;
107
108 for (; text < end; text++) {
109 switch (text[0]) {
110 case '(':
111 case ')':
112 case ' ':
113 case '"':
114 case '\'':
115 return truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
116 break;
117 default:
118 break;
119 }
120 }
121
122 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
123 }
124
125 static void
126 command_schema_output_commandcxx . . $ command_schema_output_command(bff8cce4b2bec01a).(grn_ctxcxx . . $ grn_ctx# *ctx,
127 const char *command_name,
128 grn_objcxx . . $ grn_obj# *arguments)
129 {
130 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "command", 3);
131
132 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "name");
133 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, command_name);
134
135 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "arguments");
136 {
137 uint32_tcxx . . $ uint32_t# i, n;
138
139 n = grn_vector_sizecxx . . $ grn_vector_size(8dd58acc9865e889).(ctx, arguments);
140 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "arguments", (int)(n / 2));
141 for (i = 0; i < n; i += 2) {
142 const char *name;
143 unsigned int name_size;
144 const char *value;
145 unsigned int value_size;
146
147 name_size = grn_vector_get_elementcxx . . $ grn_vector_get_element(744613554bd9830c).(ctx, arguments, 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`!);
148 value_size =
149 grn_vector_get_elementcxx . . $ grn_vector_get_element(744613554bd9830c).(ctx, arguments, i + 1, &value, 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`!);
150 grn_ctx_output_strcxx . . $ grn_ctx_output_str(bd29ebb5071afc4b).(ctx, name, name_size);
151 grn_ctx_output_strcxx . . $ grn_ctx_output_str(bd29ebb5071afc4b).(ctx, value, value_size);
152 }
153 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
154 }
155
156 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "command_line");
157 {
158 uint32_tcxx . . $ uint32_t# i, n;
159 grn_objcxx . . $ grn_obj# command_line;
160
161 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&command_line, 0);
162 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, &command_line, command_name);
163 n = grn_vector_sizecxx . . $ grn_vector_size(8dd58acc9865e889).(ctx, arguments);
164 for (i = 0; i < n; i += 2) {
165 const char *name;
166 unsigned int name_size;
167 const char *value;
168 unsigned int value_size;
169
170 name_size = grn_vector_get_elementcxx . . $ grn_vector_get_element(744613554bd9830c).(ctx, arguments, 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`!);
171 grn_text_printfcxx . . $ grn_text_printf(34596149d4dc0292).(ctx, &command_line, " --%.*s ", name_size, name);
172 value_size =
173 grn_vector_get_elementcxx . . $ grn_vector_get_element(744613554bd9830c).(ctx, arguments, i + 1, &value, 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`!);
174 if (grn_proc_text_include_special_charactercxx . . $ grn_proc_text_include_special_character(d50236b64f2b1e59).(ctx, value, value_size)) {
175 grn_objcxx . . $ grn_obj# value_text;
176 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&value_text, GRN_OBJ_DO_SHALLOW_COPYcxx . . $ `include/groonga/groonga.h:2732:9`!);
177 GRN_TEXT_SETcxx . . $ `include/groonga/groonga.h:2761:9`!(ctx, &value_text, value, value_size);
178 grn_text_otojcxx . . $ grn_text_otoj(1909183af06c6849).(ctx, &command_line, &value_text, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
179 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &value_text);
180 } else {
181 GRN_TEXT_PUTcxx . . $ `include/groonga/groonga.h:2773:9`!(ctx, &command_line, value, value_size);
182 }
183 }
184 grn_ctx_output_strcxx . . $ grn_ctx_output_str(bd29ebb5071afc4b).(ctx,
185 GRN_TEXT_VALUEcxx . . $ `include/groonga/groonga.h:2785:9`!(&command_line),
186 GRN_TEXT_LENcxx . . $ `include/groonga/groonga.h:2786:9`!(&command_line));
187 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &command_line);
188 }
189
190 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
191 }
192
193 static void
194 command_schema_output_pluginscxx . . $ command_schema_output_plugins(b578cd6e53d5fe91).(grn_ctxcxx . . $ grn_ctx# *ctx)
195 {
196 grn_objcxx . . $ grn_obj# plugin_names;
197 uint32_tcxx . . $ uint32_t# i, n;
198
199 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&plugin_names, GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!);
200
201 grn_plugin_get_namescxx . . $ grn_plugin_get_names(4865d068a46d0f83).(ctx, &plugin_names);
202
203 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "plugins");
204
205 n = grn_vector_sizecxx . . $ grn_vector_size(8dd58acc9865e889).(ctx, &plugin_names);
206 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "plugins", (int)n);
207 for (i = 0; i < n; i++) {
208 const char *name;
209 unsigned int name_size;
210
211 name_size =
212 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`!);
213 grn_ctx_output_strcxx . . $ grn_ctx_output_str(bd29ebb5071afc4b).(ctx, name, name_size);
214
215 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "plugin", 1);
216 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "name");
217 grn_ctx_output_strcxx . . $ grn_ctx_output_str(bd29ebb5071afc4b).(ctx, name, name_size);
218 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
219 }
220 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
221
222 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &plugin_names);
223 }
224
225 static void
226 command_schema_output_typescxx . . $ command_schema_output_types(b578cd6e53d5fe91).(grn_ctxcxx . . $ grn_ctx# *ctx)
227 {
228 int n_types = 0;
229 GRN_DB_EACH_BEGIN_BY_KEYcxx . . $ `include/groonga/db.h:142:9`!(ctx, cursor, id)
230 {
231 if (grn_id_is_builtin_typecxx . . $ grn_id_is_builtin_type(a2a496425acc5b40).(ctx, id)) {
232 n_types++;
233 }
234 }
235 GRN_DB_EACH_ENDcxx . . $ `include/groonga/db.h:148:9`!(ctx, cursor);
236
237 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "types");
238
239 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "types", n_types);
240 GRN_DB_EACH_BEGIN_BY_KEYcxx . . $ `include/groonga/db.h:142:9`!(ctx, cursor, id)
241 {
242 grn_objcxx . . $ grn_obj# *type;
243
244 if (!grn_id_is_builtin_typecxx . . $ grn_id_is_builtin_type(a2a496425acc5b40).(ctx, id)) {
245 continue;
246 }
247
248 type = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, id);
249
250 command_schema_output_namecxx . . $ command_schema_output_name(cda3a5f3c2e53c6b).(ctx, type);
251
252 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "type", 5);
253
254 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "id");
255 command_schema_output_idcxx . . $ command_schema_output_id(cda3a5f3c2e53c6b).(ctx, type);
256
257 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "name");
258 command_schema_output_namecxx . . $ command_schema_output_name(cda3a5f3c2e53c6b).(ctx, type);
259
260 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "size");
261 grn_ctx_output_int64cxx . . $ grn_ctx_output_int64(e824ee96bb92de8).(ctx, grn_type_sizecxx . . $ grn_type_size(8dd58acc9865e889).(ctx, type));
262
263 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "can_be_key_type");
264 grn_ctx_output_boolcxx . . $ grn_ctx_output_bool(1112b62984b2cd7f).(ctx,
265 grn_type_sizecxx . . $ grn_type_size(8dd58acc9865e889).(ctx, type) <= GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!);
266
267 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "can_be_value_type");
268 grn_ctx_output_boolcxx . . $ grn_ctx_output_bool(1112b62984b2cd7f).(ctx, !(type->headercxx . . $ _grn_obj#header..flagscxx . . $ _grn_obj_header#flags. & GRN_OBJ_KEY_VAR_SIZEcxx . . $ `include/groonga/groonga.h:820:9`!));
269
270 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
271 }
272 GRN_DB_EACH_ENDcxx . . $ `include/groonga/db.h:148:9`!(ctx, cursor);
273 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
274 }
275
276 static void
277 command_schema_output_tokenizerscxx . . $ command_schema_output_tokenizers(5200d3ea2140a9cf).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_schema_datacxx . . $ grn_schema_data# *data)
278 {
279 grn_objcxx . . $ grn_obj# tokenizer_ids;
280
281 GRN_RECORD_INITcxx . . $ `include/groonga/groonga.h:2868:9`!(&tokenizer_ids, GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!, GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!);
282 GRN_DB_EACH_BEGIN_BY_KEYcxx . . $ `include/groonga/db.h:142:9`!(ctx, cursor, id)
283 {
284 void *name;
285 int name_size;
286 grn_objcxx . . $ grn_obj# *object;
287
288 name_size = grn_table_cursor_get_keycxx . . $ grn_table_cursor_get_key(7d620ebe94cee13a).(ctx, cursor, &name);
289 if (grn_obj_name_is_columncxx . . $ grn_obj_name_is_column(da3161f0ad1ba10a).(ctx, name, name_size)) {
290 continue;
291 }
292
293 if (data->is_close_opened_object_modecxx . . $ $anonymous_type_793223df1636df93_0#is_close_opened_object_mode.) {
294 grn_ctx_push_temporary_open_spacecxx . . $ grn_ctx_push_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
295 }
296
297 object = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, id);
298 if (object) {
299 if (grn_obj_is_tokenizer_proccxx . . $ grn_obj_is_tokenizer_proc(a5760e5c319a06ee).(ctx, object)) {
300 GRN_RECORD_PUTcxx . . $ `include/groonga/groonga.h:3213:9`!(ctx, &tokenizer_ids, id);
301 }
302 } else {
303 /* XXX: this clause is executed when MeCab tokenizer is enabled in
304 database but the groonga isn't supported MeCab.
305 We should return error message about it and error exit status
306 but it's too difficult for this architecture. :< */
307 GRN_PLUGIN_CLEAR_ERRORcxx . . $ `include/groonga/plugin.h:148:9`!(ctx);
308 }
309
310 if (data->is_close_opened_object_modecxx . . $ $anonymous_type_793223df1636df93_0#is_close_opened_object_mode.) {
311 grn_ctx_pop_temporary_open_spacecxx . . $ grn_ctx_pop_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
312 }
313 }
314 GRN_DB_EACH_ENDcxx . . $ `include/groonga/db.h:148:9`!(ctx, cursor);
315
316 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "tokenizers");
317
318 size_t i, n;
319 n = GRN_BULK_VSIZEcxx . . $ `include/groonga/groonga.h:2642:9`!(&tokenizer_ids) / sizeof(grn_idcxx . . $ grn_id#);
320 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "tokenizers", (int)n);
321 for (i = 0; i < n; i++) {
322 grn_idcxx . . $ grn_id# tokenizer_id;
323 grn_objcxx . . $ grn_obj# *tokenizer;
324
325 tokenizer_id = GRN_RECORD_VALUE_ATcxx . . $ `include/groonga/groonga.h:3148:9`!(&tokenizer_ids, i);
326 tokenizer = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, tokenizer_id);
327
328 command_schema_output_namecxx . . $ command_schema_output_name(cda3a5f3c2e53c6b).(ctx, tokenizer);
329
330 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "tokenizer", 2);
331
332 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "id");
333 command_schema_output_idcxx . . $ command_schema_output_id(cda3a5f3c2e53c6b).(ctx, tokenizer);
334
335 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "name");
336 command_schema_output_namecxx . . $ command_schema_output_name(cda3a5f3c2e53c6b).(ctx, tokenizer);
337
338 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
339 }
340 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
341
342 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &tokenizer_ids);
343 }
344
345 static void
346 command_schema_output_normalizerscxx . . $ command_schema_output_normalizers(5200d3ea2140a9cf).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_schema_datacxx . . $ grn_schema_data# *data)
347 {
348 grn_objcxx . . $ grn_obj# normalizer_ids;
349
350 GRN_RECORD_INITcxx . . $ `include/groonga/groonga.h:2868:9`!(&normalizer_ids, GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!, GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!);
351 GRN_DB_EACH_BEGIN_BY_KEYcxx . . $ `include/groonga/db.h:142:9`!(ctx, cursor, id)
352 {
353 void *name;
354 int name_size;
355 grn_objcxx . . $ grn_obj# *object;
356
357 name_size = grn_table_cursor_get_keycxx . . $ grn_table_cursor_get_key(7d620ebe94cee13a).(ctx, cursor, &name);
358 if (grn_obj_name_is_columncxx . . $ grn_obj_name_is_column(da3161f0ad1ba10a).(ctx, name, name_size)) {
359 continue;
360 }
361
362 if (data->is_close_opened_object_modecxx . . $ $anonymous_type_793223df1636df93_0#is_close_opened_object_mode.) {
363 grn_ctx_push_temporary_open_spacecxx . . $ grn_ctx_push_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
364 }
365
366 object = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, id);
367 if (object) {
368 if (grn_obj_is_normalizer_proccxx . . $ grn_obj_is_normalizer_proc(a5760e5c319a06ee).(ctx, object)) {
369 GRN_RECORD_PUTcxx . . $ `include/groonga/groonga.h:3213:9`!(ctx, &normalizer_ids, id);
370 }
371 } else {
372 /* XXX: this clause is executed when MeCab normalizer is enabled in
373 database but the groonga isn't supported MeCab.
374 We should return error message about it and error exit status
375 but it's too difficult for this architecture. :< */
376 GRN_PLUGIN_CLEAR_ERRORcxx . . $ `include/groonga/plugin.h:148:9`!(ctx);
377 }
378
379 if (data->is_close_opened_object_modecxx . . $ $anonymous_type_793223df1636df93_0#is_close_opened_object_mode.) {
380 grn_ctx_pop_temporary_open_spacecxx . . $ grn_ctx_pop_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
381 }
382 }
383 GRN_DB_EACH_ENDcxx . . $ `include/groonga/db.h:148:9`!(ctx, cursor);
384
385 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "normalizers");
386
387 size_t i, n;
388 n = GRN_BULK_VSIZEcxx . . $ `include/groonga/groonga.h:2642:9`!(&normalizer_ids) / sizeof(grn_idcxx . . $ grn_id#);
389 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "normalizers", (int)n);
390 for (i = 0; i < n; i++) {
391 grn_idcxx . . $ grn_id# normalizer_id;
392 grn_objcxx . . $ grn_obj# *normalizer;
393
394 normalizer_id = GRN_RECORD_VALUE_ATcxx . . $ `include/groonga/groonga.h:3148:9`!(&normalizer_ids, i);
395 normalizer = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, normalizer_id);
396
397 command_schema_output_namecxx . . $ command_schema_output_name(cda3a5f3c2e53c6b).(ctx, normalizer);
398
399 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "normalizer", 2);
400
401 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "id");
402 command_schema_output_idcxx . . $ command_schema_output_id(cda3a5f3c2e53c6b).(ctx, normalizer);
403
404 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "name");
405 command_schema_output_namecxx . . $ command_schema_output_name(cda3a5f3c2e53c6b).(ctx, normalizer);
406
407 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
408 }
409 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
410
411 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &normalizer_ids);
412 }
413
414 static void
415 command_schema_output_token_filterscxx . . $ command_schema_output_token_filters(5200d3ea2140a9cf).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_schema_datacxx . . $ grn_schema_data# *data)
416 {
417 grn_objcxx . . $ grn_obj# token_filter_ids;
418
419 GRN_RECORD_INITcxx . . $ `include/groonga/groonga.h:2868:9`!(&token_filter_ids, GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!, GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!);
420 GRN_DB_EACH_BEGIN_BY_KEYcxx . . $ `include/groonga/db.h:142:9`!(ctx, cursor, id)
421 {
422 void *name;
423 int name_size;
424 grn_objcxx . . $ grn_obj# *object;
425
426 name_size = grn_table_cursor_get_keycxx . . $ grn_table_cursor_get_key(7d620ebe94cee13a).(ctx, cursor, &name);
427 if (grn_obj_name_is_columncxx . . $ grn_obj_name_is_column(da3161f0ad1ba10a).(ctx, name, name_size)) {
428 continue;
429 }
430
431 if (data->is_close_opened_object_modecxx . . $ $anonymous_type_793223df1636df93_0#is_close_opened_object_mode.) {
432 grn_ctx_push_temporary_open_spacecxx . . $ grn_ctx_push_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
433 }
434
435 object = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, id);
436 if (object) {
437 if (grn_obj_is_token_filter_proccxx . . $ grn_obj_is_token_filter_proc(a5760e5c319a06ee).(ctx, object)) {
438 GRN_RECORD_PUTcxx . . $ `include/groonga/groonga.h:3213:9`!(ctx, &token_filter_ids, id);
439 }
440 } else {
441 /* XXX: this clause is executed when MeCab normalizer is enabled in
442 database but the groonga isn't supported MeCab.
443 We should return error message about it and error exit status
444 but it's too difficult for this architecture. :< */
445 GRN_PLUGIN_CLEAR_ERRORcxx . . $ `include/groonga/plugin.h:148:9`!(ctx);
446 }
447
448 if (data->is_close_opened_object_modecxx . . $ $anonymous_type_793223df1636df93_0#is_close_opened_object_mode.) {
449 grn_ctx_pop_temporary_open_spacecxx . . $ grn_ctx_pop_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
450 }
451 }
452 GRN_DB_EACH_ENDcxx . . $ `include/groonga/db.h:148:9`!(ctx, cursor);
453
454 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "token_filters");
455
456 size_t i, n;
457 n = GRN_BULK_VSIZEcxx . . $ `include/groonga/groonga.h:2642:9`!(&token_filter_ids) / sizeof(grn_idcxx . . $ grn_id#);
458 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "token_filters", (int)n);
459 for (i = 0; i < n; i++) {
460 grn_idcxx . . $ grn_id# token_filter_id;
461 grn_objcxx . . $ grn_obj# *token_filter;
462
463 token_filter_id = GRN_RECORD_VALUE_ATcxx . . $ `include/groonga/groonga.h:3148:9`!(&token_filter_ids, i);
464 token_filter = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, token_filter_id);
465
466 command_schema_output_namecxx . . $ command_schema_output_name(cda3a5f3c2e53c6b).(ctx, token_filter);
467
468 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "token_filter", 2);
469
470 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "id");
471 command_schema_output_idcxx . . $ command_schema_output_id(cda3a5f3c2e53c6b).(ctx, token_filter);
472
473 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "name");
474 command_schema_output_namecxx . . $ command_schema_output_name(cda3a5f3c2e53c6b).(ctx, token_filter);
475
476 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
477 }
478 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
479
480 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &token_filter_ids);
481 }
482
483 static const char *
484 command_schema_table_type_namecxx . . $ command_schema_table_type_name(ab3dda79dad54815).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *table)
485 {
486 const char *name = "unknown";
487
488 switch (table->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type.) {
489 case GRN_TABLE_NO_KEYcxx . . $ `include/groonga/groonga.h:898:9`!:
490 name = "array";
491 break;
492 case GRN_TABLE_HASH_KEYcxx . . $ `include/groonga/groonga.h:895:9`!:
493 name = "hash table";
494 break;
495 case GRN_TABLE_PAT_KEYcxx . . $ `include/groonga/groonga.h:896:9`!:
496 name = "patricia trie";
497 break;
498 case GRN_TABLE_DAT_KEYcxx . . $ `include/groonga/groonga.h:897:9`!:
499 name = "double array trie";
500 break;
501 default:
502 break;
503 }
504
505 return name;
506 }
507
508 static void
509 command_schema_table_output_key_typecxx . . $ command_schema_table_output_key_type(cda3a5f3c2e53c6b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *table)
510 {
511 grn_objcxx . . $ grn_obj# *key_type = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
512
513 if (table->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type. != GRN_TABLE_NO_KEYcxx . . $ `include/groonga/groonga.h:898:9`! &&
514 table->headercxx . . $ _grn_obj#header..domaincxx . . $ _grn_obj_header#domain. != GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!) {
515 key_type = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, table->headercxx . . $ _grn_obj#header..domaincxx . . $ _grn_obj_header#domain.);
516 }
517
518 command_schema_output_key_typecxx . . $ command_schema_output_key_type(cda3a5f3c2e53c6b).(ctx, key_type);
519 }
520
521 static void
522 command_schema_table_output_value_typecxx . . $ command_schema_table_output_value_type(cda3a5f3c2e53c6b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *table)
523 {
524 grn_objcxx . . $ grn_obj# *value_type = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
525 grn_idcxx . . $ grn_id# range = GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!;
526
527 if (table->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type. != GRN_TABLE_DAT_KEYcxx . . $ `include/groonga/groonga.h:897:9`!) {
528 range = grn_obj_get_rangecxx . . $ grn_obj_get_range(8dd58acc9865e889).(ctx, table);
529 }
530 if (range != GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!) {
531 value_type = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, range);
532 }
533
534 command_schema_output_value_typecxx . . $ command_schema_output_value_type(cda3a5f3c2e53c6b).(ctx, value_type);
535 }
536
537 static void
538 command_schema_table_output_optionscxx . . $ command_schema_table_output_options(cda3a5f3c2e53c6b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *options)
539 {
540 if (options->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type. == GRN_VOIDcxx . . $ `include/groonga/groonga.h:863:9`!) {
541 grn_ctx_output_nullcxx . . $ grn_ctx_output_null(b578cd6e53d5fe91).(ctx);
542 } else {
543 uint32_tcxx . . $ uint32_t# i;
544 uint32_tcxx . . $ uint32_t# n;
545 grn_objcxx . . $ grn_obj# option;
546
547 n = grn_vector_sizecxx . . $ grn_vector_size(8dd58acc9865e889).(ctx, options);
548 grn_ctx_output_array_opencxx . . $ grn_ctx_output_array_open(f0f392d632556531).(ctx, "options", (int)n);
549 GRN_VOID_INITcxx . . $ `include/groonga/groonga.h:2749:9`!(&option);
550 for (i = 0; i < n; i++) {
551 const char *value;
552 unsigned int length;
553 grn_idcxx . . $ grn_id# domain;
554
555 length = grn_vector_get_elementcxx . . $ grn_vector_get_element(744613554bd9830c).(ctx, options, i, &value, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, &domain);
556 grn_obj_reinitcxx . . $ grn_obj_reinit(fc9ea836325dd1d2).(ctx, &option, domain, 0);
557 grn_bulk_writecxx . . $ grn_bulk_write(4609c18fd87cf054).(ctx, &option, value, length);
558 grn_ctx_output_objcxx . . $ grn_ctx_output_obj(eded88d24d5f23db).(ctx, &option, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
559 }
560 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &option);
561 grn_ctx_output_array_closecxx . . $ grn_ctx_output_array_close(b578cd6e53d5fe91).(ctx);
562 }
563 }
564
565 static void
566 command_schema_table_output_tokenizercxx . . $ command_schema_table_output_tokenizer(cda3a5f3c2e53c6b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *table)
567 {
568 grn_objcxx . . $ grn_obj# *tokenizer;
569
570 tokenizer = grn_obj_get_infocxx . . $ grn_obj_get_info(333a81d4a8f20670).(ctx, table, GRN_INFO_DEFAULT_TOKENIZERcxx . . $ GRN_INFO_DEFAULT_TOKENIZER., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
571 if (!tokenizer) {
572 grn_ctx_output_nullcxx . . $ grn_ctx_output_null(b578cd6e53d5fe91).(ctx);
573 return;
574 }
575
576 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "tokenizer", 3);
577
578 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "id");
579 command_schema_output_idcxx . . $ command_schema_output_id(cda3a5f3c2e53c6b).(ctx, tokenizer);
580
581 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "name");
582 command_schema_output_namecxx . . $ command_schema_output_name(cda3a5f3c2e53c6b).(ctx, tokenizer);
583
584 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "options");
585 {
586 grn_objcxx . . $ grn_obj# options;
587
588 GRN_VOID_INITcxx . . $ `include/groonga/groonga.h:2749:9`!(&options);
589 grn_table_get_default_tokenizer_optionscxx . . $ grn_table_get_default_tokenizer_options(d825b4ed5bf12304).(ctx, table, &options);
590 command_schema_table_output_optionscxx . . $ command_schema_table_output_options(cda3a5f3c2e53c6b).(ctx, &options);
591 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &options);
592 }
593
594 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
595 }
596
597 static void
598 command_schema_table_output_normalizercxx . . $ command_schema_table_output_normalizer(cda3a5f3c2e53c6b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *table)
599 {
600 grn_objcxx . . $ grn_obj# *normalizer;
601
602 normalizer = grn_obj_get_infocxx . . $ grn_obj_get_info(333a81d4a8f20670).(ctx, table, GRN_INFO_NORMALIZERcxx . . $ GRN_INFO_NORMALIZER., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
603 if (!normalizer) {
604 grn_ctx_output_nullcxx . . $ grn_ctx_output_null(b578cd6e53d5fe91).(ctx);
605 return;
606 }
607
608 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "normalizer", 3);
609
610 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "id");
611 command_schema_output_idcxx . . $ command_schema_output_id(cda3a5f3c2e53c6b).(ctx, normalizer);
612
613 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "name");
614 command_schema_output_namecxx . . $ command_schema_output_name(cda3a5f3c2e53c6b).(ctx, normalizer);
615
616 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "options");
617 {
618 grn_objcxx . . $ grn_obj# options;
619
620 GRN_VOID_INITcxx . . $ `include/groonga/groonga.h:2749:9`!(&options);
621 grn_table_get_normalizer_optionscxx . . $ grn_table_get_normalizer_options(d825b4ed5bf12304).(ctx, table, &options);
622 command_schema_table_output_optionscxx . . $ command_schema_table_output_options(cda3a5f3c2e53c6b).(ctx, &options);
623 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &options);
624 }
625
626 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
627 }
628
629 static void
630 command_schema_table_output_table_modulescxx . . $ command_schema_table_output_table_modules(b05317970bfd350f).(grn_ctxcxx . . $ grn_ctx# *ctx,
631 grn_objcxx . . $ grn_obj# *table,
632 grn_info_typecxx . . $ grn_info_type# type,
633 const char *singular,
634 const char *plural)
635 {
636 grn_objcxx . . $ grn_obj# modules;
637 GRN_PTR_INITcxx . . $ `include/groonga/groonga.h:2869:9`!(&modules, GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!, GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!);
638 if (grn_obj_is_table_with_keycxx . . $ grn_obj_is_table_with_key(a5760e5c319a06ee).(ctx, table)) {
639 grn_obj_get_infocxx . . $ grn_obj_get_info(333a81d4a8f20670).(ctx, table, type, &modules);
640 }
641
642 size_t n = GRN_PTR_VECTOR_SIZEcxx . . $ `include/groonga/groonga.h:3265:9`!(&modules);
643 grn_ctx_output_array_opencxx . . $ grn_ctx_output_array_open(f0f392d632556531).(ctx, plural, (int)n);
644 size_t i;
645 for (i = 0; i < n; i++) {
646 grn_objcxx . . $ grn_obj# *module = GRN_PTR_VALUE_ATcxx . . $ `include/groonga/groonga.h:3150:9`!(&modules, i);
647
648 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, singular, 3);
649 {
650 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "id");
651 command_schema_output_idcxx . . $ command_schema_output_id(cda3a5f3c2e53c6b).(ctx, module);
652
653 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "name");
654 command_schema_output_namecxx . . $ command_schema_output_name(cda3a5f3c2e53c6b).(ctx, module);
655
656 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "options");
657 {
658 grn_objcxx . . $ grn_obj# options;
659 GRN_VOID_INITcxx . . $ `include/groonga/groonga.h:2749:9`!(&options);
660 switch (type) {
661 case GRN_INFO_NORMALIZERScxx . . $ GRN_INFO_NORMALIZERS.:
662 grn_table_get_normalizers_optionscxx . . $ grn_table_get_normalizers_options(f5a6f2c02ff50f08).(ctx, table, (uint32_tcxx . . $ uint32_t#)i, &options);
663 break;
664 case GRN_INFO_TOKEN_FILTERScxx . . $ GRN_INFO_TOKEN_FILTERS.:
665 grn_table_get_token_filters_optionscxx . . $ grn_table_get_token_filters_options(f5a6f2c02ff50f08).(ctx,
666 table,
667 (uint32_tcxx . . $ uint32_t#)i,
668 &options);
669 break;
670 case GRN_INFO_EXTRACTORScxx . . $ GRN_INFO_EXTRACTORS.:
671 grn_table_get_token_filters_optionscxx . . $ grn_table_get_token_filters_options(f5a6f2c02ff50f08).(ctx,
672 table,
673 (uint32_tcxx . . $ uint32_t#)i,
674 &options);
675 break;
676 default:
677 break;
678 }
679 command_schema_table_output_optionscxx . . $ command_schema_table_output_options(cda3a5f3c2e53c6b).(ctx, &options);
680 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &options);
681 }
682 }
683 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
684 }
685 grn_ctx_output_array_closecxx . . $ grn_ctx_output_array_close(b578cd6e53d5fe91).(ctx);
686
687 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &modules);
688 }
689
690 static void
691 command_schema_table_command_collect_argumentscxx . . $ command_schema_table_command_collect_arguments(99eba0d3a8372d65).(grn_ctxcxx . . $ grn_ctx# *ctx,
692 grn_objcxx . . $ grn_obj# *table,
693 grn_objcxx . . $ grn_obj# *arguments)
694 {
695 #define ADDcxx . . $ `lib/proc/proc_schema.c:695:9`!(name_, value_) \
696 grn_vector_add_element(ctx, \
697 arguments, \
698 name_, \
699 (uint32_t)strlen(name_), \
700 0, \
701 GRN_DB_TEXT); \
702 grn_vector_add_element(ctx, \
703 arguments, \
704 value_, \
705 (uint32_t)strlen(value_), \
706 0, \
707 GRN_DB_TEXT)
708
709 #define ADD_OBJECT_NAMEcxx . . $ `lib/proc/proc_schema.c:709:9`!(name_, object_) \
710 do { \
711 char object_name[GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!]; \
712 int object_name_size; \
713 object_name_size = \
714 grn_obj_name(ctx, object_, object_name, GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!); \
715 object_name[object_name_size] = '\0'; \
716 ADDcxx . . $ `lib/proc/proc_schema.c:695:9`!(name_, object_name); \
717 } while (falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!)
718
719 ADD_OBJECT_NAMEcxx . . $ `lib/proc/proc_schema.c:709:9`!("name", table);
720
721 {
722 grn_objcxx . . $ grn_obj# flags;
723 grn_table_flagscxx . . $ grn_table_flags# table_flags;
724 grn_table_flagscxx . . $ grn_table_flags# ignored_flags = GRN_OBJ_KEY_NORMALIZEcxx . . $ `include/groonga/groonga.h:718:9`! | GRN_OBJ_PERSISTENTcxx . . $ `include/groonga/groonga.h:827:9`!;
725 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&flags, 0);
726 grn_table_get_infocxx . . $ grn_table_get_info(a1e4a6d36d3aee7c).(ctx, table, &table_flags, 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`!, 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`!);
727 grn_dump_table_create_flagscxx . . $ grn_dump_table_create_flags(e6d1f76f34fc094d).(ctx, table_flags & ~ignored_flags, &flags);
728 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, &flags, '\0');
729 ADDcxx . . $ `lib/proc/proc_schema.c:695:9`!("flags", GRN_TEXT_VALUEcxx . . $ `include/groonga/groonga.h:2785:9`!(&flags));
730 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &flags);
731 }
732
733 {
734 grn_objcxx . . $ grn_obj# *key_type = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
735
736 if (table->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type. != GRN_TABLE_NO_KEYcxx . . $ `include/groonga/groonga.h:898:9`! &&
737 table->headercxx . . $ _grn_obj#header..domaincxx . . $ _grn_obj_header#domain. != GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!) {
738 key_type = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, table->headercxx . . $ _grn_obj#header..domaincxx . . $ _grn_obj_header#domain.);
739 }
740 if (key_type) {
741 ADD_OBJECT_NAMEcxx . . $ `lib/proc/proc_schema.c:709:9`!("key_type", key_type);
742 }
743 }
744
745 {
746 grn_objcxx . . $ grn_obj# *value_type = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
747 grn_idcxx . . $ grn_id# range = GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!;
748
749 if (table->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type. != GRN_TABLE_DAT_KEYcxx . . $ `include/groonga/groonga.h:897:9`!) {
750 range = grn_obj_get_rangecxx . . $ grn_obj_get_range(8dd58acc9865e889).(ctx, table);
751 }
752 if (range != GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!) {
753 value_type = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, range);
754 }
755 if (value_type) {
756 ADD_OBJECT_NAMEcxx . . $ `lib/proc/proc_schema.c:709:9`!("value_type", value_type);
757 }
758 }
759
760 {
761 grn_objcxx . . $ grn_obj# *tokenizer;
762 tokenizer = grn_obj_get_infocxx . . $ grn_obj_get_info(333a81d4a8f20670).(ctx, table, GRN_INFO_DEFAULT_TOKENIZERcxx . . $ GRN_INFO_DEFAULT_TOKENIZER., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
763 if (tokenizer) {
764 grn_objcxx . . $ grn_obj# sub_output;
765 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&sub_output, 0);
766 grn_table_get_default_tokenizer_stringcxx . . $ grn_table_get_default_tokenizer_string(d825b4ed5bf12304).(ctx, table, &sub_output);
767 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, &sub_output, '\0');
768 ADDcxx . . $ `lib/proc/proc_schema.c:695:9`!("default_tokenizer", GRN_TEXT_VALUEcxx . . $ `include/groonga/groonga.h:2785:9`!(&sub_output));
769 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &sub_output);
770 }
771 }
772
773 {
774 grn_objcxx . . $ grn_obj# *normalizer;
775 normalizer = grn_obj_get_infocxx . . $ grn_obj_get_info(333a81d4a8f20670).(ctx, table, GRN_INFO_NORMALIZERcxx . . $ GRN_INFO_NORMALIZER., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
776 if (!normalizer && (table->headercxx . . $ _grn_obj#header..flagscxx . . $ _grn_obj_header#flags. & GRN_OBJ_KEY_NORMALIZEcxx . . $ `include/groonga/groonga.h:718:9`!)) {
777 normalizer = grn_ctx_getcxx . . $ grn_ctx_get(70fde0087014f9ea).(ctx, "NormalizerAuto", -1);
778 }
779 if (normalizer) {
780 grn_objcxx . . $ grn_obj# sub_output;
781 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&sub_output, 0);
782 grn_table_get_normalizers_stringcxx . . $ grn_table_get_normalizers_string(d825b4ed5bf12304).(ctx, table, &sub_output);
783 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, &sub_output, '\0');
784 ADDcxx . . $ `lib/proc/proc_schema.c:695:9`!("normalizer", GRN_TEXT_VALUEcxx . . $ `include/groonga/groonga.h:2785:9`!(&sub_output));
785 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &sub_output);
786 }
787 }
788
789 if (table->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type. != GRN_TABLE_NO_KEYcxx . . $ `include/groonga/groonga.h:898:9`!) {
790 grn_objcxx . . $ grn_obj# token_filters;
791 GRN_PTR_INITcxx . . $ `include/groonga/groonga.h:2869:9`!(&token_filters, GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!, GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!);
792 grn_obj_get_infocxx . . $ grn_obj_get_info(333a81d4a8f20670).(ctx, table, GRN_INFO_TOKEN_FILTERScxx . . $ GRN_INFO_TOKEN_FILTERS., &token_filters);
793 if (grn_vector_sizecxx . . $ grn_vector_size(8dd58acc9865e889).(ctx, &token_filters) > 0) {
794 grn_objcxx . . $ grn_obj# sub_output;
795 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&sub_output, 0);
796 grn_table_get_token_filters_stringcxx . . $ grn_table_get_token_filters_string(d825b4ed5bf12304).(ctx, table, &sub_output);
797 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, &sub_output, '\0');
798 ADDcxx . . $ `lib/proc/proc_schema.c:695:9`!("token_filters", GRN_TEXT_VALUEcxx . . $ `include/groonga/groonga.h:2785:9`!(&sub_output));
799 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &sub_output);
800 }
801 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &token_filters);
802
803 grn_objcxx . . $ grn_obj# extractors;
804 GRN_PTR_INITcxx . . $ `include/groonga/groonga.h:2869:9`!(&extractors, GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!, GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!);
805 grn_obj_get_infocxx . . $ grn_obj_get_info(333a81d4a8f20670).(ctx, table, GRN_INFO_EXTRACTORScxx . . $ GRN_INFO_EXTRACTORS., &extractors);
806 if (grn_vector_sizecxx . . $ grn_vector_size(8dd58acc9865e889).(ctx, &extractors) > 0) {
807 grn_objcxx . . $ grn_obj# sub_output;
808 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&sub_output, 0);
809 grn_table_get_extractors_stringcxx . . $ grn_table_get_extractors_string(d825b4ed5bf12304).(ctx, table, &sub_output);
810 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, &sub_output, '\0');
811 ADDcxx . . $ `lib/proc/proc_schema.c:695:9`!("extractors", GRN_TEXT_VALUEcxx . . $ `include/groonga/groonga.h:2785:9`!(&sub_output));
812 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &sub_output);
813 }
814 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &extractors);
815 }
816
817 #undef ADD_OBJECT_NAMEcxx . . $ `lib/proc/proc_schema.c:709:9`!
818 #undef ADDcxx . . $ `lib/proc/proc_schema.c:695:9`!
819 }
820
821 static void
822 command_schema_table_output_commandcxx . . $ command_schema_table_output_command(cda3a5f3c2e53c6b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *table)
823 {
824 grn_objcxx . . $ grn_obj# arguments;
825
826 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&arguments, GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!);
827 command_schema_table_command_collect_argumentscxx . . $ command_schema_table_command_collect_arguments(99eba0d3a8372d65).(ctx, table, &arguments);
828
829 command_schema_output_commandcxx . . $ command_schema_output_command(bff8cce4b2bec01a).(ctx, "table_create", &arguments);
830
831 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &arguments);
832 }
833
834 static void
835 command_schema_column_output_typecxx . . $ command_schema_column_output_type(cda3a5f3c2e53c6b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *column)
836 {
837 switch (column->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type.) {
838 case GRN_COLUMN_FIX_SIZEcxx . . $ `include/groonga/groonga.h:900:9`!:
839 case GRN_COLUMN_VAR_SIZEcxx . . $ `include/groonga/groonga.h:901:9`!:
840 switch (column->headercxx . . $ _grn_obj#header..flagscxx . . $ _grn_obj_header#flags. & GRN_OBJ_COLUMN_TYPE_MASKcxx . . $ `include/groonga/groonga.h:726:9`!) {
841 case GRN_OBJ_COLUMN_SCALARcxx . . $ `include/groonga/groonga.h:731:9`!:
842 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "scalar");
843 break;
844 case GRN_OBJ_COLUMN_VECTORcxx . . $ `include/groonga/groonga.h:736:9`!:
845 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "vector");
846 break;
847 }
848 break;
849 case GRN_COLUMN_INDEXcxx . . $ `include/groonga/groonga.h:902:9`!:
850 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "index");
851 break;
852 }
853 }
854
855 static void
856 command_schema_column_output_value_typecxx . . $ command_schema_column_output_value_type(cda3a5f3c2e53c6b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *column)
857 {
858 grn_objcxx . . $ grn_obj# *value_type;
859 value_type = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, grn_obj_get_rangecxx . . $ grn_obj_get_range(8dd58acc9865e889).(ctx, column));
860 command_schema_output_value_typecxx . . $ command_schema_output_value_type(cda3a5f3c2e53c6b).(ctx, value_type);
861 }
862
863 static void
864 command_schema_column_output_compresscxx . . $ command_schema_column_output_compress(cda3a5f3c2e53c6b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *column)
865 {
866 const char *compress = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
867
868 if (column->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type. != GRN_COLUMN_INDEXcxx . . $ `include/groonga/groonga.h:902:9`!) {
869 switch (column->headercxx . . $ _grn_obj#header..flagscxx . . $ _grn_obj_header#flags. & GRN_OBJ_COMPRESS_MASKcxx . . $ `include/groonga/groonga.h:743:9`!) {
870 case GRN_OBJ_COMPRESS_ZLIBcxx . . $ `include/groonga/groonga.h:749:9`!:
871 compress = "zlib";
872 break;
873 case GRN_OBJ_COMPRESS_LZ4cxx . . $ `include/groonga/groonga.h:754:9`!:
874 compress = "lz4";
875 break;
876 case GRN_OBJ_COMPRESS_ZSTDcxx . . $ `include/groonga/groonga.h:761:9`!:
877 compress = "zstd";
878 break;
879 case GRN_OBJ_COMPRESS_OPENZLcxx . . $ `include/groonga/groonga.h:768:9`!:
880 compress = "openzl";
881 break;
882 default:
883 break;
884 }
885 }
886
887 if (compress) {
888 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, compress);
889 } else {
890 grn_ctx_output_nullcxx . . $ grn_ctx_output_null(b578cd6e53d5fe91).(ctx);
891 }
892 }
893
894 static void
895 command_schema_column_output_missingcxx . . $ command_schema_column_output_missing(cda3a5f3c2e53c6b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *column)
896 {
897 const char *missing = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
898
899 if (column->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type. != GRN_COLUMN_INDEXcxx . . $ `include/groonga/groonga.h:902:9`!) {
900 switch (grn_column_get_flagscxx . . $ grn_column_get_flags(8dd58acc9865e889).(ctx, column) & GRN_OBJ_MISSING_MASKcxx . . $ `include/groonga/groonga.h:840:9`!) {
901 case GRN_OBJ_MISSING_ADDcxx . . $ `include/groonga/groonga.h:841:9`!:
902 missing = "add";
903 break;
904 case GRN_OBJ_MISSING_IGNOREcxx . . $ `include/groonga/groonga.h:842:9`!:
905 missing = "ignore";
906 break;
907 case GRN_OBJ_MISSING_NILcxx . . $ `include/groonga/groonga.h:843:9`!:
908 missing = "nil";
909 break;
910 default:
911 break;
912 }
913 }
914
915 if (missing) {
916 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, missing);
917 } else {
918 grn_ctx_output_nullcxx . . $ grn_ctx_output_null(b578cd6e53d5fe91).(ctx);
919 }
920 }
921
922 static void
923 command_schema_column_output_invalidcxx . . $ command_schema_column_output_invalid(cda3a5f3c2e53c6b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *column)
924 {
925 const char *invalid = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
926
927 if (column->headercxx . . $ _grn_obj#header..typecxx . . $ _grn_obj_header#type. != GRN_COLUMN_INDEXcxx . . $ `include/groonga/groonga.h:902:9`!) {
928 switch (grn_column_get_flagscxx . . $ grn_column_get_flags(8dd58acc9865e889).(ctx, column) & GRN_OBJ_INVALID_MASKcxx . . $ `include/groonga/groonga.h:845:9`!) {
929 case GRN_OBJ_INVALID_ERRORcxx . . $ `include/groonga/groonga.h:846:9`!:
930 invalid = "error";
931 break;
932 case GRN_OBJ_INVALID_WARNcxx . . $ `include/groonga/groonga.h:847:9`!:
933 invalid = "warn";
934 break;
935 case GRN_OBJ_INVALID_IGNOREcxx . . $ `include/groonga/groonga.h:848:9`!:
936 invalid = "ignore";
937 break;
938 default:
939 break;
940 }
941 }
942
943 if (invalid) {
944 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, invalid);
945 } else {
946 grn_ctx_output_nullcxx . . $ grn_ctx_output_null(b578cd6e53d5fe91).(ctx);
947 }
948 }
949
950 static void
951 command_schema_column_output_sourcescxx . . $ command_schema_column_output_sources(cda3a5f3c2e53c6b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *column)
952 {
953 grn_objcxx . . $ grn_obj# *source_table;
954 grn_objcxx . . $ grn_obj# source_ids;
955 size_t i, n_ids;
956
957 source_table = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, grn_obj_get_rangecxx . . $ grn_obj_get_range(8dd58acc9865e889).(ctx, column));
958
959 GRN_RECORD_INITcxx . . $ `include/groonga/groonga.h:2868:9`!(&source_ids, GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!, GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!);
960 grn_obj_get_infocxx . . $ grn_obj_get_info(333a81d4a8f20670).(ctx, column, GRN_INFO_SOURCEcxx . . $ GRN_INFO_SOURCE., &source_ids);
961 n_ids = GRN_BULK_VSIZEcxx . . $ `include/groonga/groonga.h:2642:9`!(&source_ids) / sizeof(grn_idcxx . . $ grn_id#);
962 grn_ctx_output_array_opencxx . . $ grn_ctx_output_array_open(f0f392d632556531).(ctx, "sources", (int)n_ids);
963 for (i = 0; i < n_ids; i++) {
964 grn_idcxx . . $ grn_id# source_id;
965 grn_objcxx . . $ grn_obj# *source;
966
967 source_id = GRN_RECORD_VALUE_ATcxx . . $ `include/groonga/groonga.h:3148:9`!(&source_ids, i);
968 source = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, source_id);
969
970 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "source", 4);
971
972 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "id");
973 if (grn_obj_is_tablecxx . . $ grn_obj_is_table(a5760e5c319a06ee).(ctx, source)) {
974 command_schema_output_idcxx . . $ command_schema_output_id(cda3a5f3c2e53c6b).(ctx, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
975 } else {
976 command_schema_output_idcxx . . $ command_schema_output_id(cda3a5f3c2e53c6b).(ctx, source);
977 }
978
979 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "name");
980 if (grn_obj_is_tablecxx . . $ grn_obj_is_table(a5760e5c319a06ee).(ctx, source)) {
981 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "_key");
982 } else {
983 command_schema_output_column_namecxx . . $ command_schema_output_column_name(cda3a5f3c2e53c6b).(ctx, source);
984 }
985
986 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "table");
987 command_schema_output_namecxx . . $ command_schema_output_name(cda3a5f3c2e53c6b).(ctx, source_table);
988
989 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "full_name");
990 if (grn_obj_is_tablecxx . . $ grn_obj_is_table(a5760e5c319a06ee).(ctx, source)) {
991 char name[GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!];
992 int name_size;
993 name_size = grn_obj_namecxx . . $ grn_obj_name(a51d1bff955f2f21).(ctx, source, name, GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!);
994 name[name_size] = '\0';
995 grn_strcatcxx . . $ `include/groonga/portability.h:114:11`!(name, GRN_TABLE_MAX_KEY_SIZE, "._key");
996 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, name);
997 } else {
998 command_schema_output_namecxx . . $ command_schema_output_name(cda3a5f3c2e53c6b).(ctx, source);
999 }
1000
1001 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
1002 }
1003 grn_ctx_output_array_closecxx . . $ grn_ctx_output_array_close(b578cd6e53d5fe91).(ctx);
1004
1005 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &source_ids);
1006 }
1007
1008 static void
1009 command_schema_column_output_generatorcxx . . $ command_schema_column_output_generator(cda3a5f3c2e53c6b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *column)
1010 {
1011 grn_objcxx . . $ grn_obj# generator;
1012 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&generator, 0);
1013 if (grn_obj_is_generated_columncxx . . $ grn_obj_is_generated_column(a5760e5c319a06ee).(ctx, column)) {
1014 grn_obj_get_infocxx . . $ grn_obj_get_info(333a81d4a8f20670).(ctx, column, GRN_INFO_GENERATORcxx . . $ GRN_INFO_GENERATOR., &generator);
1015 }
1016 grn_ctx_output_strcxx . . $ grn_ctx_output_str(bd29ebb5071afc4b).(ctx, GRN_TEXT_VALUEcxx . . $ `include/groonga/groonga.h:2785:9`!(&generator), GRN_TEXT_LENcxx . . $ `include/groonga/groonga.h:2786:9`!(&generator));
1017 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &generator);
1018 }
1019
1020 static void
1021 command_schema_output_indexescxx . . $ command_schema_output_indexes(cda3a5f3c2e53c6b).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *object)
1022 {
1023 uint32_tcxx . . $ uint32_t# i;
1024 grn_index_datumcxx . . $ grn_index_datum# *index_data = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
1025 uint32_tcxx . . $ uint32_t# n_index_data = 0;
1026
1027 n_index_data = grn_column_get_all_index_datacxx . . $ grn_column_get_all_index_data(761aa4a629c570c6).(ctx, object, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, 0);
1028 if (n_index_data > 0) {
1029 index_data = GRN_PLUGIN_MALLOCcxx . . $ `include/groonga/plugin.h:88:9`!(ctx, sizeof(grn_index_datum) * n_index_data);
1030 if (!index_data) {
1031 GRN_PLUGIN_ERRORcxx . . $ `include/groonga/plugin.h:145:9`!(ctx,
1032 GRN_NO_MEMORY_AVAILABLE,
1033 "[schema] failed to allocate memory for indexes");
1034 return;
1035 }
1036 grn_column_get_all_index_datacxx . . $ grn_column_get_all_index_data(761aa4a629c570c6).(ctx, object, index_data, n_index_data);
1037 }
1038
1039 grn_ctx_output_array_opencxx . . $ grn_ctx_output_array_open(f0f392d632556531).(ctx, "indexes", (int)n_index_data);
1040 for (i = 0; i < n_index_data; i++) {
1041 grn_objcxx . . $ grn_obj# *lexicon;
1042
1043 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "index", 5);
1044
1045 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "id");
1046 command_schema_output_idcxx . . $ command_schema_output_id(cda3a5f3c2e53c6b).(ctx, index_data[i].indexcxx . . $ _grn_index_datum#index.);
1047
1048 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "full_name");
1049 command_schema_output_namecxx . . $ command_schema_output_name(cda3a5f3c2e53c6b).(ctx, index_data[i].indexcxx . . $ _grn_index_datum#index.);
1050
1051 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "table");
1052 lexicon = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, index_data[i].indexcxx . . $ _grn_index_datum#index.->headercxx . . $ _grn_obj#header..domaincxx . . $ _grn_obj_header#domain.);
1053 command_schema_output_namecxx . . $ command_schema_output_name(cda3a5f3c2e53c6b).(ctx, lexicon);
1054
1055 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "name");
1056 command_schema_output_column_namecxx . . $ command_schema_output_column_name(cda3a5f3c2e53c6b).(ctx, index_data[i].indexcxx . . $ _grn_index_datum#index.);
1057
1058 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "section");
1059 grn_ctx_output_uint64cxx . . $ grn_ctx_output_uint64(150f498c5f9d24bd).(ctx, index_data[i].sectioncxx . . $ _grn_index_datum#section.);
1060
1061 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
1062 }
1063 grn_ctx_output_array_closecxx . . $ grn_ctx_output_array_close(b578cd6e53d5fe91).(ctx);
1064
1065 if (index_data) {
1066 GRN_PLUGIN_FREEcxx . . $ `include/groonga/plugin.h:100:9`!(ctx, index_data);
1067 }
1068 }
1069
1070 static void
1071 command_schema_column_command_collect_argumentscxx . . $ command_schema_column_command_collect_arguments(4ad76b35c8eff5b1).(grn_ctxcxx . . $ grn_ctx# *ctx,
1072 grn_objcxx . . $ grn_obj# *table,
1073 grn_objcxx . . $ grn_obj# *column,
1074 grn_objcxx . . $ grn_obj# *arguments)
1075 {
1076 #define ADDcxx . . $ `lib/proc/proc_schema.c:1076:9`!(name_, value_) \
1077 grn_vector_add_element(ctx, \
1078 arguments, \
1079 name_, \
1080 (uint32_t)strlen(name_), \
1081 0, \
1082 GRN_DB_TEXT); \
1083 grn_vector_add_element(ctx, \
1084 arguments, \
1085 value_, \
1086 (uint32_t)strlen(value_), \
1087 0, \
1088 GRN_DB_TEXT)
1089
1090 #define ADD_OBJECT_NAMEcxx . . $ `lib/proc/proc_schema.c:1090:9`!(name_, object_) \
1091 do { \
1092 char object_name[GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!]; \
1093 int object_name_size; \
1094 object_name_size = \
1095 grn_obj_name(ctx, object_, object_name, GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!); \
1096 object_name[object_name_size] = '\0'; \
1097 ADDcxx . . $ `lib/proc/proc_schema.c:1076:9`!(name_, object_name); \
1098 } while (falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!)
1099
1100 ADD_OBJECT_NAMEcxx . . $ `lib/proc/proc_schema.c:1090:9`!("table", table);
1101 {
1102 char column_name[GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!];
1103 int column_name_size;
1104 column_name_size =
1105 grn_column_namecxx . . $ grn_column_name(a51d1bff955f2f21).(ctx, column, column_name, GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!);
1106 column_name[column_name_size] = '\0';
1107 ADDcxx . . $ `lib/proc/proc_schema.c:1076:9`!("name", column_name);
1108 }
1109
1110 {
1111 grn_objcxx . . $ grn_obj# flags;
1112 grn_column_flagscxx . . $ grn_column_flags# column_flags;
1113
1114 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&flags, 0);
1115 column_flags = grn_column_get_flagscxx . . $ grn_column_get_flags(8dd58acc9865e889).(ctx, column);
1116 column_flags &= ~((grn_column_flagscxx . . $ grn_column_flags#)GRN_OBJ_PERSISTENTcxx . . $ `include/groonga/groonga.h:827:9`!);
1117 grn_dump_column_create_flagscxx . . $ grn_dump_column_create_flags(e6d1f76f34fc094d).(ctx, column_flags, &flags);
1118 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, &flags, '\0');
1119 ADDcxx . . $ `lib/proc/proc_schema.c:1076:9`!("flags", GRN_TEXT_VALUEcxx . . $ `include/groonga/groonga.h:2785:9`!(&flags));
1120 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &flags);
1121 }
1122
1123 {
1124 grn_objcxx . . $ grn_obj# *value_type;
1125
1126 value_type = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, grn_obj_get_rangecxx . . $ grn_obj_get_range(8dd58acc9865e889).(ctx, column));
1127 ADD_OBJECT_NAMEcxx . . $ `lib/proc/proc_schema.c:1090:9`!("type", value_type);
1128 }
1129
1130 {
1131 grn_objcxx . . $ grn_obj# source_ids;
1132 size_t n_ids;
1133
1134 GRN_RECORD_INITcxx . . $ `include/groonga/groonga.h:2868:9`!(&source_ids, GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!, GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!);
1135 grn_obj_get_infocxx . . $ grn_obj_get_info(333a81d4a8f20670).(ctx, column, GRN_INFO_SOURCEcxx . . $ GRN_INFO_SOURCE., &source_ids);
1136
1137 n_ids = GRN_BULK_VSIZEcxx . . $ `include/groonga/groonga.h:2642:9`!(&source_ids) / sizeof(grn_idcxx . . $ grn_id#);
1138 if (n_ids > 0) {
1139 grn_objcxx . . $ grn_obj# sources;
1140 size_t i;
1141
1142 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&sources, 0);
1143 for (i = 0; i < n_ids; i++) {
1144 grn_idcxx . . $ grn_id# source_id;
1145 grn_objcxx . . $ grn_obj# *source;
1146 char name[GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!];
1147 size_t name_size;
1148
1149 source_id = GRN_RECORD_VALUE_ATcxx . . $ `include/groonga/groonga.h:3148:9`!(&source_ids, i);
1150 source = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, source_id);
1151
1152 if (grn_obj_is_tablecxx . . $ grn_obj_is_table(a5760e5c319a06ee).(ctx, source)) {
1153 grn_strcpycxx . . $ `include/groonga/portability.h:101:11`!(name, GRN_TABLE_MAX_KEY_SIZE, "_key");
1154 name_size = strlencxx . . $ strlen(751346f8406fd082).(name);
1155 } else {
1156 name_size =
1157 (size_t)grn_column_namecxx . . $ grn_column_name(a51d1bff955f2f21).(ctx, source, name, GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!);
1158 }
1159 if (i > 0) {
1160 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, &sources, ',');
1161 }
1162 GRN_TEXT_PUTcxx . . $ `include/groonga/groonga.h:2773:9`!(ctx, &sources, name, name_size);
1163 }
1164 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, &sources, '\0');
1165 ADDcxx . . $ `lib/proc/proc_schema.c:1076:9`!("source", GRN_TEXT_VALUEcxx . . $ `include/groonga/groonga.h:2785:9`!(&sources));
1166 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &sources);
1167 }
1168 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &source_ids);
1169 }
1170
1171 {
1172 grn_objcxx . . $ grn_obj# generator;
1173 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&generator, 0);
1174 if (grn_obj_is_generated_columncxx . . $ grn_obj_is_generated_column(a5760e5c319a06ee).(ctx, column)) {
1175 grn_obj_get_infocxx . . $ grn_obj_get_info(333a81d4a8f20670).(ctx, column, GRN_INFO_GENERATORcxx . . $ GRN_INFO_GENERATOR., &generator);
1176 }
1177 if (GRN_TEXT_LENcxx . . $ `include/groonga/groonga.h:2786:9`!(&generator) > 0) {
1178 GRN_TEXT_PUTCcxx . . $ `include/groonga/groonga.h:2775:9`!(ctx, &generator, '\0');
1179 ADDcxx . . $ `lib/proc/proc_schema.c:1076:9`!("generator", GRN_TEXT_VALUEcxx . . $ `include/groonga/groonga.h:2785:9`!(&generator));
1180 }
1181 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &generator);
1182 }
1183
1184 #undef ADD_OBJECT_NAMEcxx . . $ `lib/proc/proc_schema.c:1090:9`!
1185 #undef ADDcxx . . $ `lib/proc/proc_schema.c:1076:9`!
1186 }
1187
1188 static void
1189 command_schema_column_output_commandcxx . . $ command_schema_column_output_command(99eba0d3a8372d65).(grn_ctxcxx . . $ grn_ctx# *ctx,
1190 grn_objcxx . . $ grn_obj# *table,
1191 grn_objcxx . . $ grn_obj# *column)
1192 {
1193 grn_objcxx . . $ grn_obj# arguments;
1194
1195 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&arguments, GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!);
1196 command_schema_column_command_collect_argumentscxx . . $ command_schema_column_command_collect_arguments(4ad76b35c8eff5b1).(ctx,
1197 table,
1198 column,
1199 &arguments);
1200
1201 command_schema_output_commandcxx . . $ command_schema_output_command(bff8cce4b2bec01a).(ctx, "column_create", &arguments);
1202
1203 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &arguments);
1204 }
1205
1206 static void
1207 command_schema_column_outputcxx . . $ command_schema_column_output(99eba0d3a8372d65).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_objcxx . . $ grn_obj# *table, grn_objcxx . . $ grn_obj# *column)
1208 {
1209 if (!column) {
1210 return;
1211 }
1212
1213 command_schema_output_column_namecxx . . $ command_schema_output_column_name(cda3a5f3c2e53c6b).(ctx, column);
1214
1215 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "column", 15);
1216
1217 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "id");
1218 command_schema_output_idcxx . . $ command_schema_output_id(cda3a5f3c2e53c6b).(ctx, column);
1219
1220 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "name");
1221 command_schema_output_column_namecxx . . $ command_schema_output_column_name(cda3a5f3c2e53c6b).(ctx, column);
1222
1223 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "table");
1224 command_schema_output_namecxx . . $ command_schema_output_name(cda3a5f3c2e53c6b).(ctx, table);
1225
1226 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "full_name");
1227 command_schema_output_namecxx . . $ command_schema_output_name(cda3a5f3c2e53c6b).(ctx, column);
1228
1229 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "type");
1230 command_schema_column_output_typecxx . . $ command_schema_column_output_type(cda3a5f3c2e53c6b).(ctx, column);
1231
1232 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "value_type");
1233 command_schema_column_output_value_typecxx . . $ command_schema_column_output_value_type(cda3a5f3c2e53c6b).(ctx, column);
1234
1235 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "compress");
1236 command_schema_column_output_compresscxx . . $ command_schema_column_output_compress(cda3a5f3c2e53c6b).(ctx, column);
1237
1238 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "missing");
1239 command_schema_column_output_missingcxx . . $ command_schema_column_output_missing(cda3a5f3c2e53c6b).(ctx, column);
1240
1241 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "invalid");
1242 command_schema_column_output_invalidcxx . . $ command_schema_column_output_invalid(cda3a5f3c2e53c6b).(ctx, column);
1243
1244 grn_column_flagscxx . . $ grn_column_flags# flags = grn_column_get_flagscxx . . $ grn_column_get_flags(8dd58acc9865e889).(ctx, column);
1245 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "section");
1246 grn_ctx_output_boolcxx . . $ grn_ctx_output_bool(1112b62984b2cd7f).(ctx, (flags & GRN_OBJ_WITH_SECTIONcxx . . $ `include/groonga/groonga.h:777:9`!) != 0);
1247
1248 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "weight");
1249 grn_ctx_output_boolcxx . . $ grn_ctx_output_bool(1112b62984b2cd7f).(ctx, (flags & GRN_OBJ_WITH_WEIGHTcxx . . $ `include/groonga/groonga.h:785:9`!) != 0);
1250
1251 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "weight_float32");
1252 grn_ctx_output_boolcxx . . $ grn_ctx_output_bool(1112b62984b2cd7f).(ctx, (flags & GRN_OBJ_WEIGHT_FLOAT32cxx . . $ `include/groonga/groonga.h:838:9`!) != 0);
1253
1254 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "weight_bfloat16");
1255 grn_ctx_output_boolcxx . . $ grn_ctx_output_bool(1112b62984b2cd7f).(ctx, (flags & GRN_OBJ_WEIGHT_BFLOAT16cxx . . $ `include/groonga/groonga.h:796:9`!) != 0);
1256
1257 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "position");
1258 grn_ctx_output_boolcxx . . $ grn_ctx_output_bool(1112b62984b2cd7f).(ctx, (flags & GRN_OBJ_WITH_POSITIONcxx . . $ `include/groonga/groonga.h:794:9`!) != 0);
1259
1260 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "sources");
1261 command_schema_column_output_sourcescxx . . $ command_schema_column_output_sources(cda3a5f3c2e53c6b).(ctx, column);
1262
1263 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "generator");
1264 command_schema_column_output_generatorcxx . . $ command_schema_column_output_generator(cda3a5f3c2e53c6b).(ctx, column);
1265
1266 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "indexes");
1267 command_schema_output_indexescxx . . $ command_schema_output_indexes(cda3a5f3c2e53c6b).(ctx, column);
1268
1269 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "command");
1270 command_schema_column_output_commandcxx . . $ command_schema_column_output_command(99eba0d3a8372d65).(ctx, table, column);
1271
1272 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
1273 }
1274
1275 static void
1276 command_schema_table_output_columnscxx . . $ command_schema_table_output_columns(dd6a6399550662fa).(grn_ctxcxx . . $ grn_ctx# *ctx,
1277 grn_objcxx . . $ grn_obj# *table,
1278 grn_schema_datacxx . . $ grn_schema_data# *data)
1279 {
1280 grn_hashcxx . . $ grn_hash# *columns;
1281
1282 columns = grn_hash_createcxx . . $ grn_hash_create(db1bba7e0d64660).(ctx,
1283 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!,
1284 sizeof(grn_idcxx . . $ grn_id#),
1285 0,
1286 GRN_OBJ_TABLE_HASH_KEYcxx . . $ `include/groonga/groonga.h:688:9`! | GRN_HASH_TINYcxx . . $ `include/groonga/hash.h:26:9`!);
1287 if (!columns) {
1288 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "columns", 0);
1289 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
1290 return;
1291 }
1292
1293 grn_table_columnscxx . . $ grn_table_columns(1e71eba22593aee7).(ctx, table, "", 0, (grn_objcxx . . $ grn_obj# *)columns);
1294 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "columns", (int)grn_hash_sizecxx . . $ grn_hash_size(f05d4ba70b6338a4).(ctx, columns));
1295 {
1296 grn_idcxx . . $ grn_id# *key;
1297 GRN_HASH_EACHcxx . . $ `include/groonga/hash.h:121:9`!(ctx, columns, id, &key, 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`!, {
1298 grn_obj *column;
1299
1300 if (data->is_close_opened_object_mode) {
1301 grn_ctx_push_temporary_open_space(ctx);
1302 }
1303
1304 column = grn_ctx_at(ctx, *key);
1305 command_schema_column_output(ctx, table, column);
1306
1307 if (data->is_close_opened_object_mode) {
1308 grn_ctx_pop_temporary_open_space(ctx);
1309 }
1310 });
1311 }
1312 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
1313 grn_hash_closecxx . . $ grn_hash_close(c005d027d163fb0b).(ctx, columns);
1314 }
1315
1316 static void
1317 command_schema_output_tablecxx . . $ command_schema_output_table(b524f9812a3852db).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_schema_datacxx . . $ grn_schema_data# *data, grn_objcxx . . $ grn_obj# *table)
1318 {
1319 command_schema_output_namecxx . . $ command_schema_output_name(cda3a5f3c2e53c6b).(ctx, table);
1320
1321 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "table", 13);
1322
1323 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "id");
1324 command_schema_output_idcxx . . $ command_schema_output_id(cda3a5f3c2e53c6b).(ctx, table);
1325
1326 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "name");
1327 command_schema_output_namecxx . . $ command_schema_output_name(cda3a5f3c2e53c6b).(ctx, table);
1328
1329 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "type");
1330 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, command_schema_table_type_namecxx . . $ command_schema_table_type_name(ab3dda79dad54815).(ctx, table));
1331
1332 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "key_type");
1333 command_schema_table_output_key_typecxx . . $ command_schema_table_output_key_type(cda3a5f3c2e53c6b).(ctx, table);
1334
1335 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "value_type");
1336 command_schema_table_output_value_typecxx . . $ command_schema_table_output_value_type(cda3a5f3c2e53c6b).(ctx, table);
1337
1338 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "tokenizer");
1339 command_schema_table_output_tokenizercxx . . $ command_schema_table_output_tokenizer(cda3a5f3c2e53c6b).(ctx, table);
1340
1341 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "normalizer");
1342 command_schema_table_output_normalizercxx . . $ command_schema_table_output_normalizer(cda3a5f3c2e53c6b).(ctx, table);
1343
1344 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "normalizers");
1345 command_schema_table_output_table_modulescxx . . $ command_schema_table_output_table_modules(b05317970bfd350f).(ctx,
1346 table,
1347 GRN_INFO_NORMALIZERScxx . . $ GRN_INFO_NORMALIZERS.,
1348 "normalizer",
1349 "normalizers");
1350
1351 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "token_filters");
1352 command_schema_table_output_table_modulescxx . . $ command_schema_table_output_table_modules(b05317970bfd350f).(ctx,
1353 table,
1354 GRN_INFO_TOKEN_FILTERScxx . . $ GRN_INFO_TOKEN_FILTERS.,
1355 "token_filter",
1356 "token_filters");
1357
1358 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "extractors");
1359 command_schema_table_output_table_modulescxx . . $ command_schema_table_output_table_modules(b05317970bfd350f).(ctx,
1360 table,
1361 GRN_INFO_EXTRACTORScxx . . $ GRN_INFO_EXTRACTORS.,
1362 "extractor",
1363 "extractors");
1364
1365 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "indexes");
1366 command_schema_output_indexescxx . . $ command_schema_output_indexes(cda3a5f3c2e53c6b).(ctx, table);
1367
1368 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "command");
1369 command_schema_table_output_commandcxx . . $ command_schema_table_output_command(cda3a5f3c2e53c6b).(ctx, table);
1370
1371 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "columns");
1372 command_schema_table_output_columnscxx . . $ command_schema_table_output_columns(dd6a6399550662fa).(ctx, table, data);
1373
1374 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
1375 }
1376
1377 static void
1378 command_schema_output_tablescxx . . $ command_schema_output_tables(5200d3ea2140a9cf).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_schema_datacxx . . $ grn_schema_data# *data)
1379 {
1380 grn_objcxx . . $ grn_obj# table_ids;
1381
1382 GRN_RECORD_INITcxx . . $ `include/groonga/groonga.h:2868:9`!(&table_ids, GRN_OBJ_VECTORcxx . . $ `include/groonga/groonga.h:2734:9`!, GRN_ID_NILcxx . . $ `include/groonga/groonga.h:55:9`!);
1383 GRN_DB_EACH_BEGIN_BY_KEYcxx . . $ `include/groonga/db.h:142:9`!(ctx, cursor, id)
1384 {
1385 void *name;
1386 int name_size;
1387 grn_objcxx . . $ grn_obj# *object;
1388
1389 if (grn_id_is_builtincxx . . $ grn_id_is_builtin(a2a496425acc5b40).(ctx, id)) {
1390 continue;
1391 }
1392
1393 name_size = grn_table_cursor_get_keycxx . . $ grn_table_cursor_get_key(7d620ebe94cee13a).(ctx, cursor, &name);
1394 if (grn_obj_name_is_columncxx . . $ grn_obj_name_is_column(da3161f0ad1ba10a).(ctx, name, name_size)) {
1395 continue;
1396 }
1397
1398 if (data->is_close_opened_object_modecxx . . $ $anonymous_type_793223df1636df93_0#is_close_opened_object_mode.) {
1399 grn_ctx_push_temporary_open_spacecxx . . $ grn_ctx_push_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
1400 }
1401
1402 object = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, id);
1403 if (!object) {
1404 /* XXX: this clause is executed when MeCab tokenizer is enabled in
1405 database but the groonga isn't supported MeCab.
1406 We should return error message about it and error exit status
1407 but it's too difficult for this architecture. :< */
1408 GRN_PLUGIN_CLEAR_ERRORcxx . . $ `include/groonga/plugin.h:148:9`!(ctx);
1409 goto next_loop;
1410 }
1411
1412 if (grn_obj_is_tablecxx . . $ grn_obj_is_table(a5760e5c319a06ee).(ctx, object)) {
1413 GRN_RECORD_PUTcxx . . $ `include/groonga/groonga.h:3213:9`!(ctx, &table_ids, id);
1414 }
1415
1416 next_loop:
1417 if (data->is_close_opened_object_modecxx . . $ $anonymous_type_793223df1636df93_0#is_close_opened_object_mode.) {
1418 grn_ctx_pop_temporary_open_spacecxx . . $ grn_ctx_pop_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
1419 }
1420 }
1421 GRN_TABLE_EACH_ENDcxx . . $ `include/groonga/table.h:665:9`!(ctx, cursor);
1422
1423 size_t i, n;
1424 n = GRN_BULK_VSIZEcxx . . $ `include/groonga/groonga.h:2642:9`!(&table_ids) / sizeof(grn_idcxx . . $ grn_id#);
1425
1426 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "tables");
1427 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "tables", (int)n);
1428 for (i = 0; i < n; i++) {
1429 grn_idcxx . . $ grn_id# table_id;
1430 grn_objcxx . . $ grn_obj# *table;
1431
1432 if (data->is_close_opened_object_modecxx . . $ $anonymous_type_793223df1636df93_0#is_close_opened_object_mode.) {
1433 grn_ctx_push_temporary_open_spacecxx . . $ grn_ctx_push_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
1434 }
1435
1436 table_id = GRN_RECORD_VALUE_ATcxx . . $ `include/groonga/groonga.h:3148:9`!(&table_ids, i);
1437 table = grn_ctx_atcxx . . $ grn_ctx_at(ac4544c8400954c9).(ctx, table_id);
1438
1439 command_schema_output_tablecxx . . $ command_schema_output_table(b524f9812a3852db).(ctx, data, table);
1440
1441 if (data->is_close_opened_object_modecxx . . $ $anonymous_type_793223df1636df93_0#is_close_opened_object_mode.) {
1442 grn_ctx_pop_temporary_open_spacecxx . . $ grn_ctx_pop_temporary_open_space(2b4fa601bf4f1e5b).(ctx);
1443 }
1444 }
1445 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
1446
1447 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &table_ids);
1448 }
1449
1450 static grn_objcxx . . $ grn_obj# *
1451 command_schemacxx . . $ command_schema(fd082858389c8bb0).(grn_ctxcxx . . $ grn_ctx# *ctx,
1452 int nargs,
1453 grn_objcxx . . $ grn_obj# **args,
1454 grn_user_datacxx . . $ grn_user_data# *user_data)
1455 {
1456 grn_schema_datacxx . . $ grn_schema_data# data;
1457
1458 data.is_close_opened_object_modecxx . . $ $anonymous_type_793223df1636df93_0#is_close_opened_object_mode. = (grn_thread_get_limitcxx . . $ grn_thread_get_limit(db52760e79bf9054).() == 1);
1459
1460 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "schema", 6);
1461 command_schema_output_pluginscxx . . $ command_schema_output_plugins(b578cd6e53d5fe91).(ctx);
1462 command_schema_output_typescxx . . $ command_schema_output_types(b578cd6e53d5fe91).(ctx);
1463 command_schema_output_tokenizerscxx . . $ command_schema_output_tokenizers(5200d3ea2140a9cf).(ctx, &data);
1464 command_schema_output_normalizerscxx . . $ command_schema_output_normalizers(5200d3ea2140a9cf).(ctx, &data);
1465 command_schema_output_token_filterscxx . . $ command_schema_output_token_filters(5200d3ea2140a9cf).(ctx, &data);
1466 command_schema_output_tablescxx . . $ command_schema_output_tables(5200d3ea2140a9cf).(ctx, &data);
1467 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
1468
1469 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
1470 }
1471
1472 void
1473 grn_proc_init_schemacxx . . $ grn_proc_init_schema(b578cd6e53d5fe91).(grn_ctxcxx . . $ grn_ctx# *ctx)
1474 {
1475 grn_plugin_command_createcxx . . $ grn_plugin_command_create(2dfd920bb40f3149).(ctx, "schema", -1, command_schemacxx . . $ command_schema(fd082858389c8bb0)., 0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
1476 }