camel-mime-utils
3
CAMEL Library

# camel-mime-utils

## Synopsis

    #define             CAMEL_FOLD_SIZE
    #define             CAMEL_FOLD_MAX_SIZE
    #define             CAMEL_UUDECODE_STATE_INIT
    #define             CAMEL_UUDECODE_STATE_BEGIN
    #define             CAMEL_UUDECODE_STATE_END
    #define             CAMEL_UUDECODE_STATE_MASK
    enum                CamelTransferEncoding;
    struct              camel_header_references;
    char*               camel_header_param                  (struct _camel_header_param *params,
                                                             const char *name);
                        CamelContentType;
    struct              camel_header_raw;
                        CamelContentDisposition;
    enum                camel_header_address_t;
    struct              camel_header_address;
    struct              camel_header_newsgroup;
    struct _camel_header_address* camel_header_address_new  (void);
    struct _camel_header_address* camel_header_address_new_name
                                                            (const char *name,
                                                             const char *addr);
    struct _camel_header_address* camel_header_address_new_group
                                                            (const char *name);
    void                camel_header_address_ref            (struct _camel_header_address *addrlist);
    void                camel_header_address_unref          (struct _camel_header_address *addrlist);
    void                camel_header_address_set_name       (struct _camel_header_address *addrlist,
                                                             const char *name);
    void                camel_header_address_set_addr       (struct _camel_header_address *addrlist,
                                                             const char *addr);
    void                camel_header_address_set_members    (struct _camel_header_address *addrlist,
                                                             struct _camel_header_address *group);
    void                camel_header_address_add_member     (struct _camel_header_address *addrlist,
                                                             struct _camel_header_address *member);
    void                camel_header_address_list_append_list
                                                            (struct _camel_header_address **addrlistp,
                                                             struct _camel_header_address **addrs);
    void                camel_header_address_list_append    (struct _camel_header_address **addrlistp,
                                                             struct _camel_header_address *addr);
    void                camel_header_address_list_clear     (struct _camel_header_address **addrlistp);
    struct _camel_header_address* camel_header_address_decode
                                                            (const char *in,
                                                             const char *charset);
    struct _camel_header_address* camel_header_mailbox_decode
                                                            (const char *in,
                                                             const char *charset);
    char*               camel_header_address_list_encode    (struct _camel_header_address *addrlist);
    char*               camel_header_address_list_format    (struct _camel_header_address *addrlist);
    struct _camel_header_param* camel_header_param_list_decode
                                                            (const char *in);
    char*               camel_header_param                  (struct _camel_header_param *params,
                                                             const char *name);
    struct _camel_header_param* camel_header_set_param      (struct _camel_header_param **paramsp,
                                                             const char *name,
                                                             const char *value);
    void                camel_header_param_list_format_append
                                                            (GString *out,
                                                             struct _camel_header_param *params);
    char*               camel_header_param_list_format      (struct _camel_header_param *params);
    void                camel_header_param_list_free        (struct _camel_header_param *params);
    CamelContentType*   camel_content_type_new              (const char *type,
                                                             const char *subtype);
    CamelContentType*   camel_content_type_decode           (const char *in);
    void                camel_content_type_unref            (CamelContentType *content_type);
    void                camel_content_type_ref              (CamelContentType *content_type);
    const char*         camel_content_type_param            (CamelContentType *content_type,
                                                             const char *name);
    void                camel_content_type_set_param        (CamelContentType *content_type,
                                                             const char *name,
                                                             const char *value);
    int                 camel_content_type_is               (CamelContentType *content_type,
                                                             const char *type,
                                                             const char *subtype);
    char*               camel_content_type_format           (CamelContentType *content_type);
    char*               camel_content_type_simple           (CamelContentType *content_type);
    void                camel_content_type_dump             (CamelContentType *content_type);
    CamelContentDisposition* camel_content_disposition_decode
                                                            (const char *in);
    void                camel_content_disposition_ref       (CamelContentDisposition *disposition);
    void                camel_content_disposition_unref     (CamelContentDisposition *disposition);
    char*               camel_content_disposition_format    (CamelContentDisposition *disposition);
    char*               camel_content_transfer_encoding_decode
                                                            (const char *in);
    void                camel_header_raw_append             (struct _camel_header_raw **list,
                                                             const char *name,
                                                             const char *value,
                                                             int offset);
    void                camel_header_raw_append_parse       (struct _camel_header_raw **list,
                                                             const char *header,
                                                             int offset);
    const char*         camel_header_raw_find               (struct _camel_header_raw **list,
                                                             const char *name,
                                                             int *offset);
    const char*         camel_header_raw_find_next          (struct _camel_header_raw **list,
                                                             const char *name,
                                                             int *offset,
                                                             const char *last);
    void                camel_header_raw_replace            (struct _camel_header_raw **list,
                                                             const char *name,
                                                             const char *value,
                                                             int offset);
    void                camel_header_raw_remove             (struct _camel_header_raw **list,
                                                             const char *name);
    void                camel_header_raw_fold               (struct _camel_header_raw **list);
    void                camel_header_raw_clear              (struct _camel_header_raw **list);
    char*               camel_header_raw_check_mailing_list (struct _camel_header_raw **list);
    char*               camel_header_address_fold           (const char *in,
                                                             size_t headerlen);
    char*               camel_header_fold                   (const char *in,
                                                             size_t headerlen);
    char*               camel_header_unfold                 (const char *in);
    char*               camel_header_token_decode           (const char *in);
    int                 camel_header_decode_int             (const char **in);
    char*               camel_header_decode_string          (const char *in,
                                                             const char *default_charset);
    char*               camel_header_encode_string          (unsigned char *in);
    char*               camel_header_format_ctext           (const char *in,
                                                             const char *default_charset);
    char*               camel_header_encode_phrase          (unsigned char *in);
    time_t              camel_header_decode_date            (const char *in,
                                                             int *saveoffset);
    char*               camel_header_format_date            (time_t time,
                                                             int offset);
    char*               camel_header_msgid_decode           (const char *in);
    char*               camel_header_contentid_decode       (const char *in);
    char*               camel_header_msgid_generate         (void);
    struct _camel_header_references* camel_header_references_inreplyto_decode
                                                            (const char *in);
    struct _camel_header_references* camel_header_references_decode
                                                            (const char *in);
    void                camel_header_references_list_clear  (struct _camel_header_references **list);
    void                camel_header_references_list_append_asis
                                                            (struct _camel_header_references **list,
                                                             char *ref);
    int                 camel_header_references_list_size   (struct _camel_header_references **list);
    struct _camel_header_references* camel_header_references_dup
                                                            (const struct _camel_header_references *list);
    char*               camel_header_location_decode        (const char *in);
    struct _camel_header_newsgroup* camel_header_newsgroups_decode
                                                            (const char *in);
    void                camel_header_newsgroups_free        (struct _camel_header_newsgroup *ng);
    const char*         camel_transfer_encoding_to_string   (CamelTransferEncoding encoding);
    CamelTransferEncoding camel_transfer_encoding_from_string
                                                            (const char *string);
    void                camel_header_mime_decode            (const char *in,
                                                             int *maj,
                                                             int *min);
    size_t              camel_base64_decode_step            (unsigned char *in,
                                                             size_t len,
                                                             unsigned char *out,
                                                             int *state,
                                                             unsigned int *save);
    size_t              camel_base64_encode_step            (unsigned char *in,
                                                             size_t len,
                                                             gboolean break_lines,
                                                             unsigned char *out,
                                                             int *state,
                                                             int *save);
    size_t              camel_base64_encode_close           (unsigned char *in,
                                                             size_t len,
                                                             gboolean break_lines,
                                                             unsigned char *out,
                                                             int *state,
                                                             int *save);
    size_t              camel_uudecode_step                 (unsigned char *in,
                                                             size_t len,
                                                             unsigned char *out,
                                                             int *state,
                                                             guint32 *save);
    size_t              camel_uuencode_step                 (unsigned char *in,
                                                             size_t len,
                                                             unsigned char *out,
                                                             unsigned char *uubuf,
                                                             int *state,
                                                             guint32 *save);
    size_t              camel_uuencode_close                (unsigned char *in,
                                                             size_t len,
                                                             unsigned char *out,
                                                             unsigned char *uubuf,
                                                             int *state,
                                                             guint32 *save);
    size_t              camel_quoted_decode_step            (unsigned char *in,
                                                             size_t len,
                                                             unsigned char *out,
                                                             int *savestate,
                                                             int *saveme);
    size_t              camel_quoted_encode_step            (unsigned char *in,
                                                             size_t len,
                                                             unsigned char *out,
                                                             int *state,
                                                             int *save);
    size_t              camel_quoted_encode_close           (unsigned char *in,
                                                             size_t len,
                                                             unsigned char *out,
                                                             int *state,
                                                             int *save);
    char*               camel_base64_encode_simple          (const char *data,
                                                             size_t len);
    size_t              camel_base64_decode_simple          (char *data,
                                                             size_t len);
    #define             camel_mime_is_ctrl                  (x)
    #define             camel_mime_is_lwsp                  (x)
    #define             camel_mime_is_tspecial              (x)
    #define             camel_mime_is_type                  (x, t)
    #define             camel_mime_is_ttoken                (x)
    #define             camel_mime_is_atom                  (x)
    #define             camel_mime_is_dtext                 (x)
    #define             camel_mime_is_fieldname             (x)
    #define             camel_mime_is_qpsafe                (x)
    #define             camel_mime_is_especial              (x)
    #define             camel_mime_is_psafe                 (x)
    #define             camel_mime_is_attrchar              (x)

