nsCOMPtr <nsIChromeRegistry> chromeReg = do_GetService("@mozilla.org/chrome/chrome-registry;1"); if (!chromeReg) { NS_WARNING("chrome check couldn't get the chrome registry"); return NS_ERROR_FAILURE; } chromeReg->CheckForNewChrome();  chromeReg = 0; NS_ShutdownXPCOM(nsnull); return 0;
PLOptState* optstate = PL_CreateOptState(argc, argv, "p:");  while (PL_GetNextOpt(optstate) == PL_OPT_OK) { switch (optstate->option) { case 'p': properties_filename = optstate->value; break; case '?': print_help(); exit(1); break; } } PL_DestroyOptState(optstate);  NS_InitXPCOM2(nsnull, nsnull, nsnull);  nsCOMPtr <nsIChromeRegistry> chromeReg = do_GetService(kChromeRegistryCID); if (!chromeReg) { NS_WARNING("chrome check couldn't get the chrome registry"); return NS_ERROR_FAILURE; } chromeReg->CheckForNewChrome();   if (properties_filename) WriteProperties(properties_filename);   chromeReg = 0; NS_ShutdownXPCOM(nsnull); return 0;
int main(int argc, char **argv){  NS_InitXPCOM2(nsnull, nsnull, nsnull);  nsCOMPtr <nsIChromeRegistry> chromeReg =     do_GetService("@mozilla.org/chrome/chrome-registry;1");  if (!chromeReg) {    NS_WARNING("chrome check couldn't get the chrome registry");    return NS_ERROR_FAILURE;  }  chromeReg->CheckForNewChrome();  // release the chrome registry before we shutdown XPCOM  chromeReg = 0;  NS_ShutdownXPCOM(nsnull);  return 0;}