Move type operations to another structure
Every type has free, print, check_constraints, ber_decoder, der_encoder,
xer_decoder, xer_encoder, uper_decoder, uper_encoder and outmost_tag
operations. We move them out to a separate structure asn_TYPE_operation_t.
Combined with previous logic simplification, these operations are based
on ASN.1 basic types, constructed types and string types. So we can
reduce the space occupied by asn_TYPE_descriptor_t variables.
diff --git a/tests/tests-asn1c-compiler/105-param-2-OK.asn1.-Pfwide-types b/tests/tests-asn1c-compiler/105-param-2-OK.asn1.-Pfwide-types
index 3439300..1612084 100644
--- a/tests/tests-asn1c-compiler/105-param-2-OK.asn1.-Pfwide-types
+++ b/tests/tests-asn1c-compiler/105-param-2-OK.asn1.-Pfwide-types
@@ -82,17 +82,8 @@
asn_TYPE_descriptor_t asn_DEF_SIGNED_16P0 = {
"SIGNED",
"SIGNED",
- SEQUENCE_free,
- SEQUENCE_print,
- SEQUENCE_compare,
+ &asn_OP_SEQUENCE,
SEQUENCE_constraint,
- SEQUENCE_decode_ber,
- SEQUENCE_encode_der,
- SEQUENCE_decode_xer,
- SEQUENCE_encode_xer,
- 0, 0, /* No OER support, use "-gen-OER" to enable */
- 0, 0, /* No PER support, use "-gen-PER" to enable */
- 0, /* Use generic outmost tag fetcher */
asn_DEF_SIGNED_16P0_tags_1,
sizeof(asn_DEF_SIGNED_16P0_tags_1)
/sizeof(asn_DEF_SIGNED_16P0_tags_1[0]), /* 1 */
@@ -144,17 +135,8 @@
asn_TYPE_descriptor_t asn_DEF_signed_4 = {
"signed",
"signed",
- SET_free,
- SET_print,
- SET_compare,
+ &asn_OP_SET,
SET_constraint,
- SET_decode_ber,
- SET_encode_der,
- SET_decode_xer,
- SET_encode_xer,
- 0, 0, /* No OER support, use "-gen-OER" to enable */
- 0, 0, /* No PER support, use "-gen-PER" to enable */
- 0, /* Use generic outmost tag fetcher */
asn_DEF_signed_tags_4,
sizeof(asn_DEF_signed_tags_4)
/sizeof(asn_DEF_signed_tags_4[0]), /* 1 */
@@ -199,17 +181,8 @@
asn_TYPE_descriptor_t asn_DEF_SIGNED_16P1 = {
"SIGNED",
"SIGNED",
- SEQUENCE_free,
- SEQUENCE_print,
- SEQUENCE_compare,
+ &asn_OP_SEQUENCE,
SEQUENCE_constraint,
- SEQUENCE_decode_ber,
- SEQUENCE_encode_der,
- SEQUENCE_decode_xer,
- SEQUENCE_encode_xer,
- 0, 0, /* No OER support, use "-gen-OER" to enable */
- 0, 0, /* No PER support, use "-gen-PER" to enable */
- 0, /* Use generic outmost tag fetcher */
asn_DEF_SIGNED_16P1_tags_3,
sizeof(asn_DEF_SIGNED_16P1_tags_3)
/sizeof(asn_DEF_SIGNED_16P1_tags_3[0]), /* 1 */
@@ -258,17 +231,8 @@
asn_TYPE_descriptor_t asn_DEF_SignedREAL = {
"SignedREAL",
"SignedREAL",
- SEQUENCE_free,
- SEQUENCE_print,
- SEQUENCE_compare,
+ &asn_OP_SEQUENCE,
SEQUENCE_constraint,
- SEQUENCE_decode_ber,
- SEQUENCE_encode_der,
- SEQUENCE_decode_xer,
- SEQUENCE_encode_xer,
- 0, 0, /* No OER support, use "-gen-OER" to enable */
- 0, 0, /* No PER support, use "-gen-PER" to enable */
- 0, /* Use generic outmost tag fetcher */
asn_DEF_SignedREAL_tags_1,
sizeof(asn_DEF_SignedREAL_tags_1)
/sizeof(asn_DEF_SignedREAL_tags_1[0]), /* 1 */
@@ -317,17 +281,8 @@
asn_TYPE_descriptor_t asn_DEF_SignedSET = {
"SignedSET",
"SignedSET",
- SEQUENCE_free,
- SEQUENCE_print,
- SEQUENCE_compare,
+ &asn_OP_SEQUENCE,
SEQUENCE_constraint,
- SEQUENCE_decode_ber,
- SEQUENCE_encode_der,
- SEQUENCE_decode_xer,
- SEQUENCE_encode_xer,
- 0, 0, /* No OER support, use "-gen-OER" to enable */
- 0, 0, /* No PER support, use "-gen-PER" to enable */
- 0, /* Use generic outmost tag fetcher */
asn_DEF_SignedSET_tags_1,
sizeof(asn_DEF_SignedSET_tags_1)
/sizeof(asn_DEF_SignedSET_tags_1[0]), /* 1 */