## Description

## Details

### CAMEL_FOLD_SIZE

    #define CAMEL_FOLD_SIZE (77)

### CAMEL_FOLD_MAX_SIZE

    #define CAMEL_FOLD_MAX_SIZE (998)

### CAMEL_UUDECODE_STATE_INIT

    #define CAMEL_UUDECODE_STATE_INIT   (0)

### CAMEL_UUDECODE_STATE_BEGIN

    #define CAMEL_UUDECODE_STATE_BEGIN  (1 << 16)

### CAMEL_UUDECODE_STATE_END

    #define CAMEL_UUDECODE_STATE_END    (1 << 17)

### CAMEL_UUDECODE_STATE_MASK

    #define CAMEL_UUDECODE_STATE_MASK   (CAMEL_UUDECODE_STATE_BEGIN | CAMEL_UUDECODE_STATE_END)

### enum CamelTransferEncoding

    typedef enum _CamelTransferEncoding {
    	CAMEL_TRANSFER_ENCODING_DEFAULT,
    	CAMEL_TRANSFER_ENCODING_7BIT,
    	CAMEL_TRANSFER_ENCODING_8BIT,
    	CAMEL_TRANSFER_ENCODING_BASE64,
    	CAMEL_TRANSFER_ENCODING_QUOTEDPRINTABLE,
    	CAMEL_TRANSFER_ENCODING_BINARY,
    	CAMEL_TRANSFER_ENCODING_UUENCODE,
    	CAMEL_TRANSFER_NUM_ENCODINGS
    } CamelTransferEncoding;

