]> granicus.if.org Git - neomutt/commitdiff
doxy: cache
authorRichard Russon <rich@flatcap.org>
Sat, 4 Aug 2018 22:19:43 +0000 (23:19 +0100)
committerRichard Russon <rich@flatcap.org>
Sat, 4 Aug 2018 22:24:36 +0000 (23:24 +0100)
bcache.h
config/set.c
email/thread.c
hcache/hcache.c
hcache/hcache.h
imap/message.c
imap/util.c
mutt/hash.c
mutt/hash.h
nntp/newsrc.c
pop/pop.c

index 056615e86b669b082d59f0207155bc375cab2ca4..80b5ada7bbd07cde1831478c85983fa94fcb7e28 100644 (file)
--- a/bcache.h
+++ b/bcache.h
@@ -33,7 +33,14 @@ struct BodyCache;
 extern char *MessageCachedir;
 
 /**
- * Callback function for mutt_bcache_list
+ * bcache_list_t - Prototype for mutt_bcache_list() callback
+ * @param bcache  Body Cache from mutt_bcache_open()
+ * @param want_id Callback function called for each match
+ * @param data    Data to pass to the callback function
+ * @retval -1  Failure
+ * @retval >=0 count of matching items
+ *
+ * mutt_bcache_list() will call this function once for each item in the cache.
  */
 typedef int bcache_list_t(const char *id, struct BodyCache *bcache, void *data);
 
