36 0,0,0,0,0,0,0,0, 0,1,1,0,1,1,0,0,
37 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
38 1,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
39 2,2,2,2,2,2,2,2, 2,2,0,0,0,0,0,0,
40 0,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,
41 3,3,3,3,3,3,3,3, 3,3,3,0,0,0,0,0,
42 0,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,
43 3,3,3,3,3,3,3,3, 3,3,3,0,0,0,0,0
45 #define WHITESPACE(c) (_charclass[(unsigned char)(c)] == 1) 46 #define ALNUM(c) (_charclass[(unsigned char)(c)] >= 2) 47 #define ALPHA(c) (_charclass[(unsigned char)(c)] == 3) 60 #define TOKEN_CB_CALL(type, _ns, _current_too, _final) do { \ 63 ssize_t _sz = (p - chunk_start) + _current_too; \ 69 _ret = cb(type, chunk_start, _sz, key); \ 71 if(_current_too && _ret == -1) \ 75 chunk_start = p + _current_too; \ 79 #define TOKEN_CB(_type, _ns, _current_too) \ 80 TOKEN_CB_CALL(_type, _ns, _current_too, 0) 82 #define TOKEN_CB_FINAL(_type, _ns, _current_too) \ 83 TOKEN_CB_CALL(final_chunk_type[_type], _ns, _current_too, 1) 90 const char *chunk_start = (
const char *)xmlbuf;
91 const char *p = chunk_start;
92 const char *end = p + size;
95 int C = *(
const unsigned char *)p;
205 }
else if(C ==
CDASH) {
217 if(p - chunk_start) {
230 *stateContext = (int)state;
231 return chunk_start - (
const char *)xmlbuf;
#define TOKEN_CB_FINAL(_type, _ns, _current_too)
ssize_t pxml_parse(int *stateContext, const void *xmlbuf, size_t size, pxml_callback_f *cb, void *key)
static int _charclass[256]
int() pxml_callback_f(pxml_chunk_type_e _type, const void *_chunk_data, size_t _chunk_size, void *_key)
static pxml_chunk_type_e final_chunk_type[]
#define TOKEN_CB(_type, _ns, _current_too)