c53551509cb4481c9f03ae84b1f8a099f8aaef69
[com/asn1c.git] / tests / tests-asn1c-compiler / 39-sequence-of-OK.asn1.-Pfwide-types
1
2 /*** <<< INCLUDES [T] >>> ***/
3
4 #include <INTEGER.h>
5 #include <asn_SEQUENCE_OF.h>
6 #include <constr_SEQUENCE_OF.h>
7 #include <constr_SEQUENCE.h>
8
9 /*** <<< FWD-DECLS [T] >>> ***/
10
11 struct T2;
12
13 /*** <<< TYPE-DECLS [T] >>> ***/
14
15 typedef struct T {
16         INTEGER_t        Int;
17         struct collection {
18                 A_SEQUENCE_OF(struct T2) list;
19                 
20                 /* Context for parsing across buffer boundaries */
21                 asn_struct_ctx_t _asn_ctx;
22         } collection;
23         
24         /* Context for parsing across buffer boundaries */
25         asn_struct_ctx_t _asn_ctx;
26 } T_t;
27
28 /*** <<< FUNC-DECLS [T] >>> ***/
29
30 extern asn_TYPE_descriptor_t asn_DEF_T;
31
32 /*** <<< POST-INCLUDE [T] >>> ***/
33
34 #include "T2.h"
35
36 /*** <<< STAT-DEFS [T] >>> ***/
37
38 static asn_TYPE_member_t asn_MBR_collection_3[] = {
39         { ATF_POINTER, 0, 0,
40                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
41                 .tag_mode = 0,
42                 .type = &asn_DEF_T2,
43                 .type_selector = 0,
44                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
45                 0, 0, /* No default value */
46                 .name = ""
47                 },
48 };
49 static const ber_tlv_tag_t asn_DEF_collection_tags_3[] = {
50         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
51 };
52 static asn_SET_OF_specifics_t asn_SPC_collection_specs_3 = {
53         sizeof(struct collection),
54         offsetof(struct collection, _asn_ctx),
55         0,      /* XER encoding is XMLDelimitedItemList */
56 };
57 static /* Use -fall-defs-global to expose */
58 asn_TYPE_descriptor_t asn_DEF_collection_3 = {
59         "collection",
60         "collection",
61         &asn_OP_SEQUENCE_OF,
62         asn_DEF_collection_tags_3,
63         sizeof(asn_DEF_collection_tags_3)
64                 /sizeof(asn_DEF_collection_tags_3[0]), /* 1 */
65         asn_DEF_collection_tags_3,      /* Same as above */
66         sizeof(asn_DEF_collection_tags_3)
67                 /sizeof(asn_DEF_collection_tags_3[0]), /* 1 */
68         { 0, 0, SEQUENCE_OF_constraint },
69         asn_MBR_collection_3,
70         1,      /* Single element */
71         &asn_SPC_collection_specs_3     /* Additional specs */
72 };
73
74 static asn_TYPE_member_t asn_MBR_T_1[] = {
75         { ATF_NOFLAGS, 0, offsetof(struct T, Int),
76                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
77                 .tag_mode = 0,
78                 .type = &asn_DEF_INTEGER,
79                 .type_selector = 0,
80                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
81                 0, 0, /* No default value */
82                 .name = "int"
83                 },
84         { ATF_NOFLAGS, 0, offsetof(struct T, collection),
85                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
86                 .tag_mode = 0,
87                 .type = &asn_DEF_collection_3,
88                 .type_selector = 0,
89                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
90                 0, 0, /* No default value */
91                 .name = "collection"
92                 },
93 };
94 static const ber_tlv_tag_t asn_DEF_T_tags_1[] = {
95         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
96 };
97 static const asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = {
98     { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* int */
99     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 } /* collection */
100 };
101 static asn_SEQUENCE_specifics_t asn_SPC_T_specs_1 = {
102         sizeof(struct T),
103         offsetof(struct T, _asn_ctx),
104         .tag2el = asn_MAP_T_tag2el_1,
105         .tag2el_count = 2,      /* Count of tags in the map */
106         0, 0, 0,        /* Optional elements (not needed) */
107         -1,     /* First extension addition */
108 };
109 asn_TYPE_descriptor_t asn_DEF_T = {
110         "T",
111         "T",
112         &asn_OP_SEQUENCE,
113         asn_DEF_T_tags_1,
114         sizeof(asn_DEF_T_tags_1)
115                 /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
116         asn_DEF_T_tags_1,       /* Same as above */
117         sizeof(asn_DEF_T_tags_1)
118                 /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
119         { 0, 0, SEQUENCE_constraint },
120         asn_MBR_T_1,
121         2,      /* Elements count */
122         &asn_SPC_T_specs_1      /* Additional specs */
123 };
124
125
126 /*** <<< INCLUDES [T2] >>> ***/
127
128 #include <BOOLEAN.h>
129 #include <UTF8String.h>
130 #include <constr_SEQUENCE.h>
131
132 /*** <<< TYPE-DECLS [T2] >>> ***/
133
134 typedef struct T2 {
135         BOOLEAN_t        flag;
136         UTF8String_t     str;
137         
138         /* Context for parsing across buffer boundaries */
139         asn_struct_ctx_t _asn_ctx;
140 } T2_t;
141
142 /*** <<< FUNC-DECLS [T2] >>> ***/
143
144 extern asn_TYPE_descriptor_t asn_DEF_T2;
145 extern asn_SEQUENCE_specifics_t asn_SPC_T2_specs_1;
146 extern asn_TYPE_member_t asn_MBR_T2_1[2];
147
148 /*** <<< STAT-DEFS [T2] >>> ***/
149
150 asn_TYPE_member_t asn_MBR_T2_1[] = {
151         { ATF_NOFLAGS, 0, offsetof(struct T2, flag),
152                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
153                 .tag_mode = 0,
154                 .type = &asn_DEF_BOOLEAN,
155                 .type_selector = 0,
156                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
157                 0, 0, /* No default value */
158                 .name = "flag"
159                 },
160         { ATF_NOFLAGS, 0, offsetof(struct T2, str),
161                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)),
162                 .tag_mode = 0,
163                 .type = &asn_DEF_UTF8String,
164                 .type_selector = 0,
165                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
166                 0, 0, /* No default value */
167                 .name = "str"
168                 },
169 };
170 static const ber_tlv_tag_t asn_DEF_T2_tags_1[] = {
171         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
172 };
173 static const asn_TYPE_tag2member_t asn_MAP_T2_tag2el_1[] = {
174     { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 0 }, /* flag */
175     { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 } /* str */
176 };
177 asn_SEQUENCE_specifics_t asn_SPC_T2_specs_1 = {
178         sizeof(struct T2),
179         offsetof(struct T2, _asn_ctx),
180         .tag2el = asn_MAP_T2_tag2el_1,
181         .tag2el_count = 2,      /* Count of tags in the map */
182         0, 0, 0,        /* Optional elements (not needed) */
183         -1,     /* First extension addition */
184 };
185 asn_TYPE_descriptor_t asn_DEF_T2 = {
186         "T2",
187         "T2",
188         &asn_OP_SEQUENCE,
189         asn_DEF_T2_tags_1,
190         sizeof(asn_DEF_T2_tags_1)
191                 /sizeof(asn_DEF_T2_tags_1[0]), /* 1 */
192         asn_DEF_T2_tags_1,      /* Same as above */
193         sizeof(asn_DEF_T2_tags_1)
194                 /sizeof(asn_DEF_T2_tags_1[0]), /* 1 */
195         { 0, 0, SEQUENCE_constraint },
196         asn_MBR_T2_1,
197         2,      /* Elements count */
198         &asn_SPC_T2_specs_1     /* Additional specs */
199 };
200