### struct camel_header_references

    struct camel_header_references {
    	struct _camel_header_references *next;
    	char *id;
    };

### camel_header_param ()

    char*               camel_header_param                  (struct _camel_header_param *params,
                                                             const char *name);

Searches `params` for a param named `name` and gets the value.

`params` :

  parameters

`name` :

  name of param to find

Returns :

  the value of the `name` param

### CamelContentType

    typedef struct {
    	char *type;
    	char *subtype;
    	struct _camel_header_param *params;
    	unsigned int refcount;
    } CamelContentType;

### struct camel_header_raw

    struct camel_header_raw {
    	struct _camel_header_raw *next;
    	char *name;
    	char *value;
    	int offset;		/* in file, if known */
    };

### CamelContentDisposition

    typedef struct {
    	char *disposition;
    	struct _camel_header_param *params;
    	unsigned int refcount;
    } CamelContentDisposition;

### enum camel_header_address_t

    typedef enum _camel_header_address_t {
    	CAMEL_HEADER_ADDRESS_NONE,	/* uninitialised */
    	CAMEL_HEADER_ADDRESS_NAME,
    	CAMEL_HEADER_ADDRESS_GROUP
    } camel_header_address_t;

### struct camel_header_address

    struct camel_header_address {
    	struct _camel_header_address *next;
    	camel_header_address_t type;
    	char *name;
    	union {
    		char *addr;
    		struct _camel_header_address *members;
    	} v;
    	unsigned int refcount;
    };

