Multi-ApplicationOnlineProfiling  2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
jsonCache.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <pthread.h>
Include dependency graph for jsonCache.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  json_t_s
 
struct  json_null_s
 
struct  json_bool_s
 
struct  json_string_s
 
struct  json_int_s
 
struct  json_real_s
 
struct  ObjectHT_entry
 
struct  ObjectHT
 
struct  json_object_s
 
struct  json_array_s
 
struct  json_object_iterator_s
 
struct  jsonCache
 

Macros

#define json_to_null(a)   ( (json_null_t *)( a ) )
 
#define json_to_bool(a)   ( (json_bool_t *)( a ) )
 
#define json_to_string(a)   ( (json_string_t *)( a ) )
 
#define json_to_int(a)   ( (json_int_t *)( a ) )
 
#define json_to_real(a)   ( (json_real_t *)( a ) )
 
#define json_to_object(a)   ( (json_object_t *)( a ) )
 
#define json_to_array(a)   ( (json_array_t *)( a ) )
 

Typedefs

typedef enum json_type_e json_type
 
typedef struct json_t_s json_t
 
typedef struct json_null_s json_null_t
 
typedef struct json_bool_s json_bool_t
 
typedef struct json_string_s json_string_t
 
typedef struct json_int_s json_int_t
 
typedef struct json_real_s json_real_t
 
typedef struct json_object_s json_object_t
 
typedef struct json_array_s json_array_t
 
typedef struct
json_object_iterator_s 
json_object_iterator
 

Enumerations

enum  json_type_e {
  JSON_NULL, JSON_BOOL, JSON_STRING, JSON_INT,
  JSON_REAL, JSON_OBJECT, JSON_ARRAY, JSON_SOMETHING_ELSE
}
 
enum  json_format { JSON_COMPACT = 1, JSON_PRETTY = 2, JSON_NO_LOCK = 4 }
 

Functions

static void json_lock (json_t *json)
 
static void json_unlock (json_t *json)
 
static int json_locked (json_t *json)
 
void json_incref (json_t *json)
 
void json_decref (json_t *json)
 
json_t__json_t_init (json_type type)
 
void __json_t_release (json_t *json)
 
static void json_incref_lf (json_t *json)
 
static int json_decref_lf (json_t *json)
 
json_tjson_null ()
 
void json_null_destroy (json_t *json)
 
json_tjson_bool (int thruth)
 
void json_bool_destroy (json_t *json)
 
json_tjson_string (char *string)
 
json_tjson_string_l (char *string, int len)
 
void json_string_destroy (json_t *json)
 
json_tjson_int (int64_t value)
 
void json_int_destroy (json_t *json)
 
json_tjson_real (double value)
 
void json_real_destroy (json_t *json)
 
void ObjectHT_init (struct ObjectHT *ht, int pow2_size)
 
void ObjectHT_release (struct ObjectHT *ht)
 
void ObjectHT_set (struct ObjectHT *ht, char *key, json_t *elem)
 
struct ObjectHT_entryObjectHT_get (struct ObjectHT *ht, char *key)
 
void ObjectHT_delete (struct ObjectHT *ht, char *key)
 
json_tjson_object ()
 
json_tjson_object_set (json_t *json, char *key, json_t *elem)
 
json_tjson_object_get (json_t *json, char *key)
 
json_tjson_object_delete (json_t *json, char *key)
 
void json_object_destroy (json_t *json)
 
json_tjson_array ()
 
json_tjson_array_push (json_t *json, json_t *elem)
 
json_tjson_array_push_at (json_t *json, unsigned int offset, json_t *elem)
 
json_tjson_array_get (json_t *json, unsigned int offset)
 
json_tjson_array_set (json_t *json, unsigned int offset, json_t *elem)
 
json_tjson_array_del (json_t *json, unsigned int offset)
 
void json_array_destroy (json_t *json)
 
int json_array_guarantee (json_array_t *a, unsigned int offset, int count)
 
static void json_object_iterator_init (json_object_iterator *it, json_t *json)
 
static int json_object_iterator_next (json_object_iterator *it)
 
static char * json_object_iterator_key (json_object_iterator *it)
 
static json_tjson_object_iterator_elem (json_object_iterator *it)
 
char * json_dump (json_t *json, json_format mode)
 
void json_dump_f (FILE *f, json_t *json, json_format mode)
 
static void json_print (json_t *json, json_format mode)
 
json_t_json_parse (char **buff)
 
json_tjson_parse (char *json)
 
void jsonCache_init (struct jsonCache *cache, void(*set_handler)(char *, json_t *, void *ctx), void(*delete_handler)(char *, void *ctx), void *ctx)
 
