[Contents] [Previous] [Next] [Index]

registerCFunction

Registers an external function for use with a server-side JavaScript application.

Server-side function

Implemented in

LiveWire 1.0

Syntax

registerCFunction(JSFunctionName, libraryPath,
   externalFunctionName)

Parameters

JSFunctionName
The name of the function as it is called in JavaScript.

libraryPath
The full filename and path of the library, using the conventions of your operating system.

externalFunctionName
The name of the function as it is defined in the library.

Description

registerCFunction is a top-level server-side JavaScript function that is not associated with any object.

Use registerCFunction to make an external function available to a server-side JavaScript application. The function can be written in any language, but you must use C calling conventions.

To use an external function in a server-side JavaScript application, register the function with registerCFunction, and then call it with the callC function. Once an application registers a function, you can call the function any number of times.

The registerCFunction function returns true if the external function is registered successfully; otherwise, it returns false. For example, registerCFunction can return false if the JavaScript runtime engine cannot find either the library or the specified function inside the library.

To use a backslash (\) character as a directory separator in the libraryPath parameter, you must enter a double backslash (\\). The single backslash is a reserved character.

Examples

See the example for the callC function.

See also

callC


[Contents] [Previous] [Next] [Index]

Last Updated: 10/31/97 16:38:00


Copyright ?1997 Netscape Communications Corporation