nsresult rv = NS_InitXPCOM(nsnull, nsnull, nsnull);
nsresult rv = NS_InitXPCOM(nsnull, nsnull);
int main(int argc, char **argv){#ifdef CRAWL_STACK_ON_SIGSEGV  strcpy(_progname,argv[0]);  signal(SIGSEGV, ah_crap_handler);  signal(SIGILL, ah_crap_handler);  signal(SIGABRT, ah_crap_handler);#endif // CRAWL_STACK_ON_SIGSEGV  // Initialize XPCOM  nsresult rv = NS_InitXPCOM(nsnull, nsnull, nsnull);  NS_ASSERTION(NS_SUCCEEDED(rv), "NS_InitXPCOM failed");  if (NS_SUCCEEDED(rv)) {    // The toolkit service in mozilla will look in the environment    // to determine which toolkit to use.  Yes, it is a dumb hack to    // force it here, but we have no choice because of toolkit specific    // code linked into the viewer.    putenv("MOZ_TOOLKIT=gtk");    gTheApp = new nsNativeViewerApp();    gTheApp->Initialize(argc, argv);    gTheApp->Run();    delete gTheApp;     // Shutdown XPCOM    rv = NS_ShutdownXPCOM(nsnull);    NS_ASSERTION(NS_SUCCEEDED(rv), "NS_ShutdownXPCOM failed");    // XXX This is disabled because sometimes it hangs waiting for a    // netlib thread to exit, which isn't exiting :-(. Need more    // shutdown logic in necko first.#if 0    // Shutdown NSPR    PR_LogFlush();    PR_Cleanup();#endif  }  return 0;}