Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
npos2.cpp File Reference
#include <os2.h>
#include "npapi.h"
#include "npupp.h"
#include "nsDefaultPlugin.h"

Go to the source code of this file.

Defines

#define NP_EXPORT

Functions

NPError OSCALL NP_EXPORT NP_GetEntryPoints (NPPluginFuncs *pFuncs)
NPError OSCALL NP_EXPORT NP_Initialize (NPNetscapeFuncs *pFuncs)
NPError OSCALL NP_EXPORT NP_Shutdown ()
char * NP_GetMIMEDescription ()
void NPN_Version (int *plugin_major, int *plugin_minor, int *netscape_major, int *netscape_minor)
NPError NPN_GetValue (NPP instance, NPNVariable variable, void *result)
NPError NPN_GetURLNotify (NPP instance, const char *url, const char *target, void *notifyData)
NPError NPN_GetURL (NPP instance, const char *url, const char *target)
NPError NPN_PostURLNotify (NPP instance, const char *url, const char *window, uint32 len, const char *buf, NPBool file, void *notifyData)
NPError NPN_PostURL (NPP instance, const char *url, const char *window, uint32 len, const char *buf, NPBool file)
NPError NPN_RequestRead (NPStream *stream, NPByteRange *rangeList)
NPError NPN_NewStream (NPP instance, NPMIMEType type, const char *target, NPStream **stream)
int32 NPN_Write (NPP instance, NPStream *stream, int32 len, void *buffer)
NPError NPN_DestroyStream (NPP instance, NPStream *stream, NPError reason)
void NPN_Status (NPP instance, const char *message)
const char * NPN_UserAgent (NPP instance)
voidNPN_MemAlloc (uint32 size)
void NPN_MemFree (void *ptr)

Variables

NPNetscapeFuncsg_pNavigatorFuncs = 0
static NPPluginFuncsg_pluginFuncs

Define Documentation

Definition at line 50 of file npos2.cpp.


Function Documentation

reserved

Definition at line 97 of file npos2.cpp.

{
    // trap a NULL ptr 
    if(pFuncs == NULL)
        return NPERR_INVALID_FUNCTABLE_ERROR;

    // if the plugin's function table is smaller than the plugin expects,
    // then they are incompatible, and should return an error 

    pFuncs->version       = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
    pFuncs->newp          = NPP_New;
    pFuncs->destroy       = NPP_Destroy;
    pFuncs->setwindow     = NPP_SetWindow;
    pFuncs->newstream     = NPP_NewStream;
    pFuncs->destroystream = NPP_DestroyStream;
    pFuncs->asfile        = NPP_StreamAsFile;
    pFuncs->writeready    = NPP_WriteReady;
    pFuncs->write         = NPP_Write;
    pFuncs->print         = NPP_Print;
    pFuncs->event         = 0;       

       g_pluginFuncs          = pFuncs;

    return NPERR_NO_ERROR;
}

Here is the call graph for this function:

Definition at line 174 of file npos2.cpp.

{
    static char mimetype[] = NS_PLUGIN_DEFAULT_MIME_DESCRIPTION;
    return mimetype;
}

Definition at line 130 of file npos2.cpp.

{
    // trap a NULL ptr 
    if(pFuncs == NULL)
        return NPERR_INVALID_FUNCTABLE_ERROR;

    g_pNavigatorFuncs = pFuncs; // save it for future reference 

    // if the plugin's major ver level is lower than the Navigator's,
    // then they are incompatible, and should return an error 
    if(HIBYTE(pFuncs->version) > NP_VERSION_MAJOR)
        return NPERR_INCOMPATIBLE_VERSION_ERROR;

       // We have to defer these assignments until g_pNavigatorFuncs is set
    int navMinorVers = g_pNavigatorFuncs->version & 0xFF;

       if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) {
              g_pluginFuncs->urlnotify = NPP_URLNotify;
       }
#ifdef OJI    
       if( navMinorVers >= NPVERS_HAS_LIVECONNECT ) {
              g_pluginFuncs->javaClass = Private_GetJavaClass();
       }
#endif
       // NPP_Initialize is a standard (cross-platform) initialize function.
    return NPP_Initialize();
}

Here is the call graph for this function:

Definition at line 167 of file npos2.cpp.

Here is the call graph for this function:

