Debian Codegraph @

biosig4c++/t240/INT-U8.c

raw symbols SCIP
1 /*
2 * Generated by asn1c-0.9.21 (http://lionet.info/asn1c)
3 * From ASN.1 module "FEF-IntermediateDraft"
4 * found in "../annexb-snacc-122001.asn1"
5 */
6
7 #include <asn_internal.h>
8
9 #include "INT-U8.h"
10
11 int
12 INT_U8_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
13 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
14 long value;
15
16 if(!sptr) {
17 _ASN_CTFAIL(app_key, td, sptr,
18 "%s: value not given (%s:%d)",
19 td->name, __FILE__, __LINE__);
20 return -1;
21 }
22
23 value = *(const long *)sptr;
24
25 if((value >= 0 && value <= 255)) {
26 /* Constraint check succeeded */
27 return 0;
28 } else {
29 _ASN_CTFAIL(app_key, td, sptr,
30 "%s: constraint failed (%s:%d)",
31 td->name, __FILE__, __LINE__);
32 return -1;
33 }
34 }
35
36 /*
37 * This type is implemented using NativeInteger,
38 * so here we adjust the DEF accordingly.
39 */
40 static void
41 INT_U8_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
42 td->free_struct = asn_DEF_NativeInteger.free_struct;
43 td->print_struct = asn_DEF_NativeInteger.print_struct;
44 td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
45 td->der_encoder = asn_DEF_NativeInteger.der_encoder;
46 td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
47 td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
48 td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
49 td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
50 if(!td->per_constraints)
51 td->per_constraints = asn_DEF_NativeInteger.per_constraints;
52 td->elements = asn_DEF_NativeInteger.elements;
53 td->elements_count = asn_DEF_NativeInteger.elements_count;
54 td->specifics = asn_DEF_NativeInteger.specifics;
55 }
56
57 void
58 INT_U8_free(asn_TYPE_descriptor_t *td,
59 void *struct_ptr, int contents_only) {
60 INT_U8_1_inherit_TYPE_descriptor(td);
61 td->free_struct(td, struct_ptr, contents_only);
62 }
63
64 int
65 INT_U8_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
66 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
67 INT_U8_1_inherit_TYPE_descriptor(td);
68 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
69 }
70
71 asn_dec_rval_t
72 INT_U8_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
73 void **structure, const void *bufptr, size_t size, int tag_mode) {
74 INT_U8_1_inherit_TYPE_descriptor(td);
75 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
76 }
77
78 asn_enc_rval_t
79 INT_U8_encode_der(asn_TYPE_descriptor_t *td,
80 void *structure, int tag_mode, ber_tlv_tag_t tag,
81 asn_app_consume_bytes_f *cb, void *app_key) {
82 INT_U8_1_inherit_TYPE_descriptor(td);
83 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
84 }
85
86 asn_dec_rval_t
87 INT_U8_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
88 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
89 INT_U8_1_inherit_TYPE_descriptor(td);
90 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
91 }
92
93 asn_enc_rval_t
94 INT_U8_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
95 int ilevel, enum xer_encoder_flags_e flags,
96 asn_app_consume_bytes_f *cb, void *app_key) {
97 INT_U8_1_inherit_TYPE_descriptor(td);
98 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
99 }
100
101 static ber_tlv_tag_t asn_DEF_INT_U8_tags_1[] = {
102 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
103 };
104 asn_TYPE_descriptor_t asn_DEF_INT_U8 = {
105 "INT-U8",
106 "INT-U8",
107 INT_U8_free,
108 INT_U8_print,
109 INT_U8_constraint,
110 INT_U8_decode_ber,
111 INT_U8_encode_der,
112 INT_U8_decode_xer,
113 INT_U8_encode_xer,
114 0, 0, /* No PER support, use "-gen-PER" to enable */
115 0, /* Use generic outmost tag fetcher */
116 asn_DEF_INT_U8_tags_1,
117 sizeof(asn_DEF_INT_U8_tags_1)
118 /sizeof(asn_DEF_INT_U8_tags_1[0]), /* 1 */
119 asn_DEF_INT_U8_tags_1, /* Same as above */
120 sizeof(asn_DEF_INT_U8_tags_1)
121 /sizeof(asn_DEF_INT_U8_tags_1[0]), /* 1 */
122 0, /* No PER visible constraints */
123 0, 0, /* No members */
124 0 /* No specifics */
125 };
126