Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions
nsMsgSendLater.cpp File Reference
#include "nsMsgSendLater.h"
#include "nsCOMPtr.h"
#include "nsMsgCopy.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsIEnumerator.h"
#include "nsIFileSpec.h"
#include "nsISmtpService.h"
#include "nsIMsgMailNewsUrl.h"
#include "nsMsgDeliveryListener.h"
#include "nsIMsgIncomingServer.h"
#include "nsICopyMessageListener.h"
#include "nsIMsgMessageService.h"
#include "nsIMsgMailSession.h"
#include "nsIMsgAccountManager.h"
#include "nsMsgBaseCID.h"
#include "nsMsgCompCID.h"
#include "nsMsgCompUtils.h"
#include "nsMsgUtils.h"
#include "nsMsgFolderFlags.h"
#include "nsISupportsArray.h"
#include "nsMailHeaders.h"
#include "nsMsgPrompts.h"
#include "nsIMsgSendListener.h"
#include "nsIMsgSendLaterListener.h"
#include "nsMsgComposeStringBundle.h"
#include "nsXPIDLString.h"
#include "nsIPrompt.h"
#include "nsIURI.h"
#include "nsISmtpUrl.h"
#include "nsIChannel.h"
#include "prlog.h"
#include "nsMsgSimulateError.h"
#include "nsIMimeConverter.h"
#include "nsMsgMimeCID.h"

Go to the source code of this file.

Defines

#define UNHEX(C)
#define do_grow_headers(desired_size)

Functions

static NS_DEFINE_CID (kISupportsArrayCID, NS_SUPPORTSARRAY_CID)
char * FindEOL (char *inBuf, char *buf_end)
 NS_IMPL_ISUPPORTS2 (SendOperationListener, nsIMsgSendListener, nsIMsgCopyServiceListener) SendOperationListener
int DoGrowBuffer (PRInt32 desired_size, PRInt32 element_size, PRInt32 quantum, char **buffer, PRInt32 *size)

Define Documentation

#define do_grow_headers (   desired_size)
Value:
(((desired_size) >= m_headersSize) ? \
   DoGrowBuffer ((desired_size), sizeof(char), 1024, \
           &m_headers, &m_headersSize) \
   : 0)

Definition at line 1037 of file nsMsgSendLater.cpp.

#define UNHEX (   C)
Value:
((C >= '0' && C <= '9') ? C - '0' : \
  ((C >= 'A' && C <= 'F') ? C - 'A' + 10 : \
        ((C >= 'a' && C <= 'f') ? C - 'a' + 10 : 0)))

Definition at line 795 of file nsMsgSendLater.cpp.


Function Documentation

int DoGrowBuffer ( PRInt32  desired_size,
PRInt32  element_size,
PRInt32  quantum,
char **  buffer,
PRInt32 size 
)

Definition at line 1014 of file nsMsgSendLater.cpp.

{
  if (*size <= desired_size)
  {
    char *new_buf;
    PRInt32 increment = desired_size - *size;
    if (increment < quantum) // always grow by a minimum of N bytes 
      increment = quantum;
    
    new_buf = (*buffer
                ? (char *) PR_Realloc (*buffer, (*size + increment)
                * (element_size / sizeof(char)))
                : (char *) PR_Malloc ((*size + increment)
                * (element_size / sizeof(char))));
    if (! new_buf)
      return NS_ERROR_OUT_OF_MEMORY;
    *buffer = new_buf;
    *size += increment;
  }
  return 0;
}

Here is the call graph for this function:

char* FindEOL ( char *  inBuf,
char *  buf_end 
)

Definition at line 194 of file nsMsgSendLater.cpp.

{
  char *buf = inBuf;
  char *findLoc = nsnull;

  while (buf <= buf_end)
    if (*buf == 0) 
      return buf;
    else if ( (*buf == nsCRT::LF) || (*buf == nsCRT::CR) )
    {
      findLoc = buf;
      break;
    }
    else
      ++buf;

  if (!findLoc)
    return nsnull;
  else if ((findLoc + 1) > buf_end)
    return buf;

  if ( (*findLoc == nsCRT::LF && *(findLoc+1) == nsCRT::CR) || 
       (*findLoc == nsCRT::CR && *(findLoc+1) == nsCRT::LF))
    findLoc++; // possibly a pair.       
  return findLoc;
}
static NS_DEFINE_CID ( kISupportsArrayCID  ,
NS_SUPPORTSARRAY_CID   
) [static]

Definition at line 316 of file nsMsgSendLater.cpp.

{ 
  mSendLater = nsnull;
}