]> granicus.if.org Git - neomutt/commitdiff
doxygen: add headers and links
authorRichard Russon <rich@flatcap.org>
Wed, 9 May 2018 16:18:38 +0000 (17:18 +0100)
committerRichard Russon <rich@flatcap.org>
Wed, 9 May 2018 23:30:48 +0000 (00:30 +0100)
hcache/bdb.c
hcache/gdbm.c
hcache/hcache.c
hcache/kc.c
hcache/lmdb.c
hcache/qdbm.c
hcache/tc.c
hook.c

index 1495c322e49c015ce3f12f0c9b732a7f1a7024e8..de82880d3e6f8066993df37b4144488a745ae399 100644 (file)
@@ -55,10 +55,10 @@ struct HcacheDbCtx
 };
 
 /**
- * dbt_init
- * @param dbt
- * @param data
- * @param len
+ * dbt_init - Initialise a BDB context
+ * @param dbt  Context to initialise
+ * @param data ID string to associate
+ * @param len  Length of ID string
  */
 static void dbt_init(DBT *dbt, void *data, size_t len)
 {
@@ -69,8 +69,8 @@ static void dbt_init(DBT *dbt, void *data, size_t len)
 }
 
 /**
- * dbt_empty_init
- * @param dbt
+ * dbt_empty_init - Initialise an empty BDB context
+ * @param dbt  Context to initialise
  */
 static void dbt_empty_init(DBT *dbt)
 {
@@ -79,6 +79,9 @@ static void dbt_empty_init(DBT *dbt)
   dbt->flags = 0;
 }
 
+/**
+ * hcache_bdb_open - Implements #hcache_open_t
+ */
 static void *hcache_bdb_open(const char *path)
 {
   struct stat sb;
@@ -142,6 +145,9 @@ fail_close:
   return NULL;
 }
 
+/**
+ * hcache_bdb_fetch - Implements #hcache_fetch_t
+ */
 static void *hcache_bdb_fetch(void *vctx, const char *key, size_t keylen)
 {
   DBT dkey;
@@ -161,11 +167,17 @@ static void *hcache_bdb_fetch(void *vctx, const char *key, size_t keylen)
   return data.data;
 }
 
+/**
+ * hcache_bdb_free - Implements #hcache_free_t
+ */
 static void hcache_bdb_free(void *vctx, void **data)
 {
   FREE(data);
 }
 
