]> granicus.if.org Git - neomutt/commitdiff
replace 'POP_DATA' with 'struct PopData'
authorRichard Russon <rich@flatcap.org>
Tue, 16 May 2017 13:18:36 +0000 (14:18 +0100)
committerRichard Russon <rich@flatcap.org>
Tue, 16 May 2017 14:21:29 +0000 (15:21 +0100)
pop.c
pop.h
pop_auth.c
pop_lib.c

diff --git a/pop.c b/pop.c
index 7f5eab5d6d41fe425223cc32244adef2aafd57fd..95d4209cc1be6f3ba8567f9b4f1355526a98cdfd 100644 (file)
--- a/pop.c
+++ b/pop.c
@@ -55,7 +55,7 @@ static int fetch_message(char *line, void *file)
  * -2 - invalid command or execution error,
  * -3 - error writing to tempfile
  */
-static int pop_read_header(POP_DATA *pop_data, struct Header *h)
+static int pop_read_header(struct PopData *pop_data, struct Header *h)
 {
   FILE *f = NULL;
   int ret, index;
@@ -136,7 +136,7 @@ static int fetch_uidl(char *line, void *data)
 {
   int i, index;
   struct Context *ctx = (struct Context *) data;
-  POP_DATA *pop_data = (POP_DATA *) ctx->data;
+  struct PopData *pop_data = (struct PopData *) ctx->data;
   char *endp = NULL;
 
   errno = 0;
@@ -174,12 +174,12 @@ static int fetch_uidl(char *line, void *data)
 static int msg_cache_check(const char *id, struct BodyCache *bcache, void *data)
 {
   struct Context *ctx = NULL;
-  POP_DATA *pop_data = NULL;
+  struct PopData *pop_data = NULL;
   int i;
 
   if (!(ctx = (struct Context *) data))
     return -1;
-  if (!(pop_data = (POP_DATA *) ctx->data))
+  if (!(pop_data = (struct PopData *) ctx->data))
     return -1;
 
 #ifdef USE_HCACHE
@@ -205,7 +205,7 @@ static int pop_hcache_namer(const char *path, char *dest, size_t destlen)
   return snprintf(dest, destlen, "%s." HC_FEXT, path);
 }
 
-static header_cache_t *pop_hcache_open(POP_DATA *pop_data, const char *path)
+static header_cache_t *pop_hcache_open(struct PopData *pop_data, const char *path)
 {
   struct CissUrl url;
   char p[LONG_STRING];
@@ -232,7 +232,7 @@ static int pop_fetch_headers(struct Context *ctx)
 {
   int i, ret, old_count, new_count, deleted;
   unsigned short hcached = 0, bcached;
-  POP_DATA *pop_data = (POP_DATA *) ctx->data;
+  struct PopData *pop_data = (struct PopData *) ctx->data;
   struct Progress progress;
 
 #ifdef USE_HCACHE
@@ -397,7 +397,7 @@ static int pop_open_mailbox(struct Context *ctx)
   char buf[LONG_STRING];
   struct Connection *conn = NULL;
   struct Account acct;
-  POP_DATA *pop_data = NULL;
+  struct PopData *pop_data = NULL;
   struct CissUrl url;
 
   if (pop_parse_path(ctx->path, &acct))
@@ -419,7 +419,7 @@ static int pop_open_mailbox(struct Context *ctx)
   ctx->path = safe_strdup(buf);
   ctx->realpath = safe_strdup(ctx->path);
 
-  pop_data = safe_calloc(1, sizeof(POP_DATA));
+  pop_data = safe_calloc(1, sizeof(struct PopData));
   pop_data->conn = conn;
   ctx->data = pop_data;
 
@@ -462,7 +462,7 @@ static int pop_open_mailbox(struct Context *ctx)
 }
 
 /* delete all cached messages */
-static void pop_clear_cache(POP_DATA *pop_data)
+static void pop_clear_cache(struct PopData *pop_data)
 {
   int i;
 
@@ -484,7 +484,7 @@ static void pop_clear_cache(POP_DATA *pop_data)
 /* close POP mailbox */
 static int pop_close_mailbox(struct Context *ctx)
 {
-  POP_DATA *pop_data = (POP_DATA *) ctx->data;
+  struct PopData *pop_data = (struct PopData *) ctx->data;
 
   if (!pop_data)
     return 0;
@@ -515,7 +515,7 @@ static int pop_fetch_message(struct Context *ctx, struct Message *msg, int msgno
   char buf[LONG_STRING];
   char path[_POSIX_PATH_MAX];
   struct Progress progressbar;
-  POP_DATA *pop_data = (POP_DATA *) ctx->data;
+  struct PopData *pop_data = (struct PopData *) ctx->data;
   struct PopCache *cache = NULL;
   struct Header *h = ctx->hdrs[msgno];
   unsigned short bcache = 1;
@@ -665,7 +665,7 @@ static int pop_sync_mailbox(struct Context *ctx, int *index_hint)
 {
   int i, j, ret = 0;
   char buf[LONG_STRING];
-  POP_DATA *pop_data = (POP_DATA *) ctx->data;
+  struct PopData *pop_data = (struct PopData *) ctx->data;
   struct Progress progress;
 #ifdef USE_HCACHE
   header_cache_t *hc = NULL;
@@ -742,7 +742,7 @@ static int pop_sync_mailbox(struct Context *ctx, int *index_hint)
 static int pop_check_mailbox(struct Context *ctx, int *index_hint)
 {
   int ret;
-  POP_DATA *pop_data = (POP_DATA *) ctx->data;
+  struct PopData *pop_data = (struct PopData *) ctx->data;
 
   if ((pop_data->check_time + PopCheckTimeout) > time(NULL))
     return 0;
@@ -781,7 +781,7 @@ void pop_fetch_mail(void)
   struct Context ctx;
   struct Message *msg = NULL;
   struct Account acct;
-  POP_DATA *pop_data = NULL;
+  struct PopData *pop_data = NULL;
 
   if (!PopHost)
   {
@@ -809,7 +809,7 @@ void pop_fetch_mail(void)
   if (!conn)
     return;
 
-  pop_data = safe_calloc(1, sizeof(POP_DATA));
+  pop_data = safe_calloc(1, sizeof(struct PopData));
   pop_data->conn = conn;
 
   if (pop_open_connection(pop_data) < 0)
diff --git a/pop.h b/pop.h
index 1d9e9e1c77ddd756b41a678292bcbe3eeeadb38e..876d95b4f8de6927aafa415055899eb4141513b1 100644 (file)
--- a/pop.h
+++ b/pop.h
@@ -54,7 +54,7 @@ struct PopCache
   char *path;
 };
 
-typedef struct
+struct PopData
 {
   struct Connection *conn;
   unsigned int status : 2;
@@ -76,28 +76,28 @@ typedef struct
   struct BodyCache *bcache; /* body cache */
   char err_msg[POP_CMD_RESPONSE];
   struct PopCache cache[POP_CACHE_LEN];
-} POP_DATA;
+};
 
 struct PopAuth
 {
   /* do authentication, using named method or any available if method is NULL */
-  pop_auth_res_t (*authenticate)(POP_DATA *, const char *);
+  pop_auth_res_t (*authenticate)(struct PopData *, const char *);
   /* name of authentication method supported, NULL means variable. If this
    * is not null, authenticate may ignore the second parameter. */
   const char *method;
 };
 
 /* pop_auth.c */
-int pop_authenticate(POP_DATA *pop_data);
-void pop_apop_timestamp(POP_DATA *pop_data, char *buf);
+int pop_authenticate(struct PopData *pop_data);
+void pop_apop_timestamp(struct PopData *pop_data, char *buf);
 
 /* pop_lib.c */
 #define pop_query(A, B, C) pop_query_d(A, B, C, NULL)
 int pop_parse_path(const char *path, struct Account *acct);
-int pop_connect(POP_DATA *pop_data);
-int pop_open_connection(POP_DATA *pop_data);
-int pop_query_d(POP_DATA *pop_data, char *buf, size_t buflen, char *msg);
-int pop_fetch_data(POP_DATA *pop_data, char *query, struct Progress *progressbar,
+int pop_connect(struct PopData *pop_data);
+int pop_open_connection(struct PopData *pop_data);
+int pop_query_d(struct PopData *pop_data, char *buf, size_t buflen, char *msg);
+int pop_fetch_data(struct PopData *pop_data, char *query, struct Progress *progressbar,
                    int (*funct)(char *, void *), void *data);
 int pop_reconnect(struct Context *ctx);
 void pop_logout(struct Context *ctx);
index c6143670e30b3c7640285fbce602ad8122649add..71e549874cd03d9516433217dd5ee8fb3b0dec3e 100644 (file)
@@ -30,7 +30,7 @@
 
 #ifdef USE_SASL
 /* SASL authenticator */
-static pop_auth_res_t pop_auth_sasl(POP_DATA *pop_data, const char *method)
+static pop_auth_res_t pop_auth_sasl(struct PopData *pop_data, const char *method)
 {
   sasl_conn_t *saslconn = NULL;
   sasl_interact_t *interaction = NULL;
@@ -180,7 +180,7 @@ bail:
 #endif
 
 /* Get the server timestamp for APOP authentication */
-void pop_apop_timestamp(POP_DATA *pop_data, char *buf)
+void pop_apop_timestamp(struct PopData *pop_data, char *buf)
 {
   char *p1 = NULL, *p2 = NULL;
 
@@ -194,7 +194,7 @@ void pop_apop_timestamp(POP_DATA *pop_data, char *buf)
 }
 
 /* APOP authenticator */
-static pop_auth_res_t pop_auth_apop(POP_DATA *pop_data, const char *method)
+static pop_auth_res_t pop_auth_apop(struct PopData *pop_data, const char *method)
 {
   struct md5_ctx ctx;
   unsigned char digest[16];
@@ -242,7 +242,7 @@ static pop_auth_res_t pop_auth_apop(POP_DATA *pop_data, const char *method)
 }
 
 /* USER authenticator */
-static pop_auth_res_t pop_auth_user(POP_DATA *pop_data, const char *method)
+static pop_auth_res_t pop_auth_user(struct PopData *pop_data, const char *method)
 {
   char buf[LONG_STRING];
   int ret;
@@ -315,7 +315,7 @@ static const struct PopAuth pop_authenticators[] = {
  * -2 - login failed,
  * -3 - authentication canceled.
 */
-int pop_authenticate(POP_DATA *pop_data)
+int pop_authenticate(struct PopData *pop_data)
 {
   struct Account *acct = &pop_data->conn->account;
   const struct PopAuth *authenticator = NULL;
index 5bc7b237e9bf4a3800903d6b947fa0aa0ed769ad..0fc6b2dabebb66e0d765e2036ea07a57aabf8d1f 100644 (file)
--- a/pop_lib.c
+++ b/pop_lib.c
@@ -71,7 +71,7 @@ int pop_parse_path(const char *path, struct Account *acct)
 }
 
 /* Copy error message to err_msg buffer */
-static void pop_error(POP_DATA *pop_data, char *msg)
+static void pop_error(struct PopData *pop_data, char *msg)
 {
   char *t = NULL, *c = NULL, *c2 = NULL;
 
@@ -93,7 +93,7 @@ static void pop_error(POP_DATA *pop_data, char *msg)
 /* Parse CAPA output */
 static int fetch_capa(char *line, void *data)
 {
-  POP_DATA *pop_data = (POP_DATA *) data;
+  struct PopData *pop_data = (struct PopData *) data;
   char *c = NULL;
 
   if (ascii_strncasecmp(line, "SASL", 4) == 0)
@@ -121,7 +121,7 @@ static int fetch_capa(char *line, void *data)
 /* Fetch list of the authentication mechanisms */
 static int fetch_auth(char *line, void *data)
 {
-  POP_DATA *pop_data = (POP_DATA *) data;
+  struct PopData *pop_data = (struct PopData *) data;
 
   if (!pop_data->auth_list)
   {
@@ -144,7 +144,7 @@ static int fetch_auth(char *line, void *data)
  * -1 - connection lost,
  * -2 - execution error.
 */
-static int pop_capabilities(POP_DATA *pop_data, int mode)
+static int pop_capabilities(struct PopData *pop_data, int mode)
 {
   char buf[LONG_STRING];
 
@@ -222,7 +222,7 @@ static int pop_capabilities(POP_DATA *pop_data, int mode)
  * -1 - connection lost,
  * -2 - invalid response.
 */
-int pop_connect(POP_DATA *pop_data)
+int pop_connect(struct PopData *pop_data)
 {
   char buf[LONG_STRING];
 
@@ -256,7 +256,7 @@ int pop_connect(POP_DATA *pop_data)
  * -2 - invalid command or execution error,
  * -3 - authentication canceled.
 */
-int pop_open_connection(POP_DATA *pop_data)
+int pop_open_connection(struct PopData *pop_data)
 {
   int ret;
   unsigned int n, size;
@@ -379,7 +379,7 @@ void pop_logout(struct Context *ctx)
 {
   int ret = 0;
   char buf[LONG_STRING];
-  POP_DATA *pop_data = (POP_DATA *) ctx->data;
+  struct PopData *pop_data = (struct PopData *) ctx->data;
 
   if (pop_data->status == POP_CONNECTED)
   {
@@ -413,7 +413,7 @@ void pop_logout(struct Context *ctx)
  * -1 - connection lost,
  * -2 - invalid command or execution error.
 */
-int pop_query_d(POP_DATA *pop_data, char *buf, size_t buflen, char *msg)
+int pop_query_d(struct PopData *pop_data, char *buf, size_t buflen, char *msg)
 {
   int dbg = MUTT_SOCK_LOG_CMD;
   char *c = NULL;
@@ -458,7 +458,7 @@ int pop_query_d(POP_DATA *pop_data, char *buf, size_t buflen, char *msg)
  * -2 - invalid command or execution error,
  * -3 - error in funct(*line, *data)
  */
-int pop_fetch_data(POP_DATA *pop_data, char *query, struct Progress *progressbar,
+int pop_fetch_data(struct PopData *pop_data, char *query, struct Progress *progressbar,
                    int (*funct)(char *, void *), void *data)
 {
   char buf[LONG_STRING];
@@ -549,7 +549,7 @@ static int check_uidl(char *line, void *data)
 int pop_reconnect(struct Context *ctx)
 {
   int ret;
-  POP_DATA *pop_data = (POP_DATA *) ctx->data;
+  struct PopData *pop_data = (struct PopData *) ctx->data;
   struct Progress progressbar;
 
   if (pop_data->status == POP_CONNECTED)