aboutsummaryrefslogtreecommitdiffstats
path: root/skeletons/NativeReal.c
diff options
context:
space:
mode:
authorBi-Ruei, Chiu <biruei.chiu@gmail.com>2017-08-20 01:25:45 +0800
committerBi-Ruei, Chiu <biruei.chiu@gmail.com>2017-08-24 14:09:28 +0800
commit1f87ac0058bdf5345cc8dff5d98df09405e3dd2c (patch)
tree03f0e3f57b698d7b0f0d8dcc9a71e7c1041b305f /skeletons/NativeReal.c
parentfadb26aaf14e07accdee7b656bda36644a91d7ad (diff)
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.
Diffstat (limited to 'skeletons/NativeReal.c')
-rw-r--r--skeletons/NativeReal.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/skeletons/NativeReal.c b/skeletons/NativeReal.c
index f305d8bd..af71027b 100644
--- a/skeletons/NativeReal.c
+++ b/skeletons/NativeReal.c
@@ -21,9 +21,7 @@
static const ber_tlv_tag_t asn_DEF_NativeReal_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (9 << 2))
};
-asn_TYPE_descriptor_t asn_DEF_NativeReal = {
- "REAL", /* The ASN.1 type is still REAL */
- "REAL",
+asn_TYPE_operation_t asn_OP_NativeReal = {
NativeReal_free,
NativeReal_print,
NativeReal_compare,
@@ -46,7 +44,13 @@ asn_TYPE_descriptor_t asn_DEF_NativeReal = {
NativeReal_decode_uper,
NativeReal_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_NativeReal = {
+ "REAL", /* The ASN.1 type is still REAL */
+ "REAL",
+ &asn_OP_NativeReal,
+ asn_generic_no_constraint,
asn_DEF_NativeReal_tags,
sizeof(asn_DEF_NativeReal_tags) / sizeof(asn_DEF_NativeReal_tags[0]),
asn_DEF_NativeReal_tags, /* Same as above */