]> granicus.if.org Git - neomutt/commitdiff
replace 'body_cache_t' with 'struct BodyCache'
authorRichard Russon <rich@flatcap.org>
Mon, 15 May 2017 13:32:25 +0000 (14:32 +0100)
committerRichard Russon <rich@flatcap.org>
Mon, 15 May 2017 23:04:07 +0000 (00:04 +0100)
bcache.c
bcache.h
imap/imap_private.h
imap/message.c
newsrc.c
nntp.h
pop.c
pop.h

index 65ac4dbae7ace7825354a594fb262e80cbd9aa0a..a770546a6aefd097760097214ad8519bfd64b19f 100644 (file)
--- a/bcache.c
+++ b/bcache.c
@@ -28,9 +28,9 @@
 #include "lib.h"
 #include "url.h"
 
-static int mutt_bcache_move(body_cache_t *bcache, const char *id, const char *newid);
+static int mutt_bcache_move(struct BodyCache *bcache, const char *id, const char *newid);
 
-struct body_cache
+struct BodyCache
 {
   char path[_POSIX_PATH_MAX];
   size_t pathlen;
@@ -79,14 +79,14 @@ static int bcache_path(struct Account *account, const char *mailbox, char *dst,
   return 0;
 }
 
-body_cache_t *mutt_bcache_open(struct Account *account, const char *mailbox)
+struct BodyCache *mutt_bcache_open(struct Account *account, const char *mailbox)
 {
-  struct body_cache *bcache = NULL;
+  struct BodyCache *bcache = NULL;
 
   if (!account)
     goto bail;
 
-  bcache = safe_calloc(1, sizeof(struct body_cache));
+  bcache = safe_calloc(1, sizeof(struct BodyCache));
   if (bcache_path(account, mailbox, bcache->path, sizeof(bcache->path)) < 0)
     goto bail;
   bcache->pathlen = mutt_strlen(bcache->path);
@@ -99,14 +99,14 @@ bail:
   return NULL;
 }
 
-void mutt_bcache_close(body_cache_t **bcache)
+void mutt_bcache_close(struct BodyCache **bcache)
 {
   if (!bcache || !*bcache)
     return;
   FREE(bcache);
 }
 
-FILE *mutt_bcache_get(body_cache_t *bcache, const char *id)
+FILE *mutt_bcache_get(struct BodyCache *bcache, const char *id)
 {
   char path[_POSIX_PATH_MAX];
   FILE *fp = NULL;
@@ -125,7 +125,7 @@ FILE *mutt_bcache_get(body_cache_t *bcache, const char *id)
   return fp;
 }
 
-FILE *mutt_bcache_put(body_cache_t *bcache, const char *id, int tmp)
+FILE *mutt_bcache_put(struct BodyCache *bcache, const char *id, int tmp)
 {
   char path[_POSIX_PATH_MAX];
   struct stat sb;
@@ -156,7 +156,7 @@ FILE *mutt_bcache_put(body_cache_t *bcache, const char *id, int tmp)
   return safe_fopen(path, "w+");
 }
 
-int mutt_bcache_commit(body_cache_t *bcache, const char *id)
+int mutt_bcache_commit(struct BodyCache *bcache, const char *id)
 {
   char tmpid[_POSIX_PATH_MAX];
 
@@ -165,7 +165,7 @@ int mutt_bcache_commit(body_cache_t *bcache, const char *id)
   return mutt_bcache_move(bcache, tmpid, id);
 }
 
-static int mutt_bcache_move(body_cache_t *bcache, const char *id, const char *newid)
+static int mutt_bcache_move(struct BodyCache *bcache, const char *id, const char *newid)
 {
   char path[_POSIX_PATH_MAX];
   char newpath[_POSIX_PATH_MAX];
@@ -181,7 +181,7 @@ static int mutt_bcache_move(body_cache_t *bcache, const char *id, const char *ne
   return rename(path, newpath);
 }
 
-int mutt_bcache_del(body_cache_t *bcache, const char *id)
+int mutt_bcache_del(struct BodyCache *bcache, const char *id)
 {
   char path[_POSIX_PATH_MAX];
 
@@ -197,7 +197,7 @@ int mutt_bcache_del(body_cache_t *bcache, const char *id)
   return unlink(path);
 }
 
-int mutt_bcache_exists(body_cache_t *bcache, const char *id)
+int mutt_bcache_exists(struct BodyCache *bcache, const char *id)
 {
   char path[_POSIX_PATH_MAX];
   struct stat st;
@@ -220,8 +220,8 @@ int mutt_bcache_exists(body_cache_t *bcache, const char *id)
   return rc;
 }
 
-int mutt_bcache_list(body_cache_t *bcache,
-                     int (*want_id)(const char *id, body_cache_t *bcache, void *data),
+int mutt_bcache_list(struct BodyCache *bcache,
+                     int (*want_id)(const char *id, struct BodyCache *bcache, void *data),
                      void *data)
 {
   DIR *d = NULL;
index fdf90dda67aa1198b72c90210ed8a84fc5ca99c2..4b2bebb198c465eba289b5b49ee103e69818f4ae 100644 (file)
--- a/bcache.h
+++ b/bcache.h
@@ -25,8 +25,7 @@
  * support for body cache
  */
 
-struct body_cache;
-typedef struct body_cache body_cache_t;
+struct BodyCache;
 
 /*
  * Parameters:
@@ -37,10 +36,10 @@ typedef struct body_cache body_cache_t;
  *     mailboxes or hierarchies)
  * Returns NULL on failure.
  */
-body_cache_t *mutt_bcache_open(struct Account *account, const char *mailbox);
+struct BodyCache *mutt_bcache_open(struct Account *account, const char *mailbox);
 
 /* free all memory of bcache and finally FREE() it, too */
-void mutt_bcache_close(body_cache_t **bcache);
+void mutt_bcache_close(struct BodyCache **bcache);
 
 /*
  * Parameters:
@@ -49,13 +48,13 @@ void mutt_bcache_close(body_cache_t **bcache);
  * These return NULL/-1 on failure and FILE pointer/0 on success.
  */
 
-FILE *mutt_bcache_get(body_cache_t *bcache, const char *id);
+FILE *mutt_bcache_get(struct BodyCache *bcache, const char *id);
 /* tmp: the returned FILE* is in a temporary location.
  *      if set, use mutt_bcache_commit to put it into place */
-FILE *mutt_bcache_put(body_cache_t *bcache, const char *id, int tmp);
-int mutt_bcache_commit(body_cache_t *bcache, const char *id);
-int mutt_bcache_del(body_cache_t *bcache, const char *id);
-int mutt_bcache_exists(body_cache_t *bcache, const char *id);
+FILE *mutt_bcache_put(struct BodyCache *bcache, const char *id, int tmp);
+int mutt_bcache_commit(struct BodyCache *bcache, const char *id);
+int mutt_bcache_del(struct BodyCache *bcache, const char *id);
+int mutt_bcache_exists(struct BodyCache *bcache, const char *id);
 
 /*
  * This more or less "examines" the cache and calls a function with
@@ -72,8 +71,8 @@ int mutt_bcache_exists(body_cache_t *bcache, const char *id);
  * This returns -1 on failure and the count (>=0) of items processed
  * otherwise.
  */
-int mutt_bcache_list(body_cache_t *bcache,
-                     int (*want_id)(const char *id, body_cache_t *bcache, void *data),
+int mutt_bcache_list(struct BodyCache *bcache,
+                     int (*want_id)(const char *id, struct BodyCache *bcache, void *data),
                      void *data);
 
 #endif /* _MUTT_BCACHE_H */
index b1243ad97fcae7baf91b687426f7813253ac6a5a..507db1d45cf02f1fc088420d211428244656ac4a 100644 (file)
@@ -217,7 +217,7 @@ typedef struct
   HASH *uid_hash;
   unsigned int uid_validity;
   unsigned int uidnext;
-  body_cache_t *bcache;
+  struct BodyCache *bcache;
 
   /* all folder flags - system flags AND keywords */
   LIST *flags;
index 8f607c9bfd26746af0088576480c42f01a6a02cd..caab42e344e282b8ab1c67bb47daec8a05fef476 100644 (file)
@@ -47,7 +47,7 @@ static void imap_update_context(IMAP_DATA *idata, int oldmsgcount)
   }
 }
 
-static body_cache_t *msg_cache_open(IMAP_DATA *idata)
+static struct BodyCache *msg_cache_open(IMAP_DATA *idata)
 {
   char mailbox[_POSIX_PATH_MAX];
 
@@ -96,7 +96,7 @@ static int msg_cache_commit(IMAP_DATA *idata, HEADER *h)
   return mutt_bcache_commit(idata->bcache, id);
 }
 
-static int msg_cache_clean_cb(const char *id, body_cache_t *bcache, void *data)
+static int msg_cache_clean_cb(const char *id, struct BodyCache *bcache, void *data)
 {
   unsigned int uv, uid, n;
   IMAP_DATA *idata = data;
index 6344d2c8dd9f65654e32ebda4e352ca46b8710b9..844837882a4384a243ce764bbfbf8875fdce1a36 100644 (file)
--- a/newsrc.c
+++ b/newsrc.c
@@ -690,7 +690,7 @@ void nntp_hcache_update(NNTP_DATA *nntp_data, header_cache_t *hc)
 #endif
 
 /* Remove bcache file */
-static int nntp_bcache_delete(const char *id, body_cache_t *bcache, void *data)
+static int nntp_bcache_delete(const char *id, struct BodyCache *bcache, void *data)
 {
   NNTP_DATA *nntp_data = data;
   anum_t anum;
diff --git a/nntp.h b/nntp.h
index 1de34fe02c95e035241a4012f2598ec3ed49ffe4..34f8e1e5ea2dd791e0cf12a7b3a17d9ae1c70535 100644 (file)
--- a/nntp.h
+++ b/nntp.h
@@ -106,7 +106,7 @@ typedef struct
   NEWSRC_ENTRY *newsrc_ent;
   NNTP_SERVER *nserv;
   NNTP_ACACHE acache[NNTP_ACACHE_LEN];
-  body_cache_t *bcache;
+  struct BodyCache *bcache;
 } NNTP_DATA;
 
 typedef struct
diff --git a/pop.c b/pop.c
index 4d80e24efc3ae813c71e72759f9a28e0ec6514a7..23800979fbde3bcc22b172bd33aa4d8d5cb14873 100644 (file)
--- a/pop.c
+++ b/pop.c
@@ -171,7 +171,7 @@ static int fetch_uidl(char *line, void *data)
   return 0;
 }
 
-static int msg_cache_check(const char *id, body_cache_t *bcache, void *data)
+static int msg_cache_check(const char *id, struct BodyCache *bcache, void *data)
 {
   CONTEXT *ctx = NULL;
   POP_DATA *pop_data = NULL;
diff --git a/pop.h b/pop.h
index 72b1af38cbf59325a0fa4cd13f5e422fd75ffaf3..ed6a7d187a54cee4647be677402fb5f8663548ff 100644 (file)
--- a/pop.h
+++ b/pop.h
@@ -73,7 +73,7 @@ typedef struct
   time_t login_delay; /* minimal login delay  capability */
   char *auth_list;    /* list of auth mechanisms */
   char *timestamp;
-  body_cache_t *bcache; /* body cache */
+  struct BodyCache *bcache; /* body cache */
   char err_msg[POP_CMD_RESPONSE];
   POP_CACHE cache[POP_CACHE_LEN];
 } POP_DATA;