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/95-choice-per-order-OK.asn1.-Pgen-PER b/tests/tests-asn1c-compiler/95-choice-per-order-OK.asn1.-Pgen-PER
index 8d49825..e3d73f2 100644
--- a/tests/tests-asn1c-compiler/95-choice-per-order-OK.asn1.-Pgen-PER
+++ b/tests/tests-asn1c-compiler/95-choice-per-order-OK.asn1.-Pgen-PER
@@ -114,18 +114,8 @@
asn_TYPE_descriptor_t asn_DEF_ch_4 = {
"ch",
"ch",
- CHOICE_free,
- CHOICE_print,
- CHOICE_compare,
+ &asn_OP_CHOICE,
CHOICE_constraint,
- CHOICE_decode_ber,
- CHOICE_encode_der,
- CHOICE_decode_xer,
- CHOICE_encode_xer,
- 0, 0, /* No OER support, use "-gen-OER" to enable */
- CHOICE_decode_uper,
- CHOICE_encode_uper,
- CHOICE_outmost_tag,
0, /* No effective tags (pointer) */
0, /* No effective tags (count) */
0, /* No tags (pointer) */
@@ -204,18 +194,8 @@
asn_TYPE_descriptor_t asn_DEF_Choice = {
"Choice",
"Choice",
- CHOICE_free,
- CHOICE_print,
- CHOICE_compare,
+ &asn_OP_CHOICE,
CHOICE_constraint,
- CHOICE_decode_ber,
- CHOICE_encode_der,
- CHOICE_decode_xer,
- CHOICE_encode_xer,
- 0, 0, /* No OER support, use "-gen-OER" to enable */
- CHOICE_decode_uper,
- CHOICE_encode_uper,
- CHOICE_outmost_tag,
0, /* No effective tags (pointer) */
0, /* No effective tags (count) */
0, /* No tags (pointer) */
@@ -310,18 +290,8 @@
asn_TYPE_descriptor_t asn_DEF_Choice2 = {
"Choice2",
"Choice2",
- CHOICE_free,
- CHOICE_print,
- CHOICE_compare,
+ &asn_OP_CHOICE,
CHOICE_constraint,
- CHOICE_decode_ber,
- CHOICE_encode_der,
- CHOICE_decode_xer,
- CHOICE_encode_xer,
- 0, 0, /* No OER support, use "-gen-OER" to enable */
- CHOICE_decode_uper,
- CHOICE_encode_uper,
- CHOICE_outmost_tag,
0, /* No effective tags (pointer) */
0, /* No effective tags (count) */
0, /* No tags (pointer) */