From 509501efbf5c081d5ede2cf6c55165cc251b4d4e Mon Sep 17 00:00:00 2001 From: "mcmullen%netscape.com" Date: Mon, 22 Feb 1999 23:24:03 +0000 Subject: [PATCH] Brought some more of the changes over from the trunk (needed the changes in xcDll.h/cpp). git-svn-id: svn://10.0.0.236/branches/LIBREG990212_BRANCH@21501 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/components/nsRepository.cpp | 10 ++--- mozilla/xpcom/components/xcDll.cpp | 50 ++++++++++++++++++++--- mozilla/xpcom/components/xcDll.h | 6 +-- mozilla/xpcom/src/nsRepository.cpp | 10 ++--- mozilla/xpcom/src/xcDll.cpp | 50 ++++++++++++++++++++--- mozilla/xpcom/src/xcDll.h | 6 +-- 6 files changed, 106 insertions(+), 26 deletions(-) diff --git a/mozilla/xpcom/components/nsRepository.cpp b/mozilla/xpcom/components/nsRepository.cpp index 63d694eeb64..7daf684cd58 100644 --- a/mozilla/xpcom/components/nsRepository.cpp +++ b/mozilla/xpcom/components/nsRepository.cpp @@ -234,7 +234,7 @@ static nsDll *platformCreateDll(const char *fullname) } PRTime lastModTime = LL_ZERO; - PRUint64 fileSize = LL_ZERO; + PRUint32 fileSize = 0; uint32 n = sizeof(lastModTime); NR_RegGetEntry(hreg, key, "LastModTimeStamp", &lastModTime, &n); n = sizeof(fileSize); @@ -282,7 +282,7 @@ static nsresult platformMarkNoComponents(nsDll *dll) } PRTime lastModTime = dll->GetLastModifiedTime(); - PRUint64 fileSize = dll->GetSize(); + PRUint32 fileSize = dll->GetSize(); NR_RegSetEntry(hreg, key, "LastModTimeStamp", REGTYPE_ENTRY_BYTES, &lastModTime, sizeof(lastModTime)); NR_RegSetEntry(hreg, key, "FileSize", REGTYPE_ENTRY_BYTES, @@ -352,7 +352,7 @@ static nsresult platformRegister(NSQuickRegisterData regd, nsDll *dll) NR_RegAddKey(hreg, xpcomKey, (char *)dll->GetFullPath(), &key); PRTime lastModTime = dll->GetLastModifiedTime(); - PRUint64 fileSize = dll->GetSize(); + PRUint32 fileSize = dll->GetSize(); NR_RegSetEntry(hreg, key, "LastModTimeStamp", REGTYPE_ENTRY_BYTES, &lastModTime, sizeof(lastModTime)); @@ -477,7 +477,7 @@ static FactoryEntry *platformFind(const nsCID &aCID) // Get the library name, modifiedtime and size PRTime lastModTime = LL_ZERO; - PRUint64 fileSize = LL_ZERO; + PRUint32 fileSize = 0; char buf[MAXREGNAMELEN]; uint32 len = sizeof(buf); @@ -1186,7 +1186,7 @@ nsresult nsRepository::AutoRegister(NSRegistrationInstant when, ProcessSerialNumber psn; ProcessInfoRec pInfo; FSSpec appFSSpec; - long theDirID, oldLen, newLen; + long theDirID; Str255 name; #endif diff --git a/mozilla/xpcom/components/xcDll.cpp b/mozilla/xpcom/components/xcDll.cpp index 856096648c0..fc62ecd2f9c 100644 --- a/mozilla/xpcom/components/xcDll.cpp +++ b/mozilla/xpcom/components/xcDll.cpp @@ -31,7 +31,7 @@ nsDll::nsDll(const char *libFullPath) : m_fullpath(NULL), m_instance(NULL), m_status(DLL_OK) { m_lastModTime = LL_ZERO; - m_size = LL_ZERO; + m_size = 0; if (libFullPath == NULL) { @@ -46,8 +46,8 @@ nsDll::nsDll(const char *libFullPath) : m_fullpath(NULL), m_instance(NULL), return; } - PRFileInfo64 statinfo; - if (PR_GetFileInfo64(m_fullpath, &statinfo) != PR_SUCCESS) + PRFileInfo statinfo; + if (PR_GetFileInfo(m_fullpath, &statinfo) != PR_SUCCESS) { // The stat things works only if people pass in the full pathname. // Even if our stat fails, we could be able to load it because of @@ -71,7 +71,7 @@ nsDll::nsDll(const char *libFullPath) : m_fullpath(NULL), m_instance(NULL), } -nsDll::nsDll(const char *libFullPath, PRTime lastModTime, PRUint64 fileSize) +nsDll::nsDll(const char *libFullPath, PRTime lastModTime, PRUint32 fileSize) : m_fullpath(NULL), m_instance(NULL), m_status(DLL_OK) { m_lastModTime = lastModTime; @@ -101,8 +101,17 @@ nsDll::~nsDll(void) m_fullpath = NULL; } + PRBool nsDll::Load(void) { + // Of course, this is all buggy, because it uses paths instead of nsFileSpec. + // Also, instead of writing yet another converter for path separators, for + // pete's sake use the converters in nsFileSpec.h. Thank you. +#ifdef XP_MAC + char *macFileName = NULL; + int loop; +#endif + if (m_status != DLL_OK) { return (PR_FALSE); @@ -112,7 +121,38 @@ PRBool nsDll::Load(void) // Already loaded return (PR_TRUE); } - m_instance = PR_LoadLibrary(m_fullpath); +#ifdef XP_MAC + // err = ConvertUnixPathToMacPath(m_fullpath, &macFileName); + if ((macFileName = PL_strdup(m_fullpath)) != NULL) + { + if (macFileName[0] == '/') + { + for (loop=0; loopGetLastModifiedTime(); - PRUint64 fileSize = dll->GetSize(); + PRUint32 fileSize = dll->GetSize(); NR_RegSetEntry(hreg, key, "LastModTimeStamp", REGTYPE_ENTRY_BYTES, &lastModTime, sizeof(lastModTime)); NR_RegSetEntry(hreg, key, "FileSize", REGTYPE_ENTRY_BYTES, @@ -352,7 +352,7 @@ static nsresult platformRegister(NSQuickRegisterData regd, nsDll *dll) NR_RegAddKey(hreg, xpcomKey, (char *)dll->GetFullPath(), &key); PRTime lastModTime = dll->GetLastModifiedTime(); - PRUint64 fileSize = dll->GetSize(); + PRUint32 fileSize = dll->GetSize(); NR_RegSetEntry(hreg, key, "LastModTimeStamp", REGTYPE_ENTRY_BYTES, &lastModTime, sizeof(lastModTime)); @@ -477,7 +477,7 @@ static FactoryEntry *platformFind(const nsCID &aCID) // Get the library name, modifiedtime and size PRTime lastModTime = LL_ZERO; - PRUint64 fileSize = LL_ZERO; + PRUint32 fileSize = 0; char buf[MAXREGNAMELEN]; uint32 len = sizeof(buf); @@ -1186,7 +1186,7 @@ nsresult nsRepository::AutoRegister(NSRegistrationInstant when, ProcessSerialNumber psn; ProcessInfoRec pInfo; FSSpec appFSSpec; - long theDirID, oldLen, newLen; + long theDirID; Str255 name; #endif diff --git a/mozilla/xpcom/src/xcDll.cpp b/mozilla/xpcom/src/xcDll.cpp index 856096648c0..fc62ecd2f9c 100644 --- a/mozilla/xpcom/src/xcDll.cpp +++ b/mozilla/xpcom/src/xcDll.cpp @@ -31,7 +31,7 @@ nsDll::nsDll(const char *libFullPath) : m_fullpath(NULL), m_instance(NULL), m_status(DLL_OK) { m_lastModTime = LL_ZERO; - m_size = LL_ZERO; + m_size = 0; if (libFullPath == NULL) { @@ -46,8 +46,8 @@ nsDll::nsDll(const char *libFullPath) : m_fullpath(NULL), m_instance(NULL), return; } - PRFileInfo64 statinfo; - if (PR_GetFileInfo64(m_fullpath, &statinfo) != PR_SUCCESS) + PRFileInfo statinfo; + if (PR_GetFileInfo(m_fullpath, &statinfo) != PR_SUCCESS) { // The stat things works only if people pass in the full pathname. // Even if our stat fails, we could be able to load it because of @@ -71,7 +71,7 @@ nsDll::nsDll(const char *libFullPath) : m_fullpath(NULL), m_instance(NULL), } -nsDll::nsDll(const char *libFullPath, PRTime lastModTime, PRUint64 fileSize) +nsDll::nsDll(const char *libFullPath, PRTime lastModTime, PRUint32 fileSize) : m_fullpath(NULL), m_instance(NULL), m_status(DLL_OK) { m_lastModTime = lastModTime; @@ -101,8 +101,17 @@ nsDll::~nsDll(void) m_fullpath = NULL; } + PRBool nsDll::Load(void) { + // Of course, this is all buggy, because it uses paths instead of nsFileSpec. + // Also, instead of writing yet another converter for path separators, for + // pete's sake use the converters in nsFileSpec.h. Thank you. +#ifdef XP_MAC + char *macFileName = NULL; + int loop; +#endif + if (m_status != DLL_OK) { return (PR_FALSE); @@ -112,7 +121,38 @@ PRBool nsDll::Load(void) // Already loaded return (PR_TRUE); } - m_instance = PR_LoadLibrary(m_fullpath); +#ifdef XP_MAC + // err = ConvertUnixPathToMacPath(m_fullpath, &macFileName); + if ((macFileName = PL_strdup(m_fullpath)) != NULL) + { + if (macFileName[0] == '/') + { + for (loop=0; loop