gwenhywfar 5.12.0
json_read.c File Reference
#include "./json_p.h"
#include "./json_read.h"
#include <gwenhywfar/misc.h>
#include <gwenhywfar/debug.h>
#include <gwenhywfar/text.h>
#include <ctype.h>
Include dependency graph for json_read.c:

Go to the source code of this file.

Macros

#define DISABLE_DEBUGLOG

Functions

static GWEN_JSON_ELEM_readArray (const char *s, const char **next)
static int _readKey (const char *s, GWEN_BUFFER *buf, const char **next)
static GWEN_JSON_ELEM_readObject (const char *s, const char **next)
static int _readQuotedToken (const char *s, GWEN_BUFFER *buf, 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 GWEN_JSON_ELEM_readValue (const char *s, const char **next)
GWEN_JSON_ELEMGWEN_JsonElement_fromString (const char *s)

Macro Definition Documentation

◆ DISABLE_DEBUGLOG

#define DISABLE_DEBUGLOG

Definition at line 28 of file json_read.c.

Function Documentation

◆ _readArray()

GWEN_JSON_ELEM * _readArray ( const char * s,
const char ** next )
static

Definition at line 138 of file json_read.c.

References _readValue(), DBG_INFO, GWEN_JSON_ELEMTYPE_ARRAY, GWEN_JsonElement_free(), GWEN_JsonElement_new(), GWEN_LOGDOMAIN, and NULL.

Referenced by _readValue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _readKey()

int _readKey ( const char * s,
GWEN_BUFFER * buf,
const char ** next )
static

Definition at line 180 of file json_read.c.

References _readQuotedToken(), DBG_INFO, GWEN_ERROR_BAD_DATA, GWEN_ERROR_NO_DATA, and GWEN_LOGDOMAIN.

Referenced by _readObject().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _readObject()

GWEN_JSON_ELEM * _readObject ( const char * s,
const char ** next )
static

Definition at line 76 of file json_read.c.

References _readKey(), _readValue(), DBG_INFO, GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_Buffer_Reset(), GWEN_JSON_ELEMTYPE_KEY, GWEN_JSON_ELEMTYPE_OBJECT, GWEN_JsonElement_free(), GWEN_JsonElement_new(), GWEN_LOGDOMAIN, and NULL.

Referenced by _readValue(), and GWEN_JsonElement_fromString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _readQuotedToken()

int _readQuotedToken ( const char * s,
GWEN_BUFFER * buf,
const char ** next )
static

Definition at line 357 of file json_read.c.

References GWEN_Buffer_AppendByte().

Referenced by _readKey(), and _readSimpleValueAndReturnType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _readSimpleValueAndReturnType()

int _readSimpleValueAndReturnType ( const char * s,
GWEN_BUFFER * buf,
const char ** next )
static

◆ _readTokenUntilChar()

int _readTokenUntilChar ( const char * s,
GWEN_BUFFER * buf,
int c,
const char ** next )
static

Definition at line 324 of file json_read.c.

References GWEN_Buffer_AppendByte(), and NULL.

Referenced by _readSimpleValueAndReturnType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _readValue()

GWEN_JSON_ELEM * _readValue ( const char * s,
const char ** next )
static

Definition at line 222 of file json_read.c.

References _readArray(), _readObject(), _readSimpleValueAndReturnType(), DBG_INFO, GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_JsonElement_new(), GWEN_LOGDOMAIN, and NULL.

Referenced by _readArray(), and _readObject().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_JsonElement_fromString()

GWEN_JSON_ELEM * GWEN_JsonElement_fromString ( const char * s)

Definition at line 53 of file json_read.c.

References _readObject(), DBG_INFO, GWEN_LOGDOMAIN, and NULL.

Referenced by test_json().

Here is the call graph for this function:
Here is the caller graph for this function: