All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
as_val.h File Reference
#include <citrusleaf/cf_atomic.h>
#include <stdbool.h>
#include <stdint.h>
+ Include dependency graph for as_val.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  as_val
 

Macros

#define as_val_destroy(__v)   ( as_val_val_destroy((as_val *)__v) )
 
#define as_val_hashcode(__v)   ( as_val_val_hashcode((as_val *)__v) )
 
#define as_val_reserve(__v)   ( as_val_val_reserve((as_val *)__v) )
 
#define as_val_tostring(__v)   ( as_val_val_tostring((as_val *)__v) )
 
#define as_val_type(__v)   (__v ? ((as_val *)__v)->type : AS_UNDEF)
 

Enumerations

enum  as_val_t
 

Functions

static as_valas_val_cons (as_val *val, as_val_t type, bool free)
 
static void as_val_init (as_val *v, as_val_t type, bool free)
 
as_valas_val_val_destroy (as_val *)
 
uint32_t as_val_val_hashcode (const as_val *)
 
as_valas_val_val_reserve (as_val *)
 
char * as_val_val_tostring (const as_val *)
 

Variables

 AS_BOOLEAN = 2
 
 AS_BYTES = 9
 
 AS_DOUBLE = 10
 
 AS_GEOJSON = 11
 
 AS_INTEGER = 3
 
 AS_LIST = 5
 
 AS_MAP = 6
 
 AS_NIL = 1
 
 AS_PAIR = 8
 
 AS_REC = 7
 
 AS_STRING = 4
 
 AS_UNDEF = 0
 
 AS_UNKNOWN = 0
 
 AS_VAL_T_MAX
 

Macro Definition Documentation

#define as_val_destroy (   __v)    ( as_val_val_destroy((as_val *)__v) )

Decrement the as_val.count of a value. If as_val.count reaches 0 (zero) and as_val.free is true, then free the as_val instance.

Parameters
__vThe as_val to be decremented.
Returns
The value, if its as_val.count > 0. Otherwise NULL.

Definition at line 110 of file as_val.h.

#define as_val_hashcode (   __v)    ( as_val_val_hashcode((as_val *)__v) )

Get the hashcode value for the value.

Parameters
__vThe as_val to get the hashcode value for.
Returns
The hashcode value.

Definition at line 119 of file as_val.h.

#define as_val_reserve (   __v)    ( as_val_val_reserve((as_val *)__v) )

Increment the as_val.count of a value.

Parameters
__vThe as_val to be incremented.
Returns
The value, with it's refcount incremented.

Definition at line 100 of file as_val.h.

#define as_val_tostring (   __v)    ( as_val_val_tostring((as_val *)__v) )

Get the string representation of the value.

Parameters
__vThe as_val to get the string value for.
Returns
The string representation on success. Otherwise NULL.

Definition at line 128 of file as_val.h.

#define as_val_type (   __v)    (__v ? ((as_val *)__v)->type : AS_UNDEF)

Returns the as_val.type of a value.

Parameters
__vThe as_val to get the type of
Returns
An as_val_t value. If the type is unknown, then it will be AS_UNKNOWN.

Definition at line 91 of file as_val.h.

Enumeration Type Documentation

enum as_val_t

as_val types

Definition at line 36 of file as_val.h.

Function Documentation

static as_val* as_val_cons ( as_val val,
as_val_t  type,
bool  free 
)
inlinestaticprivate

Initialize an as_val. Should only be used by subtypes.

Definition at line 182 of file as_val.h.

References as_val::count, as_val::free, type, and as_val::type.

static void as_val_init ( as_val v,
as_val_t  type,
bool  free 
)
inlinestaticprivate

Initialize an as_val. Should only be used by subtypes.

Deprecated:
Use as_val_cons() instead.

Definition at line 169 of file as_val.h.

References as_val::count, as_val::free, type, and as_val::type.

as_val* as_val_val_destroy ( as_val )
private

Helper function for decrementing the count of a value, and if count==0 and free==true, then free the value.

uint32_t as_val_val_hashcode ( const as_val )
private

Helper function for calculating the hash value.

as_val* as_val_val_reserve ( as_val )
private

Helper function for incrementing the count of a value.

char* as_val_val_tostring ( const as_val )
private

Helper function for generating the string representation.

Variable Documentation

AS_BOOLEAN = 2

Definition at line 208 of file as_val.h.

AS_BYTES = 9

Definition at line 215 of file as_val.h.

AS_DOUBLE = 10

Definition at line 216 of file as_val.h.

AS_GEOJSON = 11

Definition at line 217 of file as_val.h.

AS_INTEGER = 3

Definition at line 209 of file as_val.h.

AS_LIST = 5

Definition at line 211 of file as_val.h.

AS_MAP = 6

Definition at line 212 of file as_val.h.

AS_NIL = 1

Definition at line 207 of file as_val.h.

AS_PAIR = 8

Definition at line 214 of file as_val.h.

AS_REC = 7

Definition at line 213 of file as_val.h.

AS_STRING = 4

Definition at line 210 of file as_val.h.

AS_UNDEF = 0

Definition at line 205 of file as_val.h.

AS_UNKNOWN = 0

Definition at line 206 of file as_val.h.

AS_VAL_T_MAX

Definition at line 217 of file as_val.h.