Go to the documentation of this file.
10 #if !defined(ASN_DISABLE_PRINT_SUPPORT)
17 #if !defined(ASN_DISABLE_BER_SUPPORT)
24 #if !defined(ASN_DISABLE_XER_SUPPORT)
31 #if !defined(ASN_DISABLE_JER_SUPPORT)
38 #if !defined(ASN_DISABLE_OER_SUPPORT)
45 #if !defined(ASN_DISABLE_UPER_SUPPORT)
52 #if !defined(ASN_DISABLE_APER_SUPPORT)
59 #if !defined(ASN_DISABLE_RFILL_SUPPORT)
72 assert(tag_mode == 0); (void)tag_mode;
73 assert(tag == 0); (void)tag;
80 if(present > 0 && present <= td->elements_count) {
85 memb_ptr = *(
const void *
const *)
88 memb_ptr = (
const void *)
115 "%s: value not given (%s:%d)",
116 td->
name, __FILE__, __LINE__);
124 if(present > 0 && present <= td->elements_count) {
126 const void *memb_ptr;
129 memb_ptr = *(
const void *
const *)((
const char *)sptr + elm->
memb_offset);
134 "%s: mandatory CHOICE element %s absent (%s:%d)",
135 td->
name, elm->
name, __FILE__, __LINE__);
139 memb_ptr = (
const void *)((
const char *)sptr + elm->
memb_offset);
147 memb_ptr, ctfailcb, app_key);
151 "%s: no CHOICE element given (%s:%d)",
152 td->
name, __FILE__, __LINE__);
168 ASN_DEBUG(
"Freeing %s as CHOICE", td->
name);
178 if(present > 0 && present <= td->elements_count) {
183 memb_ptr = *(
void **)((
char *)ptr + elm->
memb_offset);
187 memb_ptr = (
void *)((
char *)ptr + elm->
memb_offset);
216 unsigned pres_size) {
217 const void *present_ptr;
220 present_ptr = ((
const char *)struct_ptr) + pres_offset;
223 case sizeof(int): present = *(
const unsigned int *)present_ptr;
break;
224 case sizeof(short): present = *(
const unsigned short *)present_ptr;
break;
225 case sizeof(char): present = *(
const unsigned char *)present_ptr;
break;
228 assert(pres_size !=
sizeof(
int));
239 present_ptr = ((
char *)struct_ptr) + pres_offset;
242 case sizeof(int): *(
unsigned int *)present_ptr = present;
break;
243 case sizeof(short): *(
unsigned short *)present_ptr = present;
break;
244 case sizeof(char): *(
unsigned char *)present_ptr = present;
break;
247 assert(pres_size !=
sizeof(
int));
268 *present_out = present;
274 if(present > 0 && present <= td->elements_count) {
276 const void *memb_ptr;
280 *(
const void *
const *)((
const char *)sptr + elm->
memb_offset);
282 memb_ptr = (
const void *)((
const char *)sptr + elm->
memb_offset);
297 unsigned apresent = 0;
298 unsigned bpresent = 0;
302 if(amember && bmember) {
303 if(apresent == bpresent) {
304 assert(aelm == belm);
306 }
else if(apresent < bpresent) {
311 }
else if(!amember) {
348 if(present <= 0 && (
unsigned)present > td->
elements_count)
return -1;
354 amembp = (
void **)((
char *)st + elm->memb_offset);
355 bmemb = *(
const void*
const*)((
const char*)bptr + elm->memb_offset);
359 bmemb = (
const void*)((
const char*)bptr + elm->memb_offset);
361 ret = elm->type->op->copy_struct(elm->type, amembp, bmemb);
362 if (ret != 0)
return ret;
393 unsigned old_present;
404 if(present == old_present)
407 if(old_present != 0) {
408 assert(old_present <= td->elements_count);
xer_type_encoder_f CHOICE_encode_xer
#define ASN_STRUCT_FREE(asn_DEF, ptr)
asn_outmost_tag_f asn_TYPE_outmost_tag
per_type_encoder_f CHOICE_encode_uper
int CHOICE_variant_set_presence(const asn_TYPE_descriptor_t *td, void *sptr, unsigned present)
void() asn_app_constraint_failed_f(void *application_specific_key, const struct asn_TYPE_descriptor_s *type_descriptor_which_failed, const void *structure_which_failed_ptr, const char *error_message_format,...) CC_PRINTFLIKE(4
per_type_decoder_f CHOICE_decode_aper
jer_type_decoder_f CHOICE_decode_jer
int CHOICE_copy(const asn_TYPE_descriptor_t *td, void **aptr, const void *bptr)
per_type_encoder_f CHOICE_encode_aper
int CHOICE_compare(const asn_TYPE_descriptor_t *td, const void *aptr, const void *bptr)
der_type_encoder_f CHOICE_encode_der
int CHOICE_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key)
#define CALLOC(nmemb, size)
@ ASFM_FREE_UNDERLYING_AND_RESET
#define ASN_STRUCT_RESET(asn_DEF, ptr)
oer_type_encoder_f CHOICE_encode_oer
oer_type_decoder_f CHOICE_decode_oer
asn_TYPE_descriptor_t * type
ber_type_decoder_f CHOICE_decode_ber
asn_TYPE_operation_t * op
asn_struct_print_f CHOICE_print
ber_tlv_tag_t CHOICE_outmost_tag(const asn_TYPE_descriptor_t *td, const void *ptr, int tag_mode, ber_tlv_tag_t tag)
asn_struct_compare_f * compare_struct
struct asn_TYPE_member_s * elements
asn_constr_check_f * general_constraints
unsigned _fetch_present_idx(const void *struct_ptr, unsigned pres_offset, unsigned pres_size)
asn_TYPE_operation_t asn_OP_CHOICE
asn_random_fill_f CHOICE_random_fill
asn_encoding_constraints_t encoding_constraints
xer_type_decoder_f CHOICE_decode_xer
enum asn_TYPE_flags_e flags
unsigned CHOICE_variant_get_presence(const asn_TYPE_descriptor_t *td, const void *sptr)
void _set_present_idx(void *struct_ptr, unsigned pres_offset, unsigned pres_size, unsigned present)
#define ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF, ptr)
jer_type_encoder_f CHOICE_encode_jer
void CHOICE_free(const asn_TYPE_descriptor_t *td, void *ptr, enum asn_struct_free_method method)
static const void * _get_member_ptr(const asn_TYPE_descriptor_t *, const void *sptr, asn_TYPE_member_t **elm, unsigned *present)
asn_encoding_constraints_t encoding_constraints
per_type_decoder_f CHOICE_decode_uper
etsi_its_spatem_ts_coding
Author(s): Jean-Pierre Busch
, Guido Küppers , Lennart Reiher
autogenerated on Sun May 18 2025 02:29:28