1 /** 2 * @file 3 * Usenet network mailbox type; talk to an NNTP server 4 * 5 * @authors 6 * Copyright (C) 2018 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_PRIVATE_H 24 #define MUTT_NNTP_PRIVATE_H 25 26 #include <stdbool.h> 27 #include <stdint.h> 28 #include "lib.h" 29 30 struct Email; 31 struct HeaderCache; 32 struct Mailbox; 33 struct NntpAccountData; 34 struct NntpMboxData; 35 36 #define NNTP_PORT 119 37 #define NNTP_SSL_PORT 563 38 39 /** 40 * enum NntpStatus - NNTP server return values 41 */ 42 enum NntpStatus 43 { 44 NNTP_NONE = 0, ///< No connection to server 45 NNTP_OK, ///< Connected to server 46 NNTP_BYE, ///< Disconnected from server 47 }; 48 49 void nntp_acache_free (struct NntpMboxData *mdata); 50 int nntp_active_save_cache (struct NntpAccountData *adata); 51 int nntp_add_group (char *line, void *data); 52 void nntp_article_status (struct Mailbox *m, struct Email *e, char *group, anum_t anum); 53 void nntp_bcache_update (struct NntpMboxData *mdata); 54 int nntp_check_new_groups (struct Mailbox *m, struct NntpAccountData *adata); 55 void nntp_delete_group_cache(struct NntpMboxData *mdata); 56 void nntp_group_unread_stat (struct NntpMboxData *mdata); 57 void nntp_hash_destructor_t (int type, void *obj, intptr_t data); 58 void nntp_hashelem_free (int type, void *obj, intptr_t data); 59 struct HeaderCache * nntp_hcache_open (struct NntpMboxData *mdata); 60 void nntp_hcache_update (struct NntpMboxData *mdata, struct HeaderCache *hc); 61 void nntp_newsrc_gen_entries(struct Mailbox *m); 62 int nntp_open_connection (struct NntpAccountData *adata); 63 64 #endif /* MUTT_NNTP_PRIVATE_H */ 65