3074c7229d0d9b8b4e1ae972351684026ca299c1
[com/asn1c.git] / tests / tests-asn1c-compiler / 03-enum-OK.asn1.-Pfwide-types
1
2 /*** <<< INCLUDES [Enum1] >>> ***/
3
4 #include <ENUMERATED.h>
5
6 /*** <<< DEPS [Enum1] >>> ***/
7
8 typedef enum Enum1 {
9         Enum1_red       = 0,
10         Enum1_green     = 1,
11         Enum1_blue      = 4,
12         Enum1_alpha     = 5
13         /*
14          * Enumeration is extensible
15          */
16 } e_Enum1;
17
18 /*** <<< TYPE-DECLS [Enum1] >>> ***/
19
20 typedef ENUMERATED_t     Enum1_t;
21
22 /*** <<< FUNC-DECLS [Enum1] >>> ***/
23
24 extern asn_TYPE_descriptor_t asn_DEF_Enum1;
25 asn_struct_free_f Enum1_free;
26 asn_struct_print_f Enum1_print;
27 asn_constr_check_f Enum1_constraint;
28 ber_type_decoder_f Enum1_decode_ber;
29 der_type_encoder_f Enum1_encode_der;
30 xer_type_decoder_f Enum1_decode_xer;
31 xer_type_encoder_f Enum1_encode_xer;
32
33 /*** <<< CODE [Enum1] >>> ***/
34
35 /*
36  * This type is implemented using ENUMERATED,
37  * so here we adjust the DEF accordingly.
38  */
39
40 /*** <<< STAT-DEFS [Enum1] >>> ***/
41
42 static const asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = {
43         { 0,    3,      "red" },
44         { 1,    5,      "green" },
45         { 4,    4,      "blue" },
46         { 5,    5,      "alpha" }
47         /* This list is extensible */
48 };
49 static const unsigned int asn_MAP_Enum1_enum2value_1[] = {
50         3,      /* alpha(5) */
51         2,      /* blue(4) */
52         1,      /* green(1) */
53         0       /* red(0) */
54         /* This list is extensible */
55 };
56 static const asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = {
57         asn_MAP_Enum1_value2enum_1,     /* "tag" => N; sorted by tag */
58         asn_MAP_Enum1_enum2value_1,     /* N => "tag"; sorted by N */
59         4,      /* Number of elements in the maps */
60         5,      /* Extensions before this member */
61         1,      /* Strict enumeration */
62         0,      /* Native long size */
63         0
64 };
65 static const ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = {
66         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
67 };
68 asn_TYPE_descriptor_t asn_DEF_Enum1 = {
69         "Enum1",
70         "Enum1",
71         &asn_OP_ENUMERATED,
72         asn_DEF_Enum1_tags_1,
73         sizeof(asn_DEF_Enum1_tags_1)
74                 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
75         asn_DEF_Enum1_tags_1,   /* Same as above */
76         sizeof(asn_DEF_Enum1_tags_1)
77                 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
78         { 0, 0, ENUMERATED_constraint },
79         0, 0,   /* Defined elsewhere */
80         &asn_SPC_Enum1_specs_1  /* Additional specs */
81 };
82
83
84 /*** <<< INCLUDES [Enum2] >>> ***/
85
86 #include <ENUMERATED.h>
87
88 /*** <<< DEPS [Enum2] >>> ***/
89
90 typedef enum Enum2 {
91         Enum2_red       = 0,
92         Enum2_green     = 1,
93         Enum2_blue      = 45,
94         Enum2_orange    = 23,
95         Enum2_alpha     = 46,
96         /*
97          * Enumeration is extensible
98          */
99         Enum2_beta      = 12,
100         Enum2_gamma     = 103
101 } e_Enum2;
102
103 /*** <<< TYPE-DECLS [Enum2] >>> ***/
104
105 typedef ENUMERATED_t     Enum2_t;
106
107 /*** <<< FUNC-DECLS [Enum2] >>> ***/
108
109 extern asn_TYPE_descriptor_t asn_DEF_Enum2;
110 asn_struct_free_f Enum2_free;
111 asn_struct_print_f Enum2_print;
112 asn_constr_check_f Enum2_constraint;
113 ber_type_decoder_f Enum2_decode_ber;
114 der_type_encoder_f Enum2_encode_der;
115 xer_type_decoder_f Enum2_decode_xer;
116 xer_type_encoder_f Enum2_encode_xer;
117
118 /*** <<< CODE [Enum2] >>> ***/
119
120 /*
121  * This type is implemented using ENUMERATED,
122  * so here we adjust the DEF accordingly.
123  */
124
125 /*** <<< STAT-DEFS [Enum2] >>> ***/
126
127 static const asn_INTEGER_enum_map_t asn_MAP_Enum2_value2enum_1[] = {
128         { 0,    3,      "red" },
129         { 1,    5,      "green" },
130         { 12,   4,      "beta" },
131         { 23,   6,      "orange" },
132         { 45,   4,      "blue" },
133         { 46,   5,      "alpha" },
134         { 103,  5,      "gamma" }
135         /* This list is extensible */
136 };
137 static const unsigned int asn_MAP_Enum2_enum2value_1[] = {
138         5,      /* alpha(46) */
139         2,      /* beta(12) */
140         4,      /* blue(45) */
141         6,      /* gamma(103) */
142         1,      /* green(1) */
143         3,      /* orange(23) */
144         0       /* red(0) */
145         /* This list is extensible */
146 };
147 static const asn_INTEGER_specifics_t asn_SPC_Enum2_specs_1 = {
148         asn_MAP_Enum2_value2enum_1,     /* "tag" => N; sorted by tag */
149         asn_MAP_Enum2_enum2value_1,     /* N => "tag"; sorted by N */
150         7,      /* Number of elements in the maps */
151         6,      /* Extensions before this member */
152         1,      /* Strict enumeration */
153         0,      /* Native long size */
154         0
155 };
156 static const ber_tlv_tag_t asn_DEF_Enum2_tags_1[] = {
157         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
158 };
159 asn_TYPE_descriptor_t asn_DEF_Enum2 = {
160         "Enum2",
161         "Enum2",
162         &asn_OP_ENUMERATED,
163         asn_DEF_Enum2_tags_1,
164         sizeof(asn_DEF_Enum2_tags_1)
165                 /sizeof(asn_DEF_Enum2_tags_1[0]), /* 1 */
166         asn_DEF_Enum2_tags_1,   /* Same as above */
167         sizeof(asn_DEF_Enum2_tags_1)
168                 /sizeof(asn_DEF_Enum2_tags_1[0]), /* 1 */
169         { 0, 0, ENUMERATED_constraint },
170         0, 0,   /* Defined elsewhere */
171         &asn_SPC_Enum2_specs_1  /* Additional specs */
172 };
173
174
175 /*** <<< INCLUDES [Enum3] >>> ***/
176
177 #include <ENUMERATED.h>
178
179 /*** <<< DEPS [Enum3] >>> ***/
180
181 typedef enum Enum3 {
182         Enum3_a = 0,
183         Enum3_b = 3,
184         /*
185          * Enumeration is extensible
186          */
187         Enum3_c = 1
188 } e_Enum3;
189
190 /*** <<< TYPE-DECLS [Enum3] >>> ***/
191
192 typedef ENUMERATED_t     Enum3_t;
193
194 /*** <<< FUNC-DECLS [Enum3] >>> ***/
195
196 extern asn_TYPE_descriptor_t asn_DEF_Enum3;
197 asn_struct_free_f Enum3_free;
198 asn_struct_print_f Enum3_print;
199 asn_constr_check_f Enum3_constraint;
200 ber_type_decoder_f Enum3_decode_ber;
201 der_type_encoder_f Enum3_encode_der;
202 xer_type_decoder_f Enum3_decode_xer;
203 xer_type_encoder_f Enum3_encode_xer;
204
205 /*** <<< CODE [Enum3] >>> ***/
206
207 /*
208  * This type is implemented using ENUMERATED,
209  * so here we adjust the DEF accordingly.
210  */
211
212 /*** <<< STAT-DEFS [Enum3] >>> ***/
213
214 static const asn_INTEGER_enum_map_t asn_MAP_Enum3_value2enum_1[] = {
215         { 0,    1,      "a" },
216         { 1,    1,      "c" },
217         { 3,    1,      "b" }
218         /* This list is extensible */
219 };
220 static const unsigned int asn_MAP_Enum3_enum2value_1[] = {
221         0,      /* a(0) */
222         2,      /* b(3) */
223         1       /* c(1) */
224         /* This list is extensible */
225 };
226 static const asn_INTEGER_specifics_t asn_SPC_Enum3_specs_1 = {
227         asn_MAP_Enum3_value2enum_1,     /* "tag" => N; sorted by tag */
228         asn_MAP_Enum3_enum2value_1,     /* N => "tag"; sorted by N */
229         3,      /* Number of elements in the maps */
230         3,      /* Extensions before this member */
231         1,      /* Strict enumeration */
232         0,      /* Native long size */
233         0
234 };
235 static const ber_tlv_tag_t asn_DEF_Enum3_tags_1[] = {
236         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
237 };
238 asn_TYPE_descriptor_t asn_DEF_Enum3 = {
239         "Enum3",
240         "Enum3",
241         &asn_OP_ENUMERATED,
242         asn_DEF_Enum3_tags_1,
243         sizeof(asn_DEF_Enum3_tags_1)
244                 /sizeof(asn_DEF_Enum3_tags_1[0]), /* 1 */
245         asn_DEF_Enum3_tags_1,   /* Same as above */
246         sizeof(asn_DEF_Enum3_tags_1)
247                 /sizeof(asn_DEF_Enum3_tags_1[0]), /* 1 */
248         { 0, 0, ENUMERATED_constraint },
249         0, 0,   /* Defined elsewhere */
250         &asn_SPC_Enum3_specs_1  /* Additional specs */
251 };
252
253
254 /*** <<< INCLUDES [Enum4] >>> ***/
255
256 #include <ENUMERATED.h>
257
258 /*** <<< DEPS [Enum4] >>> ***/
259
260 typedef enum Enum4 {
261         Enum4_a = 0,
262         Enum4_b = 1,
263         /*
264          * Enumeration is extensible
265          */
266         Enum4_c = 3,
267         Enum4_d = 4
268 } e_Enum4;
269
270 /*** <<< TYPE-DECLS [Enum4] >>> ***/
271
272 typedef ENUMERATED_t     Enum4_t;
273
274 /*** <<< FUNC-DECLS [Enum4] >>> ***/
275
276 extern asn_TYPE_descriptor_t asn_DEF_Enum4;
277 asn_struct_free_f Enum4_free;
278 asn_struct_print_f Enum4_print;
279 asn_constr_check_f Enum4_constraint;
280 ber_type_decoder_f Enum4_decode_ber;
281 der_type_encoder_f Enum4_encode_der;
282 xer_type_decoder_f Enum4_decode_xer;
283 xer_type_encoder_f Enum4_encode_xer;
284
285 /*** <<< CODE [Enum4] >>> ***/
286
287 /*
288  * This type is implemented using ENUMERATED,
289  * so here we adjust the DEF accordingly.
290  */
291
292 /*** <<< STAT-DEFS [Enum4] >>> ***/
293
294 static const asn_INTEGER_enum_map_t asn_MAP_Enum4_value2enum_1[] = {
295         { 0,    1,      "a" },
296         { 1,    1,      "b" },
297         { 3,    1,      "c" },
298         { 4,    1,      "d" }
299         /* This list is extensible */
300 };
301 static const unsigned int asn_MAP_Enum4_enum2value_1[] = {
302         0,      /* a(0) */
303         1,      /* b(1) */
304         2,      /* c(3) */
305         3       /* d(4) */
306         /* This list is extensible */
307 };
308 static const asn_INTEGER_specifics_t asn_SPC_Enum4_specs_1 = {
309         asn_MAP_Enum4_value2enum_1,     /* "tag" => N; sorted by tag */
310         asn_MAP_Enum4_enum2value_1,     /* N => "tag"; sorted by N */
311         4,      /* Number of elements in the maps */
312         3,      /* Extensions before this member */
313         1,      /* Strict enumeration */
314         0,      /* Native long size */
315         0
316 };
317 static const ber_tlv_tag_t asn_DEF_Enum4_tags_1[] = {
318         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
319 };
320 asn_TYPE_descriptor_t asn_DEF_Enum4 = {
321         "Enum4",
322         "Enum4",
323         &asn_OP_ENUMERATED,
324         asn_DEF_Enum4_tags_1,
325         sizeof(asn_DEF_Enum4_tags_1)
326                 /sizeof(asn_DEF_Enum4_tags_1[0]), /* 1 */
327         asn_DEF_Enum4_tags_1,   /* Same as above */
328         sizeof(asn_DEF_Enum4_tags_1)
329                 /sizeof(asn_DEF_Enum4_tags_1[0]), /* 1 */
330         { 0, 0, ENUMERATED_constraint },
331         0, 0,   /* Defined elsewhere */
332         &asn_SPC_Enum4_specs_1  /* Additional specs */
333 };
334
335
336 /*** <<< INCLUDES [Enum5] >>> ***/
337
338 #include <ENUMERATED.h>
339
340 /*** <<< DEPS [Enum5] >>> ***/
341
342 typedef enum Enum5 {
343         Enum5_a = 0,
344         Enum5_z = 25,
345         /*
346          * Enumeration is extensible
347          */
348         Enum5_d = 26
349 } e_Enum5;
350
351 /*** <<< TYPE-DECLS [Enum5] >>> ***/
352
353 typedef ENUMERATED_t     Enum5_t;
354
355 /*** <<< FUNC-DECLS [Enum5] >>> ***/
356
357 extern asn_TYPE_descriptor_t asn_DEF_Enum5;
358 asn_struct_free_f Enum5_free;
359 asn_struct_print_f Enum5_print;
360 asn_constr_check_f Enum5_constraint;
361 ber_type_decoder_f Enum5_decode_ber;
362 der_type_encoder_f Enum5_encode_der;
363 xer_type_decoder_f Enum5_decode_xer;
364 xer_type_encoder_f Enum5_encode_xer;
365
366 /*** <<< CODE [Enum5] >>> ***/
367
368 /*
369  * This type is implemented using ENUMERATED,
370  * so here we adjust the DEF accordingly.
371  */
372
373 /*** <<< STAT-DEFS [Enum5] >>> ***/
374
375 static const asn_INTEGER_enum_map_t asn_MAP_Enum5_value2enum_1[] = {
376         { 0,    1,      "a" },
377         { 25,   1,      "z" },
378         { 26,   1,      "d" }
379         /* This list is extensible */
380 };
381 static const unsigned int asn_MAP_Enum5_enum2value_1[] = {
382         0,      /* a(0) */
383         2,      /* d(26) */
384         1       /* z(25) */
385         /* This list is extensible */
386 };
387 static const asn_INTEGER_specifics_t asn_SPC_Enum5_specs_1 = {
388         asn_MAP_Enum5_value2enum_1,     /* "tag" => N; sorted by tag */
389         asn_MAP_Enum5_enum2value_1,     /* N => "tag"; sorted by N */
390         3,      /* Number of elements in the maps */
391         3,      /* Extensions before this member */
392         1,      /* Strict enumeration */
393         0,      /* Native long size */
394         0
395 };
396 static const ber_tlv_tag_t asn_DEF_Enum5_tags_1[] = {
397         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
398 };
399 asn_TYPE_descriptor_t asn_DEF_Enum5 = {
400         "Enum5",
401         "Enum5",
402         &asn_OP_ENUMERATED,
403         asn_DEF_Enum5_tags_1,
404         sizeof(asn_DEF_Enum5_tags_1)
405                 /sizeof(asn_DEF_Enum5_tags_1[0]), /* 1 */
406         asn_DEF_Enum5_tags_1,   /* Same as above */
407         sizeof(asn_DEF_Enum5_tags_1)
408                 /sizeof(asn_DEF_Enum5_tags_1[0]), /* 1 */
409         { 0, 0, ENUMERATED_constraint },
410         0, 0,   /* Defined elsewhere */
411         &asn_SPC_Enum5_specs_1  /* Additional specs */
412 };
413