doxy: add function comments
authorRichard Russon <rich@flatcap.org>
Fri, 8 Jun 2018 14:13:17 +0000 (15:13 +0100)
committerRichard Russon <rich@flatcap.org>
Mon, 11 Jun 2018 10:52:42 +0000 (11:52 +0100)
13 files changed:
addrbook.c
alias.c
hook.c
main.c
mbox.c
mutt/file.c
ncrypt/cryptglue.c
ncrypt/gnupgparse.c
ncrypt/pgp.c
ncrypt/pgppacket.c
rfc2047.c
score.c
wcscasecmp.c

index b9c28d2538471bb589fae75b4745ab78a227f6af..88a0904c6ce861e004ca9278af53181e3408df5e 100644 (file)
@@ -162,7 +162,7 @@ static int alias_sort_alias(const void *a, const void *b)
 }
 
 /**
- * address_sort_address - Compare two Addresses
+ * alias_sort_address - Compare two Addresses
  * @param a First  Address to compare
  * @param b Second Address to compare
  * @retval -1 a precedes b
diff --git a/alias.c b/alias.c
index 6ddbba65db5a073966984add5321bacc9dcb6104..1104469304c85bfaef8f907ac3575e25e731271f 100644 (file)
--- a/alias.c
+++ b/alias.c
@@ -160,9 +160,12 @@ static void write_safe_address(FILE *fp, char *s)
 }
 
 /**
- * recode_buf - XXX
+ * recode_buf - Convert some text between two character sets
  * @param buf    Buffer to convert
  * @param buflen Length of buffer
+ *
+ * The 'from' charset is controlled by the 'charset'        config variable.
+ * The 'to'   charset is controlled by the 'config_charset' config variable.
  */
 static void recode_buf(char *buf, size_t buflen)
 {
@@ -285,7 +288,7 @@ struct Address *mutt_expand_aliases(struct Address *a)
 }
 
 /**
- * mutt_expand_aliases_env - XXX
+ * mutt_expand_aliases_env - Expand aliases in all the fields of an Envelope
  * @param env Envelope to expand
  */
 void mutt_expand_aliases_env(struct Envelope *env)
diff --git a/hook.c b/hook.c
index 18aea1fe29da2f495df5d0950c6e1ccca544357a..8ba9433db4e4d238614fd9786681fae5cfb6ea62 100644 (file)
--- a/hook.c
+++ b/hook.c
@@ -663,6 +663,12 @@ void mutt_account_hook(const char *url)
 }
 #endif
 
+/**
+ * mutt_timeout_hook - Execute any timeout hooks
+ *
+ * The user can configure hooks to be run on timeout.
+ * This function finds all the matching hooks and executes them.
+ */
 void mutt_timeout_hook(void)
 {
   struct Hook *hook = NULL;
diff --git a/main.c b/main.c
index 1334791dfd9052c1be02622635275fc1654d743a..971a301e95218df7a0c0126ea1eccc6c681ae5a0 100644 (file)
--- a/main.c
+++ b/main.c
@@ -167,6 +167,11 @@ static void usage(void)
 }
 // clang-format on
 
+/**
+ * start_curses - Start the curses or slang UI
+ * @retval 0 Success
+ * @retval 1 Failure
+ */
 static int start_curses(void)
 {
   km_init(); /* must come before mutt_init */
diff --git a/mbox.c b/mbox.c
index e0268a511662bd98567d55f5f02195371c270cfe..09a5cbfb811eb92fcd79f0eb336da185277c7ee6 100644 (file)
--- a/mbox.c
+++ b/mbox.c
@@ -86,6 +86,10 @@ static int mbox_lock_mailbox(struct Context *ctx, int excl, int retry)
   return r;
 }
 
+/**
+ * mbox_unlock_mailbox - Unlock a mailbox
+ * @param ctx Context to unlock
+ */
 static void mbox_unlock_mailbox(struct Context *ctx)
 {
   if (ctx->locked)
@@ -97,6 +101,13 @@ static void mbox_unlock_mailbox(struct Context *ctx)
   }
 }
 
+/**
+ * mmdf_parse_mailbox - Read a mailbox in MMDF format
+ * @param ctx Mailbox
+ * @retval  0 Success
+ * @retval -1 Failure
+ * @retval -2 Aborted
+ */
 static int mmdf_parse_mailbox(struct Context *ctx)
 {
   char buf[HUGE_STRING];
index 52199b509b5c3ccebfb582f534c619968fabc1bf..96b6cf2efdc57439f9174b3438248090eeeb6c37 100644 (file)
@@ -955,7 +955,7 @@ void mutt_file_set_mtime(const char *from, const char *to)
 
 /**
  * mutt_file_touch_atime - Set the access time to current time
- * @param f File descriptor of the file to alter
+ * @param fd File descriptor of the file to alter
  *
  * This is just as read() would do on !noatime.
  * Silently ignored if futimens() isn't supported.
index 6e0c4869c5a0adb037c16b7364cb3f9f3734485f..8c0ab64f652261310d3f3dc88dabc76af3cfbacb 100644 (file)
 /**
  * @page crypt_cryptglue Wrapper around crypto functions
  *
- * This file dispatches the generic crypto functions to the implemented backend
- * or provides dummy stubs.  Note, that some generic functions are handled in
- * crypt.c.
+ * This file dispatches the generic crypto functions to the implemented
+ * backend or provides dummy stubs.
+ *
+ * @note Some generic functions are handled in crypt.c
  *
  * @note This file has been changed to make use of the new module system.
  * Consequently there's a 1:1 mapping between the functions contained in this
index 885baed6a6eff039709f0207f48c23525f3b0804..e87b1d8c396f520fe99b260b99d43a936f5a306a 100644 (file)
  *   - signature class
  */
 
-/* decode the backslash-escaped user ids. */
-
 static char *chs = NULL;
 
+/**
+ * fix_uid - Decode backslash-escaped user ids (in place)
+ * @param uid String to decode
+ */
 static void fix_uid(char *uid)
 {
   char *s = NULL, *d = NULL;
@@ -115,6 +117,14 @@ static void fix_uid(char *uid)
   }
 }
 
