зеркало из https://github.com/mozilla/pjs.git
remove XP_MAC from mailnews. b=281889 r=bienvenu
This commit is contained in:
Родитель
a491f25e25
Коммит
e084f009f4
|
@ -869,11 +869,6 @@ static int match_begin_name(int end) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(XP_MAC) && defined(__MWERKS__)
|
||||
#pragma warn_possunwant off
|
||||
#pragma require_prototypes off
|
||||
#endif
|
||||
|
||||
void initLex(const char *inputstring, unsigned long inputlen)
|
||||
{
|
||||
/* initialize lex mode stack */
|
||||
|
|
|
@ -659,7 +659,7 @@ nsresult nsMsgFilter::ConvertMoveOrCopyToFolderValue(nsIMsgRuleAction *filterAct
|
|||
// need to remove ".sbd" from moveValue, and perhaps escape it.
|
||||
moveValue.ReplaceSubstring(".sbd/", "/");
|
||||
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
char *unescapedMoveValue = ToNewCString(moveValue);
|
||||
nsUnescape(unescapedMoveValue);
|
||||
moveValue.Assign(unescapedMoveValue);
|
||||
|
|
|
@ -55,13 +55,11 @@
|
|||
#include "nsDirectoryServiceDefs.h"
|
||||
#include "nsISupportsObsolete.h"
|
||||
#include "nsQuickSort.h"
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
#include "nsIAppleFileDecoder.h"
|
||||
#if defined(XP_MACOSX)
|
||||
#include "nsILocalFileMac.h"
|
||||
#include "MoreFilesX.h"
|
||||
#endif
|
||||
#endif
|
||||
#include "nsNativeCharsetUtils.h"
|
||||
|
||||
// necko
|
||||
|
@ -216,16 +214,6 @@ nsresult ConvertAndSanitizeFileName(const char * displayName, PRUnichar ** unico
|
|||
NS_ConvertUTF8toUTF16 ucs2Str(unescapedName);
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
#if defined(XP_MAC) /* reviewed for 1.4, XP_MACOSX not needed */
|
||||
/* We need to truncate the name to 31 characters, this even on MacOS X until the file API
|
||||
correctly support long file name. Using a nsILocalFile will do the trick...
|
||||
*/
|
||||
nsCOMPtr<nsILocalFile> aLocalFile(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv));
|
||||
if (NS_SUCCEEDED(aLocalFile->SetLeafName(ucs2Str)))
|
||||
{
|
||||
aLocalFile->GetLeafName(ucs2Str);
|
||||
}
|
||||
#endif
|
||||
|
||||
// replace platform specific path separator and illegale characters to avoid any confusion
|
||||
ucs2Str.ReplaceChar(FILE_PATH_SEPARATOR FILE_ILLEGAL_CHARACTERS, '-');
|
||||
|
@ -776,7 +764,7 @@ nsMessenger::SaveAttachment(nsIFileSpec * fileSpec,
|
|||
saveListener->QueryInterface(NS_GET_IID(nsIStreamListener),
|
||||
getter_AddRefs(convertedListener));
|
||||
|
||||
#if !defined(XP_MAC) && !defined(XP_MACOSX)
|
||||
#ifndef XP_MACOSX
|
||||
// if the content type is bin hex we are going to do a hokey hack and make sure we decode the bin hex
|
||||
// when saving an attachment to disk..
|
||||
if (contentType && !nsCRT::strcasecmp(APPLICATION_BINHEX, contentType))
|
||||
|
@ -1959,7 +1947,7 @@ nsresult nsSaveMsgListener::InitializeDownload(nsIRequest * aRequest, PRInt32 aB
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
/* if we are saving an appledouble or applesingle attachment, we need to use an Apple File Decoder */
|
||||
if ((nsCRT::strcasecmp(m_contentType.get(), APPLICATION_APPLEFILE) == 0) ||
|
||||
(nsCRT::strcasecmp(m_contentType.get(), MULTIPART_APPLEDOUBLE) == 0))
|
||||
|
|
|
@ -79,11 +79,11 @@
|
|||
* on the Mac, the fat file stores relative paths to the newsrc files
|
||||
*/
|
||||
#define NEWS_FAT_STORES_ABSOLUTE_NEWSRC_FILE_PATHS 1
|
||||
#elif defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#elif defined(XP_MACOSX)
|
||||
#define NEWS_FAT_FILE_NAME "NewsFAT"
|
||||
#else
|
||||
#error dont_know_what_your_news_fat_file_is
|
||||
#endif /* XP_WIN, XP_OS2, XP_MAC */
|
||||
#endif /* XP_WIN, XP_OS2, XP_MACOSX */
|
||||
|
||||
#endif /* XP_UNIX || XP_BEOS */
|
||||
|
||||
|
|
|
@ -316,9 +316,7 @@ static PRBool ConvertibleToNative(const nsAutoString& str)
|
|||
return str.Equals(roundTripped);
|
||||
}
|
||||
|
||||
#if defined(XP_MAC)
|
||||
const static PRUint32 MAX_LEN = 25;
|
||||
#elif defined(XP_UNIX) || defined(XP_BEOS)
|
||||
#if defined(XP_UNIX) || defined(XP_BEOS)
|
||||
const static PRUint32 MAX_LEN = 55;
|
||||
#elif defined(XP_WIN32)
|
||||
const static PRUint32 MAX_LEN = 55;
|
||||
|
|
|
@ -60,14 +60,8 @@
|
|||
#include "nsMimeTypes.h"
|
||||
#include "prmem.h"
|
||||
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
|
||||
#ifdef XP_MAC
|
||||
#pragma warn_unusedarg off
|
||||
#pragma cplusplus on
|
||||
#else
|
||||
#if defined(XP_MACOSX)
|
||||
#include "MoreFilesX.h"
|
||||
#endif
|
||||
|
||||
void
|
||||
MacGetFileType(nsFileSpec *fs,
|
||||
|
@ -86,13 +80,9 @@ MacGetFileType(nsFileSpec *fs,
|
|||
*encoding = NULL;
|
||||
|
||||
FInfo fndrInfo;
|
||||
#if defined(XP_MAC)
|
||||
OSErr err = FSpGetFInfo( fs->GetFSSpecPtr(), &fndrInfo );
|
||||
#else
|
||||
FSSpec fsSpec;
|
||||
FSPathMakeFSSpec((UInt8 *)fs->GetNativePathCString(), &fsSpec, NULL);
|
||||
OSErr err = FSpGetFInfo (&fsSpec, &fndrInfo);
|
||||
#endif
|
||||
|
||||
if ( (err != noErr) || (fndrInfo.fdType == 'TEXT') )
|
||||
*fileType = nsCRT::strdup(APPLICATION_OCTET_STREAM);
|
||||
|
@ -143,11 +133,7 @@ int ap_encode_init( appledouble_encode_object *p_ap_encode_obj,
|
|||
if (!mySpec.Exists())
|
||||
return -1;
|
||||
|
||||
#if defined(XP_MAC)
|
||||
fspec = mySpec.GetFSSpec();
|
||||
#else
|
||||
FSPathMakeFSSpec((const UInt8 *)fname, &fspec, NULL);
|
||||
#endif
|
||||
memset(p_ap_encode_obj, 0, sizeof(appledouble_encode_object));
|
||||
|
||||
/*
|
||||
|
@ -312,5 +298,4 @@ int ap_encode_end(
|
|||
return noErr;
|
||||
}
|
||||
|
||||
#endif /* the ifdef of XP_MAC */
|
||||
|
||||
#endif /* XP_MACOSX */
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
#include "nsMsgAppleDouble.h"
|
||||
#include "nsMsgAppleCodes.h"
|
||||
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
|
||||
#include <Errors.h>
|
||||
|
||||
|
@ -729,4 +729,4 @@ static int output64chunk(
|
|||
p-tmpstr);
|
||||
}
|
||||
|
||||
#endif /* if define XP_MAC */
|
||||
#endif /* XP_MACOSX */
|
||||
|
|
|
@ -70,22 +70,16 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// Mac Specific Attachment Handling for AppleDouble Encoded Files
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
|
||||
#define AD_WORKING_BUFF_SIZE 8192
|
||||
|
||||
|
||||
extern void MacGetFileType(nsFileSpec *fs, PRBool *useDefault, char **type, char **encoding);
|
||||
|
||||
#include "nsIInternetConfigService.h"
|
||||
|
||||
#if defined(XP_MAC)
|
||||
#include "MoreFilesExtras.h"
|
||||
#else
|
||||
#include "MoreFilesX.h"
|
||||
#endif /* XP_MAC */
|
||||
|
||||
#endif /* XP_MAC */
|
||||
#endif /* XP_MACOSX */
|
||||
|
||||
//
|
||||
// Class implementation...
|
||||
|
@ -139,7 +133,7 @@ nsMsgAttachmentHandler::nsMsgAttachmentHandler()
|
|||
m_x_mac_type = nsnull;
|
||||
m_x_mac_creator = nsnull;
|
||||
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
mAppleFileSpec = nsnull;
|
||||
#endif
|
||||
|
||||
|
@ -152,7 +146,7 @@ nsMsgAttachmentHandler::~nsMsgAttachmentHandler()
|
|||
#if defined(DEBUG_ducarroz)
|
||||
printf("DISPOSE nsMsgAttachmentHandler: %x\n", this);
|
||||
#endif
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
if (mAppleFileSpec)
|
||||
delete mAppleFileSpec;
|
||||
#endif
|
||||
|
@ -503,7 +497,7 @@ FetcherURLDoneCallback(nsresult aStatus,
|
|||
ma->m_size = totalSize;
|
||||
if (aContentType)
|
||||
{
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
//Do not change the type if we are dealing with an apple double file
|
||||
if (!ma->mAppleFileSpec)
|
||||
#else
|
||||
|
@ -653,7 +647,7 @@ done:
|
|||
return rv;
|
||||
}
|
||||
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
PRBool nsMsgAttachmentHandler::HasResourceFork(FSSpec *fsSpec)
|
||||
{
|
||||
FSRef fsRef;
|
||||
|
@ -716,7 +710,7 @@ nsMsgAttachmentHandler::SnarfAttachment(nsMsgCompFields *compFields)
|
|||
|
||||
mURL->GetSpec(url_string);
|
||||
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
if ( !m_bogus_attachment && nsMsgIsLocalFile(url_string))
|
||||
{
|
||||
// convert the apple file to AppleDouble first, and then patch the
|
||||
|
@ -732,12 +726,8 @@ nsMsgAttachmentHandler::SnarfAttachment(nsMsgCompFields *compFields)
|
|||
//We need to retrieve the file type and creator...
|
||||
nsFileSpec scr_fileSpec(escapedFilename.get());
|
||||
FSSpec fsSpec;
|
||||
#if defined(XP_MAC)
|
||||
fsSpec = scr_fileSpec.GetFSSpec();
|
||||
#elif defined(XP_MACOSX)
|
||||
Boolean isDir;
|
||||
FSPathMakeFSSpec((UInt8 *)escapedFilename.get(), &fsSpec, &isDir);
|
||||
#endif
|
||||
FInfo info;
|
||||
if (FSpGetFInfo (&fsSpec, &info) == noErr)
|
||||
{
|
||||
|
@ -767,9 +757,7 @@ nsMsgAttachmentHandler::SnarfAttachment(nsMsgCompFields *compFields)
|
|||
{
|
||||
// before deciding to send the resource fork along the data fork, check if we have one,
|
||||
// else don't need to use apple double.
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
sendResourceFork = HasResourceFork(&fsSpec);
|
||||
#endif
|
||||
}
|
||||
|
||||
icGaveNeededInfo = PR_TRUE;
|
||||
|
@ -974,7 +962,7 @@ nsMsgAttachmentHandler::SnarfAttachment(nsMsgCompFields *compFields)
|
|||
|
||||
PR_FREEIF(src_filename);
|
||||
}
|
||||
#endif /* XP_MAC */
|
||||
#endif /* XP_MACOSX */
|
||||
|
||||
//
|
||||
// Ok, here we are, we need to fire the URL off and get the data
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include "nsIFileStreams.h"
|
||||
#include "nsIStreamConverter.h"
|
||||
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
|
||||
#include "nsMsgAppleDouble.h"
|
||||
|
||||
|
@ -59,7 +59,7 @@ typedef struct _AppledoubleEncodeObject
|
|||
nsIOFileStream *fileStream; // file to hold the encoding
|
||||
} AppleDoubleEncodeObject;
|
||||
|
||||
#endif // XP_MAC
|
||||
#endif // XP_MACOSX
|
||||
|
||||
//
|
||||
// This is a class that deals with processing remote attachments. It implements
|
||||
|
@ -90,7 +90,7 @@ private:
|
|||
PRBool UseUUEncode_p(void);
|
||||
void AnalyzeDataChunk (const char *chunk, PRInt32 chunkSize);
|
||||
nsresult LoadDataFromFile(nsFileSpec& fSpec, nsString &sigData, PRBool charsetConversion); //A similar function already exist in nsMsgCompose!
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
PRBool HasResourceFork(FSSpec *fsSpec);
|
||||
#endif
|
||||
|
||||
|
@ -106,7 +106,7 @@ public:
|
|||
nsMsgCompFields *mCompFields; // Message composition fields for the sender
|
||||
PRBool m_bogus_attachment; // This is to catch problem children...
|
||||
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
nsFileSpec *mAppleFileSpec; // The temp file holds the appledouble
|
||||
// encoding of the file we want to send.
|
||||
#endif
|
||||
|
|
|
@ -1195,7 +1195,6 @@ NS_IMETHODIMP nsMsgCompose::SetDeleteDraft(PRBool aDeleteDraft)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
#if !defined(XP_MAC)
|
||||
PRBool nsMsgCompose::IsLastWindow()
|
||||
{
|
||||
nsresult rv;
|
||||
|
@ -1218,7 +1217,6 @@ PRBool nsMsgCompose::IsLastWindow()
|
|||
}
|
||||
return PR_TRUE;
|
||||
}
|
||||
#endif /* XP_MAC */
|
||||
|
||||
NS_IMETHODIMP nsMsgCompose::CloseWindow(PRBool recycleIt)
|
||||
{
|
||||
|
@ -1231,9 +1229,7 @@ NS_IMETHODIMP nsMsgCompose::CloseWindow(PRBool recycleIt)
|
|||
rv = composeService->UnregisterComposeWindow(m_window);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
#if !defined(XP_MAC)
|
||||
recycleIt = recycleIt && !IsLastWindow();
|
||||
#endif /* XP_MAC */
|
||||
if (recycleIt)
|
||||
{
|
||||
rv = composeService->CacheWindow(m_window, m_composeHTML, mRecyclingListener);
|
||||
|
|
|
@ -128,10 +128,7 @@ private:
|
|||
nsresult TagConvertible(nsIDOMNode *node, PRInt32 *_retval);
|
||||
nsresult _BodyConvertible(nsIDOMNode *node, PRInt32 *_retval);
|
||||
|
||||
|
||||
#if !defined(XP_MAC)
|
||||
PRBool IsLastWindow();
|
||||
#endif /* XP_MAC */
|
||||
|
||||
// Helper function. Parameters are not checked.
|
||||
PRBool mConvertStructs; // for TagConvertible
|
||||
|
|
|
@ -124,33 +124,6 @@ static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
|
|||
|
||||
enum { kDefaultMode = (PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE) };
|
||||
|
||||
#ifdef XP_MAC
|
||||
|
||||
static char* NET_GetLocalFileFromURL(char *url)
|
||||
{
|
||||
char * finalPath;
|
||||
NS_ASSERTION(PL_strncasecmp(url, "file://", 7) == 0, "invalid url");
|
||||
finalPath = (char*)PR_Malloc(strlen(url));
|
||||
if (finalPath == nsnull)
|
||||
return nsnull;
|
||||
strcpy(finalPath, url+6+1);
|
||||
return finalPath;
|
||||
}
|
||||
|
||||
static char* NET_GetURLFromLocalFile(char *filename)
|
||||
{
|
||||
/* file:///<path>0 */
|
||||
char * finalPath = (char*)PR_Malloc(strlen(filename) + 8 + 1);
|
||||
if (finalPath == nsnull)
|
||||
return nsnull;
|
||||
finalPath[0] = 0;
|
||||
strcat(finalPath, "file://");
|
||||
strcat(finalPath, filename);
|
||||
return finalPath;
|
||||
}
|
||||
|
||||
#endif /* XP_MAC */
|
||||
|
||||
static PRBool mime_use_quoted_printable_p = PR_FALSE;
|
||||
|
||||
//
|
||||
|
@ -490,7 +463,7 @@ nsMsgComposeAndSend::Clear()
|
|||
m_attachments[i].mFileSpec = nsnull;
|
||||
}
|
||||
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
//
|
||||
// remove the appledoubled intermediate file after we done all.
|
||||
//
|
||||
|
@ -500,7 +473,7 @@ nsMsgComposeAndSend::Clear()
|
|||
delete m_attachments[i].mAppleFileSpec;
|
||||
m_attachments[i].mAppleFileSpec = nsnull;
|
||||
}
|
||||
#endif /* XP_MAC */
|
||||
#endif /* XP_MACOSX */
|
||||
}
|
||||
|
||||
delete[] m_attachments;
|
||||
|
@ -1330,13 +1303,6 @@ nsMsgComposeAndSend::PreProcessPart(nsMsgAttachmentHandler *ma,
|
|||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#if defined(XP_MAC) && defined(DEBUG)
|
||||
// Compiler runs out of registers for the debug build.
|
||||
#pragma global_optimizer on
|
||||
#pragma optimization_level 4
|
||||
#endif // XP_MAC && DEBUG
|
||||
|
||||
# define FROB(X) \
|
||||
if (X && *X) \
|
||||
{ \
|
||||
|
@ -1396,10 +1362,6 @@ nsresult nsMsgComposeAndSend::BeginCryptoEncapsulation ()
|
|||
return rv;
|
||||
}
|
||||
|
||||
#if defined(XP_MAC) && defined(DEBUG)
|
||||
#pragma global_optimizer reset
|
||||
#endif // XP_MAC && DEBUG
|
||||
|
||||
nsresult
|
||||
mime_write_message_body(nsIMsgSend *state, const char *buf, PRInt32 size)
|
||||
{
|
||||
|
@ -2364,7 +2326,7 @@ nsMsgComposeAndSend::AddCompFieldLocalAttachments()
|
|||
if (NS_SUCCEEDED(rv) && !fileExt.IsEmpty()) {
|
||||
nsCAutoString type;
|
||||
mimeFinder->GetTypeFromExtension(fileExt, type);
|
||||
#if !defined(XP_MAC) && !defined(XP_MACOSX)
|
||||
#ifndef XP_MACOSX
|
||||
if (!type.Equals("multipart/appledouble")) // can't do apple double on non-macs
|
||||
#endif
|
||||
m_attachments[newLoc].m_type = ToNewCString(type);
|
||||
|
@ -2381,7 +2343,7 @@ nsMsgComposeAndSend::AddCompFieldLocalAttachments()
|
|||
if (NS_SUCCEEDED(rv) && !fileExt.IsEmpty()) {
|
||||
nsCAutoString type;
|
||||
mimeFinder->GetTypeFromExtension(fileExt, type);
|
||||
#if !defined(XP_MAC) && !defined(XP_MACOSX)
|
||||
#ifndef XP_MACOSX
|
||||
if (!type.Equals("multipart/appledouble")) // can't do apple double on non-macs
|
||||
#endif
|
||||
m_attachments[newLoc].m_type = ToNewCString(type);
|
||||
|
@ -2394,7 +2356,7 @@ nsMsgComposeAndSend::AddCompFieldLocalAttachments()
|
|||
else
|
||||
element->GetContentTypeParam(&m_attachments[newLoc].m_type_param);
|
||||
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
//We always need to snarf the file to figure out how to send it, maybe we need to use apple double...
|
||||
m_attachments[newLoc].m_done = PR_FALSE;
|
||||
m_attachments[newLoc].SetMimeDeliveryState(this);
|
||||
|
|
|
@ -196,7 +196,7 @@ protected:
|
|||
static int FindInCache(nsMsgDatabase* pMessageDB);
|
||||
PRBool MatchDbName(nsFileSpec &dbName); // returns TRUE if they match
|
||||
|
||||
#if defined(XP_WIN) || defined(XP_OS2) || defined(XP_MAC) // this should go away when we can provide our own file stream to MDB/Mork
|
||||
#if defined(XP_WIN) || defined(XP_OS2) // this should go away when we can provide our own file stream to MDB/Mork
|
||||
static void UnixToNative(char*& ioPath);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -39,11 +39,7 @@
|
|||
|
||||
// this file implements the nsMsgDatabase interface using the MDB Interface.
|
||||
|
||||
#ifdef XP_MAC
|
||||
#include <stat.h>
|
||||
#else
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#include "nscore.h"
|
||||
#include "msgCore.h"
|
||||
|
@ -76,9 +72,6 @@
|
|||
#include "MailNewsTypes2.h"
|
||||
#include "nsMsgUtils.h"
|
||||
|
||||
#if defined(XP_MAC) && defined(CompareString)
|
||||
#undef CompareString
|
||||
#endif
|
||||
#include "nsICollation.h"
|
||||
|
||||
#include "nsCollationCID.h"
|
||||
|
@ -1040,42 +1033,6 @@ void nsMsgDatabase::UnixToNative(char*& ioPath)
|
|||
}
|
||||
#endif /* XP_WIN || XP_OS2 */
|
||||
|
||||
#ifdef XP_MAC
|
||||
// this code is stolen from nsFileSpecMac. Since MDB requires a native path, for
|
||||
// the time being, we'll just take the Unix/Canonical form and munge it
|
||||
void nsMsgDatabase::UnixToNative(char*& ioPath)
|
||||
// This just does string manipulation. It doesn't check reality, or canonify, or
|
||||
// anything
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
// Relying on the fact that the unix path is always longer than the mac path:
|
||||
size_t len = strlen(ioPath);
|
||||
char* result = new char[len + 2]; // ... but allow for the initial colon in a partial name
|
||||
if (result)
|
||||
{
|
||||
char* dst = result;
|
||||
const char* src = ioPath;
|
||||
if (*src == '/') // * full path
|
||||
src++;
|
||||
else if (strchr(src, '/')) // * partial path, and not just a leaf name
|
||||
*dst++ = ':';
|
||||
strcpy(dst, src);
|
||||
|
||||
while ( *dst != 0)
|
||||
{
|
||||
if (*dst == '/')
|
||||
*dst++ = ':';
|
||||
else
|
||||
*dst++;
|
||||
}
|
||||
nsCRT::free(ioPath);
|
||||
ioPath = result;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* XP_MAC */
|
||||
|
||||
|
||||
// caller passes in leaveInvalidDB==PR_TRUE if they want back a db even if the db is out of date.
|
||||
// If so, they'll extract out the interesting info from the db, close it, delete it, and
|
||||
// then try to open the db again, prior to reparsing.
|
||||
|
@ -1199,7 +1156,7 @@ nsresult nsMsgDatabase::OpenMDB(const char *dbName, PRBool create)
|
|||
if (m_mdbEnv)
|
||||
m_mdbEnv->SetAutoClear(PR_TRUE);
|
||||
m_dbName = dbName;
|
||||
#if defined(XP_WIN) || defined(XP_OS2) || defined(XP_MAC)
|
||||
#if defined(XP_WIN) || defined(XP_OS2)
|
||||
UnixToNative(nativeFileName);
|
||||
#endif
|
||||
if (stat(nativeFileName, &st))
|
||||
|
|
|
@ -754,7 +754,7 @@ PRBool nsIMAPBodypartLeaf::ShouldFetchInline(nsIMAPBodyShell *aShell)
|
|||
return PR_FALSE; // we can leave it on the server
|
||||
}
|
||||
}
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
// If it is either applesingle, or a resource fork for appledouble
|
||||
if (!PL_strcasecmp(m_contentType, "application/applefile"))
|
||||
{
|
||||
|
@ -772,7 +772,7 @@ PRBool nsIMAPBodypartLeaf::ShouldFetchInline(nsIMAPBodyShell *aShell)
|
|||
return PR_FALSE; // we can leave it on the server
|
||||
}
|
||||
}
|
||||
#endif // XP_MAC
|
||||
#endif // XP_MACOSX
|
||||
|
||||
// Leave out parts with type application/*
|
||||
if (!PL_strcasecmp(m_bodyType, "APPLICATION") && // If it is of type "application"
|
||||
|
|
|
@ -198,7 +198,7 @@ nsComm4xProfile::GetMailDir(const PRUnichar *aProfile, PRUnichar **_retval)
|
|||
rv = GetPrefValue(profileLocation, PREF_NAME, PREF_END, getter_Copies(prefValue));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (prefValue) {
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
rv = profileLocation->SetPersistentDescriptor(NS_ConvertUTF16toUTF8(prefValue));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsAutoString path;
|
||||
|
@ -209,7 +209,7 @@ nsComm4xProfile::GetMailDir(const PRUnichar *aProfile, PRUnichar **_retval)
|
|||
*_retval = ToNewUnicode(prefValue);
|
||||
#endif
|
||||
}
|
||||
#if defined(XP_WIN) || defined(XP_OS2) || defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#if defined(XP_WIN) || defined(XP_OS2) || defined(XP_MACOSX)
|
||||
else {
|
||||
nsCOMPtr <nsIFile> mailLocation;
|
||||
rv = resolvedLocation->Clone(getter_AddRefs(mailLocation));
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
#if defined(XP_WIN) || defined(XP_OS2)
|
||||
#include "nsEudoraWin32.h"
|
||||
#endif
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
#include "nsEudoraMac.h"
|
||||
#endif
|
||||
|
||||
|
@ -128,7 +128,7 @@ private:
|
|||
#if defined(XP_WIN) || defined(XP_OS2)
|
||||
nsEudoraWin32 m_eudora;
|
||||
#endif
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
nsEudoraMac m_eudora;
|
||||
#endif
|
||||
PRUint32 m_bytes;
|
||||
|
@ -191,7 +191,7 @@ private:
|
|||
#if defined(XP_WIN) || defined(XP_OS2)
|
||||
nsEudoraWin32 m_eudora;
|
||||
#endif
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
nsEudoraMac m_eudora;
|
||||
#endif
|
||||
PRUint32 m_bytes;
|
||||
|
|
|
@ -361,7 +361,7 @@ nsresult nsEudoraMailbox::ImportMailbox( PRUint32 *pBytes, PRBool *pAbort, const
|
|||
return( rv);
|
||||
}
|
||||
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
#define kMsgHeaderSize 220
|
||||
#define kMsgFirstOffset 278
|
||||
#else
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
#if defined(XP_WIN) || defined(XP_OS2)
|
||||
#include "nsEudoraWin32.h"
|
||||
#endif
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
#include "nsEudoraMac.h"
|
||||
#endif
|
||||
|
||||
|
@ -128,7 +128,7 @@ NS_IMETHODIMP nsEudoraSettings::Import(nsIMsgAccount **localMailAccount, PRBool
|
|||
}
|
||||
}
|
||||
#endif
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
if (NS_SUCCEEDED( rv = NS_NewFileSpec( getter_AddRefs(m_pLocation)))) {
|
||||
if (!nsEudoraMac::FindSettingsFile( m_pLocation)) {
|
||||
m_pLocation = nsnull;
|
||||
|
@ -146,7 +146,7 @@ NS_IMETHODIMP nsEudoraSettings::Import(nsIMsgAccount **localMailAccount, PRBool
|
|||
#if defined(XP_WIN) || defined(XP_OS2)
|
||||
*_retval = nsEudoraWin32::ImportSettings( m_pLocation, localMailAccount);
|
||||
#endif
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
*_retval = nsEudoraMac::ImportSettings( m_pLocation, localMailAccount);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -212,11 +212,7 @@ nsresult nsMailboxProtocol::Initialize(nsIURI * aURL)
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(XP_MAC)
|
||||
m_lineStreamBuffer = new nsMsgLineStreamBuffer(OUTPUT_BUFFER_SIZE, PR_TRUE, PR_TRUE, '\r');
|
||||
#else
|
||||
m_lineStreamBuffer = new nsMsgLineStreamBuffer(OUTPUT_BUFFER_SIZE, PR_TRUE);
|
||||
#endif
|
||||
|
||||
m_nextState = MAILBOX_READ_FOLDER;
|
||||
m_initialState = MAILBOX_READ_FOLDER;
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
MimeDefClass(MimeExternalBody, MimeExternalBodyClass,
|
||||
mimeExternalBodyClass, &MIME_SUPERCLASS);
|
||||
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
extern MimeObjectClass mimeMultipartAppleDoubleClass;
|
||||
#endif
|
||||
|
||||
|
@ -278,13 +278,6 @@ MimeExternalBody_make_url(const char *ct,
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef XP_MAC
|
||||
#ifdef DEBUG
|
||||
#pragma global_optimizer on
|
||||
#pragma optimization_level 1
|
||||
#endif /* DEBUG */
|
||||
#endif /* XP_MAC */
|
||||
|
||||
static int
|
||||
MimeExternalBody_parse_eof (MimeObject *obj, PRBool abort_p)
|
||||
{
|
||||
|
@ -297,11 +290,11 @@ MimeExternalBody_parse_eof (MimeObject *obj, PRBool abort_p)
|
|||
status = ((MimeObjectClass*)&MIME_SUPERCLASS)->parse_eof(obj, abort_p);
|
||||
if (status < 0) return status;
|
||||
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
if (obj->parent && mime_typep(obj->parent,
|
||||
(MimeObjectClass*) &mimeMultipartAppleDoubleClass))
|
||||
goto done;
|
||||
#endif /* XP_MAC */
|
||||
#endif /* XP_MACOSX */
|
||||
|
||||
if (!abort_p &&
|
||||
obj->output_p &&
|
||||
|
@ -467,19 +460,13 @@ MimeExternalBody_parse_eof (MimeObject *obj, PRBool abort_p)
|
|||
PR_FREEIF(subj);
|
||||
}
|
||||
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
done:
|
||||
#endif /* XP_MAC */
|
||||
#endif
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifdef XP_MAC
|
||||
#ifdef DEBUG
|
||||
#pragma global_optimizer reset
|
||||
#endif /* DEBUG */
|
||||
#endif /* XP_MAC */
|
||||
|
||||
#if 0
|
||||
#if defined(DEBUG) && defined(XP_UNIX)
|
||||
static int
|
||||
|
|
|
@ -88,7 +88,7 @@ MimeMultipartAppleDouble_parse_begin (MimeObject *obj)
|
|||
NS_ASSERTION(obj->options->state->first_data_written_p, "first data not written");
|
||||
}
|
||||
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
if (obj->options && obj->options->state)
|
||||
{
|
||||
// obj->options->state->separator_suppressed_p = PR_TRUE;
|
||||
|
@ -190,7 +190,7 @@ GOTTA STILL DO THIS FOR QUOTING!
|
|||
if (status < 0) return status;
|
||||
}
|
||||
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
done:
|
||||
#endif
|
||||
|
||||
|
@ -210,7 +210,7 @@ MimeMultipartAppleDouble_output_child_p(MimeObject *obj, MimeObject *child)
|
|||
if (cont->nchildren >= 1 && cont->children[0] == child && child->content_type &&
|
||||
!nsCRT::strcasecmp(child->content_type, APPLICATION_APPLEFILE))
|
||||
{
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
if (obj->output_p && obj->options && obj->options->write_html_p) //output HTML
|
||||
return PR_FALSE;
|
||||
#else
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include "nsMimeStringResources.h"
|
||||
#include "nsMimeTypes.h"
|
||||
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
extern MimeObjectClass mimeMultipartAppleDoubleClass;
|
||||
#endif
|
||||
|
||||
|
@ -541,7 +541,7 @@ MimeMultipart_create_child(MimeObject *obj)
|
|||
{
|
||||
status = body->clazz->parse_begin(body);
|
||||
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#ifdef XP_MACOSX
|
||||
/* if we are saving an apple double attachment, we need to set correctly the conten type of the channel */
|
||||
if (mime_typep(obj, (MimeObjectClass *) &mimeMultipartAppleDoubleClass))
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче