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/137-oer-string-OK.asn1.-Pgen-OER b/tests/tests-asn1c-compiler/137-oer-string-OK.asn1.-Pgen-OER
index 5ee4e0f..370efeb 100644
--- a/tests/tests-asn1c-compiler/137-oer-string-OK.asn1.-Pgen-OER
+++ b/tests/tests-asn1c-compiler/137-oer-string-OK.asn1.-Pgen-OER
@@ -226,18 +226,8 @@
asn_TYPE_descriptor_t asn_DEF_unconstrained_2 = {
"unconstrained",
"unconstrained",
- SEQUENCE_free,
- SEQUENCE_print,
- SEQUENCE_compare,
+ &asn_OP_SEQUENCE,
SEQUENCE_constraint,
- SEQUENCE_decode_ber,
- SEQUENCE_encode_der,
- SEQUENCE_decode_xer,
- SEQUENCE_encode_xer,
- SEQUENCE_decode_oer,
- SEQUENCE_encode_oer,
- 0, 0, /* No PER support, use "-gen-PER" to enable */
- 0, /* Use generic outmost tag fetcher */
asn_DEF_unconstrained_tags_2,
sizeof(asn_DEF_unconstrained_tags_2)
/sizeof(asn_DEF_unconstrained_tags_2[0]), /* 1 */
@@ -307,18 +297,8 @@
asn_TYPE_descriptor_t asn_DEF_constrained_6 = {
"constrained",
"constrained",
- SEQUENCE_free,
- SEQUENCE_print,
- SEQUENCE_compare,
+ &asn_OP_SEQUENCE,
SEQUENCE_constraint,
- SEQUENCE_decode_ber,
- SEQUENCE_encode_der,
- SEQUENCE_decode_xer,
- SEQUENCE_encode_xer,
- SEQUENCE_decode_oer,
- SEQUENCE_encode_oer,
- 0, 0, /* No PER support, use "-gen-PER" to enable */
- 0, /* Use generic outmost tag fetcher */
asn_DEF_constrained_tags_6,
sizeof(asn_DEF_constrained_tags_6)
/sizeof(asn_DEF_constrained_tags_6[0]), /* 1 */
@@ -375,18 +355,8 @@
asn_TYPE_descriptor_t asn_DEF_T = {
"T",
"T",
- SEQUENCE_free,
- SEQUENCE_print,
- SEQUENCE_compare,
+ &asn_OP_SEQUENCE,
SEQUENCE_constraint,
- SEQUENCE_decode_ber,
- SEQUENCE_encode_der,
- SEQUENCE_decode_xer,
- SEQUENCE_encode_xer,
- SEQUENCE_decode_oer,
- SEQUENCE_encode_oer,
- 0, 0, /* No PER support, use "-gen-PER" to enable */
- 0, /* Use generic outmost tag fetcher */
asn_DEF_T_tags_1,
sizeof(asn_DEF_T_tags_1)
/sizeof(asn_DEF_T_tags_1[0]), /* 1 */