diff --git a/ChangeLog b/ChangeLog index c9358e57ea28de64c18f7f127a59361f003fc175..9646d94eed283578980b4bda18da83b7a5f98d21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ (Severity: medim; Security impact: none) * Refactored Information Object Classes parsing. * Refactored Parameterization support. + * [typedef enum foo {}] foo_e; is now e_foo, see #1287989 0.9.20: 2006-Mar-06 diff --git a/libasn1compiler/asn1c_C.c b/libasn1compiler/asn1c_C.c index f887adf3db796aae3c60abb3c638ab7951cab8bf..21497930418b2b3410aa8895b78376222dbdff43 100644 --- a/libasn1compiler/asn1c_C.c +++ b/libasn1compiler/asn1c_C.c @@ -158,9 +158,9 @@ asn1c_lang_C_type_common_INTEGER(arg_t *arg) { return -1; } } - OUT("} "); + OUT("} e_"); out_name_chain(arg, ONC_noflags); - OUT("_e;\n"); + OUT(";\n"); assert(eidx == el_count); } @@ -259,9 +259,9 @@ asn1c_lang_C_type_BIT_STRING(arg_t *arg) { v->value->value.v_integer, (eidx < el_count) ? "," : ""); } - OUT("} "); + OUT("} e_"); out_name_chain(arg, ONC_noflags); - OUT("_e;\n"); + OUT(";\n"); assert(eidx == el_count); } diff --git a/tests/103-reference-SE.asn1 b/tests/103-reference-SE.asn1 index 38cb0aa73e9ef91738ff27f9ef21da628b3a482b..8b01ef8890234d2ca55b3a1a4567cc83190a8474 100644 --- a/tests/103-reference-SE.asn1 +++ b/tests/103-reference-SE.asn1 @@ -3,11 +3,11 @@ -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) -- .spelio.software.asn1c.test (9363.1.5.1) --- .102 +-- .103 ModuleReference { iso org(3) dod(6) internet (1) private(4) enterprise(1) - spelio(9363) software(1) asn1c(5) test(1) 102 } + spelio(9363) software(1) asn1c(5) test(1) 103 } DEFINITIONS ::= BEGIN IMPORTS Type FROM ModuleReference; diff --git a/tests/104-param-1-OK.asn1 b/tests/104-param-1-OK.asn1 index 4ffb603bd0dde11eb99a7f4109be0dd245af199d..9c1527a8b876948aa0257af3c204069c767cbdbf 100644 --- a/tests/104-param-1-OK.asn1 +++ b/tests/104-param-1-OK.asn1 @@ -5,7 +5,7 @@ -- .spelio.software.asn1c.test (9363.1.5.1) -- .104 -ModuleParametrization1 +ModuleParameterization1 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 104 } DEFINITIONS ::= diff --git a/tests/104-param-1-OK.asn1.-EFprint-class-matrix b/tests/104-param-1-OK.asn1.-EFprint-class-matrix index 26a81ef384eb8770985b1b0e290df1b0003dea23..754ba54156eef6744ef92a787c76c3dbdfc7a398 100644 --- a/tests/104-param-1-OK.asn1.-EFprint-class-matrix +++ b/tests/104-param-1-OK.asn1.-EFprint-class-matrix @@ -1,4 +1,4 @@ -ModuleParametrization1 { iso org(3) dod(6) internet(1) private(4) +ModuleParameterization1 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 104 } DEFINITIONS ::= BEGIN diff --git a/tests/105-param-2-OK.asn1 b/tests/105-param-2-OK.asn1 index eeee4c4775bd20b04e4c7376248dbd1f39ddcfab..e3ac5899a1afed90c7e08575d52033aa308840e2 100644 --- a/tests/105-param-2-OK.asn1 +++ b/tests/105-param-2-OK.asn1 @@ -5,7 +5,7 @@ -- .spelio.software.asn1c.test (9363.1.5.1) -- .105 -ModuleParametrization2 +ModuleParameterization2 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 105 } DEFINITIONS ::= diff --git a/tests/106-param-constr-OK.asn1 b/tests/106-param-constr-OK.asn1 index 7dd8c4bf213b53edeec7f3ff5b50cbafea457a86..ea63c3d7d950ff5035c2a439fe08e8e5f85462a0 100644 --- a/tests/106-param-constr-OK.asn1 +++ b/tests/106-param-constr-OK.asn1 @@ -5,7 +5,7 @@ -- .spelio.software.asn1c.test (9363.1.5.1) -- .106 -ModuleParametrizationWithConstraints +ModuleParameterizationWithConstraints { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 106 } DEFINITIONS ::= diff --git a/tests/107-param-constr-2-OK.asn1 b/tests/107-param-constr-2-OK.asn1 index 40aefab9d018d9cbad30ef0716e1c406eb603bc2..23d23ec3ea6c965d204d4dcb44aee6f2757336ab 100644 --- a/tests/107-param-constr-2-OK.asn1 +++ b/tests/107-param-constr-2-OK.asn1 @@ -5,7 +5,7 @@ -- .spelio.software.asn1c.test (9363.1.5.1) -- .107 -ModuleParametrizationWithConstraints2 +ModuleParameterizationWithConstraints2 { iso org(3) dod(6) internet (1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 107 } DEFINITIONS ::= diff --git a/tests/108-param-constr-3-OK.asn1 b/tests/108-param-constr-3-OK.asn1 new file mode 100644 index 0000000000000000000000000000000000000000..2b524860f69dfe1b5e438d30f9fc4cf28dfbd83c --- /dev/null +++ b/tests/108-param-constr-3-OK.asn1 @@ -0,0 +1,18 @@ + +-- OK: Everything is fine + +-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) +-- .spelio.software.asn1c.test (9363.1.5.1) +-- .108 + +ModuleParameterizationWithConstraints3 + { iso org(3) dod(6) internet (1) private(4) enterprise(1) + spelio(9363) software(1) asn1c(5) test(1) 108 } + DEFINITIONS ::= +BEGIN + + MinMax {Type, INTEGER:low-bound} ::= Type (low-bound..MAX) + + ThreePlus ::= MinMax {INTEGER, 3} + +END diff --git a/tests/108-param-constr-3-OK.asn1.-P b/tests/108-param-constr-3-OK.asn1.-P new file mode 100644 index 0000000000000000000000000000000000000000..ee5a50425fdb0f372c2e35a5af7209d68b74ecf9 --- /dev/null +++ b/tests/108-param-constr-3-OK.asn1.-P @@ -0,0 +1,292 @@ + +/*** <<< INCLUDES [MinMax] >>> ***/ + +#include <INTEGER.h> + +/*** <<< TYPE-DECLS [MinMax] >>> ***/ + +typedef INTEGER_t MinMax_16P0_t; + +/*** <<< FUNC-DECLS [MinMax] >>> ***/ + +extern asn_TYPE_descriptor_t asn_DEF_MinMax_16P0; +asn_struct_free_f MinMax_16P0_free; +asn_struct_print_f MinMax_16P0_print; +asn_constr_check_f MinMax_16P0_constraint; +ber_type_decoder_f MinMax_16P0_decode_ber; +der_type_encoder_f MinMax_16P0_encode_der; +xer_type_decoder_f MinMax_16P0_decode_xer; +xer_type_encoder_f MinMax_16P0_encode_xer; + +/*** <<< CODE [MinMax] >>> ***/ + +int +MinMax_16P0_constraint(asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_consume_bytes_f *app_errlog, void *app_key) { + const INTEGER_t *st = (const INTEGER_t *)sptr; + long value; + + if(!sptr) { + _ASN_ERRLOG(app_errlog, app_key, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + if(asn_INTEGER2long(st, &value)) { + _ASN_ERRLOG(app_errlog, app_key, + "%s: value too large (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + if((value >= 3)) { + /* Constraint check succeeded */ + return 0; + } else { + _ASN_ERRLOG(app_errlog, app_key, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using INTEGER, + * so here we adjust the DEF accordingly. + */ +static void +MinMax_16P0_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { + td->free_struct = asn_DEF_INTEGER.free_struct; + td->print_struct = asn_DEF_INTEGER.print_struct; + td->ber_decoder = asn_DEF_INTEGER.ber_decoder; + td->der_encoder = asn_DEF_INTEGER.der_encoder; + td->xer_decoder = asn_DEF_INTEGER.xer_decoder; + td->xer_encoder = asn_DEF_INTEGER.xer_encoder; + td->uper_decoder = asn_DEF_INTEGER.uper_decoder; + if(!td->per_constraints) + td->per_constraints = asn_DEF_INTEGER.per_constraints; + td->elements = asn_DEF_INTEGER.elements; + td->elements_count = asn_DEF_INTEGER.elements_count; + td->specifics = asn_DEF_INTEGER.specifics; +} + +void +MinMax_16P0_free(asn_TYPE_descriptor_t *td, + void *struct_ptr, int contents_only) { + MinMax_16P0_1_inherit_TYPE_descriptor(td); + td->free_struct(td, struct_ptr, contents_only); +} + +int +MinMax_16P0_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + MinMax_16P0_1_inherit_TYPE_descriptor(td); + return td->print_struct(td, struct_ptr, ilevel, cb, app_key); +} + +asn_dec_rval_t +MinMax_16P0_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, + void **structure, const void *bufptr, size_t size, int tag_mode) { + MinMax_16P0_1_inherit_TYPE_descriptor(td); + return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); +} + +asn_enc_rval_t +MinMax_16P0_encode_der(asn_TYPE_descriptor_t *td, + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { + MinMax_16P0_1_inherit_TYPE_descriptor(td); + return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); +} + +asn_dec_rval_t +MinMax_16P0_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, + void **structure, const char *opt_mname, const void *bufptr, size_t size) { + MinMax_16P0_1_inherit_TYPE_descriptor(td); + return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); +} + +asn_enc_rval_t +MinMax_16P0_encode_xer(asn_TYPE_descriptor_t *td, void *structure, + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { + MinMax_16P0_1_inherit_TYPE_descriptor(td); + return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); +} + + +/*** <<< STAT-DEFS [MinMax] >>> ***/ + +static ber_tlv_tag_t asn_DEF_MinMax_16P0_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_MinMax_16P0 = { + "MinMax", + "MinMax", + MinMax_16P0_free, + MinMax_16P0_print, + MinMax_16P0_constraint, + MinMax_16P0_decode_ber, + MinMax_16P0_encode_der, + MinMax_16P0_decode_xer, + MinMax_16P0_encode_xer, + 0, /* No PER decoder, -gen-PER to enable */ + 0, /* Use generic outmost tag fetcher */ + asn_DEF_MinMax_16P0_tags_1, + sizeof(asn_DEF_MinMax_16P0_tags_1) + /sizeof(asn_DEF_MinMax_16P0_tags_1[0]), /* 1 */ + asn_DEF_MinMax_16P0_tags_1, /* Same as above */ + sizeof(asn_DEF_MinMax_16P0_tags_1) + /sizeof(asn_DEF_MinMax_16P0_tags_1[0]), /* 1 */ + 0, /* No PER visible constraints */ + 0, 0, /* No members */ + 0 /* No specifics */ +}; + + +/*** <<< INCLUDES [ThreePlus] >>> ***/ + +#include <MinMax.h> + +/*** <<< TYPE-DECLS [ThreePlus] >>> ***/ + +typedef MinMax_16P0_t ThreePlus_t; + +/*** <<< FUNC-DECLS [ThreePlus] >>> ***/ + +extern asn_TYPE_descriptor_t asn_DEF_ThreePlus; +asn_struct_free_f ThreePlus_free; +asn_struct_print_f ThreePlus_print; +asn_constr_check_f ThreePlus_constraint; +ber_type_decoder_f ThreePlus_decode_ber; +der_type_encoder_f ThreePlus_encode_der; +xer_type_decoder_f ThreePlus_decode_xer; +xer_type_encoder_f ThreePlus_encode_xer; + +/*** <<< CODE [ThreePlus] >>> ***/ + +int +ThreePlus_constraint(asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_consume_bytes_f *app_errlog, void *app_key) { + const MinMax_16P0_t *st = (const MinMax_16P0_t *)sptr; + long value; + + if(!sptr) { + _ASN_ERRLOG(app_errlog, app_key, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + if(asn_INTEGER2long(st, &value)) { + _ASN_ERRLOG(app_errlog, app_key, + "%s: value too large (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + if((value >= 3)) { + /* Constraint check succeeded */ + return 0; + } else { + _ASN_ERRLOG(app_errlog, app_key, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +/* + * This type is implemented using MinMax_16P0, + * so here we adjust the DEF accordingly. + */ +static void +ThreePlus_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { + td->free_struct = asn_DEF_MinMax_16P0.free_struct; + td->print_struct = asn_DEF_MinMax_16P0.print_struct; + td->ber_decoder = asn_DEF_MinMax_16P0.ber_decoder; + td->der_encoder = asn_DEF_MinMax_16P0.der_encoder; + td->xer_decoder = asn_DEF_MinMax_16P0.xer_decoder; + td->xer_encoder = asn_DEF_MinMax_16P0.xer_encoder; + td->uper_decoder = asn_DEF_MinMax_16P0.uper_decoder; + if(!td->per_constraints) + td->per_constraints = asn_DEF_MinMax_16P0.per_constraints; + td->elements = asn_DEF_MinMax_16P0.elements; + td->elements_count = asn_DEF_MinMax_16P0.elements_count; + td->specifics = asn_DEF_MinMax_16P0.specifics; +} + +void +ThreePlus_free(asn_TYPE_descriptor_t *td, + void *struct_ptr, int contents_only) { + ThreePlus_1_inherit_TYPE_descriptor(td); + td->free_struct(td, struct_ptr, contents_only); +} + +int +ThreePlus_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + ThreePlus_1_inherit_TYPE_descriptor(td); + return td->print_struct(td, struct_ptr, ilevel, cb, app_key); +} + +asn_dec_rval_t +ThreePlus_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, + void **structure, const void *bufptr, size_t size, int tag_mode) { + ThreePlus_1_inherit_TYPE_descriptor(td); + return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); +} + +asn_enc_rval_t +ThreePlus_encode_der(asn_TYPE_descriptor_t *td, + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { + ThreePlus_1_inherit_TYPE_descriptor(td); + return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); +} + +asn_dec_rval_t +ThreePlus_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, + void **structure, const char *opt_mname, const void *bufptr, size_t size) { + ThreePlus_1_inherit_TYPE_descriptor(td); + return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); +} + +asn_enc_rval_t +ThreePlus_encode_xer(asn_TYPE_descriptor_t *td, void *structure, + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { + ThreePlus_1_inherit_TYPE_descriptor(td); + return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); +} + + +/*** <<< STAT-DEFS [ThreePlus] >>> ***/ + +static ber_tlv_tag_t asn_DEF_ThreePlus_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_ThreePlus = { + "ThreePlus", + "ThreePlus", + ThreePlus_free, + ThreePlus_print, + ThreePlus_constraint, + ThreePlus_decode_ber, + ThreePlus_encode_der, + ThreePlus_decode_xer, + ThreePlus_encode_xer, + 0, /* No PER decoder, -gen-PER to enable */ + 0, /* Use generic outmost tag fetcher */ + asn_DEF_ThreePlus_tags_1, + sizeof(asn_DEF_ThreePlus_tags_1) + /sizeof(asn_DEF_ThreePlus_tags_1[0]), /* 1 */ + asn_DEF_ThreePlus_tags_1, /* Same as above */ + sizeof(asn_DEF_ThreePlus_tags_1) + /sizeof(asn_DEF_ThreePlus_tags_1[0]), /* 1 */ + 0, /* No PER visible constraints */ + 0, 0, /* No members */ + 0 /* No specifics */ +}; + diff --git a/tests/110-param-3-OK.asn1 b/tests/110-param-3-OK.asn1 new file mode 100644 index 0000000000000000000000000000000000000000..383f16cac3597bb1c4f086b84e0f2c89ae2af834 --- /dev/null +++ b/tests/110-param-3-OK.asn1 @@ -0,0 +1,21 @@ + +-- OK: Everything is fine + +-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) +-- .spelio.software.asn1c.test (9363.1.5.1) +-- .110 + +ModuleParameterization3 + { iso org(3) dod(6) internet (1) private(4) enterprise(1) + spelio(9363) software(1) asn1c(5) test(1) 110 } + DEFINITIONS ::= +BEGIN + + Flag{Color} ::= SEQUENCE { + field Color DEFAULT blue + } + + IntegerColorFlag ::= Flag{INTEGER{ red(0), green(1), blue(5) }} + EnumeratedColorFlag ::= Flag{ENUMERATED{ red(3), green, blue }} + +END diff --git a/tests/110-param-3-OK.asn1.-P b/tests/110-param-3-OK.asn1.-P new file mode 100644 index 0000000000000000000000000000000000000000..37ab930e1b2d8b201277b6615240c73963c01e1e --- /dev/null +++ b/tests/110-param-3-OK.asn1.-P @@ -0,0 +1,530 @@ + +/*** <<< INCLUDES [Flag] >>> ***/ + +#include <INTEGER.h> +#include <constr_SEQUENCE.h> +#include <ENUMERATED.h> + +/*** <<< DEPS [Flag] >>> ***/ + +typedef enum field { + field_red = 0, + field_green = 1, + field_blue = 5 +} e_field; +typedef enum field { + field_red = 3, + field_green = 4, + field_blue = 5 +} e_field; + +/*** <<< TYPE-DECLS [Flag] >>> ***/ + +typedef struct Flag_16P0 { + INTEGER_t *field /* DEFAULT 5 */; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} Flag_16P0_t; +typedef struct Flag_16P1 { + ENUMERATED_t *field /* DEFAULT 5 */; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; +} Flag_16P1_t; + +/*** <<< FUNC-DECLS [Flag] >>> ***/ + +extern asn_TYPE_descriptor_t asn_DEF_Flag_16P0; +/* extern asn_TYPE_descriptor_t asn_DEF_field_7; // (Use -fall-defs-global to expose) */ +extern asn_TYPE_descriptor_t asn_DEF_Flag_16P1; + +/*** <<< CODE [Flag] >>> ***/ + +static int +field_7_constraint(asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_consume_bytes_f *app_errlog, void *app_key) { + /* Replace with underlying type checker */ + td->check_constraints = asn_DEF_ENUMERATED.check_constraints; + return td->check_constraints(td, sptr, app_errlog, app_key); +} + +/* + * This type is implemented using ENUMERATED, + * so here we adjust the DEF accordingly. + */ +static void +field_7_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { + td->free_struct = asn_DEF_ENUMERATED.free_struct; + td->print_struct = asn_DEF_ENUMERATED.print_struct; + td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; + td->der_encoder = asn_DEF_ENUMERATED.der_encoder; + td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; + td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; + td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; + if(!td->per_constraints) + td->per_constraints = asn_DEF_ENUMERATED.per_constraints; + td->elements = asn_DEF_ENUMERATED.elements; + td->elements_count = asn_DEF_ENUMERATED.elements_count; + /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ +} + +static void +field_7_free(asn_TYPE_descriptor_t *td, + void *struct_ptr, int contents_only) { + field_7_inherit_TYPE_descriptor(td); + td->free_struct(td, struct_ptr, contents_only); +} + +static int +field_7_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + field_7_inherit_TYPE_descriptor(td); + return td->print_struct(td, struct_ptr, ilevel, cb, app_key); +} + +static asn_dec_rval_t +field_7_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, + void **structure, const void *bufptr, size_t size, int tag_mode) { + field_7_inherit_TYPE_descriptor(td); + return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); +} + +static asn_enc_rval_t +field_7_encode_der(asn_TYPE_descriptor_t *td, + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { + field_7_inherit_TYPE_descriptor(td); + return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); +} + +static asn_dec_rval_t +field_7_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, + void **structure, const char *opt_mname, const void *bufptr, size_t size) { + field_7_inherit_TYPE_descriptor(td); + return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); +} + +static asn_enc_rval_t +field_7_encode_xer(asn_TYPE_descriptor_t *td, void *structure, + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { + field_7_inherit_TYPE_descriptor(td); + return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); +} + + +/*** <<< STAT-DEFS [Flag] >>> ***/ + +static int asn_DFL_2_set_5(void **sptr) { + INTEGER_t *st = *sptr; + + if(!st) { + st = (*sptr = CALLOC(1, sizeof(*st))); + if(!st) return -1; + } + + /* Install default value 5 */ + return asn_long2INTEGER(st, 5); +} +static asn_TYPE_member_t asn_MBR_Flag_16P0_1[] = { + { ATF_POINTER, 1, offsetof(struct Flag_16P0, field), + .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), + .tag_mode = 0, + .type = &asn_DEF_INTEGER, + .memb_constraints = 0, /* Defer constraints checking to the member type */ + .per_constraints = 0, /* PER is not compiled, use -gen-PER */ + .default_value = asn_DFL_2_set_5, /* DEFAULT 5 */ + .name = "field" + }, +}; +static ber_tlv_tag_t asn_DEF_Flag_16P0_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static asn_TYPE_tag2member_t asn_MAP_Flag_16P0_tag2el_1[] = { + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* field at 18 */ +}; +static asn_SEQUENCE_specifics_t asn_SPC_Flag_16P0_specs_1 = { + sizeof(struct Flag_16P0), + offsetof(struct Flag_16P0, _asn_ctx), + asn_MAP_Flag_16P0_tag2el_1, + 1, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* Start extensions */ + -1 /* Stop extensions */ +}; +asn_TYPE_descriptor_t asn_DEF_Flag_16P0 = { + "Flag", + "Flag", + SEQUENCE_free, + SEQUENCE_print, + SEQUENCE_constraint, + SEQUENCE_decode_ber, + SEQUENCE_encode_der, + SEQUENCE_decode_xer, + SEQUENCE_encode_xer, + 0, /* No PER decoder, -gen-PER to enable */ + 0, /* Use generic outmost tag fetcher */ + asn_DEF_Flag_16P0_tags_1, + sizeof(asn_DEF_Flag_16P0_tags_1) + /sizeof(asn_DEF_Flag_16P0_tags_1[0]), /* 1 */ + asn_DEF_Flag_16P0_tags_1, /* Same as above */ + sizeof(asn_DEF_Flag_16P0_tags_1) + /sizeof(asn_DEF_Flag_16P0_tags_1[0]), /* 1 */ + 0, /* No PER visible constraints */ + asn_MBR_Flag_16P0_1, + 1, /* Elements count */ + &asn_SPC_Flag_16P0_specs_1 /* Additional specs */ +}; + +static int asn_DFL_7_set_5(void **sptr) { + ENUMERATED_t *st = *sptr; + + if(!st) { + st = (*sptr = CALLOC(1, sizeof(*st))); + if(!st) return -1; + } + + /* Install default value 5 */ + return asn_long2INTEGER(st, 5); +} +static asn_INTEGER_enum_map_t asn_MAP_field_value2enum_7[] = { + { 3, 3, "red" }, + { 4, 5, "green" }, + { 5, 4, "blue" } +}; +static unsigned int asn_MAP_field_enum2value_7[] = { + 2, /* blue(5) */ + 1, /* green(4) */ + 0 /* red(3) */ +}; +static asn_INTEGER_specifics_t asn_SPC_field_specs_7 = { + asn_MAP_field_value2enum_7, /* "tag" => N; sorted by tag */ + asn_MAP_field_enum2value_7, /* N => "tag"; sorted by N */ + 3, /* Number of elements in the maps */ + 0, /* Enumeration is not extensible */ + 1 /* Strict enumeration */ +}; +static ber_tlv_tag_t asn_DEF_field_tags_7[] = { + (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_field_7 = { + "field", + "field", + field_7_free, + field_7_print, + field_7_constraint, + field_7_decode_ber, + field_7_encode_der, + field_7_decode_xer, + field_7_encode_xer, + 0, /* No PER decoder, -gen-PER to enable */ + 0, /* Use generic outmost tag fetcher */ + asn_DEF_field_tags_7, + sizeof(asn_DEF_field_tags_7) + /sizeof(asn_DEF_field_tags_7[0]), /* 1 */ + asn_DEF_field_tags_7, /* Same as above */ + sizeof(asn_DEF_field_tags_7) + /sizeof(asn_DEF_field_tags_7[0]), /* 1 */ + 0, /* No PER visible constraints */ + 0, 0, /* Defined elsewhere */ + &asn_SPC_field_specs_7 /* Additional specs */ +}; + +static asn_TYPE_member_t asn_MBR_Flag_16P1_6[] = { + { ATF_POINTER, 1, offsetof(struct Flag_16P1, field), + .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), + .tag_mode = 0, + .type = &asn_DEF_field_7, + .memb_constraints = 0, /* Defer constraints checking to the member type */ + .per_constraints = 0, /* PER is not compiled, use -gen-PER */ + .default_value = asn_DFL_7_set_5, /* DEFAULT 5 */ + .name = "field" + }, +}; +static ber_tlv_tag_t asn_DEF_Flag_16P1_tags_6[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static asn_TYPE_tag2member_t asn_MAP_Flag_16P1_tag2el_6[] = { + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* field at 19 */ +}; +static asn_SEQUENCE_specifics_t asn_SPC_Flag_16P1_specs_6 = { + sizeof(struct Flag_16P1), + offsetof(struct Flag_16P1, _asn_ctx), + asn_MAP_Flag_16P1_tag2el_6, + 1, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + -1, /* Start extensions */ + -1 /* Stop extensions */ +}; +asn_TYPE_descriptor_t asn_DEF_Flag_16P1 = { + "Flag", + "Flag", + SEQUENCE_free, + SEQUENCE_print, + SEQUENCE_constraint, + SEQUENCE_decode_ber, + SEQUENCE_encode_der, + SEQUENCE_decode_xer, + SEQUENCE_encode_xer, + 0, /* No PER decoder, -gen-PER to enable */ + 0, /* Use generic outmost tag fetcher */ + asn_DEF_Flag_16P1_tags_6, + sizeof(asn_DEF_Flag_16P1_tags_6) + /sizeof(asn_DEF_Flag_16P1_tags_6[0]), /* 1 */ + asn_DEF_Flag_16P1_tags_6, /* Same as above */ + sizeof(asn_DEF_Flag_16P1_tags_6) + /sizeof(asn_DEF_Flag_16P1_tags_6[0]), /* 1 */ + 0, /* No PER visible constraints */ + asn_MBR_Flag_16P1_6, + 1, /* Elements count */ + &asn_SPC_Flag_16P1_specs_6 /* Additional specs */ +}; + + +/*** <<< INCLUDES [IntegerColorFlag] >>> ***/ + +#include <Flag.h> + +/*** <<< TYPE-DECLS [IntegerColorFlag] >>> ***/ + +typedef Flag_16P0_t IntegerColorFlag_t; + +/*** <<< FUNC-DECLS [IntegerColorFlag] >>> ***/ + +extern asn_TYPE_descriptor_t asn_DEF_IntegerColorFlag; +asn_struct_free_f IntegerColorFlag_free; +asn_struct_print_f IntegerColorFlag_print; +asn_constr_check_f IntegerColorFlag_constraint; +ber_type_decoder_f IntegerColorFlag_decode_ber; +der_type_encoder_f IntegerColorFlag_encode_der; +xer_type_decoder_f IntegerColorFlag_decode_xer; +xer_type_encoder_f IntegerColorFlag_encode_xer; + +/*** <<< CODE [IntegerColorFlag] >>> ***/ + +int +IntegerColorFlag_constraint(asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_consume_bytes_f *app_errlog, void *app_key) { + /* Replace with underlying type checker */ + td->check_constraints = asn_DEF_Flag_16P0.check_constraints; + return td->check_constraints(td, sptr, app_errlog, app_key); +} + +/* + * This type is implemented using Flag_16P0, + * so here we adjust the DEF accordingly. + */ +static void +IntegerColorFlag_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { + td->free_struct = asn_DEF_Flag_16P0.free_struct; + td->print_struct = asn_DEF_Flag_16P0.print_struct; + td->ber_decoder = asn_DEF_Flag_16P0.ber_decoder; + td->der_encoder = asn_DEF_Flag_16P0.der_encoder; + td->xer_decoder = asn_DEF_Flag_16P0.xer_decoder; + td->xer_encoder = asn_DEF_Flag_16P0.xer_encoder; + td->uper_decoder = asn_DEF_Flag_16P0.uper_decoder; + if(!td->per_constraints) + td->per_constraints = asn_DEF_Flag_16P0.per_constraints; + td->elements = asn_DEF_Flag_16P0.elements; + td->elements_count = asn_DEF_Flag_16P0.elements_count; + td->specifics = asn_DEF_Flag_16P0.specifics; +} + +void +IntegerColorFlag_free(asn_TYPE_descriptor_t *td, + void *struct_ptr, int contents_only) { + IntegerColorFlag_1_inherit_TYPE_descriptor(td); + td->free_struct(td, struct_ptr, contents_only); +} + +int +IntegerColorFlag_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + IntegerColorFlag_1_inherit_TYPE_descriptor(td); + return td->print_struct(td, struct_ptr, ilevel, cb, app_key); +} + +asn_dec_rval_t +IntegerColorFlag_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, + void **structure, const void *bufptr, size_t size, int tag_mode) { + IntegerColorFlag_1_inherit_TYPE_descriptor(td); + return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); +} + +asn_enc_rval_t +IntegerColorFlag_encode_der(asn_TYPE_descriptor_t *td, + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { + IntegerColorFlag_1_inherit_TYPE_descriptor(td); + return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); +} + +asn_dec_rval_t +IntegerColorFlag_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, + void **structure, const char *opt_mname, const void *bufptr, size_t size) { + IntegerColorFlag_1_inherit_TYPE_descriptor(td); + return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); +} + +asn_enc_rval_t +IntegerColorFlag_encode_xer(asn_TYPE_descriptor_t *td, void *structure, + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { + IntegerColorFlag_1_inherit_TYPE_descriptor(td); + return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); +} + + +/*** <<< STAT-DEFS [IntegerColorFlag] >>> ***/ + +static ber_tlv_tag_t asn_DEF_IntegerColorFlag_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_IntegerColorFlag = { + "IntegerColorFlag", + "IntegerColorFlag", + IntegerColorFlag_free, + IntegerColorFlag_print, + IntegerColorFlag_constraint, + IntegerColorFlag_decode_ber, + IntegerColorFlag_encode_der, + IntegerColorFlag_decode_xer, + IntegerColorFlag_encode_xer, + 0, /* No PER decoder, -gen-PER to enable */ + 0, /* Use generic outmost tag fetcher */ + asn_DEF_IntegerColorFlag_tags_1, + sizeof(asn_DEF_IntegerColorFlag_tags_1) + /sizeof(asn_DEF_IntegerColorFlag_tags_1[0]), /* 1 */ + asn_DEF_IntegerColorFlag_tags_1, /* Same as above */ + sizeof(asn_DEF_IntegerColorFlag_tags_1) + /sizeof(asn_DEF_IntegerColorFlag_tags_1[0]), /* 1 */ + 0, /* No PER visible constraints */ + 0, 0, /* Defined elsewhere */ + 0 /* No specifics */ +}; + + +/*** <<< INCLUDES [EnumeratedColorFlag] >>> ***/ + +#include <Flag.h> + +/*** <<< TYPE-DECLS [EnumeratedColorFlag] >>> ***/ + +typedef Flag_16P1_t EnumeratedColorFlag_t; + +/*** <<< FUNC-DECLS [EnumeratedColorFlag] >>> ***/ + +extern asn_TYPE_descriptor_t asn_DEF_EnumeratedColorFlag; +asn_struct_free_f EnumeratedColorFlag_free; +asn_struct_print_f EnumeratedColorFlag_print; +asn_constr_check_f EnumeratedColorFlag_constraint; +ber_type_decoder_f EnumeratedColorFlag_decode_ber; +der_type_encoder_f EnumeratedColorFlag_encode_der; +xer_type_decoder_f EnumeratedColorFlag_decode_xer; +xer_type_encoder_f EnumeratedColorFlag_encode_xer; + +/*** <<< CODE [EnumeratedColorFlag] >>> ***/ + +int +EnumeratedColorFlag_constraint(asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_consume_bytes_f *app_errlog, void *app_key) { + /* Replace with underlying type checker */ + td->check_constraints = asn_DEF_Flag_16P1.check_constraints; + return td->check_constraints(td, sptr, app_errlog, app_key); +} + +/* + * This type is implemented using Flag_16P1, + * so here we adjust the DEF accordingly. + */ +static void +EnumeratedColorFlag_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { + td->free_struct = asn_DEF_Flag_16P1.free_struct; + td->print_struct = asn_DEF_Flag_16P1.print_struct; + td->ber_decoder = asn_DEF_Flag_16P1.ber_decoder; + td->der_encoder = asn_DEF_Flag_16P1.der_encoder; + td->xer_decoder = asn_DEF_Flag_16P1.xer_decoder; + td->xer_encoder = asn_DEF_Flag_16P1.xer_encoder; + td->uper_decoder = asn_DEF_Flag_16P1.uper_decoder; + if(!td->per_constraints) + td->per_constraints = asn_DEF_Flag_16P1.per_constraints; + td->elements = asn_DEF_Flag_16P1.elements; + td->elements_count = asn_DEF_Flag_16P1.elements_count; + td->specifics = asn_DEF_Flag_16P1.specifics; +} + +void +EnumeratedColorFlag_free(asn_TYPE_descriptor_t *td, + void *struct_ptr, int contents_only) { + EnumeratedColorFlag_1_inherit_TYPE_descriptor(td); + td->free_struct(td, struct_ptr, contents_only); +} + +int +EnumeratedColorFlag_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + EnumeratedColorFlag_1_inherit_TYPE_descriptor(td); + return td->print_struct(td, struct_ptr, ilevel, cb, app_key); +} + +asn_dec_rval_t +EnumeratedColorFlag_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, + void **structure, const void *bufptr, size_t size, int tag_mode) { + EnumeratedColorFlag_1_inherit_TYPE_descriptor(td); + return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); +} + +asn_enc_rval_t +EnumeratedColorFlag_encode_der(asn_TYPE_descriptor_t *td, + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { + EnumeratedColorFlag_1_inherit_TYPE_descriptor(td); + return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); +} + +asn_dec_rval_t +EnumeratedColorFlag_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, + void **structure, const char *opt_mname, const void *bufptr, size_t size) { + EnumeratedColorFlag_1_inherit_TYPE_descriptor(td); + return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); +} + +asn_enc_rval_t +EnumeratedColorFlag_encode_xer(asn_TYPE_descriptor_t *td, void *structure, + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { + EnumeratedColorFlag_1_inherit_TYPE_descriptor(td); + return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); +} + + +/*** <<< STAT-DEFS [EnumeratedColorFlag] >>> ***/ + +static ber_tlv_tag_t asn_DEF_EnumeratedColorFlag_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +asn_TYPE_descriptor_t asn_DEF_EnumeratedColorFlag = { + "EnumeratedColorFlag", + "EnumeratedColorFlag", + EnumeratedColorFlag_free, + EnumeratedColorFlag_print, + EnumeratedColorFlag_constraint, + EnumeratedColorFlag_decode_ber, + EnumeratedColorFlag_encode_der, + EnumeratedColorFlag_decode_xer, + EnumeratedColorFlag_encode_xer, + 0, /* No PER decoder, -gen-PER to enable */ + 0, /* Use generic outmost tag fetcher */ + asn_DEF_EnumeratedColorFlag_tags_1, + sizeof(asn_DEF_EnumeratedColorFlag_tags_1) + /sizeof(asn_DEF_EnumeratedColorFlag_tags_1[0]), /* 1 */ + asn_DEF_EnumeratedColorFlag_tags_1, /* Same as above */ + sizeof(asn_DEF_EnumeratedColorFlag_tags_1) + /sizeof(asn_DEF_EnumeratedColorFlag_tags_1[0]), /* 1 */ + 0, /* No PER visible constraints */ + 0, 0, /* Defined elsewhere */ + 0 /* No specifics */ +}; + diff --git a/tests/111-param-4-SE.asn1 b/tests/111-param-4-SE.asn1 new file mode 100644 index 0000000000000000000000000000000000000000..4c542b81e1854365ac8e15904715b99afdce5644 --- /dev/null +++ b/tests/111-param-4-SE.asn1 @@ -0,0 +1,21 @@ + +-- SE: Semantic error + +-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) +-- .spelio.software.asn1c.test (9363.1.5.1) +-- .111 + +ModuleParameterization4 + { iso org(3) dod(6) internet (1) private(4) enterprise(1) + spelio(9363) software(1) asn1c(5) test(1) 111 } + DEFINITIONS ::= +BEGIN + + Flag{Color} ::= SEQUENCE { + field Color DEFAULT cyan + } + + IntegerColorFlag ::= Flag{INTEGER{ red(0), green(1), blue(5) }} + EnumeratedColorFlag ::= Flag{ENUMERATED{ red(3), green, blue }} + +END diff --git a/tests/42-real-life-OK.asn1.-PR b/tests/42-real-life-OK.asn1.-PR index 4c41f53399bc63c3aba25cbe9cda79ba435e8a51..7e752afedbbaf0385a3e83e18c7715dc107d1524 100644 --- a/tests/42-real-life-OK.asn1.-PR +++ b/tests/42-real-life-OK.asn1.-PR @@ -604,7 +604,7 @@ typedef enum accept_as { /* * Enumeration is extensible */ -} accept_as_e; +} e_accept_as; /*** <<< TYPE-DECLS [ActionItem] >>> ***/ diff --git a/tests/50-constraint-OK.asn1.-P b/tests/50-constraint-OK.asn1.-P index 18ed94023a18a6dbf32261310ddd7dd8152fc316..6426a93993c5825632505ae9e6468a060e2bc3f2 100644 --- a/tests/50-constraint-OK.asn1.-P +++ b/tests/50-constraint-OK.asn1.-P @@ -3484,7 +3484,7 @@ typedef enum enum_c { * Enumeration is extensible */ enum_c_three = 3 -} enum_c_e; +} e_enum_c; /*** <<< TYPE-DECLS [Sequence] >>> ***/ @@ -3941,7 +3941,7 @@ asn_TYPE_descriptor_t asn_DEF_SequenceOf = { typedef enum Enum0 { Enum0_one = 0, Enum0_two = 1 -} Enum0_e; +} e_Enum0; /*** <<< TYPE-DECLS [Enum0] >>> ***/ @@ -4086,7 +4086,7 @@ asn_TYPE_descriptor_t asn_DEF_Enum0 = { typedef enum Enum1 { Enum1_one = 0, Enum1_two = 1 -} Enum1_e; +} e_Enum1; /*** <<< TYPE-DECLS [Enum1] >>> ***/ diff --git a/tests/50-constraint-OK.asn1.-Pgen-PER b/tests/50-constraint-OK.asn1.-Pgen-PER index a5c37ad4682d75e87e418c40b339daea6060c859..5092b01bf6e5ef4a5f46ffca8cba90e872ac0778 100644 --- a/tests/50-constraint-OK.asn1.-Pgen-PER +++ b/tests/50-constraint-OK.asn1.-Pgen-PER @@ -3744,7 +3744,7 @@ typedef enum enum_c { * Enumeration is extensible */ enum_c_three = 3 -} enum_c_e; +} e_enum_c; /*** <<< TYPE-DECLS [Sequence] >>> ***/ @@ -4234,7 +4234,7 @@ asn_TYPE_descriptor_t asn_DEF_SequenceOf = { typedef enum Enum0 { Enum0_one = 0, Enum0_two = 1 -} Enum0_e; +} e_Enum0; /*** <<< TYPE-DECLS [Enum0] >>> ***/ @@ -4391,7 +4391,7 @@ asn_TYPE_descriptor_t asn_DEF_Enum0 = { typedef enum Enum1 { Enum1_one = 0, Enum1_two = 1 -} Enum1_e; +} e_Enum1; /*** <<< TYPE-DECLS [Enum1] >>> ***/ diff --git a/tests/66-ref-simple-OK.asn1.-P b/tests/66-ref-simple-OK.asn1.-P index 1e6f4ed818fede30693807f8121d1500e6ad7c47..b424e478876aa871f55bf0551fc28aadc216a9a6 100644 --- a/tests/66-ref-simple-OK.asn1.-P +++ b/tests/66-ref-simple-OK.asn1.-P @@ -74,7 +74,7 @@ typedef enum SimpleType { SimpleType_one = 0, SimpleType_two = 1, SimpleType_three = 2 -} SimpleType_e; +} e_SimpleType; /*** <<< TYPE-DECLS [SimpleType] >>> ***/ diff --git a/tests/70-xer-test-OK.asn1.-P b/tests/70-xer-test-OK.asn1.-P index 45d6a6997325e16a059fe1838403f498d6af5914..b3d2ff9c8d53a9a26642f2450df6893021f730fc 100644 --- a/tests/70-xer-test-OK.asn1.-P +++ b/tests/70-xer-test-OK.asn1.-P @@ -499,7 +499,7 @@ typedef enum ExtensibleSet_PR { typedef enum Enum { enum_b = 0, enum_a = 1 -} enum_e; +} e_enum; /*** <<< TYPE-DECLS [ExtensibleSet] >>> ***/ @@ -1037,7 +1037,7 @@ asn_TYPE_descriptor_t asn_DEF_SetOfREAL = { typedef enum Member { Member_one = 0, Member_oneMore = 1 -} Member_e; +} e_Member; /*** <<< TYPE-DECLS [SetOfEnums] >>> ***/ @@ -1357,7 +1357,7 @@ asn_TYPE_descriptor_t asn_DEF_NamedSetOfREAL = { typedef enum name { name_one = 0, name_oneMore = 1 -} name_e; +} e_name; /*** <<< TYPE-DECLS [NamedSetOfEnums] >>> ***/ diff --git a/tests/72-same-names-OK.asn1.-P b/tests/72-same-names-OK.asn1.-P index e4d210c012ef7fb6fc5c6e80dc24935f14980593..4b804ea92340a6106f5b788b5a6fd068b1f20cb5 100644 --- a/tests/72-same-names-OK.asn1.-P +++ b/tests/72-same-names-OK.asn1.-P @@ -352,7 +352,7 @@ typedef enum Type2_PR { } Type2_PR; typedef enum a { a_one = 0 -} a_e; +} e_a; /* * Method of determining the components presence @@ -362,7 +362,7 @@ typedef enum two_name_PR { } two_name_PR; typedef enum a { a_one = 0 -} a_e; +} e_a; /*** <<< TYPE-DECLS [Type2] >>> ***/ diff --git a/tests/73-circular-OK.asn1.-P b/tests/73-circular-OK.asn1.-P index 4e29c9bb46848325d1b278e5211c48b52c42ee97..5fe6fc333e8405be7b799ea78d695cf45101deda 100644 --- a/tests/73-circular-OK.asn1.-P +++ b/tests/73-circular-OK.asn1.-P @@ -703,7 +703,7 @@ asn_TYPE_descriptor_t asn_DEF_Ypet = { typedef enum EnumType { EnumType_one = 0, EnumType_two = 1 -} EnumType_e; +} e_EnumType; /*** <<< TYPE-DECLS [EnumType] >>> ***/ diff --git a/tests/84-param-tags-OK.asn1 b/tests/84-param-tags-OK.asn1 index 3cedc419a47132214fb770aa5fa66a4b53cf3e4b..cddf8467c742f62c882c708bef143bf6a5cd164f 100644 --- a/tests/84-param-tags-OK.asn1 +++ b/tests/84-param-tags-OK.asn1 @@ -6,7 +6,7 @@ -- .84 1 -- .84 2 -ModuleTestParametrizationTags1 +ModuleTestParameterizationTags1 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 84 1 } DEFINITIONS ::= @@ -23,7 +23,7 @@ BEGIN END -ModuleTestParametrizationTagsAuto2 +ModuleTestParameterizationTagsAuto2 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 84 2 } DEFINITIONS AUTOMATIC TAGS ::= diff --git a/tests/84-param-tags-OK.asn1.-EF b/tests/84-param-tags-OK.asn1.-EF index b5889ae1d6d4da60e3cbe0ace8168e8b2b242c6e..a307434042bcbe5417be812c81eb83cd78925ffa 100644 --- a/tests/84-param-tags-OK.asn1.-EF +++ b/tests/84-param-tags-OK.asn1.-EF @@ -1,4 +1,4 @@ -ModuleTestParametrizationTags1 { iso org(3) dod(6) internet(1) private(4) +ModuleTestParameterizationTags1 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 84 1 } DEFINITIONS ::= BEGIN @@ -14,7 +14,7 @@ TestChoice ::= CHOICE { END -ModuleTestParametrizationTagsAuto2 { iso org(3) dod(6) internet(1) private(4) +ModuleTestParameterizationTagsAuto2 { iso org(3) dod(6) internet(1) private(4) enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 84 2 } DEFINITIONS AUTOMATIC TAGS ::= BEGIN diff --git a/tests/88-integer-enum-OK.asn1.-P b/tests/88-integer-enum-OK.asn1.-P index 6b73d313fb610b75a585513831abd8134c5df05c..bbd437aaa1dc77440e64ee21c053ffd41ffa799b 100644 --- a/tests/88-integer-enum-OK.asn1.-P +++ b/tests/88-integer-enum-OK.asn1.-P @@ -8,7 +8,7 @@ typedef enum T { T_a = 1, T_b = 2 -} T_e; +} e_T; /*** <<< TYPE-DECLS [T] >>> ***/ diff --git a/tests/89-bit-string-enum-OK.asn1.-P b/tests/89-bit-string-enum-OK.asn1.-P index 0514dadc1e5cb3acb913900eecd0253208a98220..4af09138794c602c7eaeb65877ba8aa64b2077a8 100644 --- a/tests/89-bit-string-enum-OK.asn1.-P +++ b/tests/89-bit-string-enum-OK.asn1.-P @@ -13,7 +13,7 @@ typedef enum T_PR { typedef enum bs { bs_a = 1, bs_b = 2 -} bs_e; +} e_bs; /*** <<< TYPE-DECLS [T] >>> ***/ diff --git a/tests/89-bit-string-enum-OK.asn1.-Pfcompound-names b/tests/89-bit-string-enum-OK.asn1.-Pfcompound-names index dbea3a304a8cdac0e8794d7ac2b1e7dfe8e767e2..259dd5ca3272ba88693188231c29766bf2a82b58 100644 --- a/tests/89-bit-string-enum-OK.asn1.-Pfcompound-names +++ b/tests/89-bit-string-enum-OK.asn1.-Pfcompound-names @@ -13,7 +13,7 @@ typedef enum T_PR { typedef enum T__bs { T__bs_a = 1, T__bs_b = 2 -} T__bs_e; +} e_T__bs; /*** <<< TYPE-DECLS [T] >>> ***/ diff --git a/tests/90-cond-int-type-OK.asn1.-P b/tests/90-cond-int-type-OK.asn1.-P index 9e03bc231361ebf0499670d445cc9585a31f5a93..aae3b12636f2a4cde8f69f9007e695acff123676 100644 --- a/tests/90-cond-int-type-OK.asn1.-P +++ b/tests/90-cond-int-type-OK.asn1.-P @@ -2288,7 +2288,7 @@ asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6 = { typedef enum CN_IntegerEnumerated1 { CN_IntegerEnumerated1_a = 1, CN_IntegerEnumerated1_b = 2 -} CN_IntegerEnumerated1_e; +} e_CN_IntegerEnumerated1; /*** <<< TYPE-DECLS [CN-IntegerEnumerated1] >>> ***/ @@ -2418,7 +2418,7 @@ asn_TYPE_descriptor_t asn_DEF_CN_IntegerEnumerated1 = { typedef enum NO_IntegerEnumerated2 { NO_IntegerEnumerated2_a = 1, NO_IntegerEnumerated2_b = 3000000000 -} NO_IntegerEnumerated2_e; +} e_NO_IntegerEnumerated2; /*** <<< TYPE-DECLS [NO-IntegerEnumerated2] >>> ***/ diff --git a/tests/90-cond-int-type-OK.asn1.-Pfnative-types b/tests/90-cond-int-type-OK.asn1.-Pfnative-types index 240c70b182fc39fcb375eabf06c1e7544c04c273..765d2847e8f5f5b7b27bc7cfd52284903ccb0087 100644 --- a/tests/90-cond-int-type-OK.asn1.-Pfnative-types +++ b/tests/90-cond-int-type-OK.asn1.-Pfnative-types @@ -2269,7 +2269,7 @@ asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6 = { typedef enum CN_IntegerEnumerated1 { CN_IntegerEnumerated1_a = 1, CN_IntegerEnumerated1_b = 2 -} CN_IntegerEnumerated1_e; +} e_CN_IntegerEnumerated1; /*** <<< TYPE-DECLS [CN-IntegerEnumerated1] >>> ***/ @@ -2399,7 +2399,7 @@ asn_TYPE_descriptor_t asn_DEF_CN_IntegerEnumerated1 = { typedef enum NO_IntegerEnumerated2 { NO_IntegerEnumerated2_a = 1, NO_IntegerEnumerated2_b = 3000000000 -} NO_IntegerEnumerated2_e; +} e_NO_IntegerEnumerated2; /*** <<< TYPE-DECLS [NO-IntegerEnumerated2] >>> ***/ diff --git a/tests/90-cond-int-type-OK.asn1.-Pgen-PER b/tests/90-cond-int-type-OK.asn1.-Pgen-PER index e0951e4f2268833431e8b32b19a31e4dd497101a..88d7b33fbc443a020a54eaf269177a2bd78749e7 100644 --- a/tests/90-cond-int-type-OK.asn1.-Pgen-PER +++ b/tests/90-cond-int-type-OK.asn1.-Pgen-PER @@ -2476,7 +2476,7 @@ asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6 = { typedef enum CN_IntegerEnumerated1 { CN_IntegerEnumerated1_a = 1, CN_IntegerEnumerated1_b = 2 -} CN_IntegerEnumerated1_e; +} e_CN_IntegerEnumerated1; /*** <<< TYPE-DECLS [CN-IntegerEnumerated1] >>> ***/ @@ -2614,7 +2614,7 @@ asn_TYPE_descriptor_t asn_DEF_CN_IntegerEnumerated1 = { typedef enum NO_IntegerEnumerated2 { NO_IntegerEnumerated2_a = 1, NO_IntegerEnumerated2_b = 3000000000 -} NO_IntegerEnumerated2_e; +} e_NO_IntegerEnumerated2; /*** <<< TYPE-DECLS [NO-IntegerEnumerated2] >>> ***/