ee7edab4e6abc53fe0977b28e5ad40d071cf4bd6
[com/asn1c.git] / tests / tests-asn1c-compiler / 60-any-OK.asn1.-Pfwide-types
1
2 /*** <<< INCLUDES [T1] >>> ***/
3
4 #include <INTEGER.h>
5 #include <ANY.h>
6 #include <constr_SEQUENCE.h>
7
8 /*** <<< TYPE-DECLS [T1] >>> ***/
9
10 typedef struct T1 {
11         INTEGER_t        i;
12         ANY_t    any;
13         
14         /* Context for parsing across buffer boundaries */
15         asn_struct_ctx_t _asn_ctx;
16 } T1_t;
17
18 /*** <<< FUNC-DECLS [T1] >>> ***/
19
20 extern asn_TYPE_descriptor_t asn_DEF_T1;
21
22 /*** <<< STAT-DEFS [T1] >>> ***/
23
24 static asn_TYPE_member_t asn_MBR_T1_1[] = {
25         { ATF_NOFLAGS, 0, offsetof(struct T1, i),
26                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
27                 .tag_mode = 0,
28                 .type = &asn_DEF_INTEGER,
29                 .type_selector = 0,
30                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
31                 0, 0, /* No default value */
32                 .name = "i"
33                 },
34         { ATF_ANY_TYPE | ATF_NOFLAGS, 0, offsetof(struct T1, any),
35                 .tag = -1 /* Ambiguous tag (ANY?) */,
36                 .tag_mode = 0,
37                 .type = &asn_DEF_ANY,
38                 .type_selector = 0,
39                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
40                 0, 0, /* No default value */
41                 .name = "any"
42                 },
43 };
44 static const ber_tlv_tag_t asn_DEF_T1_tags_1[] = {
45         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
46 };
47 static const asn_TYPE_tag2member_t asn_MAP_T1_tag2el_1[] = {
48     { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* i */
49 };
50 static asn_SEQUENCE_specifics_t asn_SPC_T1_specs_1 = {
51         sizeof(struct T1),
52         offsetof(struct T1, _asn_ctx),
53         .tag2el = asn_MAP_T1_tag2el_1,
54         .tag2el_count = 1,      /* Count of tags in the map */
55         0, 0, 0,        /* Optional elements (not needed) */
56         -1,     /* First extension addition */
57 };
58 asn_TYPE_descriptor_t asn_DEF_T1 = {
59         "T1",
60         "T1",
61         &asn_OP_SEQUENCE,
62         asn_DEF_T1_tags_1,
63         sizeof(asn_DEF_T1_tags_1)
64                 /sizeof(asn_DEF_T1_tags_1[0]), /* 1 */
65         asn_DEF_T1_tags_1,      /* Same as above */
66         sizeof(asn_DEF_T1_tags_1)
67                 /sizeof(asn_DEF_T1_tags_1[0]), /* 1 */
68         { 0, 0, SEQUENCE_constraint },
69         asn_MBR_T1_1,
70         2,      /* Elements count */
71         &asn_SPC_T1_specs_1     /* Additional specs */
72 };
73
74
75 /*** <<< INCLUDES [T2] >>> ***/
76
77 #include <INTEGER.h>
78 #include <ANY.h>
79 #include <constr_SEQUENCE.h>
80
81 /*** <<< TYPE-DECLS [T2] >>> ***/
82
83 typedef struct T2 {
84         INTEGER_t        i;
85         ANY_t   *any;   /* OPTIONAL */
86         
87         /* Context for parsing across buffer boundaries */
88         asn_struct_ctx_t _asn_ctx;
89 } T2_t;
90
91 /*** <<< FUNC-DECLS [T2] >>> ***/
92
93 extern asn_TYPE_descriptor_t asn_DEF_T2;
94
95 /*** <<< STAT-DEFS [T2] >>> ***/
96
97 static asn_TYPE_member_t asn_MBR_T2_1[] = {
98         { ATF_NOFLAGS, 0, offsetof(struct T2, i),
99                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
100                 .tag_mode = 0,
101                 .type = &asn_DEF_INTEGER,
102                 .type_selector = 0,
103                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
104                 0, 0, /* No default value */
105                 .name = "i"
106                 },
107         { ATF_POINTER, 1, offsetof(struct T2, any),
108                 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
109                 .tag_mode = +1, /* EXPLICIT tag at current level */
110                 .type = &asn_DEF_ANY,
111                 .type_selector = 0,
112                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
113                 0, 0, /* No default value */
114                 .name = "any"
115                 },
116 };
117 static const ber_tlv_tag_t asn_DEF_T2_tags_1[] = {
118         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
119 };
120 static const asn_TYPE_tag2member_t asn_MAP_T2_tag2el_1[] = {
121     { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* i */
122     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 } /* any */
123 };
124 static asn_SEQUENCE_specifics_t asn_SPC_T2_specs_1 = {
125         sizeof(struct T2),
126         offsetof(struct T2, _asn_ctx),
127         .tag2el = asn_MAP_T2_tag2el_1,
128         .tag2el_count = 2,      /* Count of tags in the map */
129         0, 0, 0,        /* Optional elements (not needed) */
130         -1,     /* First extension addition */
131 };
132 asn_TYPE_descriptor_t asn_DEF_T2 = {
133         "T2",
134         "T2",
135         &asn_OP_SEQUENCE,
136         asn_DEF_T2_tags_1,
137         sizeof(asn_DEF_T2_tags_1)
138                 /sizeof(asn_DEF_T2_tags_1[0]), /* 1 */
139         asn_DEF_T2_tags_1,      /* Same as above */
140         sizeof(asn_DEF_T2_tags_1)
141                 /sizeof(asn_DEF_T2_tags_1[0]), /* 1 */
142         { 0, 0, SEQUENCE_constraint },
143         asn_MBR_T2_1,
144         2,      /* Elements count */
145         &asn_SPC_T2_specs_1     /* Additional specs */
146 };
147
148
149 /*** <<< INCLUDES [T3] >>> ***/
150
151 #include <ANY.h>
152 #include <constr_SEQUENCE.h>
153
154 /*** <<< TYPE-DECLS [T3] >>> ***/
155
156 typedef struct T3 {
157         ANY_t    any1;
158         ANY_t    any2;
159         
160         /* Context for parsing across buffer boundaries */
161         asn_struct_ctx_t _asn_ctx;
162 } T3_t;
163
164 /*** <<< FUNC-DECLS [T3] >>> ***/
165
166 extern asn_TYPE_descriptor_t asn_DEF_T3;
167
168 /*** <<< STAT-DEFS [T3] >>> ***/
169
170 static asn_TYPE_member_t asn_MBR_T3_1[] = {
171         { ATF_ANY_TYPE | ATF_NOFLAGS, 0, offsetof(struct T3, any1),
172                 .tag = -1 /* Ambiguous tag (ANY?) */,
173                 .tag_mode = 0,
174                 .type = &asn_DEF_ANY,
175                 .type_selector = 0,
176                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
177                 0, 0, /* No default value */
178                 .name = "any1"
179                 },
180         { ATF_ANY_TYPE | ATF_NOFLAGS, 0, offsetof(struct T3, any2),
181                 .tag = -1 /* Ambiguous tag (ANY?) */,
182                 .tag_mode = 0,
183                 .type = &asn_DEF_ANY,
184                 .type_selector = 0,
185                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
186                 0, 0, /* No default value */
187                 .name = "any2"
188                 },
189 };
190 static const ber_tlv_tag_t asn_DEF_T3_tags_1[] = {
191         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
192 };
193 static asn_SEQUENCE_specifics_t asn_SPC_T3_specs_1 = {
194         sizeof(struct T3),
195         offsetof(struct T3, _asn_ctx),
196         0,      /* No top level tags */
197         0,      /* No tags in the map */
198         0, 0, 0,        /* Optional elements (not needed) */
199         -1,     /* First extension addition */
200 };
201 asn_TYPE_descriptor_t asn_DEF_T3 = {
202         "T3",
203         "T3",
204         &asn_OP_SEQUENCE,
205         asn_DEF_T3_tags_1,
206         sizeof(asn_DEF_T3_tags_1)
207                 /sizeof(asn_DEF_T3_tags_1[0]), /* 1 */
208         asn_DEF_T3_tags_1,      /* Same as above */
209         sizeof(asn_DEF_T3_tags_1)
210                 /sizeof(asn_DEF_T3_tags_1[0]), /* 1 */
211         { 0, 0, SEQUENCE_constraint },
212         asn_MBR_T3_1,
213         2,      /* Elements count */
214         &asn_SPC_T3_specs_1     /* Additional specs */
215 };
216