Defines | Typedefs | Functions
json_more_utils.h File Reference
#include <stdio.h>
#include "json_object.h"
Include dependency graph for json_more_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define jo_add   json_object_object_add
#define jo_array_add   json_object_array_add
#define jo_array_get   json_object_array_get_idx
#define jo_array_length   json_object_array_length
#define jo_del   json_object_object_del
#define jo_free   json_object_put
#define jo_get   json_object_object_get
#define jo_get_string   json_object_get_string
#define jo_new   json_object_new_object
#define jo_new_array   json_object_new_array
#define jo_new_double   json_object_new_double
#define jo_new_int   json_object_new_int
#define jo_new_null()   0
#define jo_new_string   json_object_new_string
#define jo_to_string   json_write

Typedefs

typedef struct json_objectJO

Functions

void jo_add_double (JO parent, const char *name, double v)
void jo_add_double_array (JO parent, const char *name, const double *v, int n)
void jo_add_int (JO parent, const char *name, int v)
void jo_add_int_array (JO parent, const char *name, const int *v, int n)
void jo_add_string (JO parent, const char *name, const char *v)
JO jo_double_or_null (double d)
int jo_has_field (JO s, const char *name)
JO jo_new_double_array (const double *v, int n)
JO jo_new_int_array (const int *v, int n)
int jo_read_double (JO parent, const char *name, double *p)
int jo_read_double_array (JO parent, const char *name, double *p, int n, double when_null)
int jo_read_from_double_array (JO array, double *p, int n, double when_null)
int jo_read_int (JO parent, const char *name, int *p)
int jo_read_int_array (JO parent, const char *name, int *p, int n, int when_null)
int jo_read_string (JO parent, const char *name, char *v, size_t max_len)
JO json_parse (const char *str)
JO json_read_stream (FILE *)
int json_stream_skip (FILE *)
int json_to_double (JO jo, double *ptr)
int json_to_int (JO jo, int *ptr)
JO json_tokener_parse_len (const char *str, int len)
const char * json_write (JO jo)

Define Documentation

Definition at line 14 of file json_more_utils.h.

Definition at line 19 of file json_more_utils.h.

Definition at line 20 of file json_more_utils.h.

Definition at line 21 of file json_more_utils.h.

Definition at line 15 of file json_more_utils.h.

#define jo_free   json_object_put

Definition at line 16 of file json_more_utils.h.

Definition at line 17 of file json_more_utils.h.

Definition at line 22 of file json_more_utils.h.

Definition at line 18 of file json_more_utils.h.

Definition at line 11 of file json_more_utils.h.

Definition at line 9 of file json_more_utils.h.

Definition at line 10 of file json_more_utils.h.

#define jo_new_null ( )    0

Definition at line 13 of file json_more_utils.h.

Definition at line 12 of file json_more_utils.h.

#define jo_to_string   json_write

Definition at line 75 of file json_more_utils.h.


Typedef Documentation

typedef struct json_object* JO

Definition at line 7 of file json_more_utils.h.


Function Documentation

void jo_add_double ( JO  parent,
const char *  name,
double  v 
)

Definition at line 308 of file json_more_utils.c.

void jo_add_double_array ( JO  parent,
const char *  name,
const double *  v,
int  n 
)

Definition at line 296 of file json_more_utils.c.

void jo_add_int ( JO  parent,
const char *  name,
int  v 
)

Definition at line 304 of file json_more_utils.c.

void jo_add_int_array ( JO  parent,
const char *  name,
const int *  v,
int  n 
)

Definition at line 300 of file json_more_utils.c.

void jo_add_string ( JO  parent,
const char *  name,
const char *  v 
)

Definition at line 292 of file json_more_utils.c.

JO jo_double_or_null ( double  d)

Definition at line 196 of file json_more_utils.c.

int jo_has_field ( JO  s,
const char *  name 
)

Return true if there is a field

Definition at line 117 of file json_more_utils.c.

JO jo_new_double_array ( const double *  v,
int  n 
)

Definition at line 201 of file json_more_utils.c.

JO jo_new_int_array ( const int *  v,
int  n 
)

Definition at line 209 of file json_more_utils.c.

int jo_read_double ( JO  parent,
const char *  name,
double *  p 
)

This also tolerates an integer

Definition at line 267 of file json_more_utils.c.

int jo_read_double_array ( JO  parent,
const char *  name,
double *  p,
int  n,
double  when_null 
)

Definition at line 122 of file json_more_utils.c.

int jo_read_from_double_array ( JO  array,
double *  p,
int  n,
double  when_null 
)

Definition at line 133 of file json_more_utils.c.

int jo_read_int ( JO  parent,
const char *  name,
int *  p 
)

Return 0 if there isn't a field called 'name'

Definition at line 249 of file json_more_utils.c.

int jo_read_int_array ( JO  parent,
const char *  name,
int *  p,
int  n,
int  when_null 
)

XXX should we thro error?

Definition at line 169 of file json_more_utils.c.

int jo_read_string ( JO  parent,
const char *  name,
char *  v,
size_t  max_len 
)

Definition at line 280 of file json_more_utils.c.

JO json_parse ( const char *  str)

Definition at line 312 of file json_more_utils.c.

JO json_read_stream ( FILE *  )

Reads a JSON object from stream. Returns 0 on error. XXX: does not support unicode.

Definition at line 48 of file json_more_utils.c.

int json_stream_skip ( FILE *  )

Skips one object from stream (without parsing it). Returns 0 on error. XXX: does not support unicode.

Definition at line 22 of file json_more_utils.c.

int json_to_double ( JO  jo,
double *  ptr 
)

Converts an integer or a double to a double, or else *ptr will be set to NAN.

Definition at line 236 of file json_more_utils.c.

int json_to_int ( JO  jo,
int *  ptr 
)

XXX forse ho fatto casino

Definition at line 218 of file json_more_utils.c.

JO json_tokener_parse_len ( const char *  str,
int  len 
) [read]

Definition at line 101 of file json_more_utils.c.

const char* json_write ( JO  jo)

Definition at line 316 of file json_more_utils.c.



csm
Author(s): Andrea Censi
autogenerated on Mon Jan 16 2017 03:48:29