| Top |
| GMimeContentEncoding | g_mime_content_encoding_from_string () |
| const char * | g_mime_content_encoding_to_string () |
| void | g_mime_encoding_init_encode () |
| void | g_mime_encoding_init_decode () |
| void | g_mime_encoding_reset () |
| size_t | g_mime_encoding_outlen () |
| size_t | g_mime_encoding_step () |
| size_t | g_mime_encoding_flush () |
| #define | GMIME_BASE64_ENCODE_LEN() |
| size_t | g_mime_encoding_base64_decode_step () |
| size_t | g_mime_encoding_base64_encode_step () |
| size_t | g_mime_encoding_base64_encode_close () |
| #define | GMIME_UUDECODE_STATE_INIT |
| #define | GMIME_UUDECODE_STATE_BEGIN |
| #define | GMIME_UUDECODE_STATE_END |
| #define | GMIME_UUENCODE_LEN() |
| size_t | g_mime_encoding_uudecode_step () |
| size_t | g_mime_encoding_uuencode_step () |
| size_t | g_mime_encoding_uuencode_close () |
| #define | GMIME_QP_ENCODE_LEN() |
| size_t | g_mime_encoding_quoted_decode_step () |
| size_t | g_mime_encoding_quoted_encode_step () |
| size_t | g_mime_encoding_quoted_encode_close () |
GMimeContentEncoding
g_mime_content_encoding_from_string (const char *str);
Gets the appropriate GMimeContentEncoding enumeration value based on the input string.
const char *
g_mime_content_encoding_to_string (GMimeContentEncoding encoding);
Gets the string value of the content encoding.
the encoding type as a string or NULL on error. Available
values for the encoding are: GMIME_CONTENT_ENCODING_DEFAULT,
GMIME_CONTENT_ENCODING_7BIT, GMIME_CONTENT_ENCODING_8BIT,
GMIME_CONTENT_ENCODING_BINARY, GMIME_CONTENT_ENCODING_BASE64,
GMIME_CONTENT_ENCODING_QUOTEDPRINTABLE and
GMIME_CONTENT_ENCODING_UUENCODE.
void g_mime_encoding_init_encode (GMimeEncoding *state,GMimeContentEncoding encoding);
Initializes a GMimeEncoding state machine for encoding to
encoding
.
void g_mime_encoding_init_decode (GMimeEncoding *state,GMimeContentEncoding encoding);
Initializes a GMimeEncoding state machine for decoding from
encoding
.
void
g_mime_encoding_reset (GMimeEncoding *state);
Resets the state of the GMimeEncoding.
size_t g_mime_encoding_outlen (GMimeEncoding *state,size_t inlen);
Given the input length, inlen
, calculate the needed output length
to perform an encoding or decoding step.
size_t g_mime_encoding_step (GMimeEncoding *state,const char *inbuf,size_t inlen,char *outbuf);
Incrementally encodes or decodes (depending on state
) an input
stream by 'stepping' through a block of input at a time.
You should make sure outbuf
is large enough by calling
g_mime_encoding_outlen() to find out how large outbuf
might need
to be.
size_t g_mime_encoding_flush (GMimeEncoding *state,const char *inbuf,size_t inlen,char *outbuf);
Completes the incremental encode or decode of the input stream (see
g_mime_encoding_step() for details).
#define GMIME_BASE64_ENCODE_LEN(x) ((size_t) (((((x) + 2) / 57) * 77) + 77))
Calculates the maximum number of bytes needed to base64 encode the
full input buffer of length x
.
size_t g_mime_encoding_base64_decode_step (const unsigned char *inbuf,size_t inlen,unsigned char *outbuf,int *state,guint32 *save);
Decodes a chunk of base64 encoded data.
size_t g_mime_encoding_base64_encode_step (const unsigned char *inbuf,size_t inlen,unsigned char *outbuf,int *state,guint32 *save);
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).
size_t g_mime_encoding_base64_encode_close (const unsigned char *inbuf,size_t inlen,unsigned char *outbuf,int *state,guint32 *save);
Base64 encodes the input stream to the output stream. Call this
when finished encoding data with g_mime_encoding_base64_encode_step()
to flush off the last little bit.
#define GMIME_UUDECODE_STATE_INIT (0)
Initial state for the g_mime_encoding_uudecode_step() function.
#define GMIME_UUDECODE_STATE_BEGIN (1 << 16)
State for the g_mime_encoding_uudecode_step() function, denoting that
the 'begin' line has been found.
#define GMIME_UUDECODE_STATE_END (1 << 17)
State for the g_mime_encoding_uudecode_step() function, denoting that
the end of the UU encoded block has been found.
#define GMIME_UUENCODE_LEN(x) ((size_t) (((((x) + 2) / 45) * 62) + 64))
Calculates the maximum number of bytes needed to uuencode the full
input buffer of length x
.
size_t g_mime_encoding_uudecode_step (const unsigned char *inbuf,size_t inlen,unsigned char *outbuf,int *state,guint32 *save);
Uudecodes a chunk of data. Performs a 'decode step' on a chunk of uuencoded data. Assumes the "begin mode filename" line has been stripped off.
size_t g_mime_encoding_uuencode_step (const unsigned char *inbuf,size_t inlen,unsigned char *outbuf,unsigned char *uubuf,int *state,guint32 *save);
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).
size_t g_mime_encoding_uuencode_close (const unsigned char *inbuf,size_t inlen,unsigned char *outbuf,unsigned char *uubuf,int *state,guint32 *save);
Uuencodes a chunk of data. Call this when finished encoding data
with g_mime_encoding_uuencode_step() to flush off the last little bit.
#define GMIME_QP_ENCODE_LEN(x) ((size_t) ((((x) / 24) * 74) + 74))
Calculates the maximum number of bytes needed to encode the full
input buffer of length x
using the quoted-printable encoding.
size_t g_mime_encoding_quoted_decode_step (const unsigned char *inbuf,size_t inlen,unsigned char *outbuf,int *state,guint32 *save);
Decodes a block of quoted-printable encoded data. Performs a 'decode step' on a chunk of QP encoded data.
size_t g_mime_encoding_quoted_encode_step (const unsigned char *inbuf,size_t inlen,unsigned char *outbuf,int *state,guint32 *save);
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).
size_t g_mime_encoding_quoted_encode_close (const unsigned char *inbuf,size_t inlen,unsigned char *outbuf,int *state,guint32 *save);
Quoted-printable encodes a block of text. Call this when finished
encoding data with g_mime_encoding_quoted_encode_step() to flush off
the last little bit.
A Content-Transfer-Encoding enumeration.
Used with functions like g_mime_filter_best_encoding() and
g_mime_object_encode() as the 'constraint' argument. These values
provide a means of letting the filter know what the encoding
constraints are for the stream.
struct GMimeEncoding {
GMimeContentEncoding encoding;
unsigned char uubuf[60];
gboolean encode;
guint32 save;
int state;
};
A context used for encoding or decoding data.
GMimeContentEncoding |
the type of encoding |
|
a temporary buffer needed when uuencoding data |
||
gboolean |
||
guint32 |
saved bytes from the previous step |
|
current encder/decoder state |