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

Functions

shim_val_tshim_array_new (shim_ctx_t *ctx, size_t len)
 
size_t shim_array_length (shim_val_t *arr)
 
shim_bool_t shim_array_get (shim_ctx_t *ctx, shim_val_t *arr, int32_t idx, shim_val_t *rval)
 
shim_bool_t shim_array_set (shim_ctx_t *ctx, shim_val_t *arr, int32_t idx, shim_val_t *val)
 

Detailed Description

Methods for Arrays

Function Documentation

shim_bool_t shim_array_get ( shim_ctx_t ctx,
shim_val_t arr,
int32_t  idx,
shim_val_t rval 
)

Get the value at the given index

Parameters
ctxCurrent executing context
arrGiven array
idxIndex of element
rvalActual return value
Returns
TRUE if the value existed, otherwise FALSE
size_t shim_array_length ( shim_val_t arr)

Get the length of the given array

Parameters
arrGiven array
Returns
Length of the array
shim_val_t* shim_array_new ( shim_ctx_t ctx,
size_t  len 
)

Create a new array of given length

Parameters
ctxCurrent executing context
lenLength of array to be created
Returns
Wrapped array
shim_bool_t shim_array_set ( shim_ctx_t ctx,
shim_val_t arr,
int32_t  idx,
shim_val_t val 
)

Set the value at the given index

Parameters
ctxCurrent executing context
arrGiven array
idxIndex of element
valValue to be set
Returns
TRUE if the value was able to be set, otherwise FALSE