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/REAL.c b/skeletons/REAL.c
index c510db5..e31e1ad 100644
--- a/skeletons/REAL.c
+++ b/skeletons/REAL.c
@@ -41,41 +41,45 @@
static const ber_tlv_tag_t asn_DEF_REAL_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (9 << 2))
};
-asn_TYPE_descriptor_t asn_DEF_REAL = {
- "REAL",
- "REAL",
- ASN__PRIMITIVE_TYPE_free,
- REAL_print,
- REAL_compare,
- asn_generic_no_constraint,
- ber_decode_primitive,
- der_encode_primitive,
- REAL_decode_xer,
- REAL_encode_xer,
+asn_TYPE_operation_t asn_OP_REAL = {
+ ASN__PRIMITIVE_TYPE_free,
+ REAL_print,
+ REAL_compare,
+ asn_generic_no_constraint,
+ ber_decode_primitive,
+ der_encode_primitive,
+ REAL_decode_xer,
+ REAL_encode_xer,
#ifdef ASN_DISABLE_OER_SUPPORT
- 0,
- 0,
+ 0,
+ 0,
#else
- 0,
- 0,
+ 0,
+ 0,
#endif /* ASN_DISABLE_OER_SUPPORT */
#ifdef ASN_DISABLE_PER_SUPPORT
- 0,
- 0,
+ 0,
+ 0,
#else
- REAL_decode_uper,
- REAL_encode_uper,
+ REAL_decode_uper,
+ REAL_encode_uper,
#endif /* ASN_DISABLE_PER_SUPPORT */
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_REAL_tags,
- sizeof(asn_DEF_REAL_tags) / sizeof(asn_DEF_REAL_tags[0]),
- asn_DEF_REAL_tags, /* Same as above */
- sizeof(asn_DEF_REAL_tags) / sizeof(asn_DEF_REAL_tags[0]),
- 0, /* No OER visible constraints */
- 0, /* No PER visible constraints */
- 0,
- 0, /* No members */
- 0 /* No specifics */
+ 0 /* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_REAL = {
+ "REAL",
+ "REAL",
+ &asn_OP_REAL,
+ asn_generic_no_constraint,
+ asn_DEF_REAL_tags,
+ sizeof(asn_DEF_REAL_tags) / sizeof(asn_DEF_REAL_tags[0]),
+ asn_DEF_REAL_tags, /* Same as above */
+ sizeof(asn_DEF_REAL_tags) / sizeof(asn_DEF_REAL_tags[0]),
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ 0,
+ 0, /* No members */
+ 0 /* No specifics */
};
typedef enum specialRealValue {