MACSio  0.9
Multi-purpose, Application-Centric, Scalable I/O Proxy App
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
json_object.h File Reference
#include "json_inttypes.h"

Go to the source code of this file.

Data Structures

struct  json_object_iter
 

Macros

#define THIS_FUNCTION_IS_DEPRECATED(func)   func
 
#define JSON_OBJECT_DEF_HASH_ENTRIES   16
 
#define JSON_C_TO_STRING_PLAIN   0
 
#define JSON_C_TO_STRING_SPACED   (1<<0)
 
#define JSON_C_TO_STRING_PRETTY   (1<<1)
 
#define JSON_C_TO_STRING_NOZERO   (1<<2)
 
#define JSON_C_TO_STRING_UNQUOTED   (1<<3)
 
#define JSON_C_TO_STRING_NO_EXTARR_VALS   (1<<4)
 
#define JSON_C_FALSE   ((json_bool)0)
 
#define JSON_C_TRUE   ((json_bool)1)
 
#define json_object_object_foreach(obj, key, val)
 
#define json_object_object_foreachC(obj, iter)   for(iter.entry = json_object_get_object(obj)->head; (iter.entry ? (iter.key = (char*)iter.entry->k, iter.val = (struct json_object*)iter.entry->v, iter.entry) : 0); iter.entry = iter.entry->next)
 
#define JsonGetBool(OBJ,...)   json_object_apath_get_boolean(OBJ, json_paste_apath(#__VA_ARGS__, __VA_ARGS__))
 Get the bool value at specified path. More...
 
#define JsonGetInt(OBJ,...)   json_object_apath_get_int( OBJ, json_paste_apath(#__VA_ARGS__, __VA_ARGS__))
 Get the int value at specified path. More...
 
#define JsonGetInt64(OBJ,...)   json_object_apath_get_int64( OBJ, json_paste_apath(#__VA_ARGS__, __VA_ARGS__))
 Get the int64_t value at specified path. More...
 
#define JsonGetDbl(OBJ,...)   json_object_apath_get_double( OBJ, json_paste_apath(#__VA_ARGS__, __VA_ARGS__))
 Get the double value at specified path. More...
 
#define JsonGetStr(OBJ,...)   json_object_apath_get_string( OBJ, json_paste_apath(#__VA_ARGS__, __VA_ARGS__))
 Get the string value at specified path. More...
 
#define JsonGetObj(OBJ,...)   json_object_apath_get_object( OBJ, json_paste_apath(#__VA_ARGS__, __VA_ARGS__))
 Get the object at specified path. More...
 
#define JsonFindObj(OBJ,...)   json_object_apath_find_object(OBJ, json_paste_apath(#__VA_ARGS__, __VA_ARGS__))
 

Typedefs

typedef int json_bool
 
typedef struct printbuf printbuf
 
typedef struct lh_table lh_table
 
typedef struct array_list array_list
 
typedef struct json_object json_object
 
typedef struct json_object_iter json_object_iter
 
typedef struct json_tokener json_tokener
 
typedef void( json_object_delete_fn )(struct json_object *jso, void *userdata)
 
typedef int( json_object_to_json_string_fn )(struct json_object *jso, struct printbuf *pb, int level, int flags)
 
typedef enum json_type json_type
 
typedef enum json_extarr_type json_extarr_type
 

Enumerations

enum  json_type {
  json_type_null, json_type_boolean, json_type_double, json_type_int,
  json_type_object, json_type_array, json_type_string, json_type_extarr,
  json_type_enum, json_type_null, json_type_boolean, json_type_double,
  json_type_int, json_type_object, json_type_array, json_type_string,
  json_type_extarr, json_type_enum
}
 
enum  json_extarr_type {
  json_extarr_type_null, json_extarr_type_bit01, json_extarr_type_byt08, json_extarr_type_int32,
  json_extarr_type_int64, json_extarr_type_flt32, json_extarr_type_flt64, json_extarr_type_null,
  json_extarr_type_bit01, json_extarr_type_byt08, json_extarr_type_int32, json_extarr_type_int64,
  json_extarr_type_flt32, json_extarr_type_flt64
}
 

Functions

struct json_objectjson_object_get (struct json_object *obj)
 
int json_object_put (struct json_object *obj)
 
int json_object_is_type (struct json_object *obj, enum json_type type)
 
enum json_type json_object_get_type (struct json_object *obj)
 
const char * json_object_to_json_string (struct json_object *obj)
 
const char * json_object_to_json_string_ext (struct json_object *obj, int flags)
 
