Mstdlib-1.24.0
Email Simple Reader

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)
 

Detailed Description

Reads a full email. Useful for small messages. Alls all data is contained within an email object for easy processing.

Enumeration Type Documentation

◆ M_email_simple_read_flags_t

Enumerator
M_EMAIL_SIMPLE_READ_NONE 

Function Documentation

◆ M_email_simple_read()

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.

Parameters
[out]emailPlace 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]dataBuffer containing EMAIL messages to read.
[in]data_lenLength of data.
[in]flagsRead options (OR'd combo of M_email_simple_read_flags_t).
[in]len_readNum 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.
Returns
Response code.
See also
M_email_reader_read
M_email_simple_read_parser

◆ M_email_simple_read_parser()

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.

Parameters
[out]emailPlace 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]parserBuffer containing messages to read.
[in]flagsRead options (OR'd combo of M_email_simple_read_flags_t).
Returns
Response code.
See also
M_email_reader_read
M_email_simple_read