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/119-per-strings-OK.asn1.-Pgen-PER b/tests/tests-asn1c-compiler/119-per-strings-OK.asn1.-Pgen-PER
index c09c605..0fe86d7 100644
--- a/tests/tests-asn1c-compiler/119-per-strings-OK.asn1.-Pgen-PER
+++ b/tests/tests-asn1c-compiler/119-per-strings-OK.asn1.-Pgen-PER
@@ -1209,18 +1209,8 @@
asn_TYPE_descriptor_t asn_DEF_many_2 = {
"many",
"many",
- SEQUENCE_OF_free,
- SEQUENCE_OF_print,
- SEQUENCE_OF_compare,
+ &asn_OP_SEQUENCE_OF,
SEQUENCE_OF_constraint,
- SEQUENCE_OF_decode_ber,
- SEQUENCE_OF_encode_der,
- SEQUENCE_OF_decode_xer,
- SEQUENCE_OF_encode_xer,
- 0, 0, /* No OER support, use "-gen-OER" to enable */
- SEQUENCE_OF_decode_uper,
- SEQUENCE_OF_encode_uper,
- 0, /* Use generic outmost tag fetcher */
asn_DEF_many_tags_2,
sizeof(asn_DEF_many_tags_2)
/sizeof(asn_DEF_many_tags_2[0]) - 1, /* 1 */
@@ -1627,18 +1617,8 @@
asn_TYPE_descriptor_t asn_DEF_PDU = {
"PDU",
"PDU",
- 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 */
- SEQUENCE_decode_uper,
- SEQUENCE_encode_uper,
- 0, /* Use generic outmost tag fetcher */
asn_DEF_PDU_tags_1,
sizeof(asn_DEF_PDU_tags_1)
/sizeof(asn_DEF_PDU_tags_1[0]), /* 1 */