Mime Messages

#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);

mu_mime_t

typedef _mu_mime_t *mu_mime_t;

This is an opaque data structure. None of the fields should be accessed by a user program.

mu_mime_add_part

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.

mu_mime_create

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.

mu_mime_destroy

void mu_mime_destroy(mu_mime_t *mime);

Releases all the resources associates with the message.

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

mu_mime_get_num_parts

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.

mu_mime_get_part

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.

mu_mime_is_multipart

int mu_mime_is_multipart(mu_mime_t *mime);

Returns 1 if the message has the content type multipart/digest.

 
mime.txt · Last modified: 2009/07/02 16:17 by admin
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki