5aca4453a11feccb93f8893d654b83b1198a55b3
[com/asn1c.git] / tests / tests-asn1c-compiler / 47-set-ext-OK.asn1.-Pfwide-types
1
2 /*** <<< INCLUDES [T1] >>> ***/
3
4 #include <INTEGER.h>
5 #include <constr_SET.h>
6
7 /*** <<< DEPS [T1] >>> ***/
8
9
10 /*
11  * Method of determining the components presence
12  */
13 typedef enum T1_PR {
14         T1_PR_i,        /* Member i is present */
15 } T1_PR;
16
17 /*** <<< TYPE-DECLS [T1] >>> ***/
18
19 typedef struct T1 {
20         INTEGER_t        i;
21         /*
22          * This type is extensible,
23          * possible extensions are below.
24          */
25         
26         /* Presence bitmask: ASN_SET_ISPRESENT(pT1, T1_PR_x) */
27         unsigned int _presence_map
28                 [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
29         
30         /* Context for parsing across buffer boundaries */
31         asn_struct_ctx_t _asn_ctx;
32 } T1_t;
33
34 /*** <<< FUNC-DECLS [T1] >>> ***/
35
36 extern asn_TYPE_descriptor_t asn_DEF_T1;
37
38 /*** <<< STAT-DEFS [T1] >>> ***/
39
40 static asn_TYPE_member_t asn_MBR_T1_1[] = {
41         { ATF_NOFLAGS, 0, offsetof(struct T1, i),
42                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
43                 .tag_mode = 0,
44                 .type = &asn_DEF_INTEGER,
45                 .type_selector = 0,
46                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
47                 0, 0, /* No default value */
48                 .name = "i"
49                 },
50 };
51 static const ber_tlv_tag_t asn_DEF_T1_tags_1[] = {
52         (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
53 };
54 static const asn_TYPE_tag2member_t asn_MAP_T1_tag2el_1[] = {
55     { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* i */
56 };
57 static const uint8_t asn_MAP_T1_mmap_1[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = {
58         (1 << 7)
59 };
60 static 
61 asn_SET_specifics_t asn_SPC_T1_specs_1 = {
62         sizeof(struct T1),
63         offsetof(struct T1, _asn_ctx),
64         offsetof(struct T1, _presence_map),
65         .tag2el = asn_MAP_T1_tag2el_1,
66         .tag2el_count = 1,      /* Count of tags in the map */
67         asn_MAP_T1_tag2el_1,    /* Same as above */
68         1,      /* Count of tags in the CXER map */
69         1,      /* Whether extensible */
70         (const unsigned int *)asn_MAP_T1_mmap_1 /* Mandatory elements map */
71 };
72 asn_TYPE_descriptor_t asn_DEF_T1 = {
73         "T1",
74         "T1",
75         &asn_OP_SET,
76         asn_DEF_T1_tags_1,
77         sizeof(asn_DEF_T1_tags_1)
78                 /sizeof(asn_DEF_T1_tags_1[0]), /* 1 */
79         asn_DEF_T1_tags_1,      /* Same as above */
80         sizeof(asn_DEF_T1_tags_1)
81                 /sizeof(asn_DEF_T1_tags_1[0]), /* 1 */
82         { 0, 0, SET_constraint },
83         asn_MBR_T1_1,
84         1,      /* Elements count */
85         &asn_SPC_T1_specs_1     /* Additional specs */
86 };
87
88
89 /*** <<< INCLUDES [T2] >>> ***/
90
91 #include <INTEGER.h>
92 #include <constr_SET.h>
93
94 /*** <<< DEPS [T2] >>> ***/
95
96
97 /*
98  * Method of determining the components presence
99  */
100 typedef enum T2_PR {
101         T2_PR_i,        /* Member i is present */
102 } T2_PR;
103
104 /*** <<< TYPE-DECLS [T2] >>> ***/
105
106 typedef struct T2 {
107         INTEGER_t        i;
108         /*
109          * This type is extensible,
110          * possible extensions are below.
111          */
112         
113         /* Presence bitmask: ASN_SET_ISPRESENT(pT2, T2_PR_x) */
114         unsigned int _presence_map
115                 [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
116         
117         /* Context for parsing across buffer boundaries */
118         asn_struct_ctx_t _asn_ctx;
119 } T2_t;
120
121 /*** <<< FUNC-DECLS [T2] >>> ***/
122
123 extern asn_TYPE_descriptor_t asn_DEF_T2;
124
125 /*** <<< STAT-DEFS [T2] >>> ***/
126
127 static asn_TYPE_member_t asn_MBR_T2_1[] = {
128         { ATF_NOFLAGS, 0, offsetof(struct T2, i),
129                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
130                 .tag_mode = 0,
131                 .type = &asn_DEF_INTEGER,
132                 .type_selector = 0,
133                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
134                 0, 0, /* No default value */
135                 .name = "i"
136                 },
137 };
138 static const ber_tlv_tag_t asn_DEF_T2_tags_1[] = {
139         (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
140 };
141 static const asn_TYPE_tag2member_t asn_MAP_T2_tag2el_1[] = {
142     { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* i */
143 };
144 static const uint8_t asn_MAP_T2_mmap_1[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = {
145         (1 << 7)
146 };
147 static 
148 asn_SET_specifics_t asn_SPC_T2_specs_1 = {
149         sizeof(struct T2),
150         offsetof(struct T2, _asn_ctx),
151         offsetof(struct T2, _presence_map),
152         .tag2el = asn_MAP_T2_tag2el_1,
153         .tag2el_count = 1,      /* Count of tags in the map */
154         asn_MAP_T2_tag2el_1,    /* Same as above */
155         1,      /* Count of tags in the CXER map */
156         1,      /* Whether extensible */
157         (const unsigned int *)asn_MAP_T2_mmap_1 /* Mandatory elements map */
158 };
159 asn_TYPE_descriptor_t asn_DEF_T2 = {
160         "T2",
161         "T2",
162         &asn_OP_SET,
163         asn_DEF_T2_tags_1,
164         sizeof(asn_DEF_T2_tags_1)
165                 /sizeof(asn_DEF_T2_tags_1[0]), /* 1 */
166         asn_DEF_T2_tags_1,      /* Same as above */
167         sizeof(asn_DEF_T2_tags_1)
168                 /sizeof(asn_DEF_T2_tags_1[0]), /* 1 */
169         { 0, 0, SET_constraint },
170         asn_MBR_T2_1,
171         1,      /* Elements count */
172         &asn_SPC_T2_specs_1     /* Additional specs */
173 };
174
175
176 /*** <<< INCLUDES [T3] >>> ***/
177
178 #include <INTEGER.h>
179 #include <constr_CHOICE.h>
180
181 /*** <<< DEPS [T3] >>> ***/
182
183 typedef enum T3_PR {
184         T3_PR_NOTHING,  /* No components present */
185         T3_PR_i
186         /* Extensions may appear below */
187         
188 } T3_PR;
189
190 /*** <<< TYPE-DECLS [T3] >>> ***/
191
192 typedef struct T3 {
193         T3_PR present;
194         union T3_u {
195                 INTEGER_t        i;
196                 /*
197                  * This type is extensible,
198                  * possible extensions are below.
199                  */
200         } choice;
201         
202         /* Context for parsing across buffer boundaries */
203         asn_struct_ctx_t _asn_ctx;
204 } T3_t;
205
206 /*** <<< FUNC-DECLS [T3] >>> ***/
207
208 extern asn_TYPE_descriptor_t asn_DEF_T3;
209
210 /*** <<< STAT-DEFS [T3] >>> ***/
211
212 static asn_TYPE_member_t asn_MBR_T3_1[] = {
213         { ATF_NOFLAGS, 0, offsetof(struct T3, choice.i),
214                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
215                 .tag_mode = 0,
216                 .type = &asn_DEF_INTEGER,
217                 .type_selector = 0,
218                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
219                 0, 0, /* No default value */
220                 .name = "i"
221                 },
222 };
223 static const asn_TYPE_tag2member_t asn_MAP_T3_tag2el_1[] = {
224     { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* i */
225 };
226 static asn_CHOICE_specifics_t asn_SPC_T3_specs_1 = {
227         sizeof(struct T3),
228         offsetof(struct T3, _asn_ctx),
229         offsetof(struct T3, present),
230         sizeof(((struct T3 *)0)->present),
231         .tag2el = asn_MAP_T3_tag2el_1,
232         .tag2el_count = 1,      /* Count of tags in the map */
233         0, 0,
234         .first_extension = 1    /* Extensions start */
235 };
236 asn_TYPE_descriptor_t asn_DEF_T3 = {
237         "T3",
238         "T3",
239         &asn_OP_CHOICE,
240         0,      /* No effective tags (pointer) */
241         0,      /* No effective tags (count) */
242         0,      /* No tags (pointer) */
243         0,      /* No tags (count) */
244         { 0, 0, CHOICE_constraint },
245         asn_MBR_T3_1,
246         1,      /* Elements count */
247         &asn_SPC_T3_specs_1     /* Additional specs */
248 };
249
250
251 /*** <<< INCLUDES [T4] >>> ***/
252
253 #include <INTEGER.h>
254 #include <constr_CHOICE.h>
255
256 /*** <<< DEPS [T4] >>> ***/
257
258 typedef enum T4_PR {
259         T4_PR_NOTHING,  /* No components present */
260         T4_PR_i
261         /* Extensions may appear below */
262         
263 } T4_PR;
264
265 /*** <<< TYPE-DECLS [T4] >>> ***/
266
267 typedef struct T4 {
268         T4_PR present;
269         union T4_u {
270                 INTEGER_t        i;
271                 /*
272                  * This type is extensible,
273                  * possible extensions are below.
274                  */
275         } choice;
276         
277         /* Context for parsing across buffer boundaries */
278         asn_struct_ctx_t _asn_ctx;
279 } T4_t;
280
281 /*** <<< FUNC-DECLS [T4] >>> ***/
282
283 extern asn_TYPE_descriptor_t asn_DEF_T4;
284
285 /*** <<< STAT-DEFS [T4] >>> ***/
286
287 static asn_TYPE_member_t asn_MBR_T4_1[] = {
288         { ATF_NOFLAGS, 0, offsetof(struct T4, choice.i),
289                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
290                 .tag_mode = 0,
291                 .type = &asn_DEF_INTEGER,
292                 .type_selector = 0,
293                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
294                 0, 0, /* No default value */
295                 .name = "i"
296                 },
297 };
298 static const asn_TYPE_tag2member_t asn_MAP_T4_tag2el_1[] = {
299     { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* i */
300 };
301 static asn_CHOICE_specifics_t asn_SPC_T4_specs_1 = {
302         sizeof(struct T4),
303         offsetof(struct T4, _asn_ctx),
304         offsetof(struct T4, present),
305         sizeof(((struct T4 *)0)->present),
306         .tag2el = asn_MAP_T4_tag2el_1,
307         .tag2el_count = 1,      /* Count of tags in the map */
308         0, 0,
309         .first_extension = 1    /* Extensions start */
310 };
311 asn_TYPE_descriptor_t asn_DEF_T4 = {
312         "T4",
313         "T4",
314         &asn_OP_CHOICE,
315         0,      /* No effective tags (pointer) */
316         0,      /* No effective tags (count) */
317         0,      /* No tags (pointer) */
318         0,      /* No tags (count) */
319         { 0, 0, CHOICE_constraint },
320         asn_MBR_T4_1,
321         1,      /* Elements count */
322         &asn_SPC_T4_specs_1     /* Additional specs */
323 };
324