+/*-\r
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.\r
+ * Redistribution and modifications are permitted subject to BSD license.\r
+ */\r
+#ifndef ASN_CODECS_PRIM_H\r
+#define ASN_CODECS_PRIM_H\r
+\r
+#include <asn_application.h>\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+typedef struct ASN__PRIMITIVE_TYPE_s {\r
+ uint8_t *buf; /* Buffer with consecutive primitive encoding bytes */\r
+ size_t size; /* Size of the buffer */\r
+} ASN__PRIMITIVE_TYPE_t; /* Do not use this type directly! */\r
+\r
+asn_struct_free_f ASN__PRIMITIVE_TYPE_free;\r
+ber_type_decoder_f ber_decode_primitive;\r
+der_type_encoder_f der_encode_primitive;\r
+\r
+/*\r
+ * A callback specification for the xer_decode_primitive() function below.\r
+ */\r
+enum xer_pbd_rval {\r
+ XPBD_SYSTEM_FAILURE, /* System failure (memory shortage, etc) */\r
+ XPBD_DECODER_LIMIT, /* Hit some decoder limitation or deficiency */\r
+ XPBD_BROKEN_ENCODING, /* Encoding of a primitive body is broken */\r
+ XPBD_NOT_BODY_IGNORE, /* Not a body format, but safe to ignore */\r
+ XPBD_BODY_CONSUMED /* Body is recognized and consumed */\r
+};\r
+typedef enum xer_pbd_rval(xer_primitive_body_decoder_f)(\r
+ const asn_TYPE_descriptor_t *td, void *struct_ptr, const void *chunk_buf,\r
+ size_t chunk_size);\r
+\r
+/*\r
+ * Specific function to decode simple primitive types.\r
+ * Also see xer_decode_general() in xer_decoder.h\r
+ */\r
+asn_dec_rval_t xer_decode_primitive(\r
+ const asn_codec_ctx_t *opt_codec_ctx,\r
+ const asn_TYPE_descriptor_t *type_descriptor, void **struct_ptr,\r
+ size_t struct_size, const char *opt_mname, const void *buf_ptr, size_t size,\r
+ xer_primitive_body_decoder_f *prim_body_decoder);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* ASN_CODECS_PRIM_H */\r