The C-Level Api - Adobe 38040334 - Dreamweaver CS3 User Manual

Extending dreamweaver
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

typedef struct jsval jsval
An opaque data structure that can contain an integer, or a pointer to a floating-point number, string, or object. Some
functions in the API can read the values of function arguments by reading the contents of a
some can be used to write the function's return value by writing a
typedef enum { JS_FALSE = 0, JS_TRUE = 1 } JSBool
A simple data type that stores a Boolean value.

The C-level API

The C-level extensibility API consists of the following functions:
typedef JSBool (*JSNative)(JSContext *cx, JSObject *obj, unsigned int argc, jsval
*argv, jsval *rval)
Description
This function signature describes C-level implementations of JavaScript functions in the following situations:
• The
pointer is a pointer to an opaque
cx
the JavaScript API. This variable holds the interpreter's execution context.
• The
pointer is a pointer to the object in whose context the script executes. While the script is running, the
obj
keyword is equal to this object.
this
• The
integer is the number of arguments being passed to the function.
argc
• The
pointer is a pointer to an array of
argv
• The
pointer is a pointer to a single
rval
The function returns
JS_TRUE
script stops executing and an error message appears.
JSBool JS_DefineFunction()
Description
This function registers a C-level function with the JavaScript interpreter in Dreamweaver. After the
function registers the C-level function that you specify in the
JS_DefineFunction()
invoke it in a JavaScript script by referring to it with the name that you specify in the
argument is case-sensitive.
Typically, this function is called from the
Arguments
,
char *name
JSNative call
• The
argument is the name of the function as it is exposed to JavaScript.
name
• The
argument is a pointer to a C-level function. The function must accept the same arguments as
call
, and it must return a
readContentsOfFile
structure, which must be passed to some of the functions in
JSContext
structures. The array is
JSVal
structure. The function's return value should be written to
JSVal
if successful;
otherwise. If the function returns
JS_FALSE
function, which Dreamweaver calls during startup.
MM_Init()
,
unsigned int nargs
, which indicates success or failure.
JSBool
JSVal
structure.
JSVal
elements in length.
argc
JS_FALSE
argument, you can
call
argument. The
name
DREAMWEAVER CS3
348
Extending Dreamweaver
structure, and
.
*rval
, the current
name

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents