immd_mime_decode - Decodes a MIME message
#include <imta.h>
immd_mime_decode(immd_t md, void *param, void (*output_header)(), void (*output_line)(), void (*output_block)());
immd_mime_decode() may be used to decode a MIME message being dequeued with the dequeue context md. An example program illustrating the use of this routine is given by the file decode_mime_messages.c.
The message being dequeued must have its read point positioned at the start of the message's outer header. This will be the case immediately after having retrieved the entire list of recipients, or, after immd_get_recipient() has returned 1, or immediately after calling immd_rewind().
The procedures referenced by output_header, output_line, and output_block have the form:
int output_header(void *param, imhdr_t hdr, int part, int depth, int index);
int output_line(void *param, const char *line, int line_len);
int output_block(void *param, const char *data, int data_len);
The arguments are as follows:
N has an index value of 2, etc.
These routines should return a value of IMTARC_OK if there is more data to read and IMTARC_EOF if there is an error or no further data to read.
immd_mime_decode() return IMRC_OK when successful, and one of the following error codes otherwise.
A textual explanation of the failure can be obtained by calling imta_error() immediately afterwards.
_______________________________________
immd_init(3) , immd_rewind(3) , immd_get_recipient(3)