void jsonCache_release (struct jsonCache *cache)
 
json_tjsonCache_get (struct jsonCache *cache, char *key)
 
void jsonCache_commit (struct jsonCache *cache, char *key)
 
char * jsonCache_json (struct jsonCache *c, char *key, json_format mode)
 
void jsonCache_set_json (struct jsonCache *cache, char *key, char *json)
 
void jsonCache_set (struct jsonCache *cache, char *key, json_t *elem)
 
void jsonCache_set_json_nocommit (struct jsonCache *cache, char *key, char *json)
 
void jsonCache_set_nocommit (struct jsonCache *cache, char *key, json_t *elem)
 
void jsonCache_delete (struct jsonCache *cache, char *key)
 
void jsonCache_delete_nocommit (struct jsonCache *cache, char *key)
 

Macro Definition Documentation

#define json_to_array (   a)    ( (json_array_t *)( a ) )

Definition at line 238 of file jsonCache.h.

#define json_to_bool (   a)    ( (json_bool_t *)( a ) )

Definition at line 233 of file jsonCache.h.

#define json_to_int (   a)    ( (json_int_t *)( a ) )

Definition at line 235 of file jsonCache.h.

#define json_to_null (   a)    ( (json_null_t *)( a ) )

Definition at line 232 of file jsonCache.h.

#define json_to_object (   a)    ( (json_object_t *)( a ) )

Definition at line 237 of file jsonCache.h.

#define json_to_real (   a)    ( (json_real_t *)( a ) )

Definition at line 236 of file jsonCache.h.

#define json_to_string (   a)    ( (json_string_t *)( a ) )

Definition at line 234 of file jsonCache.h.

Typedef Documentation

typedef struct json_array_s json_array_t
typedef struct json_bool_s json_bool_t
typedef struct json_int_s json_int_t
typedef struct json_null_s json_null_t
typedef struct json_object_s json_object_t
typedef struct json_real_s json_real_t
typedef struct json_string_s json_string_t
typedef struct json_t_s json_t
typedef enum json_type_e json_type

Enumeration Type Documentation

Enumerator
JSON_COMPACT 
JSON_PRETTY 
JSON_NO_LOCK 

Definition at line 332 of file jsonCache.h.

Enumerator
JSON_NULL 
JSON_BOOL 
JSON_STRING 
JSON_INT 
JSON_REAL 
JSON_OBJECT 
JSON_ARRAY 
JSON_SOMETHING_ELSE 

Definition at line 13 of file jsonCache.h.

Function Documentation

json_t* __json_t_init ( json_type  type)

Definition at line 31 of file jsonCache.c.

Here is the caller graph for this function:

void __json_t_release ( json_t json)

Definition at line 97 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

json_t* _json_parse ( char **  buff)

Definition at line 1469 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

json_t* json_array ( )

Definition at line 540 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

json_t* json_array_del ( json_t json,
unsigned int  offset 
)

Definition at line 655 of file jsonCache.c.

Here is the call graph for this function:

void json_array_destroy ( json_t json)

Definition at line 700 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

json_t* json_array_get ( json_t json,
unsigned int  offset 
)

Definition at line 618 of file jsonCache.c.

Here is the call graph for this function:

int json_array_guarantee ( json_array_t a,
unsigned int  offset,
int  count 
)

Definition at line 553 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

json_t* json_array_push ( json_t json,
json_t elem 
)

Definition at line 610 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

json_t* json_array_push_at ( json_t json,
unsigned int  offset,
json_t elem 
)

Definition at line 592 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

json_t* json_array_set ( json_t json,
unsigned int  offset,
json_t elem 
)

Definition at line 635 of file jsonCache.c.

Here is the call graph for this function:

json_t* json_bool ( int  thruth)

Definition at line 156 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void json_bool_destroy ( json_t json)

Definition at line 167 of file jsonCache.c.

Here is the caller graph for this function:

void json_decref ( json_t json)

Definition at line 23 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int json_decref_lf ( json_t json)
inlinestatic

Definition at line 78 of file jsonCache.h.

Here is the call graph for this function:

Here is the caller graph for this function:

char* json_dump ( json_t json,
json_format  mode 
)

Definition at line 938 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void json_dump_f ( FILE *  f,
json_t json,
json_format  mode 
)

Definition at line 980 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void json_incref ( json_t json)

Definition at line 13 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void json_incref_lf ( json_t json)
inlinestatic

Definition at line 69 of file jsonCache.h.

Here is the caller graph for this function:

