NativeEnumerated.c vars NULL init and check
[com/asn1c.git] / tests / tests-asn1c-compiler / 89-bit-string-enum-OK.asn1.-Pfwide-types
1
2 /*** <<< INCLUDES [T] >>> ***/
3
4 #include <BIT_STRING.h>
5 #include <constr_CHOICE.h>
6
7 /*** <<< DEPS [T] >>> ***/
8
9 typedef enum T_PR {
10         T_PR_NOTHING,   /* No components present */
11         T_PR_bs
12 } T_PR;
13 typedef enum bs {
14         bs_a    = 1,
15         bs_b    = 2
16 } e_bs;
17
18 /*** <<< TYPE-DECLS [T] >>> ***/
19
20 typedef struct T {
21         T_PR present;
22         union T_u {
23                 BIT_STRING_t     bs;
24         } choice;
25         
26         /* Context for parsing across buffer boundaries */
27         asn_struct_ctx_t _asn_ctx;
28 } T_t;
29
30 /*** <<< FUNC-DECLS [T] >>> ***/
31
32 extern asn_TYPE_descriptor_t asn_DEF_T;
33
34 /*** <<< STAT-DEFS [T] >>> ***/
35
36 static asn_TYPE_member_t asn_MBR_T_1[] = {
37         { ATF_NOFLAGS, 0, offsetof(struct T, choice.bs),
38                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
39                 .tag_mode = 0,
40                 .type = &asn_DEF_BIT_STRING,
41                 .type_selector = 0,
42                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
43                 0, 0, /* No default value */
44                 .name = "bs"
45                 },
46 };
47 static const asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = {
48     { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 } /* bs */
49 };
50 static asn_CHOICE_specifics_t asn_SPC_T_specs_1 = {
51         sizeof(struct T),
52         offsetof(struct T, _asn_ctx),
53         offsetof(struct T, present),
54         sizeof(((struct T *)0)->present),
55         .tag2el = asn_MAP_T_tag2el_1,
56         .tag2el_count = 1,      /* Count of tags in the map */
57         0, 0,
58         .first_extension = -1   /* Extensions start */
59 };
60 asn_TYPE_descriptor_t asn_DEF_T = {
61         "T",
62         "T",
63         &asn_OP_CHOICE,
64         0,      /* No effective tags (pointer) */
65         0,      /* No effective tags (count) */
66         0,      /* No tags (pointer) */
67         0,      /* No tags (count) */
68         { 0, 0, CHOICE_constraint },
69         asn_MBR_T_1,
70         1,      /* Elements count */
71         &asn_SPC_T_specs_1      /* Additional specs */
72 };
73