28#define DISABLE_DEBUGLOG
34#include <gwenhywfar/misc.h>
35#include <gwenhywfar/debug.h>
36#include <gwenhywfar/text.h>
55 while(*s && isspace(*s))
88 while(*s && isspace(*s))
102 GWEN_JsonElement_Tree2_AddChild(jeObject, jeKey);
104 while(*s && isspace(*s))
114 GWEN_JsonElement_Tree2_AddChild(jeKey, jeValue);
116 while(*s && isspace(*s))
146 while(*s && isspace(*s))
157 GWEN_JsonElement_Tree2_AddChild(jeArray, jeValue);
159 while(*s && isspace(*s))
185 while(*s && isspace(*s))
207 while(*s && isspace(*s))
227 while(*s && isspace(*s))
275 while(*s && isspace(*s))
307 if (*p==
'-' || *p==
'.' || isdigit(*p)) {
310 else if (strcasecmp(p,
"TRUE")==0 || strcasecmp(p,
"FALSE")==0) {
313 else if (strcasecmp(p,
"NULL")==0) {
339 if (*s==c || strchr(
",:{}[]", *s)!=
NULL)
GWEN_BUFFER * GWEN_Buffer_new(char *buffer, uint32_t size, uint32_t used, int take)
void GWEN_Buffer_Reset(GWEN_BUFFER *bf)
uint32_t GWEN_Buffer_GetPos(const GWEN_BUFFER *bf)
void GWEN_Buffer_free(GWEN_BUFFER *bf)
char * GWEN_Buffer_GetStart(const GWEN_BUFFER *bf)
int GWEN_Buffer_AppendByte(GWEN_BUFFER *bf, char c)
#define DBG_INFO(dbg_logger, format,...)
#define GWEN_ERROR_BAD_DATA
#define GWEN_ERROR_NO_DATA
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
GWEN_JSON_ELEM * GWEN_JsonElement_new(int t, const char *sData)
void GWEN_JsonElement_free(GWEN_JSON_ELEM *je)
@ GWEN_JSON_ELEMTYPE_OBJECT
@ GWEN_JSON_ELEMTYPE_STRING
@ GWEN_JSON_ELEMTYPE_BOOL
@ GWEN_JSON_ELEMTYPE_NULL
@ GWEN_JSON_ELEMTYPE_ARRAY
@ GWEN_JSON_ELEMTYPE_UNKNOWN
struct GWEN_JSON_ELEM GWEN_JSON_ELEM
static int _readQuotedToken(const char *s, GWEN_BUFFER *buf, const char **next)
static GWEN_JSON_ELEM * _readValue(const char *s, const char **next)
static int _readSimpleValueAndReturnType(const char *s, GWEN_BUFFER *buf, const char **next)
static int _readTokenUntilChar(const char *s, GWEN_BUFFER *buf, int c, const char **next)
static int _readKey(const char *s, GWEN_BUFFER *buf, const char **next)
static GWEN_JSON_ELEM * _readArray(const char *s, const char **next)
static GWEN_JSON_ELEM * _readObject(const char *s, const char **next)
GWEN_JSON_ELEM * GWEN_JsonElement_fromString(const char *s)