d0e5ae34bba202621c628a9fd9a983015f9d8593
[com/asn1c.git] / tests / tests-asn1c-compiler / 65-multi-tag-OK.asn1.-Pfnative-types
1
2 /*** <<< INCLUDES [T1] >>> ***/
3
4 #include "T2.h"
5
6 /*** <<< TYPE-DECLS [T1] >>> ***/
7
8 typedef T2_t     T1_t;
9
10 /*** <<< FUNC-DECLS [T1] >>> ***/
11
12 extern asn_TYPE_descriptor_t asn_DEF_T1;
13 asn_struct_free_f T1_free;
14 asn_struct_print_f T1_print;
15 asn_constr_check_f T1_constraint;
16 ber_type_decoder_f T1_decode_ber;
17 der_type_encoder_f T1_encode_der;
18 xer_type_decoder_f T1_decode_xer;
19 xer_type_encoder_f T1_encode_xer;
20
21 /*** <<< CODE [T1] >>> ***/
22
23 /*
24  * This type is implemented using T2,
25  * so here we adjust the DEF accordingly.
26  */
27
28 /*** <<< STAT-DEFS [T1] >>> ***/
29
30 static const ber_tlv_tag_t asn_DEF_T1_tags_1[] = {
31         (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
32         (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
33         (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
34         (ASN_TAG_CLASS_CONTEXT | (6 << 2))
35 };
36 static const ber_tlv_tag_t asn_DEF_T1_all_tags_1[] = {
37         (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
38         (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
39         (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
40         (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
41         (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
42         (ASN_TAG_CLASS_UNIVERSAL | (9 << 2))
43 };
44 asn_TYPE_descriptor_t asn_DEF_T1 = {
45         "T1",
46         "T1",
47         &asn_OP_NativeReal,
48         asn_DEF_T1_tags_1,
49         sizeof(asn_DEF_T1_tags_1)
50                 /sizeof(asn_DEF_T1_tags_1[0]), /* 4 */
51         asn_DEF_T1_all_tags_1,
52         sizeof(asn_DEF_T1_all_tags_1)
53                 /sizeof(asn_DEF_T1_all_tags_1[0]), /* 6 */
54         { 0, 0, NativeReal_constraint },
55         0, 0,   /* No members */
56         0       /* No specifics */
57 };
58
59
60 /*** <<< INCLUDES [T2] >>> ***/
61
62 #include "T3.h"
63
64 /*** <<< TYPE-DECLS [T2] >>> ***/
65
66 typedef T3_t     T2_t;
67
68 /*** <<< FUNC-DECLS [T2] >>> ***/
69
70 extern asn_TYPE_descriptor_t asn_DEF_T2;
71 asn_struct_free_f T2_free;
72 asn_struct_print_f T2_print;
73 asn_constr_check_f T2_constraint;
74 ber_type_decoder_f T2_decode_ber;
75 der_type_encoder_f T2_encode_der;
76 xer_type_decoder_f T2_decode_xer;
77 xer_type_encoder_f T2_encode_xer;
78
79 /*** <<< CODE [T2] >>> ***/
80
81 /*
82  * This type is implemented using T3,
83  * so here we adjust the DEF accordingly.
84  */
85
86 /*** <<< STAT-DEFS [T2] >>> ***/
87
88 static const ber_tlv_tag_t asn_DEF_T2_tags_1[] = {
89         (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
90         (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
91         (ASN_TAG_CLASS_CONTEXT | (6 << 2))
92 };
93 static const ber_tlv_tag_t asn_DEF_T2_all_tags_1[] = {
94         (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
95         (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
96         (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
97         (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
98         (ASN_TAG_CLASS_UNIVERSAL | (9 << 2))
99 };
100 asn_TYPE_descriptor_t asn_DEF_T2 = {
101         "T2",
102         "T2",
103         &asn_OP_NativeReal,
104         asn_DEF_T2_tags_1,
105         sizeof(asn_DEF_T2_tags_1)
106                 /sizeof(asn_DEF_T2_tags_1[0]), /* 3 */
107         asn_DEF_T2_all_tags_1,
108         sizeof(asn_DEF_T2_all_tags_1)
109                 /sizeof(asn_DEF_T2_all_tags_1[0]), /* 5 */
110         { 0, 0, NativeReal_constraint },
111         0, 0,   /* No members */
112         0       /* No specifics */
113 };
114
115
116 /*** <<< INCLUDES [T3] >>> ***/
117
118 #include "T4.h"
119
120 /*** <<< TYPE-DECLS [T3] >>> ***/
121
122 typedef T4_t     T3_t;
123
124 /*** <<< FUNC-DECLS [T3] >>> ***/
125
126 extern asn_TYPE_descriptor_t asn_DEF_T3;
127 asn_struct_free_f T3_free;
128 asn_struct_print_f T3_print;
129 asn_constr_check_f T3_constraint;
130 ber_type_decoder_f T3_decode_ber;
131 der_type_encoder_f T3_encode_der;
132 xer_type_decoder_f T3_decode_xer;
133 xer_type_encoder_f T3_encode_xer;
134
135 /*** <<< CODE [T3] >>> ***/
136
137 /*
138  * This type is implemented using T4,
139  * so here we adjust the DEF accordingly.
140  */
141
142 /*** <<< STAT-DEFS [T3] >>> ***/
143
144 static const ber_tlv_tag_t asn_DEF_T3_tags_1[] = {
145         (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
146         (ASN_TAG_CLASS_CONTEXT | (6 << 2))
147 };
148 static const ber_tlv_tag_t asn_DEF_T3_all_tags_1[] = {
149         (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
150         (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
151         (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
152         (ASN_TAG_CLASS_UNIVERSAL | (9 << 2))
153 };
154 asn_TYPE_descriptor_t asn_DEF_T3 = {
155         "T3",
156         "T3",
157         &asn_OP_NativeReal,
158         asn_DEF_T3_tags_1,
159         sizeof(asn_DEF_T3_tags_1)
160                 /sizeof(asn_DEF_T3_tags_1[0]), /* 2 */
161         asn_DEF_T3_all_tags_1,
162         sizeof(asn_DEF_T3_all_tags_1)
163                 /sizeof(asn_DEF_T3_all_tags_1[0]), /* 4 */
164         { 0, 0, NativeReal_constraint },
165         0, 0,   /* No members */
166         0       /* No specifics */
167 };
168
169
170 /*** <<< INCLUDES [T4] >>> ***/
171
172 #include "T5.h"
173
174 /*** <<< TYPE-DECLS [T4] >>> ***/
175
176 typedef T5_t     T4_t;
177
178 /*** <<< FUNC-DECLS [T4] >>> ***/
179
180 extern asn_TYPE_descriptor_t asn_DEF_T4;
181 asn_struct_free_f T4_free;
182 asn_struct_print_f T4_print;
183 asn_constr_check_f T4_constraint;
184 ber_type_decoder_f T4_decode_ber;
185 der_type_encoder_f T4_encode_der;
186 xer_type_decoder_f T4_decode_xer;
187 xer_type_encoder_f T4_encode_xer;
188
189 /*** <<< CODE [T4] >>> ***/
190
191 /*
192  * This type is implemented using T5,
193  * so here we adjust the DEF accordingly.
194  */
195
196 /*** <<< STAT-DEFS [T4] >>> ***/
197
198 static const ber_tlv_tag_t asn_DEF_T4_tags_1[] = {
199         (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
200         (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
201         (ASN_TAG_CLASS_UNIVERSAL | (9 << 2))
202 };
203 asn_TYPE_descriptor_t asn_DEF_T4 = {
204         "T4",
205         "T4",
206         &asn_OP_NativeReal,
207         asn_DEF_T4_tags_1,
208         sizeof(asn_DEF_T4_tags_1)
209                 /sizeof(asn_DEF_T4_tags_1[0]) - 1, /* 2 */
210         asn_DEF_T4_tags_1,      /* Same as above */
211         sizeof(asn_DEF_T4_tags_1)
212                 /sizeof(asn_DEF_T4_tags_1[0]), /* 3 */
213         { 0, 0, NativeReal_constraint },
214         0, 0,   /* No members */
215         0       /* No specifics */
216 };
217
218
219 /*** <<< INCLUDES [T5] >>> ***/
220
221 #include "T6.h"
222
223 /*** <<< TYPE-DECLS [T5] >>> ***/
224
225 typedef T6_t     T5_t;
226
227 /*** <<< FUNC-DECLS [T5] >>> ***/
228
229 extern asn_TYPE_descriptor_t asn_DEF_T5;
230 asn_struct_free_f T5_free;
231 asn_struct_print_f T5_print;
232 asn_constr_check_f T5_constraint;
233 ber_type_decoder_f T5_decode_ber;
234 der_type_encoder_f T5_encode_der;
235 xer_type_decoder_f T5_decode_xer;
236 xer_type_encoder_f T5_encode_xer;
237
238 /*** <<< CODE [T5] >>> ***/
239
240 /*
241  * This type is implemented using T6,
242  * so here we adjust the DEF accordingly.
243  */
244
245 /*** <<< STAT-DEFS [T5] >>> ***/
246
247 static const ber_tlv_tag_t asn_DEF_T5_tags_1[] = {
248         (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
249         (ASN_TAG_CLASS_UNIVERSAL | (9 << 2))
250 };
251 asn_TYPE_descriptor_t asn_DEF_T5 = {
252         "T5",
253         "T5",
254         &asn_OP_NativeReal,
255         asn_DEF_T5_tags_1,
256         sizeof(asn_DEF_T5_tags_1)
257                 /sizeof(asn_DEF_T5_tags_1[0]) - 1, /* 1 */
258         asn_DEF_T5_tags_1,      /* Same as above */
259         sizeof(asn_DEF_T5_tags_1)
260                 /sizeof(asn_DEF_T5_tags_1[0]), /* 2 */
261         { 0, 0, NativeReal_constraint },
262         0, 0,   /* No members */
263         0       /* No specifics */
264 };
265
266
267 /*** <<< INCLUDES [T6] >>> ***/
268
269 #include <NativeReal.h>
270
271 /*** <<< TYPE-DECLS [T6] >>> ***/
272
273 typedef double   T6_t;
274
275 /*** <<< FUNC-DECLS [T6] >>> ***/
276
277 extern asn_TYPE_descriptor_t asn_DEF_T6;
278 asn_struct_free_f T6_free;
279 asn_struct_print_f T6_print;
280 asn_constr_check_f T6_constraint;
281 ber_type_decoder_f T6_decode_ber;
282 der_type_encoder_f T6_encode_der;
283 xer_type_decoder_f T6_decode_xer;
284 xer_type_encoder_f T6_encode_xer;
285
286 /*** <<< CODE [T6] >>> ***/
287
288 /*
289  * This type is implemented using NativeReal,
290  * so here we adjust the DEF accordingly.
291  */
292
293 /*** <<< STAT-DEFS [T6] >>> ***/
294
295 static const ber_tlv_tag_t asn_DEF_T6_tags_1[] = {
296         (ASN_TAG_CLASS_UNIVERSAL | (9 << 2))
297 };
298 asn_TYPE_descriptor_t asn_DEF_T6 = {
299         "T6",
300         "T6",
301         &asn_OP_NativeReal,
302         asn_DEF_T6_tags_1,
303         sizeof(asn_DEF_T6_tags_1)
304                 /sizeof(asn_DEF_T6_tags_1[0]), /* 1 */
305         asn_DEF_T6_tags_1,      /* Same as above */
306         sizeof(asn_DEF_T6_tags_1)
307                 /sizeof(asn_DEF_T6_tags_1[0]), /* 1 */
308         { 0, 0, NativeReal_constraint },
309         0, 0,   /* No members */
310         0       /* No specifics */
311 };
312
313
314 /*** <<< INCLUDES [T] >>> ***/
315
316 #include "Ts.h"
317
318 /*** <<< TYPE-DECLS [T] >>> ***/
319
320 typedef Ts_t     T_t;
321
322 /*** <<< FUNC-DECLS [T] >>> ***/
323
324 extern asn_TYPE_descriptor_t asn_DEF_T;
325 asn_struct_free_f T_free;
326 asn_struct_print_f T_print;
327 asn_constr_check_f T_constraint;
328 ber_type_decoder_f T_decode_ber;
329 der_type_encoder_f T_encode_der;
330 xer_type_decoder_f T_decode_xer;
331 xer_type_encoder_f T_encode_xer;
332
333 /*** <<< CODE [T] >>> ***/
334
335 /*
336  * This type is implemented using Ts,
337  * so here we adjust the DEF accordingly.
338  */
339
340 /*** <<< STAT-DEFS [T] >>> ***/
341
342 static const ber_tlv_tag_t asn_DEF_T_tags_1[] = {
343         (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
344         (ASN_TAG_CLASS_CONTEXT | (123 << 2)),
345         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
346 };
347 asn_TYPE_descriptor_t asn_DEF_T = {
348         "T",
349         "T",
350         &asn_OP_SEQUENCE,
351         asn_DEF_T_tags_1,
352         sizeof(asn_DEF_T_tags_1)
353                 /sizeof(asn_DEF_T_tags_1[0]) - 2, /* 1 */
354         asn_DEF_T_tags_1,       /* Same as above */
355         sizeof(asn_DEF_T_tags_1)
356                 /sizeof(asn_DEF_T_tags_1[0]), /* 3 */
357         { 0, 0, SEQUENCE_constraint },
358         asn_MBR_Ts_1,
359         3,      /* Elements count */
360         &asn_SPC_Ts_specs_1     /* Additional specs */
361 };
362
363
364 /*** <<< INCLUDES [Ts] >>> ***/
365
366 #include "T2.h"
367 #include "T3.h"
368 #include <constr_SEQUENCE.h>
369
370 /*** <<< TYPE-DECLS [Ts] >>> ***/
371
372 typedef struct Ts {
373         T2_t     m1;
374         T3_t    *m2;    /* OPTIONAL */
375         T3_t     m3;
376         
377         /* Context for parsing across buffer boundaries */
378         asn_struct_ctx_t _asn_ctx;
379 } Ts_t;
380
381 /*** <<< FUNC-DECLS [Ts] >>> ***/
382
383 extern asn_TYPE_descriptor_t asn_DEF_Ts;
384 extern asn_SEQUENCE_specifics_t asn_SPC_Ts_specs_1;
385 extern asn_TYPE_member_t asn_MBR_Ts_1[3];
386
387 /*** <<< STAT-DEFS [Ts] >>> ***/
388
389 asn_TYPE_member_t asn_MBR_Ts_1[] = {
390         { ATF_NOFLAGS, 0, offsetof(struct Ts, m1),
391                 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
392                 .tag_mode = -1, /* IMPLICIT tag at current level */
393                 .type = &asn_DEF_T2,
394                 .type_selector = 0,
395                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
396                 0, 0, /* No default value */
397                 .name = "m1"
398                 },
399         { ATF_POINTER, 1, offsetof(struct Ts, m2),
400                 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
401                 .tag_mode = +1, /* EXPLICIT tag at current level */
402                 .type = &asn_DEF_T3,
403                 .type_selector = 0,
404                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
405                 0, 0, /* No default value */
406                 .name = "m2"
407                 },
408         { ATF_NOFLAGS, 0, offsetof(struct Ts, m3),
409                 .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
410                 .tag_mode = -1, /* IMPLICIT tag at current level */
411                 .type = &asn_DEF_T3,
412                 .type_selector = 0,
413                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
414                 0, 0, /* No default value */
415                 .name = "m3"
416                 },
417 };
418 static const ber_tlv_tag_t asn_DEF_Ts_tags_1[] = {
419         (ASN_TAG_CLASS_CONTEXT | (123 << 2)),
420         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
421 };
422 static const asn_TYPE_tag2member_t asn_MAP_Ts_tag2el_1[] = {
423     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* m1 */
424     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* m2 */
425     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 2, 0, 0 } /* m3 */
426 };
427 asn_SEQUENCE_specifics_t asn_SPC_Ts_specs_1 = {
428         sizeof(struct Ts),
429         offsetof(struct Ts, _asn_ctx),
430         .tag2el = asn_MAP_Ts_tag2el_1,
431         .tag2el_count = 3,      /* Count of tags in the map */
432         0, 0, 0,        /* Optional elements (not needed) */
433         -1,     /* First extension addition */
434 };
435 asn_TYPE_descriptor_t asn_DEF_Ts = {
436         "Ts",
437         "Ts",
438         &asn_OP_SEQUENCE,
439         asn_DEF_Ts_tags_1,
440         sizeof(asn_DEF_Ts_tags_1)
441                 /sizeof(asn_DEF_Ts_tags_1[0]) - 1, /* 1 */
442         asn_DEF_Ts_tags_1,      /* Same as above */
443         sizeof(asn_DEF_Ts_tags_1)
444                 /sizeof(asn_DEF_Ts_tags_1[0]), /* 2 */
445         { 0, 0, SEQUENCE_constraint },
446         asn_MBR_Ts_1,
447         3,      /* Elements count */
448         &asn_SPC_Ts_specs_1     /* Additional specs */
449 };
450