NS_InitXPCOM(NULL, NULL, NULL);
NS_InitXPCOM(NULL, NULL);
int main(int argc, char *argv[]){    int ret = 0;    NS_InitXPCOM(NULL, NULL, NULL);    /* With no arguments, RegFactory will autoregister */    if (argc <= 1)    {        nsresult rv = nsComponentManager::AutoRegister(                                                       nsIComponentManager::NS_Startup,                                                       NULL /* default location */);        ret = (NS_FAILED(rv)) ? -1 : 0;    }    else      ret = ProcessArgs(argc, argv);    NS_ShutdownXPCOM(NULL);    return ret;}