ELinks 0.16.1.1
spidermonkey-shared.h File Reference
#include <jsapi.h>
#include <jsfriendapi.h>
#include <js/Conversions.h>
#include "util/string.h"
Include dependency graph for spidermonkey-shared.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  spidermonkeyFunctionSpec
 An ELinks-specific replacement for JSFunctionSpec. More...

Macros

#define ELINKS_CAST_PROP_PARAMS

Typedefs

typedef struct spidermonkeyFunctionSpec spidermonkeyFunctionSpec
 An ELinks-specific replacement for JSFunctionSpec.

Functions

int spidermonkey_runtime_addref (void)
void spidermonkey_runtime_release (void)
bool spidermonkey_DefineFunctions (JSContext *cx, JSObject *obj, const spidermonkeyFunctionSpec *fs)
JSObject * spidermonkey_InitClass (JSContext *cx, JSObject *obj, JSObject *parent_proto, const JSClass *clasp, JSNative constructor, unsigned int nargs, JSPropertySpec *ps, const spidermonkeyFunctionSpec *fs, JSPropertySpec *static_ps, const spidermonkeyFunctionSpec *static_fs)
bool spidermonkey_check_if_function_name (const spidermonkeyFunctionSpec funcs[], const char *string)
static char * jsval_to_string (JSContext *ctx, JS::HandleValue hvp)
static char * jsid_to_string (JSContext *ctx, JS::HandleId hid)

Variables

JSRuntime * spidermonkey_runtime
JSContext * main_ctx

Macro Definition Documentation

◆ ELINKS_CAST_PROP_PARAMS

#define ELINKS_CAST_PROP_PARAMS
Value:
JSObject *obj = (hobj.get()); \
JS::Value *vp = (hvp.address());

Typedef Documentation

◆ spidermonkeyFunctionSpec

typedef struct spidermonkeyFunctionSpec spidermonkeyFunctionSpec

An ELinks-specific replacement for JSFunctionSpec.

Bug 1016: In SpiderMonkey 1.7 bundled with XULRunner 1.8, jsapi.h defines JSFunctionSpec in different ways depending on whether MOZILLA_1_8_BRANCH is defined, and there is no obvious way for ELinks to check whether MOZILLA_1_8_BRANCH was defined when the library was built. Avoid the unstable JSFunctionSpec definitions and use this ELinks-specific structure instead.

Function Documentation

◆ jsid_to_string()

char * jsid_to_string ( JSContext * ctx,
JS::HandleId hid )
inlinestatic

◆ jsval_to_string()

char * jsval_to_string ( JSContext * ctx,
JS::HandleValue hvp )
inlinestatic

◆ spidermonkey_check_if_function_name()

bool spidermonkey_check_if_function_name ( const spidermonkeyFunctionSpec funcs[],
const char * string )

◆ spidermonkey_DefineFunctions()

bool spidermonkey_DefineFunctions ( JSContext * cx,
JSObject * obj,
const spidermonkeyFunctionSpec * fs )

◆ spidermonkey_InitClass()

JSObject * spidermonkey_InitClass ( JSContext * cx,
JSObject * obj,
JSObject * parent_proto,
const JSClass * clasp,
JSNative constructor,
unsigned int nargs,
JSPropertySpec * ps,
const spidermonkeyFunctionSpec * fs,
JSPropertySpec * static_ps,
const spidermonkeyFunctionSpec * static_fs )

◆ spidermonkey_runtime_addref()

int spidermonkey_runtime_addref ( void )

◆ spidermonkey_runtime_release()

void spidermonkey_runtime_release ( void )

Variable Documentation

◆ main_ctx

JSContext* main_ctx
extern

◆ spidermonkey_runtime

JSRuntime* spidermonkey_runtime
extern