AcornSearch - Acorn and RISC OS information searching
RISC OS Search
containing
"Nutty quip goes here!"
Home  |  About  |  Filebase Archive  |  StrongHelp Manuals  |  Newsgroups  |  Module Database
Entry:     JS_DefineFunctions (Function)
Summary:     Creates one or more functions for a JS object.
Syntax:
JSBool JS_DefineFunctions(JSContext *cx, JSObject *obj,
JSFunctionSpec *fs);

     Argument     Type     Description
     cx     JSContext *     Pointer to a JS context from which to derive runtime information.
                 
     obj     JSObject *     Object for which to define functions.
                 
     fs     JSFunctionSpec *     A null-terminated array of function specifications. Each element of the array defines an individual function, its name, the built-in native C call it wraps, the number of arguments it takes, and its attribute flag.
                 
Description:
JS_DefineFunctions creates one or more functions and makes them properties (methods) of a specified object, obj

fs is a pointer to the first element of an array of JSFunctionSpec. Each array element defines a single function: its name, the native C call wrapped by the function, the number of arguments passed to the function, and its attribute flags. The last element of the array must contain zero values. JS_DefineFunctions creates one function for each non-zero element in the array.

JS_DefineFunctions always returns JS_TRUE, indicating it has created all functions specified in the array.


See also:
JS_CallFunction
JS_CallFunctionName
JS_CallFunctionValue
JS_CompileFunction
JS_CompileUCFunction
JS_DecompileFunction
JS_DecompileFunctionBody
JS_DefineConstDoubles
JS_DefineElement
JS_DefineFunction
JS_DefineObject
JS_DefineProperties
JS_DefineProperty
JS_DefinePropertyWithTinyId
JS_GetFunctionName
JS_GetFunctionObject
JS_NewFunction
JS_SetBranchCallback
JS_ValueToFunction

[sh-index] Back to list of manuals