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 "mutt_socket.h"
21 #define NNTP_SSL_PORT 563
23 /* number of entries in the hash table */
24 #define NNTP_CACHE_LEN 10
38 unsigned int hasXPAT:1;
39 unsigned int hasXGTITLE:1;
40 unsigned int hasXOVER:1;
41 unsigned int hasLISTGROUP:1;
42 unsigned int status:3;
48 time_t newgroups_time;
51 LIST *list; /* list of newsgroups */
52 LIST *tail; /* last entry of list */
62 NEWSRC_ENTRY *entries;
63 unsigned int num; /* number of used entries */
64 unsigned int max; /* number of allocated entries */
66 unsigned int firstMessage;
67 unsigned int lastMessage;
68 unsigned int lastLoaded;
69 unsigned int lastCached;
70 unsigned int subscribed:1;
73 unsigned int allowed:1;
74 unsigned int deleted:1;
79 NNTP_CACHE acache[NNTP_CACHE_LEN];
82 /* internal functions */
83 int nntp_get_active (NNTP_SERVER *);
84 int nntp_get_cache_all (NNTP_SERVER *);
85 int nntp_save_cache_index (NNTP_SERVER *);
86 int nntp_check_newgroups (NNTP_SERVER *, int);
87 int nntp_save_cache_group (CONTEXT *);
88 int nntp_parse_url (const char *, ACCOUNT *, char *, size_t);
89 void newsrc_gen_entries (CONTEXT *);
90 void nntp_get_status (CONTEXT *, HEADER *, char *, int);
91 void mutt_newsgroup_stat (NNTP_DATA *);
92 void nntp_delete_cache (NNTP_DATA *);
93 void nntp_add_to_list (NNTP_SERVER *, NNTP_DATA *);
94 void nntp_cache_expand (char *, const char *);
95 void nntp_delete_data (void *);
97 /* exposed interface */
98 NNTP_SERVER *mutt_select_newsserver (char *);
99 NNTP_DATA *mutt_newsgroup_subscribe (NNTP_SERVER *, char *);
100 NNTP_DATA *mutt_newsgroup_unsubscribe (NNTP_SERVER *, char *);
101 NNTP_DATA *mutt_newsgroup_catchup (NNTP_SERVER *, char *);
102 NNTP_DATA *mutt_newsgroup_uncatchup (NNTP_SERVER *, char *);
103 void nntp_clear_cacheindex (NNTP_SERVER *);
104 int mutt_newsrc_update (NNTP_SERVER *);
105 int nntp_open_mailbox (CONTEXT *);
106 int nntp_sync_mailbox (CONTEXT *, int, int*);
107 int nntp_check_mailbox (CONTEXT *, int*, int);
108 int nntp_close_mailbox (CONTEXT *);
109 void nntp_fastclose_mailbox (CONTEXT *);
110 int nntp_fetch_message (MESSAGE *, CONTEXT *, int);
111 int nntp_post (const char *);
112 int nntp_check_msgid (CONTEXT *, const char *);
113 int nntp_check_children (CONTEXT *, const char *);
114 void nntp_buffy (char *);
115 void nntp_expand_path (char *, size_t, ACCOUNT *);
116 void nntp_logout_all ();
117 const char *nntp_format_str (char *, size_t, char, const char *, const char *,
118 const char *, const char *, unsigned long,
121 NNTP_SERVER *CurrentNewsSrv INITVAL (NULL);
123 #endif /* _NNTP_H_ */