Integrating C functions
535
To get a copy of the mm_jsapi.h file, extract it from the sample ZIP or SIT file (see
“Sample
DLL implementation” on page 540
), or copy the following code into a file that you name
mm_jsapi.h:
#ifndef _MM_JSAPI_H_
#define _MM_JSAPI_H_
/
************************************************************************
*****
* Public data types
************************************************************************
****/
typedef struct JSContext JSContext;
typedef struct JSObject JSObject;
typedef long jsval;
#ifndef JSBool
typedef long JSBool;
#endif
typedef JSBool (*JSNative)(JSContext *cx, JSObject *obj, unsigned int argc,
jsval *argv, jsval *rval);
/* Possible values for JSBool */
#define JS_TRUE 1
#define JS_FALSE 0
/
************************************************************************
*****
* Public functions
************************************************************************
****/
/* JSBool JS_DefineFunction(unsigned short *name, JSNative call, unsigned
int nargs) */
#define JS_DefineFunction(n, c, a) \
(mmEnv.defineFunction ? (*(mmEnv.defineFunction))(mmEnv.libObj, n, c,
a) \
: JS_FALSE)
/* unsigned short *JS_ValueToString(JSContext *cx, jsval v, unsigned int
*pLength) */
#define JS_ValueToString(c, v, l) \
Summary of Contents for FLASH 8-EXTENDING FLASH
Page 1: ...Extending Flash...
Page 38: ...38 Top Level Functions and Methods...
Page 532: ...532 Objects...
Page 554: ...554 C Level Extensibility...