quiet unix missing initializer warnings
add private data to JSDContexxt
This commit is contained in:
rginda%netscape.com 2001-04-20 03:44:25 +00:00
Родитель 30d9f9d2ef
Коммит fea369338b
1 изменённых файлов: 17 добавлений и 1 удалений

Просмотреть файл

@ -57,7 +57,8 @@ void JSD_ASSERT_VALID_CONTEXT(JSDContext* jsdc)
static JSClass global_class = { static JSClass global_class = {
"JSDGlobal", 0, "JSDGlobal", 0,
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
JSCLASS_NO_OPTIONAL_MEMBERS
}; };
static JSBool static JSBool
@ -124,6 +125,7 @@ _newJSDContext(JSRuntime* jsrt,
if( ! JS_InitStandardClasses(jsdc->dumbContext, jsdc->glob) ) if( ! JS_InitStandardClasses(jsdc->dumbContext, jsdc->glob) )
goto label_newJSDContext_failure; goto label_newJSDContext_failure;
jsdc->data = NULL;
jsdc->inited = JS_TRUE; jsdc->inited = JS_TRUE;
JSD_LOCK(); JSD_LOCK();
@ -246,6 +248,20 @@ jsd_SetUserCallbacks(JSRuntime* jsrt, JSD_UserCallbacks* callbacks, void* user)
memset(&_callbacks, 0 , sizeof(JSD_UserCallbacks)); memset(&_callbacks, 0 , sizeof(JSD_UserCallbacks));
} }
void*
jsd_SetContextPrivate(JSDContext* jsdc, void *data)
{
void *rval = jsdc->data;
jsdc->data = data;
return data;
}
void*
jsd_GetContextPrivate(JSDContext* jsdc)
{
return jsdc->data;
}
JSDContext* JSDContext*
jsd_JSDContextForJSContext(JSContext* context) jsd_JSDContextForJSContext(JSContext* context)
{ {