node-addon-layer
C API For writing Node modules
|
Functions | |
shim_bool_t | shim_unpack_one (shim_ctx_t *ctx, shim_args_t *args, uint32_t idx, shim_type_t type, void *rval) |
shim_bool_t | shim_unpack_type (shim_ctx_t *ctx, shim_val_t *arg, shim_type_t type, void *rval) |
shim_bool_t | shim_unpack (shim_ctx_t *ctx, shim_args_t *args, shim_type_t type,...) |
int | shim_unpack_fmt (shim_ctx_t *ctx, shim_args_t *args, const char *fmt,...) |
size_t | shim_args_length (shim_args_t *args) |
shim_val_t * | shim_args_get (shim_args_t *, size_t idx) |
shim_bool_t | shim_args_set_rval (shim_ctx_t *ctx, shim_args_t *args, shim_val_t *val) |
shim_val_t * | shim_args_get_this (shim_ctx_t *ctx, shim_args_t *args) |
void * | shim_args_get_data (shim_ctx_t *ctx, shim_args_t *args) |
Methods for arguments
shim_val_t* shim_args_get | ( | shim_args_t * | args, |
size_t | idx | ||
) |
Get the argument at the given index
args | The arguments passed to the function |
idx | The index of the desired argument |
void* shim_args_get_data | ( | shim_ctx_t * | ctx, |
shim_args_t * | args | ||
) |
Get the arbitrary data associated with this function
ctx | Currently executing context |
args | The arguments passed to the function |
shim_val_t* shim_args_get_this | ( | shim_ctx_t * | ctx, |
shim_args_t * | args | ||
) |
Get the This for the given function
ctx | Currently executing context |
args | The arguments passed to the function |
this
associated with the executing function size_t shim_args_length | ( | shim_args_t * | args) |
How many arguments were passed to this function
args | The arguments passed to the function |
shim_bool_t shim_args_set_rval | ( | shim_ctx_t * | ctx, |
shim_args_t * | args, | ||
shim_val_t * | val | ||
) |
Set the return value for this function
ctx | Currently executing context |
args | The arguments passed to the function |
val | The value to use for return |
shim_bool_t shim_unpack | ( | shim_ctx_t * | ctx, |
shim_args_t * | args, | ||
shim_type_t | type, | ||
... | |||
) |
Unpack the arguments into underlying types
ctx | Currently executing context |
args | Arguments passed to the function |
type | The first type to unpack |
Arguments are passed in pairs of shim_type_t and a pointer to their destination, you end the set of pairs by a single SHIM_TYPE_UNKNOWN.
In the event an argument was unable to be unpacked, FALSE is returned and an exception is set.
int shim_unpack_fmt | ( | shim_ctx_t * | ctx, |
shim_args_t * | args, | ||
const char * | fmt, | ||
... | |||
) |
Unpack the arguments by format
shim_bool_t shim_unpack_one | ( | shim_ctx_t * | ctx, |
shim_args_t * | args, | ||
uint32_t | idx, | ||
shim_type_t | type, | ||
void * | rval | ||
) |
Unpack the argument at the given index
ctx | Currently executing context |
args | Arguments passed to the function |
idx | Index of the argument to unpack |
type | The destination type |
rval | The pointer to the destination |
shim_bool_t shim_unpack_type | ( | shim_ctx_t * | ctx, |
shim_val_t * | arg, | ||
shim_type_t | type, | ||
void * | rval | ||
) |
Unpack the value to the underlying type
ctx | Currently executing context |
arg | Given wrapped value |
type | The destination type |
rval | The pointer to where the data will be stored |