ea18361d3754d5193778719be8badd89d657d6a8
[com/asn1c.git] / tests / tests-asn1c-compiler / 46-redefine-OK.asn1.-PR
1
2 /*** <<< INCLUDES [PrimitiveType] >>> ***/
3
4 #include <OCTET_STRING.h>
5
6 /*** <<< TYPE-DECLS [PrimitiveType] >>> ***/
7
8 typedef OCTET_STRING_t   PrimitiveType_t;
9
10 /*** <<< FUNC-DECLS [PrimitiveType] >>> ***/
11
12 extern asn_TYPE_descriptor_t asn_DEF_PrimitiveType;
13 asn_struct_free_f PrimitiveType_free;
14 asn_struct_print_f PrimitiveType_print;
15 asn_constr_check_f PrimitiveType_constraint;
16 ber_type_decoder_f PrimitiveType_decode_ber;
17 der_type_encoder_f PrimitiveType_encode_der;
18 xer_type_decoder_f PrimitiveType_decode_xer;
19 xer_type_encoder_f PrimitiveType_encode_xer;
20
21 /*** <<< CODE [PrimitiveType] >>> ***/
22
23 /*
24  * This type is implemented using OCTET_STRING,
25  * so here we adjust the DEF accordingly.
26  */
27
28 /*** <<< STAT-DEFS [PrimitiveType] >>> ***/
29
30 static const ber_tlv_tag_t asn_DEF_PrimitiveType_tags_1[] = {
31         (ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
32 };
33 asn_TYPE_descriptor_t asn_DEF_PrimitiveType = {
34         "PrimitiveType",
35         "PrimitiveType",
36         &asn_OP_OCTET_STRING,
37         asn_DEF_PrimitiveType_tags_1,
38         sizeof(asn_DEF_PrimitiveType_tags_1)
39                 /sizeof(asn_DEF_PrimitiveType_tags_1[0]), /* 1 */
40         asn_DEF_PrimitiveType_tags_1,   /* Same as above */
41         sizeof(asn_DEF_PrimitiveType_tags_1)
42                 /sizeof(asn_DEF_PrimitiveType_tags_1[0]), /* 1 */
43         { 0, 0, OCTET_STRING_constraint },
44         0, 0,   /* No members */
45         &asn_SPC_OCTET_STRING_specs     /* Additional specs */
46 };
47
48
49 /*** <<< INCLUDES [ConstructedType] >>> ***/
50
51 #include "PrimitiveType.h"
52 #include <constr_SEQUENCE.h>
53
54 /*** <<< TYPE-DECLS [ConstructedType] >>> ***/
55
56 typedef struct ConstructedType {
57         PrimitiveType_t  field;
58         
59         /* Context for parsing across buffer boundaries */
60         asn_struct_ctx_t _asn_ctx;
61 } ConstructedType_t;
62
63 /*** <<< FUNC-DECLS [ConstructedType] >>> ***/
64
65 extern asn_TYPE_descriptor_t asn_DEF_ConstructedType;
66 extern asn_SEQUENCE_specifics_t asn_SPC_ConstructedType_specs_1;
67 extern asn_TYPE_member_t asn_MBR_ConstructedType_1[1];
68
69 /*** <<< STAT-DEFS [ConstructedType] >>> ***/
70
71 asn_TYPE_member_t asn_MBR_ConstructedType_1[] = {
72         { ATF_NOFLAGS, 0, offsetof(struct ConstructedType, field),
73                 .tag = (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
74                 .tag_mode = -1, /* IMPLICIT tag at current level */
75                 .type = &asn_DEF_PrimitiveType,
76                 .type_selector = 0,
77                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
78                 0, 0, /* No default value */
79                 .name = "field"
80                 },
81 };
82 static const ber_tlv_tag_t asn_DEF_ConstructedType_tags_1[] = {
83         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
84 };
85 static const asn_TYPE_tag2member_t asn_MAP_ConstructedType_tag2el_1[] = {
86     { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 0, 0, 0 } /* field */
87 };
88 asn_SEQUENCE_specifics_t asn_SPC_ConstructedType_specs_1 = {
89         sizeof(struct ConstructedType),
90         offsetof(struct ConstructedType, _asn_ctx),
91         .tag2el = asn_MAP_ConstructedType_tag2el_1,
92         .tag2el_count = 1,      /* Count of tags in the map */
93         0, 0, 0,        /* Optional elements (not needed) */
94         -1,     /* First extension addition */
95 };
96 asn_TYPE_descriptor_t asn_DEF_ConstructedType = {
97         "ConstructedType",
98         "ConstructedType",
99         &asn_OP_SEQUENCE,
100         asn_DEF_ConstructedType_tags_1,
101         sizeof(asn_DEF_ConstructedType_tags_1)
102                 /sizeof(asn_DEF_ConstructedType_tags_1[0]), /* 1 */
103         asn_DEF_ConstructedType_tags_1, /* Same as above */
104         sizeof(asn_DEF_ConstructedType_tags_1)
105                 /sizeof(asn_DEF_ConstructedType_tags_1[0]), /* 1 */
106         { 0, 0, SEQUENCE_constraint },
107         asn_MBR_ConstructedType_1,
108         1,      /* Elements count */
109         &asn_SPC_ConstructedType_specs_1        /* Additional specs */
110 };
111
112
113 /*** <<< INCLUDES [T] >>> ***/
114
115 #include "ConstructedType.h"
116
117 /*** <<< TYPE-DECLS [T] >>> ***/
118
119 typedef ConstructedType_t        T_t;
120
121 /*** <<< FUNC-DECLS [T] >>> ***/
122
123 extern asn_TYPE_descriptor_t asn_DEF_T;
124 asn_struct_free_f T_free;
125 asn_struct_print_f T_print;
126 asn_constr_check_f T_constraint;
127 ber_type_decoder_f T_decode_ber;
128 der_type_encoder_f T_encode_der;
129 xer_type_decoder_f T_decode_xer;
130 xer_type_encoder_f T_encode_xer;
131
132 /*** <<< CODE [T] >>> ***/
133
134 /*
135  * This type is implemented using ConstructedType,
136  * so here we adjust the DEF accordingly.
137  */
138
139 /*** <<< STAT-DEFS [T] >>> ***/
140
141 static const ber_tlv_tag_t asn_DEF_T_tags_1[] = {
142         (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
143         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
144 };
145 asn_TYPE_descriptor_t asn_DEF_T = {
146         "T",
147         "T",
148         &asn_OP_SEQUENCE,
149         asn_DEF_T_tags_1,
150         sizeof(asn_DEF_T_tags_1)
151                 /sizeof(asn_DEF_T_tags_1[0]) - 1, /* 1 */
152         asn_DEF_T_tags_1,       /* Same as above */
153         sizeof(asn_DEF_T_tags_1)
154                 /sizeof(asn_DEF_T_tags_1[0]), /* 2 */
155         { 0, 0, SEQUENCE_constraint },
156         asn_MBR_ConstructedType_1,
157         1,      /* Elements count */
158         &asn_SPC_ConstructedType_specs_1        /* Additional specs */
159 };
160