f6840e1390102bbabc67bec34504420cc5552774
[gssweb.git] / npapi / npapi.c
1 #include <stdio.h>
2 #include <string.h>
3 #include <firefox/npapi.h>
4 #include <firefox/nptypes.h>
5 #include <firefox/npfunctions.h>
6
7 /*
8  * Loading and unloading the library 
9  */
10 NPError NP_Initialize(NPNetscapeFuncs *aNPNFuncs, NPPluginFuncs *aNPPFuncs)
11 {
12   return NPERR_NO_ERROR;
13 }
14
15 void NP_Shutdown(void)
16 {
17   return;
18 }
19
20 /*
21  * Create and destroy an instance of the plugin
22  */
23 NPError NPP_New(NPMIMEType    pluginType,
24                 NPP instance, uint16_t mode,
25                 int16_t argc, char *argn[],
26                 char *argv[], NPSavedData *saved)
27 {
28   return(NPERR_NO_ERROR);
29 }
30
31 NPError NPP_Destroy(NPP instance, NPSavedData **save)
32 {
33   return(NPERR_NO_ERROR);
34 }
35
36
37
38 /*
39  * Register the plugin for MIME type, and name, etc.
40  */
41 #define MIME_TYPES_DESCRIPTION "application/web-shot:wsht:Web plugin for the Moonshot libraries"
42 const char* NP_GetMIMEDescription(void)
43 {
44   return(MIME_TYPES_DESCRIPTION);
45 }
46
47 NPError NP_GetValue(void *instance, 
48                     NPPVariable variable, 
49                     void *value)
50 {
51   switch(variable)
52   {
53   case NPPVpluginNameString:
54     *((char **)value) = "GSS-web Plugin\0";
55     break;
56   case NPPVpluginDescriptionString:
57     *((char **)value) = "This plugin facilitates identification of you and authorization to access web resources using GSS-EAP, a standards-compliant mechanism for establishing an identity and access rights within a sophisticated organization.\0";
58     break;
59   default:
60     return NPERR_GENERIC_ERROR;
61   }
62   
63   return NPERR_NO_ERROR;
64 }