void json_object_set_serializer (json_object *jso, json_object_to_json_string_fn to_string_func, void *userdata, json_object_delete_fn *user_delete)
 
struct json_objectjson_object_new_object (void)
 
struct lh_tablejson_object_get_object (struct json_object *obj)
 
int json_object_object_length (struct json_object *obj)
 
void json_object_object_add (struct json_object *obj, const char *key, struct json_object *val)
 
 THIS_FUNCTION_IS_DEPRECATED (extern struct json_object *json_object_object_get(struct json_object *obj, const char *key))
 
json_bool json_object_object_get_ex (struct json_object *obj, const char *key, struct json_object **value)
 
void json_object_object_del (struct json_object *obj, const char *key)
 
struct json_objectjson_object_new_array (void)
 
struct array_listjson_object_get_array (struct json_object *obj)
 
int json_object_array_length (struct json_object *obj)
 
void json_object_array_sort (struct json_object *jso, int(*sort_fn)(const void *, const void *))
 
int json_object_array_add (struct json_object *obj, struct json_object *val)
 
int json_object_array_put_idx (struct json_object *obj, int idx, struct json_object *val)
 
struct json_objectjson_object_array_get_idx (struct json_object *obj, int idx)
 
struct json_objectjson_object_new_boolean (json_bool b)
 
json_bool json_object_get_boolean (struct json_object *obj)
 
struct json_objectjson_object_new_int (int32_t i)
 
struct json_objectjson_object_new_int64 (int64_t i)
 
int32_t json_object_get_int (struct json_object *obj)
 
int64_t json_object_get_int64 (struct json_object *obj)
 
struct json_objectjson_object_new_double (double d)
 
struct json_objectjson_object_new_double_s (double d, const char *ds)
 
double json_object_get_double (struct json_object *obj)
 
struct json_objectjson_object_new_string (const char *s)
 
struct json_objectjson_object_new_string_len (const char *s, int len)
 
const char * json_object_get_string (struct json_object *obj)
 
int json_object_get_string_len (struct json_object *obj)
 
struct json_objectjson_object_new_enum (void)
 Create a new, empty enumeration object. More...
 
void json_object_enum_add (struct json_object *jso, char const *name, int64_t val, json_bool selected)
 Add a name/value pair to an enumeration. More...
 
int json_object_enum_length (struct json_object *jso)
 Get the length (or size) of an enumeration. More...
 
int json_object_enum_nbytes (struct json_object *jso)
 
char const * json_object_enum_get_idx_name (struct json_object *jso, int idx)
 Get the name of a specific name/value pair in the enumeration. More...
 
int64_t json_object_enum_get_idx_val (struct json_object *jso, int idx)
 Get the value of a specific name/value pair in the enumeration. More...
 
char const * json_object_enum_get_name (struct json_object *jso, int64_t val)
 Get name of value in an enumeration. More...
 
int64_t json_object_enum_get_val (struct json_object *jso, char const *name)
 Get value of name in an enumeration. More...
 
char const * json_object_enum_get_choice_name (struct json_object *jso)
 Get chosen name of an enumeration. More...
 
int64_t json_object_enum_get_choice_val (struct json_object *jso)
 Get chosen value of an enumeration. More...
 
void json_object_free_printbuf (struct json_object *obj)
 
struct json_objectjson_object_new_extarr (void const *data, enum json_extarr_type type, int ndims, int const *dims)
 
struct json_objectjson_object_new_extarr_alloc (enum json_extarr_type etype, int ndims, int const *dims)
 
enum json_extarr_type json_object_extarr_type (struct json_object *jso)
 
int json_object_extarr_nvals (struct json_object *jso)
 
int json_object_extarr_valsize (struct json_object *jso)
 
int64_t json_object_extarr_nbytes (struct json_object *jso)
 
int json_object_extarr_ndims (struct json_object *jso)
 
int json_object_extarr_dim (struct json_object *jso, int dimidx)
 
void const * json_object_extarr_data (struct json_object *jso)
 
int json_object_extarr_data_as_unsigned_char (struct json_object *jso, unsigned char **buf)
 
int json_object_extarr_data_as_int (struct json_object *jso, int **buf)
 
int json_object_extarr_data_as_int64_t (struct json_object *jso, int64_t **buf)
 
int json_object_extarr_data_as_float (struct json_object *jso, float **buf)
 
int json_object_extarr_data_as_double (struct json_object *jso, double **buf)
 
json_bool json_object_path_get_boolean (struct json_object *src, char const *key_path)
 Get boolean value for the object at specified path. More...
 
