The C-level API
461
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
cx
pointer is a pointer to an opaque
JSContext
structure, which must be passed to
some of the functions in the JavaScript API. This variable holds the interpreter’s execution
context.
■
The
obj
pointer is a pointer to the object in whose context the script executes. While the
script is running, the
this
keyword is equal to this object.
■
The
argc
integer is the number of arguments being passed to the function.
■
The
argv
pointer is a pointer to an array of
jsval
structures. The array is
argc
elements
in length.
■
The
rval
pointer is a pointer to a single
jsval
structure. The function’s return value
should be written to
*rval
.
The function returns
JS_TRUE
if successful;
JS_FALSE
otherwise. If the function returns
JS_FALSE
, the current 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
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 Dreamweaver calls
during startup.
Summary of Contents for DREAMWEAVER 8-EXTENDING DREAMWEAVER
Page 1: ...Extending Dreamweaver...
Page 8: ...8 Contents...
Page 14: ...14 Introduction...
Page 16: ......
Page 54: ...54 Customizing Dreamweaver...
Page 96: ...96 Customizing Code View...
Page 98: ......
Page 110: ...110 Extending Dreamweaver...
Page 138: ......
Page 166: ...166 Insert Bar Objects...
Page 180: ...180 Commands...
Page 248: ...248 Toolbars...
Page 260: ...260 Reports...
Page 278: ...278 Tag Libraries and Editors...
Page 288: ...288 Property Inspectors...
Page 378: ...378 Server Behaviors...
Page 398: ...398 Data Sources...
Page 432: ...432 Server Models...
Page 456: ...456 Data Translators...
Page 482: ......
Page 492: ...492 The Shared Folder...