0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/scripting/engine_spidermonkey.h
2009-05-09 22:07:36 -04:00

44 lines
952 B
C++

// engine_spidermonkey.h
#pragma once
#include "engine.h"
#ifdef _WIN32
#define XP_WIN
#else
#define XP_UNIX
#endif
#ifdef MOZJS
#include "mozjs/jsapi.h"
#include "mozjs/jsdate.h"
#else
#include "js/jsapi.h"
#include "js/jsdate.h"
#endif
namespace mongo {
class SMScope;
class Convertor;
extern JSClass bson_class;
extern JSClass bson_ro_class;
extern JSClass object_id_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
void initMongoJS( SMScope * scope , JSContext * cx , JSObject * global , bool local );
bool appendSpecialDBObject( Convertor * c , BSONObjBuilder& b , const string& name , JSObject * o );
}