Mstdlib-1.24.0
|
Enumerations | |
enum | M_email_simple_read_flags_t { M_EMAIL_SIMPLE_READ_NONE = 0 } |
Functions | |
M_email_error_t | M_email_simple_read (M_email_t **email, const char *data, size_t data_len, M_uint32 flags, size_t *len_read) |
M_email_error_t | M_email_simple_read_parser (M_email_t **email, M_parser_t *parser, M_uint32 flags) |
Reads a full email. Useful for small messages. Alls all data is contained within an email object for easy processing.
M_email_error_t M_email_simple_read | ( | M_email_t ** | email, |
const char * | data, | ||
size_t | data_len, | ||
M_uint32 | flags, | ||
size_t * | len_read | ||
) |
Read the next email from the given buffer, store results in a new M_email_t object.
Will return M_EMAIL_ERROR_MOREDATA if we need to wait for more data to get a complete email.
[out] | Place to store new M_email_t object. Can be NULL to check for valid email. Will only be set on M_EMAIL_ERROR_SUCCESS, and M_EMAIL_ERROR_SUCCESS_MORE_POSSIBLE. | |
[in] | data | Buffer containing EMAIL messages to read. |
[in] | data_len | Length of data. |
[in] | flags | Read options (OR'd combo of M_email_simple_read_flags_t). |
[in] | len_read | Num bytes consumed from data (may be NULL, if caller doesn't need this info). Will be set on error indicating the location in the email that generated the error. |
M_email_error_t M_email_simple_read_parser | ( | M_email_t ** | email, |
M_parser_t * | parser, | ||
M_uint32 | flags | ||
) |
Read the next email from the given parser.
Will return M_EMAIL_ERROR_MOREDATA if we need to wait for more data to get a complete email. No data will be dropped from the parser, in this case.
On all other return values the parser will advance and data consumed. On a hard ERROR condition the parser will start at the point of the error. If this is undesirable, the parser should be marked and rewound after this function is called.
[out] | Place to store new M_email_t object. Can be NULL to check for valid email. Will only be set on M_EMAIL_ERROR_SUCCESS, and M_EMAIL_ERROR_SUCCESS_MORE_POSSIBLE. | |
[in] | parser | Buffer containing messages to read. |
[in] | flags | Read options (OR'd combo of M_email_simple_read_flags_t). |