NPNetscapeFuncs* npnfuncs;
NPError NP_Initialize(NPNetscapeFuncs *npnf) {
npnfuncs = npnf;
}
Then we need to write a wrapper for each function. Here goes an example for NPN_GetValue, NPN_Evaluate, NPN_ReleaseVariantValue:
/* Wrappers for NPN functions */
NPError NP_LOADDS NPN_GetValue(NPP instance, NPNVariable variable, void *value)
{
return npnfuncs->getvalue(instance, variable, value);
}
bool NPN_Evaluate(NPP npp, NPObject *npobj, NPString *script,
NPVariant *result)
{
return npnfuncs->evaluate(npp, npobj, script, result);
}
void NPN_ReleaseVariantValue(NPVariant *variant)
{
npnfuncs->releasevariantvalue(variant);
}
Немає коментарів:
Дописати коментар