Back to index

lightning-sunbird  0.9+nobinonly
mimebuf.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


int mime_GrowBuffer (PRUint32 desired_size, PRUint32 element_size, PRUint32 quantum, char **buffer, PRInt32 *size)
int mime_LineBuffer (const char *net_buffer, PRInt32 net_buffer_size, char **bufferP, PRInt32 *buffer_sizeP, PRInt32 *buffer_fpP, PRBool convert_newlines_p, PRInt32(*PR_CALLBACK per_line_fn)(char *line, PRInt32line_length, void *closure), void *closure)
int mime_ReBuffer (const char *net_buffer, PRInt32 net_buffer_size, PRUint32 desired_buffer_size, char **bufferP, PRUint32 *buffer_sizeP, PRUint32 *buffer_fpP, PRInt32(*per_buffer_fn)(char *buffer, PRUint32 buffer_size, void *closure), void *closure)

Function Documentation

int mime_GrowBuffer ( PRUint32  desired_size,
PRUint32  element_size,
PRUint32  quantum,
char **  buffer,
PRInt32 size 

Definition at line 56 of file mimebuf.cpp.

  if ((PRUint32) *size <= desired_size)
         char *new_buf;
         PRUint32 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 MIME_OUT_OF_MEMORY;
         *buffer = new_buf;
         *size += increment;
  return 0;

Here is the call graph for this function:

Here is the caller graph for this function:

int mime_LineBuffer ( const char *  net_buffer,
PRInt32  net_buffer_size,
char **  bufferP,
PRInt32 buffer_sizeP,
PRInt32 buffer_fpP,
PRBool  convert_newlines_p,
PRInt32(*)(char *line, PRInt32line_length, void *closure per_line_fn,
void closure 
int mime_ReBuffer ( const char *  net_buffer,
PRInt32  net_buffer_size,
PRUint32  desired_buffer_size,
char **  bufferP,
PRUint32 buffer_sizeP,
PRUint32 buffer_fpP,
PRInt32(*)(char *buffer, PRUint32 buffer_size, void *closure per_buffer_fn,
void closure