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/144-ios-parameterization-OK.asn1.-P b/tests/tests-asn1c-compiler/144-ios-parameterization-OK.asn1.-P
index 340d2ec..5c010ea 100644
--- a/tests/tests-asn1c-compiler/144-ios-parameterization-OK.asn1.-P
+++ b/tests/tests-asn1c-compiler/144-ios-parameterization-OK.asn1.-P
@@ -50,17 +50,8 @@
asn_TYPE_descriptor_t asn_DEF_Message = {
"Message",
"Message",
- 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_Message_tags_1,
sizeof(asn_DEF_Message_tags_1)
/sizeof(asn_DEF_Message_tags_1[0]), /* 1 */
@@ -166,7 +157,7 @@
const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
- if(constraining_cell->type_descriptor->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+ if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
result.type_descriptor = type_cell->type_descriptor;
result.presence_index = row + 1;
break;
@@ -240,17 +231,8 @@
asn_TYPE_descriptor_t asn_DEF_value_3 = {
"value",
"value",
- OPEN_TYPE_free,
- OPEN_TYPE_print,
- OPEN_TYPE_compare,
+ &asn_OP_OPEN_TYPE,
OPEN_TYPE_constraint,
- OPEN_TYPE_decode_ber,
- OPEN_TYPE_encode_der,
- OPEN_TYPE_decode_xer,
- OPEN_TYPE_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 */
0, /* No effective tags (pointer) */
0, /* No effective tags (count) */
0, /* No tags (pointer) */
@@ -304,17 +286,8 @@
asn_TYPE_descriptor_t asn_DEF_SpecializedContent_30P0 = {
"SpecializedContent",
"SpecializedContent",
- 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_SpecializedContent_30P0_tags_1,
sizeof(asn_DEF_SpecializedContent_30P0_tags_1)
/sizeof(asn_DEF_SpecializedContent_30P0_tags_1[0]), /* 1 */