gmime-utils

Name

gmime-utils -- 

Synopsis



time_t      g_mime_utils_header_decode_date (const gchar *in,
                                             gint *saveoffset);
gchar*      g_mime_utils_header_format_date (time_t time,
                                             gint offset);
gchar*      g_mime_utils_quote_string       (const gchar *string,
                                             gboolean do_quotes);
void        g_mime_utils_unquote_string     (gchar *string);
gboolean    g_mime_utils_text_is_8bit       (const guchar *text);
GMimePartEncodingType g_mime_utils_best_encoding
                                            (const guchar *text);
gchar*      g_mime_utils_8bit_header_decode (const guchar *in);
gchar*      g_mime_utils_8bit_header_encode (const guchar *in);
gchar*      g_mime_utils_8bit_header_encode_phrase
                                            (const guchar *in);
gint        g_mime_utils_base64_decode_step (const guchar *in,
                                             gint inlen,
                                             guchar *out,
                                             gint *state,
                                             guint *save);
gint        g_mime_utils_base64_encode_step (const guchar *in,
                                             gint inlen,
                                             guchar *out,
                                             gint *state,
                                             gint *save);
gint        g_mime_utils_base64_encode_close
                                            (const guchar *in,
                                             gint inlen,
                                             guchar *out,
                                             gint *state,
                                             gint *save);
gint        g_mime_utils_uudecode_step      (const guchar *in,
                                             gint inlen,
                                             guchar *out,
                                             gint *state,
                                             guint32 *save,
                                             gchar *uulen);
gint        g_mime_utils_quoted_decode_step (const guchar *in,
                                             gint inlen,
                                             guchar *out,
                                             gint *savestate,
                                             gint *saved);
gint        g_mime_utils_quoted_encode_step (const guchar *in,
                                             gint inlen,
                                             guchar *out,
                                             gint *state,
                                             gint *save);
gint        g_mime_utils_quoted_encode_close
                                            (const guchar *in,
                                             gint inlen,
                                             guchar *out,
                                             gint *state,
                                             gint *save);

Description

Details

g_mime_utils_header_decode_date ()

time_t      g_mime_utils_header_decode_date (const gchar *in,
                                             gint *saveoffset);

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.


g_mime_utils_header_format_date ()

gchar*      g_mime_utils_header_format_date (time_t time,
                                             gint offset);

time : time_t date representation
offset : Timezone offset
Returns :a valid string representation of the date.


g_mime_utils_quote_string ()

gchar*      g_mime_utils_quote_string       (const gchar *string,
                                             gboolean do_quotes);

string : input string
do_quotes : wrap string in quotes.
Returns :an allocated string containing the escaped and (optionally) quoted input string.


g_mime_utils_unquote_string ()

void        g_mime_utils_unquote_string     (gchar *string);

Unquotes and unescapes a string.

string : 


g_mime_utils_text_is_8bit ()

gboolean    g_mime_utils_text_is_8bit       (const guchar *text);

text : text to check for 8bit chars
Returns :TRUE if the text contains 8bit characters or FALSE otherwise.


g_mime_utils_best_encoding ()

GMimePartEncodingType g_mime_utils_best_encoding
                                            (const guchar *text);

text : text to encode
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)


g_mime_utils_8bit_header_decode ()

gchar*      g_mime_utils_8bit_header_decode (const guchar *in);

in : header to decode
Returns :the mime encoded header as 8bit text.


g_mime_utils_8bit_header_encode ()

gchar*      g_mime_utils_8bit_header_encode (const guchar *in);

in : header to encode
Returns :the header as several encoded atoms. Useful for encoding headers like "Subject".


g_mime_utils_8bit_header_encode_phrase ()

gchar*      g_mime_utils_8bit_header_encode_phrase
                                            (const guchar *in);

in : header to encode
Returns :the header phrase as 1 encoded atom. Useful for encoding internet addresses.


g_mime_utils_base64_decode_step ()

gint        g_mime_utils_base64_decode_step (const guchar *in,
                                             gint inlen,
                                             guchar *out,
                                             gint *state,
                                             guint *save);

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).


g_mime_utils_base64_encode_step ()

gint        g_mime_utils_base64_encode_step (const guchar *in,
                                             gint inlen,
                                             guchar *out,
                                             gint *state,
                                             gint *save);

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. 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).


g_mime_utils_base64_encode_close ()

gint        g_mime_utils_base64_encode_close
                                            (const guchar *in,
                                             gint inlen,
                                             guchar *out,
                                             gint *state,
                                             gint *save);

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. Call this when finished encoding data with base64_encode_step to flush off the last little bit.


g_mime_utils_uudecode_step ()

gint        g_mime_utils_uudecode_step      (const guchar *in,
                                             gint inlen,
                                             guchar *out,
                                             gint *state,
                                             guint32 *save,
                                             gchar *uulen);

in : input stream
inlen : max length of data to decode ( normally strlen(in) ??)
out : output stream
state : holds the number of bits that are stored in save
save : leftover bits that have not yet been decoded
uulen : holds the value of the length-char which is used to calculate how many more chars need to be decoded for that 'line'
Returns :the number of bytes decoded. Performs a 'uudecode step' on a chunk of uuencoded data. Assumes the "begin <mode> <file name>" line has been stripped off.


g_mime_utils_quoted_decode_step ()

gint        g_mime_utils_quoted_decode_step (const guchar *in,
                                             gint inlen,
                                             guchar *out,
                                             gint *savestate,
                                             gint *saved);

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. Performs a 'decode step' on a chunk of QP encoded data.


g_mime_utils_quoted_encode_step ()

gint        g_mime_utils_quoted_encode_step (const guchar *in,
                                             gint inlen,
                                             guchar *out,
                                             gint *state,
                                             gint *save);

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. Performs an 'encode step', saves left-over state in state and save (initialise to -1 on first invocation).


g_mime_utils_quoted_encode_close ()

gint        g_mime_utils_quoted_encode_close
                                            (const guchar *in,
                                             gint inlen,
                                             guchar *out,
                                             gint *state,
                                             gint *save);

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. Call this when finished encoding data with quoted_encode_step to flush off the last little bit.