зеркало из https://github.com/mozilla/pjs.git
Bug 352647 String literal converted to char* in formal argument name, in assignment, and in call
r=bienvenu sr=bienvenu
This commit is contained in:
Родитель
d3f155e683
Коммит
45d6acccd5
|
@ -549,7 +549,7 @@ nsresult nsMsgSearchAdapter::EncodeImapTerm (nsIMsgSearchTerm *term, PRBool real
|
|||
}
|
||||
}
|
||||
|
||||
char *value = "";
|
||||
char *value = nsnull;
|
||||
char dateBuf[100];
|
||||
dateBuf[0] = '\0';
|
||||
|
||||
|
@ -686,10 +686,15 @@ nsresult nsMsgSearchAdapter::EncodeImapTerm (nsIMsgSearchTerm *term, PRBool real
|
|||
}
|
||||
|
||||
// this should be rewritten to use nsCString
|
||||
int len = strlen(whichMnemonic) + strlen(value) + (useNot ? strlen(m_kImapNot) : 0) +
|
||||
(useQuotes ? 2 : 0) + strlen(m_kImapHeader) +
|
||||
(orHeaderMnemonic ? (strlen(m_kImapHeader) + strlen(m_kImapOr) + (useNot ? strlen(m_kImapNot) : 0) +
|
||||
strlen(orHeaderMnemonic) + strlen(value) + 2 /*""*/) : 0) + 10; // add slough for imap string literals
|
||||
int subLen =
|
||||
(value ? strlen(value) : 0) +
|
||||
(useNot ? strlen(m_kImapNot) : 0) +
|
||||
strlen(m_kImapHeader);
|
||||
int len = strlen(whichMnemonic) + subLen + (useQuotes ? 2 : 0) +
|
||||
(orHeaderMnemonic
|
||||
? (subLen + strlen(m_kImapOr) + strlen(orHeaderMnemonic) + 2 /*""*/)
|
||||
: 0) +
|
||||
10; // add slough for imap string literals
|
||||
char *encoding = new char[len];
|
||||
if (encoding)
|
||||
{
|
||||
|
@ -724,7 +729,7 @@ nsresult nsMsgSearchAdapter::EncodeImapTerm (nsIMsgSearchTerm *term, PRBool real
|
|||
}
|
||||
|
||||
if (value && valueWasAllocated)
|
||||
PR_Free (value);
|
||||
nsCRT::free (value);
|
||||
|
||||
*ppOutTerm = encoding;
|
||||
|
||||
|
|
|
@ -1278,7 +1278,7 @@ nsMsgKeySet::test_decoder (const char *string)
|
|||
void
|
||||
nsMsgKeySet::test_adder (void)
|
||||
{
|
||||
char *string;
|
||||
const char *string;
|
||||
nsMsgKeySet *set;
|
||||
char *s;
|
||||
PRInt32 i;
|
||||
|
|
|
@ -1401,7 +1401,7 @@ nsresult nsMsgComposeAndSend::BeginCryptoEncapsulation ()
|
|||
#endif // XP_MAC && DEBUG
|
||||
|
||||
nsresult
|
||||
mime_write_message_body(nsIMsgSend *state, char *buf, PRInt32 size)
|
||||
mime_write_message_body(nsIMsgSend *state, const char *buf, PRInt32 size)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(state);
|
||||
|
||||
|
@ -1780,7 +1780,7 @@ nsMsgComposeAndSend::GetBodyFromEditor()
|
|||
|
||||
nsCString attachment1_body;
|
||||
// we'd better be "text/html" at this point
|
||||
char *attachment1_type = TEXT_HTML;
|
||||
const char *attachment1_type = TEXT_HTML;
|
||||
|
||||
// Convert body to mail charset
|
||||
nsXPIDLCString outCString;
|
||||
|
|
|
@ -427,7 +427,7 @@ private:
|
|||
//
|
||||
// These C routines should only be used by the nsMsgSendPart class.
|
||||
//
|
||||
extern nsresult mime_write_message_body(nsIMsgSend *state, char *buf, PRInt32 size);
|
||||
extern nsresult mime_write_message_body(nsIMsgSend *state, const char *buf, PRInt32 size);
|
||||
extern char *mime_get_stream_write_buffer(void);
|
||||
extern nsresult PR_CALLBACK mime_encoder_output_fn (const char *buf, PRInt32 size, void *closure);
|
||||
extern PRBool UseQuotedPrintable(void);
|
||||
|
|
|
@ -74,7 +74,7 @@ void nsIMAPGenericParser::ResetLexAnalyzer()
|
|||
PR_FREEIF( fCurrentLine );
|
||||
PR_FREEIF( fStartOfLineOfTokens );
|
||||
|
||||
fCurrentLine = fNextToken = fLineOfTokens = fStartOfLineOfTokens = fCurrentTokenPlaceHolder = nsnull;
|
||||
fNextToken = fCurrentLine = fLineOfTokens = fStartOfLineOfTokens = fCurrentTokenPlaceHolder = nsnull;
|
||||
fAtEndOfLine = PR_FALSE;
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@ void nsIMAPGenericParser::skip_to_close_paren()
|
|||
while (ContinueParse())
|
||||
{
|
||||
// go through fNextToken, account for nested parens
|
||||
char *loc;
|
||||
const char *loc;
|
||||
for (loc = fNextToken; loc && *loc; loc++)
|
||||
{
|
||||
if (*loc == '(')
|
||||
|
|
|
@ -91,7 +91,7 @@ protected:
|
|||
|
||||
protected:
|
||||
// use with care
|
||||
char *fNextToken;
|
||||
const char *fNextToken;
|
||||
char *fCurrentLine;
|
||||
char *fLineOfTokens;
|
||||
char *fStartOfLineOfTokens;
|
||||
|
|
|
@ -204,7 +204,7 @@ void nsImapServerResponseParser::ParseIMAPServerResponse(const char *currentComm
|
|||
{
|
||||
char *placeInTokenString = nsnull;
|
||||
char *tagToken = nsnull;
|
||||
char *commandToken = nsnull;
|
||||
const char *commandToken = nsnull;
|
||||
PRBool inIdle = PR_FALSE;
|
||||
if (!sendingIdleDone)
|
||||
{
|
||||
|
@ -1136,7 +1136,7 @@ void nsImapServerResponseParser::msg_fetch()
|
|||
char *whereHeader = PL_strstr(fNextToken, "HEADER");
|
||||
if (whereHeader)
|
||||
{
|
||||
char *startPartNum = fNextToken + 5;
|
||||
const char *startPartNum = fNextToken + 5;
|
||||
if (whereHeader > startPartNum)
|
||||
{
|
||||
PRInt32 partLength = whereHeader - startPartNum - 1; //-1 for the dot!
|
||||
|
@ -2313,7 +2313,7 @@ void nsImapServerResponseParser::namespace_data()
|
|||
char *namespacePrefix = CreateQuoted(PR_FALSE);
|
||||
|
||||
AdvanceToNextToken();
|
||||
char *quotedDelimiter = fNextToken;
|
||||
const char *quotedDelimiter = fNextToken;
|
||||
char namespaceDelimiter = '\0';
|
||||
|
||||
if (quotedDelimiter[0] == '"')
|
||||
|
|
|
@ -465,11 +465,11 @@ NS_IMETHODIMP nsLocalUndoFolderListener::OnItemPropertyFlagChanged(nsIMsgDBHdr *
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsLocalUndoFolderListener::OnItemEvent(nsIMsgFolder *item, nsIAtom *event)
|
||||
NS_IMETHODIMP nsLocalUndoFolderListener::OnItemEvent(nsIMsgFolder *item, nsIAtom *aEvent)
|
||||
{
|
||||
nsCOMPtr <nsIAtom> folderLoadedAtom = do_GetAtom("FolderLoaded");
|
||||
nsCOMPtr <nsIMsgFolder> itemFolder = do_QueryInterface(item);
|
||||
if (mTxn && mFolder && folderLoadedAtom == event && item == mFolder)
|
||||
if (mTxn && mFolder && folderLoadedAtom == aEvent && item == mFolder)
|
||||
return mTxn->UndoTransactionInternal();
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
/*
|
||||
* This is the write call for outputting processed stream data.
|
||||
*/
|
||||
extern "C" int COM_MimeObject_write(void *mimeObject, char *data,
|
||||
extern "C" int COM_MimeObject_write(void *mimeObject, const char *data,
|
||||
PRInt32 length,
|
||||
PRBool user_visible_p);
|
||||
/*
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
static nsCOMPtr<nsIStringBundle> stringBundle = nsnull;
|
||||
#endif
|
||||
|
||||
static int MimeInlineTextVCard_parse_line (char *, PRInt32, MimeObject *);
|
||||
static int MimeInlineTextVCard_parse_line (const char *, PRInt32, MimeObject *);
|
||||
static int MimeInlineTextVCard_parse_eof (MimeObject *, PRBool);
|
||||
static int MimeInlineTextVCard_parse_begin (MimeObject *obj);
|
||||
|
||||
|
@ -170,7 +170,7 @@ char *strcpySafe (char *dest, const char *src, size_t destLength)
|
|||
}
|
||||
|
||||
static int
|
||||
MimeInlineTextVCard_parse_line (char *line, PRInt32 length, MimeObject *obj)
|
||||
MimeInlineTextVCard_parse_line (const char *line, PRInt32 length, MimeObject *obj)
|
||||
{
|
||||
// This routine gets fed each line of data, one at a time.
|
||||
char* linestring;
|
||||
|
@ -357,7 +357,7 @@ static int WriteEachLineToStream (MimeObject *obj, const char *line)
|
|||
return status;
|
||||
}
|
||||
|
||||
static int OutputTable (MimeObject *obj, PRBool endTable, PRBool border, char *cellspacing, char *cellpadding, char *bgcolor)
|
||||
static int OutputTable (MimeObject *obj, PRBool endTable, PRBool border, const char *cellspacing, const char *cellpadding, const char *bgcolor)
|
||||
{
|
||||
int status = 0;
|
||||
char * htmlLine = NULL;
|
||||
|
@ -418,9 +418,9 @@ static int OutputTable (MimeObject *obj, PRBool endTable, PRBool border, char *c
|
|||
}
|
||||
|
||||
static int OutputTableRowOrData(MimeObject *obj, PRBool outputRow,
|
||||
PRBool end, char * align,
|
||||
char* valign, char* colspan,
|
||||
char* width)
|
||||
PRBool end, const char * align,
|
||||
const char* valign, const char* colspan,
|
||||
const char* width)
|
||||
{
|
||||
int status = 0;
|
||||
char * htmlLine = NULL;
|
||||
|
@ -488,7 +488,7 @@ static int OutputTableRowOrData(MimeObject *obj, PRBool outputRow,
|
|||
}
|
||||
|
||||
|
||||
static int OutputFont(MimeObject *obj, PRBool endFont, char * size, char* color)
|
||||
static int OutputFont(MimeObject *obj, PRBool endFont, const char * size, const char* color)
|
||||
{
|
||||
int status = 0;
|
||||
char * htmlLine = NULL;
|
||||
|
@ -1910,9 +1910,7 @@ nsCOMPtr<nsIStringBundle> stringBundle = nsnull;
|
|||
|
||||
if (!stringBundle)
|
||||
{
|
||||
char* propertyURL = NULL;
|
||||
|
||||
propertyURL = VCARD_URL;
|
||||
const char* propertyURL = VCARD_URL;
|
||||
|
||||
nsCOMPtr<nsIStringBundleService> sBundleService =
|
||||
do_GetService(NS_STRINGBUNDLE_CONTRACTID, &res);
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
/*
|
||||
* This is the write call for outputting processed stream data.
|
||||
*/
|
||||
extern "C" int XPCOM_MimeObject_write(void *mimeObject, char *data,
|
||||
extern "C" int XPCOM_MimeObject_write(void *mimeObject, const char *data,
|
||||
PRInt32 length,
|
||||
PRBool user_visible_p);
|
||||
/*
|
||||
|
|
|
@ -55,7 +55,7 @@ static int MimeEncrypted_initialize (MimeObject *);
|
|||
static void MimeEncrypted_finalize (MimeObject *);
|
||||
static int MimeEncrypted_parse_begin (MimeObject *);
|
||||
static int MimeEncrypted_parse_buffer (const char *, PRInt32, MimeObject *);
|
||||
static int MimeEncrypted_parse_line (char *, PRInt32, MimeObject *);
|
||||
static int MimeEncrypted_parse_line (const char *, PRInt32, MimeObject *);
|
||||
static int MimeEncrypted_parse_decoded_buffer (const char *, PRInt32, MimeObject *);
|
||||
static int MimeEncrypted_parse_eof (MimeObject *, PRBool);
|
||||
static int MimeEncrypted_parse_end (MimeObject *, PRBool);
|
||||
|
@ -177,7 +177,7 @@ MimeEncrypted_parse_buffer (const char *buffer, PRInt32 size, MimeObject *obj)
|
|||
|
||||
|
||||
static int
|
||||
MimeEncrypted_parse_line (char *line, PRInt32 length, MimeObject *obj)
|
||||
MimeEncrypted_parse_line (const char *line, PRInt32 length, MimeObject *obj)
|
||||
{
|
||||
NS_ASSERTION(0, "1.2 <mscott@netscape.com> 01 Nov 2001 17:59");
|
||||
/* This method shouldn't ever be called. */
|
||||
|
|
|
@ -692,9 +692,9 @@ mime_fix_up_html_address( char **addr)
|
|||
static void
|
||||
mime_intl_insert_message_header_1(char **body,
|
||||
char **hdr_value,
|
||||
char *hdr_str,
|
||||
const char *hdr_str,
|
||||
const char *html_hdr_str,
|
||||
char *mailcharset,
|
||||
const char *mailcharset,
|
||||
PRBool htmlEdit)
|
||||
{
|
||||
if (!body || !hdr_value || !hdr_str)
|
||||
|
|
|
@ -59,7 +59,7 @@ extern MimeObjectClass mimeMultipartAppleDoubleClass;
|
|||
|
||||
static int MimeExternalBody_initialize (MimeObject *);
|
||||
static void MimeExternalBody_finalize (MimeObject *);
|
||||
static int MimeExternalBody_parse_line (char *, PRInt32, MimeObject *);
|
||||
static int MimeExternalBody_parse_line (const char *, PRInt32, MimeObject *);
|
||||
static int MimeExternalBody_parse_eof (MimeObject *, PRBool);
|
||||
static PRBool MimeExternalBody_displayable_inline_p (MimeObjectClass *clazz,
|
||||
MimeHeaders *hdrs);
|
||||
|
@ -113,7 +113,7 @@ MimeExternalBody_finalize (MimeObject *object)
|
|||
}
|
||||
|
||||
static int
|
||||
MimeExternalBody_parse_line (char *line, PRInt32 length, MimeObject *obj)
|
||||
MimeExternalBody_parse_line (const char *line, PRInt32 length, MimeObject *obj)
|
||||
{
|
||||
MimeExternalBody *bod = (MimeExternalBody *) obj;
|
||||
int status = 0;
|
||||
|
|
|
@ -55,7 +55,7 @@ static int MimeExternalObject_initialize (MimeObject *);
|
|||
static void MimeExternalObject_finalize (MimeObject *);
|
||||
static int MimeExternalObject_parse_begin (MimeObject *);
|
||||
static int MimeExternalObject_parse_buffer (const char *, PRInt32, MimeObject *);
|
||||
static int MimeExternalObject_parse_line (char *, PRInt32, MimeObject *);
|
||||
static int MimeExternalObject_parse_line (const char *, PRInt32, MimeObject *);
|
||||
static int MimeExternalObject_parse_decoded_buffer (const char*, PRInt32, MimeObject*);
|
||||
static PRBool MimeExternalObject_displayable_inline_p (MimeObjectClass *clazz,
|
||||
MimeHeaders *hdrs);
|
||||
|
@ -259,7 +259,7 @@ MimeExternalObject_parse_decoded_buffer (const char *buf, PRInt32 size,
|
|||
|
||||
|
||||
static int
|
||||
MimeExternalObject_parse_line (char *line, PRInt32 length, MimeObject *obj)
|
||||
MimeExternalObject_parse_line (const char *line, PRInt32 length, MimeObject *obj)
|
||||
{
|
||||
/* This method should never be called (externals do no line buffering).
|
||||
*/
|
||||
|
|
|
@ -747,7 +747,7 @@ MimeHeaders_get_name(MimeHeaders *hdrs, MimeDisplayOptions *opt)
|
|||
void
|
||||
MimeHeaders_do_unix_display_hook_hack(MimeHeaders *hdrs)
|
||||
{
|
||||
static char *cmd = 0;
|
||||
static const char *cmd = 0;
|
||||
if (!cmd)
|
||||
{
|
||||
/* The first time we're invoked, look up the command in the
|
||||
|
@ -755,8 +755,6 @@ MimeHeaders_do_unix_display_hook_hack(MimeHeaders *hdrs)
|
|||
cmd = getenv("NS_MSG_DISPLAY_HOOK");
|
||||
if (!cmd)
|
||||
cmd = "";
|
||||
else
|
||||
cmd = nsCRT::strdup(cmd);
|
||||
}
|
||||
|
||||
/* Invoke "cmd" at the end of a pipe, and give it the headers on stdin.
|
||||
|
|
|
@ -52,7 +52,7 @@ MimeDefClass(MimeInlineImage, MimeInlineImageClass,
|
|||
static int MimeInlineImage_initialize (MimeObject *);
|
||||
static void MimeInlineImage_finalize (MimeObject *);
|
||||
static int MimeInlineImage_parse_begin (MimeObject *);
|
||||
static int MimeInlineImage_parse_line (char *, PRInt32, MimeObject *);
|
||||
static int MimeInlineImage_parse_line (const char *, PRInt32, MimeObject *);
|
||||
static int MimeInlineImage_parse_eof (MimeObject *, PRBool);
|
||||
static int MimeInlineImage_parse_decoded_buffer (const char *, PRInt32, MimeObject *);
|
||||
|
||||
|
@ -267,7 +267,7 @@ MimeInlineImage_parse_decoded_buffer (const char *buf, PRInt32 size, MimeObject
|
|||
|
||||
|
||||
static int
|
||||
MimeInlineImage_parse_line (char *line, PRInt32 length, MimeObject *obj)
|
||||
MimeInlineImage_parse_line (const char *line, PRInt32 length, MimeObject *obj)
|
||||
{
|
||||
/* This method should never be called (inline images do no line buffering).
|
||||
*/
|
||||
|
|
|
@ -51,7 +51,7 @@ static int MimeLeaf_initialize (MimeObject *);
|
|||
static void MimeLeaf_finalize (MimeObject *);
|
||||
static int MimeLeaf_parse_begin (MimeObject *);
|
||||
static int MimeLeaf_parse_buffer (const char *, PRInt32, MimeObject *);
|
||||
static int MimeLeaf_parse_line (char *, PRInt32, MimeObject *);
|
||||
static int MimeLeaf_parse_line (const char *, PRInt32, MimeObject *);
|
||||
static int MimeLeaf_close_decoder (MimeObject *);
|
||||
static int MimeLeaf_parse_eof (MimeObject *, PRBool);
|
||||
static PRBool MimeLeaf_displayable_inline_p (MimeObjectClass *clazz,
|
||||
|
@ -179,7 +179,7 @@ MimeLeaf_parse_buffer (const char *buffer, PRInt32 size, MimeObject *obj)
|
|||
}
|
||||
|
||||
static int
|
||||
MimeLeaf_parse_line (char *line, PRInt32 length, MimeObject *obj)
|
||||
MimeLeaf_parse_line (const char *line, PRInt32 length, MimeObject *obj)
|
||||
{
|
||||
NS_ASSERTION(0, "1.1 <rhp@netscape.com> 19 Mar 1999 12:00");
|
||||
/* This method shouldn't ever be called. */
|
||||
|
|
|
@ -56,7 +56,7 @@ static int MimeMultipartAlternative_initialize (MimeObject *);
|
|||
static void MimeMultipartAlternative_finalize (MimeObject *);
|
||||
static int MimeMultipartAlternative_parse_eof (MimeObject *, PRBool);
|
||||
static int MimeMultipartAlternative_create_child(MimeObject *);
|
||||
static int MimeMultipartAlternative_parse_child_line (MimeObject *, char *,
|
||||
static int MimeMultipartAlternative_parse_child_line (MimeObject *, const char *,
|
||||
PRInt32, PRBool);
|
||||
static int MimeMultipartAlternative_close_child(MimeObject *);
|
||||
|
||||
|
@ -182,7 +182,7 @@ MimeMultipartAlternative_create_child(MimeObject *obj)
|
|||
|
||||
static int
|
||||
MimeMultipartAlternative_parse_child_line (MimeObject *obj,
|
||||
char *line, PRInt32 length,
|
||||
const char *line, PRInt32 length,
|
||||
PRBool first_line_p)
|
||||
{
|
||||
MimeMultipartAlternative *malt = (MimeMultipartAlternative *) obj;
|
||||
|
|
|
@ -62,8 +62,8 @@ MimeDefClass(MimeMultipartSignedCMS, MimeMultipartSignedCMSClass,
|
|||
static int MimeMultipartSignedCMS_initialize (MimeObject *);
|
||||
|
||||
static void *MimeMultCMS_init (MimeObject *);
|
||||
static int MimeMultCMS_data_hash (char *, PRInt32, void *);
|
||||
static int MimeMultCMS_sig_hash (char *, PRInt32, void *);
|
||||
static int MimeMultCMS_data_hash (const char *, PRInt32, void *);
|
||||
static int MimeMultCMS_sig_hash (const char *, PRInt32, void *);
|
||||
static int MimeMultCMS_data_eof (void *, PRBool);
|
||||
static int MimeMultCMS_sig_eof (void *, PRBool);
|
||||
static int MimeMultCMS_sig_init (void *, MimeObject *, MimeHeaders *);
|
||||
|
@ -279,7 +279,7 @@ MimeMultCMS_init (MimeObject *obj)
|
|||
}
|
||||
|
||||
static int
|
||||
MimeMultCMS_data_hash (char *buf, PRInt32 size, void *crypto_closure)
|
||||
MimeMultCMS_data_hash (const char *buf, PRInt32 size, void *crypto_closure)
|
||||
{
|
||||
MimeMultCMSdata *data = (MimeMultCMSdata *) crypto_closure;
|
||||
if (!data || !data->data_hash_context) {
|
||||
|
@ -360,7 +360,7 @@ MimeMultCMS_sig_init (void *crypto_closure,
|
|||
|
||||
|
||||
static int
|
||||
MimeMultCMS_sig_hash (char *buf, PRInt32 size, void *crypto_closure)
|
||||
MimeMultCMS_sig_hash (const char *buf, PRInt32 size, void *crypto_closure)
|
||||
{
|
||||
MimeMultCMSdata *data = (MimeMultCMSdata *) crypto_closure;
|
||||
nsresult rv;
|
||||
|
|
|
@ -1995,9 +1995,7 @@ MimeGetStringByID(PRInt32 stringID)
|
|||
|
||||
if (!stringBundle)
|
||||
{
|
||||
char* propertyURL = NULL;
|
||||
|
||||
propertyURL = MIME_URL;
|
||||
const char* propertyURL = MIME_URL;
|
||||
|
||||
nsCOMPtr<nsIStringBundleService> sBundleService =
|
||||
do_GetService(NS_STRINGBUNDLE_CONTRACTID, &res);
|
||||
|
|
|
@ -84,7 +84,7 @@ typedef void
|
|||
/* streamclass function */
|
||||
struct _nsMIMESession {
|
||||
|
||||
char * name; /* Just for diagnostics */
|
||||
const char * name; /* Just for diagnostics */
|
||||
|
||||
void * window_id; /* used for progress messages, etc. */
|
||||
|
||||
|
|
|
@ -617,7 +617,7 @@ MimeMultipartRelated_output_child_p(MimeObject *obj, MimeObject* child)
|
|||
|
||||
static int
|
||||
MimeMultipartRelated_parse_child_line (MimeObject *obj,
|
||||
char *line, PRInt32 length,
|
||||
const char *line, PRInt32 length,
|
||||
PRBool first_line_p)
|
||||
{
|
||||
MimeContainer *cont = (MimeContainer *) obj;
|
||||
|
|
|
@ -63,7 +63,7 @@ static int MimeMessage_initialize (MimeObject *);
|
|||
static void MimeMessage_finalize (MimeObject *);
|
||||
static int MimeMessage_add_child (MimeObject *, MimeObject *);
|
||||
static int MimeMessage_parse_begin (MimeObject *);
|
||||
static int MimeMessage_parse_line (char *, PRInt32, MimeObject *);
|
||||
static int MimeMessage_parse_line (const char *, PRInt32, MimeObject *);
|
||||
static int MimeMessage_parse_eof (MimeObject *, PRBool);
|
||||
static int MimeMessage_close_headers (MimeObject *obj);
|
||||
static int MimeMessage_write_headers_html (MimeObject *);
|
||||
|
@ -146,9 +146,9 @@ MimeMessage_parse_begin (MimeObject *obj)
|
|||
|
||||
|
||||
static int
|
||||
MimeMessage_parse_line (char *aLine, PRInt32 aLength, MimeObject *obj)
|
||||
MimeMessage_parse_line (const char *aLine, PRInt32 aLength, MimeObject *obj)
|
||||
{
|
||||
char * line = aLine;
|
||||
const char * line = aLine;
|
||||
PRInt32 length = aLength;
|
||||
|
||||
MimeMessage *msg = (MimeMessage *) obj;
|
||||
|
@ -508,7 +508,7 @@ MimeMessage_close_headers (MimeObject *obj)
|
|||
char *msgID = MimeHeaders_get (msg->hdrs, HEADER_MESSAGE_ID,
|
||||
PR_FALSE, PR_FALSE);
|
||||
|
||||
char *outCharset = NULL;
|
||||
const char *outCharset = NULL;
|
||||
if (!obj->options->force_user_charset) /* Only convert if the user prefs is false */
|
||||
outCharset = "UTF-8";
|
||||
|
||||
|
|
|
@ -55,8 +55,8 @@ MimeDefClass(MimeMultipartSigned, MimeMultipartSignedClass,
|
|||
static int MimeMultipartSigned_initialize (MimeObject *);
|
||||
static int MimeMultipartSigned_create_child (MimeObject *);
|
||||
static int MimeMultipartSigned_close_child(MimeObject *);
|
||||
static int MimeMultipartSigned_parse_line (char *, PRInt32, MimeObject *);
|
||||
static int MimeMultipartSigned_parse_child_line (MimeObject *, char *, PRInt32,
|
||||
static int MimeMultipartSigned_parse_line (const char *, PRInt32, MimeObject *);
|
||||
static int MimeMultipartSigned_parse_child_line (MimeObject *, const char *, PRInt32,
|
||||
PRBool);
|
||||
static int MimeMultipartSigned_parse_eof (MimeObject *, PRBool);
|
||||
static void MimeMultipartSigned_finalize (MimeObject *);
|
||||
|
@ -176,7 +176,7 @@ MimeMultipartSigned_finalize (MimeObject *obj)
|
|||
|
||||
|
||||
static int
|
||||
MimeMultipartSigned_parse_line (char *line, PRInt32 length, MimeObject *obj)
|
||||
MimeMultipartSigned_parse_line (const char *line, PRInt32 length, MimeObject *obj)
|
||||
{
|
||||
MimeMultipart *mult = (MimeMultipart *) obj;
|
||||
MimeMultipartSigned *sig = (MimeMultipartSigned *) obj;
|
||||
|
@ -506,7 +506,7 @@ MimeMultipartSigned_close_child (MimeObject *obj)
|
|||
|
||||
static int
|
||||
MimeMultipartSigned_parse_child_line (MimeObject *obj,
|
||||
char *line, PRInt32 length,
|
||||
const char *line, PRInt32 length,
|
||||
PRBool first_line_p)
|
||||
{
|
||||
MimeMultipartSigned *sig = (MimeMultipartSigned *) obj;
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
used to initialize the dexlateion engine. NULL indicates failure;
|
||||
otherwise, an opaque closure object should be returned.
|
||||
|
||||
int crypto_data_hash (char *data, PRInt32 data_size,
|
||||
int crypto_data_hash (const char *data, PRInt32 data_size,
|
||||
void *crypto_closure)
|
||||
|
||||
This is called with the raw data, for which a signature has been computed.
|
||||
|
@ -75,7 +75,7 @@
|
|||
initialization here, or may wish to examine the actual headers of the
|
||||
signature object itself.
|
||||
|
||||
int crypto_signature_hash (char *data, PRInt32 data_size,
|
||||
int crypto_signature_hash (const char *data, PRInt32 data_size,
|
||||
void *crypto_closure)
|
||||
|
||||
This is called with the raw data of the detached signature block. It will
|
||||
|
@ -123,9 +123,9 @@ struct MimeMultipartSignedClass {
|
|||
/* Callbacks used by dexlateion (really, signature verification) module. */
|
||||
void * (*crypto_init) (MimeObject *multipart_object);
|
||||
|
||||
int (*crypto_data_hash) (char *data, PRInt32 data_size,
|
||||
int (*crypto_data_hash) (const char *data, PRInt32 data_size,
|
||||
void *crypto_closure);
|
||||
int (*crypto_signature_hash) (char *data, PRInt32 data_size,
|
||||
int (*crypto_signature_hash) (const char *data, PRInt32 data_size,
|
||||
void *crypto_closure);
|
||||
|
||||
int (*crypto_data_eof) (void *crypto_closure, PRBool abort_p);
|
||||
|
|
|
@ -57,7 +57,7 @@ MimeDefClass(MimeMultipart, MimeMultipartClass,
|
|||
|
||||
static int MimeMultipart_initialize (MimeObject *);
|
||||
static void MimeMultipart_finalize (MimeObject *);
|
||||
static int MimeMultipart_parse_line (char *line, PRInt32 length, MimeObject *);
|
||||
static int MimeMultipart_parse_line (const char *line, PRInt32 length, MimeObject *);
|
||||
static int MimeMultipart_parse_eof (MimeObject *object, PRBool abort_p);
|
||||
|
||||
static MimeMultipartBoundaryType MimeMultipart_check_boundary(MimeObject *,
|
||||
|
@ -65,7 +65,7 @@ static MimeMultipartBoundaryType MimeMultipart_check_boundary(MimeObject *,
|
|||
PRInt32);
|
||||
static int MimeMultipart_create_child(MimeObject *);
|
||||
static PRBool MimeMultipart_output_child_p(MimeObject *, MimeObject *);
|
||||
static int MimeMultipart_parse_child_line (MimeObject *, char *, PRInt32,
|
||||
static int MimeMultipart_parse_child_line (MimeObject *, const char *, PRInt32,
|
||||
PRBool);
|
||||
static int MimeMultipart_close_child(MimeObject *);
|
||||
|
||||
|
@ -145,7 +145,7 @@ int MimeWriteAString(MimeObject *obj, const nsACString &string)
|
|||
}
|
||||
|
||||
static int
|
||||
MimeMultipart_parse_line (char *line, PRInt32 length, MimeObject *obj)
|
||||
MimeMultipart_parse_line (const char *line, PRInt32 length, MimeObject *obj)
|
||||
{
|
||||
MimeMultipart *mult = (MimeMultipart *) obj;
|
||||
int status = 0;
|
||||
|
@ -632,7 +632,7 @@ MimeMultipart_close_child(MimeObject *object)
|
|||
|
||||
|
||||
static int
|
||||
MimeMultipart_parse_child_line (MimeObject *obj, char *line, PRInt32 length,
|
||||
MimeMultipart_parse_child_line (MimeObject *obj, const char *line, PRInt32 length,
|
||||
PRBool first_line_p)
|
||||
{
|
||||
MimeContainer *cont = (MimeContainer *) obj;
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
|
||||
Whether this child should be output. Default method always says `yes'.
|
||||
|
||||
int parse_child_line (MimeObject *obj, char *line, PRInt32 length,
|
||||
int parse_child_line (MimeObject *obj, const char *line, PRInt32 length,
|
||||
PRBool first_line_p)
|
||||
|
||||
When we have a line which should be handed off to the currently-active
|
||||
|
@ -111,7 +111,7 @@ struct MimeMultipartClass {
|
|||
int (*create_child) (MimeObject *);
|
||||
PRBool (*output_child_p) (MimeObject *self, MimeObject *child);
|
||||
int (*close_child) (MimeObject *);
|
||||
int (*parse_child_line) (MimeObject *, char *line, PRInt32 length,
|
||||
int (*parse_child_line) (MimeObject *, const char *line, PRInt32 length,
|
||||
PRBool first_line_p);
|
||||
MimeMultipartBoundaryType (*check_boundary) (MimeObject *, const char *line,
|
||||
PRInt32 length);
|
||||
|
|
|
@ -66,7 +66,7 @@ static int MimeObject_initialize (MimeObject *);
|
|||
static void MimeObject_finalize (MimeObject *);
|
||||
static int MimeObject_parse_begin (MimeObject *);
|
||||
static int MimeObject_parse_buffer (const char *, PRInt32, MimeObject *);
|
||||
static int MimeObject_parse_line (char *, PRInt32, MimeObject *);
|
||||
static int MimeObject_parse_line (const char *, PRInt32, MimeObject *);
|
||||
static int MimeObject_parse_eof (MimeObject *, PRBool);
|
||||
static int MimeObject_parse_end (MimeObject *, PRBool);
|
||||
static PRBool MimeObject_displayable_inline_p (MimeObjectClass *clazz,
|
||||
|
@ -286,7 +286,7 @@ MimeObject_parse_buffer (const char *buffer, PRInt32 size, MimeObject *obj)
|
|||
|
||||
|
||||
static int
|
||||
MimeObject_parse_line (char *line, PRInt32 length, MimeObject *obj)
|
||||
MimeObject_parse_line (const char *line, PRInt32 length, MimeObject *obj)
|
||||
{
|
||||
/* This method should never be called. */
|
||||
NS_ASSERTION(0, "shouldn't call this method");
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
Called after `init' but before `parse_line' or `parse_buffer'.
|
||||
Can be used to initialize various parsing machinery.
|
||||
|
||||
int parse_line (char *line, PRInt32 length, MimeObject *obj)
|
||||
int parse_line (const char *line, PRInt32 length, MimeObject *obj)
|
||||
|
||||
This method is called (by parse_buffer()) for each complete line of
|
||||
data handed to the parser, and is the method which most subclasses
|
||||
|
@ -145,7 +145,7 @@ struct MimeObjectClass {
|
|||
void (*finalize) (MimeObject *obj);
|
||||
int (*parse_begin) (MimeObject *obj);
|
||||
int (*parse_buffer) (const char *buf, PRInt32 size, MimeObject *obj);
|
||||
int (*parse_line) (char *line, PRInt32 length, MimeObject *obj);
|
||||
int (*parse_line) (const char *line, PRInt32 length, MimeObject *obj);
|
||||
int (*parse_eof) (MimeObject *obj, PRBool abort_p);
|
||||
int (*parse_end) (MimeObject *obj, PRBool abort_p);
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ static MimeMultipartBoundaryType MimeSunAttachment_check_boundary(MimeObject *,
|
|||
const char *,
|
||||
PRInt32);
|
||||
static int MimeSunAttachment_create_child(MimeObject *);
|
||||
static int MimeSunAttachment_parse_child_line (MimeObject *, char *, PRInt32,
|
||||
static int MimeSunAttachment_parse_child_line (MimeObject *, const char *, PRInt32,
|
||||
PRBool);
|
||||
static int MimeSunAttachment_parse_begin (MimeObject *);
|
||||
static int MimeSunAttachment_parse_eof (MimeObject *, PRBool);
|
||||
|
@ -351,7 +351,7 @@ MimeSunAttachment_create_child(MimeObject *obj)
|
|||
|
||||
|
||||
static int
|
||||
MimeSunAttachment_parse_child_line (MimeObject *obj, char *line, PRInt32 length,
|
||||
MimeSunAttachment_parse_child_line (MimeObject *obj, const char *line, PRInt32 length,
|
||||
PRBool first_line_p)
|
||||
{
|
||||
MimeContainer *cont = (MimeContainer *) obj;
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
MimeDefClass(MimeInlineTextHTMLAsPlaintext, MimeInlineTextHTMLAsPlaintextClass,
|
||||
mimeInlineTextHTMLAsPlaintextClass, &MIME_SUPERCLASS);
|
||||
|
||||
static int MimeInlineTextHTMLAsPlaintext_parse_line (char *, PRInt32,
|
||||
static int MimeInlineTextHTMLAsPlaintext_parse_line (const char *, PRInt32,
|
||||
MimeObject *);
|
||||
static int MimeInlineTextHTMLAsPlaintext_parse_begin (MimeObject *obj);
|
||||
static int MimeInlineTextHTMLAsPlaintext_parse_eof (MimeObject *, PRBool);
|
||||
|
@ -162,7 +162,7 @@ MimeInlineTextHTMLAsPlaintext_finalize (MimeObject *obj)
|
|||
}
|
||||
|
||||
static int
|
||||
MimeInlineTextHTMLAsPlaintext_parse_line (char *line, PRInt32 length,
|
||||
MimeInlineTextHTMLAsPlaintext_parse_line (const char *line, PRInt32 length,
|
||||
MimeObject *obj)
|
||||
{
|
||||
MimeInlineTextHTMLAsPlaintext *textHTMLPlain =
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
MimeDefClass(MimeInlineTextHTMLSanitized, MimeInlineTextHTMLSanitizedClass,
|
||||
mimeInlineTextHTMLSanitizedClass, &MIME_SUPERCLASS);
|
||||
|
||||
static int MimeInlineTextHTMLSanitized_parse_line (char *, PRInt32,
|
||||
static int MimeInlineTextHTMLSanitized_parse_line (const char *, PRInt32,
|
||||
MimeObject *);
|
||||
static int MimeInlineTextHTMLSanitized_parse_begin (MimeObject *obj);
|
||||
static int MimeInlineTextHTMLSanitized_parse_eof (MimeObject *, PRBool);
|
||||
|
@ -250,7 +250,7 @@ printf("/finalize\n");
|
|||
}
|
||||
|
||||
static int
|
||||
MimeInlineTextHTMLSanitized_parse_line (char *line, PRInt32 length,
|
||||
MimeInlineTextHTMLSanitized_parse_line (const char *line, PRInt32 length,
|
||||
MimeObject *obj)
|
||||
{
|
||||
#ifdef DEBUG_BenB
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
MimeDefClass(MimeInlineTextHTML, MimeInlineTextHTMLClass,
|
||||
mimeInlineTextHTMLClass, &MIME_SUPERCLASS);
|
||||
|
||||
static int MimeInlineTextHTML_parse_line (char *, PRInt32, MimeObject *);
|
||||
static int MimeInlineTextHTML_parse_line (const char *, PRInt32, MimeObject *);
|
||||
static int MimeInlineTextHTML_parse_eof (MimeObject *, PRBool);
|
||||
static int MimeInlineTextHTML_parse_begin (MimeObject *obj);
|
||||
|
||||
|
@ -160,7 +160,7 @@ MimeInlineTextHTML_parse_begin (MimeObject *obj)
|
|||
|
||||
|
||||
static int
|
||||
MimeInlineTextHTML_parse_line (char *line, PRInt32 length, MimeObject *obj)
|
||||
MimeInlineTextHTML_parse_line (const char *line, PRInt32 length, MimeObject *obj)
|
||||
{
|
||||
MimeInlineTextHTML *textHTML = (MimeInlineTextHTML *) obj;
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ MimeDefClass(MimeInlineTextPlainFlowed, MimeInlineTextPlainFlowedClass,
|
|||
mimeInlineTextPlainFlowedClass, &MIME_SUPERCLASS);
|
||||
|
||||
static int MimeInlineTextPlainFlowed_parse_begin (MimeObject *);
|
||||
static int MimeInlineTextPlainFlowed_parse_line (char *, PRInt32, MimeObject *);
|
||||
static int MimeInlineTextPlainFlowed_parse_line (const char *, PRInt32, MimeObject *);
|
||||
static int MimeInlineTextPlainFlowed_parse_eof (MimeObject *, PRBool);
|
||||
|
||||
static MimeInlineTextPlainFlowedExData *MimeInlineTextPlainFlowedExDataList = nsnull;
|
||||
|
@ -286,7 +286,7 @@ EarlyOut:
|
|||
|
||||
|
||||
static int
|
||||
MimeInlineTextPlainFlowed_parse_line (char *line, PRInt32 length, MimeObject *obj)
|
||||
MimeInlineTextPlainFlowed_parse_line (const char *aLine, PRInt32 length, MimeObject *obj)
|
||||
{
|
||||
int status;
|
||||
PRBool quoting = ( obj->options
|
||||
|
@ -309,7 +309,9 @@ MimeInlineTextPlainFlowed_parse_line (char *line, PRInt32 length, MimeObject *ob
|
|||
if (length <= 0) return 0;
|
||||
|
||||
uint32 linequotelevel = 0;
|
||||
const char *linep = line;
|
||||
nsCAutoString real_line(aLine, length);
|
||||
char *line = real_line.BeginWriting();
|
||||
const char *linep = real_line.BeginReading();
|
||||
// Space stuffed?
|
||||
if(' ' == *linep) {
|
||||
linep++;
|
||||
|
|
|
@ -58,7 +58,7 @@ MimeDefClass(MimeInlineTextPlain, MimeInlineTextPlainClass,
|
|||
mimeInlineTextPlainClass, &MIME_SUPERCLASS);
|
||||
|
||||
static int MimeInlineTextPlain_parse_begin (MimeObject *);
|
||||
static int MimeInlineTextPlain_parse_line (char *, PRInt32, MimeObject *);
|
||||
static int MimeInlineTextPlain_parse_line (const char *, PRInt32, MimeObject *);
|
||||
static int MimeInlineTextPlain_parse_eof (MimeObject *, PRBool);
|
||||
|
||||
static int
|
||||
|
@ -304,7 +304,7 @@ MimeInlineTextPlain_parse_eof (MimeObject *obj, PRBool abort_p)
|
|||
|
||||
|
||||
static int
|
||||
MimeInlineTextPlain_parse_line (char *line, PRInt32 length, MimeObject *obj)
|
||||
MimeInlineTextPlain_parse_line (const char *line, PRInt32 length, MimeObject *obj)
|
||||
{
|
||||
int status;
|
||||
PRBool quoting = ( obj->options
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
MimeDefClass(MimeInlineTextRichtext, MimeInlineTextRichtextClass,
|
||||
mimeInlineTextRichtextClass, &MIME_SUPERCLASS);
|
||||
|
||||
static int MimeInlineTextRichtext_parse_line (char *, PRInt32, MimeObject *);
|
||||
static int MimeInlineTextRichtext_parse_line (const char *, PRInt32, MimeObject *);
|
||||
static int MimeInlineTextRichtext_parse_begin (MimeObject *);
|
||||
static int MimeInlineTextRichtext_parse_eof (MimeObject *, PRBool);
|
||||
|
||||
|
@ -65,7 +65,7 @@ MimeInlineTextRichtextClassInitialize(MimeInlineTextRichtextClass *clazz)
|
|||
from outside this module (no MimeObject, etc.)
|
||||
*/
|
||||
int
|
||||
MimeRichtextConvert (char *line, PRInt32 length,
|
||||
MimeRichtextConvert (const char *line, PRInt32 length,
|
||||
int (*output_fn) (const char *buf, PRInt32 size, void *closure),
|
||||
void *closure,
|
||||
char **obufferP,
|
||||
|
@ -181,8 +181,8 @@ MimeRichtextConvert (char *line, PRInt32 length,
|
|||
{
|
||||
/* Push out this ID. */
|
||||
const char *old = this_start + 1;
|
||||
char *tag_open = 0;
|
||||
char *tag_close = 0;
|
||||
const char *tag_open = 0;
|
||||
const char *tag_close = 0;
|
||||
if (*old == '/')
|
||||
{
|
||||
/* This is </tag> */
|
||||
|
@ -330,7 +330,7 @@ MimeRichtextConvert (char *line, PRInt32 length,
|
|||
|
||||
|
||||
static int
|
||||
MimeInlineTextRichtext_parse_line (char *line, PRInt32 length, MimeObject *obj)
|
||||
MimeInlineTextRichtext_parse_line (const char *line, PRInt32 length, MimeObject *obj)
|
||||
{
|
||||
PRBool enriched_p = (((MimeInlineTextRichtextClass *) obj->clazz)
|
||||
->enriched_p);
|
||||
|
|
|
@ -51,7 +51,7 @@ MimeDefClass(MimeUntypedText, MimeUntypedTextClass,
|
|||
static int MimeUntypedText_initialize (MimeObject *);
|
||||
static void MimeUntypedText_finalize (MimeObject *);
|
||||
static int MimeUntypedText_parse_begin (MimeObject *);
|
||||
static int MimeUntypedText_parse_line (char *, PRInt32, MimeObject *);
|
||||
static int MimeUntypedText_parse_line (const char *, PRInt32, MimeObject *);
|
||||
|
||||
static int MimeUntypedText_open_subpart (MimeObject *obj,
|
||||
MimeUntypedTextSubpartType ttype,
|
||||
|
@ -124,7 +124,7 @@ MimeUntypedText_parse_begin (MimeObject *obj)
|
|||
}
|
||||
|
||||
static int
|
||||
MimeUntypedText_parse_line (char *line, PRInt32 length, MimeObject *obj)
|
||||
MimeUntypedText_parse_line (const char *line, PRInt32 length, MimeObject *obj)
|
||||
{
|
||||
MimeUntypedText *uty = (MimeUntypedText *) obj;
|
||||
int status = 0;
|
||||
|
|
|
@ -82,7 +82,7 @@ BeginGather(MimeObject *obj)
|
|||
}
|
||||
|
||||
static int
|
||||
GatherLine(char *line, PRInt32 length, MimeObject *obj)
|
||||
GatherLine(const char *line, PRInt32 length, MimeObject *obj)
|
||||
{
|
||||
MimeSimpleStub *ssobj = (MimeSimpleStub *)obj;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче