Debian Codegraph @

tests/31-set-of-OK.asn1.-Pfwide-types

raw
1
2 /*** <<< INCLUDES [Forest] >>> ***/
3
4 #include <asn_SET_OF.h>
5 #include <constr_SET_OF.h>
6
7 /*** <<< FWD-DECLS [Forest] >>> ***/
8
9 struct Tree;
10
11 /*** <<< TYPE-DECLS [Forest] >>> ***/
12
13 typedef struct Forest {
14 A_SET_OF(struct Tree) list;
15
16 /* Context for parsing across buffer boundaries */
17 asn_struct_ctx_t _asn_ctx;
18 } Forest_t;
19
20 /*** <<< FUNC-DECLS [Forest] >>> ***/
21
22 extern asn_TYPE_descriptor_t asn_DEF_Forest;
23
24 /*** <<< POST-INCLUDE [Forest] >>> ***/
25
26 #include "Tree.h"
27
28 /*** <<< STAT-DEFS [Forest] >>> ***/
29
30 static asn_TYPE_member_t asn_MBR_Forest_1[] = {
31 { ATF_POINTER, 0, 0,
32 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
33 .tag_mode = 0,
34 .type = &asn_DEF_Tree,
35 .memb_constraints = 0, /* Defer constraints checking to the member type */
36 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
37 .default_value = 0,
38 .name = ""
39 },
40 };
41 static const ber_tlv_tag_t asn_DEF_Forest_tags_1[] = {
42 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
43 };
44 static asn_SET_OF_specifics_t asn_SPC_Forest_specs_1 = {
45 sizeof(struct Forest),
46 offsetof(struct Forest, _asn_ctx),
47 0, /* XER encoding is XMLDelimitedItemList */
48 };
49 asn_TYPE_descriptor_t asn_DEF_Forest = {
50 "Forest",
51 "Forest",
52 SET_OF_free,
53 SET_OF_print,
54 SET_OF_constraint,
55 SET_OF_decode_ber,
56 SET_OF_encode_der,
57 SET_OF_decode_xer,
58 SET_OF_encode_xer,
59 0, 0, /* No PER support, use "-gen-PER" to enable */
60 0, /* Use generic outmost tag fetcher */
61 asn_DEF_Forest_tags_1,
62 sizeof(asn_DEF_Forest_tags_1)
63 /sizeof(asn_DEF_Forest_tags_1[0]), /* 1 */
64 asn_DEF_Forest_tags_1, /* Same as above */
65 sizeof(asn_DEF_Forest_tags_1)
66 /sizeof(asn_DEF_Forest_tags_1[0]), /* 1 */
67 0, /* No PER visible constraints */
68 asn_MBR_Forest_1,
69 1, /* Single element */
70 &asn_SPC_Forest_specs_1 /* Additional specs */
71 };
72
73
74 /*** <<< INCLUDES [Tree] >>> ***/
75
76 #include <INTEGER.h>
77 #include <constr_SEQUENCE.h>
78
79 /*** <<< TYPE-DECLS [Tree] >>> ***/
80
81 typedef struct Tree {
82 INTEGER_t height;
83 INTEGER_t width;
84
85 /* Context for parsing across buffer boundaries */
86 asn_struct_ctx_t _asn_ctx;
87 } Tree_t;
88
89 /*** <<< FUNC-DECLS [Tree] >>> ***/
90
91 extern asn_TYPE_descriptor_t asn_DEF_Tree;
92
93 /*** <<< STAT-DEFS [Tree] >>> ***/
94
95 static asn_TYPE_member_t asn_MBR_Tree_1[] = {
96 { ATF_NOFLAGS, 0, offsetof(struct Tree, height),
97 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
98 .tag_mode = 0,
99 .type = &asn_DEF_INTEGER,
100 .memb_constraints = 0, /* Defer constraints checking to the member type */
101 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
102 .default_value = 0,
103 .name = "height"
104 },
105 { ATF_NOFLAGS, 0, offsetof(struct Tree, width),
106 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
107 .tag_mode = 0,
108 .type = &asn_DEF_INTEGER,
109 .memb_constraints = 0, /* Defer constraints checking to the member type */
110 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
111 .default_value = 0,
112 .name = "width"
113 },
114 };
115 static const ber_tlv_tag_t asn_DEF_Tree_tags_1[] = {
116 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
117 };
118 static const asn_TYPE_tag2member_t asn_MAP_Tree_tag2el_1[] = {
119 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* height */
120 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* width */
121 };
122 static asn_SEQUENCE_specifics_t asn_SPC_Tree_specs_1 = {
123 sizeof(struct Tree),
124 offsetof(struct Tree, _asn_ctx),
125 asn_MAP_Tree_tag2el_1,
126 2, /* Count of tags in the map */
127 0, 0, 0, /* Optional elements (not needed) */
128 -1, /* Start extensions */
129 -1 /* Stop extensions */
130 };
131 asn_TYPE_descriptor_t asn_DEF_Tree = {
132 "Tree",
133 "Tree",
134 SEQUENCE_free,
135 SEQUENCE_print,
136 SEQUENCE_constraint,
137 SEQUENCE_decode_ber,
138 SEQUENCE_encode_der,
139 SEQUENCE_decode_xer,
140 SEQUENCE_encode_xer,
141 0, 0, /* No PER support, use "-gen-PER" to enable */
142 0, /* Use generic outmost tag fetcher */
143 asn_DEF_Tree_tags_1,
144 sizeof(asn_DEF_Tree_tags_1)
145 /sizeof(asn_DEF_Tree_tags_1[0]), /* 1 */
146 asn_DEF_Tree_tags_1, /* Same as above */
147 sizeof(asn_DEF_Tree_tags_1)
148 /sizeof(asn_DEF_Tree_tags_1[0]), /* 1 */
149 0, /* No PER visible constraints */
150 asn_MBR_Tree_1,
151 2, /* Elements count */
152 &asn_SPC_Tree_specs_1 /* Additional specs */
153 };
154
155
156 /*** <<< INCLUDES [Stuff] >>> ***/
157
158 #include <asn_SET_OF.h>
159 #include <constr_SET_OF.h>
160 #include <BIT_STRING.h>
161 #include <constr_SEQUENCE.h>
162 #include <INTEGER.h>
163 #include <constr_CHOICE.h>
164 #include <constr_SET.h>
165
166 /*** <<< DEPS [Stuff] >>> ***/
167
168
169 /*
170 * Method of determining the components presence
171 */
172 typedef enum Stuff_PR {
173 Stuff_PR_trees, /* Member trees is present */
174 Stuff_PR_anything, /* Member anything is present */
175 Stuff_PR_other, /* Member other is present */
176 } Stuff_PR;
177 typedef enum other_PR {
178 other_PR_NOTHING, /* No components present */
179 other_PR_a,
180 other_PR_b
181 } other_PR;
182
183 /*** <<< FWD-DECLS [Stuff] >>> ***/
184
185 struct Forest;
186
187 /*** <<< TYPE-DECLS [Stuff] >>> ***/
188
189 typedef struct Stuff {
190 struct trees {
191 A_SET_OF(struct Forest) list;
192
193 /* Context for parsing across buffer boundaries */
194 asn_struct_ctx_t _asn_ctx;
195 } *trees;
196 struct anything {
197 A_SET_OF(struct Member {
198 BIT_STRING_t cup_of_coffee;
199 /*
200 * This type is extensible,
201 * possible extensions are below.
202 */
203
204 /* Context for parsing across buffer boundaries */
205 asn_struct_ctx_t _asn_ctx;
206 } ) list;
207
208 /* Context for parsing across buffer boundaries */
209 asn_struct_ctx_t _asn_ctx;
210 } *anything;
211 /*
212 * This type is extensible,
213 * possible extensions are below.
214 */
215 struct other {
216 other_PR present;
217 union Stuff__other_u {
218 INTEGER_t a;
219 INTEGER_t b;
220 } choice;
221
222 /* Context for parsing across buffer boundaries */
223 asn_struct_ctx_t _asn_ctx;
224 } *other;
225
226 /* Presence bitmask: ASN_SET_ISPRESENT(pStuff, Stuff_PR_x) */
227 unsigned int _presence_map
228 [((3+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
229
230 /* Context for parsing across buffer boundaries */
231 asn_struct_ctx_t _asn_ctx;
232 } Stuff_t;
233
234 /*** <<< FUNC-DECLS [Stuff] >>> ***/
235
236 extern asn_TYPE_descriptor_t asn_DEF_Stuff;
237
238 /*** <<< POST-INCLUDE [Stuff] >>> ***/
239
240 #include "Forest.h"
241
242 /*** <<< STAT-DEFS [Stuff] >>> ***/
243
244 static asn_TYPE_member_t asn_MBR_trees_2[] = {
245 { ATF_POINTER, 0, 0,
246 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
247 .tag_mode = 0,
248 .type = &asn_DEF_Forest,
249 .memb_constraints = 0, /* Defer constraints checking to the member type */
250 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
251 .default_value = 0,
252 .name = ""
253 },
254 };
255 static const ber_tlv_tag_t asn_DEF_trees_tags_2[] = {
256 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
257 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
258 };
259 static asn_SET_OF_specifics_t asn_SPC_trees_specs_2 = {
260 sizeof(struct trees),
261 offsetof(struct trees, _asn_ctx),
262 0, /* XER encoding is XMLDelimitedItemList */
263 };
264 static /* Use -fall-defs-global to expose */
265 asn_TYPE_descriptor_t asn_DEF_trees_2 = {
266 "trees",
267 "trees",
268 SET_OF_free,
269 SET_OF_print,
270 SET_OF_constraint,
271 SET_OF_decode_ber,
272 SET_OF_encode_der,
273 SET_OF_decode_xer,
274 SET_OF_encode_xer,
275 0, 0, /* No PER support, use "-gen-PER" to enable */
276 0, /* Use generic outmost tag fetcher */
277 asn_DEF_trees_tags_2,
278 sizeof(asn_DEF_trees_tags_2)
279 /sizeof(asn_DEF_trees_tags_2[0]) - 1, /* 1 */
280 asn_DEF_trees_tags_2, /* Same as above */
281 sizeof(asn_DEF_trees_tags_2)
282 /sizeof(asn_DEF_trees_tags_2[0]), /* 2 */
283 0, /* No PER visible constraints */
284 asn_MBR_trees_2,
285 1, /* Single element */
286 &asn_SPC_trees_specs_2 /* Additional specs */
287 };
288
289 static asn_TYPE_member_t asn_MBR_Member_5[] = {
290 { ATF_NOFLAGS, 0, offsetof(struct Member, cup_of_coffee),
291 .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
292 .tag_mode = 0,
293 .type = &asn_DEF_BIT_STRING,
294 .memb_constraints = 0, /* Defer constraints checking to the member type */
295 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
296 .default_value = 0,
297 .name = "cup-of-coffee"
298 },
299 };
300 static const ber_tlv_tag_t asn_DEF_Member_tags_5[] = {
301 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
302 };
303 static const asn_TYPE_tag2member_t asn_MAP_Member_tag2el_5[] = {
304 { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 } /* cup-of-coffee */
305 };
306 static asn_SEQUENCE_specifics_t asn_SPC_Member_specs_5 = {
307 sizeof(struct Member),
308 offsetof(struct Member, _asn_ctx),
309 asn_MAP_Member_tag2el_5,
310 1, /* Count of tags in the map */
311 0, 0, 0, /* Optional elements (not needed) */
312 0, /* Start extensions */
313 2 /* Stop extensions */
314 };
315 static /* Use -fall-defs-global to expose */
316 asn_TYPE_descriptor_t asn_DEF_Member_5 = {
317 "SEQUENCE",
318 "SEQUENCE",
319 SEQUENCE_free,
320 SEQUENCE_print,
321 SEQUENCE_constraint,
322 SEQUENCE_decode_ber,
323 SEQUENCE_encode_der,
324 SEQUENCE_decode_xer,
325 SEQUENCE_encode_xer,
326 0, 0, /* No PER support, use "-gen-PER" to enable */
327 0, /* Use generic outmost tag fetcher */
328 asn_DEF_Member_tags_5,
329 sizeof(asn_DEF_Member_tags_5)
330 /sizeof(asn_DEF_Member_tags_5[0]), /* 1 */
331 asn_DEF_Member_tags_5, /* Same as above */
332 sizeof(asn_DEF_Member_tags_5)
333 /sizeof(asn_DEF_Member_tags_5[0]), /* 1 */
334 0, /* No PER visible constraints */
335 asn_MBR_Member_5,
336 1, /* Elements count */
337 &asn_SPC_Member_specs_5 /* Additional specs */
338 };
339
340 static asn_TYPE_member_t asn_MBR_anything_4[] = {
341 { ATF_POINTER, 0, 0,
342 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
343 .tag_mode = 0,
344 .type = &asn_DEF_Member_5,
345 .memb_constraints = 0, /* Defer constraints checking to the member type */
346 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
347 .default_value = 0,
348 .name = ""
349 },
350 };
351 static const ber_tlv_tag_t asn_DEF_anything_tags_4[] = {
352 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
353 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
354 };
355 static asn_SET_OF_specifics_t asn_SPC_anything_specs_4 = {
356 sizeof(struct anything),
357 offsetof(struct anything, _asn_ctx),
358 0, /* XER encoding is XMLDelimitedItemList */
359 };
360 static /* Use -fall-defs-global to expose */
361 asn_TYPE_descriptor_t asn_DEF_anything_4 = {
362 "anything",
363 "anything",
364 SET_OF_free,
365 SET_OF_print,
366 SET_OF_constraint,
367 SET_OF_decode_ber,
368 SET_OF_encode_der,
369 SET_OF_decode_xer,
370 SET_OF_encode_xer,
371 0, 0, /* No PER support, use "-gen-PER" to enable */
372 0, /* Use generic outmost tag fetcher */
373 asn_DEF_anything_tags_4,
374 sizeof(asn_DEF_anything_tags_4)
375 /sizeof(asn_DEF_anything_tags_4[0]) - 1, /* 1 */
376 asn_DEF_anything_tags_4, /* Same as above */
377 sizeof(asn_DEF_anything_tags_4)
378 /sizeof(asn_DEF_anything_tags_4[0]), /* 2 */
379 0, /* No PER visible constraints */
380 asn_MBR_anything_4,
381 1, /* Single element */
382 &asn_SPC_anything_specs_4 /* Additional specs */
383 };
384
385 static asn_TYPE_member_t asn_MBR_other_9[] = {
386 { ATF_NOFLAGS, 0, offsetof(struct other, choice.a),
387 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
388 .tag_mode = -1, /* IMPLICIT tag at current level */
389 .type = &asn_DEF_INTEGER,
390 .memb_constraints = 0, /* Defer constraints checking to the member type */
391 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
392 .default_value = 0,
393 .name = "a"
394 },
395 { ATF_NOFLAGS, 0, offsetof(struct other, choice.b),
396 .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
397 .tag_mode = -1, /* IMPLICIT tag at current level */
398 .type = &asn_DEF_INTEGER,
399 .memb_constraints = 0, /* Defer constraints checking to the member type */
400 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
401 .default_value = 0,
402 .name = "b"
403 },
404 };
405 static const asn_TYPE_tag2member_t asn_MAP_other_tag2el_9[] = {
406 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* a */
407 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 1, 0, 0 } /* b */
408 };
409 static asn_CHOICE_specifics_t asn_SPC_other_specs_9 = {
410 sizeof(struct other),
411 offsetof(struct other, _asn_ctx),
412 offsetof(struct other, present),
413 sizeof(((struct other *)0)->present),
414 asn_MAP_other_tag2el_9,
415 2, /* Count of tags in the map */
416 .canonical_order = 0,
417 .ext_start = -1 /* Extensions start */
418 };
419 static /* Use -fall-defs-global to expose */
420 asn_TYPE_descriptor_t asn_DEF_other_9 = {
421 "other",
422 "other",
423 CHOICE_free,
424 CHOICE_print,
425 CHOICE_constraint,
426 CHOICE_decode_ber,
427 CHOICE_encode_der,
428 CHOICE_decode_xer,
429 CHOICE_encode_xer,
430 0, 0, /* No PER support, use "-gen-PER" to enable */
431 CHOICE_outmost_tag,
432 0, /* No effective tags (pointer) */
433 0, /* No effective tags (count) */
434 0, /* No tags (pointer) */
435 0, /* No tags (count) */
436 0, /* No PER visible constraints */
437 asn_MBR_other_9,
438 2, /* Elements count */
439 &asn_SPC_other_specs_9 /* Additional specs */
440 };
441
442 static asn_TYPE_member_t asn_MBR_Stuff_1[] = {
443 { ATF_POINTER, 3, offsetof(struct Stuff, trees),
444 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
445 .tag_mode = 0,
446 .type = &asn_DEF_trees_2,
447 .memb_constraints = 0, /* Defer constraints checking to the member type */
448 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
449 .default_value = 0,
450 .name = "trees"
451 },
452 { ATF_POINTER, 2, offsetof(struct Stuff, anything),
453 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
454 .tag_mode = 0,
455 .type = &asn_DEF_anything_4,
456 .memb_constraints = 0, /* Defer constraints checking to the member type */
457 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
458 .default_value = 0,
459 .name = "anything"
460 },
461 { ATF_POINTER, 1, offsetof(struct Stuff, other),
462 .tag = -1 /* Ambiguous tag (CHOICE?) */,
463 .tag_mode = 0,
464 .type = &asn_DEF_other_9,
465 .memb_constraints = 0, /* Defer constraints checking to the member type */
466 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
467 .default_value = 0,
468 .name = "other"
469 },
470 };
471 static const ber_tlv_tag_t asn_DEF_Stuff_tags_1[] = {
472 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
473 };
474 static const asn_TYPE_tag2member_t asn_MAP_Stuff_tag2el_1[] = {
475 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* a */
476 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* trees */
477 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* anything */
478 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 2, 0, 0 } /* b */
479 };
480 static const asn_TYPE_tag2member_t asn_MAP_Stuff_tag2el_cxer_1[] = {
481 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* trees */
482 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* anything */
483 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 } /* a */
484 };
485 static const uint8_t asn_MAP_Stuff_mmap_1[(3 + (8 * sizeof(unsigned int)) - 1) / 8] = {
486 (0 << 7) | (0 << 6) | (0 << 5)
487 };
488 static asn_SET_specifics_t asn_SPC_Stuff_specs_1 = {
489 sizeof(struct Stuff),
490 offsetof(struct Stuff, _asn_ctx),
491 offsetof(struct Stuff, _presence_map),
492 asn_MAP_Stuff_tag2el_1,
493 4, /* Count of tags in the map */
494 asn_MAP_Stuff_tag2el_cxer_1,
495 3, /* Count of tags in the CXER map */
496 1, /* Whether extensible */
497 (unsigned int *)asn_MAP_Stuff_mmap_1 /* Mandatory elements map */
498 };
499 asn_TYPE_descriptor_t asn_DEF_Stuff = {
500 "Stuff",
501 "Stuff",
502 SET_free,
503 SET_print,
504 SET_constraint,
505 SET_decode_ber,
506 SET_encode_der,
507 SET_decode_xer,
508 SET_encode_xer,
509 0, 0, /* No PER support, use "-gen-PER" to enable */
510 0, /* Use generic outmost tag fetcher */
511 asn_DEF_Stuff_tags_1,
512 sizeof(asn_DEF_Stuff_tags_1)
513 /sizeof(asn_DEF_Stuff_tags_1[0]), /* 1 */
514 asn_DEF_Stuff_tags_1, /* Same as above */
515 sizeof(asn_DEF_Stuff_tags_1)
516 /sizeof(asn_DEF_Stuff_tags_1[0]), /* 1 */
517 0, /* No PER visible constraints */
518 asn_MBR_Stuff_1,
519 3, /* Elements count */
520 &asn_SPC_Stuff_specs_1 /* Additional specs */
521 };
522