mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-21 23:56:54 +02:00
back-port JSON and accompanying Foundation portions (JSONString, Dynamic::Var etc)
This commit is contained in:
52
JSON/include/pd_json_private.h
Normal file
52
JSON/include/pd_json_private.h
Normal file
@@ -0,0 +1,52 @@
|
||||
#ifndef PDJSON_PRIVATE_H
|
||||
#define PDJSON_PRIVATE_H
|
||||
|
||||
#if defined(__STDC_VERSION__) || (__STDC_VERSION__ >= 199901L)
|
||||
#include <stdbool.h>
|
||||
#endif // __STDC_VERSION__
|
||||
#include <stdio.h>
|
||||
|
||||
struct json_source {
|
||||
int (*get) (struct json_source *);
|
||||
int (*peek) (struct json_source *);
|
||||
size_t position;
|
||||
union {
|
||||
struct {
|
||||
FILE *stream;
|
||||
} stream;
|
||||
struct {
|
||||
const char *buffer;
|
||||
size_t length;
|
||||
} buffer;
|
||||
} source;
|
||||
};
|
||||
|
||||
struct json_stack {
|
||||
enum json_type type;
|
||||
long count;
|
||||
};
|
||||
|
||||
struct json_stream {
|
||||
size_t lineno;
|
||||
|
||||
struct json_stack *stack;
|
||||
size_t stack_top;
|
||||
size_t stack_size;
|
||||
enum json_type next;
|
||||
int error : 31;
|
||||
bool streaming : 1;
|
||||
|
||||
struct {
|
||||
char *string;
|
||||
size_t string_fill;
|
||||
size_t string_size;
|
||||
} data;
|
||||
|
||||
size_t ntokens;
|
||||
|
||||
struct json_source source;
|
||||
struct json_allocator alloc;
|
||||
char errmsg[128];
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user