NativeEnumerated.c vars NULL init and check
[com/asn1c.git] / tests / tests-asn1c-compiler / 158-sequence-of-sequence-nested-OK.asn1.-Pfcompound-names
1
2 /*** <<< INCLUDES [SeqWithNestedSOS] >>> ***/
3
4 #include <UTF8String.h>
5 #include <asn_SEQUENCE_OF.h>
6 #include <constr_SEQUENCE.h>
7 #include <constr_SEQUENCE_OF.h>
8
9 /*** <<< FWD-DEFS [SeqWithNestedSOS] >>> ***/
10
11 typedef struct SeqWithNestedSOS__sos__Member {
12         UTF8String_t     anotherString;
13         struct SeqWithNestedSOS__sos__Member__nested_sos {
14                 A_SEQUENCE_OF(typedef struct SeqWithNestedSOS__sos__Member__nested_sos__Member {
15                         UTF8String_t     nested_string;
16                         
17                         /* Context for parsing across buffer boundaries */
18                         asn_struct_ctx_t _asn_ctx;
19                 } SeqWithNestedSOS__sos__Member__nested_sos__Member;
20                 SeqWithNestedSOS__sos__Member__nested_sos__Member) list;
21                 
22                 /* Context for parsing across buffer boundaries */
23                 asn_struct_ctx_t _asn_ctx;
24         } nested_sos;
25         
26         /* Context for parsing across buffer boundaries */
27         asn_struct_ctx_t _asn_ctx;
28 } SeqWithNestedSOS__sos__Member;
29
30 /*** <<< TYPE-DECLS [SeqWithNestedSOS] >>> ***/
31
32 typedef struct SeqWithNestedSOS {
33         UTF8String_t     someString;
34         struct SeqWithNestedSOS__sos {
35                 A_SEQUENCE_OF(SeqWithNestedSOS__sos__Member) list;
36                 
37                 /* Context for parsing across buffer boundaries */
38                 asn_struct_ctx_t _asn_ctx;
39         } sos;
40         
41         /* Context for parsing across buffer boundaries */
42         asn_struct_ctx_t _asn_ctx;
43 } SeqWithNestedSOS_t;
44
45 /*** <<< FUNC-DECLS [SeqWithNestedSOS] >>> ***/
46
47 extern asn_TYPE_descriptor_t asn_DEF_SeqWithNestedSOS;
48
49 /*** <<< STAT-DEFS [SeqWithNestedSOS] >>> ***/
50
51 static asn_TYPE_member_t asn_MBR_Member_7[] = {
52         { ATF_NOFLAGS, 0, offsetof(struct SeqWithNestedSOS__sos__Member__nested_sos__Member, nested_string),
53                 .tag = (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
54                 .tag_mode = -1, /* IMPLICIT tag at current level */
55                 .type = &asn_DEF_UTF8String,
56                 .type_selector = 0,
57                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
58                 0, 0, /* No default value */
59                 .name = "nested-string"
60                 },
61 };
62 static const ber_tlv_tag_t asn_DEF_Member_tags_7[] = {
63         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
64 };
65 static const asn_TYPE_tag2member_t asn_MAP_Member_tag2el_7[] = {
66     { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 0, 0, 0 } /* nested-string */
67 };
68 static asn_SEQUENCE_specifics_t asn_SPC_Member_specs_7 = {
69         sizeof(struct SeqWithNestedSOS__sos__Member__nested_sos__Member),
70         offsetof(struct SeqWithNestedSOS__sos__Member__nested_sos__Member, _asn_ctx),
71         .tag2el = asn_MAP_Member_tag2el_7,
72         .tag2el_count = 1,      /* Count of tags in the map */
73         0, 0, 0,        /* Optional elements (not needed) */
74         -1,     /* First extension addition */
75 };
76 static /* Use -fall-defs-global to expose */
77 asn_TYPE_descriptor_t asn_DEF_Member_7 = {
78         "SEQUENCE",
79         "SEQUENCE",
80         &asn_OP_SEQUENCE,
81         asn_DEF_Member_tags_7,
82         sizeof(asn_DEF_Member_tags_7)
83                 /sizeof(asn_DEF_Member_tags_7[0]), /* 1 */
84         asn_DEF_Member_tags_7,  /* Same as above */
85         sizeof(asn_DEF_Member_tags_7)
86                 /sizeof(asn_DEF_Member_tags_7[0]), /* 1 */
87         { 0, 0, SEQUENCE_constraint },
88         asn_MBR_Member_7,
89         1,      /* Elements count */
90         &asn_SPC_Member_specs_7 /* Additional specs */
91 };
92
93 static asn_TYPE_member_t asn_MBR_nested_sos_6[] = {
94         { ATF_POINTER, 0, 0,
95                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
96                 .tag_mode = 0,
97                 .type = &asn_DEF_Member_7,
98                 .type_selector = 0,
99                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
100                 0, 0, /* No default value */
101                 .name = ""
102                 },
103 };
104 static const ber_tlv_tag_t asn_DEF_nested_sos_tags_6[] = {
105         (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
106         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
107 };
108 static asn_SET_OF_specifics_t asn_SPC_nested_sos_specs_6 = {
109         sizeof(struct SeqWithNestedSOS__sos__Member__nested_sos),
110         offsetof(struct SeqWithNestedSOS__sos__Member__nested_sos, _asn_ctx),
111         0,      /* XER encoding is XMLDelimitedItemList */
112 };
113 static /* Use -fall-defs-global to expose */
114 asn_TYPE_descriptor_t asn_DEF_nested_sos_6 = {
115         "nested-sos",
116         "nested-sos",
117         &asn_OP_SEQUENCE_OF,
118         asn_DEF_nested_sos_tags_6,
119         sizeof(asn_DEF_nested_sos_tags_6)
120                 /sizeof(asn_DEF_nested_sos_tags_6[0]) - 1, /* 1 */
121         asn_DEF_nested_sos_tags_6,      /* Same as above */
122         sizeof(asn_DEF_nested_sos_tags_6)
123                 /sizeof(asn_DEF_nested_sos_tags_6[0]), /* 2 */
124         { 0, 0, SEQUENCE_OF_constraint },
125         asn_MBR_nested_sos_6,
126         1,      /* Single element */
127         &asn_SPC_nested_sos_specs_6     /* Additional specs */
128 };
129
130 static asn_TYPE_member_t asn_MBR_Member_4[] = {
131         { ATF_NOFLAGS, 0, offsetof(struct SeqWithNestedSOS__sos__Member, anotherString),
132                 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
133                 .tag_mode = -1, /* IMPLICIT tag at current level */
134                 .type = &asn_DEF_UTF8String,
135                 .type_selector = 0,
136                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
137                 0, 0, /* No default value */
138                 .name = "anotherString"
139                 },
140         { ATF_NOFLAGS, 0, offsetof(struct SeqWithNestedSOS__sos__Member, nested_sos),
141                 .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
142                 .tag_mode = 0,
143                 .type = &asn_DEF_nested_sos_6,
144                 .type_selector = 0,
145                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
146                 0, 0, /* No default value */
147                 .name = "nested-sos"
148                 },
149 };
150 static const ber_tlv_tag_t asn_DEF_Member_tags_4[] = {
151         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
152 };
153 static const asn_TYPE_tag2member_t asn_MAP_Member_tag2el_4[] = {
154     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 }, /* anotherString */
155     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 1, 0, 0 } /* nested-sos */
156 };
157 static asn_SEQUENCE_specifics_t asn_SPC_Member_specs_4 = {
158         sizeof(struct SeqWithNestedSOS__sos__Member),
159         offsetof(struct SeqWithNestedSOS__sos__Member, _asn_ctx),
160         .tag2el = asn_MAP_Member_tag2el_4,
161         .tag2el_count = 2,      /* Count of tags in the map */
162         0, 0, 0,        /* Optional elements (not needed) */
163         -1,     /* First extension addition */
164 };
165 static /* Use -fall-defs-global to expose */
166 asn_TYPE_descriptor_t asn_DEF_Member_4 = {
167         "SEQUENCE",
168         "SEQUENCE",
169         &asn_OP_SEQUENCE,
170         asn_DEF_Member_tags_4,
171         sizeof(asn_DEF_Member_tags_4)
172                 /sizeof(asn_DEF_Member_tags_4[0]), /* 1 */
173         asn_DEF_Member_tags_4,  /* Same as above */
174         sizeof(asn_DEF_Member_tags_4)
175                 /sizeof(asn_DEF_Member_tags_4[0]), /* 1 */
176         { 0, 0, SEQUENCE_constraint },
177         asn_MBR_Member_4,
178         2,      /* Elements count */
179         &asn_SPC_Member_specs_4 /* Additional specs */
180 };
181
182 static asn_TYPE_member_t asn_MBR_sos_3[] = {
183         { ATF_POINTER, 0, 0,
184                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
185                 .tag_mode = 0,
186                 .type = &asn_DEF_Member_4,
187                 .type_selector = 0,
188                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
189                 0, 0, /* No default value */
190                 .name = ""
191                 },
192 };
193 static const ber_tlv_tag_t asn_DEF_sos_tags_3[] = {
194         (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
195         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
196 };
197 static asn_SET_OF_specifics_t asn_SPC_sos_specs_3 = {
198         sizeof(struct SeqWithNestedSOS__sos),
199         offsetof(struct SeqWithNestedSOS__sos, _asn_ctx),
200         0,      /* XER encoding is XMLDelimitedItemList */
201 };
202 static /* Use -fall-defs-global to expose */
203 asn_TYPE_descriptor_t asn_DEF_sos_3 = {
204         "sos",
205         "sos",
206         &asn_OP_SEQUENCE_OF,
207         asn_DEF_sos_tags_3,
208         sizeof(asn_DEF_sos_tags_3)
209                 /sizeof(asn_DEF_sos_tags_3[0]) - 1, /* 1 */
210         asn_DEF_sos_tags_3,     /* Same as above */
211         sizeof(asn_DEF_sos_tags_3)
212                 /sizeof(asn_DEF_sos_tags_3[0]), /* 2 */
213         { 0, 0, SEQUENCE_OF_constraint },
214         asn_MBR_sos_3,
215         1,      /* Single element */
216         &asn_SPC_sos_specs_3    /* Additional specs */
217 };
218
219 static asn_TYPE_member_t asn_MBR_SeqWithNestedSOS_1[] = {
220         { ATF_NOFLAGS, 0, offsetof(struct SeqWithNestedSOS, someString),
221                 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
222                 .tag_mode = -1, /* IMPLICIT tag at current level */
223                 .type = &asn_DEF_UTF8String,
224                 .type_selector = 0,
225                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
226                 0, 0, /* No default value */
227                 .name = "someString"
228                 },
229         { ATF_NOFLAGS, 0, offsetof(struct SeqWithNestedSOS, sos),
230                 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
231                 .tag_mode = 0,
232                 .type = &asn_DEF_sos_3,
233                 .type_selector = 0,
234                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
235                 0, 0, /* No default value */
236                 .name = "sos"
237                 },
238 };
239 static const ber_tlv_tag_t asn_DEF_SeqWithNestedSOS_tags_1[] = {
240         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
241 };
242 static const asn_TYPE_tag2member_t asn_MAP_SeqWithNestedSOS_tag2el_1[] = {
243     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* someString */
244     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* sos */
245 };
246 static asn_SEQUENCE_specifics_t asn_SPC_SeqWithNestedSOS_specs_1 = {
247         sizeof(struct SeqWithNestedSOS),
248         offsetof(struct SeqWithNestedSOS, _asn_ctx),
249         .tag2el = asn_MAP_SeqWithNestedSOS_tag2el_1,
250         .tag2el_count = 2,      /* Count of tags in the map */
251         0, 0, 0,        /* Optional elements (not needed) */
252         -1,     /* First extension addition */
253 };
254 asn_TYPE_descriptor_t asn_DEF_SeqWithNestedSOS = {
255         "SeqWithNestedSOS",
256         "SeqWithNestedSOS",
257         &asn_OP_SEQUENCE,
258         asn_DEF_SeqWithNestedSOS_tags_1,
259         sizeof(asn_DEF_SeqWithNestedSOS_tags_1)
260                 /sizeof(asn_DEF_SeqWithNestedSOS_tags_1[0]), /* 1 */
261         asn_DEF_SeqWithNestedSOS_tags_1,        /* Same as above */
262         sizeof(asn_DEF_SeqWithNestedSOS_tags_1)
263                 /sizeof(asn_DEF_SeqWithNestedSOS_tags_1[0]), /* 1 */
264         { 0, 0, SEQUENCE_constraint },
265         asn_MBR_SeqWithNestedSOS_1,
266         2,      /* Elements count */
267         &asn_SPC_SeqWithNestedSOS_specs_1       /* Additional specs */
268 };
269