### struct camel_header_newsgroup

    struct camel_header_newsgroup {
    	struct _camel_header_newsgroup *next;

    	char *newsgroup;
    };

### camel_header_address_new ()

    struct _camel_header_address* camel_header_address_new  (void);

Returns :

### camel_header_address_new_name ()

    struct _camel_header_address* camel_header_address_new_name
                                                            (const char *name,
                                                             const char *addr);

`name` :

`addr` :

Returns :

### camel_header_address_new_group ()

    struct _camel_header_address* camel_header_address_new_group
                                                            (const char *name);

`name` :

Returns :

### camel_header_address_ref ()

    void                camel_header_address_ref            (struct _camel_header_address *addrlist);

`addrlist` :

### camel_header_address_unref ()

    void                camel_header_address_unref          (struct _camel_header_address *addrlist);

`addrlist` :

### camel_header_address_set_name ()

    void                camel_header_address_set_name       (struct _camel_header_address *addrlist,
                                                             const char *name);

`addrlist` :

`name` :

### camel_header_address_set_addr ()

    void                camel_header_address_set_addr       (struct _camel_header_address *addrlist,
                                                             const char *addr);

`addrlist` :

`addr` :

### camel_header_address_set_members ()

    void                camel_header_address_set_members    (struct _camel_header_address *addrlist,
                                                             struct _camel_header_address *group);

`addrlist` :

`group` :

### camel_header_address_add_member ()

    void                camel_header_address_add_member     (struct _camel_header_address *addrlist,
                                                             struct _camel_header_address *member);

`addrlist` :

`member` :

### camel_header_address_list_append_list ()

    void                camel_header_address_list_append_list
                                                            (struct _camel_header_address **addrlistp,
                                                             struct _camel_header_address **addrs);

`addrlistp` :

`addrs` :

### camel_header_address_list_append ()

    void                camel_header_address_list_append    (struct _camel_header_address **addrlistp,
                                                             struct _camel_header_address *addr);

`addrlistp` :

`addr` :

### camel_header_address_list_clear ()

    void                camel_header_address_list_clear     (struct _camel_header_address **addrlistp);

`addrlistp` :

### camel_header_address_decode ()

    struct _camel_header_address* camel_header_address_decode
                                                            (const char *in,
                                                             const char *charset);

`in` :

`charset` :

Returns :

### camel_header_mailbox_decode ()

    struct _camel_header_address* camel_header_mailbox_decode
                                                            (const char *in,
                                                             const char *charset);

`in` :

`charset` :

Returns :

### camel_header_address_list_encode ()

    char*               camel_header_address_list_encode    (struct _camel_header_address *addrlist);

`addrlist` :

Returns :

### camel_header_address_list_format ()

    char*               camel_header_address_list_format    (struct _camel_header_address *addrlist);

`addrlist` :

Returns :

### camel_header_param_list_decode ()

    struct _camel_header_param* camel_header_param_list_decode
                                                            (const char *in);

`in` :

Returns :

### camel_header_param ()

    char*               camel_header_param                  (struct _camel_header_param *params,
                                                             const char *name);

Searches `params` for a param named `name` and gets the value.

`params` :

  parameters

`name` :

  name of param to find

Returns :

  the value of the `name` param

