Representation of an email. More...
#include "config.h"
#include <stdbool.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. More... | |
void | email_free (struct Email **ptr) |
Free an Email. More... | |
struct Email * | email_new (void) |
Create a new Email. More... | |
bool | email_cmp_strict (const struct Email *e1, const struct Email *e2) |
Strictly compare message emails. More... | |
size_t | email_size (const struct Email *e) |
compute the size of an email More... | |
void | emaillist_clear (struct EmailList *el) |
Drop a private list of Emails. More... | |
int | emaillist_add_email (struct EmailList *el, struct Email *e) |
Add an Email to a list. More... | |
struct ListNode * | header_find (const struct ListHead *hdrlist, const char *header) |
Find a header, matching on its field, in a list of headers. More... | |
struct ListNode * | header_add (struct ListHead *hdrlist, const char *header) |
Add a header to a list. More... | |
struct ListNode * | header_update (struct ListNode *hdr, const char *header) |
Update an existing header. More... | |
struct ListNode * | header_set (struct ListHead *hdrlist, const char *header) |
Set a header value in a list. More... | |
void | header_free (struct ListHead *hdrlist, struct ListNode *target) |
Free and remove a header from a header list. More... | |
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 | ) |
Free data attached to an Email.
[out] | ptr | Email data |
Each email has an attached NmEmailData, which contains things like the tags (labels).
Definition at line 251 of file notmuch.c.
void email_free | ( | struct Email ** | ptr | ) |
Free an Email.
[out] | ptr | Email to free |
Definition at line 43 of file email.c.
struct Email* email_new | ( | void | ) |
Create a new Email.
ptr | Newly created Email |
Definition at line 72 of file email.c.
Strictly compare message emails.
true | Emails are strictly identical |
Definition at line 92 of file email.c.
size_t email_size | ( | const struct Email * | e | ) |
void emaillist_clear | ( | struct EmailList * | el | ) |
int emaillist_add_email | ( | struct EmailList * | el, |
struct Email * | e | ||
) |
Add an Email to a list.
e | Email to add |
el | EmailList to add to |
0 | Success |
-1 | Error |
Definition at line 151 of file email.c.
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 |
node | The node in the list matching the header |
NULL | If no matching header is found |
The header should either of the form "X-Header:" or "X-Header: value"
Definition at line 172 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 |
node | The created header |
Definition at line 195 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 |
node | The updated or created header |
If a header exists with the same field, update it, otherwise add a new header.
Definition at line 225 of file email.c.