Changing RegisterFactory to use the new API.

This commit is contained in:
ebina%netscape.com 1999-02-26 16:18:23 +00:00
Родитель 2f28d33b0c
Коммит ec691d8a4c
7 изменённых файлов: 26 добавлений и 24 удалений

Просмотреть файл

@ -106,19 +106,19 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* serviceMgr, const char
{
nsresult res;
res = nsRepository::RegisterFactory(kUnicodeEncodeHelperCID, path,
res = nsRepository::RegisterComponent(kUnicodeEncodeHelperCID, NULL, NULL,
path, PR_TRUE, PR_TRUE);
if(NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
res = nsRepository::RegisterComponent(kCharsetAliasCID, NULL, NULL, path,
PR_TRUE, PR_TRUE);
if(NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
res = nsRepository::RegisterFactory(kCharsetAliasCID, path,
PR_TRUE, PR_TRUE);
res = nsRepository::RegisterComponent(kCharsetConverterManagerCID, NULL, NULL,
path, PR_TRUE, PR_TRUE);
if(NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
res = nsRepository::RegisterFactory(kCharsetConverterManagerCID, path,
PR_TRUE, PR_TRUE);
if(NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
res = nsRepository::RegisterFactory(kPlatformCharsetCID, path,
res = nsRepository::RegisterComponent(kPlatformCharsetCID, NULL, NULL, path,
PR_TRUE, PR_TRUE);
return res;
}

Просмотреть файл

@ -80,25 +80,25 @@ nsresult setupRegistry()
{
nsresult res;
res = nsRepository::RegisterFactory(kCharsetConverterManagerCID, UCONV_DLL, PR_FALSE, PR_FALSE);
res = nsRepository::RegisterComponent(kCharsetConverterManagerCID, NULL, NULL, UCONV_DLL, PR_FALSE, PR_FALSE);
if (NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
res = nsRepository::RegisterFactory(kLatin1ToUnicodeCID, UCVLATIN_DLL, PR_FALSE, PR_FALSE);
res = nsRepository::RegisterComponent(kLatin1ToUnicodeCID, NULL, NULL, UCVLATIN_DLL, PR_FALSE, PR_FALSE);
if (NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
res = nsRepository::RegisterFactory(kCP1253ToUnicodeCID, UCVLATIN_DLL, PR_FALSE, PR_FALSE);
res = nsRepository::RegisterComponent(kCP1253ToUnicodeCID, NULL, NULL, UCVLATIN_DLL, PR_FALSE, PR_FALSE);
if (NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
res = nsRepository::RegisterFactory(kISO88597ToUnicodeCID, UCVLATIN_DLL, PR_FALSE, PR_FALSE);
res = nsRepository::RegisterComponent(kISO88597ToUnicodeCID, NULL, NULL, UCVLATIN_DLL, PR_FALSE, PR_FALSE);
if (NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
res = nsRepository::RegisterFactory(kSJIS2UnicodeCID, UCVJA_DLL, PR_FALSE, PR_FALSE);
res = nsRepository::RegisterComponent(kSJIS2UnicodeCID, NULL, NULL, UCVJA_DLL, PR_FALSE, PR_FALSE);
if (NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
res = nsRepository::RegisterFactory(kISO2022JPToUnicodeCID, UCVJA2_DLL, PR_FALSE, PR_FALSE);
res = nsRepository::RegisterComponent(kISO2022JPToUnicodeCID, NULL, NULL, UCVJA2_DLL, PR_FALSE, PR_FALSE);
if (NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
res = nsRepository::RegisterFactory(kPlatformCharsetCID, UCONV_DLL, PR_FALSE, PR_FALSE);
res = nsRepository::RegisterComponent(kPlatformCharsetCID, NULL, NULL, UCONV_DLL, PR_FALSE, PR_FALSE);
if (NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
return NS_OK;

Просмотреть файл

@ -149,8 +149,8 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* serviceMgr, const char
nsresult res;
for (PRInt32 i=0; i<ARRAY_SIZE(g_FactoryData); i++) {
res = nsRepository::RegisterFactory(*(g_FactoryData[i].mCID), path,
PR_TRUE, PR_TRUE);
res = nsRepository::RegisterComponent(*(g_FactoryData[i].mCID), NULL, NULL,
path, PR_TRUE, PR_TRUE);
if(NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
}

Просмотреть файл

@ -168,8 +168,8 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* serviceMgr, const char
nsresult res;
for (PRInt32 i=0; i<ARRAY_SIZE(g_FactoryData); i++) {
res = nsRepository::RegisterFactory(*(g_FactoryData[i].mCID), path,
PR_TRUE, PR_TRUE);
res = nsRepository::RegisterComponent(*(g_FactoryData[i].mCID), NULL, NULL,
path, PR_TRUE, PR_TRUE);
if(NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
}

Просмотреть файл

@ -172,8 +172,8 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* serviceMgr, const char
nsresult res;
for (PRInt32 i=0; i<ARRAY_SIZE(g_FactoryData); i++) {
res = nsRepository::RegisterFactory(*(g_FactoryData[i].mCID), path,
PR_TRUE, PR_TRUE);
res = nsRepository::RegisterComponent(*(g_FactoryData[i].mCID), NULL, NULL,
path, PR_TRUE, PR_TRUE);
if(NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
}

Просмотреть файл

@ -108,7 +108,7 @@ extern "C" NS_EXPORT PRBool NSCanUnload(nsISupports* serviceMgr) {
}
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* serviceMgr, const char *path)
{
return nsRepository::RegisterFactory(kUnicharUtilCID, path,
return nsRepository::RegisterComponent(kUnicharUtilCID, NULL, NULL, path,
PR_TRUE, PR_TRUE);
}

Просмотреть файл

@ -347,12 +347,14 @@ void TestCaseConversion()
void RegisterFactories()
{
nsresult res;
res = nsRepository::RegisterFactory(kUnicharUtilCID,
res = nsRepository::RegisterComponent(kUnicharUtilCID,
NULL,
NULL,
UNICHARUTIL_DLL_NAME,
PR_FALSE,
PR_TRUE);
if(NS_FAILED(res))
cout << "RegisterFactory failed\n";
cout << "RegisterComponent failed\n";
}
int main(int argc, char** argv) {