NPError NPN_DestroyStream ( NPP  instance,
NPStream stream,
NPError  reason 
)

Definition at line 298 of file npos2.cpp.

{
       int navMinorVersion = g_pNavigatorFuncs->version & 0xFF;
       NPError err;

       if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) {
              err = g_pNavigatorFuncs->destroystream(instance, stream, reason);
       }
       else {
              err = NPERR_INCOMPATIBLE_VERSION_ERROR;
       }
       return err;
}
NPError NPN_GetURL ( NPP  instance,
const char *  url,
const char *  target 
)

Definition at line 227 of file npos2.cpp.

{
    return g_pNavigatorFuncs->geturl(instance, url, target);
}
NPError NPN_GetURLNotify ( NPP  instance,
const char *  url,
const char *  target,
void notifyData 
)

Definition at line 212 of file npos2.cpp.

{
       int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
       NPError err;
       if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) {
              err = g_pNavigatorFuncs->geturlnotify(instance, url, target, notifyData);
       }
       else {
              err = NPERR_INCOMPATIBLE_VERSION_ERROR;
       }
       return err;
}
NPError NPN_GetValue ( NPP  instance,
NPNVariable  variable,
void result 
)

Definition at line 204 of file npos2.cpp.

{
    return g_pNavigatorFuncs->getvalue(instance, variable, result);
}
void* NPN_MemAlloc ( uint32  size)

Definition at line 331 of file npos2.cpp.

void NPN_MemFree ( void ptr)

Definition at line 338 of file npos2.cpp.

NPError NPN_NewStream ( NPP  instance,
NPMIMEType  type,
const char *  target,
NPStream **  stream 
)

Definition at line 263 of file npos2.cpp.

{
       int navMinorVersion = g_pNavigatorFuncs->version & 0xFF;
       NPError err;

       if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) {
              err = g_pNavigatorFuncs->newstream(instance, type, target, stream);
       }
       else {
              err = NPERR_INCOMPATIBLE_VERSION_ERROR;
       }
       return err;
}
NPError NPN_PostURL ( NPP  instance,
const char *  url,
const char *  window,
uint32  len,
const char *  buf,
NPBool  file 
)

Definition at line 246 of file npos2.cpp.

{
    return g_pNavigatorFuncs->posturl(instance, url, window, len, buf, file);
}
NPError NPN_PostURLNotify ( NPP  instance,
const char *  url,
const char *  window,
uint32  len,
const char *  buf,
NPBool  file,
void notifyData 
)

Definition at line 232 of file npos2.cpp.

{
       int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
       NPError err;
       if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) {
              err = g_pNavigatorFuncs->posturlnotify(instance, url, window, len, buf, file, notifyData);
       }
       else {
              err = NPERR_INCOMPATIBLE_VERSION_ERROR;
       }
       return err;
}
NPError NPN_RequestRead ( NPStream stream,
NPByteRange rangeList 
)

Definition at line 255 of file npos2.cpp.

{
    return g_pNavigatorFuncs->requestread(stream, rangeList);
}
void NPN_Status ( NPP  instance,
const char *  message 
)

Definition at line 314 of file npos2.cpp.

{
    g_pNavigatorFuncs->status(instance, message);
}
const char* NPN_UserAgent ( NPP  instance)

Definition at line 321 of file npos2.cpp.

{
    return g_pNavigatorFuncs->uagent(instance);
}
void NPN_Version ( int plugin_major,
int plugin_minor,
int netscape_major,
int netscape_minor 
)

Definition at line 196 of file npos2.cpp.

{
    *plugin_major   = NP_VERSION_MAJOR;
    *plugin_minor   = NP_VERSION_MINOR;
    *netscape_major = HIBYTE(g_pNavigatorFuncs->version);
    *netscape_minor = LOBYTE(g_pNavigatorFuncs->version);
}
int32 NPN_Write ( NPP  instance,
NPStream stream,
int32  len,
void buffer 
)

Definition at line 280 of file npos2.cpp.

{
       int navMinorVersion = g_pNavigatorFuncs->version & 0xFF;
       int32 result;

       if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) {
              result = g_pNavigatorFuncs->write(instance, stream, len, buffer);
       }
       else {
              result = -1;
       }
       return result;
}

Variable Documentation

Definition at line 86 of file npos2.cpp.

Definition at line 53 of file npos2.cpp.