1 /**
2 * @file
3 * Nntp-specific Email data
4 *
5 * @authors
6 * Copyright (C) 2021 Richard Russon <rich@flatcap.org>
7 *
8 * @copyright
9 * This program is free software: you can redistribute it and/or modify it under
10 * the terms of the GNU General Public License as published by the Free Software
11 * Foundation, either version 2 of the License, or (at your option) any later
12 * version.
13 *
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License along with
20 * this program. If not, see <http://www.gnu.org/licenses/>.
21 */
22
23 /**
24 * @page nntp_edata Nntp-specific Email data
25 *
26 * Nntp-specific Email data
27 */
28
29 #include "config.h"
30 #include <stddef.h>
31 #include "mutt/lib.h"
32 #include "email/lib.h"
33 #include "edata.h"
34
35 /**
36 * nntp_edata_free - Free the private Email data - Implements Email::edata_free()
37 */
nntp_edata_free(void ** ptr)38 void nntp_edata_free(void **ptr)
39 {
40 // struct NntpEmailData *edata = *ptr;
41 FREE(ptr);
42 }
43
44 /**
45 * nntp_edata_new - Create a new NntpEmailData for an Email
46 * @retval ptr New NntpEmailData struct
47 */
nntp_edata_new(void)48 struct NntpEmailData *nntp_edata_new(void)
49 {
50 return mutt_mem_calloc(1, sizeof(struct NntpEmailData));
51 }
52
53 /**
54 * nntp_edata_get - Get the private data for this Email
55 * @param e Email
56 * @retval ptr Private Email data
57 */
nntp_edata_get(struct Email * e)58 struct NntpEmailData *nntp_edata_get(struct Email *e)
59 {
60 if (!e)
61 return NULL;
62 return e->edata;
63 }
64