aboutsummaryrefslogtreecommitdiffstats
path: root/skeletons/NULL.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/NULL.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/NULL.c')
-rw-r--r--skeletons/NULL.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/skeletons/NULL.c b/skeletons/NULL.c
index b5991b8e..b465ee9c 100644
--- a/skeletons/NULL.c
+++ b/skeletons/NULL.c
@@ -13,9 +13,7 @@
static const ber_tlv_tag_t asn_DEF_NULL_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (5 << 2))
};
-asn_TYPE_descriptor_t asn_DEF_NULL = {
- "NULL",
- "NULL",
+asn_TYPE_operation_t asn_OP_NULL = {
BOOLEAN_free,
NULL_print,
NULL_compare,
@@ -38,7 +36,13 @@ asn_TYPE_descriptor_t asn_DEF_NULL = {
NULL_decode_uper, /* Unaligned PER decoder */
NULL_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_NULL = {
+ "NULL",
+ "NULL",
+ &asn_OP_NULL,
+ asn_generic_no_constraint,
asn_DEF_NULL_tags,
sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]),
asn_DEF_NULL_tags, /* Same as above */