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/skeletons/constr_TYPE.c b/skeletons/constr_TYPE.c
index 322f68c..7a135ce 100644
--- a/skeletons/constr_TYPE.c
+++ b/skeletons/constr_TYPE.c
@@ -26,7 +26,7 @@
if(type_descriptor->tags_count)
return type_descriptor->tags[0];
- return type_descriptor->outmost_tag(type_descriptor, struct_ptr, 0, 0);
+ return type_descriptor->op->outmost_tag(type_descriptor, struct_ptr, 0, 0);
}
/*
@@ -41,7 +41,7 @@
}
/* Invoke type-specific printer */
- if(td->print_struct(td, struct_ptr, 1, _print2fp, stream))
+ if(td->op->print_struct(td, struct_ptr, 1, _print2fp, stream))
return -1;
/* Terminate the output */