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/ObjectDescriptor.c b/skeletons/ObjectDescriptor.c
index b80b69e..2e9a76d 100644
--- a/skeletons/ObjectDescriptor.c
+++ b/skeletons/ObjectDescriptor.c
@@ -12,9 +12,7 @@
(ASN_TAG_CLASS_UNIVERSAL | (7 << 2)), /* [UNIVERSAL 7] IMPLICIT ... */
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
-asn_TYPE_descriptor_t asn_DEF_ObjectDescriptor = {
- "ObjectDescriptor",
- "ObjectDescriptor",
+asn_TYPE_operation_t asn_OP_ObjectDescriptor = {
OCTET_STRING_free,
OCTET_STRING_print_utf8, /* Treat as ASCII subset (it's not) */
OCTET_STRING_compare,
@@ -37,7 +35,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_ObjectDescriptor = {
+ "ObjectDescriptor",
+ "ObjectDescriptor",
+ &asn_OP_ObjectDescriptor,
+ asn_generic_unknown_constraint,
asn_DEF_ObjectDescriptor_tags,
sizeof(asn_DEF_ObjectDescriptor_tags)
/ sizeof(asn_DEF_ObjectDescriptor_tags[0]) - 1,