NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved) { PluginInstance* This; int i; if (instance == NULL) return NPERR_INVALID_INSTANCE_ERROR; instance->pdata = malloc(sizeof(PluginInstance)); This = (PluginInstance*) instance->pdata; if (This == NULL) return NPERR_OUT_OF_MEMORY_ERROR; This->m_argn = (char**)malloc(sizeof(char*)*(argc+1)); This->m_argv = (char**)malloc(sizeof(char*)*(argc+1)); This->m_peer = instance; for(i=0; i<argc; i++) { (This->m_argn)[i] = strdup(argn[i]); (This->m_argv)[i] = strdup(argv[i]); }; //NPN_GetURL(This->m_peer, "javascript:document.location", // NULL); This->m_argn[i] = strdup("docbase"); This->m_argv[i] = strdup("http://java.sun.com"); argc++; This->m_argc = argc; This->m_wid = 0; ADD_INST(This); if ((g_jvmp_context->JVMP_CreatePeer)(g_ctx, PV_MOZILLA4, 0, &(This->m_id)) != JNI_TRUE) return NPERR_GENERIC_ERROR; if ((g_jvmp_context->JVMP_SendEvent)(g_ctx, This->m_id, (jint)PE_SETTYPE, (jlong)PT_APPLET) != JNI_TRUE) return NPERR_GENERIC_ERROR; /* async as it calls browser back */ if ((g_jvmp_context->JVMP_PostEvent)(g_ctx, This->m_id, (jint)PE_NEWPARAMS, (jlong)0) != JNI_TRUE) return NPERR_GENERIC_ERROR; return NPERR_NO_ERROR; }
unsigned int instruction; unsigned int format; }; #define ADD_INST(_name, _instruction, _format) \ { \ .name = (_name), \ .instruction = (_instruction), \ .format = (_format) \ } #define END_INST {0} static const struct a15_instruction a15_instructions[] = { ADD_INST("SDIV", 0x7100010, 0xFF000F0), ADD_INST("UDIV", 0x7300010, 0xFF000F0), END_INST }; #endif #ifdef CONFIG_KDEBUGD #include <linux/bootmem.h> #include <linux/vmalloc.h> #endif static int __init user_debug_setup(char *str) { get_option(&str, &user_debug); return 1; }