static JSBool SMJS_FUNCTION(upnp_action_get_error_code) { NPT_String res; SMJS_OBJ PLT_Action *action = (PLT_Action *) SMJS_GET_PRIVATE(c, obj); if (!action ) return JS_FALSE; SMJS_SET_RVAL( INT_TO_JSVAL( action->GetErrorCode() )); return JS_TRUE; }
static JSBool SMJS_FUNCTION(upnp_action_get_error) { NPT_String res; unsigned int code; SMJS_OBJ PLT_Action *action = (PLT_Action *) SMJS_GET_PRIVATE(c, obj); if (!action ) return JS_FALSE; SMJS_SET_RVAL( STRING_TO_JSVAL( JS_NewStringCopyZ(c, action->GetError( &code ) ) ) ); return JS_TRUE; }
static JSBool SMJS_FUNCTION(upnp_action_get_error_code) { NPT_String res; char *arg_name = NULL; SMJS_OBJ PLT_Action *action = (PLT_Action *) JS_GetPrivate(c, obj); if (!action ) return JS_FALSE; SMJS_SET_RVAL( INT_TO_JSVAL( action->GetErrorCode() )); return JS_TRUE; }
static JSBool SMJS_FUNCTION(upnp_action_get_error) { NPT_String res; unsigned int code; char *arg_name = NULL; SMJS_OBJ PLT_Action *action = (PLT_Action *) JS_GetPrivate(c, obj); if (!action ) return JS_FALSE; SMJS_SET_RVAL( STRING_TO_JSVAL( JS_NewStringCopyZ(c, action->GetError( code ) ) ) ); return JS_TRUE; }
static JSBool SMJS_FUNCTION(upnp_action_get_argument_value) { NPT_String res; char *arg_name = NULL; SMJS_OBJ SMJS_ARGS PLT_Action *action = (PLT_Action *) SMJS_GET_PRIVATE(c, obj); if (!action || !argc || !JSVAL_IS_STRING(argv[0])) return JS_FALSE; arg_name = SMJS_CHARS(c, argv[0]); if (!arg_name) return JS_FALSE; action->GetArgumentValue(arg_name, res); SMJS_SET_RVAL( STRING_TO_JSVAL( JS_NewStringCopyZ(c, res) )); SMJS_FREE(c, arg_name); return JS_TRUE; }