18 void *memb_ptr = NULL;
19 void **memb_ptr2 = NULL;
34 if(constraints) ct = &constraints->
value;
39 if(ct && ct->flags & APC_EXTENSIBLE) {
47 if(ct && ct->range_bits >= 0) {
50 ASN_DEBUG(
"CHOICE %s got index %d in range %d",
51 td->
name, value, ct->range_bits);
52 if(value > ct->upper_bound)
69 ASN_DEBUG(
"CHOICE presence from wire %d", value);
71 ASN_DEBUG(
"CHOICE presence index effective %d", value);
80 memb_ptr2 = (
void **)((
char *)st + elm->memb_offset);
83 memb_ptr2 = &memb_ptr;
85 ASN_DEBUG(
"Discovered CHOICE %s encodes %s", td->
name, elm->name);
87 if(ct && ct->range_bits >= 0) {
88 rv = elm->type->op->aper_decoder(opt_codec_ctx, elm->type,
89 elm->encoding_constraints.per_constraints, memb_ptr2, pd);
92 elm->encoding_constraints.per_constraints, memb_ptr2, pd);
96 ASN_DEBUG(
"Failed to decode %s in %s (CHOICE) %d",
97 elm->name, td->
name, rv.code);
108 const void *memb_ptr;
114 ASN_DEBUG(
"Encoding %s as CHOICE using ALIGNED PER", td->
name);
116 if(constraints) ct = &constraints->
value;
137 present_enc = present;
139 ASN_DEBUG(
"Encoding %s CHOICE element %d", td->
name, present);
141 if(ct && ct->range_bits >= 0) {
142 if(present_enc < ct->lower_bound
143 || present_enc > ct->upper_bound) {
144 if(ct->flags & APC_EXTENSIBLE) {
147 present, present_enc, ct->lower_bound, ct->upper_bound);
156 if(ct && ct->flags & APC_EXTENSIBLE) {
158 present, present_enc, ct->lower_bound, ct->upper_bound);
164 ASN_DEBUG(
"CHOICE member \"%s\" %d (as %d)", elm->name, present,
168 memb_ptr = *(
const void *
const *)((
const char *)sptr + elm->memb_offset);
171 memb_ptr = (
const char *)sptr + elm->memb_offset;
174 if(ct && ct->range_bits >= 0) {
178 return elm->type->op->aper_encoder(elm->type, elm->encoding_constraints.per_constraints,