Manipulating MiniMIME contexts | |
MM_CTX * | mm_context_new (void) |
void | mm_context_free (MM_CTX *ctx) |
int | mm_context_attachpart (MM_CTX *ctx, struct mm_mimepart *part) |
int | mm_context_attachpart_after (MM_CTX *ctx, struct mm_mimepart *part, int pos) |
int | mm_context_deletepart (MM_CTX *ctx, int which, int freemem) |
int | mm_context_countparts (MM_CTX *ctx) |
mm_mimepart * | mm_context_getpart (MM_CTX *ctx, int which) |
int | mm_context_iscomposite (MM_CTX *ctx) |
int | mm_context_haswarnings (MM_CTX *ctx) |
int | mm_context_generateboundary (MM_CTX *ctx) |
int | mm_context_setpreamble (MM_CTX *ctx, char *preamble) |
char * | mm_context_getpreamble (MM_CTX *ctx) |
int | mm_context_flatten (MM_CTX *ctx, char **flat, size_t *length, int flags) |
int mm_context_attachpart | ( | MM_CTX * | ctx, | |
struct mm_mimepart * | part | |||
) |
Attaches a MIME part object to a MiniMIME context.
ctx | the MiniMIME context | |
part | the MIME part object to attach |
The MIME part should be initialized before attaching it using mm_mimepart_new().
int mm_context_attachpart_after | ( | MM_CTX * | ctx, | |
struct mm_mimepart * | part, | |||
int | pos | |||
) |
Attaches a MIME part object to a MiniMIME context at a given position
ctx | A valid MiniMIME context | |
part | The MIME part object to attach | |
pos | After which part to attach the object |
int mm_context_countparts | ( | MM_CTX * | ctx | ) |
Counts the number of attached MIME part objects in a given MiniMIME context
ctx | The MiniMIME context |
int mm_context_deletepart | ( | MM_CTX * | ctx, | |
int | which, | |||
int | freemem | |||
) |
Deletes a MIME part object from a MiniMIME context
ctx | A valid MiniMIME context object | |
which | The number of the MIME part object to delete | |
freemem | Whether to free the memory associated with the MIME part object |
int mm_context_flatten | ( | MM_CTX * | ctx, | |
char ** | flat, | |||
size_t * | length, | |||
int | flags | |||
) |
Creates an ASCII message of the specified context
ctx | A valid MiniMIME context object | |
flat | Where to store the message | |
flags | Flags that affect the flattening process |
Great care is taken to not produce invalid MIME output.
void mm_context_free | ( | MM_CTX * | ctx | ) |
Releases a MiniMIME context object
ctx | A valid MiniMIME context |
int mm_context_generateboundary | ( | MM_CTX * | ctx | ) |
Generates a generic boundary string for a given context
ctx | A valid MiniMIME context |
struct mm_mimepart* mm_context_getpart | ( | MM_CTX * | ctx, | |
int | which | |||
) |
Gets a specified MIME part object from a MimeMIME context
ctx | The MiniMIME context | |
which | The number of the MIME part object to retrieve |
int mm_context_haswarnings | ( | MM_CTX * | ctx | ) |
Checks whether there are any warnings associated with a given context
ctx | A valid MiniMIME context |
int mm_context_iscomposite | ( | MM_CTX * | ctx | ) |
Checks whether a given context represents a composite (multipart) message
ctx | A valid MiniMIME context object |
MM_CTX* mm_context_new | ( | void | ) |
Creates a new MiniMIME context object.
Before a context can be created, the MiniMIME library needs to be initialized properly using mm_library_init().
int mm_context_setpreamble | ( | MM_CTX * | ctx, | |
char * | preamble | |||
) |
Sets a preamble for the given MiniMIME context
ctx | A valid MiniMIME context | |
preamble | The preamble to set |