Integrating C functions
537
(mmEnv.objectType ? (*(mmEnv.objectType))(o) : (unsigned short *)0)
/* JSObject *JS_NewArrayObject(JSContext *cx, unsigned int length, jsval
*v) */
#define JS_NewArrayObject(c, l, v) \
(mmEnv.newArrayObject ? (*(mmEnv.newArrayObject))(c, l, v) : (JSObject
*)0)
/* long JS_GetArrayLength(JSContext *cx, JSObject *obj) */
#define JS_GetArrayLength(c, o) \
(mmEnv.getArrayLength ? (*(mmEnv.getArrayLength))(c, o) : -1)
/* JSBool JS_GetElement(JSContext *cx, JSObject *obj, jsint idx, jsval *vp)
*/
#define JS_GetElement(c, o, i, v) \
(mmEnv.getElement ? (*(mmEnv.getElement))(c, o, i, v) : JS_FALSE)
/* JSBool JS_SetElement(JSContext *cx, JSObject *obj, jsint idx, jsval *vp)
*/
#define JS_SetElement(c, o, i, v) \
(mmEnv.setElement ? (*(mmEnv.setElement))(c, o, i, v) : JS_FALSE)
/* JSBool JS_ExecuteScript(JSContext *cx, JSObject *obj, unsigned short
*script,
* unsigned int sz, jsval *rval) */
#define JS_ExecuteScript(c, o, s, z, r) \
(mmEnv.executeScript ? (*(mmEnv.executeScript))(c, o, s, z,
_T(__FILE__), \
__LINE__, r) : JS_FALSE)
/* JSBool JS_ReportError(JSContext *cx, unsigned short *error, unsigned int
sz) */
#define JS_ReportError(c, e, s) \
(mmEnv.reportError ? (*(mmEnv.reportError))(c, e, s) : JS_FALSE)
/
************************************************************************
*****
* Private data types, macros, and globals
************************************************************************
****/
typedef struct {
JSObject *libObj;
JSBool (*defineFunction)(JSObject *libObj, unsigned short *name,
JSNative call,
unsigned int nargs);
Содержание FLASH 8-EXTENDING FLASH
Страница 1: ...Extending Flash...
Страница 38: ...38 Top Level Functions and Methods...
Страница 532: ...532 Objects...
Страница 554: ...554 C Level Extensibility...