### camel_header_set_param ()

    struct _camel_header_param* camel_header_set_param      (struct _camel_header_param **paramsp,
                                                             const char *name,
                                                             const char *value);

Set a parameter in the list.

`paramsp` :

  poinetr to a list of params

`name` :

  name of param to set

`value` :

  value to set

Returns :

  the set param

### camel_header_param_list_format_append ()

    void                camel_header_param_list_format_append
                                                            (GString *out,
                                                             struct _camel_header_param *params);

`out` :

`params` :

### camel_header_param_list_format ()

    char*               camel_header_param_list_format      (struct _camel_header_param *params);

`params` :

Returns :

### camel_header_param_list_free ()

    void                camel_header_param_list_free        (struct _camel_header_param *params);

Free the list of params.

`params` :

  a list of params

### camel_content_type_new ()

    CamelContentType*   camel_content_type_new              (const char *type,
                                                             const char *subtype);

Create a new CamelContentType.

`type` :

  the major type of the new content-type

`subtype` :

  the subtype

Returns :

  the new CamelContentType

### camel_content_type_decode ()

    CamelContentType*   camel_content_type_decode           (const char *in);

`in` :

Returns :

### camel_content_type_unref ()

    void                camel_content_type_unref            (CamelContentType *content_type);

Unrefs, and potentially frees, the content type.

`content_type` :

  a CamelContentType

### camel_content_type_ref ()

    void                camel_content_type_ref              (CamelContentType *content_type);

Refs the content type.

`content_type` :

  a CamelContentType

### camel_content_type_param ()

    const char*         camel_content_type_param            (CamelContentType *content_type,
                                                             const char *name);

Searches the params on s CamelContentType for a param named `name` and gets the value.

`content_type` :

  a CamelContentType

`name` :

  name of param to find

Returns :

  the value of the `name` param

### camel_content_type_set_param ()

    void                camel_content_type_set_param        (CamelContentType *content_type,
                                                             const char *name,
                                                             const char *value);

Set a parameter on `content_type`.

`content_type` :

  a CamelContentType

`name` :

  name of param to set

`value` :

  value of param to set

### camel_content_type_is ()

    int                 camel_content_type_is               (CamelContentType *content_type,
                                                             const char *type,
                                                             const char *subtype);

The subtype of "*" will match any subtype. If `ct` is `NULL`, then it will match the type "text/plain".

`content_type` :

  A content type specifier, or `NULL`.

`type` :

  A type to check against.

`subtype` :

  A subtype to check against, or "*" to match any subtype.

Returns :

  %TRUE if the content type `ct` is of type `type`/`subtype` or `FALSE` otherwise

### camel_content_type_format ()

    char*               camel_content_type_format           (CamelContentType *content_type);

`content_type` :

Returns :

### camel_content_type_simple ()

    char*               camel_content_type_simple           (CamelContentType *content_type);

`content_type` :

Returns :

### camel_content_type_dump ()

    void                camel_content_type_dump             (CamelContentType *content_type);

`content_type` :

### camel_content_disposition_decode ()

    CamelContentDisposition* camel_content_disposition_decode
                                                            (const char *in);

`in` :

Returns :

### camel_content_disposition_ref ()

    void                camel_content_disposition_ref       (CamelContentDisposition *disposition);

`disposition` :

### camel_content_disposition_unref ()

    void                camel_content_disposition_unref     (CamelContentDisposition *disposition);

`disposition` :

### camel_content_disposition_format ()

    char*               camel_content_disposition_format    (CamelContentDisposition *disposition);

`disposition` :

Returns :

### camel_content_transfer_encoding_decode ()

    char*               camel_content_transfer_encoding_decode
                                                            (const char *in);

`in` :

Returns :

### camel_header_raw_append ()

    void                camel_header_raw_append             (struct _camel_header_raw **list,
                                                             const char *name,
                                                             const char *value,
                                                             int offset);

`list` :

`name` :

`value` :

`offset` :

### camel_header_raw_append_parse ()

    void                camel_header_raw_append_parse       (struct _camel_header_raw **list,
                                                             const char *header,
                                                             int offset);

