Commit 48bfe685 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

NPUnix: Use gNPNetscapeFuncs as pointer

parent 1d567c16
......@@ -81,7 +81,7 @@
*
***********************************************************************/
static NPNetscapeFuncs gNetscapeFuncs; /* Netscape Function table */
static NPNetscapeFuncs *gNetscapeFuncs; /* Netscape Function table */
static const char *gUserAgent; /* User agent string */
/***********************************************************************
......@@ -102,9 +102,9 @@ NPN_Version(int* plugin_major, int* plugin_minor,
*plugin_minor = NP_VERSION_MINOR;
/* Major version is in high byte */
*netscape_major = gNetscapeFuncs.version >> 8;
*netscape_major = gNetscapeFuncs->version >> 8;
/* Minor version is in low byte */
*netscape_minor = gNetscapeFuncs.version & 0xFF;
*netscape_minor = gNetscapeFuncs->version & 0xFF;
}
......@@ -134,11 +134,11 @@ NPN_PluginThreadAsyncCall(NPP plugin,
{
bool workaround = false;
const int minor = gNetscapeFuncs.version & 0xFF;
const int minor = gNetscapeFuncs->version & 0xFF;
if (gUserAgent && (strstr(gUserAgent, "Opera")))
workaround = true;
if (!gNetscapeFuncs.pluginthreadasynccall)
if (!gNetscapeFuncs->pluginthreadasynccall)
workaround = true;
if (workaround) {
......@@ -152,7 +152,7 @@ NPN_PluginThreadAsyncCall(NPP plugin,
}
# if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) >= 20)
return (*gNetscapeFuncs.pluginthreadasynccall)(plugin, func, userData);
return (*gNetscapeFuncs->pluginthreadasynccall)(plugin, func, userData);
# endif
// otherwise nothing we can do...
......@@ -163,10 +163,10 @@ NPError
NPN_GetValue(NPP instance, NPNVariable variable, void *r_value)
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_GetValueProc(gNetscapeFuncs.getvalue,
return CallNPN_GetValueProc(gNetscapeFuncs->getvalue,
instance, variable, r_value);
#else
return (*gNetscapeFuncs.getvalue)(instance, variable, r_value);
return (*gNetscapeFuncs->getvalue)(instance, variable, r_value);
#endif
}
......@@ -174,10 +174,10 @@ NPError
NPN_SetValue(NPP instance, NPPVariable variable, void *value)
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_SetValueProc(gNetscapeFuncs.setvalue,
return CallNPN_SetValueProc(gNetscapeFuncs->setvalue,
instance, variable, value);
#else
return (*gNetscapeFuncs.setvalue)(instance, variable, value);
return (*gNetscapeFuncs->setvalue)(instance, variable, value);
#endif
}
......@@ -185,9 +185,9 @@ NPError
NPN_GetURL(NPP instance, const char* url, const char* window)
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_GetURLProc(gNetscapeFuncs.geturl, instance, url, window);
return CallNPN_GetURLProc(gNetscapeFuncs->geturl, instance, url, window);
#else
return (*gNetscapeFuncs.geturl)(instance, url, window);
return (*gNetscapeFuncs->geturl)(instance, url, window);
#endif
}
......@@ -195,9 +195,9 @@ NPError
NPN_GetURLNotify(NPP instance, const char* url, const char* window, void* notifyData)
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_GetURLNotifyProc(gNetscapeFuncs.geturlnotify, instance, url, window, notifyData);
return CallNPN_GetURLNotifyProc(gNetscapeFuncs->geturlnotify, instance, url, window, notifyData);
#else
return (*gNetscapeFuncs.geturlnotify)(instance, url, window, notifyData);
return (*gNetscapeFuncs->geturlnotify)(instance, url, window, notifyData);
#endif
}
......@@ -206,10 +206,10 @@ NPN_PostURL(NPP instance, const char* url, const char* window,
uint32_t len, const char* buf, NPBool file)
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_PostURLProc(gNetscapeFuncs.posturl, instance,
return CallNPN_PostURLProc(gNetscapeFuncs->posturl, instance,
url, window, len, buf, file);
#else
return (*gNetscapeFuncs.posturl)(instance, url, window, len, buf, file);
return (*gNetscapeFuncs->posturl)(instance, url, window, len, buf, file);
#endif
}
......@@ -218,10 +218,10 @@ NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32_t le
const char* buf, NPBool file, void* notifyData)
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_PostURLNotifyProc(gNetscapeFuncs.posturlnotify,
return CallNPN_PostURLNotifyProc(gNetscapeFuncs->posturlnotify,
instance, url, window, len, buf, file, notifyData);
#else
return (*gNetscapeFuncs.posturlnotify)(instance, url, window, len, buf, file, notifyData);
return (*gNetscapeFuncs->posturlnotify)(instance, url, window, len, buf, file, notifyData);
#endif
}
......@@ -230,10 +230,10 @@ NPError
NPN_RequestRead(NPStream* stream, NPByteRange* rangeList)
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_RequestReadProc(gNetscapeFuncs.requestread,
return CallNPN_RequestReadProc(gNetscapeFuncs->requestread,
stream, rangeList);
#else
return (*gNetscapeFuncs.requestread)(stream, rangeList);
return (*gNetscapeFuncs->requestread)(stream, rangeList);
#endif
}
......@@ -242,10 +242,10 @@ NPN_NewStream(NPP instance, NPMIMEType type, const char *window,
NPStream** stream_ptr)
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_NewStreamProc(gNetscapeFuncs.newstream, instance,
return CallNPN_NewStreamProc(gNetscapeFuncs->newstream, instance,
type, window, stream_ptr);
#else
return (*gNetscapeFuncs.newstream)(instance, type, window, stream_ptr);
return (*gNetscapeFuncs->newstream)(instance, type, window, stream_ptr);
#endif
}
......@@ -253,10 +253,10 @@ int32_t
NPN_Write(NPP instance, NPStream* stream, int32_t len, void* buffer)
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_WriteProc(gNetscapeFuncs.write, instance,
return CallNPN_WriteProc(gNetscapeFuncs->write, instance,
stream, len, buffer);
#else
return (*gNetscapeFuncs.write)(instance, stream, len, buffer);
return (*gNetscapeFuncs->write)(instance, stream, len, buffer);
#endif
}
......@@ -264,10 +264,10 @@ NPError
NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_DestroyStreamProc(gNetscapeFuncs.destroystream,
return CallNPN_DestroyStreamProc(gNetscapeFuncs->destroystream,
instance, stream, reason);
#else
return (*gNetscapeFuncs.destroystream)(instance, stream, reason);
return (*gNetscapeFuncs->destroystream)(instance, stream, reason);
#endif
}
......@@ -275,9 +275,9 @@ void
NPN_Status(NPP instance, const char* message)
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_StatusProc(gNetscapeFuncs.status, instance, message);
CallNPN_StatusProc(gNetscapeFuncs->status, instance, message);
#else
(*gNetscapeFuncs.status)(instance, message);
(*gNetscapeFuncs->status)(instance, message);
#endif
}
......@@ -285,45 +285,45 @@ const char*
NPN_UserAgent(NPP instance)
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_UserAgentProc(gNetscapeFuncs.uagent, instance);
return CallNPN_UserAgentProc(gNetscapeFuncs->uagent, instance);
#else
return (*gNetscapeFuncs.uagent)(instance);
return (*gNetscapeFuncs->uagent)(instance);
#endif
}
void *NPN_MemAlloc(uint32_t size)
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_MemAllocProc(gNetscapeFuncs.memalloc, size);
return CallNPN_MemAllocProc(gNetscapeFuncs->memalloc, size);
#else
return (*gNetscapeFuncs.memalloc)(size);
return (*gNetscapeFuncs->memalloc)(size);
#endif
}
void NPN_MemFree(void* ptr)
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_MemFreeProc(gNetscapeFuncs.memfree, ptr);
CallNPN_MemFreeProc(gNetscapeFuncs->memfree, ptr);
#else
(*gNetscapeFuncs.memfree)(ptr);
(*gNetscapeFuncs->memfree)(ptr);
#endif
}
uint32_t NPN_MemFlush(uint32_t size)
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_MemFlushProc(gNetscapeFuncs.memflush, size);
return CallNPN_MemFlushProc(gNetscapeFuncs->memflush, size);
#else
return (*gNetscapeFuncs.memflush)(size);
return (*gNetscapeFuncs->memflush)(size);
#endif
}
void NPN_ReloadPlugins(NPBool reloadPages)
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_ReloadPluginsProc(gNetscapeFuncs.reloadplugins, reloadPages);
CallNPN_ReloadPluginsProc(gNetscapeFuncs->reloadplugins, reloadPages);
#else
(*gNetscapeFuncs.reloadplugins)(reloadPages);
(*gNetscapeFuncs->reloadplugins)(reloadPages);
#endif
}
......@@ -331,10 +331,10 @@ void
NPN_InvalidateRect(NPP instance, NPRect *invalidRect)
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_InvalidateRectProc(gNetscapeFuncs.invalidaterect, instance,
CallNPN_InvalidateRectProc(gNetscapeFuncs->invalidaterect, instance,
invalidRect);
#else
(*gNetscapeFuncs.invalidaterect)(instance, invalidRect);
(*gNetscapeFuncs->invalidaterect)(instance, invalidRect);
#endif
}
......@@ -342,10 +342,10 @@ void
NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion)
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_InvalidateRegionProc(gNetscapeFuncs.invalidateregion, instance,
CallNPN_InvalidateRegionProc(gNetscapeFuncs->invalidateregion, instance,
invalidRegion);
#else
(*gNetscapeFuncs.invalidateregion)(instance, invalidRegion);
(*gNetscapeFuncs->invalidateregion)(instance, invalidRegion);
#endif
}
......@@ -353,42 +353,42 @@ void
NPN_ForceRedraw(NPP instance)
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_ForceRedrawProc(gNetscapeFuncs.forceredraw, instance);
CallNPN_ForceRedrawProc(gNetscapeFuncs->forceredraw, instance);
#else
(*gNetscapeFuncs.forceredraw)(instance);
(*gNetscapeFuncs->forceredraw)(instance);
#endif
}
void NPN_PushPopupsEnabledState(NPP instance, NPBool enabled)
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_PushPopupsEnabledStateProc(gNetscapeFuncs.pushpopupsenabledstate,
CallNPN_PushPopupsEnabledStateProc(gNetscapeFuncs->pushpopupsenabledstate,
instance, enabled);
#else
(*gNetscapeFuncs.pushpopupsenabledstate)(instance, enabled);
(*gNetscapeFuncs->pushpopupsenabledstate)(instance, enabled);
#endif
}
void NPN_PopPopupsEnabledState(NPP instance)
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_PopPopupsEnabledStateProc(gNetscapeFuncs.poppopupsenabledstate,
CallNPN_PopPopupsEnabledStateProc(gNetscapeFuncs->poppopupsenabledstate,
instance);
#else
(*gNetscapeFuncs.poppopupsenabledstate)(instance);
(*gNetscapeFuncs->poppopupsenabledstate)(instance);
#endif
}
NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name)
{
int minor = gNetscapeFuncs.version & 0xFF;
int minor = gNetscapeFuncs->version & 0xFF;
if( minor >= 14 )
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_GetStringIdentifierProc(
gNetscapeFuncs.getstringidentifier, name);
gNetscapeFuncs->getstringidentifier, name);
#else
return (*gNetscapeFuncs.getstringidentifier)(name);
return (*gNetscapeFuncs->getstringidentifier)(name);
#endif
}
return NULL;
......@@ -397,27 +397,27 @@ NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name)
void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount,
NPIdentifier *identifiers)
{
int minor = gNetscapeFuncs.version & 0xFF;
int minor = gNetscapeFuncs->version & 0xFF;
if( minor >= 14 )
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_GetStringIdentifiersProc(gNetscapeFuncs.getstringidentifiers,
CallNPN_GetStringIdentifiersProc(gNetscapeFuncs->getstringidentifiers,
names, nameCount, identifiers);
#else
(*gNetscapeFuncs.getstringidentifiers)(names, nameCount, identifiers);
(*gNetscapeFuncs->getstringidentifiers)(names, nameCount, identifiers);
#endif
}
}
NPIdentifier NPN_GetIntIdentifier(int32_t intid)
{
int minor = gNetscapeFuncs.version & 0xFF;
int minor = gNetscapeFuncs->version & 0xFF;
if( minor >= 14 )
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_GetIntIdentifierProc(gNetscapeFuncs.getintidentifier, intid);
return CallNPN_GetIntIdentifierProc(gNetscapeFuncs->getintidentifier, intid);
#else
return (*gNetscapeFuncs.getintidentifier)(intid);
return (*gNetscapeFuncs->getintidentifier)(intid);
#endif
}
return NULL;
......@@ -425,15 +425,15 @@ NPIdentifier NPN_GetIntIdentifier(int32_t intid)
bool NPN_IdentifierIsString(NPIdentifier identifier)
{
int minor = gNetscapeFuncs.version & 0xFF;
int minor = gNetscapeFuncs->version & 0xFF;
if( minor >= 14 )
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_IdentifierIsStringProc(
gNetscapeFuncs.identifierisstring,
gNetscapeFuncs->identifierisstring,
identifier);
#else
return (*gNetscapeFuncs.identifierisstring)(identifier);
return (*gNetscapeFuncs->identifierisstring)(identifier);
#endif
}
return false;
......@@ -441,15 +441,15 @@ bool NPN_IdentifierIsString(NPIdentifier identifier)
NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier)
{
int minor = gNetscapeFuncs.version & 0xFF;
int minor = gNetscapeFuncs->version & 0xFF;
if( minor >= 14 )
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_UTF8FromIdentifierProc(
gNetscapeFuncs.utf8fromidentifier,
gNetscapeFuncs->utf8fromidentifier,
identifier);
#else
return (*gNetscapeFuncs.utf8fromidentifier)(identifier);
return (*gNetscapeFuncs->utf8fromidentifier)(identifier);
#endif
}
return NULL;
......@@ -457,15 +457,15 @@ NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier)
int32_t NPN_IntFromIdentifier(NPIdentifier identifier)
{
int minor = gNetscapeFuncs.version & 0xFF;
int minor = gNetscapeFuncs->version & 0xFF;
if( minor >= 14 )
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_IntFromIdentifierProc(
gNetscapeFuncs.intfromidentifier,
gNetscapeFuncs->intfromidentifier,
identifier);
#else
return (*gNetscapeFuncs.intfromidentifier)(identifier);
return (*gNetscapeFuncs->intfromidentifier)(identifier);
#endif
}
return 0;
......@@ -473,49 +473,49 @@ int32_t NPN_IntFromIdentifier(NPIdentifier identifier)
NPObject *NPN_CreateObject(NPP npp, NPClass *aClass)
{
int minor = gNetscapeFuncs.version & 0xFF;
int minor = gNetscapeFuncs->version & 0xFF;
if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_CreateObjectProc(gNetscapeFuncs.createobject, npp, aClass);
return CallNPN_CreateObjectProc(gNetscapeFuncs->createobject, npp, aClass);
#else
return (*gNetscapeFuncs.createobject)(npp, aClass);
return (*gNetscapeFuncs->createobject)(npp, aClass);
#endif
return NULL;
}
NPObject *NPN_RetainObject(NPObject *obj)
{
int minor = gNetscapeFuncs.version & 0xFF;
int minor = gNetscapeFuncs->version & 0xFF;
if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_RetainObjectProc(gNetscapeFuncs.retainobject, obj);
return CallNPN_RetainObjectProc(gNetscapeFuncs->retainobject, obj);
#else
return (*gNetscapeFuncs.retainobject)(obj);
return (*gNetscapeFuncs->retainobject)(obj);
#endif
return NULL;
}
void NPN_ReleaseObject(NPObject *obj)
{
int minor = gNetscapeFuncs.version & 0xFF;
int minor = gNetscapeFuncs->version & 0xFF;
if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_ReleaseObjectProc(gNetscapeFuncs.releaseobject, obj);
CallNPN_ReleaseObjectProc(gNetscapeFuncs->releaseobject, obj);
#else
(*gNetscapeFuncs.releaseobject)(obj);
(*gNetscapeFuncs->releaseobject)(obj);
#endif
}
bool NPN_Invoke(NPP npp, NPObject* obj, NPIdentifier methodName,
const NPVariant *args, uint32_t argCount, NPVariant *result)
{
int minor = gNetscapeFuncs.version & 0xFF;
int minor = gNetscapeFuncs->version & 0xFF;
if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_InvokeProc(gNetscapeFuncs.invoke, npp, obj, methodName,
return CallNPN_InvokeProc(gNetscapeFuncs->invoke, npp, obj, methodName,
args, argCount, result);
#else
return (*gNetscapeFuncs.invoke)(npp, obj, methodName, args, argCount, result);
return (*gNetscapeFuncs->invoke)(npp, obj, methodName, args, argCount, result);
#endif
return false;
}
......@@ -523,13 +523,13 @@ bool NPN_Invoke(NPP npp, NPObject* obj, NPIdentifier methodName,
bool NPN_InvokeDefault(NPP npp, NPObject* obj, const NPVariant *args,
uint32_t argCount, NPVariant *result)
{
int minor = gNetscapeFuncs.version & 0xFF;
int minor = gNetscapeFuncs->version & 0xFF;
if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_InvokeDefaultProc(gNetscapeFuncs.invokeDefault, npp, obj,
return CallNPN_InvokeDefaultProc(gNetscapeFuncs->invokeDefault, npp, obj,
args, argCount, result);
#else
return (*gNetscapeFuncs.invokeDefault)(npp, obj, args, argCount, result);
return (*gNetscapeFuncs->invokeDefault)(npp, obj, args, argCount, result);
#endif
return false;
}
......@@ -537,13 +537,13 @@ bool NPN_InvokeDefault(NPP npp, NPObject* obj, const NPVariant *args,
bool NPN_Evaluate(NPP npp, NPObject* obj, NPString *script,
NPVariant *result)
{
int minor = gNetscapeFuncs.version & 0xFF;
int minor = gNetscapeFuncs->version & 0xFF;
if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_EvaluateProc(gNetscapeFuncs.evaluate, npp, obj,
return CallNPN_EvaluateProc(gNetscapeFuncs->evaluate, npp, obj,
script, result);
#else
return (*gNetscapeFuncs.evaluate)(npp, obj, script, result);
return (*gNetscapeFuncs->evaluate)(npp, obj, script, result);
#endif
return false;
}
......@@ -551,13 +551,13 @@ bool NPN_Evaluate(NPP npp, NPObject* obj, NPString *script,
bool NPN_GetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName,
NPVariant *result)
{
int minor = gNetscapeFuncs.version & 0xFF;
int minor = gNetscapeFuncs->version & 0xFF;
if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_GetPropertyProc(gNetscapeFuncs.getproperty, npp, obj,
return CallNPN_GetPropertyProc(gNetscapeFuncs->getproperty, npp, obj,
propertyName, result);
#else
return (*gNetscapeFuncs.getproperty)(npp, obj, propertyName, result);
return (*gNetscapeFuncs->getproperty)(npp, obj, propertyName, result);
#endif
return false;
}
......@@ -565,75 +565,75 @@ bool NPN_GetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName,
bool NPN_SetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName,
const NPVariant *value)
{
int minor = gNetscapeFuncs.version & 0xFF;
int minor = gNetscapeFuncs->version & 0xFF;
if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_SetPropertyProc(gNetscapeFuncs.setproperty, npp, obj,
return CallNPN_SetPropertyProc(gNetscapeFuncs->setproperty, npp, obj,
propertyName, value);
#else
return (*gNetscapeFuncs.setproperty)(npp, obj, propertyName, value);
return (*gNetscapeFuncs->setproperty)(npp, obj, propertyName, value);
#endif
return false;
}
bool NPN_RemoveProperty(NPP npp, NPObject* obj, NPIdentifier propertyName)
{
int minor = gNetscapeFuncs.version & 0xFF;
int minor = gNetscapeFuncs->version & 0xFF;
if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_RemovePropertyProc(gNetscapeFuncs.removeproperty, npp, obj,
return CallNPN_RemovePropertyProc(gNetscapeFuncs->removeproperty, npp, obj,
propertyName);
#else
return (*gNetscapeFuncs.removeproperty)(npp, obj, propertyName);
return (*gNetscapeFuncs->removeproperty)(npp, obj, propertyName);
#endif
return false;
}
bool NPN_HasProperty(NPP npp, NPObject* obj, NPIdentifier propertyName)
{
int minor = gNetscapeFuncs.version & 0xFF;
int minor = gNetscapeFuncs->version & 0xFF;
if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_HasPropertyProc(gNetscapeFuncs.hasproperty, npp, obj,
return CallNPN_HasPropertyProc(gNetscapeFuncs->hasproperty, npp, obj,
propertyName);
#else
return (*gNetscapeFuncs.hasproperty)(npp, obj, propertyName);
return (*gNetscapeFuncs->hasproperty)(npp, obj, propertyName);
#endif
return false;
}
bool NPN_HasMethod(NPP npp, NPObject* obj, NPIdentifier methodName)
{
int minor = gNetscapeFuncs.version & 0xFF;
int minor = gNetscapeFuncs->version & 0xFF;
if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_HasMethodProc(gNetscapeFuncs.hasmethod, npp,
return CallNPN_HasMethodProc(gNetscapeFuncs->hasmethod, npp,
obj, methodName);
#else
return (*gNetscapeFuncs.hasmethod)(npp, obj, methodName);
return (*gNetscapeFuncs->hasmethod)(npp, obj, methodName);
#endif
return false;
}
void NPN_ReleaseVariantValue(NPVariant *variant)
{
int minor = gNetscapeFuncs.version & 0xFF;
int minor = gNetscapeFuncs->version & 0xFF;
if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_ReleaseVariantValueProc(gNetscapeFuncs.releasevariantvalue, variant);
CallNPN_ReleaseVariantValueProc(gNetscapeFuncs->releasevariantvalue, variant);
#else
(*gNetscapeFuncs.releasevariantvalue)(variant);
(*gNetscapeFuncs->releasevariantvalue)(variant);
#endif
}
void NPN_SetException(NPObject* obj, const NPUTF8 *message)
{
int minor = gNetscapeFuncs.version & 0xFF;
int minor = gNetscapeFuncs->version & 0xFF;
if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_SetExceptionProc(gNetscapeFuncs.setexception, obj, message);
CallNPN_SetExceptionProc(gNetscapeFuncs->setexception, obj, message);
#else
(*gNetscapeFuncs.setexception)(obj, message);
(*gNetscapeFuncs->setexception)(obj, message);
#endif
}
......@@ -860,7 +860,7 @@ NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
* the whole structure, because the Netscape function table
* could actually be bigger than what we expect.
*/
gNetscapeFuncs = *nsTable;
gNetscapeFuncs = nsTable;
int minor = nsTable->version & 0xFF;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment