462
C-Level Extensibility
Arguments
char
*name
,
JSNative
call
,
unsigned int
nargs
■
The
name
argument is the name of the function as it is exposed to JavaScript.
■
The
call
argument is a pointer to a C-level function. The function must accept the same
arguments as
readContentsOfFile
, and it must return a
JSBool
, which indicates success
or failure.
■
The
nargs
argument is the number of arguments that the function expects to receive.
Returns
A Boolean value:
JS_TRUE
indicates success;
JS_FALSE
indicates failure.
char *JS_ValueToString()
Description
This function extracts a function argument from a
jsval
structure, converts it to a string, if
possible, and passes the converted value back to the caller.
Arguments
JSContext
*cx
,
jsval
v
,
unsigned int
*pLength
■
The
cx
argument is the opaque
JSContext
pointer that passes to the JavaScript function.
■
The
v
argument is the
jsval
structure
from which the string is to be extracted.
■
The
pLength
argument is a pointer to an unsigned integer. This function sets
*plength
equal to the length of the string in bytes.
Returns
A pointer that points to a null-terminated string if successful or to a
null
value on failure.
The calling routine must not free this string when it finishes.
JSBool JS_ValueToInteger()
Description
This function extracts a function argument from a
jsval
structure, converts it to an integer
(if possible), and passes the converted value back to the caller.
NO
TE
Do not modify the returned buffer pointer or you might corrupt the data structures of the
JavaScript interpreter. To change the string, you must copy the characters into another
buffer and create a new JavaScript string.
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...