`list` :

`header` :

`offset` :

### camel_header_raw_find ()

    const char*         camel_header_raw_find               (struct _camel_header_raw **list,
                                                             const char *name,
                                                             int *offset);

`list` :

`name` :

`offset` :

Returns :

### camel_header_raw_find_next ()

    const char*         camel_header_raw_find_next          (struct _camel_header_raw **list,
                                                             const char *name,
                                                             int *offset,
                                                             const char *last);

`list` :

`name` :

`offset` :

`last` :

Returns :

### camel_header_raw_replace ()

    void                camel_header_raw_replace            (struct _camel_header_raw **list,
                                                             const char *name,
                                                             const char *value,
                                                             int offset);

`list` :

`name` :

`value` :

`offset` :

### camel_header_raw_remove ()

    void                camel_header_raw_remove             (struct _camel_header_raw **list,
                                                             const char *name);

`list` :

`name` :

### camel_header_raw_fold ()

    void                camel_header_raw_fold               (struct _camel_header_raw **list);

`list` :

### camel_header_raw_clear ()

    void                camel_header_raw_clear              (struct _camel_header_raw **list);

`list` :

### camel_header_raw_check_mailing_list ()

    char*               camel_header_raw_check_mailing_list (struct _camel_header_raw **list);

`list` :

Returns :

### camel_header_address_fold ()

    char*               camel_header_address_fold           (const char *in,
                                                             size_t headerlen);

`in` :

`headerlen` :

Returns :

### camel_header_fold ()

    char*               camel_header_fold                   (const char *in,
                                                             size_t headerlen);

`in` :

`headerlen` :

Returns :

### camel_header_unfold ()

    char*               camel_header_unfold                 (const char *in);

`in` :

Returns :

### camel_header_token_decode ()

    char*               camel_header_token_decode           (const char *in);

Gets the first token in the string according to the rules of rfc0822.

`in` :

  input string

Returns :

  a new string containing the first token in `in`

### camel_header_decode_int ()

    int                 camel_header_decode_int             (const char **in);

Extracts an integer token from `in` and updates the pointer to point to after the end of the integer token (sort of like strtol).

`in` :

  pointer to input string

Returns :

  the int value

### camel_header_decode_string ()

    char*               camel_header_decode_string          (const char *in,
                                                             const char *default_charset);

Decodes rfc2047 encoded-word tokens

`in` :

  input header value string

`default_charset` :

  default charset to use if improperly encoded

Returns :

  a string containing the UTF-8 version of the decoded header value

### camel_header_encode_string ()

    char*               camel_header_encode_string          (unsigned char *in);

Encodes a 'text' header according to the rules of rfc2047.

`in` :

  input string

Returns :

  the rfc2047 encoded header

### camel_header_format_ctext ()

    char*               camel_header_format_ctext           (const char *in,
                                                             const char *default_charset);

Decodes a header which contains rfc2047 encoded-word tokens that may or may not be within a comment.

`in` :

  input header value string

`default_charset` :

  default charset to use if improperly encoded

Returns :

  a string containing the UTF-8 version of the decoded header value

### camel_header_encode_phrase ()

    char*               camel_header_encode_phrase          (unsigned char *in);

Encodes a 'phrase' header according to the rules in rfc2047.

`in` :

  header to encode

Returns :

  the encoded 'phrase'

### camel_header_decode_date ()

    time_t              camel_header_decode_date            (const char *in,
                                                             int *saveoffset);

`in` :

`saveoffset` :

Returns :

### camel_header_format_date ()

    char*               camel_header_format_date            (time_t time,
                                                             int offset);

`time` :

`offset` :

Returns :

### camel_header_msgid_decode ()

    char*               camel_header_msgid_decode           (const char *in);

Extract a message-id token from `in`.

`in` :

  input string

Returns :

  the msg-id

### camel_header_contentid_decode ()

    char*               camel_header_contentid_decode       (const char *in);

Extract a content-id from `in`.

