aboutsummaryrefslogtreecommitdiffstats
path: root/tests/44-choice-in-sequence-OK.asn1.-P
diff options
context:
space:
mode:
authorvlm <vlm@59561ff5-6e30-0410-9f3c-9617f08c8826>2004-08-20 13:36:32 +0000
committervlm <vlm@59561ff5-6e30-0410-9f3c-9617f08c8826>2004-08-20 13:36:32 +0000
commit21e4600d0f9943be9969e089de5f637cc5ddfca9 (patch)
tree50c4db6d5966e9d373a1cba550ebba9eb1112700 /tests/44-choice-in-sequence-OK.asn1.-P
parentd8d90352700518952d5b535785d7093d07e46a4b (diff)
new meaning of life
git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@169 59561ff5-6e30-0410-9f3c-9617f08c8826
Diffstat (limited to 'tests/44-choice-in-sequence-OK.asn1.-P')
-rw-r--r--tests/44-choice-in-sequence-OK.asn1.-P364
1 files changed, 187 insertions, 177 deletions
diff --git a/tests/44-choice-in-sequence-OK.asn1.-P b/tests/44-choice-in-sequence-OK.asn1.-P
index 0c65871f..3a12ecfc 100644
--- a/tests/44-choice-in-sequence-OK.asn1.-P
+++ b/tests/44-choice-in-sequence-OK.asn1.-P
@@ -7,23 +7,23 @@
/*** <<< DEPS [T] >>> ***/
- typedef enum b_PR {
- b_PR_NOTHING, /* No components present */
- b_PR_c,
- b_PR_d,
- b_PR_e,
- b_PR_h,
- } b_PR;
- typedef enum e_PR {
- e_PR_NOTHING, /* No components present */
- e_PR_f,
- e_PR_g,
- } e_PR;
- typedef enum h_PR {
- h_PR_NOTHING, /* No components present */
- h_PR_i,
- h_PR_j,
- } h_PR;
+typedef enum b_PR {
+ b_PR_NOTHING, /* No components present */
+ b_PR_c,
+ b_PR_d,
+ b_PR_e,
+ b_PR_h,
+} b_PR;
+typedef enum e_PR {
+ e_PR_NOTHING, /* No components present */
+ e_PR_f,
+ e_PR_g,
+} e_PR;
+typedef enum h_PR {
+ h_PR_NOTHING, /* No components present */
+ h_PR_i,
+ h_PR_j,
+} h_PR;
extern asn1_TYPE_descriptor_t asn1_DEF_T;
/*** <<< TYPE-DECLS [T] >>> ***/
@@ -68,165 +68,175 @@ typedef struct T {
/*** <<< STAT-DEFS [T] >>> ***/
- static asn1_CHOICE_element_t asn1_DEF_e_elements[] = {
- { offsetof(struct e, choice.f), 0,
- (ASN_TAG_CLASS_PRIVATE | (7 << 2)),
- -1, /* IMPLICIT tag at current level */
- (void *)&asn1_DEF_NULL,
- "f"
- },
- { offsetof(struct e, choice.g), 0,
- (ASN_TAG_CLASS_PRIVATE | (8 << 2)),
- -1, /* IMPLICIT tag at current level */
- (void *)&asn1_DEF_NULL,
- "g"
- },
- };
- static asn1_TYPE_tag2member_t asn1_DEF_e_tag2el[] = {
- { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 0, 0, 0 }, /* f at 20 */
- { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 1, 0, 0 }, /* g at 21 */
- };
- static asn1_CHOICE_specifics_t asn1_DEF_e_specs = {
- sizeof(struct e),
- offsetof(struct e, _ber_dec_ctx),
- offsetof(struct e, present),
- sizeof(((struct e *)0)->present),
- asn1_DEF_e_elements,
- 2, /* Elements count */
- asn1_DEF_e_tag2el,
- 2, /* Count of tags in the map */
- 0 /* Whether extensible */
- };
- asn1_TYPE_descriptor_t asn1_DEF_e = {
- "e",
- CHOICE_constraint,
- CHOICE_decode_ber,
- CHOICE_encode_der,
- CHOICE_print,
- CHOICE_free,
- CHOICE_outmost_tag,
- 0, /* No explicit tags (pointer) */
- 0, /* No explicit tags (count) */
- 0, /* Tags to skip */
- 1, /* Whether CONSTRUCTED */
- &asn1_DEF_e_specs /* Additional specs */
- };
-
- static asn1_CHOICE_element_t asn1_DEF_h_elements[] = {
- { offsetof(struct h, choice.i), 0,
- (ASN_TAG_CLASS_PRIVATE | (1 << 2)),
- -1, /* IMPLICIT tag at current level */
- (void *)&asn1_DEF_NULL,
- "i"
- },
- { offsetof(struct h, choice.j), 0,
- (ASN_TAG_CLASS_PRIVATE | (2 << 2)),
- -1, /* IMPLICIT tag at current level */
- (void *)&asn1_DEF_NULL,
- "j"
- },
- };
- static asn1_TYPE_tag2member_t asn1_DEF_h_tag2el[] = {
- { (ASN_TAG_CLASS_PRIVATE | (1 << 2)), 0, 0, 0 }, /* i at 24 */
- { (ASN_TAG_CLASS_PRIVATE | (2 << 2)), 1, 0, 0 }, /* j at 25 */
- };
- static asn1_CHOICE_specifics_t asn1_DEF_h_specs = {
- sizeof(struct h),
- offsetof(struct h, _ber_dec_ctx),
- offsetof(struct h, present),
- sizeof(((struct h *)0)->present),
- asn1_DEF_h_elements,
- 2, /* Elements count */
- asn1_DEF_h_tag2el,
- 2, /* Count of tags in the map */
- 0 /* Whether extensible */
- };
- asn1_TYPE_descriptor_t asn1_DEF_h = {
- "h",
- CHOICE_constraint,
- CHOICE_decode_ber,
- CHOICE_encode_der,
- CHOICE_print,
- CHOICE_free,
- CHOICE_outmost_tag,
- 0, /* No explicit tags (pointer) */
- 0, /* No explicit tags (count) */
- 0, /* Tags to skip */
- 1, /* Whether CONSTRUCTED */
- &asn1_DEF_h_specs /* Additional specs */
- };
-
- static asn1_CHOICE_element_t asn1_DEF_b_elements[] = {
- { offsetof(struct b, choice.c), 0,
- (ASN_TAG_CLASS_PRIVATE | (5 << 2)),
- -1, /* IMPLICIT tag at current level */
- (void *)&asn1_DEF_NULL,
- "c"
- },
- { offsetof(struct b, choice.d), 0,
- (ASN_TAG_CLASS_PRIVATE | (6 << 2)),
- -1, /* IMPLICIT tag at current level */
- (void *)&asn1_DEF_NULL,
- "d"
- },
- { offsetof(struct b, choice.e), 0,
- -1 /* Ambiguous tag (CHOICE?) */,
- 0,
- (void *)&asn1_DEF_e,
- "e"
- },
- { offsetof(struct b, choice.h), 0,
- (ASN_TAG_CLASS_PRIVATE | (9 << 2)),
- +1, /* EXPLICIT tag at current level */
- (void *)&asn1_DEF_h,
- "h"
- },
- };
- static asn1_TYPE_tag2member_t asn1_DEF_b_tag2el[] = {
- { (ASN_TAG_CLASS_PRIVATE | (5 << 2)), 0, 0, 0 }, /* c at 17 */
- { (ASN_TAG_CLASS_PRIVATE | (6 << 2)), 1, 0, 0 }, /* d at 18 */
- { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 2, 0, 0 }, /* f at 20 */
- { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 2, 0, 0 }, /* g at 21 */
- { (ASN_TAG_CLASS_PRIVATE | (9 << 2)), 3, 0, 0 }, /* h at 24 */
- };
- static asn1_CHOICE_specifics_t asn1_DEF_b_specs = {
- sizeof(struct b),
- offsetof(struct b, _ber_dec_ctx),
- offsetof(struct b, present),
- sizeof(((struct b *)0)->present),
- asn1_DEF_b_elements,
- 4, /* Elements count */
- asn1_DEF_b_tag2el,
- 5, /* Count of tags in the map */
- 0 /* Whether extensible */
- };
- asn1_TYPE_descriptor_t asn1_DEF_b = {
- "b",
- CHOICE_constraint,
- CHOICE_decode_ber,
- CHOICE_encode_der,
- CHOICE_print,
- CHOICE_free,
- CHOICE_outmost_tag,
- 0, /* No explicit tags (pointer) */
- 0, /* No explicit tags (count) */
- 0, /* Tags to skip */
- 1, /* Whether CONSTRUCTED */
- &asn1_DEF_b_specs /* Additional specs */
- };
-
-static asn1_SEQUENCE_element_t asn1_DEF_T_elements[] = {
- { offsetof(struct T, a), 0,
- (ASN_TAG_CLASS_PRIVATE | (2 << 2)),
- -1, /* IMPLICIT tag at current level */
- (void *)&asn1_DEF_NULL,
- "a"
+static asn1_TYPE_member_t asn1_MBR_e[] = {
+ { 0, offsetof(struct e, choice.f),
+ .tag = (ASN_TAG_CLASS_PRIVATE | (7 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = (void *)&asn1_DEF_NULL,
+ .memb_constraints = 0, /* Defer to actual type */
+ .name = "f"
},
- { offsetof(struct T, b), 0,
- -1 /* Ambiguous tag (CHOICE?) */,
- 0,
- (void *)&asn1_DEF_b,
- "b"
+ { 0, offsetof(struct e, choice.g),
+ .tag = (ASN_TAG_CLASS_PRIVATE | (8 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = (void *)&asn1_DEF_NULL,
+ .memb_constraints = 0, /* Defer to actual type */
+ .name = "g"
+ },
+};
+static asn1_TYPE_tag2member_t asn1_DEF_e_tag2el[] = {
+ { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 0, 0, 0 }, /* f at 20 */
+ { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 1, 0, 0 }, /* g at 21 */
+};
+static asn1_CHOICE_specifics_t asn1_DEF_e_specs = {
+ sizeof(struct e),
+ offsetof(struct e, _ber_dec_ctx),
+ offsetof(struct e, present),
+ sizeof(((struct e *)0)->present),
+ asn1_DEF_e_tag2el,
+ 2, /* Count of tags in the map */
+ 0 /* Whether extensible */
+};
+asn1_TYPE_descriptor_t asn1_DEF_e = {
+ "e",
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_print,
+ CHOICE_free,
+ CHOICE_outmost_tag,
+ 0, /* No explicit tags (pointer) */
+ 0, /* No explicit tags (count) */
+ 0, /* Tags to skip */
+ 1, /* Whether CONSTRUCTED */
+ asn1_MBR_e,
+ 2, /* Elements count */
+ &asn1_DEF_e_specs /* Additional specs */
+};
+
+static asn1_TYPE_member_t asn1_MBR_h[] = {
+ { 0, offsetof(struct h, choice.i),
+ .tag = (ASN_TAG_CLASS_PRIVATE | (1 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = (void *)&asn1_DEF_NULL,
+ .memb_constraints = 0, /* Defer to actual type */
+ .name = "i"
+ },
+ { 0, offsetof(struct h, choice.j),
+ .tag = (ASN_TAG_CLASS_PRIVATE | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = (void *)&asn1_DEF_NULL,
+ .memb_constraints = 0, /* Defer to actual type */
+ .name = "j"
+ },
+};
+static asn1_TYPE_tag2member_t asn1_DEF_h_tag2el[] = {
+ { (ASN_TAG_CLASS_PRIVATE | (1 << 2)), 0, 0, 0 }, /* i at 24 */
+ { (ASN_TAG_CLASS_PRIVATE | (2 << 2)), 1, 0, 0 }, /* j at 25 */
+};
+static asn1_CHOICE_specifics_t asn1_DEF_h_specs = {
+ sizeof(struct h),
+ offsetof(struct h, _ber_dec_ctx),
+ offsetof(struct h, present),
+ sizeof(((struct h *)0)->present),
+ asn1_DEF_h_tag2el,
+ 2, /* Count of tags in the map */
+ 0 /* Whether extensible */
+};
+asn1_TYPE_descriptor_t asn1_DEF_h = {
+ "h",
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_print,
+ CHOICE_free,
+ CHOICE_outmost_tag,
+ 0, /* No explicit tags (pointer) */
+ 0, /* No explicit tags (count) */
+ 0, /* Tags to skip */
+ 1, /* Whether CONSTRUCTED */
+ asn1_MBR_h,
+ 2, /* Elements count */
+ &asn1_DEF_h_specs /* Additional specs */
+};
+
+static asn1_TYPE_member_t asn1_MBR_b[] = {
+ { 0, offsetof(struct b, choice.c),
+ .tag = (ASN_TAG_CLASS_PRIVATE | (5 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = (void *)&asn1_DEF_NULL,
+ .memb_constraints = 0, /* Defer to actual type */
+ .name = "c"
+ },
+ { 0, offsetof(struct b, choice.d),
+ .tag = (ASN_TAG_CLASS_PRIVATE | (6 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = (void *)&asn1_DEF_NULL,
+ .memb_constraints = 0, /* Defer to actual type */
+ .name = "d"
+ },
+ { 0, offsetof(struct b, choice.e),
+ .tag = -1 /* Ambiguous tag (CHOICE?) */,
+ .tag_mode = 0,
+ .type = (void *)&asn1_DEF_e,
+ .memb_constraints = 0, /* Defer to actual type */
+ .name = "e"
+ },
+ { 0, offsetof(struct b, choice.h),
+ .tag = (ASN_TAG_CLASS_PRIVATE | (9 << 2)),
+ .tag_mode = +1, /* EXPLICIT tag at current level */
+ .type = (void *)&asn1_DEF_h,
+ .memb_constraints = 0, /* Defer to actual type */
+ .name = "h"
+ },
+};
+static asn1_TYPE_tag2member_t asn1_DEF_b_tag2el[] = {
+ { (ASN_TAG_CLASS_PRIVATE | (5 << 2)), 0, 0, 0 }, /* c at 17 */
+ { (ASN_TAG_CLASS_PRIVATE | (6 << 2)), 1, 0, 0 }, /* d at 18 */
+ { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 2, 0, 0 }, /* f at 20 */
+ { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 2, 0, 0 }, /* g at 21 */
+ { (ASN_TAG_CLASS_PRIVATE | (9 << 2)), 3, 0, 0 }, /* h at 24 */
+};
+static asn1_CHOICE_specifics_t asn1_DEF_b_specs = {
+ sizeof(struct b),
+ offsetof(struct b, _ber_dec_ctx),
+ offsetof(struct b, present),
+ sizeof(((struct b *)0)->present),
+ asn1_DEF_b_tag2el,
+ 5, /* Count of tags in the map */
+ 0 /* Whether extensible */
+};
+asn1_TYPE_descriptor_t asn1_DEF_b = {
+ "b",
+ CHOICE_constraint,
+ CHOICE_decode_ber,
+ CHOICE_encode_der,
+ CHOICE_print,
+ CHOICE_free,
+ CHOICE_outmost_tag,
+ 0, /* No explicit tags (pointer) */
+ 0, /* No explicit tags (count) */
+ 0, /* Tags to skip */
+ 1, /* Whether CONSTRUCTED */
+ asn1_MBR_b,
+ 4, /* Elements count */
+ &asn1_DEF_b_specs /* Additional specs */
+};
+
+static asn1_TYPE_member_t asn1_MBR_T[] = {
+ { 0, offsetof(struct T, a),
+ .tag = (ASN_TAG_CLASS_PRIVATE | (2 << 2)),
+ .tag_mode = -1, /* IMPLICIT tag at current level */
+ .type = (void *)&asn1_DEF_NULL,
+ .memb_constraints = 0, /* Defer to actual type */
+ .name = "a"
+ },
+ { 0, offsetof(struct T, b),
+ .tag = -1 /* Ambiguous tag (CHOICE?) */,
+ .tag_mode = 0,
+ .type = (void *)&asn1_DEF_b,
+ .memb_constraints = 0, /* Defer to actual type */
+ .name = "b"
},
};
static ber_tlv_tag_t asn1_DEF_T_tags[] = {
@@ -243,8 +253,6 @@ static asn1_TYPE_tag2member_t asn1_DEF_T_tag2el[] = {
static asn1_SEQUENCE_specifics_t asn1_DEF_T_specs = {
sizeof(struct T),
offsetof(struct T, _ber_dec_ctx),
- asn1_DEF_T_elements,
- 2, /* Elements count */
asn1_DEF_T_tag2el,
6, /* Count of tags in the map */
-1, /* Start extensions */
@@ -263,6 +271,8 @@ asn1_TYPE_descriptor_t asn1_DEF_T = {
/sizeof(asn1_DEF_T_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
+ asn1_MBR_T,
+ 2, /* Elements count */
&asn1_DEF_T_specs /* Additional specs */
};