Bug 96910. Restore NS_NewGenericModule() entry point for backwards compatibility. r=dougt, sr=jband, a=asa

This commit is contained in:
waterson%netscape.com 2001-08-29 21:59:43 +00:00
Родитель 2afe17b617
Коммит fe14ff8338
6 изменённых файлов: 76 добавлений и 10 удалений

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

@ -114,6 +114,6 @@ NSGetModule(nsIComponentManager *servMgr,
metainfo.mCtor = Initialize;
metainfo.mDtor = Shutdown;
return NS_NewGenericModule(&metainfo, result);
return NS_NewGenericModule2(&metainfo, result);
}

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

@ -415,7 +415,7 @@ nsGenericModule::CanUnload(nsIComponentManager *aCompMgr, PRBool *okToUnload)
}
NS_COM nsresult
NS_NewGenericModule(nsModuleInfo* info, nsIModule* *result)
NS_NewGenericModule2(nsModuleInfo* info, nsIModule* *result)
{
nsresult rv = NS_OK;
@ -436,4 +436,23 @@ NS_NewGenericModule(nsModuleInfo* info, nsIModule* *result)
return rv;
}
NS_COM nsresult
NS_NewGenericModule(const char* moduleName,
PRUint32 componentCount,
nsModuleComponentInfo* components,
nsModuleDestructorProc dtor,
nsIModule* *result)
{
nsModuleInfo info;
nsCRT::memset(&info, 0, sizeof(info));
info.mVersion = NS_MODULEINFO_VERSION;
info.mModuleName = moduleName;
info.mComponents = components;
info.mCount = componentCount;
info.mDtor = dtor;
return NS_NewGenericModule2(&info, result);
}
////////////////////////////////////////////////////////////////////////////////

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

@ -125,13 +125,27 @@ struct nsModuleInfo {
/**
* Rev this if you change the nsModuleInfo, and are worried about
* binary compatibility. (Ostensibly fix NS_NewGenericModule() to deal
* binary compatibility. (Ostensibly fix NS_NewGenericModule2() to deal
* with older rev's at the same time.)
*/
#define NS_MODULEINFO_VERSION 0x00010000UL // 1.0
/**
* Create a new generic module. Use the NS_IMPL_NSGETMODULE macro, or
* one of its relatives, rather than using this directly.
*/
extern NS_COM nsresult
NS_NewGenericModule(nsModuleInfo *info, nsIModule* *result);
NS_NewGenericModule2(nsModuleInfo *info, nsIModule* *result);
/**
* Obsolete. Use NS_NewGenericModule2() instead.
*/
extern NS_COM nsresult
NS_NewGenericModule(const char* moduleName,
PRUint32 componentCount,
nsModuleComponentInfo* components,
nsModuleDestructorProc dtor,
nsIModule* *result);
#if defined(XPCOM_TRANSLATE_NSGM_ENTRY_POINT)
# define NSMODULEINFO(_name) _name##_gModuleInfo
@ -144,7 +158,7 @@ NSGetModule(nsIComponentManager *servMgr, \
nsIFile* location, \
nsIModule** result) \
{ \
return NS_NewGenericModule(&(_info), result); \
return NS_NewGenericModule2(&(_info), result); \
}
#endif

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

@ -415,7 +415,7 @@ nsGenericModule::CanUnload(nsIComponentManager *aCompMgr, PRBool *okToUnload)
}
NS_COM nsresult
NS_NewGenericModule(nsModuleInfo* info, nsIModule* *result)
NS_NewGenericModule2(nsModuleInfo* info, nsIModule* *result)
{
nsresult rv = NS_OK;
@ -436,4 +436,23 @@ NS_NewGenericModule(nsModuleInfo* info, nsIModule* *result)
return rv;
}
NS_COM nsresult
NS_NewGenericModule(const char* moduleName,
PRUint32 componentCount,
nsModuleComponentInfo* components,
nsModuleDestructorProc dtor,
nsIModule* *result)
{
nsModuleInfo info;
nsCRT::memset(&info, 0, sizeof(info));
info.mVersion = NS_MODULEINFO_VERSION;
info.mModuleName = moduleName;
info.mComponents = components;
info.mCount = componentCount;
info.mDtor = dtor;
return NS_NewGenericModule2(&info, result);
}
////////////////////////////////////////////////////////////////////////////////

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

@ -125,13 +125,27 @@ struct nsModuleInfo {
/**
* Rev this if you change the nsModuleInfo, and are worried about
* binary compatibility. (Ostensibly fix NS_NewGenericModule() to deal
* binary compatibility. (Ostensibly fix NS_NewGenericModule2() to deal
* with older rev's at the same time.)
*/
#define NS_MODULEINFO_VERSION 0x00010000UL // 1.0
/**
* Create a new generic module. Use the NS_IMPL_NSGETMODULE macro, or
* one of its relatives, rather than using this directly.
*/
extern NS_COM nsresult
NS_NewGenericModule(nsModuleInfo *info, nsIModule* *result);
NS_NewGenericModule2(nsModuleInfo *info, nsIModule* *result);
/**
* Obsolete. Use NS_NewGenericModule2() instead.
*/
extern NS_COM nsresult
NS_NewGenericModule(const char* moduleName,
PRUint32 componentCount,
nsModuleComponentInfo* components,
nsModuleDestructorProc dtor,
nsIModule* *result);
#if defined(XPCOM_TRANSLATE_NSGM_ENTRY_POINT)
# define NSMODULEINFO(_name) _name##_gModuleInfo
@ -144,7 +158,7 @@ NSGetModule(nsIComponentManager *servMgr, \
nsIFile* location, \
nsIModule** result) \
{ \
return NS_NewGenericModule(&(_info), result); \
return NS_NewGenericModule2(&(_info), result); \
}
#endif

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

@ -43,7 +43,7 @@ NSGETMODULE(_name) (nsIComponentManager* aCompMgr, \
nsIFile* aLocation, \
nsIModule** aResult) \
{ \
return NS_NewGenericModule(&NSMODULEINFO(_name), aResult); \
return NS_NewGenericModule2(&NSMODULEINFO(_name), aResult);\
}
// NSGetModule entry points