`in` :

  input string

Returns :

  the extracted content-id

### camel_header_msgid_generate ()

    char*               camel_header_msgid_generate         (void);

Returns :

### camel_header_references_inreplyto_decode ()

    struct _camel_header_references* camel_header_references_inreplyto_decode
                                                            (const char *in);

`in` :

Returns :

### camel_header_references_decode ()

    struct _camel_header_references* camel_header_references_decode
                                                            (const char *in);

`in` :

Returns :

### camel_header_references_list_clear ()

    void                camel_header_references_list_clear  (struct _camel_header_references **list);

`list` :

### camel_header_references_list_append_asis ()

    void                camel_header_references_list_append_asis
                                                            (struct _camel_header_references **list,
                                                             char *ref);

`list` :

`ref` :

### camel_header_references_list_size ()

    int                 camel_header_references_list_size   (struct _camel_header_references **list);

`list` :

Returns :

### camel_header_references_dup ()

    struct _camel_header_references* camel_header_references_dup
                                                            (const struct _camel_header_references *list);

`list` :

Returns :

### camel_header_location_decode ()

    char*               camel_header_location_decode        (const char *in);

`in` :

Returns :

### camel_header_newsgroups_decode ()

    struct _camel_header_newsgroup* camel_header_newsgroups_decode
                                                            (const char *in);

`in` :

Returns :

### camel_header_newsgroups_free ()

    void                camel_header_newsgroups_free        (struct _camel_header_newsgroup *ng);

`ng` :

### camel_transfer_encoding_to_string ()

    const char*         camel_transfer_encoding_to_string   (CamelTransferEncoding encoding);

`encoding` :

Returns :

### camel_transfer_encoding_from_string ()

    CamelTransferEncoding camel_transfer_encoding_from_string
                                                            (const char *string);

`string` :

Returns :

### camel_header_mime_decode ()

    void                camel_header_mime_decode            (const char *in,
                                                             int *maj,
                                                             int *min);

`in` :

`maj` :

`min` :

### camel_base64_decode_step ()

    size_t              camel_base64_decode_step            (unsigned char *in,
                                                             size_t len,
                                                             unsigned char *out,
                                                             int *state,
                                                             unsigned int *save);

`camel_base64_decode_step` is deprecated and should not be used in newly-written code.

Decodes a chunk of base64 encoded data

`in` :

  input stream

`len` :

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

### camel_base64_encode_step ()

    size_t              camel_base64_encode_step            (unsigned char *in,
                                                             size_t len,
                                                             gboolean break_lines,
                                                             unsigned char *out,
                                                             int *state,
                                                             int *save);

`camel_base64_encode_step` is deprecated and should not be used in newly-written code.

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

`len` :

`break_lines` :

  break long lines

`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

### camel_base64_encode_close ()

    size_t              camel_base64_encode_close           (unsigned char *in,
                                                             size_t len,
                                                             gboolean break_lines,
                                                             unsigned char *out,
                                                             int *state,
                                                             int *save);

`camel_base64_encode_close` is deprecated and should not be used in newly-written code.

Base64 encodes the input stream to the output stream. Call this when finished encoding data with camel_base64_encode_step to flush off the last little bit.

`in` :

  input stream

`len` :

`break_lines` :

  whether or not to break long lines

`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

