remark release date
[Net-Radio-Location-SUPL-Test.git] / asn1 / IntervalTime.c
blobfd702ffe1fd3f12ffd496002f13d32dda7d04118
1 /*
2 * Generated by asn1c-0.9.23 (http://lionet.info/asn1c)
3 * From ASN.1 module "MAP-LCS-DataTypes"
4 * found in "../asn1src/MAP-LCS-DataTypes.asn"
5 * `asn1c -gen-PER -fskeletons-copy -fnative-types`
6 */
8 #include "IntervalTime.h"
10 int
11 IntervalTime_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
12 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
13 long value;
15 if(!sptr) {
16 _ASN_CTFAIL(app_key, td, sptr,
17 "%s: value not given (%s:%d)",
18 td->name, __FILE__, __LINE__);
19 return -1;
22 value = *(const long *)sptr;
24 if((value >= 1 && value <= 32767)) {
25 /* Constraint check succeeded */
26 return 0;
27 } else {
28 _ASN_CTFAIL(app_key, td, sptr,
29 "%s: constraint failed (%s:%d)",
30 td->name, __FILE__, __LINE__);
31 return -1;
36 * This type is implemented using NativeInteger,
37 * so here we adjust the DEF accordingly.
39 static void
40 IntervalTime_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
41 td->free_struct = asn_DEF_NativeInteger.free_struct;
42 td->print_struct = asn_DEF_NativeInteger.print_struct;
43 td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
44 td->der_encoder = asn_DEF_NativeInteger.der_encoder;
45 td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
46 td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
47 td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
48 td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
49 if(!td->per_constraints)
50 td->per_constraints = asn_DEF_NativeInteger.per_constraints;
51 td->elements = asn_DEF_NativeInteger.elements;
52 td->elements_count = asn_DEF_NativeInteger.elements_count;
53 td->specifics = asn_DEF_NativeInteger.specifics;
56 void
57 IntervalTime_free(asn_TYPE_descriptor_t *td,
58 void *struct_ptr, int contents_only) {
59 IntervalTime_1_inherit_TYPE_descriptor(td);
60 td->free_struct(td, struct_ptr, contents_only);
63 int
64 IntervalTime_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
65 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
66 IntervalTime_1_inherit_TYPE_descriptor(td);
67 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
70 asn_dec_rval_t
71 IntervalTime_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
72 void **structure, const void *bufptr, size_t size, int tag_mode) {
73 IntervalTime_1_inherit_TYPE_descriptor(td);
74 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
77 asn_enc_rval_t
78 IntervalTime_encode_der(asn_TYPE_descriptor_t *td,
79 void *structure, int tag_mode, ber_tlv_tag_t tag,
80 asn_app_consume_bytes_f *cb, void *app_key) {
81 IntervalTime_1_inherit_TYPE_descriptor(td);
82 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
85 asn_dec_rval_t
86 IntervalTime_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
87 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
88 IntervalTime_1_inherit_TYPE_descriptor(td);
89 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
92 asn_enc_rval_t
93 IntervalTime_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
94 int ilevel, enum xer_encoder_flags_e flags,
95 asn_app_consume_bytes_f *cb, void *app_key) {
96 IntervalTime_1_inherit_TYPE_descriptor(td);
97 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
100 asn_dec_rval_t
101 IntervalTime_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
102 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
103 IntervalTime_1_inherit_TYPE_descriptor(td);
104 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
107 asn_enc_rval_t
108 IntervalTime_encode_uper(asn_TYPE_descriptor_t *td,
109 asn_per_constraints_t *constraints,
110 void *structure, asn_per_outp_t *per_out) {
111 IntervalTime_1_inherit_TYPE_descriptor(td);
112 return td->uper_encoder(td, constraints, structure, per_out);
115 static asn_per_constraints_t asn_PER_type_IntervalTime_constr_1 = {
116 { APC_CONSTRAINED, 15, 15, 1, 32767 } /* (1..32767) */,
117 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
118 0, 0 /* No PER value map */
120 static ber_tlv_tag_t asn_DEF_IntervalTime_tags_1[] = {
121 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
123 asn_TYPE_descriptor_t asn_DEF_IntervalTime = {
124 "IntervalTime",
125 "IntervalTime",
126 IntervalTime_free,
127 IntervalTime_print,
128 IntervalTime_constraint,
129 IntervalTime_decode_ber,
130 IntervalTime_encode_der,
131 IntervalTime_decode_xer,
132 IntervalTime_encode_xer,
133 IntervalTime_decode_uper,
134 IntervalTime_encode_uper,
135 0, /* Use generic outmost tag fetcher */
136 asn_DEF_IntervalTime_tags_1,
137 sizeof(asn_DEF_IntervalTime_tags_1)
138 /sizeof(asn_DEF_IntervalTime_tags_1[0]), /* 1 */
139 asn_DEF_IntervalTime_tags_1, /* Same as above */
140 sizeof(asn_DEF_IntervalTime_tags_1)
141 /sizeof(asn_DEF_IntervalTime_tags_1[0]), /* 1 */
142 &asn_PER_type_IntervalTime_constr_1,
143 0, 0, /* No members */
144 0 /* No specifics */