+/**
+ * hcache_bdb_store - Implements #hcache_store_t
+ */
 static int hcache_bdb_store(void *vctx, const char *key, size_t keylen, void *data, size_t dlen)
 {
   DBT dkey;
@@ -186,6 +198,9 @@ static int hcache_bdb_store(void *vctx, const char *key, size_t keylen, void *da
   return ctx->db->put(ctx->db, NULL, &dkey, &databuf, 0);
 }
 
+/**
+ * hcache_bdb_delete - Implements #hcache_delete_t
+ */
 static int hcache_bdb_delete(void *vctx, const char *key, size_t keylen)
 {
   DBT dkey;
@@ -199,6 +214,9 @@ static int hcache_bdb_delete(void *vctx, const char *key, size_t keylen)
   return ctx->db->del(ctx->db, NULL, &dkey, 0);
 }
 
+/**
+ * hcache_bdb_close - Implements #hcache_close_t
+ */
 static void hcache_bdb_close(void **vctx)
 {
   if (!vctx || !*vctx)
@@ -214,6 +232,9 @@ static void hcache_bdb_close(void **vctx)
   FREE(vctx);
 }
 
+/**
+ * hcache_bdb_backend - Implements #hcache_backend_t
+ */
 static const char *hcache_bdb_backend(void)
 {
   return DB_VERSION_STRING;
index 33f100f2ce47e1d4117db81687cf4c8f94964a67..2770eb0832bfa5f526824c01f589189d0bd8b8a5 100644 (file)
@@ -36,6 +36,9 @@
 #include "backend.h"
 #include "globals.h"
 
+/**
+ * hcache_gdbm_open - Implements #hcache_open_t
+ */
 static void *hcache_gdbm_open(const char *path)
 {
   int pagesize;
@@ -51,6 +54,9 @@ static void *hcache_gdbm_open(const char *path)
   return gdbm_open((char *) path, pagesize, GDBM_READER, 00600, NULL);
 }
 
+/**
+ * hcache_gdbm_fetch - Implements #hcache_fetch_t
+ */
 static void *hcache_gdbm_fetch(void *ctx, const char *key, size_t keylen)
 {
   datum dkey;
@@ -67,11 +73,17 @@ static void *hcache_gdbm_fetch(void *ctx, const char *key, size_t keylen)
   return data.dptr;
 }
 
+/**
+ * hcache_gdbm_free - Implements #hcache_free_t
+ */
 static void hcache_gdbm_free(void *vctx, void **data)
 {
   FREE(data);
 }
 
+/**
+ * hcache_gdbm_store - Implements #hcache_store_t
+ */
 static int hcache_gdbm_store(void *ctx, const char *key, size_t keylen, void *data, size_t dlen)
 {
   datum dkey;
@@ -91,6 +103,9 @@ static int hcache_gdbm_store(void *ctx, const char *key, size_t keylen, void *da
   return gdbm_store(db, dkey, databuf, GDBM_REPLACE);
 }
 
+/**
+ * hcache_gdbm_delete - Implements #hcache_delete_t
+ */
 static int hcache_gdbm_delete(void *ctx, const char *key, size_t keylen)
 {
   datum dkey;
@@ -106,6 +121,9 @@ static int hcache_gdbm_delete(void *ctx, const char *key, size_t keylen)
   return gdbm_delete(db, dkey);
 }
 
+/**
+ * hcache_gdbm_close - Implements #hcache_close_t
+ */
 static void hcache_gdbm_close(void **ctx)
 {
   if (!ctx)
@@ -115,6 +133,9 @@ static void hcache_gdbm_close(void **ctx)
   gdbm_close(db);
 }
 
+/**
+ * hcache_gdbm_backend - Implements #hcache_backend_t
+ */
 static const char *hcache_gdbm_backend(void)
 {
   return gdbm_version;
index 33885c444b837487b46adc9fb82dbac3d6e9f3b1..1fedd5ade4a37a090685ce49f4b887ef281d0a9e 100644 (file)
@@ -53,7 +53,7 @@
 #include "envelope.h"
 #include "globals.h"
 #include "hcache.h"
-#include "hcache/hcversion.h"
+#include "hcversion.h"
 #include "header.h"
 #include "protos.h"
 #include "tags.h"
@@ -87,8 +87,14 @@ union Validate {
 HCACHE_BACKEND_LIST
 #undef HCACHE_BACKEND
 
-/* Keep this list sorted as it is in configure.ac to avoid user surprise if no
- * header_cache_backend is specified. */
+#define hcache_get_ops() hcache_get_backend_ops(HeaderCacheBackend)
+
+/**
+ * hcache_ops - Backend implementations
+ *
+ * Keep this list sorted as it is in configure.ac to avoid user surprise if no
+ * header_cache_backend is specified.
+ */
 const struct HcacheOps *hcache_ops[] = {
 #ifdef HAVE_TC
   &hcache_tokyocabinet_ops,
@@ -112,9 +118,9 @@ const struct HcacheOps *hcache_ops[] = {
 };
 
 /**
- * hcache_get_backend_ops
- * @param backend
- * @retval ptr
+ * hcache_get_backend_ops - Get the API functions for an hcache backend
+ * @param backend Name of the backend
+ * @retval ptr Set of function pointers
  */
 static const struct HcacheOps *hcache_get_backend_ops(const char *backend)
 {
@@ -132,12 +138,13 @@ static const struct HcacheOps *hcache_get_backend_ops(const char *backend)
   return *ops;
 }
 
-#define hcache_get_ops() hcache_get_backend_ops(HeaderCacheBackend)
-
 /**
- * lazy_malloc
- * @retval ptr
- * @param siz
+ * lazy_malloc - Allocate some memory
+ * @param siz Minimum size to allocate
+ * @retval ptr Allocated memory
+ *
+ * This block is likely to be lazy_realloc()'d repeatedly.
+ * It starts off with a minimum size of 4KiB.
  */
 static void *lazy_malloc(size_t siz)
 {
@@ -148,9 +155,11 @@ static void *lazy_malloc(size_t siz)
 }
 
 /**
- * lazy_realloc
- * @param ptr
- * @param siz
+ * lazy_realloc - Reallocate some memory
+ * @param ptr Pointer to resize
+ * @param siz Minimum size
+ *
+ * The minimum size is 4KiB to avoid repeated resizing.
  */
 static void lazy_realloc(void *ptr, size_t siz)
 {
@@ -163,11 +172,11 @@ static void lazy_realloc(void *ptr, size_t siz)
 }
 
 /**
- * dump_int
- * @param i
- * @param d
- * @param off
- * @retval ptr
+ * dump_int - Pack an integer into a binary blob
+ * @param i   Integer to save
+ * @param d   Binary blob to add to
+ * @param off Offset into the blob
+ * @retval ptr End of the newly packed binary
  */
 static unsigned char *dump_int(unsigned int i, unsigned char *d, int *off)
 {
@@ -179,10 +188,10 @@ static unsigned char *dump_int(unsigned int i, unsigned char *d, int *off)
 }
 
 /**
- * restore_int
- * @param i
- * @param d
- * @param off
+ * restore_int - Unpack an integer from a binary blob
+ * @param i   Integer to write to
+ * @param d   Binary blob to read from
+ * @param off Offset into the blob
  */
 static void restore_int(unsigned int *i, const unsigned char *d, int *off)
 {
@@ -191,13 +200,13 @@ static void restore_int(unsigned int *i, const unsigned char *d, int *off)
 }
 
 /**
- * dump_char_size
- * @param c
- * @param d
- * @param off
- * @param size
- * @param convert
- * @retval ptr
+ * dump_char_size - Pack a fixed-length string into a binary blob
+ * @param c       String to pack
+ * @param d       Binary blob to add to
+ * @param off     Offset into the blob
+ * @param size    Size of the string
+ * @param convert If true, the strings will be converted to utf-8
+ * @retval ptr End of the newly packed binary
  */
 static unsigned char *dump_char_size(char *c, unsigned char *d, int *off,
                                      ssize_t size, bool convert)
@@ -233,12 +242,12 @@ static unsigned char *dump_char_size(char *c, unsigned char *d, int *off,
 }
 
 /**
- * dump_char
- * @param c
- * @param d
- * @param off
- * @param convert
- * @retval ptr
+ * dump_char - Pack a variable-length string into a binary blob
+ * @param c       String to pack
+ * @param d       Binary blob to add to
+ * @param off     Offset into the blob
+ * @param convert If true, the strings will be converted to utf-8
+ * @retval ptr End of the newly packed binary
  */
 static unsigned char *dump_char(char *c, unsigned char *d, int *off, bool convert)
 {
@@ -246,11 +255,11 @@ static unsigned char *dump_char(char *c, unsigned char *d, int *off, bool conver
 }
 
 /**
- * restore_char
- * @param c
- * @param d
- * @param off
- * @param convert
+ * restore_char - Unpack a variable-length string from a binary blob
+ * @param c       Store the unpacked string here
+ * @param d       Binary blob to read from
+ * @param off     Offset into the blob
+ * @param convert If true, the strings will be converted to utf-8
  */
 static void restore_char(char **c, const unsigned char *d, int *off, bool convert)
 {
@@ -281,12 +290,12 @@ static void restore_char(char **c, const unsigned char *d, int *off, bool conver
 }
 
 /**
- * dump_address
- * @param a
- * @param d
- * @param off
- * @param convert
- * @retval ptr
+ * dump_address - Pack an Address into a binary blob
+ * @param a       Address to pack
+ * @param d       Binary blob to add to
+ * @param off     Offset into the blob
+ * @param convert If true, the strings will be converted to utf-8
+ * @retval ptr End of the newly packed binary
  */
 static unsigned char *dump_address(struct Address *a, unsigned char *d, int *off, bool convert)
 {
@@ -310,11 +319,11 @@ static unsigned char *dump_address(struct Address *a, unsigned char *d, int *off
 }
 
 /**
- * restore_address
- * @param a
- * @param d
- * @param off
- * @param convert
+ * restore_address - Unpack an Address from a binary blob
+ * @param a       Store the unpacked Address here
+ * @param d       Binary blob to read from
+ * @param off     Offset into the blob
+ * @param convert If true, the strings will be converted from utf-8
  */
 static void restore_address(struct Address **a, const unsigned char *d, int *off, bool convert)
 {
@@ -366,7 +375,7 @@ static unsigned char *dump_stailq(struct ListHead *l, unsigned char *d, int *off
  * restore_stailq - Unpack a STAILQ from a binary blob
  * @param l       List to add to
  * @param d       Binary blob to read from
- * @param off     Offset into blob
+ * @param off     Offset into the blob
  * @param convert If true, the strings will be converted from utf-8
  */
 static void restore_stailq(struct ListHead *l, const unsigned char *d, int *off, bool convert)
@@ -385,12 +394,12 @@ static void restore_stailq(struct ListHead *l, const unsigned char *d, int *off,
 }
 
 /**
- * dump_buffer
- * @param b
- * @param d
- * @param off
- * @param convert
- * @retval ptr
+ * dump_buffer - Pack a Buffer into a binary blob
+ * @param b       Buffer to pack
+ * @param d       Binary blob to add to
+ * @param off     Offset into the blob
+ * @param convert If true, the strings will be converted to utf-8
+ * @retval ptr End of the newly packed binary
  */
 static unsigned char *dump_buffer(struct Buffer *b, unsigned char *d, int *off, bool convert)
 {
@@ -411,11 +420,11 @@ static unsigned char *dump_buffer(struct Buffer *b, unsigned char *d, int *off,
 }
 
 /**
- * restore_buffer
- * @param b
- * @param d
- * @param off
- * @param convert
+ * restore_buffer - Unpack a Buffer from a binary blob
+ * @param b       Store the unpacked Buffer here
+ * @param d       Binary blob to read from
+ * @param off     Offset into the blob
+ * @param convert If true, the strings will be converted from utf-8
  */
 static void restore_buffer(struct Buffer **b, const unsigned char *d, int *off, bool convert)
 {
@@ -439,12 +448,12 @@ static void restore_buffer(struct Buffer **b, const unsigned char *d, int *off,
 }
 
 /**
- * dump_parameter
- * @param p
- * @param d
- * @param off
- * @param convert
- * @retval ptr
+ * dump_parameter - Pack a Parameter into a binary blob
+ * @param p       Parameter to pack
+ * @param d       Binary blob to add to
+ * @param off     Offset into the blob
+ * @param convert If true, the strings will be converted to utf-8
+ * @retval ptr End of the newly packed binary
  */
 static unsigned char *dump_parameter(struct ParameterList *p, unsigned char *d,
                                      int *off, bool convert)
@@ -468,11 +477,11 @@ static unsigned char *dump_parameter(struct ParameterList *p, unsigned char *d,
 }
 
 /**
- * restore_parameter
- * @param p
- * @param d
- * @param off
- * @param convert
+ * restore_parameter - Unpack a Parameter from a binary blob
+ * @param p       Store the unpacked Parameter here
+ * @param d       Binary blob to read from
+ * @param off     Offset into the blob
+ * @param convert If true, the strings will be converted from utf-8
  */
 static void restore_parameter(struct ParameterList *p, const unsigned char *d,
                               int *off, bool convert)
@@ -493,12 +502,12 @@ static void restore_parameter(struct ParameterList *p, const unsigned char *d,
 }
 
 /**
- * dump_body
- * @param c
- * @param d
- * @param off
- * @param convert
- * @retval ptr
+ * dump_body - Pack an Body into a binary blob
+ * @param c       Body to pack
+ * @param d       Binary blob to add to
+ * @param off     Offset into the blob
+ * @param convert If true, the strings will be converted to utf-8
+ * @retval ptr End of the newly packed binary
  */
 static unsigned char *dump_body(struct Body *c, unsigned char *d, int *off, bool convert)
 {
@@ -532,11 +541,11 @@ static unsigned char *dump_body(struct Body *c, unsigned char *d, int *off, bool
 }
 
 /**
- * restore_body
- * @param c
- * @param d
- * @param off
- * @param convert
+ * restore_body - Unpack a Body from a binary blob
+ * @param c       Store the unpacked Body here
+ * @param d       Binary blob to read from
+ * @param off     Offset into the blob
+ * @param convert If true, the strings will be converted from utf-8
  */
 static void restore_body(struct Body *c, const unsigned char *d, int *off, bool convert)
 {
@@ -556,12 +565,12 @@ static void restore_body(struct Body *c, const unsigned char *d, int *off, bool
 }
 
 /**
- * dump_envelope
- * @param e
- * @param d
- * @param off
- * @param convert
- * @retval ptr
+ * dump_envelope - Pack an Envelope into a binary blob
+ * @param e       Envelope to pack
+ * @param d       Binary blob to add to
+ * @param off     Offset into the blob
+ * @param convert If true, the strings will be converted to utf-8
+ * @retval ptr End of the newly packed binary
  */
 static unsigned char *dump_envelope(struct Envelope *e, unsigned char *d, int *off, bool convert)
 {
@@ -603,11 +612,11 @@ static unsigned char *dump_envelope(struct Envelope *e, unsigned char *d, int *o
 }
 
 /**
- * restore_envelope
- * @param e
- * @param d
- * @param off
- * @param convert
+ * restore_envelope - Unpack an Envelope from a binary blob
+ * @param e       Store the unpacked Envelope here
+ * @param d       Binary blob to read from
+ * @param off     Offset into the blob
+ * @param convert If true, the strings will be converted from utf-8
  */
 static void restore_envelope(struct Envelope *e, const unsigned char *d, int *off, bool convert)
 {
@@ -650,10 +659,10 @@ static void restore_envelope(struct Envelope *e, const unsigned char *d, int *of
 }
 
 /**
- * crc_matches
- * @param d
- * @param crc
- * @retval num
+ * crc_matches - Is the CRC number correct?
+ * @param d   Binary blob to read CRC from
+ * @param crc CRC to compare
+ * @retval num 1 if true, 0 if not
  */
 static int crc_matches(const char *d, unsigned int crc)
 {
@@ -705,7 +714,7 @@ static bool create_hcache_dir(const char *path)
  * Generate the pathname for the hcache database, it will be of the form:
  *     BASE/FOLDER/NAME-SUFFIX
  *
- * * BASE:  Base directory (@a path)
+ * * BASE:   Base directory (@a path)
  * * FOLDER: Mailbox name (@a folder)
  * * NAME:   Create by @a namer, or md5sum of @a folder
  * * SUFFIX: Character set (if ICONV isn't being used)
@@ -768,11 +777,11 @@ static const char *hcache_per_folder(const char *path, const char *folder, hcach
 
 /**
  * hcache_dump - Serialise a Header object
- * @param h
- * @param header
- * @param off
- * @param uidvalidity
- * @retval ptr
+ * @param h           Header cache handle
+ * @param header      Header to serialise
+ * @param off         Size of the binary blob
+ * @param uidvalidity IMAP server identifier
+ * @retval ptr Binary blob representing the Header
  *
  * This function transforms a header into a char so that it is useable by
  * db_store.
@@ -835,6 +844,11 @@ static void *hcache_dump(header_cache_t *h, struct Header *header, int *off,
   return d;
 }
 
+/**
+ * mutt_hcache_restore - Deserialise a Header object
+ * @param d Binary blob
+ * @retval ptr Reconstructed Header
+ */
 struct Header *mutt_hcache_restore(const unsigned char *d)
 {
   int off = 0;
@@ -862,9 +876,9 @@ struct Header *mutt_hcache_restore(const unsigned char *d)
 }
 
 /**
- * get_foldername
- * @param folder
- * @retval ptr
+ * get_foldername - Where should the cache be stored?
+ * @param folder Path to be canonicalised
+ * @retval ptr New string with canonical path
  */
 static char *get_foldername(const char *folder)
 {
@@ -877,6 +891,9 @@ static char *get_foldername(const char *folder)
   return p;
 }
 
+/**
+ * mutt_hcache_open - Multiplexor for #hcache_open_t
+ */
 header_cache_t *mutt_hcache_open(const char *path, const char *folder, hcache_namer_t namer)
 {
   const struct HcacheOps *ops = hcache_get_ops();
@@ -952,6 +969,9 @@ header_cache_t *mutt_hcache_open(const char *path, const char *folder, hcache_na
   }
 }
 
+/**
+ * mutt_hcache_close - Multiplexor for #hcache_close_t
+ */
 void mutt_hcache_close(header_cache_t *h)
 {
   const struct HcacheOps *ops = hcache_get_ops();
@@ -963,6 +983,9 @@ void mutt_hcache_close(header_cache_t *h)
   FREE(&h);
 }
 
+/**
+ * mutt_hcache_fetch - Multiplexor for #hcache_fetch_t
+ */
 void *mutt_hcache_fetch(header_cache_t *h, const char *key, size_t keylen)
 {
   void *data = mutt_hcache_fetch_raw(h, key, keylen);
@@ -980,6 +1003,12 @@ void *mutt_hcache_fetch(header_cache_t *h, const char *key, size_t keylen)
   return data;
 }
 
+/**
+ * mutt_hcache_fetch_raw - Find the data for a key in a database backend
+ * @param h      Header cache handle
+ * @param key    A message identification string
+ * @param keylen The length of the string pointed to by key
+ */
 void *mutt_hcache_fetch_raw(header_cache_t *h, const char *key, size_t keylen)
 {
   char path[_POSIX_PATH_MAX];
@@ -993,6 +1022,9 @@ void *mutt_hcache_fetch_raw(header_cache_t *h, const char *key, size_t keylen)
   return ops->fetch(h->ctx, path, keylen);
 }
 
+/**
+ * mutt_hcache_free - Multiplexor for #hcache_free_t
+ */
 void mutt_hcache_free(header_cache_t *h, void **data)
 {
   const struct HcacheOps *ops = hcache_get_ops();
@@ -1003,6 +1035,9 @@ void mutt_hcache_free(header_cache_t *h, void **data)
   ops->free(h->ctx, data);
 }
 
+/**
+ * mutt_hcache_store - Multiplexor for #hcache_store_t
+ */
 int mutt_hcache_store(header_cache_t *h, const char *key, size_t keylen,
                       struct Header *header, unsigned int uidvalidity)
 {
@@ -1021,6 +1056,16 @@ int mutt_hcache_store(header_cache_t *h, const char *key, size_t keylen,
   return ret;
 }
 
+/**
+ * mutt_hcache_store_raw - Store some data in a database backend
+ * @param h      Header cache handle
+ * @param key    A message identification string
+ * @param keylen The length of the string pointed to by key
+ * @param data   Binary blob
+ * @param dlen   Length of binary blob
+ * @retval 0   Success
+ * @retval num Generic or backend-specific error code otherwise
+ */
 int mutt_hcache_store_raw(header_cache_t *h, const char *key, size_t keylen,
                           void *data, size_t dlen)
 {
@@ -1035,6 +1080,9 @@ int mutt_hcache_store_raw(header_cache_t *h, const char *key, size_t keylen,
   return ops->store(h->ctx, path, keylen, data, dlen);
 }
 
+/**
+ * mutt_hcache_delete - Multiplexor for #hcache_delete_t
+ */
 int mutt_hcache_delete(header_cache_t *h, const char *key, size_t keylen)
 {
   char path[_POSIX_PATH_MAX];
@@ -1048,6 +1096,12 @@ int mutt_hcache_delete(header_cache_t *h, const char *key, size_t keylen)
   return ops->delete (h->ctx, path, keylen);
 }
 
+/**
+ * mutt_hcache_backend_list - Get a list of backend names
+ * @retval ptr Comma-space-separated list of names
+ *
+ * The caller should free the string.
+ */
 const char *mutt_hcache_backend_list(void)
 {
   char tmp[STRING] = { 0 };
@@ -1066,6 +1120,11 @@ const char *mutt_hcache_backend_list(void)
   return mutt_str_strdup(tmp);
 }
 
+/**
+ * mutt_hcache_is_valid_backend - Is this a valid hcache backend name?
+ * @param s Name to check
+ * @retval num 1 if valid, 0 if not
+ */
 int mutt_hcache_is_valid_backend(const char *s)
 {
   return hcache_get_backend_ops(s) != NULL;
index 57fb71cefe3973904d4a6929a09ae8ca100192d9..1fe6adb896ce04ee3e2acafcd1b7909f94411857 100644 (file)
@@ -37,6 +37,9 @@
 #include "backend.h"
 #include "options.h"
 
+/**
+ * hcache_kyotocabinet_open - Implements #hcache_open_t
+ */
 static void *hcache_kyotocabinet_open(const char *path)
 {
   char kcdbpath[_POSIX_PATH_MAX];
@@ -64,6 +67,9 @@ static void *hcache_kyotocabinet_open(const char *path)
   }
 }
 
+/**
+ * hcache_kyotocabinet_fetch - Implements #hcache_fetch_t
+ */
 static void *hcache_kyotocabinet_fetch(void *ctx, const char *key, size_t keylen)
 {
   size_t sp;
@@ -75,12 +81,18 @@ static void *hcache_kyotocabinet_fetch(void *ctx, const char *key, size_t keylen
   return kcdbget(db, key, keylen, &sp);
 }
 
+/**
+ * hcache_kyotocabinet_free - Implements #hcache_free_t
+ */
 static void hcache_kyotocabinet_free(void *vctx, void **data)
 {
   kcfree(*data);
   *data = NULL;
 }
 
+/**
+ * hcache_kyotocabinet_store - Implements #hcache_store_t
+ */
 static int hcache_kyotocabinet_store(void *ctx, const char *key, size_t keylen,
                                      void *data, size_t dlen)
 {
@@ -96,6 +108,9 @@ static int hcache_kyotocabinet_store(void *ctx, const char *key, size_t keylen,
   return 0;
 }
 
+/**
+ * hcache_kyotocabinet_delete - Implements #hcache_delete_t
+ */
 static int hcache_kyotocabinet_delete(void *ctx, const char *key, size_t keylen)
 {
   if (!ctx)
@@ -110,6 +125,9 @@ static int hcache_kyotocabinet_delete(void *ctx, const char *key, size_t keylen)
   return 0;
 }
 
+/**
+ * hcache_kyotocabinet_close - Implements #hcache_close_t
+ */
 static void hcache_kyotocabinet_close(void **ctx)
 {
   if (!ctx || !*ctx)
@@ -124,6 +142,9 @@ static void hcache_kyotocabinet_close(void **ctx)
   kcdbdel(db);
 }
 
+/**
+ * hcache_kyotocabinet_backend - Implements #hcache_backend_t
+ */
 static const char *hcache_kyotocabinet_backend(void)
 {
   /* SHORT_STRING(128) should be more than enough for KCVERSION */
index 6c6c54387f7a379d455108b0d75a15b3878fbd3a..5b43a2289c22fd2a7892c48bf3611fac27bc8dfa 100644 (file)
@@ -61,9 +61,9 @@ struct HcacheLmdbCtx
 };
 
 /**
- * mdb_get_r_txn
- * @retval num
- * @param ctx
+ * mdb_get_r_txn - Get an LMDB read transaction
+ * @param ctx LMDB context
+ * @retval num LMDB return code, e.g. MDB_SUCCESS
  */
 static int mdb_get_r_txn(struct HcacheLmdbCtx *ctx)
 {
@@ -87,9 +87,9 @@ static int mdb_get_r_txn(struct HcacheLmdbCtx *ctx)
 }
 
 /**
- * mdb_get_w_txn
- * @retval num
- * @param ctx
+ * mdb_get_w_txn - Get an LMDB write transaction
+ * @param ctx LMDB context
+ * @retval num LMDB return code, e.g. MDB_SUCCESS
  */
 static int mdb_get_w_txn(struct HcacheLmdbCtx *ctx)
 {
@@ -113,6 +113,9 @@ static int mdb_get_w_txn(struct HcacheLmdbCtx *ctx)
   return rc;
 }
 
+/**
+ * hcache_lmdb_open - Implements #hcache_open_t
+ */
 static void *hcache_lmdb_open(const char *path)
 {
   int rc;
@@ -165,6 +168,9 @@ fail_env:
   return NULL;
 }
 
+/**
+ * hcache_lmdb_fetch - Implements #hcache_fetch_t
+ */
 static void *hcache_lmdb_fetch(void *vctx, const char *key, size_t keylen)
 {
   MDB_val dkey;
@@ -201,11 +207,17 @@ static void *hcache_lmdb_fetch(void *vctx, const char *key, size_t keylen)
   return data.mv_data;
 }
 
+/**
+ * hcache_lmdb_free - Implements #hcache_free_t
+ */
 static void hcache_lmdb_free(void *vctx, void **data)
 {
   /* LMDB data is owned by the database */
 }
 
+/**
+ * hcache_lmdb_store - Implements #hcache_store_t
+ */
 static int hcache_lmdb_store(void *vctx, const char *key, size_t keylen, void *data, size_t dlen)
 {
   MDB_val dkey;
@@ -238,6 +250,9 @@ static int hcache_lmdb_store(void *vctx, const char *key, size_t keylen, void *d
   return rc;
 }
 
+/**
+ * hcache_lmdb_delete - Implements #hcache_delete_t
+ */
 static int hcache_lmdb_delete(void *vctx, const char *key, size_t keylen)
 {
   MDB_val dkey;
@@ -268,6 +283,9 @@ static int hcache_lmdb_delete(void *vctx, const char *key, size_t keylen)
   return rc;
 }
 
+/**
+ * hcache_lmdb_close - Implements #hcache_close_t
+ */
 static void hcache_lmdb_close(void **vctx)
 {
   if (!vctx || !*vctx)
@@ -286,6 +304,9 @@ static void hcache_lmdb_close(void **vctx)
   FREE(vctx);
 }
 
+/**
+ * hcache_lmdb_backend - Implements #hcache_backend_t
+ */
 static const char *hcache_lmdb_backend(void)
 {
   return "lmdb " MDB_VERSION_STRING;
index 3cf8e28a306d2c67dd84c80b203c6a30f257cb8d..6ee1e48bb65377c1c66d58d0ddc5294d5c43bcff 100644 (file)
@@ -37,6 +37,9 @@
 #include "backend.h"
 #include "options.h"
 
+/**
+ * hcache_qdbm_open - Implements #hcache_open_t
+ */
 static void *hcache_qdbm_open(const char *path)
 {
   int flags = VL_OWRITER | VL_OCREAT;
@@ -47,6 +50,9 @@ static void *hcache_qdbm_open(const char *path)
   return vlopen(path, flags, VL_CMPLEX);
 }
 
+/**
+ * hcache_qdbm_fetch - Implements #hcache_fetch_t
+ */
 static void *hcache_qdbm_fetch(void *ctx, const char *key, size_t keylen)
 {
   if (!ctx)
@@ -56,11 +62,17 @@ static void *hcache_qdbm_fetch(void *ctx, const char *key, size_t keylen)
   return vlget(db, key, keylen, NULL);
 }
 
+/**
+ * hcache_qdbm_free - Implements #hcache_free_t
+ */
 static void hcache_qdbm_free(void *ctx, void **data)
 {
   FREE(data);
 }
 
+/**
+ * hcache_qdbm_store - Implements #hcache_store_t
+ */
 static int hcache_qdbm_store(void *ctx, const char *key, size_t keylen, void *data, size_t dlen)
 {
   if (!ctx)
@@ -73,6 +85,9 @@ static int hcache_qdbm_store(void *ctx, const char *key, size_t keylen, void *da
   return success ? 0 : dpecode ? dpecode : -1;
 }
 
+/**
+ * hcache_qdbm_delete - Implements #hcache_delete_t
+ */
 static int hcache_qdbm_delete(void *ctx, const char *key, size_t keylen)
 {
   if (!ctx)
@@ -85,6 +100,9 @@ static int hcache_qdbm_delete(void *ctx, const char *key, size_t keylen)
   return success ? 0 : dpecode ? dpecode : -1;
 }
 
+/**
+ * hcache_qdbm_close - Implements #hcache_close_t
+ */
 static void hcache_qdbm_close(void **ctx)
 {
   if (!ctx || !*ctx)
@@ -94,6 +112,9 @@ static void hcache_qdbm_close(void **ctx)
   vlclose(db);
 }
 
+/**
+ * hcache_qdbm_backend - Implements #hcache_backend_t
+ */
 static const char *hcache_qdbm_backend(void)
 {
   return "qdbm " _QDBM_VERSION;
index 702ea09928933687ce9a3ff23d1bdcfec697eee5..521cfde8790d14df4dd35811f9935e0527050179 100644 (file)
@@ -37,6 +37,9 @@
 #include "backend.h"
 #include "options.h"
 
+/**
+ * hcache_tokyocabinet_open - Implements #hcache_open_t
+ */
 static void *hcache_tokyocabinet_open(const char *path)
 {
   TCBDB *db = tcbdbnew();
@@ -56,6 +59,9 @@ static void *hcache_tokyocabinet_open(const char *path)
   }
 }
 
+/**
+ * hcache_tokyocabinet_fetch - Implements #hcache_fetch_t
+ */
 static void *hcache_tokyocabinet_fetch(void *ctx, const char *key, size_t keylen)
 {
   int sp;
@@ -67,11 +73,17 @@ static void *hcache_tokyocabinet_fetch(void *ctx, const char *key, size_t keylen
   return tcbdbget(db, key, keylen, &sp);
 }
 
+/**
+ * hcache_tokyocabinet_free - Implements #hcache_free_t
+ */
 static void hcache_tokyocabinet_free(void *ctx, void **data)
 {
   FREE(data);
 }
 
+/**
+ * hcache_tokyocabinet_store - Implements #hcache_store_t
+ */
 static int hcache_tokyocabinet_store(void *ctx, const char *key, size_t keylen,
                                      void *data, size_t dlen)
 {
@@ -87,6 +99,9 @@ static int hcache_tokyocabinet_store(void *ctx, const char *key, size_t keylen,
   return 0;
 }
 
+/**
+ * hcache_tokyocabinet_delete - Implements #hcache_delete_t
+ */
 static int hcache_tokyocabinet_delete(void *ctx, const char *key, size_t keylen)
 {
   if (!ctx)
@@ -101,6 +116,9 @@ static int hcache_tokyocabinet_delete(void *ctx, const char *key, size_t keylen)
   return 0;
 }
 
+/**
+ * hcache_tokyocabinet_close - Implements #hcache_close_t
+ */
 static void hcache_tokyocabinet_close(void **ctx)
 {
   if (!ctx || !*ctx)
@@ -115,6 +133,9 @@ static void hcache_tokyocabinet_close(void **ctx)
   tcbdbdel(db);
 }
 
+/**
+ * hcache_tokyocabinet_backend - Implements #hcache_backend_t
+ */
 static const char *hcache_tokyocabinet_backend(void)
 {
   return "tokyocabinet " _TC_VERSION;
diff --git a/hook.c b/hook.c
index a910f05a37eedf6a437f1c971686490fa4c5608a..453adcac2148f8d2d7ad169afd3e8082cdbde1c3 100644 (file)
--- a/hook.c
+++ b/hook.c
@@ -295,9 +295,9 @@ static void delete_hook(struct Hook *h)
 
 /**
  * mutt_delete_hooks - Delete matching hooks
- * @param type
- * * Hook type to delete, e.g. #MUTT_SENDHOOK
- * * Or, 0 to delete all hooks
+ * @param type Hook type to delete, e.g. #MUTT_SENDHOOK
+ *
+ * If 0 is passed, all the hooks will be deleted.
  */
 void mutt_delete_hooks(int type)
 {