From: Richard Russon Date: Fri, 17 Aug 2018 19:59:35 +0000 (+0100) Subject: refactor parse functions X-Git-Tag: 2019-10-25~689^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=57fb34b9420a0896a62ad62c8ccbf3119318aa6c;p=neomutt refactor parse functions --- diff --git a/bcache.h b/bcache.h index 80b5ada7b..a716a063e 100644 --- a/bcache.h +++ b/bcache.h @@ -33,7 +33,7 @@ struct BodyCache; extern char *MessageCachedir; /** - * bcache_list_t - Prototype for mutt_bcache_list() callback + * typedef 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 diff --git a/color.c b/color.c index e5d057ac7..aba956ec0 100644 --- a/color.c +++ b/color.c @@ -868,7 +868,7 @@ static int parse_object(struct Buffer *buf, struct Buffer *s, int *o, int *ql, } /** - * parser_callback_t - Prototype for a function to parse color config + * typedef parser_callback_t - Prototype for a function to parse color config * @param[in] buf Temporary Buffer space * @param[in] s Buffer containing string to be parsed * @param[out] fg Foreground colour (set to -1) diff --git a/config/set.h b/config/set.h index 039d7f8c0..8deca05bf 100644 --- a/config/set.h +++ b/config/set.h @@ -70,7 +70,7 @@ enum CsListenerAction }; /** - * cs_listener - Listen for config changes + * typedef cs_listener - Listen for config changes * @param cs Config items * @param he HashElem representing config item * @param name Name of the config item @@ -79,7 +79,7 @@ enum CsListenerAction */ typedef bool (*cs_listener) (const struct ConfigSet *cs, struct HashElem *he, const char *name, enum ConfigEvent ev); /** - * cs_validator - Validate the "charset" config variable + * typedef cs_validator - Validate the "charset" config variable * @param cs Config items * @param cdef Config definition * @param value Native value @@ -88,9 +88,8 @@ typedef bool (*cs_listener) (const struct ConfigSet *cs, struct HashElem *h * @retval CSR_ERR_INVALID Failure */ typedef int (*cs_validator) (const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err); - /** - * cst_string_set - Set a config item by string + * typedef cst_string_set - Set a config item by string * @param cs Config items * @param var Variable to set * @param cdef Variable definition @@ -102,7 +101,7 @@ typedef int (*cs_validator) (const struct ConfigSet *cs, const struct Confi */ typedef int (*cst_string_set)(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err); /** - * cst_string_get - Get a config item as a string + * typedef cst_string_get - Get a config item as a string * @param cs Config items * @param var Variable to get * @param cdef Variable definition @@ -113,7 +112,7 @@ typedef int (*cst_string_set)(const struct ConfigSet *cs, void *var, s */ typedef int (*cst_string_get)(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result); /** - * cst_native_set - Set a config item by string + * typedef cst_native_set - Set a config item by string * @param cs Config items * @param var Variable to set * @param cdef Variable definition @@ -123,7 +122,7 @@ typedef int (*cst_string_get)(const struct ConfigSet *cs, void *var, const s */ typedef int (*cst_native_set)(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err); /** - * cst_native_get - Get a string from a config item + * typedef cst_native_get - Get a string from a config item * @param cs Config items * @param var Variable to get * @param cdef Variable definition @@ -133,7 +132,7 @@ typedef int (*cst_native_set)(const struct ConfigSet *cs, void *var, const s typedef intptr_t(*cst_native_get)(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err); /** - * cst_reset - Reset a config item to its initial value + * typedef cst_reset - Reset a config item to its initial value * @param cs Config items * @param var Variable to reset * @param cdef Variable definition @@ -142,7 +141,7 @@ typedef intptr_t(*cst_native_get)(const struct ConfigSet *cs, void *var, const s */ typedef int (*cst_reset) (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err); /** - * cst_destroy - Destroy a config item + * typedef cst_destroy - Destroy a config item * @param cs Config items * @param var Variable to destroy * @param cdef Variable definition diff --git a/email/rfc2047.c b/email/rfc2047.c index 3bd77db78..db87493a8 100644 --- a/email/rfc2047.c +++ b/email/rfc2047.c @@ -49,7 +49,7 @@ #define CONTINUATION_BYTE(c) (((c) &0xc0) == 0x80) /** - * encoder_t - Prototype for an encoding function + * typedef encoder_t - Prototype for an encoding function * @param str String to encode * @param buf Buffer for result * @param buflen Length of buffer diff --git a/format_flags.h b/format_flags.h index dee94f5da..27c8da5f4 100644 --- a/format_flags.h +++ b/format_flags.h @@ -41,7 +41,7 @@ enum FormatFlag }; /** - * format_t - Prototype for a mutt_expando_format() callback function + * typedef format_t - Prototype for a mutt_expando_format() callback function * @param[out] buf Buffer in which to save string * @param[in] buflen Buffer length * @param[in] col Starting column diff --git a/handler.c b/handler.c index 7e42393ce..0e4aaafb6 100644 --- a/handler.c +++ b/handler.c @@ -70,7 +70,7 @@ char *ShowMultipartAlternative; ///< Config: How to display 'multipart/alternati #define TXTENRICHED 3 /** - * handler_t - Manage a PGP or S/MIME encrypted MIME part + * typedef handler_t - Manage a PGP or S/MIME encrypted MIME part * @param m Body of the email * @param s State of text being processed * @retval 0 Success diff --git a/hcache/hcache.h b/hcache/hcache.h index ff583aa8c..a6be30aee 100644 --- a/hcache/hcache.h +++ b/hcache/hcache.h @@ -72,7 +72,7 @@ struct HeaderCache typedef struct HeaderCache header_cache_t; /** - * hcache_namer_t - Prototype for function to compose hcache file names + * typedef 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 diff --git a/init.c b/init.c index 3b8f56a42..94d53e111 100644 --- a/init.c +++ b/init.c @@ -599,13 +599,7 @@ bail: } /** - * parse_replace_list - Parse a string replacement rule - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Success - * @retval -1 Error + * parse_replace_list - Parse a string replacement rule - Implements ::command_t */ static int parse_replace_list(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -703,13 +697,7 @@ static int parse_unattach_list(struct Buffer *buf, struct Buffer *s, } /** - * parse_unreplace_list - Remove a string replacement rule - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Success - * @retval -1 Error + * parse_unreplace_list - Remove a string replacement rule - Implements ::command_t */ static int parse_unreplace_list(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -926,13 +914,7 @@ static int source_rc(const char *rcfile_path, struct Buffer *err) } /** - * parse_alias - Parse the 'alias' command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Success - * @retval -1 Error + * parse_alias - Parse the 'alias' command - Implements ::command_t */ static int parse_alias(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -1013,13 +995,7 @@ bail: } /** - * parse_alternates - Parse the 'alternates' command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Success - * @retval -1 Error + * parse_alternates - Parse the 'alternates' command - Implements ::command_t */ static int parse_alternates(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -1053,13 +1029,7 @@ bail: } /** - * parse_attachments - Parse the 'attachments' command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Success - * @retval -1 Error + * parse_attachments - Parse the 'attachments' command - Implements ::command_t */ static int parse_attachments(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -1119,12 +1089,7 @@ static int parse_attachments(struct Buffer *buf, struct Buffer *s, } /** - * parse_echo - Parse the 'echo' command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Always + * parse_echo - Parse the 'echo' command - Implements ::command_t */ static int parse_echo(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -1144,11 +1109,7 @@ static int parse_echo(struct Buffer *buf, struct Buffer *s, unsigned long data, } /** - * parse_finish - Parse the 'finish' command - * @param buf Temporary space shared by all command handlers - * @param s Current line of the config file - * @param data data field from init.h:struct Command - * @param err Buffer for any error message + * parse_finish - Parse the 'finish' command - Implements ::command_t * @retval 1 Stop processing the current file * @retval -1 Failed * @@ -1167,13 +1128,7 @@ static int parse_finish(struct Buffer *buf, struct Buffer *s, } /** - * parse_group - Parse the 'group' and 'ungroup' commands - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Success - * @retval -1 Error + * parse_group - Parse the 'group' and 'ungroup' commands - Implements ::command_t */ static int parse_group(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -1254,13 +1209,7 @@ bail: } /** - * parse_ifdef - Parse the 'ifdef' and 'ifndef' commands - * @param buf Temporary space shared by all command handlers - * @param s Current line of the config file - * @param data data field from init.h:struct Command - * @param err Buffer for any error message - * @retval 0 Success - * @retval -1 Failed + * parse_ifdef - Parse the 'ifdef' and 'ifndef' commands - Implements ::command_t * * The 'ifdef' command allows conditional elements in the config file. * If a given variable, function, command or compile-time symbol exists, then @@ -1352,12 +1301,7 @@ static int parse_ifdef(struct Buffer *buf, struct Buffer *s, unsigned long data, } /** - * parse_ignore - Parse the 'ignore' command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Always + * parse_ignore - Parse the 'ignore' command - Implements ::command_t */ static int parse_ignore(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -1373,13 +1317,7 @@ static int parse_ignore(struct Buffer *buf, struct Buffer *s, } /** - * parse_lists - Parse the 'lists' command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Success - * @retval -1 Error + * parse_lists - Parse the 'lists' command - Implements ::command_t */ static int parse_lists(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -1411,13 +1349,7 @@ bail: } /** - * parse_my_hdr - Parse the 'my_hdr' command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Success - * @retval -1 Error + * parse_my_hdr - Parse the 'my_hdr' command - Implements ::command_t */ static int parse_my_hdr(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -1462,12 +1394,7 @@ static int parse_my_hdr(struct Buffer *buf, struct Buffer *s, #ifdef USE_SIDEBAR /** - * parse_path_list - Parse the 'sidebar_whitelist' command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Always + * parse_path_list - Parse the 'sidebar_whitelist' command - Implements ::command_t */ static int parse_path_list(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -1488,12 +1415,7 @@ static int parse_path_list(struct Buffer *buf, struct Buffer *s, #ifdef USE_SIDEBAR /** - * parse_path_unlist - Parse the 'unsidebar_whitelist' command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Always + * parse_path_unlist - Parse the 'unsidebar_whitelist' command - Implements ::command_t */ static int parse_path_unlist(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -1519,13 +1441,7 @@ static int parse_path_unlist(struct Buffer *buf, struct Buffer *s, #endif /** - * parse_set - Parse the 'set' family of commands - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Success - * @retval -1 Error + * parse_set - Parse the 'set' family of commands - Implements ::command_t * * This is used by 'reset', 'set', 'toggle' and 'unset'. */ @@ -1857,13 +1773,7 @@ static int parse_set(struct Buffer *buf, struct Buffer *s, unsigned long data, } /** - * parse_setenv - Parse the 'setenv' and 'unsetenv' commands - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Success - * @retval -1 Error + * parse_setenv - Parse the 'setenv' and 'unsetenv' commands - Implements ::command_t */ static int parse_setenv(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -1947,13 +1857,7 @@ static int parse_setenv(struct Buffer *buf, struct Buffer *s, } /** - * parse_source - Parse the 'source' command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Success - * @retval -1 Error + * parse_source - Parse the 'source' command - Implements ::command_t */ static int parse_source(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -1982,13 +1886,7 @@ static int parse_source(struct Buffer *buf, struct Buffer *s, } /** - * parse_spam_list - Parse the 'spam' and 'nospam' commands - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Success - * @retval -1 Error + * parse_spam_list - Parse the 'spam' and 'nospam' commands - Implements ::command_t */ static int parse_spam_list(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -2066,12 +1964,7 @@ static int parse_spam_list(struct Buffer *buf, struct Buffer *s, } /** - * parse_stailq - Parse a list command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Always + * parse_stailq - Parse a list command - Implements ::command_t * * This is used by 'alternative_order', 'auto_view' and several others. */ @@ -2088,13 +1981,7 @@ static int parse_stailq(struct Buffer *buf, struct Buffer *s, } /** - * parse_subjectrx_list - Parse the 'subjectrx' command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Success - * @retval -1 Error + * parse_subjectrx_list - Parse the 'subjectrx' command - Implements ::command_t */ static int parse_subjectrx_list(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -2108,13 +1995,7 @@ static int parse_subjectrx_list(struct Buffer *buf, struct Buffer *s, } /** - * parse_subscribe - Parse the 'subscribe' command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Success - * @retval -1 Error + * parse_subscribe - Parse the 'subscribe' command - Implements ::command_t */ static int parse_subscribe(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -2149,13 +2030,7 @@ bail: #ifdef USE_IMAP /** - * parse_subscribe_to - Parse the 'subscribe-to' command - * @param buf Buffer space shared by all command handlers - * @param s Current line of the config file - * @param data Data field from init.h:struct Command - * @param err Buffer for any error message - * @retval 0 Success - * @retval -1 Failed + * parse_subscribe_to - Parse the 'subscribe-to' command - Implements ::command_t * * The 'subscribe-to' command allows to subscribe to an IMAP-Mailbox. * Patterns are not supported. @@ -2206,13 +2081,7 @@ static int parse_subscribe_to(struct Buffer *buf, struct Buffer *s, #endif /** - * parse_tag_formats - Parse the 'tag-formats' command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Success - * @retval -1 Error + * parse_tag_formats - Parse the 'tag-formats' command - Implements ::command_t */ static int parse_tag_formats(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -2251,13 +2120,7 @@ static int parse_tag_formats(struct Buffer *buf, struct Buffer *s, } /** - * parse_tag_transforms - Parse the 'tag-transforms' command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Success - * @retval -1 Error + * parse_tag_transforms - Parse the 'tag-transforms' command - Implements ::command_t */ static int parse_tag_transforms(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -2296,12 +2159,7 @@ static int parse_tag_transforms(struct Buffer *buf, struct Buffer *s, } /** - * parse_unalias - Parse the 'unalias' command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Always + * parse_unalias - Parse the 'unalias' command - Implements ::command_t */ static int parse_unalias(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -2351,13 +2209,7 @@ static int parse_unalias(struct Buffer *buf, struct Buffer *s, } /** - * parse_unalternates - Parse the 'unalternates' command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Success - * @retval -1 Error + * parse_unalternates - Parse the 'unalternates' command - Implements ::command_t */ static int parse_unalternates(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -2380,13 +2232,7 @@ static int parse_unalternates(struct Buffer *buf, struct Buffer *s, } /** - * parse_unattachments - Parse the 'unattachments' command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Success - * @retval -1 Error + * parse_unattachments - Parse the 'unattachments' command - Implements ::command_t */ static int parse_unattachments(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -2432,12 +2278,7 @@ static int parse_unattachments(struct Buffer *buf, struct Buffer *s, } /** - * parse_unignore - Parse the 'unignore' command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Always + * parse_unignore - Parse the 'unignore' command - Implements ::command_t */ static int parse_unignore(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -2457,13 +2298,7 @@ static int parse_unignore(struct Buffer *buf, struct Buffer *s, } /** - * parse_unlists - Parse the 'unlists' command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Success - * @retval -1 Error + * parse_unlists - Parse the 'unlists' command - Implements ::command_t */ static int parse_unlists(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -2485,12 +2320,7 @@ static int parse_unlists(struct Buffer *buf, struct Buffer *s, } /** - * parse_unmy_hdr - Parse the 'unmy_hdr' command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Always + * parse_unmy_hdr - Parse the 'unmy_hdr' command - Implements ::command_t */ static int parse_unmy_hdr(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -2525,12 +2355,7 @@ static int parse_unmy_hdr(struct Buffer *buf, struct Buffer *s, } /** - * parse_unstailq - Parse an unlist command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Always + * parse_unstailq - Parse an unlist command - Implements ::command_t * * This is used by 'unalternative_order', 'unauto_view' and several others. */ @@ -2553,13 +2378,7 @@ static int parse_unstailq(struct Buffer *buf, struct Buffer *s, } /** - * parse_unsubjectrx_list - Parse the 'unsubjectrx' command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Success - * @retval -1 Error + * parse_unsubjectrx_list - Parse the 'unsubjectrx' command - Implements ::command_t */ static int parse_unsubjectrx_list(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -2573,13 +2392,7 @@ static int parse_unsubjectrx_list(struct Buffer *buf, struct Buffer *s, } /** - * parse_unsubscribe - Parse the 'unsubscribe' command - * @param buf Temporary Buffer space - * @param s Buffer containing string to be parsed - * @param data Flags associated with the command - * @param err Buffer for error messages - * @retval 0 Success - * @retval -1 Error + * parse_unsubscribe - Parse the 'unsubscribe' command - Implements ::command_t */ static int parse_unsubscribe(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) @@ -2601,13 +2414,7 @@ static int parse_unsubscribe(struct Buffer *buf, struct Buffer *s, #ifdef USE_IMAP /** - * parse_unsubscribe_from - Parse the 'unsubscribe-from' command - * @param buf Buffer space shared by all command handlers - * @param s Current line of the config file - * @param data Data field from init.h:struct Command - * @param err Buffer for any error message - * @retval 0 Success - * @retval -1 Failed + * parse_unsubscribe_from - Parse the 'unsubscribe-from' command - Implements ::command_t * * The 'unsubscribe-from' command allows to unsubscribe from an IMAP-Mailbox. * Patterns are not supported. diff --git a/mutt/hash.h b/mutt/hash.h index c96d642dd..6e2247f05 100644 --- a/mutt/hash.h +++ b/mutt/hash.h @@ -48,7 +48,7 @@ struct HashElem }; /** - * hash_destructor_t - Prototype for Hash Destructor callback function + * typedef 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 diff --git a/mutt/list.h b/mutt/list.h index d6ed7f396..800f3fdf6 100644 --- a/mutt/list.h +++ b/mutt/list.h @@ -45,7 +45,7 @@ struct ListNode STAILQ_HEAD(ListHead, ListNode); /** - * list_free_t - Prototype for a function to free List data + * typedef list_free_t - Prototype for a function to free List data * @param ptr Data to free */ typedef void (*list_free_t)(void **ptr); diff --git a/mutt/logging.h b/mutt/logging.h index c8b0f4da5..ab5a8c38d 100644 --- a/mutt/logging.h +++ b/mutt/logging.h @@ -29,7 +29,7 @@ #include "queue.h" /** - * log_dispatcher_t - Prototype for a logging function + * typedef log_dispatcher_t - Prototype for a logging function * @param stamp Unix time (optional) * @param file Source file * @param line Source line diff --git a/mutt/signal2.h b/mutt/signal2.h index e5288364b..38aff8c3b 100644 --- a/mutt/signal2.h +++ b/mutt/signal2.h @@ -23,6 +23,10 @@ #ifndef _MUTT_SIGNAL_H #define _MUTT_SIGNAL_H +/** + * typedef sig_handler_t - Handler for signals + * @param sig Signal number, e.g. SIGINT + */ typedef void (*sig_handler_t)(int sig); void mutt_sig_allow_interrupt(int disposition); diff --git a/mutt_commands.h b/mutt_commands.h index 55397e788..a29bd9fac 100644 --- a/mutt_commands.h +++ b/mutt_commands.h @@ -25,14 +25,26 @@ struct Buffer; +/** + * typedef command_t - Prototype for a function to parse a command + * @param buf Temporary Buffer space + * @param s Buffer containing string to be parsed + * @param data Flags associated with the command + * @param err Buffer for error messages + * @retval 0 Success + * @retval -1 Error + * @retval -2 Warning + */ +typedef int (*command_t)(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err); + /** * struct Command - A user-callable command */ struct Command { - char *name; - int (*func)(struct Buffer *, struct Buffer *, unsigned long, struct Buffer *); - unsigned long data; + char *name; /**< Name of the command */ + command_t func; /**< Function to parse the command */ + unsigned long data; /**< Data or flags to pass to the command */ }; const struct Command *mutt_command_get(const char *s); diff --git a/sort.h b/sort.h index 7d6bff08f..a59797d74 100644 --- a/sort.h +++ b/sort.h @@ -37,7 +37,7 @@ extern bool ReverseAlias; #define SORTCODE(x) (Sort & SORT_REVERSE) ? -(x) : x /** - * sort_t - Prototype for a function to compare two emails + * typedef sort_t - Prototype for a function to compare two emails * @param a First email * @param b Second email * @retval -1 a precedes b