2 * Copyright notice from original mutt:
3 * Copyright (C) 1998 Brandon Long <blong@fiction.net>
4 * Copyright (C) 1999 Andrej Gritsenko <andrej@lucky.net>
5 * Copyright (C) 2000-2002 Vsevolod Volkov <vvv@mutt.org.ua>
7 * This file is part of mutt-ng, see http://www.muttng.org/.
8 * It's licensed under the GNU General Public License,
9 * please see the file GPL in the top level source directory.
15 #include <lib-sys/mutt_socket.h>
16 #include <lib-mx/mx.h>
18 extern mx_t const nntp_mx;
21 #define NNTP_SSL_PORT 563
23 /* number of entries in the hash table */
24 #define NNTP_CACHE_LEN 10
38 unsigned feat_known : 1;
40 unsigned hasXGTITLE : 1;
41 unsigned hasXOVER : 1;
42 unsigned hasLISTGROUP : 1;
49 time_t newgroups_time;
52 string_list_t *list; /* list of newsgroups */
53 string_list_t **tail; /* last entry of list */
63 NEWSRC_ENTRY *entries;
64 int num; /* number of used entries */
65 int max; /* number of allocated entries */
71 unsigned subscribed:1;
80 NNTP_CACHE acache[NNTP_CACHE_LEN];
83 /* internal functions */
84 int nntp_get_active (NNTP_SERVER *);
85 int nntp_get_cache_all (NNTP_SERVER *);
86 int nntp_save_cache_index (NNTP_SERVER *);
87 int nntp_check_newgroups (NNTP_SERVER *, int);
88 int nntp_save_cache_group (CONTEXT *);
89 int nntp_parse_url (const char *, ACCOUNT *, char *, ssize_t);
90 void newsrc_gen_entries (CONTEXT *);
91 void nntp_get_status (CONTEXT *, HEADER *, char *, int);
92 void mutt_newsgroup_stat (NNTP_DATA *);
93 void nntp_delete_cache (NNTP_DATA *);
94 void nntp_add_to_list (NNTP_SERVER *, NNTP_DATA *);
95 void nntp_cache_expand (char *, const char *);
96 void nntp_delete_data (void *);
98 /* exposed interface */
99 NNTP_SERVER *mutt_select_newsserver (char *);
100 NNTP_DATA *mutt_newsgroup_subscribe (NNTP_SERVER *, char *);
101 NNTP_DATA *mutt_newsgroup_unsubscribe (NNTP_SERVER *, char *);
102 NNTP_DATA *mutt_newsgroup_catchup (NNTP_SERVER *, char *);
103 NNTP_DATA *mutt_newsgroup_uncatchup (NNTP_SERVER *, char *);
104 void nntp_clear_cacheindex (NNTP_SERVER *);
105 int mutt_newsrc_update (NNTP_SERVER *);
106 int nntp_close_mailbox (CONTEXT *);
107 int nntp_fetch_message (MESSAGE *, CONTEXT *, int);
108 int nntp_post (const char *);
109 int nntp_check_msgid (CONTEXT *, const char *);
110 int nntp_check_children (CONTEXT *, const char *);
111 void nntp_buffy (char* dst, ssize_t dstlen);
112 void nntp_expand_path (char *, ssize_t, ACCOUNT *);
113 void nntp_logout_all(void);
114 const char *nntp_format_str(char *, ssize_t, char, const char *, const char *,
115 const char *, const char *, anytype, format_flag);
116 void nntp_sync_sidebar (NNTP_DATA*);
118 WHERE NNTP_SERVER *CurrentNewsSrv INITVAL (NULL);
120 #endif /* _NNTP_H_ */