#include <mailutils/mime.h> int mu_mime_add_part(mu_mime_t mime, mu_message_t msg); int mu_mime_create(mu_mime_t *mime,mu_message_t msg, int flags); void mu_mime_destroy(mu_mime_t *mime); int mu_mime_get_message(mu_mime_t mime, mu_message_t *msg); int mu_mime_get_num_parts(mu_mime_t *mime,size_t *nparts); int mu_mime_get_part(mu_mime_t mime, size_t part, mu_message_t *msg); int mu_mime_is_multipart(mu_mime_t *mime);
typedef _mu_mime_t *mu_mime_t;
This is an opaque data structure. None of the fields should be accessed by a user program.
int mu_mime_add_part(mu_mime_t mime, mu_message_t msg);
Appends msg to the end of the mime message. The function returns 0 if successful or an error code.
int mu_mime_create(mu_mime_t *mime,mu_message_t msg, int flags);
Creates a new mime message. The argument flags can be constructed from MU_MIME_MULTIPART_MIXED or MU_MIME_MULTIPART_ALT. Passing NULL as the msg argument creates a new mime message to which additional items can be added using the mu_mime_add_part function. The function returns 0 if successful or an error code.
void mu_mime_destroy(mu_mime_t *mime);
Releases all the resources associates with the message.
int mu_mime_get_message(mu_mime_t mime, mu_message_t *msg);
Converts the mime message into a message which can be manipulated by the mu_message_* functions. The function returns 0 if successful or an error code.
int mu_mime_get_num_parts(mu_mime_t *mime,size_t *nparts);
Returns the number of parts in the mime message. The function returns 0 if successful or an error code.
int mu_mime_get_part(mu_mime_t mime, size_t part, mu_message_t *msg);
Returns the part'th part of the message. Numbering starts at 1. The function returns 0 if successful or an error code.
int mu_mime_is_multipart(mu_mime_t *mime);
Returns 1 if the message has the content type multipart/digest.