Files
mongo/scripting/engine_spidermonkey.h

61 lines
1.3 KiB
C
Raw Normal View History

// engine_spidermonkey.h
#pragma once
#include "engine.h"
#if defined( MOZJS )
#include "mozjs/jsapi.h"
#include "mozjs/jsdate.h"
#elif defined( OLDJS )
2009-05-13 14:20:20 -04:00
#ifdef WIN32
#include "jstypes.h"
#undef JS_PUBLIC_API
#undef JS_PUBLIC_DATA
#define JS_PUBLIC_API(t) t
#define JS_PUBLIC_DATA(t) t
#endif
#include "jsapi.h"
#include "jsdate.h"
#ifndef JSCLASS_GLOBAL_FLAGS
#define JSCLASS_GLOBAL_FLAGS 0
#endif
#else
#include "js/jsapi.h"
#include "js/jsdate.h"
#endif
namespace mongo {
class SMScope;
2009-05-08 11:02:12 -04:00
class Convertor;
2009-05-09 22:07:36 -04:00
extern JSClass bson_class;
extern JSClass bson_ro_class;
2009-05-06 17:33:00 -04:00
extern JSClass object_id_class;
extern JSClass timestamp_class;
extern JSClass minkey_class;
extern JSClass maxkey_class;
// internal things
void dontDeleteScope( SMScope * s ){}
void errorReporter( JSContext *cx, const char *message, JSErrorReport *report );
extern boost::thread_specific_ptr<SMScope> currentScope;
// bson
JSBool resolveBSONField( JSContext *cx, JSObject *obj, jsval id, uintN flags, JSObject **objp );
// mongo
2009-05-15 16:32:31 -04:00
void initMongoJS( SMScope * scope , JSContext * cx , JSObject * global , bool local );
2009-05-08 11:02:12 -04:00
bool appendSpecialDBObject( Convertor * c , BSONObjBuilder& b , const string& name , JSObject * o );
}