JSBool JS_DefineFunction()
Description
This function registers a C-level function with the JavaScript interpreter in Adobe Dreamweaver. After the JS_DefineFunction() function registers the C-level function that you specify in the call argument, you can invoke it in a JavaScript script by referring to it with the name that you specify in the name argument. The name is case-sensitive.
Typically, this function is called from the MM_Init() function, which Adobe Dreamweaver calls during startup.
Arguments
char *name, JSNative call, unsigned int nargs
- The
nameargument is the name of the function as it is exposed to JavaScript. - The
callargument is a pointer to a C-level function. The function must accept the same arguments asreadContentsOfFile, and it must return aJSBool, which indicates success or failure. - The
nargsargument is the number of arguments that the function expects to receive.
Returns
A Boolean value: JS_TRUE indicates success; JS_FALSE indicates failure.