include
etsi_its_spatem_ts_coding
jer_support.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2003, 2004 X/IO Labs, xiolabs.com.
3
* Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
4
* Redistribution and modifications are permitted subject to BSD license.
5
*/
6
#ifndef _JER_SUPPORT_H_
7
#define _JER_SUPPORT_H_
8
9
#include <
etsi_its_spatem_ts_coding/asn_system.h
>
/* Platform-specific types */
10
11
#ifdef __cplusplus
12
extern
"C"
{
13
#endif
14
15
/*
16
* Pre-computed JER constraints
17
*/
18
typedef
struct
asn_jer_constraints_s
{
19
ssize_t
size
;
/* -1 (no constraint) or >= 0 */
20
}
asn_jer_constraints_t
;
21
22
/*
23
* Types of data transferred to the application.
24
*/
25
typedef
enum
{
26
PJSON_TEXT
,
27
PJSON_KEY
,
28
PJSON_VALUE
,
29
PJSON_DLM
,
30
/*
31
* The following chunk types are reported if the chunk
32
* terminates the specified JSON element.
33
*/
34
PJSON_KEY_END
,
/* Key ended */
35
PJSON_VALUE_END
/* Value ended */
36
}
pjson_chunk_type_e
;
37
38
/*
39
* Callback function that is called by the parser when parsed data is
40
* available. The _opaque is the pointer to a field containing opaque user
41
* data specified in pxml_create() call. The chunk type is _type and the text
42
* data is the piece of buffer identified by _bufid (as supplied to
43
* pxml_feed() call) starting at offset _offset and of _size bytes size.
44
* The chunk is NOT '\0'-terminated.
45
*/
46
typedef
int (
pjson_callback_f
)(
pjson_chunk_type_e
_type,
47
const
void
*_chunk_data,
size_t
_chunk_size,
void
*_key);
48
49
/*
50
* Parse the given buffer as it were a chunk of XML data.
51
* Invoke the specified callback each time the meaningful data is found.
52
* This function returns number of bytes consumed from the buffer.
53
* It will always be lesser than or equal to the specified _size.
54
* The next invocation of this function must account the difference.
55
*/
56
ssize_t
pjson_parse
(
int
*_stateContext,
const
void
*_buf,
size_t
_size,
57
pjson_callback_f
*cb,
void
*_key);
58
59
#ifdef __cplusplus
60
}
61
#endif
62
63
#endif
/* _JER_SUPPORT_H_ */
PJSON_VALUE_END
@ PJSON_VALUE_END
Definition:
jer_support.h:35
PJSON_DLM
@ PJSON_DLM
Definition:
jer_support.h:29
asn_jer_constraints_s::size
ssize_t size
Definition:
jer_support.h:19
asn_jer_constraints_s
Definition:
jer_support.h:18
pjson_callback_f
int() pjson_callback_f(pjson_chunk_type_e _type, const void *_chunk_data, size_t _chunk_size, void *_key)
Definition:
jer_support.h:46
PJSON_TEXT
@ PJSON_TEXT
Definition:
jer_support.h:26
asn_jer_constraints_t
struct asn_jer_constraints_s asn_jer_constraints_t
pjson_chunk_type_e
pjson_chunk_type_e
Definition:
jer_support.h:25
PJSON_VALUE
@ PJSON_VALUE
Definition:
jer_support.h:28
PJSON_KEY
@ PJSON_KEY
Definition:
jer_support.h:27
pjson_parse
ssize_t pjson_parse(int *_stateContext, const void *_buf, size_t _size, pjson_callback_f *cb, void *_key)
Definition:
jer_support.c:79
asn_system.h
PJSON_KEY_END
@ PJSON_KEY_END
Definition:
jer_support.h:34
etsi_its_spatem_ts_coding
Author(s): Jean-Pierre Busch
, Guido Küppers
, Lennart Reiher
autogenerated on Sun May 18 2025 02:29:28