Representation of an email. More...
#include "config.h"
#include <stdbool.h>
#include <string.h>
#include "mutt/lib.h"
#include "email.h"
#include "body.h"
#include "envelope.h"
#include "tags.h"
Go to the source code of this file.
Functions | |
void | nm_edata_free (void **ptr) |
Free data attached to an Email. | |
void | email_free (struct Email **ptr) |
Free an Email. | |
struct Email * | email_new (void) |
Create a new Email. | |
bool | email_cmp_strict (const struct Email *e1, const struct Email *e2) |
Strictly compare message emails. | |
size_t | email_size (const struct Email *e) |
Compute the size of an email. | |
struct ListNode * | header_find (const struct ListHead *hdrlist, const char *header) |
Find a header, matching on its field, in a list of headers. | |
struct ListNode * | header_add (struct ListHead *hdrlist, const char *header) |
Add a header to a list. | |
struct ListNode * | header_update (struct ListNode *hdr, const char *header) |
Update an existing header. | |
struct ListNode * | header_set (struct ListHead *hdrlist, const char *header) |
Set a header value in a list. | |
void | header_free (struct ListHead *hdrlist, struct ListNode *target) |
Free and remove a header from a header list. | |
Representation of an email.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file email.c.
void nm_edata_free | ( | void ** | ptr | ) |
void email_free | ( | struct Email ** | ptr | ) |
Free an Email.
[out] | ptr | Email to free |
Definition at line 46 of file email.c.
struct Email * email_new | ( | void | ) |
Create a new Email.
ptr | Newly created Email |
Definition at line 77 of file email.c.
Strictly compare message emails.
true | Emails are strictly identical |
Definition at line 96 of file email.c.
size_t email_size | ( | const struct Email * | e | ) |
struct ListNode * header_find | ( | const struct ListHead * | hdrlist, |
const char * | header | ||
) |
Find a header, matching on its field, in a list of headers.
hdrlist | List of headers to search |
header | The header to search for |
ptr | The node in the list matching the header |
NULL | No matching header is found |
The header should either of the form "X-Header:" or "X-Header: value"
Definition at line 137 of file email.c.
struct ListNode * header_add | ( | struct ListHead * | hdrlist, |
const char * | header | ||
) |
Add a header to a list.
hdrlist | List of headers to search |
header | String to set as the header |
ptr | The created header |
Definition at line 160 of file email.c.
struct ListNode * header_set | ( | struct ListHead * | hdrlist, |
const char * | header | ||
) |
Set a header value in a list.
hdrlist | List of headers to search |
header | String to set the value of the header to |
ptr | The updated or created header |
If a header exists with the same field, update it, otherwise add a new header.
Definition at line 190 of file email.c.
void header_free | ( | struct ListHead * | hdrlist, |
struct ListNode * | target | ||
) |