+/**
+ * parse_pub_line - Parse the 'pub' line from the pgp output
+ * @param[in]  buf       Buffer containing string to parse
+ * @param[out] is_subkey Is this a subkey of another key?
+ * @param[in]  k         Key to from which to merge info (optional)
+ * @retval ptr  PgpKeyInfo containing the (merged) results
+ * @retval NULL Error
+ */
 static struct PgpKeyInfo *parse_pub_line(char *buf, int *is_subkey, struct PgpKeyInfo *k)
 {
   struct PgpUid *uid = NULL;
index ad429af5e8e5382e458331fefb103e196abea777..1e690b72715728ee0fd97638a010d681071d4a20 100644 (file)
@@ -26,8 +26,8 @@
  * @page crypt_pgp PGP sign, encrypt, check routines
  *
  * This file contains all of the PGP routines necessary to sign, encrypt,
- * verify and decrypt PGP messages in either the new PGP/MIME format, or in the
- * older Application/Pgp format.  It also contains some code to cache the
+ * verify and decrypt PGP messages in either the new PGP/MIME format, or in
+ * the older Application/Pgp format.  It also contains some code to cache the
  * user's passphrase for repeat use when decrypting or signing a message.
  */
 
index 6038589edfbf56009ad175bbf458cc9c008d5f45..9ad9b7088dad385aed5b66d768e83155f108c75e 100644 (file)
 #include <stdlib.h>
 #include "mutt/mutt.h"
 
-#define CHUNKSIZE 1024
+#define CHUNKSIZE 1024 /**< Amount of data to read at once */
 
-static unsigned char *pbuf = NULL;
-static size_t plen = 0;
+static unsigned char *pbuf = NULL; /**< Cache PGP data packet */
+static size_t plen = 0;            /**< Length of cached packet */
 
+/**
+ * read_material - Read PGP data into a buffer
+ * @param[in]     material Number of bytes to read
+ * @param[in,out] used     Number of bytes already read
+ * @param[in]     fp       File to read from
+ * @retval  0 Success
+ * @retval -1 Failure (see errno)
+ *
+ * This function uses a cache to store the data: #pbuf, #plen.
+ */
 static int read_material(size_t material, size_t *used, FILE *fp)
 {
   if (*used + material >= plen)
@@ -63,6 +73,13 @@ static int read_material(size_t material, size_t *used, FILE *fp)
   return 0;
 }
 
+/**
+ * pgp_read_packet - Read a PGP packet from a file
+ * @param[in]  fp  File to read from
+ * @param[out] len Number of bytes read
+ *
+ * This function uses a cache to store the data: #pbuf, #plen.
+ */
 unsigned char *pgp_read_packet(FILE *fp, size_t *len)
 {
   size_t used = 0;
@@ -213,6 +230,11 @@ bail:
   return NULL;
 }
 
+/**
+ * pgp_release_packet - Free the cached PGP packet
+ *
+ * Free the data stored in #pbuf.
+ */
 void pgp_release_packet(void)
 {
   plen = 0;
index 9e88f6a305cd06777d6b423a6a1fa15fe9549c52..3ba9200d9c7dd6591dd89e4d5b6900cce653de72 100644 (file)
--- a/rfc2047.c
+++ b/rfc2047.c
 
 #include <string.h>
 
+/**
+ * rfc2047_encode_addrlist - Encode any RFC2047 headers, where required, in an Address list
+ * @param addr Address list
+ * @param tag  Header tag (used for wrapping calculation)
+ */
 void rfc2047_encode_addrlist(struct Address *addr, const char *tag)
 {
   struct Address *ptr = addr;
@@ -44,6 +49,10 @@ void rfc2047_encode_addrlist(struct Address *addr, const char *tag)
   }
 }
 
+/**
+ * rfc2047_decode_addrlist - Decode any RFC2047 headers in an Address list
+ * @param a Address list
+ */
 void rfc2047_decode_addrlist(struct Address *a)
 {
   while (a)
diff --git a/score.c b/score.c
index a52f67ce38e410a6ef56bbf5d91721fc980b61e2..2c48f8490b110787235551d8c101256fccc793a4 100644 (file)
--- a/score.c
+++ b/score.c
@@ -50,6 +50,10 @@ struct Score
 
 static struct Score *ScoreList = NULL;
 
+/**
+ * mutt_check_rescore - Do the emails need to have their scores recalculated?
+ * @param ctx Mailbox
+ */
 void mutt_check_rescore(struct Context *ctx)
 {
   if (OptNeedRescore && Score)
index 939f556a348c82c94adbe793840c712a58624831..5156e5eaec1a6e09976e92bc46a94be90de08d6c 100644 (file)
 #include <stddef.h>
 #include <wctype.h>
 
+/**
+ * wcscasecmp - Compare two wide-character strings, ignoring case
+ * @param a First string
+ * @param b Second string
+ * @retval -1 a precedes b
+ * @retval  0 a and b are identical
+ * @retval  1 b precedes a
+ */
 int wcscasecmp(const wchar_t *a, const wchar_t *b)
 {
   if (!a && !b)