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/per_opentype.c b/skeletons/per_opentype.c
index 589bb4a..2ccaf39 100644
--- a/skeletons/per_opentype.c
+++ b/skeletons/per_opentype.c
@@ -103,7 +103,7 @@
spd.nbits = bufLen << 3;
ASN_DEBUG_INDENT_ADD(+4);
- rv = td->uper_decoder(ctx, td, constraints, sptr, &spd);
+ rv = td->op->uper_decoder(ctx, td, constraints, sptr, &spd);
ASN_DEBUG_INDENT_ADD(-4);
if(rv.code == RC_OK) {
@@ -155,7 +155,7 @@
pd->moved = 0; /* This now counts the open type size in bits */
ASN_DEBUG_INDENT_ADD(+4);
- rv = td->uper_decoder(ctx, td, constraints, sptr, pd);
+ rv = td->op->uper_decoder(ctx, td, constraints, sptr, pd);
ASN_DEBUG_INDENT_ADD(-4);
#define UPDRESTOREPD do { \
@@ -257,7 +257,7 @@
asn_dec_rval_t rv;
s_td.name = "<unknown extension>";
- s_td.uper_decoder = uper_sot_suck;
+ s_td.op->uper_decoder = uper_sot_suck;
rv = uper_open_type_get(ctx, &s_td, 0, 0, pd);
if(rv.code != RC_OK)