Macros | Enumerations | Functions | Variables
jer_support.c File Reference
#include <etsi_its_spatem_ts_coding/asn_system.h>
#include <etsi_its_spatem_ts_coding/jer_support.h>
Include dependency graph for jer_support.c:

Go to the source code of this file.

Macros

#define ALNUM(c)   (_charclass[(unsigned char)(c)] >= 2)
 
#define ALPHA(c)   (_charclass[(unsigned char)(c)] == 3)
 
#define CCOLON   0x3a /* ':' */
 
#define CCOMMA   0x2c /* ',' */
 
#define CQUOTE   0x22 /* '"' */
 
#define LCBRAC   0x7b /* '{' */
 
#define LSBRAC   0x5b /* '[' */
 
#define PJSON_KEY_FINAL_CHUNK_TYPE   PJSON_KEY_END
 
#define PJSON_VALUE_FINAL_CHUNK_TYPE   PJSON_VALUE_END
 
#define RCBRAC   0x7d /* '}' */
 
#define RSBRAC   0x5d /* ']' */
 
#define TOKEN_CB(_type, _ns, _current_too)   TOKEN_CB_CALL(_type, _ns, _current_too, 0)
 
#define TOKEN_CB_CALL(type, _ns, _current_too, _final)
 
#define TOKEN_CB_FINAL(_type, _ns, _current_too)   TOKEN_CB_CALL(_type##_FINAL_CHUNK_TYPE, _ns, _current_too, 1)
 
#define WHITESPACE(c)   (_charclass[(unsigned char)(c)] == 1)
 

Enumerations

enum  pstate_e {
  ST_TEXT, ST_KEY, ST_KEY_BODY, ST_COLON,
  ST_VALUE, ST_VALUE_BODY, ST_ARRAY_VALUE, ST_ARRAY_VALUE_BODY,
  ST_END
}
 

Functions

ssize_t pjson_parse (int *stateContext, const void *jsonbuf, size_t size, pjson_callback_f *cb, void *key)
 

Variables

static const int _charclass [256]
 

Macro Definition Documentation

◆ ALNUM

#define ALNUM (   c)    (_charclass[(unsigned char)(c)] >= 2)

Definition at line 34 of file jer_support.c.

◆ ALPHA

#define ALPHA (   c)    (_charclass[(unsigned char)(c)] == 3)

Definition at line 35 of file jer_support.c.

◆ CCOLON

#define CCOLON   0x3a /* ':' */

Definition at line 38 of file jer_support.c.

◆ CCOMMA

#define CCOMMA   0x2c /* ',' */

Definition at line 44 of file jer_support.c.

◆ CQUOTE

#define CQUOTE   0x22 /* '"' */

Definition at line 41 of file jer_support.c.

◆ LCBRAC

#define LCBRAC   0x7b /* '{' */

Definition at line 39 of file jer_support.c.

◆ LSBRAC

#define LSBRAC   0x5b /* '[' */

Definition at line 42 of file jer_support.c.

◆ PJSON_KEY_FINAL_CHUNK_TYPE

#define PJSON_KEY_FINAL_CHUNK_TYPE   PJSON_KEY_END

Definition at line 69 of file jer_support.c.

◆ PJSON_VALUE_FINAL_CHUNK_TYPE

#define PJSON_VALUE_FINAL_CHUNK_TYPE   PJSON_VALUE_END

Definition at line 70 of file jer_support.c.

◆ RCBRAC

#define RCBRAC   0x7d /* '}' */

Definition at line 40 of file jer_support.c.

◆ RSBRAC

#define RSBRAC   0x5d /* ']' */

Definition at line 43 of file jer_support.c.

◆ TOKEN_CB

#define TOKEN_CB (   _type,
  _ns,
  _current_too 
)    TOKEN_CB_CALL(_type, _ns, _current_too, 0)

Definition at line 66 of file jer_support.c.

◆ TOKEN_CB_CALL

#define TOKEN_CB_CALL (   type,
  _ns,
  _current_too,
  _final 
)
Value:
do { \
int _ret; \
pstate_e ns = _ns; \
ssize_t _sz = (p - chunk_start) + _current_too; \
if(!_sz) { \
/* Shortcut */ \
state = _ns; \
break; \
} \
_ret = cb(type, chunk_start, _sz, key); \
if(_ret < _sz) { \
if(_current_too && _ret == -1) state = ns; \
goto finish; \
} \
chunk_start = p + _current_too; \
state = ns; \
} while(0)

Definition at line 47 of file jer_support.c.

◆ TOKEN_CB_FINAL

#define TOKEN_CB_FINAL (   _type,
  _ns,
  _current_too 
)    TOKEN_CB_CALL(_type##_FINAL_CHUNK_TYPE, _ns, _current_too, 1)

Definition at line 72 of file jer_support.c.

◆ WHITESPACE

#define WHITESPACE (   c)    (_charclass[(unsigned char)(c)] == 1)

Definition at line 33 of file jer_support.c.

Enumeration Type Documentation

◆ pstate_e

enum pstate_e
Enumerator
ST_TEXT 
ST_KEY 
ST_KEY_BODY 
ST_COLON 
ST_VALUE 
ST_VALUE_BODY 
ST_ARRAY_VALUE 
ST_ARRAY_VALUE_BODY 
ST_END 

Definition at line 11 of file jer_support.c.

Function Documentation

◆ pjson_parse()

ssize_t pjson_parse ( int *  stateContext,
const void *  jsonbuf,
size_t  size,
pjson_callback_f cb,
void *  key 
)

Definition at line 79 of file jer_support.c.

Variable Documentation

◆ _charclass

const int _charclass[256]
static
Initial value:
= {
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0,
0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0,
0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0
}

Definition at line 23 of file jer_support.c.

key
static void ssize_t void * key
Definition: asn_internal.h:96


etsi_its_spatem_ts_coding
Author(s): Jean-Pierre Busch , Guido Küppers , Lennart Reiher
autogenerated on Sun May 18 2025 02:29:29