gmime-utils

Name

gmime-utils -- 

Synopsis



#define     BASE64_ENCODE_LEN               (x)
#define     QP_ENCODE_LEN                   (x)
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_header_fold        (const gchar *in);
gchar*      g_mime_utils_header_printf      (const gchar *format,
                                             ...);
gchar*      g_mime_utils_quote_string       (const gchar *string);
void        g_mime_utils_unquote_string     (gchar *string);
gboolean    g_mime_utils_text_is_8bit       (const guchar *text,
                                             guint len);
GMimePartEncodingType g_mime_utils_best_encoding
                                            (const guchar *text,
                                             guint len);
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,
                                             guint32 *save);
gint        g_mime_utils_base64_encode_step (const guchar *in,
                                             gint inlen,
                                             guchar *out,
                                             gint *state,
                                             guint32 *save);
gint        g_mime_utils_base64_encode_close
                                            (const guchar *in,
                                             gint inlen,
                                             guchar *out,
                                             gint *state,
                                             guint32 *save);
gint        g_mime_utils_uudecode_step      (const guchar *in,
                                             gint inlen,
                                             guchar *out,
                                             gint *state,
                                             guint32 *save,
                                             gchar *uulen);
gint        g_mime_utils_uuencode_step      (const guchar *in,
                                             gint inlen,
                                             guchar *out,
                                             guchar *uubuf,
                                             gint *state,
                                             guint32 *save,
                                             gchar *uulen);
gint        g_mime_utils_uuencode_close     (const guchar *in,
                                             gint inlen,
                                             guchar *out,
                                             guchar *uubuf,
                                             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

BASE64_ENCODE_LEN()

#define BASE64_ENCODE_LEN(x) ((guint) ((x) * 5 / 3) + 4)  /* conservative would be ((x * 4 / 3) + 4) */

x : 


QP_ENCODE_LEN()

#define QP_ENCODE_LEN(x)     ((guint) ((x) * 7 / 2) + 4)  /* conservative would be ((x * 3) + 4) */

x : 


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_header_fold ()

gchar*      g_mime_utils_header_fold        (const gchar *in);

in : input header string
Returns :an allocated string containing the folded header.


g_mime_utils_header_printf ()

gchar*      g_mime_utils_header_printf      (const gchar *format,
                                             ...);

format : string format
... : arguments
Returns :an allocated string containing the folded header specified by format and the following arguments.


g_mime_utils_quote_string ()

gchar*      g_mime_utils_quote_string       (const gchar *string);

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.


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,
                                             guint len);

text : text to check for 8bit chars
len : text length
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,
                                             guint len);

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)


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,
                                             guint32 *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,
                                             guint32 *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,
                                             guint32 *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 'decode step' on a chunk of uuencoded data. Assumes the "begin <mode> <file name>" line has been stripped off.


g_mime_utils_uuencode_step ()

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

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


g_mime_utils_uuencode_close ()

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

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


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.