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

Functions

shim_val_tshim_func_new (shim_ctx_t *ctx, shim_func cfunc, size_t argc, int32_t flags, const char *name, void *data)
 
shim_bool_t shim_func_call_sym (shim_ctx_t *ctx, shim_val_t *self, shim_val_t *name, size_t argc, shim_val_t **argv, shim_val_t *rval)
 
shim_bool_t shim_func_call_name (shim_ctx_t *ctx, shim_val_t *self, const char *name, size_t argc, shim_val_t **argv, shim_val_t *rval)
 
shim_bool_t shim_func_call_val (shim_ctx_t *ctx, shim_val_t *self, shim_val_t *func, size_t argc, shim_val_t **argv, shim_val_t *rval)
 
shim_bool_t shim_make_callback_sym (shim_ctx_t *ctx, shim_val_t *self, shim_val_t *sym, size_t argc, shim_val_t **argv, shim_val_t *rval)
 
shim_bool_t shim_make_callback_val (shim_ctx_t *ctx, shim_val_t *self, shim_val_t *fval, size_t argc, shim_val_t **argv, shim_val_t *rval)
 
shim_bool_t shim_make_callback_name (shim_ctx_t *ctx, shim_val_t *obj, const char *name, size_t argc, shim_val_t **argv, shim_val_t *rval)
 

Detailed Description

Methods for functions

Function Documentation

shim_bool_t shim_func_call_name ( shim_ctx_t ctx,
shim_val_t self,
const char *  name,
size_t  argc,
shim_val_t **  argv,
shim_val_t rval 
)

Get the function by name from an object and call it

Parameters
ctxCurrently executing context
selfThe this parameter of the function call
nameThe name of the function
argcThe number of args to pass the function
argvThe array of arguments to pass to the function
rvalThe return value of the function
Returns
TRUE if the function succeeded, otherwise FALSE
shim_bool_t shim_func_call_sym ( shim_ctx_t ctx,
shim_val_t self,
shim_val_t sym,
size_t  argc,
shim_val_t **  argv,
shim_val_t rval 
)

Get the symbol from the object as a function and call it

Parameters
ctxCurrently executing context
selfThe this parameter of the function call
symThe symbol representing the name of the function
argcThe number of args to pass the function
argvThe array of arguments to pass to the function
rvalThe return value of the function
Returns
TRUE if the function succeeded, otherwise FALSE
shim_bool_t shim_func_call_val ( shim_ctx_t ctx,
shim_val_t self,
shim_val_t func,
size_t  argc,
shim_val_t **  argv,
shim_val_t rval 
)

Call the given function

Parameters
ctxCurrently executing context
selfThe this parameter of the function call
funcThe function to be called
argcThe number of args to pass the function
argvThe array of arguments to pass to the function
rvalThe return value of the function
Returns
TRUE if the function succeeded, otherwise FALSE
shim_val_t* shim_func_new ( shim_ctx_t ctx,
shim_func  cfunc,
size_t  argc,
int32_t  flags,
const char *  name,
void *  hint 
)

Create a new javascript function that points to a C function

Parameters
ctxCurrently executing context
cfuncThe function pointer to be executed
argcThe number of arguments the function takes
flagsThe flags for the function
nameThe name of the function
hintArbitrary data to keep associated with the function
Returns
The wrapped function
shim_bool_t shim_make_callback_name ( shim_ctx_t ctx,
shim_val_t obj,
const char *  name,
size_t  argc,
shim_val_t **  argv,
shim_val_t rval 
)

Process the callback for the given name

Parameters
ctxCurrently executing context
objThe this parameter of the function call
nameThe name of the function
argcThe number of args to pass the function
argvThe array of arguments to pass to the function
rvalThe return value of the function
Returns
TRUE if the function succeeded, otherwise FALSE
shim_bool_t shim_make_callback_sym ( shim_ctx_t ctx,
shim_val_t self,
shim_val_t sym,
size_t  argc,
shim_val_t **  argv,
shim_val_t rval 
)

Get a function by symbol and process the callback

Parameters
ctxCurrently executing context
selfThe this parameter of the function call
symThe symbol representing the name of the function
argcThe number of args to pass the function
argvThe array of arguments to pass to the function
rvalThe return value of the function
Returns
TRUE if the function succeeded, otherwise FALSE
shim_bool_t shim_make_callback_val ( shim_ctx_t ctx,
shim_val_t self,
shim_val_t fval,
size_t  argc,
shim_val_t **  argv,
shim_val_t rval 
)

Process the callback for the given function

Parameters
ctxCurrently executing context
selfThe this parameter of the function call
fvalThe function to call
argcThe number of args to pass the function
argvThe array of arguments to pass to the function
rvalThe return value of the function
Returns
TRUE if the function succeeded, otherwise FALSE