#include <assert.h>
#endif
+/**
+ * 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)
+ * @param[out] bg Background colour (set to -1)
+ * @param[out] attr Attribute flags
+ * @param[out] err Buffer for error messages
+ * @retval 0 Success
+ * @retval -1 Error
+ */
+typedef int (*parser_callback_t)(struct Buffer *buf, struct Buffer *s, uint32_t *fg,
+ uint32_t *bg, int *attr, struct Buffer *err);
+
/* globals */
int *ColorQuote = NULL;
int ColorQuoteUsed;
*
* Note that no flag means it's a palette color.
*/
-#define RGB24 (1u << 24)
+#define RGB24 (1U << 24)
/**
* struct ColorList - A set of colors
char fgc[128], bgc[128];
#endif
struct ColorList *p = ColorList;
- int i;
/* check to see if this color is already allocated to save space */
while (p)
return A_NORMAL;
/* find the smallest available index (object) */
- i = 1;
+ int i = 1;
while (true)
{
p = ColorList;
return MUTT_CMD_WARNING;
}
- if (
#ifdef HAVE_COLOR
- /* we're running without curses */
- OptNoCurses || /* we're parsing an uncolor command, and have no colors */
- (uncolor && !has_colors())
- /* we're parsing an unmono command, and have colors */
- || (!uncolor && has_colors())
+ if (OptNoCurses || // running without curses
+ (uncolor && !has_colors()) || // parsing an uncolor command, and have no colors
+ (!uncolor && has_colors())) // parsing an unmono command, and have colors
#else
- /* We don't even have colors compiled in */
- uncolor
+ if (uncolor) // We don't even have colors compiled in
#endif
- )
{
- /* just eat the command, but don't do anything real about it */
do
{
+ /* just eat the command, but don't do anything real about it */
mutt_extract_token(buf, s, MUTT_TOKEN_NO_FLAGS);
} while (MoreArgs(s));
bool sensitive, uint32_t fg, uint32_t bg, int attr,
struct Buffer *err, bool is_index, int match)
{
- /* is_index used to store compiled pattern
- * only for 'index' color object
+ /* is_index used to store compiled pattern only for 'index' color object
* when called from mutt_parse_color() */
struct ColorLine *tmp = NULL;
return 0;
}
-/**
- * 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)
- * @param[out] bg Background colour (set to -1)
- * @param[out] attr Attribute flags
- * @param[out] err Buffer for error messages
- * @retval 0 Success
- * @retval -1 Error
- */
-typedef int (*parser_callback_t)(struct Buffer *buf, struct Buffer *s, uint32_t *fg,
- uint32_t *bg, int *attr, struct Buffer *err);
-
#ifdef HAVE_COLOR
/**
* parse_color_pair - Parse a pair of colours - Implements ::parser_callback_t
}
/**
- * parse_color - Parse a "color" command
+ * parse_color - Parse a 'color' command
* @param buf Temporary Buffer space
* @param s Buffer containing string to be parsed
* @param err Buffer for error messages
return MUTT_CMD_WARNING;
}
- /* dry run? */
-
if (dry_run)
{
*s->dptr = '\0'; /* fake that we're done parsing */
regex_t regex; ///< Compiled regex
int match; ///< Substring to match, 0 for old behaviour
char *pattern; ///< Pattern to match
- struct PatternList *color_pattern; ///< compiled pattern to speed up index color calculation
+ struct PatternList *color_pattern; ///< Compiled pattern to speed up index color calculation
uint32_t fg; ///< Foreground colour
uint32_t bg; ///< Background colour
int pair; ///< Colour pair index
- bool stop_matching : 1; ///< used by the pager for body patterns, to prevent the color from being retried once it fails
+ bool stop_matching : 1; ///< Used by the pager for body patterns, to prevent the color from being retried once it fails
STAILQ_ENTRY(ColorLine) entries; ///< Linked list
};