Coin Logo http://www.coin3d.org/
http://www.kongsberg.com/kogt/

spidermonkey.h
Go to the documentation of this file.
1 #ifndef COIN_GLUE_SPIDERMONKEY_H
2 #define COIN_GLUE_SPIDERMONKEY_H
3 
4 /**************************************************************************\
5  * Copyright (c) Kongsberg Oil & Gas Technologies AS
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are
10  * met:
11  *
12  * Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  *
15  * Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in the
17  * documentation and/or other materials provided with the distribution.
18  *
19  * Neither the name of the copyright holder nor the names of its
20  * contributors may be used to endorse or promote products derived from
21  * this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 \**************************************************************************/
35 
36 #include <Inventor/C/basic.h>
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif /* __cplusplus */
41 
42 #if 0 /* to get proper auto-indentation in emacs */
43 }
44 #endif /* emacs indentation */
45 
46 
47 /*
48  This is used to detect whether the 'jsapi.h' was included by the
49  user or not. The JSVERSION_IS_ECMA is defined in the 'jspubtd.h'
50  file in the SpiderMonkey header directory.
51 */
52 #ifndef JSVERSION_IS_ECMA
53 
54 
55 /*
56  Structs and defines.
57 */
58 typedef int JSBool;
59 typedef long jsword;
60 typedef jsword jsval;
61 typedef jsword jsid;
62 typedef int intN;
63 typedef unsigned int uintN;
64 typedef uint16_t jschar;
65 
66 typedef int32_t jsrefcount;
67 typedef uint8_t jsbytecode;
68 typedef uint32_t JSHashNumber;
69 typedef uint32_t jsatomid;
70 
71 typedef enum JSType {
72  JSTYPE_VOID,
73  JSTYPE_OBJECT,
74  JSTYPE_FUNCTION,
75  JSTYPE_STRING,
76  JSTYPE_NUMBER,
77  JSTYPE_BOOLEAN,
78  JSTYPE_LIMIT
79 } JSType;
80 
81 typedef enum JSAccessMode {
82  JSACC_PROTO = 0,
83  JSACC_PARENT = 1,
84  JSACC_IMPORT = 2,
85  JSACC_WATCH = 3,
86  JSACC_READ = 4,
87  JSACC_WRITE = 8,
88  JSACC_LIMIT
89 } JSAccessMode;
90 
91 typedef enum JSGCStatus {
92  JSGC_BEGIN,
93  JSGC_END,
94  JSGC_MARK_END,
95  JSGC_FINALIZE_END
96 } JSGCStatus;
97 
98 struct JSIdArray {
99  int32_t length;
100  jsid vector[1];
101 };
102 
103 typedef void JSRuntime;
104 typedef void JSContext;
105 typedef void JSObject;
106 typedef void JSObjectOps;
107 typedef void JSXDRState;
108 typedef void JSString;
109 typedef struct JSClass JSClass;
110 typedef struct JSPropertySpec JSPropertySpec;
111 typedef int JSVersion;
112 typedef void JSFunction;
113 typedef struct JSFunctionSpec JSFunctionSpec;
114 typedef struct JSErrorReport JSErrorReport;
115 typedef void JSScript;
116 
117 #define JS_DLL_CALLBACK /* FIXME: set up this define properly. 20050601 mortene. */
118 
119 typedef JSBool (* JS_DLL_CALLBACK JSPropertyOp)(JSContext *, JSObject *, jsval, jsval *);
120 typedef JSBool (* JS_DLL_CALLBACK JSEnumerateOp)(JSContext *, JSObject *);
121 typedef JSBool (* JS_DLL_CALLBACK JSResolveOp)(JSContext *, JSObject *, jsval);
122 typedef JSBool (* JS_DLL_CALLBACK JSConvertOp)(JSContext *, JSObject *, JSType, jsval *);
123 typedef void (* JS_DLL_CALLBACK JSFinalizeOp)(JSContext *, JSObject *);
124 typedef JSObjectOps * (* JS_DLL_CALLBACK JSGetObjectOps)(JSContext *, JSClass *);
125 typedef JSBool (* JS_DLL_CALLBACK JSCheckAccessOp)(JSContext *, JSObject *, jsval, JSAccessMode, jsval *);
126 typedef JSBool (* JS_DLL_CALLBACK JSNative)(JSContext *, JSObject *, uintN, jsval *, jsval *);
127 typedef JSBool (* JS_DLL_CALLBACK JSXDRObjectOp)(JSXDRState *, JSObject **);
128 typedef JSBool (* JS_DLL_CALLBACK JSHasInstanceOp)(JSContext *, JSObject *, jsval, JSBool *);
129 typedef uint32_t (* JS_DLL_CALLBACK JSMarkOp)(JSContext *, JSObject *, void *);
130 
131 struct JSClass {
132  const char * name;
133  uint32_t flags;
134  JSPropertyOp addProperty;
135  JSPropertyOp delProperty;
136  JSPropertyOp getProperty;
137  JSPropertyOp setProperty;
138  JSEnumerateOp enumerate;
139  JSResolveOp resolve;
140  JSConvertOp convert;
141  JSFinalizeOp finalize;
142  JSGetObjectOps getObjectOps;
143  JSCheckAccessOp checkAccess;
144  JSNative call;
145  JSNative construct;
146  JSXDRObjectOp xdrObject;
147  JSHasInstanceOp hasInstance;
148  JSMarkOp mark;
149  jsword spare;
150 };
151 
152 struct JSPropertySpec {
153  const char * name;
154  int8_t tinyid;
155  uint8_t flags;
156  JSPropertyOp getter;
157  JSPropertyOp setter;
158 };
159 
160 struct JSFunctionSpec {
161  const char *name;
162  JSNative call;
163  uint8_t nargs;
164  uint8_t flags;
165  uint16_t extra;
166 };
167 
168 struct JSErrorReport {
169  const char * filename;
170  uintN lineno;
171  const char * linebuf;
172  const char * tokenptr;
173  const jschar * uclinebuf;
174  const jschar * uctokenptr;
175  uintN flags;
176  uintN errorNumber;
177  const jschar * ucmessage;
178  const jschar ** messageArgs;
179 };
180 
181 
182 /* Defines and macros. ************************************************** */
183 
184 #define JSVAL_OBJECT 0x0
185 #define JSVAL_INT 0x1
186 #define JSVAL_DOUBLE 0x2
187 #define JSVAL_STRING 0x4
188 #define JSVAL_BOOLEAN 0x6
189 
190 #define JS_BIT(n) ((uint32_t)1 << (n))
191 #define JS_BITMASK(n) (JS_BIT(n) - 1)
192 
193 #define JSVAL_TAGBITS 3
194 #define JSVAL_TAGMASK JS_BITMASK(JSVAL_TAGBITS)
195 #define JSVAL_TAG(v) ((v) & JSVAL_TAGMASK)
196 #define JSVAL_SETTAG(v,t) ((v) | (t))
197 #define JSVAL_CLRTAG(v) ((v) & ~(jsval)JSVAL_TAGMASK)
198 
199 #define JSVAL_IS_PRIMITIVE(v) (!JSVAL_IS_OBJECT(v) || JSVAL_IS_NULL(v))
200 #define JSVAL_IS_OBJECT(v) (JSVAL_TAG(v) == JSVAL_OBJECT)
201 #define JSVAL_IS_NUMBER(v) (JSVAL_IS_INT(v) || JSVAL_IS_DOUBLE(v))
202 #define JSVAL_IS_INT(v) (((v) & JSVAL_INT) && (v) != JSVAL_VOID)
203 #define JSVAL_IS_DOUBLE(v) (JSVAL_TAG(v) == JSVAL_DOUBLE)
204 #define JSVAL_IS_STRING(v) (JSVAL_TAG(v) == JSVAL_STRING)
205 #define JSVAL_IS_BOOLEAN(v) (JSVAL_TAG(v) == JSVAL_BOOLEAN)
206 #define JSVAL_IS_NULL(v) ((v) == JSVAL_NULL)
207 #define JSVAL_IS_VOID(v) ((v) == JSVAL_VOID)
208 
209 #define BOOLEAN_TO_JSVAL(b) JSVAL_SETTAG((jsval)(b) << JSVAL_TAGBITS, JSVAL_BOOLEAN)
210 #define JSVAL_TO_BOOLEAN(v) ((JSBool)((v) >> JSVAL_TAGBITS))
211 
212 #define JSVAL_INT_BITS 31
213 #define JSVAL_INT_POW2(n) ((jsval)1 << (n))
214 #define JSVAL_INT_MIN ((jsval)1 - JSVAL_INT_POW2(30))
215 #define JSVAL_INT_MAX (JSVAL_INT_POW2(30) - 1)
216 #define INT_FITS_IN_JSVAL(i) ((uint32_t)((i)+JSVAL_INT_MAX) <= 2*JSVAL_INT_MAX)
217 #define JSVAL_TO_INT(v) ((int32_t)(v) >> 1)
218 #define INT_TO_JSVAL(i) (((jsval)(i) << 1) | JSVAL_INT)
219 
220 #define JSVAL_TO_GCTHING(v) ((void *)JSVAL_CLRTAG(v))
221 #define JSVAL_TO_OBJECT(v) ((JSObject *)JSVAL_TO_GCTHING(v))
222 #define JSVAL_TO_DOUBLE(v) ((double *)JSVAL_TO_GCTHING(v))
223 #define JSVAL_TO_STRING(v) ((JSString *)JSVAL_TO_GCTHING(v))
224 #define OBJECT_TO_JSVAL(obj) ((jsval)(obj))
225 #define DOUBLE_TO_JSVAL(dp) JSVAL_SETTAG((jsval)(dp), JSVAL_DOUBLE)
226 #define STRING_TO_JSVAL(str) JSVAL_SETTAG((jsval)(str), JSVAL_STRING)
227 #define JSVAL_TO_PRIVATE(v) ((void *)((v) & ~JSVAL_INT))
228 #define PRIVATE_TO_JSVAL(p) ((jsval)(p) | JSVAL_INT)
229 
230 #define JSPROP_ENUMERATE 0x01
231 #define JSPROP_READONLY 0x02
232 #define JSPROP_PERMANENT 0x04
233 #define JSPROP_EXPORTED 0x08
234 #define JSPROP_GETTER 0x10
235 #define JSPROP_SETTER 0x20
236 #define JSPROP_SHARED 0x40
237 #define JSPROP_INDEX 0x80
238 
239 #define JS_FALSE (int)0
240 #define JS_TRUE (int)1
241 
242 #define JSVAL_VOID INT_TO_JSVAL(0 - JSVAL_INT_POW2(30))
243 #define JSVAL_NULL OBJECT_TO_JSVAL(0)
244 #define JSVAL_ZERO INT_TO_JSVAL(0)
245 #define JSVAL_ONE INT_TO_JSVAL(1)
246 #define JSVAL_FALSE BOOLEAN_TO_JSVAL(JS_FALSE)
247 #define JSVAL_TRUE BOOLEAN_TO_JSVAL(JS_TRUE)
248 
249 #define JSCLASS_HAS_PRIVATE (1<<0)
250 #define JSCLASS_NEW_ENUMERATE (1<<1)
251 #define JSCLASS_NEW_RESOLVE (1<<2)
252 #define JSCLASS_PRIVATE_IS_NSISUPPORTS (1<<3)
253 #define JSCLASS_SHARE_ALL_PROPERTIES (1<<4)
254 #define JSCLASS_NEW_RESOLVE_GETS_START (1<<5)
255 
256 #define JSFUN_BOUND_METHOD 0x40
257 
258 #define JSOPTION_STRICT JS_BIT(0)
259 #define JSOPTION_WERROR JS_BIT(1)
260 #define JSOPTION_VAROBJFIX JS_BIT(2)
261 #define JSOPTION_PRIVATE_IS_NSISUPPORTS JS_BIT(3)
262 #define JSOPTION_COMPILE_N_GO JS_BIT(4)
263 
264 
265 /* Function typedefs. *************************************************** */
266 
267 typedef void (* JS_DLL_CALLBACK JSErrorReporter)(JSContext *, const char *, JSErrorReport *);
268 typedef JSBool (* JS_DLL_CALLBACK JSGCCallback)(JSContext *, JSGCStatus);
269 
270 #endif /* !JSVERSION_IS_ECMA */
271 
272 typedef JSBool (* JS_EvaluateScript_t)(JSContext *, JSObject *, const char *, uintN, const char *, uintN, jsval *);
273 typedef JSString * (* JS_ValueToString_t)(JSContext *, jsval);
274 typedef char * (* JS_GetStringBytes_t)(JSString *);
275 typedef JSBool (* JS_SetProperty_t)(JSContext *, JSObject *, const char *, jsval *);
276 typedef JSBool (* JS_GetProperty_t)(JSContext *, JSObject *, const char *, jsval *);
277 typedef JSBool (* JS_CallFunctionName_t)(JSContext *, JSObject *, const char *, uintN, jsval *, jsval *);
278 typedef JSBool (* JS_CallFunctionValue_t)(JSContext *, JSObject *, jsval, uintN, jsval *, jsval *);
279 typedef JSObject * (* JS_ConstructObjectWithArguments_t)(JSContext *, JSClass *, JSObject *, JSObject *, uintN, jsval *);
280 typedef JSRuntime * (* JS_NewRuntime_t)(uint32_t);
281 typedef void (* JS_DestroyRuntime_t)(JSRuntime *);
282 typedef JSContext * (* JS_NewContext_t)(JSRuntime *, size_t);
283 typedef void (* JS_DestroyContext_t)(JSContext *);
284 typedef void (* JS_ShutDown_t)(void);
285 typedef JSObject * (* JS_NewObject_t)(JSContext *, JSClass *, JSObject *, JSObject *);
286 typedef JSBool (* JS_InitStandardClasses_t)(JSContext *, JSObject *);
287 typedef JSErrorReporter (* JS_SetErrorReporter_t)(JSContext *, JSErrorReporter);
288 typedef JSBool (* JS_PropertyStub_t)(JSContext *, JSObject *, jsval, jsval *);
289 typedef JSBool (* JS_EnumerateStub_t)(JSContext *, JSObject *);
290 typedef JSBool (* JS_ResolveStub_t)(JSContext *, JSObject *, jsval);
291 typedef JSBool (* JS_ConvertStub_t)(JSContext *, JSObject *, JSType, jsval *);
292 typedef void (* JS_FinalizeStub_t)(JSContext *, JSObject *);
293 typedef const char * (* JS_GetImplementationVersion_t)(void);
294 typedef void * (* JS_GetPrivate_t)(JSContext *, JSObject *);
295 typedef JSBool (* JS_SetPrivate_t)(JSContext *, JSObject *, void *);
296 typedef JSFunction * (* JS_NewFunction_t)(JSContext *, JSNative, uintN, uintN flags, JSObject *, const char *);
297 typedef JSObject * (* JS_GetFunctionObject_t)(JSFunction *);
298 typedef JSObject * (* JS_DefineObject_t)(JSContext *, JSObject *, const char *, JSClass *, JSObject *, uintN);
299 typedef JSBool (* JS_DefineProperties_t)(JSContext *, JSObject *, JSPropertySpec *);
300 typedef JSObject * (* JS_GetParent_t)(JSContext *, JSObject *);
301 typedef JSBool (* JS_SetParent_t)(JSContext *, JSObject *, JSObject *);
302 typedef JSBool (* JS_DefineFunctions_t)(JSContext *, JSObject *, JSFunctionSpec *);
303 typedef JSString * (* JS_NewStringCopyZ_t)(JSContext *, const char *);
304 typedef JSType (* JS_TypeOfValue_t)(JSContext *, jsval);
305 typedef const char * (* JS_GetTypeName_t)(JSContext *, JSType);
306 typedef JSBool (* JS_InstanceOf_t)(JSContext *, JSObject *, JSClass *, jsval *);
307 typedef JSObject * (* JS_InitClass_t)(JSContext *, JSObject *, JSObject *, JSClass *,
308  JSNative, uintN, JSPropertySpec *, JSFunctionSpec *,
309  JSPropertySpec *, JSFunctionSpec *);
310 typedef JSBool (* JS_NewDoubleValue_t)(JSContext *, double, jsval *);
311 typedef void * (* JS_GetContextPrivate_t)(JSContext *);
312 typedef void (* JS_SetContextPrivate_t)(JSContext *, void *);
313 typedef JSBool (* JS_ValueToBoolean_t)(JSContext *, jsval, JSBool *);
314 typedef JSBool (* JS_ValueToNumber_t)(JSContext *, jsval, double *);
315 typedef JSObject * (* JS_NewArrayObject_t)(JSContext *, int32_t, jsval *);
316 typedef JSBool (* JS_GetArrayLength_t)(JSContext *, JSObject *, uint32_t *);
317 typedef JSBool (* JS_SetArrayLength_t)(JSContext *, JSObject *, uint32_t);
318 typedef JSBool (* JS_HasArrayLength_t)(JSContext *, JSObject *, uint32_t *);
319 typedef JSBool (* JS_GetElement_t)(JSContext *, JSObject *, int32_t, jsval *);
320 typedef JSBool (* JS_SetElement_t)(JSContext *, JSObject *, int32_t, jsval *);
321 typedef JSBool (* JS_AddRoot_t)(JSContext *, void *);
322 typedef JSBool (* JS_RemoveRoot_t)(JSContext *, void *);
323 typedef size_t (* JS_GetStringLength_t)(JSString *);
324 typedef JSBool (* JS_LookupProperty_t)(JSContext *, JSObject *, const char *, jsval *);
325 typedef JSBool (* JS_DefineProperty_t)(JSContext *, JSObject *, const char *, jsval, JSPropertyOp, JSPropertyOp, uintN);
326 typedef JSScript * (* JS_CompileFile_t)(JSContext *, JSObject *, const char *);
327 typedef JSBool (* JS_ValueToObject_t)(JSContext *, jsval, JSObject **);
328 typedef JSBool (* JS_ExecuteScript_t)(JSContext *, JSObject *, JSScript *, jsval *);
329 typedef JSBool (* JS_IsExceptionPending_t)(JSContext *);
330 typedef JSBool (* JS_GetPendingException_t)(JSContext *, jsval *);
331 typedef void (* JS_SetPendingException_t)(JSContext *, jsval);
332 typedef void (* JS_ClearPendingException_t)(JSContext *);
333 typedef double * (* JS_NewDouble_t)(JSContext *, double);
334 typedef JSBool (* JS_CallFunction_t)(JSContext *, JSObject *, JSFunction *, uintN, jsval *, jsval *);
335 typedef JSFunction * (* JS_ValueToFunction_t)(JSContext *, jsval);
336 typedef void (* JS_ReportError_t)(JSContext *, const char *, ...);
337 typedef JSBool (* JS_IsArrayObject_t)(JSContext *, JSObject *);
338 typedef JSBool (* JS_ObjectIsFunction_t)(JSContext *, JSObject *);
339 typedef JSBool (* JS_ValueToECMAInt32_t)(JSContext *, jsval, int32_t *);
340 typedef JSFunction * (* JS_DefineFunction_t)(JSContext *, JSObject *, const char *, JSNative, uintN, uintN);
341 typedef JSObject * (* JS_GetGlobalObject_t)(JSContext *);
342 typedef JSGCCallback (* JS_SetGCCallback_t)(JSContext *, JSGCCallback);
343 typedef void (* JS_GC_t)(JSContext *);
344 typedef void (* JS_MaybeGC_t)(JSContext *);
345 typedef JSBool (* JS_IsRunning_t)(JSContext *);
346 typedef JSBool (* JS_DeleteProperty_t)(JSContext *, JSObject *, const char *);
347 typedef JSScript * (* JS_CompileScript_t)(JSContext *, JSObject *,
348  const char *, size_t,
349  const char *, uintN);
350 typedef jsval (* JS_GetNaNValue_t)(JSContext *);
351 typedef jsval (* JS_GetNegativeInfinityValue_t)(JSContext *);
352 typedef jsval (* JS_GetPositiveInfinityValue_t)(JSContext *);
353 typedef jsval (* JS_GetEmptyStringValue_t)(JSContext *);
354 typedef JSBool (* JS_SetPropertyAttributes_t)(JSContext *, JSObject *, const char *, uintN, JSBool *);
355 typedef JSBool (* JS_GetPropertyAttributes_t)(JSContext *, JSObject *, const char *, uintN *, JSBool *);
356 typedef JSClass * (* JS_GetClass_t)(JSObject *);
357 typedef JSObject * (* JS_GetPrototype_t)(JSContext *, JSObject *);
358 typedef JSObject * (* JS_SetPrototype_t)(JSContext *, JSObject *, JSObject *);
359 typedef intN (* JS_CompareStrings_t)(JSString *, JSString *);
360 typedef uint32_t (* JS_GetOptions_t)(JSContext *);
361 typedef uint32_t (* JS_SetOptions_t)(JSContext *, uint32_t);
362 typedef uint32_t (* JS_ToggleOptions_t)(JSContext *, uint32_t);
363 typedef struct JSIdArray * (* JS_Enumerate_t)(JSContext *, JSObject *);
364 typedef JSBool (* JS_IdToValue_t)(JSContext *, jsid, jsval *);
365 typedef const char * (* JS_GetFunctionName_t)(JSFunction *);
366 typedef JSObject * (* JS_GetConstructor_t)(JSContext *, JSObject *);
367 typedef void (* JS_DestroyIdArray_t)(JSContext *, struct JSIdArray *);
368 
369 
370 /* Access interface. **************************************************** */
371 
372 typedef struct {
373  int available;
374 
375  JS_CallFunctionName_t JS_CallFunctionName;
376  JS_CallFunctionValue_t JS_CallFunctionValue;
377  JS_ConstructObjectWithArguments_t JS_ConstructObjectWithArguments;
378  JS_ConvertStub_t JS_ConvertStub;
379  JS_DestroyContext_t JS_DestroyContext;
380  JS_DestroyRuntime_t JS_DestroyRuntime;
381  JS_EnumerateStub_t JS_EnumerateStub;
382  JS_EvaluateScript_t JS_EvaluateScript;
383  JS_FinalizeStub_t JS_FinalizeStub;
384  JS_GetClass_t JS_GetClass;
385  JS_GetImplementationVersion_t JS_GetImplementationVersion;
386  JS_GetProperty_t JS_GetProperty;
387  JS_GetStringBytes_t JS_GetStringBytes;
388  JS_InitStandardClasses_t JS_InitStandardClasses;
389  JS_NewContext_t JS_NewContext;
390  JS_NewObject_t JS_NewObject;
391  JS_NewRuntime_t JS_NewRuntime;
392  JS_PropertyStub_t JS_PropertyStub;
393  JS_ResolveStub_t JS_ResolveStub;
394  JS_SetErrorReporter_t JS_SetErrorReporter;
395  JS_SetProperty_t JS_SetProperty;
396  JS_ShutDown_t JS_ShutDown;
397  JS_ValueToString_t JS_ValueToString;
398  JS_DefineObject_t JS_DefineObject;
399  JS_DefineProperties_t JS_DefineProperties;
400  JS_GetPrivate_t JS_GetPrivate;
401  JS_SetPrivate_t JS_SetPrivate;
402  JS_NewFunction_t JS_NewFunction;
403  JS_GetFunctionObject_t JS_GetFunctionObject;
404  JS_GetParent_t JS_GetParent;
405  JS_SetParent_t JS_SetParent;
406  JS_DefineFunctions_t JS_DefineFunctions;
407  JS_NewStringCopyZ_t JS_NewStringCopyZ;
408  JS_TypeOfValue_t JS_TypeOfValue;
409  JS_GetTypeName_t JS_GetTypeName;
410  JS_InstanceOf_t JS_InstanceOf;
411  JS_InitClass_t JS_InitClass;
412  JS_NewDoubleValue_t JS_NewDoubleValue;
413  JS_GetContextPrivate_t JS_GetContextPrivate;
414  JS_SetContextPrivate_t JS_SetContextPrivate;
415  JS_ValueToBoolean_t JS_ValueToBoolean;
416  JS_ValueToNumber_t JS_ValueToNumber;
417  JS_NewArrayObject_t JS_NewArrayObject;
418  JS_GetArrayLength_t JS_GetArrayLength;
419  JS_SetArrayLength_t JS_SetArrayLength;
420  JS_HasArrayLength_t JS_HasArrayLength;
421  JS_GetElement_t JS_GetElement;
422  JS_SetElement_t JS_SetElement;
423  JS_AddRoot_t JS_AddRoot;
424  JS_RemoveRoot_t JS_RemoveRoot;
425  JS_GetStringLength_t JS_GetStringLength;
426  JS_LookupProperty_t JS_LookupProperty;
427  JS_DefineProperty_t JS_DefineProperty;
428  JS_CompileFile_t JS_CompileFile;
429  JS_ValueToObject_t JS_ValueToObject;
430  JS_ExecuteScript_t JS_ExecuteScript;
431  JS_IsExceptionPending_t JS_IsExceptionPending;
432  JS_GetPendingException_t JS_GetPendingException;
433  JS_SetPendingException_t JS_SetPendingException;
434  JS_ClearPendingException_t JS_ClearPendingException;
435  JS_NewDouble_t JS_NewDouble;
436  JS_CallFunction_t JS_CallFunction;
437  JS_ValueToFunction_t JS_ValueToFunction;
438  JS_ReportError_t JS_ReportError;
439  JS_IsArrayObject_t JS_IsArrayObject;
440  JS_ObjectIsFunction_t JS_ObjectIsFunction;
441  // Note: We use this function instead of JS_ValueToInt32() since the
442  // latter is buggy in versions of SpiderMonkey older than 2005-09-29,
443  // see Mozilla bug #284032.
444  JS_ValueToECMAInt32_t JS_ValueToECMAInt32;
445  JS_DefineFunction_t JS_DefineFunction;
446  JS_GetGlobalObject_t JS_GetGlobalObject;
447  JS_SetGCCallback_t JS_SetGCCallback;
448  JS_GC_t JS_GC;
449  JS_MaybeGC_t JS_MaybeGC;
450  JS_IsRunning_t JS_IsRunning;
451  JS_DeleteProperty_t JS_DeleteProperty;
452  JS_CompileScript_t JS_CompileScript;
453  JS_GetNaNValue_t JS_GetNaNValue;
454  JS_GetNegativeInfinityValue_t JS_GetNegativeInfinityValue;
455  JS_GetPositiveInfinityValue_t JS_GetPositiveInfinityValue;
456  JS_GetEmptyStringValue_t JS_GetEmptyStringValue;
457  JS_SetPropertyAttributes_t JS_SetPropertyAttributes;
458  JS_GetPropertyAttributes_t JS_GetPropertyAttributes;
459  JS_GetPrototype_t JS_GetPrototype;
460  JS_SetPrototype_t JS_SetPrototype;
461  JS_CompareStrings_t JS_CompareStrings;
462  JS_GetOptions_t JS_GetOptions;
463  JS_SetOptions_t JS_SetOptions;
464  JS_ToggleOptions_t JS_ToggleOptions;
465  JS_Enumerate_t JS_Enumerate;
466  JS_IdToValue_t JS_IdToValue;
467  JS_GetFunctionName_t JS_GetFunctionName;
468  JS_GetConstructor_t JS_GetConstructor;
469  JS_DestroyIdArray_t JS_DestroyIdArray;
470 
471 } SpiderMonkey_t;
472 
473 COIN_DLL_API const SpiderMonkey_t * spidermonkey(void);
474 
475 #ifdef __cplusplus
476 }
477 #endif /* __cplusplus */
478 
479 #endif /* !COIN_GLUE_SPIDERMONKEY_H */

Copyright © by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated for Coin by Doxygen