nsComponentManager::AutoRegister(nsIComponentManagerObsolete::NS_Startup, NULL);
nsCOMPtr<nsIComponentRegistrar> registrar = do_QueryInterface(servMan); NS_ASSERTION(registrar, "Null nsIComponentRegistrar"); registrar->AutoRegister(nsnull);
main(int argc, char* argv[]){    nsresult rv;    nsCOMPtr<nsILocalFile> topDir;    rv = NS_InitXPCOM2(nsnull, nsnull, nsnull);    if (NS_FAILED(rv)) return -1;        nsComponentManager::AutoRegister(nsIComponentManagerObsolete::NS_Startup, NULL);    if (argc > 1 && argv[1] != nsnull)     {            char* pathStr = argv[1];        NS_NewLocalFile(pathStr, PR_FALSE, getter_AddRefs(topDir));    }        if (!topDir)    {       printf("No Top Dir\n");       return -1;    }    PRInt32 startTime = PR_IntervalNow();        LoopInDir(topDir);        PRInt32 endTime = PR_IntervalNow();        printf("\nTime: %d\n", PR_IntervalToMilliseconds(endTime - startTime));    return 0;}