json_t* json_int ( int64_t  value)

Definition at line 212 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void json_int_destroy ( json_t json)

Definition at line 223 of file jsonCache.c.

Here is the caller graph for this function:

static void json_lock ( json_t json)
inlinestatic

Definition at line 38 of file jsonCache.h.

Here is the caller graph for this function:

static int json_locked ( json_t json)
inlinestatic

Definition at line 56 of file jsonCache.h.

json_t* json_null ( )

Definition at line 145 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void json_null_destroy ( json_t json)

Definition at line 151 of file jsonCache.c.

Here is the caller graph for this function:

json_t* json_object ( )

Definition at line 468 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

json_t* json_object_delete ( json_t json,
char *  key 
)

Definition at line 520 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void json_object_destroy ( json_t json)

Definition at line 480 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

json_t* json_object_get ( json_t json,
char *  key 
)

Definition at line 500 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static json_t* json_object_iterator_elem ( json_object_iterator it)
inlinestatic

Definition at line 317 of file jsonCache.h.

Here is the caller graph for this function:

static void json_object_iterator_init ( json_object_iterator it,
json_t json 
)
inlinestatic

Definition at line 252 of file jsonCache.h.

Here is the caller graph for this function:

static char* json_object_iterator_key ( json_object_iterator it)
inlinestatic

Definition at line 306 of file jsonCache.h.

Here is the caller graph for this function:

static int json_object_iterator_next ( json_object_iterator it)
inlinestatic

Definition at line 271 of file jsonCache.h.

Here is the caller graph for this function:

json_t* json_object_set ( json_t json,
char *  key,
json_t elem 
)

Definition at line 487 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

json_t* json_parse ( char *  json)

Definition at line 1504 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void json_print ( json_t json,
json_format  mode 
)
inlinestatic

Definition at line 343 of file jsonCache.h.

Here is the call graph for this function:

json_t* json_real ( double  value)

Definition at line 229 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void json_real_destroy ( json_t json)

Definition at line 240 of file jsonCache.c.

Here is the caller graph for this function:

json_t* json_string ( char *  string)

Definition at line 173 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void json_string_destroy ( json_t json)

Definition at line 205 of file jsonCache.c.

Here is the caller graph for this function:

json_t* json_string_l ( char *  string,
int  len 
)

Definition at line 184 of file jsonCache.c.

Here is the call graph for this function:

static void json_unlock ( json_t json)
inlinestatic

Definition at line 47 of file jsonCache.h.

Here is the caller graph for this function:

void jsonCache_commit ( struct jsonCache cache,
char *  key 
)

Definition at line 1578 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void jsonCache_delete ( struct jsonCache cache,
char *  key 
)

Definition at line 1565 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void jsonCache_delete_nocommit ( struct jsonCache cache,
char *  key 
)

Definition at line 1570 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

json_t* jsonCache_get ( struct jsonCache cache,
char *  key 
)

Definition at line 1539 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void jsonCache_init ( struct jsonCache cache,
void(*)(char *, json_t *, void *ctx)  set_handler,
void(*)(char *, void *ctx)  delete_handler,
void *  ctx 
)
char* jsonCache_json ( struct jsonCache c,
char *  key,
json_format  mode 
)

Definition at line 1660 of file jsonCache.c.

Here is the call graph for this function:

void jsonCache_release ( struct jsonCache cache)

Definition at line 1531 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void jsonCache_set ( struct jsonCache cache,
char *  key,
json_t elem 
)

Definition at line 1619 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void jsonCache_set_json ( struct jsonCache cache,
char *  key,
char *  json 
)

Definition at line 1648 of file jsonCache.c.

Here is the call graph for this function:

void jsonCache_set_json_nocommit ( struct jsonCache cache,
char *  key,
char *  json 
)

Definition at line 1653 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void jsonCache_set_nocommit ( struct jsonCache cache,
char *  key,
json_t elem 
)

Definition at line 1625 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void ObjectHT_delete ( struct ObjectHT ht,
char *  key 
)

Definition at line 461 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

struct ObjectHT_entry* ObjectHT_get ( struct ObjectHT ht,
char *  key 
)

Definition at line 387 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void ObjectHT_init ( struct ObjectHT ht,
int  pow2_size 
)

Definition at line 310 of file jsonCache.c.

Here is the caller graph for this function:

void ObjectHT_release ( struct ObjectHT ht)

Definition at line 332 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void ObjectHT_set ( struct ObjectHT ht,
char *  key,
json_t elem 
)

Definition at line 409 of file jsonCache.c.

Here is the call graph for this function:

Here is the caller graph for this function: