| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#ifndef _XER_DECODER_H_ |
| 6 |
#define _XER_DECODER_H_ |
| 7 |
|
| 8 |
#include <asn_application.h> |
| 9 |
|
| 10 |
#ifdef __cplusplus |
| 11 |
extern "C" { |
| 12 |
#endif |
| 13 |
|
| 14 |
struct asn_TYPE_descriptor_s; |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
asn_dec_rval_t xer_decode(struct asn_codec_ctx_s *opt_codec_ctx, |
| 20 |
struct asn_TYPE_descriptor_s *type_descriptor, |
| 21 |
void **struct_ptr, |
| 22 |
const void *buffer, |
| 23 |
size_t size |
| 24 |
); |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
typedef asn_dec_rval_t (xer_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx, |
| 30 |
struct asn_TYPE_descriptor_s *type_descriptor, |
| 31 |
void **struct_ptr, |
| 32 |
const char *opt_mname, |
| 33 |
const void *buf_ptr, size_t size |
| 34 |
); |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
asn_dec_rval_t xer_decode_general(asn_codec_ctx_t *opt_codec_ctx, |
| 47 |
asn_struct_ctx_t *ctx, |
| 48 |
void *struct_key, |
| 49 |
const char *xml_tag, |
| 50 |
const void *buf_ptr, size_t size, |
| 51 |
int (*opt_unexpected_tag_decoder) |
| 52 |
(void *struct_key, const void *chunk_buf, size_t chunk_size), |
| 53 |
ssize_t (*body_receiver) |
| 54 |
(void *struct_key, const void *chunk_buf, size_t chunk_size, |
| 55 |
int have_more) |
| 56 |
); |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
typedef enum pxer_chunk_type { |
| 66 |
PXER_TAG, |
| 67 |
PXER_TEXT, |
| 68 |
PXER_COMMENT |
| 69 |
} pxer_chunk_type_e; |
| 70 |
ssize_t xer_next_token(int *stateContext, |
| 71 |
const void *buffer, size_t size, pxer_chunk_type_e *_ch_type); |
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
typedef enum xer_check_tag { |
| 77 |
XCT_BROKEN = 0, |
| 78 |
XCT_OPENING = 1, |
| 79 |
XCT_CLOSING = 2, |
| 80 |
XCT_BOTH = 3, |
| 81 |
XCT__UNK__MASK = 4, |
| 82 |
XCT_UNKNOWN_OP = 5, |
| 83 |
XCT_UNKNOWN_CL = 6, |
| 84 |
XCT_UNKNOWN_BO = 7 |
| 85 |
} xer_check_tag_e; |
| 86 |
xer_check_tag_e xer_check_tag(const void *buf_ptr, int size, |
| 87 |
const char *need_tag); |
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
int xer_is_whitespace(const void *chunk_buf, size_t chunk_size); |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
int xer_skip_unknown(xer_check_tag_e tcv, ber_tlv_len_t *depth); |
| 101 |
|
| 102 |
#ifdef __cplusplus |
| 103 |
} |
| 104 |
#endif |
| 105 |
|
| 106 |
#endif |