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>
19 #define NNTP_SSL_PORT 563
21 /* number of entries in the hash table */
22 #define NNTP_CACHE_LEN 10
36 unsigned int hasXPAT:1;
37 unsigned int hasXGTITLE:1;
38 unsigned int hasXOVER:1;
39 unsigned int hasLISTGROUP:1;
40 unsigned int status:3;
46 time_t newgroups_time;
49 string_list_t *list; /* list of newsgroups */
50 string_list_t *tail; /* last entry of list */
60 NEWSRC_ENTRY *entries;
61 unsigned int num; /* number of used entries */
62 unsigned int max; /* number of allocated entries */
64 unsigned int firstMessage;
65 unsigned int lastMessage;
66 unsigned int lastLoaded;
67 unsigned int lastCached;
68 unsigned int subscribed:1;
71 unsigned int allowed:1;
72 unsigned int deleted:1;
77 NNTP_CACHE acache[NNTP_CACHE_LEN];
80 /* internal functions */
81 int nntp_get_active (NNTP_SERVER *);
82 int nntp_get_cache_all (NNTP_SERVER *);
83 int nntp_save_cache_index (NNTP_SERVER *);
84 int nntp_check_newgroups (NNTP_SERVER *, int);
85 int nntp_save_cache_group (CONTEXT *);
86 int nntp_parse_url (const char *, ACCOUNT *, char *, ssize_t);
87 void newsrc_gen_entries (CONTEXT *);
88 void nntp_get_status (CONTEXT *, HEADER *, char *, int);
89 void mutt_newsgroup_stat (NNTP_DATA *);
90 void nntp_delete_cache (NNTP_DATA *);
91 void nntp_add_to_list (NNTP_SERVER *, NNTP_DATA *);
92 void nntp_cache_expand (char *, const char *);
93 void nntp_delete_data (void *);
95 /* exposed interface */
96 NNTP_SERVER *mutt_select_newsserver (char *);
97 NNTP_DATA *mutt_newsgroup_subscribe (NNTP_SERVER *, char *);
98 NNTP_DATA *mutt_newsgroup_unsubscribe (NNTP_SERVER *, char *);
99 NNTP_DATA *mutt_newsgroup_catchup (NNTP_SERVER *, char *);
100 NNTP_DATA *mutt_newsgroup_uncatchup (NNTP_SERVER *, char *);
101 void nntp_clear_cacheindex (NNTP_SERVER *);
102 int mutt_newsrc_update (NNTP_SERVER *);
103 int nntp_open_mailbox (CONTEXT *);
104 int nntp_sync_mailbox (CONTEXT *, int, int*);
105 int nntp_check_mailbox (CONTEXT *, int*, int);
106 int nntp_close_mailbox (CONTEXT *);
107 void nntp_fastclose_mailbox (CONTEXT *);
108 int nntp_fetch_message (MESSAGE *, CONTEXT *, int);
109 int nntp_post (const char *);
110 int nntp_check_msgid (CONTEXT *, const char *);
111 int nntp_check_children (CONTEXT *, const char *);
112 void nntp_buffy (char* dst, ssize_t dstlen);
113 void nntp_expand_path (char *, ssize_t, ACCOUNT *);
114 void nntp_logout_all ();
115 const char *nntp_format_str (char *, ssize_t, char, const char *, const char *,
116 const char *, const char *, unsigned long,
118 void nntp_sync_sidebar (NNTP_DATA*);
120 WHERE NNTP_SERVER *CurrentNewsSrv INITVAL (NULL);
122 #endif /* _NNTP_H_ */