### camel_uudecode_step ()

    size_t              camel_uudecode_step                 (unsigned char *in,
                                                             size_t len,
                                                             unsigned char *out,
                                                             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.

`in` :

  input stream

`len` :

`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

### camel_uuencode_step ()

    size_t              camel_uuencode_step                 (unsigned char *in,
                                                             size_t len,
                                                             unsigned char *out,
                                                             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).

`in` :

  input stream

`len` :

  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

### camel_uuencode_close ()

    size_t              camel_uuencode_close                (unsigned char *in,
                                                             size_t len,
                                                             unsigned char *out,
                                                             unsigned char *uubuf,
                                                             int *state,
                                                             guint32 *save);

Uuencodes a chunk of data. Call this when finished encoding data with camel_uuencode_step to flush off the last little bit.

`in` :

  input stream

`len` :

  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

### camel_quoted_decode_step ()

    size_t              camel_quoted_decode_step            (unsigned char *in,
                                                             size_t len,
                                                             unsigned char *out,
                                                             int *savestate,
                                                             int *saveme);

Decodes a block of quoted-printable encoded data. Performs a 'decode step' on a chunk of QP encoded data.

`in` :

  input stream

`len` :

  max length of data to decode

`out` :

  output stream

`savestate` :

  holds the number of bits that are stored in `save`

`saveme` :

Returns :

  the number of bytes decoded

### camel_quoted_encode_step ()

    size_t              camel_quoted_encode_step            (unsigned char *in,
                                                             size_t len,
                                                             unsigned char *out,
                                                             int *state,
                                                             int *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).

`in` :

  input stream

`len` :

  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

### camel_quoted_encode_close ()

    size_t              camel_quoted_encode_close           (unsigned char *in,
                                                             size_t len,
                                                             unsigned char *out,
                                                             int *state,
                                                             int *save);

Quoted-printable encodes a block of text. Call this when finished encoding data with camel_quoted_encode_step to flush off the last little bit.

`in` :

  input stream

`len` :

  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

### camel_base64_encode_simple ()

    char*               camel_base64_encode_simple          (const char *data,
                                                             size_t len);

`camel_base64_encode_simple` is deprecated and should not be used in newly-written code.

Base64 encodes a block of memory.

`data` :

  binary stream of data to encode

`len` :

  length of data

Returns :

  a string containing the base64 encoded data

### camel_base64_decode_simple ()

    size_t              camel_base64_decode_simple          (char *data,
                                                             size_t len);

`camel_base64_decode_simple` is deprecated and should not be used in newly-written code.

Base64 decodes `data` inline (overwrites `data` with the decoded version).

`data` :

  data to decode

`len` :

  length of data

Returns :

  the new length of `data`

### camel_mime_is_ctrl()

    #define camel_mime_is_ctrl(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_CTRL) != 0)

`x` :

### camel_mime_is_lwsp()

    #define camel_mime_is_lwsp(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_LWSP) != 0)

`x` :

### camel_mime_is_tspecial()

    #define camel_mime_is_tspecial(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_TSPECIAL) != 0)

`x` :

### camel_mime_is_type()

    #define camel_mime_is_type(x, t) ((camel_mime_special_table[(unsigned char)(x)] & (t)) != 0)

`x` :

`t` :

### camel_mime_is_ttoken()

    #define camel_mime_is_ttoken(x) ((camel_mime_special_table[(unsigned char)(x)] & (CAMEL_MIME_IS_TSPECIAL|CAMEL_MIME_IS_LWSP|CAMEL_MIME_IS_CTRL)) == 0)

`x` :

### camel_mime_is_atom()

    #define camel_mime_is_atom(x) ((camel_mime_special_table[(unsigned char)(x)] & (CAMEL_MIME_IS_SPECIAL|CAMEL_MIME_IS_SPACE|CAMEL_MIME_IS_CTRL)) == 0)

`x` :

### camel_mime_is_dtext()

    #define camel_mime_is_dtext(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_DSPECIAL) == 0)

`x` :

### camel_mime_is_fieldname()

    #define camel_mime_is_fieldname(x) ((camel_mime_special_table[(unsigned char)(x)] & (CAMEL_MIME_IS_CTRL|CAMEL_MIME_IS_SPACE)) == 0)

`x` :

### camel_mime_is_qpsafe()

    #define camel_mime_is_qpsafe(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_QPSAFE) != 0)

`x` :

### camel_mime_is_especial()

    #define camel_mime_is_especial(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_ESPECIAL) != 0)

`x` :

### camel_mime_is_psafe()

    #define camel_mime_is_psafe(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_PSAFE) != 0)

`x` :

### camel_mime_is_attrchar()

    #define camel_mime_is_attrchar(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_ATTRCHAR) != 0)

`x` :