constr_CHOICE.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
3  * Redistribution and modifications are permitted subject to BSD license.
4  */
5 #ifndef _CONSTR_CHOICE_H_
6 #define _CONSTR_CHOICE_H_
7 
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 typedef struct asn_CHOICE_specifics_s {
15  /*
16  * Target structure description.
17  */
18  unsigned struct_size; /* Size of the target structure. */
19  unsigned ctx_offset; /* Offset of the asn_codec_ctx_t member */
20  unsigned pres_offset; /* Identifier of the present member */
21  unsigned pres_size; /* Size of the identifier (enum) */
22 
23  /*
24  * Tags to members mapping table.
25  */
27  unsigned tag2el_count;
28 
29  /* Canonical ordering of CHOICE elements, for PER */
30  const unsigned *to_canonical_order;
31  const unsigned *from_canonical_order;
32 
33  /*
34  * Extensions-related stuff.
35  */
36  signed ext_start; /* First member of extensions, or -1 */
38 
39 /*
40  * A set specialized functions dealing with the CHOICE type.
41  */
43 
44 #if !defined(ASN_DISABLE_PRINT_SUPPORT)
46 #endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
47 
50 
52 
53 #if !defined(ASN_DISABLE_BER_SUPPORT)
54 ber_type_decoder_f CHOICE_decode_ber;
55 der_type_encoder_f CHOICE_encode_der;
56 #endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
57 
58 #if !defined(ASN_DISABLE_XER_SUPPORT)
59 xer_type_decoder_f CHOICE_decode_xer;
60 xer_type_encoder_f CHOICE_encode_xer;
61 #endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
62 
63 #if !defined(ASN_DISABLE_JER_SUPPORT)
66 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
67 
68 #if !defined(ASN_DISABLE_OER_SUPPORT)
69 oer_type_decoder_f CHOICE_decode_oer;
70 oer_type_encoder_f CHOICE_encode_oer;
71 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
72 
73 #if !defined(ASN_DISABLE_UPER_SUPPORT)
76 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
77 #if !defined(ASN_DISABLE_APER_SUPPORT)
80 #endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
81 
82 #if !defined(ASN_DISABLE_RFILL_SUPPORT)
84 #endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
85 
87 
89 
90 unsigned _fetch_present_idx(
91  const void *struct_ptr,
92  unsigned off,
93  unsigned size);
94 
95 void _set_present_idx(
96  void *sptr,
97  unsigned offset,
98  unsigned size,
99  unsigned present);
100 
101 /*
102  * Return the 1-based choice variant presence index.
103  * Returns 0 in case of error.
104  */
106  const void *structure_ptr);
107 
108 /*
109  * Sets or resets the 1-based choice variant presence index.
110  * In case a previous index is not zero, the currently selected structure
111  * member is freed and zeroed-out first.
112  * Returns 0 on success and -1 on error.
113  */
115  void *structure_ptr, unsigned present);
116 
117 #ifdef __cplusplus
118 }
119 #endif
120 
121 #endif /* _CONSTR_CHOICE_H_ */
CHOICE_encode_xer
xer_type_encoder_f CHOICE_encode_xer
Definition: constr_CHOICE.h:60
asn_CHOICE_specifics_t
struct asn_CHOICE_specifics_s asn_CHOICE_specifics_t
asn_OP_CHOICE
asn_TYPE_operation_t asn_OP_CHOICE
Definition: constr_CHOICE.c:8
per_type_decoder_f
asn_dec_rval_t() per_type_decoder_f(const asn_codec_ctx_t *opt_codec_ctx, const struct asn_TYPE_descriptor_s *type_descriptor, const asn_per_constraints_t *constraints, void **struct_ptr, asn_per_data_t *per_data)
Definition: per_decoder.h:20
asn_TYPE_operation_s
Definition: constr_TYPE.h:184
CHOICE_encode_uper
per_type_encoder_f CHOICE_encode_uper
Definition: constr_CHOICE.h:75
asn_struct_print_f
int() asn_struct_print_f(const struct asn_TYPE_descriptor_s *type_descriptor, const void *struct_ptr, int level, asn_app_consume_bytes_f *callback, void *app_key)
Definition: constr_TYPE.h:129
asn_random_fill_f
asn_random_fill_result_t() asn_random_fill_f(const struct asn_TYPE_descriptor_s *td, void **struct_ptr, const struct asn_encoding_constraints_s *memb_constraints, size_t max_length)
Definition: asn_random_fill.h:32
CHOICE_decode_aper
per_type_decoder_f CHOICE_decode_aper
Definition: constr_CHOICE.h:78
CHOICE_decode_jer
jer_type_decoder_f CHOICE_decode_jer
Definition: constr_CHOICE.h:64
asn_struct_compare_f
int() asn_struct_compare_f(const struct asn_TYPE_descriptor_s *type_descriptor, const void *struct_A, const void *struct_B)
Definition: constr_TYPE.h:141
CHOICE_encode_aper
per_type_encoder_f CHOICE_encode_aper
Definition: constr_CHOICE.h:79
CHOICE_variant_get_presence
unsigned CHOICE_variant_get_presence(const asn_TYPE_descriptor_t *td, const void *structure_ptr)
Definition: constr_CHOICE.c:376
CHOICE_encode_der
der_type_encoder_f CHOICE_encode_der
Definition: constr_CHOICE.h:55
asn_CHOICE_specifics_s::ctx_offset
unsigned ctx_offset
Definition: constr_CHOICE.h:19
asn_CHOICE_specifics_s::struct_size
unsigned struct_size
Definition: constr_CHOICE.h:18
asn_CHOICE_specifics_s
Definition: constr_CHOICE.h:14
CHOICE_encode_oer
oer_type_encoder_f CHOICE_encode_oer
Definition: constr_CHOICE.h:70
CHOICE_free
asn_struct_free_f CHOICE_free
Definition: constr_CHOICE.h:42
asn_TYPE_tag2member_s
Definition: constr_TYPE.h:289
asn_CHOICE_specifics_s::tag2el_count
unsigned tag2el_count
Definition: constr_CHOICE.h:27
CHOICE_decode_oer
oer_type_decoder_f CHOICE_decode_oer
Definition: constr_CHOICE.h:69
CHOICE_variant_set_presence
int CHOICE_variant_set_presence(const asn_TYPE_descriptor_t *td, void *structure_ptr, unsigned present)
Definition: constr_CHOICE.c:389
_set_present_idx
void _set_present_idx(void *sptr, unsigned offset, unsigned size, unsigned present)
Definition: constr_CHOICE.c:236
asn_TYPE_descriptor_s
Definition: constr_TYPE.h:224
jer_type_encoder_f
asn_enc_rval_t() jer_type_encoder_f(const struct asn_TYPE_descriptor_s *type_descriptor, const asn_jer_constraints_t *constraints, const void *struct_ptr, int ilevel, enum jer_encoder_flags_e jer_flags, asn_app_consume_bytes_f *consume_bytes_cb, void *app_key)
Definition: jer_encoder.h:73
CHOICE_compare
asn_struct_compare_f CHOICE_compare
Definition: constr_CHOICE.h:48
CHOICE_decode_ber
ber_type_decoder_f CHOICE_decode_ber
Definition: constr_CHOICE.h:54
asn_CHOICE_specifics_s::pres_offset
unsigned pres_offset
Definition: constr_CHOICE.h:20
asn_CHOICE_specifics_s::ext_start
signed ext_start
Definition: constr_CHOICE.h:36
jer_type_decoder_f
asn_dec_rval_t() jer_type_decoder_f(const asn_codec_ctx_t *opt_codec_ctx, const struct asn_TYPE_descriptor_s *type_descriptor, const asn_jer_constraints_t *constraints, void **struct_ptr, const void *buf_ptr, size_t size)
Definition: jer_decoder.h:32
CHOICE_print
asn_struct_print_f CHOICE_print
Definition: constr_CHOICE.h:45
CHOICE_outmost_tag
asn_outmost_tag_f CHOICE_outmost_tag
Definition: constr_CHOICE.h:86
per_type_encoder_f
asn_enc_rval_t() per_type_encoder_f(const struct asn_TYPE_descriptor_s *type_descriptor, const asn_per_constraints_t *constraints, const void *struct_ptr, asn_per_outp_t *per_output)
Definition: per_encoder.h:20
asn_constr_check_f
int() asn_constr_check_f(const struct asn_TYPE_descriptor_s *type_descriptor, const void *struct_ptr, asn_app_constraint_failed_f *optional_callback, void *optional_app_key)
Definition: constraints.h:41
CHOICE_constraint
asn_constr_check_f CHOICE_constraint
Definition: constr_CHOICE.h:51
CHOICE_copy
asn_struct_copy_f CHOICE_copy
Definition: constr_CHOICE.h:49
asn_CHOICE_specifics_s::to_canonical_order
const unsigned * to_canonical_order
Definition: constr_CHOICE.h:30
asn_CHOICE_specifics_s::from_canonical_order
const unsigned * from_canonical_order
Definition: constr_CHOICE.h:31
asn_outmost_tag_f
ber_tlv_tag_t() asn_outmost_tag_f(const struct asn_TYPE_descriptor_s *type_descriptor, const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag)
Definition: constr_TYPE.h:162
_fetch_present_idx
unsigned _fetch_present_idx(const void *struct_ptr, unsigned off, unsigned size)
Definition: constr_CHOICE.c:215
CHOICE_random_fill
asn_random_fill_f CHOICE_random_fill
Definition: constr_CHOICE.h:83
asn_application.h
asn_CHOICE_specifics_s::tag2el
const asn_TYPE_tag2member_t * tag2el
Definition: constr_CHOICE.h:26
CHOICE_decode_xer
xer_type_decoder_f CHOICE_decode_xer
Definition: constr_CHOICE.h:59
asn_struct_copy_f
int() asn_struct_copy_f(const struct asn_TYPE_descriptor_s *type_descriptor, void **struct_A, const void *struct_B)
Definition: constr_TYPE.h:150
CHOICE_encode_jer
jer_type_encoder_f CHOICE_encode_jer
Definition: constr_CHOICE.h:65
asn_struct_free_f
void() asn_struct_free_f(const struct asn_TYPE_descriptor_s *type_descriptor, void *struct_ptr, enum asn_struct_free_method)
Definition: constr_TYPE.h:95
CHOICE_decode_uper
per_type_decoder_f CHOICE_decode_uper
Definition: constr_CHOICE.h:74
asn_CHOICE_specifics_s::pres_size
unsigned pres_size
Definition: constr_CHOICE.h:21


etsi_its_vam_ts_coding
Author(s): Jean-Pierre Busch , Guido Küppers , Lennart Reiher
autogenerated on Sun May 18 2025 02:30:55