+++ /dev/null
-# CMake
-CMakeCache.txt
-CMakeFiles
-Makefile
-cmake_install.cmake
-install_manifest.txt
-
-##
-## C++
-################################
-# Compiled Object files
-*.slo
-*.lo
-*.o
-*.obj
-
-# Compiled Dynamic libraries
-*.so
-*.dylib
-*.dll
-
-# Compiled Static libraries
-*.lai
-*.la
-*.a
-*.lib
-
-# Executables
-*.exe
-*.out
-*.app
-
-##
-## C Files
-##############################
-# Object files
-*.o
-*.ko
-*.obj
-*.elf
-
-# Libraries
-*.lib
-*.a
-
-# Shared objects (inc. Windows DLLs)
-*.dll
-*.so
-*.so.*
-*.dylib
-
-# Executables
-*.exe
-*.out
-*.app
-*.hex
--- /dev/null
+#include <stdio.h>
+#include <string.h>
+#include <firefox/npapi.h>
+#include <firefox/nptypes.h>
+#include <firefox/npfunctions.h>
+
+/*
+ * Loading and unloading the library
+ */
+NPError NP_Initialize(NPNetscapeFuncs *aNPNFuncs, NPPluginFuncs *aNPPFuncs)
+{
+ return NPERR_NO_ERROR;
+}
+
+void NP_Shutdown(void)
+{
+ return;
+}
+
+/*
+ * Create and destroy an instance of the plugin
+ */
+NPError NPP_New(NPMIMEType pluginType,
+ NPP instance, uint16_t mode,
+ int16_t argc, char *argn[],
+ char *argv[], NPSavedData *saved)
+{
+ return(NPERR_NO_ERROR);
+}
+
+NPError NPP_Destroy(NPP instance, NPSavedData **save)
+{
+ return(NPERR_NO_ERROR);
+}
+
+
+
+/*
+ * Register the plugin for MIME type, and name, etc.
+ */
+#define MIME_TYPES_DESCRIPTION "application/web-shot:wsht:Web plugin for the Moonshot libraries"
+const char* NP_GetMIMEDescription(void)
+{
+ return(MIME_TYPES_DESCRIPTION);
+}
+
+NPError NP_GetValue(void *instance,
+ NPPVariable variable,
+ void *value)
+{
+ switch(variable)
+ {
+ case NPPVpluginNameString:
+ *((char **)value) = "GSS-web Plugin\0";
+ break;
+ case NPPVpluginDescriptionString:
+ *((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";
+ break;
+ default:
+ return NPERR_GENERIC_ERROR;
+ }
+
+ return NPERR_NO_ERROR;
+}
--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+#include <dlfcn.h>
+#include <firefox/npapi.h>
+
+int main(int argc, char **argv)
+{
+ void *lib_handle;
+ int (*fn)(void);
+ int x;
+ char *error;
+
+ char* funcs[4] = {"NP_Initialize", "NP_Shutdown", "NPP_New", "NPP_Destroy"};
+
+ lib_handle = dlopen("../../npapi/libWebShot.so", RTLD_LAZY);
+ if (!lib_handle)
+ {
+ fprintf(stderr, "%s\n", dlerror());
+ exit(1);
+ }
+
+ for (x=0; x<4; x++)
+ {
+ int retVal = 0;
+
+ fn = dlsym(lib_handle, funcs[x]);
+ if ((error = dlerror()) != NULL)
+ {
+ fprintf(stderr, "Did not find function %s: %s\n", funcs[x], error);
+ exit(2);
+ }
+
+ retVal = (*fn)();
+ printf("%s() => %i\n", funcs[x], retVal);
+ }
+
+
+ /*
+ (*fn)(&x);
+ printf("Valx=%d\n",x);
+ */
+
+ dlclose(lib_handle);
+ return 0;
+}