index a4306a0c49f50956f082d0745468ac8aa9deeb9e..6b4588a5f17303e864da7cb2173e83fdd59f7c5e 100644 (file)
@@ -45,7 +45,7 @@ struct ConfigSetType RegisteredTypes[18] = {
 };
 
 /**
- * destroy - Callback function for the Hash Table
+ * destroy - Callback function for the Hash Table - Implements ::hash_destructor_t
  * @param type Object type, e.g. #DT_STRING
  * @param obj  Object to destroy
  * @param data ConfigSet associated with the object
index 1c0fcd9e6d3024b6b2dc76cdc32b989e4b53e1cc..0b7e8480b068cb2255486a01d5e70832abe7815c 100644 (file)
@@ -101,10 +101,7 @@ void insert_message(struct MuttThread **new, struct MuttThread *newparent,
 }
 
 /**
- * thread_hash_destructor - Hash Destructor callback
- * @param type Hash Type
- * @param obj  Object to free
- * @param data Data associated with the Hash
+ * thread_hash_destructor - Hash Destructor callback - Implements ::hash_destructor_t
  */
 void thread_hash_destructor(int type, void *obj, intptr_t data)
 {
index 1cafa7d3f3e3c6bbeb1ccecd17a9fbfb6a7a4b66..27a5e16f50f16681e8b818559c3ed928d1bcce46 100644 (file)
@@ -165,7 +165,7 @@ static bool create_hcache_dir(const char *path)
  * hcache_per_folder - Generate the hcache pathname
  * @param path   Base directory, from $header_cache
  * @param folder Mailbox name (including protocol)
- * @param namer  Callback to generate database filename
+ * @param namer  Callback to generate database filename - Implements ::hcache_namer_t
  * @retval ptr Full pathname to the database (to be generated)
  *             (path must be freed by the caller)
  *
index 8aac251aba456e23138fb4497a1833027c147f13..ff583aa8c2d1d95d786036f469cc97983c79aad1 100644 (file)
@@ -71,6 +71,13 @@ struct HeaderCache
 
 typedef struct HeaderCache header_cache_t;
 
+/**
+ * hcache_namer_t - Prototype for function to compose hcache file names
+ * @param path    Path of message
+ * @param dest    Buffer for filename
+ * @param destlen Length of buffer
+ * @retval num Characters written to buffer
+ */
 typedef int (*hcache_namer_t)(const char *path, char *dest, size_t dlen);
 
 /**
index 62d235e8356bbf1b442b045b694a059adfe482e4..1021235c7152ac48651ce4822840f03860e320eb 100644 (file)
@@ -171,10 +171,7 @@ static int msg_cache_commit(struct ImapData *idata, struct Header *h)
 }
 
 /**
- * msg_cache_clean_cb - Delete an entry from the message cache
- * @param id     ID of entry to delete
- * @param bcache BodyCache
- * @param data   Server data
+ * msg_cache_clean_cb - Delete an entry from the message cache - Implements ::bcache_list_t
  * @retval 0 Always
  */
 static int msg_cache_clean_cb(const char *id, struct BodyCache *bcache, void *data)
index 0b0aa606d2a65cd331991d57f10910c2c682a3e2..400fd5bab3283071e422e14057adfcf87bab319a 100644 (file)
@@ -211,11 +211,7 @@ void imap_clean_path(char *path, size_t plen)
 
 #ifdef USE_HCACHE
 /**
- * imap_hcache_namer - Generate a filename for the header cache
- * @param path Path for the header cache file
- * @param dest Buffer for result
- * @param dlen Length of buffer
- * @retval num Chars written to dest
+ * imap_hcache_namer - Generate a filename for the header cache - Implements ::hcache_namer_t
  */
 static int imap_hcache_namer(const char *path, char *dest, size_t dlen)
 {
index e493c7e8904a9e9f2b07f168483ec56231a8676a..ed1b7eca58864d2e40b9b0271cb9ee08d0884689 100644 (file)
@@ -317,7 +317,7 @@ struct Hash *mutt_hash_int_create(size_t nelem, int flags)
  * @param fn      Callback function to free Hash Table's resources
  * @param fn_data Data to pass to the callback function
  */
-void mutt_hash_set_destructor(struct Hash *table, hash_destructor fn, intptr_t fn_data)
+void mutt_hash_set_destructor(struct Hash *table, hash_destructor_t fn, intptr_t fn_data)
 {
   table->destroy = fn;
   table->dest_data = fn_data;
index 28d8bfd96c18a599aef47de41ca91b02bbfcda38..c96d642dd02f08ecaa14bad3d5d0f7ccd35283b2 100644 (file)
@@ -47,7 +47,13 @@ struct HashElem
   struct HashElem *next;
 };
 
-typedef void (*hash_destructor)(int type, void *obj, intptr_t data);
+/**
+ * hash_destructor_t - Prototype for Hash Destructor callback function
+ * @param type Hash Type
+ * @param obj  Object to free
+ * @param data Data associated with the Hash
+ */
+typedef void (*hash_destructor_t)(int type, void *obj, intptr_t data);
 
 /**
  * struct Hash - A Hash Table
@@ -60,7 +66,7 @@ struct Hash
   struct HashElem **table;
   size_t (*gen_hash)(union HashKey, size_t);
   int (*cmp_key)(union HashKey, union HashKey);
-  hash_destructor destroy;
+  hash_destructor_t destroy;
   intptr_t dest_data;
 };
 
@@ -80,7 +86,7 @@ struct Hash *    mutt_hash_int_create(size_t nelem, int flags);
 void             mutt_hash_int_delete(struct Hash *table, unsigned int intkey, const void *data);
 void *           mutt_hash_int_find(const struct Hash *table, unsigned int intkey);
 struct HashElem *mutt_hash_int_insert(struct Hash *table, unsigned int intkey, void *data);
-void             mutt_hash_set_destructor(struct Hash *table, hash_destructor fn, intptr_t fn_data);
+void             mutt_hash_set_destructor(struct Hash *table, hash_destructor_t fn, intptr_t fn_data);
 struct HashElem *mutt_hash_typed_insert(struct Hash *table, const char *strkey, int type, void *data);
 
 /**
index e3997e49a0aa39bdc1bb78369f5a821017ee031a..85e599159dc1763abafe09e42b9c0257e02b77c7 100644 (file)
@@ -133,12 +133,9 @@ void nntp_data_free(void *data)
 }
 
 /**
- * nntp_hash_destructor - Free our hash table data
- * @param type Type (UNUSED)
- * @param obj  NNTP data
- * @param data Data (UNUSED)
+ * nntp_hash_destructor_t - Free our hash table data - Implements ::hash_destructor_t
  */
-void nntp_hash_destructor(int type, void *obj, intptr_t data)
+void nntp_hash_destructor_t(int type, void *obj, intptr_t data)
 {
   nntp_data_free(obj);
 }
@@ -710,13 +707,7 @@ int nntp_active_save_cache(struct NntpServer *nserv)
 
 #ifdef USE_HCACHE
 /**
- * nntp_hcache_namer - Compose hcache file names
- * @param path    Path of message
- * @param dest    Buffer for filename
- * @param destlen Length of buffer
- * @retval num Characters written to buffer
- *
- * Used by mutt_hcache_open() to compose hcache file name
+ * nntp_hcache_namer - Compose hcache file names - Implements ::hcache_namer_t
  */
 static int nntp_hcache_namer(const char *path, char *dest, size_t destlen)
 {
@@ -808,10 +799,7 @@ void nntp_hcache_update(struct NntpData *nntp_data, header_cache_t *hc)
 #endif
 
 /**
- * nntp_bcache_delete - Remove bcache file
- * @param id     Body cache ID
- * @param bcache Body cache
- * @param data   NNTP data
+ * nntp_bcache_delete - Remove bcache file - Implements ::bcache_list_t
  * @retval 0 Always
  */
 static int nntp_bcache_delete(const char *id, struct BodyCache *bcache, void *data)
@@ -1098,7 +1086,7 @@ struct NntpServer *nntp_select_server(char *server, bool leave_lock)
   nserv = mutt_mem_calloc(1, sizeof(struct NntpServer));
   nserv->conn = conn;
   nserv->groups_hash = mutt_hash_create(1009, 0);
-  mutt_hash_set_destructor(nserv->groups_hash, nntp_hash_destructor, 0);
+  mutt_hash_set_destructor(nserv->groups_hash, nntp_hash_destructor_t, 0);
   nserv->groups_max = 16;
   nserv->groups_list = mutt_mem_malloc(nserv->groups_max * sizeof(nntp_data));
 
index d2dd1cd1e4e407ff474e94d5a50ddd7ad3faa00a..ca568d18bdb4e9a68afad7d57867969ce1ccc14e 100644 (file)
--- a/pop/pop.c
+++ b/pop/pop.c
@@ -242,12 +242,7 @@ static int fetch_uidl(char *line, void *data)
 }
 
 /**
- * msg_cache_check - Check the Body Cache for an ID
- * @param id     Cache ID
- * @param bcache Body cache
- * @param data   Mailbox Context
- * @retval  0 Success
- * @retval -1 Failure
+ * msg_cache_check - Check the Body Cache for an ID - Implements ::bcache_list_t
  */
 static int msg_cache_check(const char *id, struct BodyCache *bcache, void *data)
 {
@@ -279,11 +274,7 @@ static int msg_cache_check(const char *id, struct BodyCache *bcache, void *data)
 
 #ifdef USE_HCACHE
 /**
- * pop_hcache_namer - Create a header cache filename for a POP mailbox
- * @param path    Path of mailbox
- * @param dest    Buffer for filename
- * @param destlen Length of buffer
- * @retval num Characters written to buffer
+ * pop_hcache_namer - Create a header cache filename for a POP mailbox - Implements ::hcache_namer_t
  */
 static int pop_hcache_namer(const char *path, char *dest, size_t destlen)
 {