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/UTF8String.c b/skeletons/UTF8String.c
index de78c5e..a89a89e 100644
--- a/skeletons/UTF8String.c
+++ b/skeletons/UTF8String.c
@@ -13,9 +13,7 @@
(ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), /* [UNIVERSAL 12] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), /* ... OCTET STRING */
};
-asn_TYPE_descriptor_t asn_DEF_UTF8String = {
- "UTF8String",
- "UTF8String",
+asn_TYPE_operation_t asn_OP_UTF8String = {
OCTET_STRING_free,
UTF8String_print,
OCTET_STRING_compare,
@@ -38,7 +36,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_UTF8String = {
+ "UTF8String",
+ "UTF8String",
+ &asn_OP_UTF8String,
+ UTF8String_constraint, /* Check for invalid codes, etc. */
asn_DEF_UTF8String_tags,
sizeof(asn_DEF_UTF8String_tags)
/ sizeof(asn_DEF_UTF8String_tags[0]) - 1,