ec_message_get_headers

March 26, 2020 Contributors

Name

ec_message_get_headers — Returns an rfc2822_context struct which stores the headers for the message part

Synopsis

#include "message.h"

| rfc2822_context * **ec_message_get_headers** ( | part, |   |
|   | for_read); |   |

ec_message_part * <var class="pdparam">part</var>;
int <var class="pdparam">for_read</var>;

Description

Returns an rfc2822_context struct which stores the headers for the message part.

Parameters

part

A pointer to an ec_message_part struct. For documentation of this data structure see “ec_message_part”

for_read

An integer value. If for_read is 1 (non-zero), then the address of the headers in an rfc2822_context struct within the ec_message_part is returned. If for_read is passed 0, then a clone of the headers is allocated and that address returned.

Return Values

This function returns the address of an rfc2822_context struct. The rfc2822_context is passed by reference. It is valid until the message part is freed (either directly or indirectly by the message itself being freed). Any modifications made to the rfc2822_context must be noted in the message part with ec_message_part_touch. For documentation of this data structure see “rfc2822_context”

Threading

It is legal to call this function in any thread.

See Also

ec_message_render_headers_to_string, ec_message_part_touch