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/UTCTime.c b/skeletons/UTCTime.c
index 04776d7..61caf2e 100644
--- a/skeletons/UTCTime.c
+++ b/skeletons/UTCTime.c
@@ -28,9 +28,7 @@
{ APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, /* Size */
0, 0
};
-asn_TYPE_descriptor_t asn_DEF_UTCTime = {
- "UTCTime",
- "UTCTime",
+asn_TYPE_operation_t asn_OP_UTCTime = {
OCTET_STRING_free,
UTCTime_print,
OCTET_STRING_compare, /* Does not deal with time zones. */
@@ -53,7 +51,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_UTCTime = {
+ "UTCTime",
+ "UTCTime",
+ &asn_OP_UTCTime,
+ UTCTime_constraint,
asn_DEF_UTCTime_tags,
sizeof(asn_DEF_UTCTime_tags)
/ sizeof(asn_DEF_UTCTime_tags[0]) - 2,