0535c89aafda1066108b991b4f9bd522a57955a1
[com/asn1c.git] / tests / tests-asn1c-compiler / 105-param-2-OK.asn1.-Pfwide-types
1
2 /*** <<< INCLUDES [SIGNED] >>> ***/
3
4 #include <REAL.h>
5 #include <constr_SEQUENCE.h>
6 #include <INTEGER.h>
7 #include <constr_SET.h>
8
9 /*** <<< DEPS [SIGNED] >>> ***/
10
11
12 /*
13  * Method of determining the components presence
14  */
15 typedef enum signed_PR {
16         signed_PR_a,    /* Member a is present */
17 } signed_PR;
18
19 /*** <<< TYPE-DECLS [SIGNED] >>> ***/
20
21 typedef struct SIGNED_16P0 {
22         REAL_t   Signed;
23         
24         /* Context for parsing across buffer boundaries */
25         asn_struct_ctx_t _asn_ctx;
26 } SIGNED_16P0_t;
27 typedef struct SIGNED_16P1 {
28         struct Signed {
29                 INTEGER_t        a;
30                 
31                 /* Presence bitmask: ASN_SET_ISPRESENT(psigned, signed_PR_x) */
32                 unsigned int _presence_map
33                         [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
34                 
35                 /* Context for parsing across buffer boundaries */
36                 asn_struct_ctx_t _asn_ctx;
37         } Signed;
38         
39         /* Context for parsing across buffer boundaries */
40         asn_struct_ctx_t _asn_ctx;
41 } SIGNED_16P1_t;
42
43 /*** <<< FUNC-DECLS [SIGNED] >>> ***/
44
45 extern asn_TYPE_descriptor_t asn_DEF_SIGNED_16P0;
46 extern asn_SEQUENCE_specifics_t asn_SPC_SIGNED_16P0_specs_1;
47 extern asn_TYPE_member_t asn_MBR_SIGNED_16P0_1[1];
48 extern asn_TYPE_descriptor_t asn_DEF_SIGNED_16P1;
49 extern asn_SEQUENCE_specifics_t asn_SPC_SIGNED_16P1_specs_3;
50 extern asn_TYPE_member_t asn_MBR_SIGNED_16P1_3[1];
51
52 /*** <<< STAT-DEFS [SIGNED] >>> ***/
53
54 asn_TYPE_member_t asn_MBR_SIGNED_16P0_1[] = {
55         { ATF_NOFLAGS, 0, offsetof(struct SIGNED_16P0, Signed),
56                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)),
57                 .tag_mode = 0,
58                 .type = &asn_DEF_REAL,
59                 .type_selector = 0,
60                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
61                 0, 0, /* No default value */
62                 .name = "signed"
63                 },
64 };
65 static const ber_tlv_tag_t asn_DEF_SIGNED_16P0_tags_1[] = {
66         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
67 };
68 static const asn_TYPE_tag2member_t asn_MAP_SIGNED_16P0_tag2el_1[] = {
69     { (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)), 0, 0, 0 } /* signed */
70 };
71 asn_SEQUENCE_specifics_t asn_SPC_SIGNED_16P0_specs_1 = {
72         sizeof(struct SIGNED_16P0),
73         offsetof(struct SIGNED_16P0, _asn_ctx),
74         .tag2el = asn_MAP_SIGNED_16P0_tag2el_1,
75         .tag2el_count = 1,      /* Count of tags in the map */
76         0, 0, 0,        /* Optional elements (not needed) */
77         -1,     /* First extension addition */
78 };
79 asn_TYPE_descriptor_t asn_DEF_SIGNED_16P0 = {
80         "SIGNED",
81         "SIGNED",
82         &asn_OP_SEQUENCE,
83         asn_DEF_SIGNED_16P0_tags_1,
84         sizeof(asn_DEF_SIGNED_16P0_tags_1)
85                 /sizeof(asn_DEF_SIGNED_16P0_tags_1[0]), /* 1 */
86         asn_DEF_SIGNED_16P0_tags_1,     /* Same as above */
87         sizeof(asn_DEF_SIGNED_16P0_tags_1)
88                 /sizeof(asn_DEF_SIGNED_16P0_tags_1[0]), /* 1 */
89         { 0, 0, SEQUENCE_constraint },
90         asn_MBR_SIGNED_16P0_1,
91         1,      /* Elements count */
92         &asn_SPC_SIGNED_16P0_specs_1    /* Additional specs */
93 };
94
95 static asn_TYPE_member_t asn_MBR_signed_4[] = {
96         { ATF_NOFLAGS, 0, offsetof(struct Signed, a),
97                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
98                 .tag_mode = 0,
99                 .type = &asn_DEF_INTEGER,
100                 .type_selector = 0,
101                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
102                 0, 0, /* No default value */
103                 .name = "a"
104                 },
105 };
106 static const ber_tlv_tag_t asn_DEF_signed_tags_4[] = {
107         (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
108 };
109 static const asn_TYPE_tag2member_t asn_MAP_signed_tag2el_4[] = {
110     { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* a */
111 };
112 static const uint8_t asn_MAP_signed_mmap_4[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = {
113         (1 << 7)
114 };
115 static 
116 asn_SET_specifics_t asn_SPC_signed_specs_4 = {
117         sizeof(struct Signed),
118         offsetof(struct Signed, _asn_ctx),
119         offsetof(struct Signed, _presence_map),
120         .tag2el = asn_MAP_signed_tag2el_4,
121         .tag2el_count = 1,      /* Count of tags in the map */
122         asn_MAP_signed_tag2el_4,        /* Same as above */
123         1,      /* Count of tags in the CXER map */
124         0,      /* Whether extensible */
125         (const unsigned int *)asn_MAP_signed_mmap_4     /* Mandatory elements map */
126 };
127 static /* Use -fall-defs-global to expose */
128 asn_TYPE_descriptor_t asn_DEF_signed_4 = {
129         "signed",
130         "signed",
131         &asn_OP_SET,
132         asn_DEF_signed_tags_4,
133         sizeof(asn_DEF_signed_tags_4)
134                 /sizeof(asn_DEF_signed_tags_4[0]), /* 1 */
135         asn_DEF_signed_tags_4,  /* Same as above */
136         sizeof(asn_DEF_signed_tags_4)
137                 /sizeof(asn_DEF_signed_tags_4[0]), /* 1 */
138         { 0, 0, SET_constraint },
139         asn_MBR_signed_4,
140         1,      /* Elements count */
141         &asn_SPC_signed_specs_4 /* Additional specs */
142 };
143
144 asn_TYPE_member_t asn_MBR_SIGNED_16P1_3[] = {
145         { ATF_NOFLAGS, 0, offsetof(struct SIGNED_16P1, Signed),
146                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
147                 .tag_mode = 0,
148                 .type = &asn_DEF_signed_4,
149                 .type_selector = 0,
150                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
151                 0, 0, /* No default value */
152                 .name = "signed"
153                 },
154 };
155 static const ber_tlv_tag_t asn_DEF_SIGNED_16P1_tags_3[] = {
156         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
157 };
158 static const asn_TYPE_tag2member_t asn_MAP_SIGNED_16P1_tag2el_3[] = {
159     { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 0 } /* signed */
160 };
161 asn_SEQUENCE_specifics_t asn_SPC_SIGNED_16P1_specs_3 = {
162         sizeof(struct SIGNED_16P1),
163         offsetof(struct SIGNED_16P1, _asn_ctx),
164         .tag2el = asn_MAP_SIGNED_16P1_tag2el_3,
165         .tag2el_count = 1,      /* Count of tags in the map */
166         0, 0, 0,        /* Optional elements (not needed) */
167         -1,     /* First extension addition */
168 };
169 asn_TYPE_descriptor_t asn_DEF_SIGNED_16P1 = {
170         "SIGNED",
171         "SIGNED",
172         &asn_OP_SEQUENCE,
173         asn_DEF_SIGNED_16P1_tags_3,
174         sizeof(asn_DEF_SIGNED_16P1_tags_3)
175                 /sizeof(asn_DEF_SIGNED_16P1_tags_3[0]), /* 1 */
176         asn_DEF_SIGNED_16P1_tags_3,     /* Same as above */
177         sizeof(asn_DEF_SIGNED_16P1_tags_3)
178                 /sizeof(asn_DEF_SIGNED_16P1_tags_3[0]), /* 1 */
179         { 0, 0, SEQUENCE_constraint },
180         asn_MBR_SIGNED_16P1_3,
181         1,      /* Elements count */
182         &asn_SPC_SIGNED_16P1_specs_3    /* Additional specs */
183 };
184
185
186 /*** <<< INCLUDES [SignedREAL] >>> ***/
187
188 #include "SIGNED.h"
189
190 /*** <<< TYPE-DECLS [SignedREAL] >>> ***/
191
192 typedef SIGNED_16P0_t    SignedREAL_t;
193
194 /*** <<< FUNC-DECLS [SignedREAL] >>> ***/
195
196 extern asn_TYPE_descriptor_t asn_DEF_SignedREAL;
197 asn_struct_free_f SignedREAL_free;
198 asn_struct_print_f SignedREAL_print;
199 asn_constr_check_f SignedREAL_constraint;
200 ber_type_decoder_f SignedREAL_decode_ber;
201 der_type_encoder_f SignedREAL_encode_der;
202 xer_type_decoder_f SignedREAL_decode_xer;
203 xer_type_encoder_f SignedREAL_encode_xer;
204
205 /*** <<< CODE [SignedREAL] >>> ***/
206
207 /*
208  * This type is implemented using SIGNED_16P0,
209  * so here we adjust the DEF accordingly.
210  */
211
212 /*** <<< STAT-DEFS [SignedREAL] >>> ***/
213
214 static const ber_tlv_tag_t asn_DEF_SignedREAL_tags_1[] = {
215         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
216 };
217 asn_TYPE_descriptor_t asn_DEF_SignedREAL = {
218         "SignedREAL",
219         "SignedREAL",
220         &asn_OP_SEQUENCE,
221         asn_DEF_SignedREAL_tags_1,
222         sizeof(asn_DEF_SignedREAL_tags_1)
223                 /sizeof(asn_DEF_SignedREAL_tags_1[0]), /* 1 */
224         asn_DEF_SignedREAL_tags_1,      /* Same as above */
225         sizeof(asn_DEF_SignedREAL_tags_1)
226                 /sizeof(asn_DEF_SignedREAL_tags_1[0]), /* 1 */
227         { 0, 0, SEQUENCE_constraint },
228         asn_MBR_SIGNED_16P0_1,
229         1,      /* Elements count */
230         &asn_SPC_SIGNED_16P0_specs_1    /* Additional specs */
231 };
232
233
234 /*** <<< INCLUDES [SignedSET] >>> ***/
235
236 #include "SIGNED.h"
237
238 /*** <<< TYPE-DECLS [SignedSET] >>> ***/
239
240 typedef SIGNED_16P1_t    SignedSET_t;
241
242 /*** <<< FUNC-DECLS [SignedSET] >>> ***/
243
244 extern asn_TYPE_descriptor_t asn_DEF_SignedSET;
245 asn_struct_free_f SignedSET_free;
246 asn_struct_print_f SignedSET_print;
247 asn_constr_check_f SignedSET_constraint;
248 ber_type_decoder_f SignedSET_decode_ber;
249 der_type_encoder_f SignedSET_encode_der;
250 xer_type_decoder_f SignedSET_decode_xer;
251 xer_type_encoder_f SignedSET_encode_xer;
252
253 /*** <<< CODE [SignedSET] >>> ***/
254
255 /*
256  * This type is implemented using SIGNED_16P1,
257  * so here we adjust the DEF accordingly.
258  */
259
260 /*** <<< STAT-DEFS [SignedSET] >>> ***/
261
262 static const ber_tlv_tag_t asn_DEF_SignedSET_tags_1[] = {
263         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
264 };
265 asn_TYPE_descriptor_t asn_DEF_SignedSET = {
266         "SignedSET",
267         "SignedSET",
268         &asn_OP_SEQUENCE,
269         asn_DEF_SignedSET_tags_1,
270         sizeof(asn_DEF_SignedSET_tags_1)
271                 /sizeof(asn_DEF_SignedSET_tags_1[0]), /* 1 */
272         asn_DEF_SignedSET_tags_1,       /* Same as above */
273         sizeof(asn_DEF_SignedSET_tags_1)
274                 /sizeof(asn_DEF_SignedSET_tags_1[0]), /* 1 */
275         { 0, 0, SEQUENCE_constraint },
276         asn_MBR_SIGNED_16P1_3,
277         1,      /* Elements count */
278         &asn_SPC_SIGNED_16P1_specs_3    /* Additional specs */
279 };
280