GMime Library Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
#define BASE64_ENCODE_LEN (x) #define QP_ENCODE_LEN (x) enum GMimePartEncodingType; struct GMimeReferences; |
#define BASE64_ENCODE_LEN(x) ((size_t) ((x) * 5 / 3) + 4) /* conservative would be ((x * 4 / 3) + 4) */ |
x : |
|
#define QP_ENCODE_LEN(x) ((size_t) ((x) * 7 / 2) + 4) /* conservative would be ((x * 3) + 4) */ |
x : |
|
typedef enum { GMIME_PART_ENCODING_DEFAULT, GMIME_PART_ENCODING_7BIT, GMIME_PART_ENCODING_8BIT, GMIME_PART_ENCODING_BINARY, GMIME_PART_ENCODING_BASE64, GMIME_PART_ENCODING_QUOTEDPRINTABLE, GMIME_PART_ENCODING_UUENCODE, GMIME_PART_NUM_ENCODINGS } GMimePartEncodingType; |
|
Decodes the rfc822 date string and saves the GMT offset into saveoffset if non-NULL.
in : | input date string |
saveoffset : | |
Returns : | the time_t representation of the date string specified by in. If 'saveoffset' is non-NULL, the value of the timezone offset will be stored. |
char* g_mime_utils_header_format_date ( |
Allocates a string buffer containing the rfc822 formatted date string represented by time and offset.
time : | time_t date representation |
offset : | Timezone offset |
Returns : | a valid string representation of the date. |
char* g_mime_utils_generate_message_id (const char *fqdn); |
Generates a unique Message-Id.
fqdn : | Fully qualified domain name |
Returns : | a unique string in an addr-spec format suitable for use as a Message-Id. |
char* g_mime_utils_decode_message_id (const char *message_id); |
Decodes a msg-id as defined by rfc822.
message_id : | string containing a message-id |
Returns : | the addr-spec portion of the msg-id. |
GMimeReferences* g_mime_references_decode (const char *text); |
Decodes a list of msg-ids as in the References and/or In-Reply-To headers defined in rfc822.
text : | string containing a list of msg-ids |
Returns : | a list of referenced msg-ids. |
void g_mime_references_append (GMimeReferences **refs, const char *msgid); |
Appends a reference to msgid to the list of references.
refs : | the address of a GMimeReferences list |
msgid : | a message-id string |
void g_mime_references_clear (GMimeReferences **refs); |
Clears the GMimeReferences list and resets it to NULL.
refs : | address of a GMimeReferences list |
char* g_mime_utils_header_fold (const char *in); |
Folds a header according to the rules in rfc822.
in : | input header string |
Returns : | an allocated string containing the folded header. |
char* g_mime_utils_header_printf (const char *format, ...); |
Allocates a buffer containing a formatted header specified by the Varargs.
format : | string format |
... : | arguments |
Returns : | an allocated string containing the folded header specified by format and the following arguments. |
char* g_mime_utils_quote_string (const char *string); |
Quotes string as needed according to the rules in rfc2045.
string : | input string |
Returns : | an allocated string containing the escaped and quoted (if needed to be) input string. The decision to quote the string is based on whether or not the input string contains any 'tspecials' as defined by rfc2045. |
void g_mime_utils_unquote_string (char *string); |
Unquotes and unescapes a string.
string : | string |
|
Determines if text contains 8bit characters within the first len bytes.
text : | text to check for 8bit chars |
len : | text length |
Returns : | TRUE if the text contains 8bit characters or FALSE otherwise. |
GMimePartEncodingType g_mime_utils_best_encoding (unsigned char *text, |
Determines the best content encoding for the first len bytes of text.
text : | text to encode |
len : | text length |
Returns : | a GMimePartEncodingType that is determined to be the best encoding type for the specified block of text. ("best" in this particular case means best compression) |
char* g_mime_utils_8bit_header_decode (unsigned char *in); |
Decodes and rfc2047 encoded header.
in : | header to decode |
Returns : | the mime encoded header as 8bit text. |
char* g_mime_utils_8bit_header_encode (unsigned char *in); |
Encodes a header according to the rules in rfc2047.
in : | header to encode |
Returns : | the header as several encoded atoms. Useful for encoding headers like "Subject". |
char* g_mime_utils_8bit_header_encode_phrase (unsigned char *in); |
Encodes a header phrase according to the rules in rfc2047.
in : | header to encode |
Returns : | the header phrase as 1 encoded atom. Useful for encoding internet addresses. |
|
Decodes a chunk of base64 encoded data.
in : | input stream |
inlen : | max length of data to decode |
out : | output stream |
state : | holds the number of bits that are stored in save |
save : | leftover bits that have not yet been decoded |
Returns : | the number of bytes decoded (which have been dumped in out). |
|
Base64 encodes a chunk of data. Performs an 'encode step', only encodes blocks of 3 characters to the output at a time, saves left-over state in state and save (initialise to 0 on first invocation).
in : | input stream |
inlen : | length of the input |
out : | output string |
state : | holds the number of bits that are stored in save |
save : | leftover bits that have not yet been encoded |
Returns : | the number of bytes encoded. |
|
Base64 encodes the input stream to the output stream. Call this when finished encoding data with g_mime_utils_base64_encode_step to flush off the last little bit.
in : | input stream |
inlen : | length of the input |
out : | output string |
state : | holds the number of bits that are stored in save |
save : | leftover bits that have not yet been encoded |
Returns : | the number of bytes encoded. |
#define GMIME_UUDECODE_STATE_MASK (GMIME_UUDECODE_STATE_BEGIN | GMIME_UUDECODE_STATE_END) |
|
Uudecodes a chunk of data. Performs a 'decode step' on a chunk of uuencoded data. Assumes the "begin <mode> <file name>" line has been stripped off.
in : | input stream |
inlen : | max length of data to decode |
out : | output stream |
state : | holds the number of bits that are stored in save |
save : | leftover bits that have not yet been decoded |
Returns : | the number of bytes decoded. |
|
Uuencodes a chunk of data. Performs an 'encode step', only encodes blocks of 45 characters to the output at a time, saves left-over state in uubuf, state and save (initialize to 0 on first invocation).
in : | input stream |
inlen : | input stream length |
out : | output stream |
uubuf : | temporary buffer of 60 bytes |
state : | holds the number of bits that are stored in save |
save : | leftover bits that have not yet been encoded |
Returns : | the number of bytes encoded. |
|
Uuencodes a chunk of data. Call this when finished encoding data with g_mime_utils_uuencode_step to flush off the last little bit.
in : | input stream |
inlen : | input stream length |
out : | output stream |
uubuf : | temporary buffer of 60 bytes |
state : | holds the number of bits that are stored in save |
save : | leftover bits that have not yet been encoded |
Returns : | the number of bytes encoded. |
|
Decodes a block of quoted-printable encoded data. Performs a 'decode step' on a chunk of QP encoded data.
in : | input stream |
inlen : | max length of data to decode |
out : | output stream |
savestate : | holds the number of bits that are stored in save |
saved : | leftover bits that have not yet been decoded |
Returns : | the number of bytes decoded. |
|
Quoted-printable encodes a block of text. Performs an 'encode step', saves left-over state in state and save (initialise to -1 on first invocation).
in : | input stream |
inlen : | length of the input |
out : | output string |
state : | holds the number of bits that are stored in save |
save : | leftover bits that have not yet been encoded |
Returns : | the number of bytes encoded. |
|
Quoted-printable encodes a block of text. Call this when finished encoding data with g_mime_utils_quoted_encode_step to flush off the last little bit.
in : | input stream |
inlen : | length of the input |
out : | output string |
state : | holds the number of bits that are stored in save |
save : | leftover bits that have not yet been encoded |
Returns : | the number of bytes encoded. |