nsFontFamilyName* f = gFamilyNameTable;
nsFontFamilyNameXlib* f = gFamilyNameTable;
InitGlobals(void){  nsServiceManager::GetService(kCharSetManagerCID,                               NS_GET_IID(nsICharsetConverterManager2),                               (nsISupports**) &gCharSetManager);  if (!gCharSetManager) {    FreeGlobals();    return NS_ERROR_FAILURE;  }  nsServiceManager::GetService(kPrefCID, NS_GET_IID(nsIPref),                               (nsISupports**) &gPref);  if (!gPref) {    FreeGlobals();    return NS_ERROR_FAILURE;  }  gNodes = new nsHashtable();  if (!gNodes) {    FreeGlobals();    return NS_ERROR_OUT_OF_MEMORY;  }  gCachedFFRESearches = new nsHashtable();  if (!gCachedFFRESearches) {    FreeGlobals();    return NS_ERROR_OUT_OF_MEMORY;  }  gFamilies = new nsHashtable();  if (!gFamilies) {    FreeGlobals();    return NS_ERROR_OUT_OF_MEMORY;  }    gAliases = new nsHashtable();  if (!gAliases) {    FreeGlobals();    return NS_ERROR_OUT_OF_MEMORY;  }  nsFontFamilyName* f = gFamilyNameTable;  while (f->mName) {    nsCStringKey key(f->mName);    gAliases->Put(&key, f->mXName);    f++;  }  gWeights = new nsHashtable();  if (!gWeights) {    FreeGlobals();    return NS_ERROR_OUT_OF_MEMORY;  }  nsFontPropertyName* p = gWeightNames;  while (p->mName) {    nsCStringKey key(p->mName);    gWeights->Put(&key, (void*) p->mValue);    p++;  }  gStretches = new nsHashtable();  if (!gStretches) {    FreeGlobals();    return NS_ERROR_OUT_OF_MEMORY;  }  p = gStretchNames;  while (p->mName) {    nsCStringKey key(p->mName);    gStretches->Put(&key, (void*) p->mValue);    p++;  }  gCharSets = new nsHashtable();  if (!gCharSets) {    FreeGlobals();    return NS_ERROR_OUT_OF_MEMORY;  }  nsFontCharSetMap* charSetMap = gCharSetMap;  while (charSetMap->mName) {    nsCStringKey key(charSetMap->mName);    gCharSets->Put(&key, charSetMap->mInfo);    charSetMap++;  }  gSpecialCharSets = new nsHashtable();  if (!gSpecialCharSets) {    FreeGlobals();    return NS_ERROR_OUT_OF_MEMORY;  }  nsFontCharSetMap* specialCharSetMap = gSpecialCharSetMap;  while (specialCharSetMap->mName) {    nsCStringKey key(specialCharSetMap->mName);    gSpecialCharSets->Put(&key, specialCharSetMap->mInfo);    specialCharSetMap++;  }  gUnicode = NS_NewAtom("x-unicode");  if (!gUnicode) {    FreeGlobals();    return NS_ERROR_OUT_OF_MEMORY;  }  gUserDefined = NS_NewAtom(USER_DEFINED);  if (!gUserDefined) {    FreeGlobals();    return NS_ERROR_OUT_OF_MEMORY;  }  /* get the user's locale */  nsCOMPtr <nsILanguageAtomService> langService;  langService = do_GetService(NS_LANGUAGEATOMSERVICE_CONTRACTID);  if (langService)    langService->GetLocaleLanguageGroup(&gUsersLocale);  if (!gUsersLocale)    gUsersLocale = NS_NewAtom("x-western");  if (!gUsersLocale) {    FreeGlobals();    return NS_ERROR_OUT_OF_MEMORY;  }  gInitialized = 1;    return NS_OK;}