1 /**
2  * @file
3  * Nntp-specific Account 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 #ifndef MUTT_NNTP_ADATA_H
24 #define MUTT_NNTP_ADATA_H
25 
26 #include <stdbool.h>
27 #include <stdio.h>
28 #include <sys/types.h>
29 
30 struct Connection;
31 struct Mailbox;
32 
33 /**
34  * struct NntpAccountData - NNTP-specific Account data - @extends Account
35  */
36 struct NntpAccountData
37 {
38   bool hasCAPABILITIES    : 1; ///< Server supports CAPABILITIES command
39   bool hasSTARTTLS        : 1; ///< Server supports STARTTLS command
40   bool hasDATE            : 1; ///< Server supports DATE command
41   bool hasLIST_NEWSGROUPS : 1; ///< Server supports LIST_NEWSGROUPS command
42   bool hasXGTITLE         : 1; ///< Server supports XGTITLE command
43   bool hasLISTGROUP       : 1; ///< Server supports LISTGROUP command
44   bool hasLISTGROUPrange  : 1; ///< Server supports LISTGROUPrange command
45   bool hasOVER            : 1; ///< Server supports OVER command
46   bool hasXOVER           : 1; ///< Server supports XOVER command
47   unsigned int use_tls    : 3;
48   unsigned int status     : 3;
49   bool cacheable          : 1;
50   bool newsrc_modified    : 1;
51   FILE *fp_newsrc;
52   char *newsrc_file;
53   char *authenticators;
54   char *overview_fmt;
55   off_t size;
56   time_t mtime;
57   time_t newgroups_time;
58   time_t check_time;
59   unsigned int groups_num;
60   unsigned int groups_max;
61   void **groups_list;
62   struct HashTable *groups_hash;
63   struct Connection *conn; ///< Connection to NNTP Server
64 };
65 
66 void                    nntp_adata_free(void **ptr);
67 struct NntpAccountData *nntp_adata_get (struct Mailbox *m);
68 struct NntpAccountData *nntp_adata_new (struct Connection *conn);
69 
70 #endif /* MUTT_NNTP_ADATA_H */
71