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);
};
/**
- * 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
}
/**
- * 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)
{
* 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)
*
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);
/**
}
/**
- * 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)
#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)
{
* @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;
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
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;
};
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);
/**
}
/**
- * 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);
}
#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)
{
#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)
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));
}
/**
- * 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)
{
#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)
{