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/tests/tests-c-compiler/check-src/check-41.c b/tests/tests-c-compiler/check-src/check-41.c
index 1c1b907..c1efbd2 100644
--- a/tests/tests-c-compiler/check-src/check-41.c
+++ b/tests/tests-c-compiler/check-src/check-41.c
@@ -188,7 +188,7 @@
assert(rval.code == RC_OK);
assert(rval.consumed == size3);
- asn_DEF_T.free_struct(&asn_DEF_T, &t, 1);
+ ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_T, &t);
}
}
}
@@ -204,13 +204,13 @@
check(&t, buf1, sizeof(buf1), sizeof(buf1));
compare(&t, buf1_reconstr, sizeof(buf1_reconstr));
asn_fprint(stderr, &asn_DEF_T, &t);
- asn_DEF_T.free_struct(&asn_DEF_T, &t, 1);
+ ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_T, &t);
/* Check slightly more than buf1 */
check(&t, buf1, sizeof(buf1) + 10, sizeof(buf1));
compare(&t, buf1_reconstr, sizeof(buf1_reconstr));
asn_fprint(stderr, &asn_DEF_T, &t);
- asn_DEF_T.free_struct(&asn_DEF_T, &t, 1);
+ ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_T, &t);
/* Split the buffer in parts and check decoder restartability */
partial_read(buf1, sizeof(buf1));