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/PrintableString.c b/skeletons/PrintableString.c
index 5e0e4b7..10a3edd 100644
--- a/skeletons/PrintableString.c
+++ b/skeletons/PrintableString.c
@@ -47,9 +47,7 @@
asn_DEF_PrintableString_v2c,
asn_DEF_PrintableString_c2v
};
-asn_TYPE_descriptor_t asn_DEF_PrintableString = {
- "PrintableString",
- "PrintableString",
+asn_TYPE_operation_t asn_OP_PrintableString = {
OCTET_STRING_free,
OCTET_STRING_print_utf8, /* ASCII subset */
OCTET_STRING_compare,
@@ -72,7 +70,13 @@
OCTET_STRING_decode_uper,
OCTET_STRING_encode_uper,
#endif /* ASN_DISABLE_PER_SUPPORT */
- 0, /* Use generic outmost tag fetcher */
+ 0 /* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_PrintableString = {
+ "PrintableString",
+ "PrintableString",
+ &asn_OP_PrintableString,
+ PrintableString_constraint,
asn_DEF_PrintableString_tags,
sizeof(asn_DEF_PrintableString_tags)
/ sizeof(asn_DEF_PrintableString_tags[0]) - 1,