Main Page | Data Structures | File List | Data Fields | Globals

mimeproc.c File Reference

#include "mimeproc.h"

Functions

MimeStringmime_mstr_new (unsigned long blen, char *binstr, unsigned long mlen, char *mimestr)
void mime_mstr_free (MimeString *mstr)
void mime_print (MimeString *mstr)
int mime_encode_b64 (MimeString *mstr)
int mime_encode_qp (MimeString *mstr)
int mime_decode_b64 (MimeString *mstr)
int mime_decode_qp (MimeString *mstr)
int mime_encode (MimeString *mstr)
int mime_decode (MimeString *mstr)
int mime_convert (MimeString *mstr)

Detailed Description

Basic Mime Encoder/Decoder, v0.1

Lots of RFC reading and a few examples like mpack to do this. Well maybe not enough RFC reading but it does what it needs to do. Easily could be converted to be a much smarter mime handler.

I realize this is a strange way to handle mime (en/de)coding. This was not really meant to be used outside of iparser's binary loading/saving routines. Although, if you find it useful feel free, and i will try to document as best i can the functionality.


Function Documentation

int mime_convert MimeString mstr  ) 
 

Parameters:
mstr The MimeString to convert.
Return values:
TRUE On success or their is no action to preform.
FALSE When their is no strings present.
Description:
Automatically determines if the supplied MimeString needs to be encoded or decoded and performs the appropriate action.

int mime_decode MimeString mstr  ) 
 

Parameters:
mstr The MimeString to decode.
Return values:
TRUE On success or decoded string allready present.
FALSE When their is no mime string to decode or mstr is NULL.
Description:
Converts the mime string member of the supplied MimeString to binary. The decoding method is determined automatically.

int mime_decode_b64 MimeString mstr  ) 
 

Parameters:
mstr The MimeString to decode.
Return values:
TRUE On success or decoded string allready present.
FALSE When their is no mime string to decode or mstr is NULL.
Description:
Converts the Base64 encoded string member of the supplied MimeString to binary.
Note:
It is recommended that you use mime_decode() instead of calling this function directly.

int mime_decode_qp MimeString mstr  ) 
 

Parameters:
mstr The MimeString to decode.
Return values:
TRUE On success or decoded string allready present.
FALSE When their is no mime string to decode or mstr is NULL.
Description:
Converts the Quoted Printable encoded string member of the supplied MimeString to binary.
Note:
It is recommended that you use mime_decode() instead of calling this function directly.

int mime_encode MimeString mstr  ) 
 

Parameters:
mstr The MimeString to encode.
Return values:
TRUE On success or encoded string allready present.
FALSE When their is no binary string to encode or mstr is NULL.
Description:
Converts the binary string member of the supplied MimeString to either Base64 or Quoted Printable. The encodeing method is determined automaticly by the amount of printable charters the binary string contains.

int mime_encode_b64 MimeString mstr  ) 
 

Parameters:
mstr The MimeString to encode.
Return values:
TRUE On success or encoded string allready present.
FALSE When their is no binary string to encode or mstr is NULL.
Description:
Converts the binary string member of the supplied MimeString to Base64 encodeing.
Note:
It is recommended that you use mime_encode() instead of calling this function directly, unless Base64 encoding is required.

int mime_encode_qp MimeString mstr  ) 
 

Parameters:
mstr The MimeString to encode.
Return values:
TRUE On success or encoded string allready present.
FALSE When their is no binary string to encode or mstr is NULL.
Description:
Converts the binary string member of the supplied MimeString to Quoted Printable encodeing.
Note:
It is recommended that you use mime_encode() instead of calling this function directly, unless Quoted Printable encoding is required.

void mime_mstr_free MimeString mstr  ) 
 

Parameters:
mstr The MimeString to free.
Description:
Frees a MimeString structure and all its members.

MimeString* mime_mstr_new unsigned long  blen,
char *  binstr,
unsigned long  mlen,
char *  mimestr
 

Parameters:
blen The binary string length.
binstr The binary string.
mlen The mime string length.
mimestr The mime string.
Return values:
#MimeString * Containing a duplicate copy of the supplied strings and lengths.
Description:
Generates a MimeString containing a duplicate copy of the supplied binary or mime string(s). You only need to supply one of the strings and related lengths.

void mime_print MimeString mstr  ) 
 

Parameters:
mstr The MimeString to print.
Description:
Prints all the information about the members of the the supplied MimeString structure.
Note:
Only useful for debugging.


Generated on Fri Jun 4 18:35:19 2004 for cuf by doxygen 1.3.6