Rename pop_query_d to pop_query and remove useless arg
[apps/madmutt.git] / pop / pop.h
index 453d2ce..6e857c0 100644 (file)
--- a/pop/pop.h
+++ b/pop/pop.h
 #ifndef _POP_H
 #define _POP_H 1
 
-#include "mailbox.h"
-#include "mutt_socket.h"
+#include <lib-ui/curses.h>
+#include <lib-sys/mutt_socket.h>
+
+#include "mx.h"
 
 #define POP_PORT 110
 #define POP_SSL_PORT 995
@@ -38,7 +40,7 @@ typedef enum {
 } pop_auth_res_t;
 
 typedef struct {
-  unsigned int index;
+  int index;
   char *path;
 } POP_CACHE;
 
@@ -49,22 +51,22 @@ typedef enum pop_query_status_e {
   PQ_OK = 0
 } pop_query_status;
 
-typedef enum cmd_user_status_e {
-  USER_NOT_AVAILABLE = 0,
-  USER_AVAILABLE,
-  USER_UNKNOWN
-} cmd_user_status;
+typedef enum cmd_status_e {
+  CMD_NOT_AVAILABLE = 0,
+  CMD_AVAILABLE,
+  CMD_UNKNOWN /* unknown whether it is available or not */
+} cmd_status;
 
 typedef struct {
   CONNECTION *conn;
   unsigned int status:2;
   unsigned int capabilities:1;
   unsigned int use_stls:2;
-  unsigned int cmd_capa:1;      /* optional command CAPA */
-  unsigned int cmd_stls:1;      /* optional command STLS */
-  cmd_user_status cmd_user;      /* optional command USER */
-  unsigned int cmd_uidl:2;      /* optional command UIDL */
-  unsigned int cmd_top:2;       /* optional command TOP */
+  cmd_status cmd_capa;      /* optional command CAPA */
+  cmd_status cmd_stls;      /* optional command STLS */
+  cmd_status cmd_user;      /* optional command USER */
+  cmd_status cmd_uidl;      /* optional command UIDL */
+  cmd_status cmd_top;       /* optional command TOP */
   unsigned int resp_codes:1;    /* server supports extended response codes */
   unsigned int expire:1;        /* expire is greater than 0 */
   unsigned int clear_cache:1;
@@ -90,21 +92,20 @@ int pop_authenticate (POP_DATA *);
 void pop_apop_timestamp (POP_DATA *, char *);
 
 /* pop_lib.c */
-#define pop_query(A,B,C) pop_query_d(A,B,C,NULL)
 int pop_parse_path (const char *, ACCOUNT *);
 int pop_connect (POP_DATA *);
 pop_query_status pop_open_connection (POP_DATA *);
-pop_query_status pop_query_d (POP_DATA *, char *, size_t, char *);
-pop_query_status pop_fetch_data (POP_DATA *, char *, char *, int (*funct) (char *, void *),
-                    void *);
+pop_query_status pop_query (POP_DATA *, char *, size_t);
+pop_query_status pop_fetch_data (POP_DATA *, const char *, progress_t*,
+                                 int (*funct) (char *, void *), void *);
 pop_query_status pop_reconnect (CONTEXT *);
 void pop_logout (CONTEXT *);
 void pop_error (POP_DATA *, char *);
 
 /* pop.c */
-int pop_check_mailbox (CONTEXT *, int *);
+int pop_check_mailbox (CONTEXT *, int *, int);
 int pop_open_mailbox (CONTEXT *);
-pop_query_status pop_sync_mailbox (CONTEXT *, int *);
+pop_query_status pop_sync_mailbox (CONTEXT *, int, int *);
 int pop_fetch_message (MESSAGE *, CONTEXT *, int);
 void pop_close_mailbox (CONTEXT *);
 void pop_fetch_mail (void);