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/BIT_STRING.c b/skeletons/BIT_STRING.c
index d87f0d4..7e9b82c 100644
--- a/skeletons/BIT_STRING.c
+++ b/skeletons/BIT_STRING.c
@@ -17,9 +17,7 @@
offsetof(BIT_STRING_t, _asn_ctx),
ASN_OSUBV_BIT
};
-asn_TYPE_descriptor_t asn_DEF_BIT_STRING = {
- "BIT STRING",
- "BIT_STRING",
+asn_TYPE_operation_t asn_OP_BIT_STRING = {
OCTET_STRING_free, /* Implemented in terms of OCTET STRING */
BIT_STRING_print,
BIT_STRING_compare,
@@ -42,7 +40,13 @@
OCTET_STRING_decode_uper, /* Unaligned PER decoder */
OCTET_STRING_encode_uper, /* Unaligned PER encoder */
#endif /* ASN_DISABLE_PER_SUPPORT */
- 0, /* Use generic outmost tag fetcher */
+ 0 /* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_BIT_STRING = {
+ "BIT STRING",
+ "BIT_STRING",
+ &asn_OP_BIT_STRING,
+ BIT_STRING_constraint,
asn_DEF_BIT_STRING_tags,
sizeof(asn_DEF_BIT_STRING_tags)
/ sizeof(asn_DEF_BIT_STRING_tags[0]),