From: Richard Russon Date: Thu, 19 Apr 2018 16:38:59 +0000 (+0100) Subject: doxygen: Fix, improve, tidy comment blocks X-Git-Tag: neomutt-20180512~45 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dede661b81764a154ed51dd0b83433c7b0f9faa7;p=neomutt doxygen: Fix, improve, tidy comment blocks --- diff --git a/attach.c b/attach.c index 87084c392..186e1e01d 100644 --- a/attach.c +++ b/attach.c @@ -350,9 +350,9 @@ void mutt_check_lookup_list(struct Body *b, char *type, size_t len) * @param flag Option flag for how the attachment should be viewed * @param hdr Message header for the current message. Can be NULL * @param actx Attachment context - * @retval 0 If the viewer is run and exited successfully - * @retval -1 Error - * @retval n Return value of mutt_do_pager() when it is used + * @retval 0 If the viewer is run and exited successfully + * @retval -1 Error + * @retval num Return value of mutt_do_pager() when it is used * * flag can be one of: #MUTT_MAILCAP, #MUTT_REGULAR, #MUTT_AS_TEXT * @@ -639,8 +639,8 @@ return_error: /** * mutt_pipe_attachment - Pipe an attachment to a command - * @retval 1 on success - * @retval 0 on error + * @retval 1 Success + * @retval 0 Error */ int mutt_pipe_attachment(FILE *fp, struct Body *b, const char *path, char *outfile) { @@ -876,8 +876,8 @@ int mutt_save_attachment(FILE *fp, struct Body *m, char *path, int flags, struct /** * mutt_decode_save_attachment - Decode, then save an attachment - * @retval 0 on success - * @retval -1 on error + * @retval 0 Success + * @retval -1 Error */ int mutt_decode_save_attachment(FILE *fp, struct Body *m, char *path, int displaying, int flags) { diff --git a/bcache.h b/bcache.h index 6626e263f..2da3548e6 100644 --- a/bcache.h +++ b/bcache.h @@ -33,7 +33,7 @@ struct BodyCache; * mutt_bcache_open - Open an Email-Body Cache * @param account current mailbox' account (required) * @param mailbox path to the mailbox of the account (optional) - * @retval NULL on failure + * @retval NULL Failure * * The driver using it is responsible for ensuring that hierarchies are * separated by '/' (if it knows of such a concepts like mailboxes or @@ -53,8 +53,8 @@ void mutt_bcache_close(struct BodyCache **bcache); * mutt_bcache_get - Open a file in the Body Cache * @param bcache Body Cache from mutt_bcache_open() * @param id Per-mailbox unique identifier for the message - * @retval FILE* on success - * @retval NULL on failure + * @retval ptr Success + * @retval NULL Failure */ FILE *mutt_bcache_get(struct BodyCache *bcache, const char *id); @@ -62,8 +62,8 @@ FILE *mutt_bcache_get(struct BodyCache *bcache, const char *id); * mutt_bcache_put - Create a file in the Body Cache * @param bcache Body Cache from mutt_bcache_open() * @param id Per-mailbox unique identifier for the message - * @retval FILE* on success - * @retval NULL on failure + * @retval ptr Success + * @retval NULL Failure * * The returned FILE* is in a temporary location. * Use mutt_bcache_commit to put it into place @@ -74,8 +74,8 @@ FILE *mutt_bcache_put(struct BodyCache *bcache, const char *id); * mutt_bcache_commit - Move a temporary file into the Body Cache * @param bcache Body Cache from mutt_bcache_open() * @param id Per-mailbox unique identifier for the message - * @retval 0 on success - * @retval -1 on failure + * @retval 0 Success + * @retval -1 Failure */ int mutt_bcache_commit(struct BodyCache *bcache, const char *id); @@ -83,8 +83,8 @@ int mutt_bcache_commit(struct BodyCache *bcache, const char *id); * mutt_bcache_del - Delete a file from the Body Cache * @param bcache Body Cache from mutt_bcache_open() * @param id Per-mailbox unique identifier for the message - * @retval 0 on success - * @retval -1 on failure + * @retval 0 Success + * @retval -1 Failure */ int mutt_bcache_del(struct BodyCache *bcache, const char *id); @@ -92,8 +92,8 @@ int mutt_bcache_del(struct BodyCache *bcache, const char *id); * mutt_bcache_exists - Check if a file exists in the Body Cache * @param bcache Body Cache from mutt_bcache_open() * @param id Per-mailbox unique identifier for the message - * @retval 0 on success - * @retval -1 on failure + * @retval 0 Success + * @retval -1 Failure */ int mutt_bcache_exists(struct BodyCache *bcache, const char *id); @@ -102,7 +102,7 @@ int mutt_bcache_exists(struct BodyCache *bcache, const char *id); * @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 on failure + * @retval -1 Failure * @retval >=0 count of matching items * * This more or less "examines" the cache and calls a function with diff --git a/body.c b/body.c index d9c770294..4a791ed40 100644 --- a/body.c +++ b/body.c @@ -40,7 +40,12 @@ struct Body *mutt_body_new(void) } /** - * mutt_body_copy - create a send-mode duplicate from a receive-mode body + * mutt_body_copy - Create a send-mode duplicate from a receive-mode body + * @param[in] fp FILE pointer to attachments + * @param[out] tgt New Body will be saved here + * @param[in] src Source Body to copy + * @retval 0 Success + * @retval -1 Failure */ int mutt_body_copy(FILE *fp, struct Body **tgt, struct Body *src) { diff --git a/buffy.c b/buffy.c index 8bad1fa03..027574e85 100644 --- a/buffy.c +++ b/buffy.c @@ -61,8 +61,8 @@ static short BuffyNotify = 0; /**< # of unnotified new boxes */ /** * fseek_last_message - Find the last message in the file - * @retval 0 on success - * @retval -1 if no message found + * @retval 0 Success + * @retval -1 No message found */ static int fseek_last_message(FILE *f) { diff --git a/commands.c b/commands.c index 53044b9ef..73d72bd26 100644 --- a/commands.c +++ b/commands.c @@ -748,8 +748,8 @@ int mutt_save_message_ctx(struct Header *h, int delete, int decode, int decrypt, /** * mutt_save_message - Save an email - * @retval 0 if the copy/save was successful - * @retval -1 on error/abort + * @retval 0 Copy/save was successful + * @retval -1 Error/abort */ int mutt_save_message(struct Header *h, int delete, int decode, int decrypt) { diff --git a/compose.c b/compose.c index a59f96ecc..12d809a4c 100644 --- a/compose.c +++ b/compose.c @@ -642,7 +642,7 @@ static void compose_menu_redraw(struct Menu *menu) /** * cum_attachs_size - Cumulative Attachments Size * @param menu Menu listing attachments - * @retval n Number of bytes in attachments + * @retval num Bytes in attachments * * Returns the total number of bytes used by the attachments in the attachment * list _after_ content-transfer-encodings have been applied. diff --git a/compress.c b/compress.c index c31969b12..9ab49497b 100644 --- a/compress.c +++ b/compress.c @@ -169,8 +169,8 @@ static int setup_paths(struct Context *ctx) /** * get_size - Get the size of a file * @param path File to measure - * @retval n Size in bytes - * @retval 0 On error + * @retval num Size in bytes + * @retval 0 Error */ static int get_size(const char *path) { @@ -206,8 +206,8 @@ static void store_size(const struct Context *ctx) * find_hook - Find a hook to match a path * @param type Type of hook, e.g. #MUTT_CLOSEHOOK * @param path Filename to test - * @retval string Matching hook command - * @retval NULL No matches + * @retval ptr Matching hook command + * @retval NULL No matches * * Each hook has a type and a pattern. * Find a command that matches the type and path supplied. e.g. @@ -234,7 +234,7 @@ static const char *find_hook(int type, const char *path) * set_compress_info - Find the compress hooks for a mailbox * @param ctx Mailbox to examine * @retval ptr CompressInfo Hook info for the mailbox's path - * @retval NULL On error + * @retval NULL Error * * When a mailbox is opened, we check if there are any matching hooks. */ @@ -400,9 +400,9 @@ static void expand_command_str(const struct Context *ctx, const char *cmd, char /** * execute_command - Run a system command - * @param ctx Mailbox to work with - * @param command Command string to execute - * @param progress Message to show the user + * @param ctx Mailbox to work with + * @param command Command string to execute + * @param progress Message to show the user * @retval 1 Success * @retval 0 Failure * diff --git a/conn/sasl.c b/conn/sasl.c index 5135b3aa5..9934e771a 100644 --- a/conn/sasl.c +++ b/conn/sasl.c @@ -71,7 +71,7 @@ static sasl_secret_t *secret_ptr = NULL; /** * getnameinfo_err - Convert a getaddrinfo() error code into an SASL error code * @param ret getaddrinfo() error code, e.g. EAI_AGAIN - * @retval int SASL error code, e.g. SASL_FAIL + * @retval num SASL error code, e.g. SASL_FAIL */ static int getnameinfo_err(int ret) { @@ -128,7 +128,7 @@ static int getnameinfo_err(int ret) * @param addrlen Size of addr struct * @param out Buffer for result * @param outlen Length of buffer - * @retval int SASL error code, e.g. SASL_BADPARAM + * @retval num SASL error code, e.g. SASL_BADPARAM * * utility function, copied from sasl2 sample code */ @@ -163,7 +163,7 @@ static int iptostring(const struct sockaddr *addr, socklen_t addrlen, char *out, * @param context Supplied context, always NULL * @param priority Debug level * @param message Message - * @retval int SASL_OK, always + * @retval num SASL_OK, always */ static int mutt_sasl_cb_log(void *context, int priority, const char *message) { @@ -174,7 +174,7 @@ static int mutt_sasl_cb_log(void *context, int priority, const char *message) /** * mutt_sasl_start - Initialise SASL library - * @retval int SASL error code, e.g. SASL_OK + * @retval num SASL error code, e.g. SASL_OK * * Call before doing an SASL exchange - initialises library (if necessary). */ @@ -216,7 +216,7 @@ static int mutt_sasl_start(void) * @param[in] id Field to get. SASL_CB_USER or SASL_CB_AUTHNAME * @param[out] result Resulting string * @param[out] len Length of result - * @retval int SASL error code, e.g. SASL_FAIL + * @retval num SASL error code, e.g. SASL_FAIL */ static int mutt_sasl_cb_authname(void *context, int id, const char **result, unsigned int *len) { @@ -260,7 +260,7 @@ static int mutt_sasl_cb_authname(void *context, int id, const char **result, uns * @param[in] context Account * @param[in] id SASL_CB_PASS * @param[out] psecret SASL secret - * @retval int SASL error code, e.g SASL_FAIL + * @retval num SASL error code, e.g SASL_FAIL */ static int mutt_sasl_cb_pass(sasl_conn_t *conn, void *context, int id, sasl_secret_t **psecret) { @@ -627,7 +627,7 @@ int mutt_sasl_client_new(struct Connection *conn, sasl_conn_t **saslconn) /** * mutt_sasl_interact - Perform an SASL interaction with the user * @param interaction Details of interaction - * @retval int SASL error code: SASL_OK or SASL_FAIL + * @retval num SASL error code: SASL_OK or SASL_FAIL * * An example interaction might be asking the user for a password. */ diff --git a/conn/sasl_plain.h b/conn/sasl_plain.h index a919de9ff..cd1705c7e 100644 --- a/conn/sasl_plain.h +++ b/conn/sasl_plain.h @@ -33,7 +33,7 @@ * @param authz Authorization identity * @param user Authentication identity (username) * @param pass Password - * @retval Number Bytes written to buf + * @retval num Bytes written to buf * * This function can be used to build a protocol-specific SASL Response message * using the PLAIN mechanism. The protocol specific command is given in the cmd diff --git a/conn/ssl_gnutls.c b/conn/ssl_gnutls.c index cc6c284ca..b694497f5 100644 --- a/conn/ssl_gnutls.c +++ b/conn/ssl_gnutls.c @@ -543,8 +543,8 @@ static int tls_check_preauth(const gnutls_datum_t *certdata, * @param hostname Hostname * @param idx Index into certificate list * @param len Length of certificate list - * @retval 0 on failure - * @retval >0 on success + * @retval 0 Failure + * @retval >0 Success */ static int tls_check_one_certificate(const gnutls_datum_t *certdata, gnutls_certificate_status_t certstat, diff --git a/copy.c b/copy.c index 331b7a97a..4d2c61aa9 100644 --- a/copy.c +++ b/copy.c @@ -774,8 +774,8 @@ int mutt_copy_message_ctx(FILE *fpout, struct Context *src, struct Header *hdr, * @param hdr message being copied * @param flags mutt_open_copy_message() flags * @param chflags mutt_copy_header() flags - * @retval 0 on success - * @retval -1 on error + * @retval 0 Success + * @retval -1 Error */ static int append_message(struct Context *dest, FILE *fpin, struct Context *src, struct Header *hdr, int flags, int chflags) @@ -821,8 +821,12 @@ int mutt_append_message(struct Context *dest, struct Context *src, /** * copy_delete_attach - Copy a message, deleting marked attachments - * @retval 0 on success - * @retval -1 on failure + * @param b Email Body + * @param fpin FILE pointer to read from + * @param fpout FILE pointer to write to + * @param date Date stamp + * @retval 0 Success + * @retval -1 Failure * * This function copies a message body, while deleting _in_the_copy_ * any attachments which are marked for deletion. @@ -880,7 +884,7 @@ static int copy_delete_attach(struct Body *b, FILE *fpin, FILE *fpout, char *dat * a buffer instead of writing to a stream. mutt_write_address_list could be * re-used if we wouldn't store all the decoded headers in a huge array, first. * - * XXX - fix that. + * TODO - fix that. */ static void format_address_header(char **h, struct Address *a) { diff --git a/curs_lib.c b/curs_lib.c index 3e45ebd62..0100d291d 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -941,7 +941,7 @@ void mutt_paddstr(int n, const char *s) * @param[in] maxlen Maximum length of string in bytes * @param[in] maxwid Maximum width in screen columns * @param[out] width Save the truncated screen column width - * @retval n Number of bytes to use + * @retval num Bytes to use * * See how many bytes to copy from string so it's at most maxlen bytes long and * maxwid columns wide @@ -994,7 +994,7 @@ out: /** * mutt_strwidth - Measure a string's width in screen cells * @param s String to be measured - * @retval n Number of screen cells string would use + * @retval num Screen cells string would use */ int mutt_strwidth(const char *s) { @@ -1036,7 +1036,7 @@ int mutt_strwidth(const char *s) * message_is_visible - Is a message in the index within limit * @param ctx Open mailbox * @param index Message ID (index into `ctx->hdrs[]` - * @retval bool True if the message is within limit + * @retval true The message is within limit * * If no limit is in effect, all the messages are visible. */ @@ -1052,7 +1052,7 @@ bool message_is_visible(struct Context *ctx, int index) * message_is_tagged - Is a message in the index tagged (and within limit) * @param ctx Open mailbox * @param index Message ID (index into `ctx->hdrs[]` - * @retval bool True if the message is both tagged and within limit + * @retval true The message is both tagged and within limit * * If a limit is in effect, the message must be visible within it. */ diff --git a/doxygen/doxygen.conf b/doxygen/doxygen.conf index 2d9f5fc83..889d54b63 100644 --- a/doxygen/doxygen.conf +++ b/doxygen/doxygen.conf @@ -688,7 +688,7 @@ CITE_BIB_FILES = # messages are off. # The default value is: NO. -QUIET = NO +QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages that are # generated to standard error (stderr) by doxygen. If WARNINGS is set to YES diff --git a/editmsg.c b/editmsg.c index 91bf17ab7..878ed91b6 100644 --- a/editmsg.c +++ b/editmsg.c @@ -20,7 +20,11 @@ * this program. If not, see . */ -/* simple, editor-based message editing */ +/** + * @page editmsg Prepare an email to be edited + * + * Prepare an email to be edited + */ #include "config.h" #include @@ -45,7 +49,7 @@ /** * edit_or_view_one_message - Edit an email or view it in an external editor * @param edit true if the message should be editable. If false, changes - * to the massage (in the editor) will be ignored. + * to the message (in the editor) will be ignored. * @param ctx Context * @param cur Header of email * @retval 1 Message not modified diff --git a/enter.c b/enter.c index a3eb41a3f..98a60eb4b 100644 --- a/enter.c +++ b/enter.c @@ -64,8 +64,9 @@ static int my_addwch(wchar_t wc) /** * replace_part - Search and replace on a buffer - * - * Replace part of the wchar_t buffer, from FROM to CURPOS, by BUF. + * @param state Current state of the input buffer + * @param from Starting point for the replacement + * @param buf Replacement string */ static void replace_part(struct EnterState *state, size_t from, char *buf) { @@ -100,7 +101,7 @@ static void replace_part(struct EnterState *state, size_t from, char *buf) } /** - * mutt_enter_string_simple - Ask the user for a string + * mutt_enter_string - Ask the user for a string * @param buf Buffer to store the string * @param buflen Buffer length * @param col Initial cursor position @@ -768,9 +769,3 @@ void mutt_enter_state_free(struct EnterState **esp) FREE(esp); } -/* - * TODO: - * very narrow screen might crash it - * sort out the input side - * unprintable chars - */ diff --git a/filter.c b/filter.c index 83fac2dc5..7efa93db2 100644 --- a/filter.c +++ b/filter.c @@ -40,8 +40,8 @@ * @param fdin If `in` is NULL and fdin is not -1 then fdin will be used as stdin for the command process * @param fdout If `out` is NULL and fdout is not -1 then fdout will be used as stdout for the command process * @param fderr If `error` is NULL and fderr is not -1 then fderr will be used as stderr for the command process - * @retval n pid of the created process - * @retval -1 on any error creating pipes or forking + * @retval num PID of the created process + * @retval -1 Error creating pipes or forking * * This function provides multiple mechanisms to handle IO sharing for the * command process. File streams are prioritized over file descriptors if @@ -206,8 +206,8 @@ pid_t mutt_create_filter(const char *s, FILE **in, FILE **out, FILE **err) /** * mutt_wait_filter - Wait for the exit of a process and return its status * @param pid Process id of the process to wait for - * @retval n Exit status of the process identified by pid - * @retval -1 Error + * @retval num Exit status of the process identified by pid + * @retval -1 Error */ int mutt_wait_filter(pid_t pid) { diff --git a/flags.c b/flags.c index 28c75cd31..bb0661575 100644 --- a/flags.c +++ b/flags.c @@ -333,7 +333,9 @@ void mutt_set_flag_update(struct Context *ctx, struct Header *h, int flag, int b } /** - * mutt_thread_set_flag - Set a flag on an entire thread + * mutt_tag_set_flag - Set flag on tagged messages + * @param flag Flag to set, e.g. #MUTT_DELETE + * @param bf true: set the flag; false: clear the flag */ void mutt_tag_set_flag(int flag, int bf) { diff --git a/from.c b/from.c index e2eb7495e..0fa271d7a 100644 --- a/from.c +++ b/from.c @@ -27,10 +27,17 @@ #include #include "mutt/mutt.h" -/* - * A valid message separator looks like: +/** + * is_from - Is a string a 'From' header line? + * @param[in] s String to test + * @param[out] path Buffer for extracted path + * @param[in] pathlen Length of buffer + * @param[out] tp Extracted time + * @retval 1 Yes, it is + * @retval 0 No, it isn't * - * From [ ]