node-addon-layer
C API For writing Node modules
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions
Primitive methods

Functions

shim_bool_t shim_value_is (shim_val_t *val, shim_type_t type)
 
shim_bool_t shim_value_to (shim_ctx_t *ctx, shim_val_t *val, shim_type_t type, shim_val_t *rval)
 
void shim_value_release (shim_val_t *val)
 
shim_val_tshim_undefined ()
 
shim_val_tshim_null ()
 
const char * shim_type_str (shim_type_t type)
 

Detailed Description

Methods for managing primitives

Function Documentation

shim_val_t* shim_null ( )

Get the null value

const char* shim_type_str ( shim_type_t  type)
Parameters
typeThe given type
Returns
The string representation of the given type
shim_val_t* shim_undefined ( )

Get the undefined value

shim_bool_t shim_value_is ( shim_val_t val,
shim_type_t  type 
)

Check the value is of a given type

Parameters
valThe value to check
typeThe expected type
Returns
TRUE or FALSE

This doesn't coerce types, merely checks that the value is or isn't of the desired type

void shim_value_release ( shim_val_t val)

Relase memory associated with this value

Parameters
valThe given value
See Also
memory

Presuming the value was not allocated for shim_args_t or being used for shim_args_set_rval() use this method to free the allocated memory

shim_bool_t shim_value_to ( shim_ctx_t ctx,
shim_val_t val,
shim_type_t  type,
shim_val_t rval 
)

Convert the value to a given type

Parameters
ctxThe currently executed context
valThe given value
typeThe desired type
rvalThe destination value
Returns
TRUE or FALSE

Attempts to coerce the given value into another type, if it fails to do so returns FALSE.