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/32-sequence-of-OK.asn1.-P b/tests/tests-asn1c-compiler/32-sequence-of-OK.asn1.-P
index c4d2466..876dcda 100644
--- a/tests/tests-asn1c-compiler/32-sequence-of-OK.asn1.-P
+++ b/tests/tests-asn1c-compiler/32-sequence-of-OK.asn1.-P
@@ -51,17 +51,8 @@
asn_TYPE_descriptor_t asn_DEF_Programming = {
"Programming",
"Programming",
- 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 */
- 0, 0, /* No PER support, use "-gen-PER" to enable */
- 0, /* Use generic outmost tag fetcher */
asn_DEF_Programming_tags_1,
sizeof(asn_DEF_Programming_tags_1)
/sizeof(asn_DEF_Programming_tags_1[0]), /* 1 */
@@ -130,17 +121,8 @@
asn_TYPE_descriptor_t asn_DEF_Fault = {
"Fault",
"Fault",
- SET_OF_free,
- SET_OF_print,
- SET_OF_compare,
+ &asn_OP_SET_OF,
SET_OF_constraint,
- SET_OF_decode_ber,
- SET_OF_encode_der,
- SET_OF_decode_xer,
- SET_OF_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_Fault_tags_1,
sizeof(asn_DEF_Fault_tags_1)
/sizeof(asn_DEF_Fault_tags_1[0]), /* 1 */
@@ -193,17 +175,8 @@
asn_TYPE_descriptor_t asn_DEF_Error = {
"Error",
"Error",
- 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_Error_tags_1,
sizeof(asn_DEF_Error_tags_1)
/sizeof(asn_DEF_Error_tags_1[0]), /* 1 */
@@ -279,17 +252,8 @@
asn_TYPE_descriptor_t asn_DEF_seqOfMan_3 = {
"seqOfMan",
"seqOfMan",
- 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 */
- 0, 0, /* No PER support, use "-gen-PER" to enable */
- 0, /* Use generic outmost tag fetcher */
asn_DEF_seqOfMan_tags_3,
sizeof(asn_DEF_seqOfMan_tags_3)
/sizeof(asn_DEF_seqOfMan_tags_3[0]), /* 2 */
@@ -346,17 +310,8 @@
asn_TYPE_descriptor_t asn_DEF_SeqWithMandatory = {
"SeqWithMandatory",
"SeqWithMandatory",
- 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_SeqWithMandatory_tags_1,
sizeof(asn_DEF_SeqWithMandatory_tags_1)
/sizeof(asn_DEF_SeqWithMandatory_tags_1[0]), /* 1 */
@@ -433,17 +388,8 @@
asn_TYPE_descriptor_t asn_DEF_seqOfOpt_3 = {
"seqOfOpt",
"seqOfOpt",
- 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 */
- 0, 0, /* No PER support, use "-gen-PER" to enable */
- 0, /* Use generic outmost tag fetcher */
asn_DEF_seqOfOpt_tags_3,
sizeof(asn_DEF_seqOfOpt_tags_3)
/sizeof(asn_DEF_seqOfOpt_tags_3[0]), /* 2 */
@@ -500,17 +446,8 @@
asn_TYPE_descriptor_t asn_DEF_SeqWithOptional = {
"SeqWithOptional",
"SeqWithOptional",
- 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_SeqWithOptional_tags_1,
sizeof(asn_DEF_SeqWithOptional_tags_1)
/sizeof(asn_DEF_SeqWithOptional_tags_1[0]), /* 1 */