[vlc-commits] npmac: remove dead code

Felix Paul Kühne git at videolan.org
Fri Jun 21 12:46:58 CEST 2013


npapi-vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Fri Jun 21 12:45:14 2013 +0200| [d7f3bdf9250d143cb67bfb4068ae5778b8e9f8c2] | committer: Felix Paul Kühne

npmac: remove dead code

> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=d7f3bdf9250d143cb67bfb4068ae5778b8e9f8c2
---

 npapi/support/npmac.cpp |  123 -----------------------------------------------
 1 file changed, 123 deletions(-)

diff --git a/npapi/support/npmac.cpp b/npapi/support/npmac.cpp
index 7163f6e..4e92222 100644
--- a/npapi/support/npmac.cpp
+++ b/npapi/support/npmac.cpp
@@ -568,129 +568,6 @@ void Private_URLNotify(NPP instance, const char* url, NPReason reason, void* not
 #pragma mark -
 #pragma mark Initialization & Run
 
-// gcc requires that main have an 'int' return type
-typedef int main_return_t;
-typedef void (* NP_LOADDS NPP_ShutdownProcPtr)(void);
-typedef NPP_ShutdownProcPtr unloadupp_t;
-
-main_return_t main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, unloadupp_t* unloadUpp);
-
-DEFINE_API_C(main_return_t) main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, unloadupp_t* unloadUpp)
-{
-    NPError err = NPERR_NO_ERROR;
-
-    //
-    // Ensure that everything Netscape passed us is valid!
-    //
-    if ((nsTable == NULL) || (pluginFuncs == NULL) || (unloadUpp == NULL))
-        err = NPERR_INVALID_FUNCTABLE_ERROR;
-
-    //
-    // Check the “major” version passed in Netscape’s function table.
-    // We won’t load if the major version is newer than what we expect.
-    // Also check that the function tables passed in are big enough for
-    // all the functions we need (they could be bigger, if Netscape added
-    // new APIs, but that’s OK with us -- we’ll just ignore them).
-    //
-    if (err == NPERR_NO_ERROR) {
-        if ((nsTable->version >> 8) > NP_VERSION_MAJOR)     // Major version is in high byte
-            err = NPERR_INCOMPATIBLE_VERSION_ERROR;
-    }
-
-    if (err == NPERR_NO_ERROR) {
-        //
-        // Copy all the fields of Netscape’s function table into our
-        // copy so we can call back into Netscape later.  Note that
-        // we need to copy the fields one by one, rather than assigning
-        // the whole structure, because the Netscape function table
-        // could actually be bigger than what we expect.
-        //
-
-        int navMinorVers = nsTable->version & 0xFF;
-
-        gNetscapeFuncs.version          = nsTable->version;
-        gNetscapeFuncs.size             = nsTable->size;
-        gNetscapeFuncs.posturl          = HOST_TO_PLUGIN_GLUE(posturl, nsTable->posturl);
-        gNetscapeFuncs.geturl           = HOST_TO_PLUGIN_GLUE(geturl, nsTable->geturl);
-        gNetscapeFuncs.requestread      = HOST_TO_PLUGIN_GLUE(requestread, nsTable->requestread);
-        gNetscapeFuncs.newstream        = HOST_TO_PLUGIN_GLUE(newstream, nsTable->newstream);
-        gNetscapeFuncs.write            = HOST_TO_PLUGIN_GLUE(write, nsTable->write);
-        gNetscapeFuncs.destroystream    = HOST_TO_PLUGIN_GLUE(destroystream, nsTable->destroystream);
-        gNetscapeFuncs.status           = HOST_TO_PLUGIN_GLUE(status, nsTable->status);
-        gNetscapeFuncs.uagent           = HOST_TO_PLUGIN_GLUE(uagent, nsTable->uagent);
-        gNetscapeFuncs.memalloc         = HOST_TO_PLUGIN_GLUE(memalloc, nsTable->memalloc);
-        gNetscapeFuncs.memfree          = HOST_TO_PLUGIN_GLUE(memfree, nsTable->memfree);
-        gNetscapeFuncs.memflush         = HOST_TO_PLUGIN_GLUE(memflush, nsTable->memflush);
-        gNetscapeFuncs.reloadplugins    = HOST_TO_PLUGIN_GLUE(reloadplugins, nsTable->reloadplugins);
-        if (navMinorVers >= NPVERS_HAS_LIVECONNECT) {
-            gNetscapeFuncs.getJavaEnv   = HOST_TO_PLUGIN_GLUE(getJavaEnv, nsTable->getJavaEnv);
-            gNetscapeFuncs.getJavaPeer  = HOST_TO_PLUGIN_GLUE(getJavaPeer, nsTable->getJavaPeer);
-        }
-        if (navMinorVers >= NPVERS_HAS_NOTIFICATION) {
-            gNetscapeFuncs.geturlnotify = HOST_TO_PLUGIN_GLUE(geturlnotify, nsTable->geturlnotify);
-            gNetscapeFuncs.posturlnotify    = HOST_TO_PLUGIN_GLUE(posturlnotify, nsTable->posturlnotify);
-        }
-        gNetscapeFuncs.getvalue         = HOST_TO_PLUGIN_GLUE(getvalue, nsTable->getvalue);
-        gNetscapeFuncs.setvalue         = HOST_TO_PLUGIN_GLUE(setvalue, nsTable->setvalue);
-        gNetscapeFuncs.invalidaterect   = HOST_TO_PLUGIN_GLUE(invalidaterect, nsTable->invalidaterect);
-        gNetscapeFuncs.invalidateregion = HOST_TO_PLUGIN_GLUE(invalidateregion, nsTable->invalidateregion);
-        gNetscapeFuncs.forceredraw      = HOST_TO_PLUGIN_GLUE(forceredraw, nsTable->forceredraw);
-        if (navMinorVers >= 14) {
-            // NPRuntime support
-            gNetscapeFuncs.getstringidentifier   = HOST_TO_PLUGIN_GLUE(getstringidentifier, nsTable->getstringidentifier);
-            gNetscapeFuncs.getstringidentifiers  = HOST_TO_PLUGIN_GLUE(getstringidentifiers, nsTable->getstringidentifiers);
-            gNetscapeFuncs.getintidentifier      = HOST_TO_PLUGIN_GLUE(getintidentifier, nsTable->getintidentifier);
-            gNetscapeFuncs.identifierisstring    = HOST_TO_PLUGIN_GLUE(identifierisstring, nsTable->identifierisstring);
-            gNetscapeFuncs.utf8fromidentifier    = HOST_TO_PLUGIN_GLUE(utf8fromidentifier, nsTable->utf8fromidentifier);
-            gNetscapeFuncs.intfromidentifier     = HOST_TO_PLUGIN_GLUE(intfromidentifier, nsTable->intfromidentifier);
-            gNetscapeFuncs.createobject          = HOST_TO_PLUGIN_GLUE(createobject, nsTable->createobject);
-            gNetscapeFuncs.retainobject          = HOST_TO_PLUGIN_GLUE(retainobject, nsTable->retainobject);
-            gNetscapeFuncs.releaseobject         = HOST_TO_PLUGIN_GLUE(releaseobject, nsTable->releaseobject);
-            gNetscapeFuncs.invoke                = HOST_TO_PLUGIN_GLUE(invoke, nsTable->invoke);
-            gNetscapeFuncs.invokeDefault         = HOST_TO_PLUGIN_GLUE(invokeDefault, nsTable->invokeDefault);
-            gNetscapeFuncs.evaluate              = HOST_TO_PLUGIN_GLUE(evaluate, nsTable->evaluate);
-            gNetscapeFuncs.getproperty           = HOST_TO_PLUGIN_GLUE(getproperty, nsTable->getproperty);
-            gNetscapeFuncs.setproperty           = HOST_TO_PLUGIN_GLUE(setproperty, nsTable->setproperty);
-            gNetscapeFuncs.removeproperty        = HOST_TO_PLUGIN_GLUE(removeproperty, nsTable->removeproperty);
-            gNetscapeFuncs.hasproperty           = HOST_TO_PLUGIN_GLUE(hasproperty, nsTable->hasproperty);
-            gNetscapeFuncs.hasmethod             = HOST_TO_PLUGIN_GLUE(hasmethod, nsTable->hasmethod);
-            gNetscapeFuncs.releasevariantvalue   = HOST_TO_PLUGIN_GLUE(releasevariantvalue, nsTable->releasevariantvalue);
-            gNetscapeFuncs.setexception          = HOST_TO_PLUGIN_GLUE(setexception, nsTable->setexception);
-            gNetscapeFuncs.pluginthreadasynccall = HOST_TO_PLUGIN_GLUE(pluginthreadasynccall, nsTable->pluginthreadasynccall);
-        }
-
-        //
-        // Set up the plugin function table that Netscape will use to
-        // call us.  Netscape needs to know about our version and size
-        // and have a UniversalProcPointer for every function we implement.
-        //
-        pluginFuncs->version        = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR;
-        pluginFuncs->size           = sizeof(NPPluginFuncs);
-        pluginFuncs->newp           = (NPP_NewProcPtr)(PLUGIN_TO_HOST_GLUE(newp, Private_New));
-        pluginFuncs->destroy        = (NPP_DestroyProcPtr)(PLUGIN_TO_HOST_GLUE(destroy, Private_Destroy));
-        pluginFuncs->setwindow      = (NPP_SetWindowProcPtr)(PLUGIN_TO_HOST_GLUE(setwindow, Private_SetWindow));
-        pluginFuncs->newstream      = (NPP_NewStreamProcPtr)(PLUGIN_TO_HOST_GLUE(newstream, Private_NewStream));
-        pluginFuncs->destroystream  = (NPP_DestroyStreamProcPtr)(PLUGIN_TO_HOST_GLUE(destroystream, Private_DestroyStream));
-        pluginFuncs->asfile         = (NPP_StreamAsFileProcPtr)(PLUGIN_TO_HOST_GLUE(asfile, Private_StreamAsFile));
-        pluginFuncs->writeready     = (NPP_WriteReadyProcPtr)(PLUGIN_TO_HOST_GLUE(writeready, Private_WriteReady));
-        pluginFuncs->write          = (NPP_WriteProcPtr)(PLUGIN_TO_HOST_GLUE(write, Private_Write));
-        pluginFuncs->print          = (NPP_PrintProcPtr)(PLUGIN_TO_HOST_GLUE(print, Private_Print));
-        pluginFuncs->event          = (NPP_HandleEventProcPtr)(PLUGIN_TO_HOST_GLUE(event, Private_HandleEvent));
-        pluginFuncs->getvalue       = (NPP_GetValueProcPtr)(PLUGIN_TO_HOST_GLUE(getvalue, Private_GetValue));
-
-        if (navMinorVers >= NPVERS_HAS_NOTIFICATION)
-            pluginFuncs->urlnotify = (NPP_URLNotifyProcPtr)(PLUGIN_TO_HOST_GLUE(urlnotify, Private_URLNotify));
-
-        pluginFuncs->javaClass = NULL;
-
-        *unloadUpp = (NPP_ShutdownProcPtr)(PLUGIN_TO_HOST_GLUE(shutdown, Private_Shutdown));
-
-        err = Private_Initialize();
-    }
-
-    return err;
-}
-
 /*
 ** netscape plugins functions when building Mach-O binary
 */



More information about the vlc-commits mailing list