Go to the documentation of this file.
16 const void *buffer,
size_t size) {
25 s_codec_ctx = *opt_codec_ctx;
26 opt_codec_ctx = &s_codec_ctx;
30 memset(&s_codec_ctx, 0,
sizeof(s_codec_ctx));
32 opt_codec_ctx = &s_codec_ctx;
38 return td->
op->
jer_decoder(opt_codec_ctx, td, 0, struct_ptr, buffer, size);
66 int new_stateContext = *stateContext;
71 if(ret < 0)
return -1;
104 *stateContext = new_stateContext;
117 const char *buf = (
const char *)buf_ptr;
121 switch(buf[size-1]) {
140 ASN_DEBUG(
"Broken JSON key: \"%c...%c\"",
141 buf[0], buf[size - 1]);
151 for(end = buf + size; buf < end; buf++, need_key++) {
152 int b = *buf, n = *need_key;
156 case 0x09:
case 0x0a:
case 0x0c:
case 0x0d:
175 #define ADVANCE(num_bytes) do { \
176 size_t num = (num_bytes); \
177 buf_ptr = ((const char *)buf_ptr) + num; \
179 consumed_myself += num; \
183 #define RETURN(_code) do { \
185 rval.consumed = consumed_myself; \
186 if(rval.code != RC_OK) \
187 ASN_DEBUG("Failed with %d", rval.code); \
191 #define JER_GOT_BODY(chunk_buf, chunk_size, size) do { \
192 ssize_t converted_size = body_receiver \
193 (struct_key, chunk_buf, chunk_size, \
194 (size_t)chunk_size <= size); \
195 if(converted_size == -1) RETURN(RC_FAIL); \
196 if(converted_size == 0 \
197 && size == (size_t)chunk_size) \
199 chunk_size = converted_size; \
201 #define JER_GOT_EMPTY() do { \
202 if(body_receiver(struct_key, 0, 0, size > 0) == -1) \
213 const void *buf_ptr,
size_t size,
214 int (*opt_unexpected_key_decoder)
216 ssize_t (*body_receiver)
222 ssize_t consumed_myself = 0;
225 (void)opt_unexpected_key_decoder;
275 const char *pend = (p == NULL)? NULL : p +
chunk_size;
277 for(; p < pend; p++) {
285 case 0x09:
case 0x0a:
case 0x0d:
case 0x20:
size_t jer_whitespace_span(const void *chunk_buf, size_t chunk_size)
enum pjer_chunk_type pjer_chunk_type_e
#define JER_GOT_BODY(chunk_buf, chunk_size, size)
static int jer__token_cb(pjson_chunk_type_e type, const void *_chunk_data, size_t _chunk_size, void *key)
asn_TYPE_operation_t * op
asn_dec_rval_t jer_decode(const asn_codec_ctx_t *opt_codec_ctx, const asn_TYPE_descriptor_t *td, void **struct_ptr, const void *buffer, size_t size)
ssize_t pjson_parse(int *_stateContext, const void *_buf, size_t _size, pjson_callback_f *cb, void *_key)
int jer_skip_unknown(jer_check_sym_e scv, ber_tlv_len_t *depth)
jer_type_decoder_f * jer_decoder
static void ssize_t void * key
asn_dec_rval_t jer_decode_general(const asn_codec_ctx_t *opt_codec_ctx, asn_struct_ctx_t *ctx, void *struct_key, const void *buf_ptr, size_t size, int(*opt_unexpected_key_decoder)(void *struct_key, const void *chunk_buf, size_t chunk_size), ssize_t(*body_receiver)(void *struct_key, const void *chunk_buf, size_t chunk_size, int have_more))
ssize_t jer_next_token(int *stateContext, const void *buffer, size_t size, pjer_chunk_type_e *ch_type)
#define ADVANCE(num_bytes)
#define ASN__DEFAULT_STACK_MAX
jer_check_sym_e jer_check_sym(const void *buf_ptr, int size, const char *need_key)
enum jer_check_sym jer_check_sym_e
pjson_chunk_type_e chunk_type
etsi_its_cpm_ts_coding
Author(s): Jean-Pierre Busch
, Guido Küppers , Lennart Reiher
autogenerated on Sun May 18 2025 02:22:38