Adding initial code jy.oak@samsung.com
[ric-app/kpimon.git] / asn1c_defs / all-defs / asn_codecs_prim.h
1 /*-\r
2  * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.\r
3  * Redistribution and modifications are permitted subject to BSD license.\r
4  */\r
5 #ifndef ASN_CODECS_PRIM_H\r
6 #define ASN_CODECS_PRIM_H\r
7 \r
8 #include <asn_application.h>\r
9 \r
10 #ifdef __cplusplus\r
11 extern "C" {\r
12 #endif\r
13 \r
14 typedef struct ASN__PRIMITIVE_TYPE_s {\r
15     uint8_t *buf;   /* Buffer with consecutive primitive encoding bytes */\r
16     size_t size;    /* Size of the buffer */\r
17 } ASN__PRIMITIVE_TYPE_t;        /* Do not use this type directly! */\r
18 \r
19 asn_struct_free_f ASN__PRIMITIVE_TYPE_free;\r
20 ber_type_decoder_f ber_decode_primitive;\r
21 der_type_encoder_f der_encode_primitive;\r
22 \r
23 /*\r
24  * A callback specification for the xer_decode_primitive() function below.\r
25  */\r
26 enum xer_pbd_rval {\r
27     XPBD_SYSTEM_FAILURE,  /* System failure (memory shortage, etc) */\r
28     XPBD_DECODER_LIMIT,   /* Hit some decoder limitation or deficiency */\r
29     XPBD_BROKEN_ENCODING, /* Encoding of a primitive body is broken */\r
30     XPBD_NOT_BODY_IGNORE, /* Not a body format, but safe to ignore */\r
31     XPBD_BODY_CONSUMED    /* Body is recognized and consumed */\r
32 };\r
33 typedef enum xer_pbd_rval(xer_primitive_body_decoder_f)(\r
34     const asn_TYPE_descriptor_t *td, void *struct_ptr, const void *chunk_buf,\r
35     size_t chunk_size);\r
36 \r
37 /*\r
38  * Specific function to decode simple primitive types.\r
39  * Also see xer_decode_general() in xer_decoder.h\r
40  */\r
41 asn_dec_rval_t xer_decode_primitive(\r
42     const asn_codec_ctx_t *opt_codec_ctx,\r
43     const asn_TYPE_descriptor_t *type_descriptor, void **struct_ptr,\r
44     size_t struct_size, const char *opt_mname, const void *buf_ptr, size_t size,\r
45     xer_primitive_body_decoder_f *prim_body_decoder);\r
46 \r
47 #ifdef __cplusplus\r
48 }\r
49 #endif\r
50 \r
51 #endif  /* ASN_CODECS_PRIM_H */\r