char const * json_object_path_get_enum_choice_name (struct json_object *src, char const *key_path)
 
int64_t json_object_path_get_enum_choice_val (struct json_object *src, char const *key_path)
 
int32_t json_object_path_get_int (struct json_object *src, char const *key_path)
 Get integer value for object at specified path. More...
 
int64_t json_object_path_get_int64 (struct json_object *src, char const *key_path)
 Get int64 value for object at specified path. More...
 
char const * json_object_path_get_string (struct json_object *src, char const *key_path)
 Get a string value for the object at specified path. More...
 
double json_object_path_get_double (struct json_object *src, char const *key_path)
 Get a double value for the object at specified path. More...
 
struct json_objectjson_object_path_get_array (struct json_object *src, char const *key_path)
 Get the array object at specified path. More...
 
struct json_objectjson_object_path_get_object (struct json_object *src, char const *key_path)
 Get the object at specified path. More...
 
struct json_objectjson_object_path_get_extarr (struct json_object *src, char const *key_path)
 Get the extarr object at specified path. More...
 
struct json_objectjson_object_path_get_any (struct json_object *src, char const *key_path)
 Get object of any type at specified path. More...
 
json_bool json_object_apath_get_boolean (struct json_object *src, char const *key_path)
 Query boolean value at specified path. More...
 
int json_object_apath_get_int (struct json_object *src, char const *key_path)
 Query int value at specified path. More...
 
int64_t json_object_apath_get_int64 (struct json_object *src, char const *key_path)
 Query int64_t value at specified path. More...
 
double json_object_apath_get_double (struct json_object *src, char const *key_path)
 Query double value at specified path. More...
 
char const * json_object_apath_get_string (struct json_object *src, char const *key_path)
 Query string value at specified path. More...
 
struct json_objectjson_object_apath_get_object (struct json_object *src, char const *key_path)
 Query any object at specified path. More...
 
struct json_objectjson_object_apath_find_object (struct json_object *src, char const *key_path)
 
char const * json_paste_apath (char const *va_args_str, char const *first,...)
 Helper method to automatically construct paths from values. More...
 
json_bool json_object_set_boolean (struct json_object *bool_obj, json_bool val)
 
json_bool json_object_set_enum_choice_name (struct json_object *enum_obj, char const *name)
 
json_bool json_object_set_enum_choice_val (struct json_object *enum_obj, int64_t val)
 
json_bool json_object_set_int (struct json_object *int_obj, int32_t val)
 
json_bool json_object_set_int64 (struct json_object *int64_obj, int64_t val)
 
json_bool json_object_set_double (struct json_object *double_obj, double val)
 
json_bool json_object_set_string (struct json_object *string_obj, char const *val)
 
json_bool json_object_path_set_boolean (struct json_object *obj, char const *key_path, json_bool val)
 
json_bool json_object_path_set_enum_choice_name (struct json_object *enum_obj, char const *key_path, char const *val)
 
json_bool json_object_path_set_enum_choice_val (struct json_object *enum_obj, char const *key_path, int64_t val)
 
json_bool json_object_path_set_int (struct json_object *obj, char const *key_path, int32_t val)
 
json_bool json_object_path_set_int64 (struct json_object *obj, char const *key_path, int64_t val)
 
json_bool json_object_path_set_double (struct json_object *obj, char const *key_path, double val)
 
json_bool json_object_path_set_string (struct json_object *obj, char const *key_path, char const *val)
 
int64_t json_object_object_nbytes (struct json_object *const obj)
 

Variables

const char * json_number_chars
 
const char * json_hex_chars
 
json_object_delete_fn json_object_free_userdata
 
json_object_to_json_string_fn json_object_userdata_to_json_string
 

Macro Definition Documentation

#define THIS_FUNCTION_IS_DEPRECATED (   func)    func

Definition at line 21 of file json_object.h.

Function Documentation

int json_object_enum_nbytes ( struct json_object jso)
int json_object_extarr_data_as_unsigned_char ( struct json_object jso,
unsigned char **  buf 
)
int json_object_extarr_data_as_int ( struct json_object jso,
int **  buf 
)
int json_object_extarr_data_as_int64_t ( struct json_object jso,
int64_t **  buf 
)
int json_object_extarr_data_as_float ( struct json_object jso,
float **  buf 
)
int json_object_extarr_data_as_double ( struct json_object jso,
double **  buf 
)
char const* json_object_path_get_enum_choice_name ( struct json_object src,
char const *  key_path 
)
int64_t json_object_path_get_enum_choice_val ( struct json_object src,
char const *  key_path 
)