Debian Codegraph @

lib/proc/proc_object_list.c

raw symbols SCIP
1 /*
2 Copyright (C) 2016 Brazil
3 Copyright (C) 2020-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_db.h"cxx . . $ `<file>/lib/grn_db.h`/
22 #include "../grn_vector.h"cxx . . $ `<file>/lib/grn_vector.h`/
23
24 #include <groonga/plugin.h>cxx . . $ `<file>/include/groonga/plugin.h`/
25
26 static void
27 command_object_list_dump_flagscxx . . $ command_object_list_dump_flags(859ac4e21fc97fa8).(grn_ctxcxx . . $ grn_ctx# *ctx, grn_obj_speccxx . . $ grn_obj_spec# *spec)
28 {
29 grn_objcxx . . $ grn_obj# flags;
30
31 GRN_TEXT_INITcxx . . $ `include/groonga/groonga.h:2750:9`!(&flags, 0);
32
33 switch (spec->headercxx . . $ $anonymous_type_5d6f2f2d27272fbe_1#header..typecxx . . $ _grn_obj_header#type.) {
34 case GRN_TABLE_HASH_KEYcxx . . $ `include/groonga/groonga.h:895:9`!:
35 case GRN_TABLE_PAT_KEYcxx . . $ `include/groonga/groonga.h:896:9`!:
36 case GRN_TABLE_DAT_KEYcxx . . $ `include/groonga/groonga.h:897:9`!:
37 case GRN_TABLE_NO_KEYcxx . . $ `include/groonga/groonga.h:898:9`!:
38 grn_dump_table_create_flagscxx . . $ grn_dump_table_create_flags(e6d1f76f34fc094d).(ctx, spec->headercxx . . $ $anonymous_type_5d6f2f2d27272fbe_1#header..flagscxx . . $ _grn_obj_header#flags., &flags);
39 break;
40 case GRN_COLUMN_VAR_SIZEcxx . . $ `include/groonga/groonga.h:901:9`!:
41 case GRN_COLUMN_FIX_SIZEcxx . . $ `include/groonga/groonga.h:900:9`!:
42 case GRN_COLUMN_INDEXcxx . . $ `include/groonga/groonga.h:902:9`!:
43 grn_dump_column_create_flagscxx . . $ grn_dump_column_create_flags(e6d1f76f34fc094d).(ctx, spec->headercxx . . $ $anonymous_type_5d6f2f2d27272fbe_1#header..flagscxx . . $ _grn_obj_header#flags., &flags);
44 break;
45 case GRN_TYPEcxx . . $ `include/groonga/groonga.h:892:9`!:
46 if (spec->headercxx . . $ $anonymous_type_5d6f2f2d27272fbe_1#header..flagscxx . . $ _grn_obj_header#flags. & GRN_OBJ_KEY_VAR_SIZEcxx . . $ `include/groonga/groonga.h:820:9`!) {
47 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, &flags, "KEY_VAR_SIZE");
48 } else {
49 switch (spec->headercxx . . $ $anonymous_type_5d6f2f2d27272fbe_1#header..flagscxx . . $ _grn_obj_header#flags. & GRN_OBJ_KEY_MASKcxx . . $ `include/groonga/groonga.h:694:9`!) {
50 case GRN_OBJ_KEY_UINTcxx . . $ `include/groonga/groonga.h:697:9`!:
51 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, &flags, "KEY_UINT");
52 break;
53 case GRN_OBJ_KEY_INTcxx . . $ `include/groonga/groonga.h:700:9`!:
54 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, &flags, "KEY_INT");
55 break;
56 case GRN_OBJ_KEY_FLOATcxx . . $ `include/groonga/groonga.h:703:9`!:
57 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, &flags, "KEY_FLOAT");
58 break;
59 case GRN_OBJ_KEY_GEO_POINTcxx . . $ `include/groonga/groonga.h:706:9`!:
60 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, &flags, "KEY_GEO_POINT");
61 break;
62 }
63 }
64 break;
65 }
66 if (spec->headercxx . . $ $anonymous_type_5d6f2f2d27272fbe_1#header..flagscxx . . $ _grn_obj_header#flags. & GRN_OBJ_CUSTOM_NAMEcxx . . $ `lib/grn_db.h:552:9`!) {
67 if (GRN_TEXT_LENcxx . . $ `include/groonga/groonga.h:2786:9`!(&flags) > 0) {
68 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, &flags, "|");
69 }
70 GRN_TEXT_PUTScxx . . $ `include/groonga/groonga.h:2781:9`!(ctx, &flags, "CUSTOM_NAME");
71 }
72
73 grn_ctx_output_strcxx . . $ grn_ctx_output_str(bd29ebb5071afc4b).(ctx, GRN_TEXT_VALUEcxx . . $ `include/groonga/groonga.h:2785:9`!(&flags), GRN_TEXT_LENcxx . . $ `include/groonga/groonga.h:2786:9`!(&flags));
74
75 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &flags);
76 }
77
78 static void
79 command_object_list_output_table_modulescxx . . $ command_object_list_output_table_modules(4ed27a7b549e6121).(grn_ctxcxx . . $ grn_ctx# *ctx,
80 grn_objcxx . . $ grn_obj# *spec_vector,
81 unsigned int spec_index,
82 const char *singular,
83 const char *plural)
84 {
85 const grn_idcxx . . $ grn_id# *ids;
86 int n_ids;
87
88 unsigned int n_elements = grn_vector_sizecxx . . $ grn_vector_size(8dd58acc9865e889).(ctx, spec_vector);
89 if (n_elements > spec_index) {
90 uint32_tcxx . . $ uint32_t# element_size;
91
92 element_size = grn_vector_get_elementcxx . . $ grn_vector_get_element(744613554bd9830c).(ctx,
93 spec_vector,
94 spec_index,
95 (const char **)&ids,
96 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!,
97 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
98 n_ids = (int)(element_size / sizeof(grn_idcxx . . $ grn_id#));
99 } else {
100 ids = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
101 n_ids = 0;
102 }
103
104 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, plural);
105 grn_ctx_output_array_opencxx . . $ grn_ctx_output_array_open(f0f392d632556531).(ctx, plural, n_ids);
106 grn_objcxx . . $ grn_obj# *db = grn_ctx_dbcxx . . $ grn_ctx_db(ddec8e3b1327ceae).(ctx);
107 for (int i = 0; i < n_ids; i++) {
108 grn_idcxx . . $ grn_id# id = ids[i];
109 char name[GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!];
110 int name_size;
111 name_size = grn_table_get_keycxx . . $ grn_table_get_key(2c24f49dad267d35).(ctx, db, id, name, GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!);
112
113 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, singular, 2);
114 {
115 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "id");
116 grn_ctx_output_uint64cxx . . $ grn_ctx_output_uint64(150f498c5f9d24bd).(ctx, id);
117
118 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "name");
119 if (name_size == 0) {
120 grn_ctx_output_nullcxx . . $ grn_ctx_output_null(b578cd6e53d5fe91).(ctx);
121 } else {
122 grn_ctx_output_strcxx . . $ grn_ctx_output_str(bd29ebb5071afc4b).(ctx, name, (size_tcxx . . $ size_t#)name_size);
123 }
124 }
125 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
126 }
127 grn_ctx_output_array_closecxx . . $ grn_ctx_output_array_close(b578cd6e53d5fe91).(ctx);
128 }
129
130 static grn_objcxx . . $ grn_obj# *
131 command_object_listcxx . . $ command_object_list(fd082858389c8bb0).(grn_ctxcxx . . $ grn_ctx# *ctx,
132 int nargs,
133 grn_objcxx . . $ grn_obj# **args,
134 grn_user_datacxx . . $ grn_user_data# *user_data)
135 {
136 grn_dbcxx . . $ grn_db# *db;
137 int n_objects = 0;
138 grn_objcxx . . $ grn_obj# vector;
139
140 db = (grn_dbcxx . . $ grn_db# *)grn_ctx_dbcxx . . $ grn_ctx_db(ddec8e3b1327ceae).(ctx);
141 if (!db->specscxx . . $ _grn_db#specs.) {
142 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "objects", n_objects);
143 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
144 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
145 }
146
147 GRN_TABLE_EACH_BEGIN_FLAGScxx . . $ `include/groonga/table.h:631:9`!(ctx,
148 (grn_obj *)db,
149 cursor,
150 id,
151 GRN_CURSOR_BY_IDcxx . . $ `include/groonga/table.h:280:9`! | GRN_CURSOR_ASCENDINGcxx . . $ `include/groonga/table.h:273:9`!)
152 {
153 grn_io_wincxx . . $ grn_io_win# jw;
154 uint32_tcxx . . $ uint32_t# value_len;
155 char *value;
156
157 value = grn_ja_refcxx . . $ grn_ja_ref(e22c1a9426972524).(ctx, db->specscxx . . $ _grn_db#specs., id, &jw, &value_len);
158 if (value) {
159 n_objects++;
160 grn_ja_unrefcxx . . $ grn_ja_unref(2a637fdbe33921a9).(ctx, &jw);
161 }
162 }
163 GRN_TABLE_EACH_ENDcxx . . $ `include/groonga/table.h:665:9`!(ctx, cursor);
164
165 GRN_OBJ_INITcxx . . $ `include/groonga/groonga.h:947:9`!(&vector, GRN_VECTORcxx . . $ `include/groonga/groonga.h:877:9`!, 0, GRN_DB_TEXT);
166
167 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "objects", n_objects);
168 GRN_TABLE_EACH_BEGIN_FLAGScxx . . $ `include/groonga/table.h:631:9`!(ctx,
169 (grn_obj *)db,
170 cursor,
171 id,
172 GRN_CURSOR_BY_IDcxx . . $ `include/groonga/table.h:280:9`! | GRN_CURSOR_ASCENDINGcxx . . $ `include/groonga/table.h:273:9`!)
173 {
174 void *name;
175 int name_size;
176 grn_io_wincxx . . $ grn_io_win# jw;
177 uint32_tcxx . . $ uint32_t# value_len;
178 char *value;
179 unsigned int n_elements;
180
181 value = grn_ja_refcxx . . $ grn_ja_ref(e22c1a9426972524).(ctx, db->specscxx . . $ _grn_db#specs., id, &jw, &value_len);
182 if (!value) {
183 continue;
184 }
185
186 name_size = grn_table_cursor_get_keycxx . . $ grn_table_cursor_get_key(7d620ebe94cee13a).(ctx, cursor, &name);
187
188 grn_ctx_output_strcxx . . $ grn_ctx_output_str(bd29ebb5071afc4b).(ctx, name, (size_tcxx . . $ size_t#)name_size);
189
190 GRN_BULK_REWINDcxx . . $ `include/groonga/groonga.h:2599:9`!(&vector);
191 grn_rccxx . . $ grn_rc# rc = grn_vector_unpackcxx . . $ grn_vector_unpack(99dba44697abdcb7).(ctx, &vector, value, value_len, 0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
192 if (rc != GRN_SUCCESScxx . . $ GRN_SUCCESS.) {
193 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "object", 4);
194 {
195 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "id");
196 grn_ctx_output_int64cxx . . $ grn_ctx_output_int64(e824ee96bb92de8).(ctx, id);
197 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "name");
198 grn_ctx_output_strcxx . . $ grn_ctx_output_str(bd29ebb5071afc4b).(ctx, name, (size_tcxx . . $ size_t#)name_size);
199 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "opened");
200 grn_ctx_output_boolcxx . . $ grn_ctx_output_bool(1112b62984b2cd7f).(ctx, grn_ctx_is_openedcxx . . $ grn_ctx_is_opened(a2a496425acc5b40).(ctx, id));
201 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "value_size");
202 grn_ctx_output_uint64cxx . . $ grn_ctx_output_uint64(150f498c5f9d24bd).(ctx, value_len);
203 }
204 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
205 goto next;
206 }
207
208 n_elements = grn_vector_sizecxx . . $ grn_vector_size(8dd58acc9865e889).(ctx, &vector);
209
210 {
211 uint32_tcxx . . $ uint32_t# element_size;
212 grn_obj_speccxx . . $ grn_obj_spec# *spec;
213 int n_properties = 8;
214 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! need_sources = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
215 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! need_generator = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
216 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! need_token_filters = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
217 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! need_normalizers = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
218 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! need_extractors = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
219
220 element_size = grn_vector_get_elementcxx . . $ grn_vector_get_element(744613554bd9830c).(ctx,
221 &vector,
222 GRN_SERIALIZED_SPEC_INDEX_SPECcxx . . $ `lib/grn_db.h:114:9`!,
223 (const char **)&spec,
224 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!,
225 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
226 if (element_size == 0) {
227 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "object", 4);
228 {
229 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "id");
230 grn_ctx_output_int64cxx . . $ grn_ctx_output_int64(e824ee96bb92de8).(ctx, id);
231 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "name");
232 grn_ctx_output_strcxx . . $ grn_ctx_output_str(bd29ebb5071afc4b).(ctx, name, (size_tcxx . . $ size_t#)name_size);
233 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "opened");
234 grn_ctx_output_boolcxx . . $ grn_ctx_output_bool(1112b62984b2cd7f).(ctx, grn_ctx_is_openedcxx . . $ grn_ctx_is_opened(a2a496425acc5b40).(ctx, id));
235 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "n_elements");
236 grn_ctx_output_uint64cxx . . $ grn_ctx_output_uint64(150f498c5f9d24bd).(ctx, n_elements);
237 }
238 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
239 goto next;
240 }
241
242 switch (spec->headercxx . . $ $anonymous_type_5d6f2f2d27272fbe_1#header..typecxx . . $ _grn_obj_header#type.) {
243 case GRN_COLUMN_FIX_SIZEcxx . . $ `include/groonga/groonga.h:900:9`!:
244 case GRN_COLUMN_VAR_SIZEcxx . . $ `include/groonga/groonga.h:901:9`!:
245 need_sources = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
246 n_properties++;
247 need_generator = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
248 n_properties++;
249 break;
250 case GRN_COLUMN_INDEXcxx . . $ `include/groonga/groonga.h:902:9`!:
251 need_sources = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
252 n_properties++;
253 break;
254 case GRN_TABLE_PAT_KEYcxx . . $ `include/groonga/groonga.h:896:9`!:
255 case GRN_TABLE_DAT_KEYcxx . . $ `include/groonga/groonga.h:897:9`!:
256 case GRN_TABLE_HASH_KEYcxx . . $ `include/groonga/groonga.h:895:9`!:
257 need_token_filters = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
258 n_properties++;
259 need_normalizers = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
260 n_properties++;
261 need_extractors = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
262 n_properties++;
263 break;
264 case GRN_TABLE_NO_KEYcxx . . $ `include/groonga/groonga.h:898:9`!:
265 break;
266 }
267 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "object", n_properties);
268 {
269 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "id");
270 grn_ctx_output_uint64cxx . . $ grn_ctx_output_uint64(150f498c5f9d24bd).(ctx, id);
271
272 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "name");
273 grn_ctx_output_strcxx . . $ grn_ctx_output_str(bd29ebb5071afc4b).(ctx, name, (size_tcxx . . $ size_t#)name_size);
274
275 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "opened");
276 grn_ctx_output_boolcxx . . $ grn_ctx_output_bool(1112b62984b2cd7f).(ctx, grn_ctx_is_openedcxx . . $ grn_ctx_is_opened(a2a496425acc5b40).(ctx, id));
277
278 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "n_elements");
279 grn_ctx_output_uint64cxx . . $ grn_ctx_output_uint64(150f498c5f9d24bd).(ctx, n_elements);
280
281 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "type");
282 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "type", 2);
283 {
284 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "id");
285 grn_ctx_output_uint64cxx . . $ grn_ctx_output_uint64(150f498c5f9d24bd).(ctx, spec->headercxx . . $ $anonymous_type_5d6f2f2d27272fbe_1#header..typecxx . . $ _grn_obj_header#type.);
286 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "name");
287 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, grn_obj_type_to_stringcxx . . $ grn_obj_type_to_string(42624c5f3be67010).(spec->headercxx . . $ $anonymous_type_5d6f2f2d27272fbe_1#header..typecxx . . $ _grn_obj_header#type.));
288 }
289 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
290
291 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "flags");
292 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "flags", 2);
293 {
294 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "value");
295 grn_ctx_output_uint64cxx . . $ grn_ctx_output_uint64(150f498c5f9d24bd).(ctx, spec->headercxx . . $ $anonymous_type_5d6f2f2d27272fbe_1#header..flagscxx . . $ _grn_obj_header#flags.);
296 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "names");
297 command_object_list_dump_flagscxx . . $ command_object_list_dump_flags(859ac4e21fc97fa8).(ctx, spec);
298 }
299 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
300
301 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "path");
302 char path[PATH_MAXcxx . . $ `<external>/6347054901304145714/limits.h:13:9`!];
303 grn_obj_spec_get_pathcxx . . $ grn_obj_spec_get_path(1e232f0954a7a698).(ctx, spec, id, path, db, &vector);
304 size_tcxx . . $ size_t# path_size = strlencxx . . $ strlen(751346f8406fd082).(path);
305 if (path_size == 0) {
306 grn_ctx_output_nullcxx . . $ grn_ctx_output_null(b578cd6e53d5fe91).(ctx);
307 } else {
308 grn_ctx_output_strcxx . . $ grn_ctx_output_str(bd29ebb5071afc4b).(ctx, path, path_size);
309 }
310
311 switch (spec->headercxx . . $ $anonymous_type_5d6f2f2d27272fbe_1#header..typecxx . . $ _grn_obj_header#type.) {
312 case GRN_TYPEcxx . . $ `include/groonga/groonga.h:892:9`!:
313 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "size");
314 grn_ctx_output_uint64cxx . . $ grn_ctx_output_uint64(150f498c5f9d24bd).(ctx, spec->rangecxx . . $ $anonymous_type_5d6f2f2d27272fbe_1#range.);
315 break;
316 case GRN_PROCcxx . . $ `include/groonga/groonga.h:893:9`!:
317 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "plugin_id");
318 grn_ctx_output_uint64cxx . . $ grn_ctx_output_uint64(150f498c5f9d24bd).(ctx, spec->rangecxx . . $ $anonymous_type_5d6f2f2d27272fbe_1#range.);
319 break;
320 default:
321 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "range");
322 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "range", 2);
323 {
324 char name[GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!];
325 int name_size;
326
327 name_size = grn_table_get_keycxx . . $ grn_table_get_key(2c24f49dad267d35).(ctx,
328 (grn_objcxx . . $ grn_obj# *)db,
329 spec->rangecxx . . $ $anonymous_type_5d6f2f2d27272fbe_1#range.,
330 name,
331 GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!);
332
333 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "id");
334 grn_ctx_output_uint64cxx . . $ grn_ctx_output_uint64(150f498c5f9d24bd).(ctx, spec->rangecxx . . $ $anonymous_type_5d6f2f2d27272fbe_1#range.);
335
336 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "name");
337 if (name_size == 0) {
338 grn_ctx_output_nullcxx . . $ grn_ctx_output_null(b578cd6e53d5fe91).(ctx);
339 } else {
340 grn_ctx_output_strcxx . . $ grn_ctx_output_str(bd29ebb5071afc4b).(ctx, name, (size_tcxx . . $ size_t#)name_size);
341 }
342 }
343 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
344 break;
345 }
346
347 if (need_sources) {
348 const grn_idcxx . . $ grn_id# *source_ids;
349 int n_source_ids;
350 int i;
351
352 if (n_elements > GRN_SERIALIZED_SPEC_INDEX_SOURCEcxx . . $ `lib/grn_db.h:116:9`!) {
353 uint32_tcxx . . $ uint32_t# element_size;
354
355 element_size =
356 grn_vector_get_elementcxx . . $ grn_vector_get_element(744613554bd9830c).(ctx,
357 &vector,
358 GRN_SERIALIZED_SPEC_INDEX_SOURCEcxx . . $ `lib/grn_db.h:116:9`!,
359 (const char **)&source_ids,
360 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!,
361 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
362 n_source_ids = (int)(element_size / sizeof(grn_idcxx . . $ grn_id#));
363 } else {
364 source_ids = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
365 n_source_ids = 0;
366 }
367
368 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "sources");
369 grn_ctx_output_array_opencxx . . $ grn_ctx_output_array_open(f0f392d632556531).(ctx, "sources", n_source_ids);
370 for (i = 0; i < n_source_ids; i++) {
371 grn_idcxx . . $ grn_id# source_id;
372 char name[GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!];
373 int name_size;
374
375 source_id = source_ids[i];
376 name_size = grn_table_get_keycxx . . $ grn_table_get_key(2c24f49dad267d35).(ctx,
377 (grn_objcxx . . $ grn_obj# *)db,
378 source_id,
379 name,
380 GRN_TABLE_MAX_KEY_SIZEcxx . . $ `include/groonga/table.h:26:9`!);
381
382 grn_ctx_output_map_opencxx . . $ grn_ctx_output_map_open(f0f392d632556531).(ctx, "source", 2);
383 {
384 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "id");
385 grn_ctx_output_uint64cxx . . $ grn_ctx_output_uint64(150f498c5f9d24bd).(ctx, source_id);
386
387 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "name");
388 if (name_size == 0) {
389 grn_ctx_output_nullcxx . . $ grn_ctx_output_null(b578cd6e53d5fe91).(ctx);
390 } else {
391 grn_ctx_output_strcxx . . $ grn_ctx_output_str(bd29ebb5071afc4b).(ctx, name, (size_tcxx . . $ size_t#)name_size);
392 }
393 }
394 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
395 }
396 grn_ctx_output_array_closecxx . . $ grn_ctx_output_array_close(b578cd6e53d5fe91).(ctx);
397 }
398
399 if (need_generator) {
400 grn_raw_stringcxx . . $ grn_raw_string# generator;
401 GRN_RAW_STRING_INITcxx . . $ `include/groonga/raw_string.h:26:9`!(generator);
402 if (n_elements > GRN_SERIALIZED_SPEC_INDEX_JA_GENERATORcxx . . $ `lib/grn_db.h:122:9`!) {
403 generator.lengthcxx . . $ $anonymous_type_7f733dd816802915_0#length. =
404 grn_vector_get_elementcxx . . $ grn_vector_get_element(744613554bd9830c).(ctx,
405 &vector,
406 GRN_SERIALIZED_SPEC_INDEX_JA_GENERATORcxx . . $ `lib/grn_db.h:122:9`!,
407 &(generator.valuecxx . . $ $anonymous_type_7f733dd816802915_0#value.),
408 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!,
409 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
410 }
411
412 grn_ctx_output_cstrcxx . . $ grn_ctx_output_cstr(777524e3d10dd7b4).(ctx, "generator");
413 grn_ctx_output_strcxx . . $ grn_ctx_output_str(bd29ebb5071afc4b).(ctx, generator.valuecxx . . $ $anonymous_type_7f733dd816802915_0#value., generator.lengthcxx . . $ $anonymous_type_7f733dd816802915_0#length.);
414 }
415
416 if (need_token_filters) {
417 command_object_list_output_table_modulescxx . . $ command_object_list_output_table_modules(4ed27a7b549e6121).(
418 ctx,
419 &vector,
420 GRN_SERIALIZED_SPEC_INDEX_TOKEN_FILTERScxx . . $ `lib/grn_db.h:118:9`!,
421 "token_filter",
422 "token_filters");
423 }
424
425 if (need_normalizers) {
426 command_object_list_output_table_modulescxx . . $ command_object_list_output_table_modules(4ed27a7b549e6121).(
427 ctx,
428 &vector,
429 GRN_SERIALIZED_SPEC_INDEX_NORMALIZERScxx . . $ `lib/grn_db.h:119:9`!,
430 "normalizer",
431 "normalizers");
432 }
433
434 if (need_extractors) {
435 command_object_list_output_table_modulescxx . . $ command_object_list_output_table_modules(4ed27a7b549e6121).(
436 ctx,
437 &vector,
438 GRN_SERIALIZED_SPEC_INDEX_EXTRACTORScxx . . $ `lib/grn_db.h:120:9`!,
439 "extractor",
440 "extractors");
441 }
442 }
443 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
444 }
445
446 next:
447 grn_ja_unrefcxx . . $ grn_ja_unref(2a637fdbe33921a9).(ctx, &jw);
448 }
449 GRN_TABLE_EACH_ENDcxx . . $ `include/groonga/table.h:665:9`!(ctx, cursor);
450 grn_ctx_output_map_closecxx . . $ grn_ctx_output_map_close(b578cd6e53d5fe91).(ctx);
451
452 GRN_OBJ_FINcxx . . $ `include/groonga/groonga.h:958:9`!(ctx, &vector);
453
454 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
455 }
456
457 void
458 grn_proc_init_object_listcxx . . $ grn_proc_init_object_list(b578cd6e53d5fe91).(grn_ctxcxx . . $ grn_ctx# *ctx)
459 {
460 grn_plugin_command_createcxx . . $ grn_plugin_command_create(2dfd920bb40f3149).(ctx,
461 "object_list",
462 -1,
463 command_object_listcxx . . $ command_object_list(fd082858389c8bb0).,
464 0,
465 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
466 }