tail is always a list_item**.
[apps/madmutt.git] / nntp / nntp.h
index a111b67..18b20fe 100644 (file)
@@ -13,9 +13,9 @@
 #define _NNTP_H_ 1
 
 #include <lib-sys/mutt_socket.h>
-#include "mx.h"
+#include <lib-mx/mx.h>
 
-#include <time.h>
+extern mx_t const nntp_mx;
 
 #define NNTP_PORT 119
 #define NNTP_SSL_PORT 563
@@ -35,11 +35,12 @@ typedef struct {
 } NEWSRC_ENTRY;
 
 typedef struct {
-  unsigned int hasXPAT:1;
-  unsigned int hasXGTITLE:1;
-  unsigned int hasXOVER:1;
-  unsigned int hasLISTGROUP:1;
-  unsigned int status:3;
+  unsigned feat_known   : 1;
+  unsigned hasXPAT      : 1;
+  unsigned hasXGTITLE   : 1;
+  unsigned hasXOVER     : 1;
+  unsigned hasLISTGROUP : 1;
+  unsigned status       : 3;
   char *newsrc;
   char *cache;
   int stat;
@@ -47,31 +48,31 @@ typedef struct {
   time_t mtime;
   time_t newgroups_time;
   time_t check_time;
-  HASH *newsgroups;
+  hash_t *newsgroups;
   string_list_t *list;                   /* list of newsgroups */
-  string_list_t *tail;                   /* last entry of list */
+  string_list_t **tail;                  /* last entry of list */
   CONNECTION *conn;
 } NNTP_SERVER;
 
 typedef struct {
-  unsigned int index;
+  int   index;
   char *path;
 } NNTP_CACHE;
 
 typedef struct {
   NEWSRC_ENTRY *entries;
-  unsigned int num;             /* number of used entries */
-  unsigned int max;             /* number of allocated entries */
-  unsigned int unread;
-  unsigned int firstMessage;
-  unsigned int lastMessage;
-  unsigned int lastLoaded;
-  unsigned int lastCached;
-  unsigned int subscribed:1;
-  unsigned int rc:1;
-  unsigned int new:1;
-  unsigned int allowed:1;
-  unsigned int deleted:1;
+  int num;             /* number of used entries */
+  int max;             /* number of allocated entries */
+  int unread;
+  int firstMessage;
+  int lastMessage;
+  int lastLoaded;
+  int lastCached;
+  unsigned subscribed:1;
+  unsigned rc:1;
+  unsigned new:1;
+  unsigned allowed:1;
+  unsigned deleted:1;
   char *group;
   char *desc;
   char *cache;
@@ -85,7 +86,7 @@ int nntp_get_cache_all (NNTP_SERVER *);
 int nntp_save_cache_index (NNTP_SERVER *);
 int nntp_check_newgroups (NNTP_SERVER *, int);
 int nntp_save_cache_group (CONTEXT *);
-int nntp_parse_url (const char *, ACCOUNT *, char *, size_t);
+int nntp_parse_url (const char *, ACCOUNT *, char *, ssize_t);
 void newsrc_gen_entries (CONTEXT *);
 void nntp_get_status (CONTEXT *, HEADER *, char *, int);
 void mutt_newsgroup_stat (NNTP_DATA *);
@@ -102,21 +103,16 @@ NNTP_DATA *mutt_newsgroup_catchup (NNTP_SERVER *, char *);
 NNTP_DATA *mutt_newsgroup_uncatchup (NNTP_SERVER *, char *);
 void nntp_clear_cacheindex (NNTP_SERVER *);
 int mutt_newsrc_update (NNTP_SERVER *);
-int nntp_open_mailbox (CONTEXT *);
-int nntp_sync_mailbox (CONTEXT *, int, int*);
-int nntp_check_mailbox (CONTEXT *, int*, int);
 int nntp_close_mailbox (CONTEXT *);
-void nntp_fastclose_mailbox (CONTEXT *);
 int nntp_fetch_message (MESSAGE *, CONTEXT *, int);
 int nntp_post (const char *);
 int nntp_check_msgid (CONTEXT *, const char *);
 int nntp_check_children (CONTEXT *, const char *);
-void nntp_buffy (char* dst, size_t dstlen);
-void nntp_expand_path (char *, size_t, ACCOUNT *);
-void nntp_logout_all ();
-const char *nntp_format_str (char *, size_t, char, const char *, const char *,
-                             const char *, const char *, unsigned long,
-                             format_flag);
+void nntp_buffy (char* dst, ssize_t dstlen);
+void nntp_expand_path (char *, ssize_t, ACCOUNT *);
+void nntp_logout_all(void);
+const char *nntp_format_str(char *, ssize_t, char, const char *, const char *,
+                            const char *, const char *, anytype, format_flag);
 void nntp_sync_sidebar (NNTP_DATA*);
 
 WHERE NNTP_SERVER *CurrentNewsSrv INITVAL (NULL);