NeoMutt  2024-04-25-85-g27bab4
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
regex4.h
Go to the documentation of this file.
1
23#ifndef MUTT_COLOR_REGEX4_H
24#define MUTT_COLOR_REGEX4_H
25
26#include "config.h"
27#include <stdbool.h>
28#include "mutt/lib.h"
29#include "attr.h"
30#include "color.h"
31
36{
38 char *pattern;
39 regex_t regex;
40 int match;
41 struct PatternList *color_pattern;
42
43 bool stop_matching : 1;
44
46};
47STAILQ_HEAD(RegexColorList, RegexColor);
48
49void regex_color_clear(struct RegexColor *rcol);
50void regex_color_free(struct RegexColorList *list, struct RegexColor **ptr);
51struct RegexColor * regex_color_new (void);
52
53void regex_colors_cleanup(void);
54struct RegexColorList *regex_colors_get_list(enum ColorId cid);
55void regex_colors_init(void);
56
57void regex_color_list_clear(struct RegexColorList *rcl);
58
59bool regex_colors_parse_color_list (enum ColorId cid, const char *pat, struct AttrColor *ac, int *rc, struct Buffer *err);
60int regex_colors_parse_status_list(enum ColorId cid, const char *pat, struct AttrColor *ac, int match, struct Buffer *err);
61bool regex_colors_parse_uncolor (enum ColorId cid, const char *pat, bool uncolor);
62
63#endif /* MUTT_COLOR_REGEX4_H */
Colour and attributes.
Color and attribute parsing.
ColorId
List of all colored objects.
Definition: color.h:40
Convenience wrapper for the library headers.
#define STAILQ_HEAD(name, type)
Definition: queue.h:312
struct RegexColorList * regex_colors_get_list(enum ColorId cid)
Return the RegexColorList for a colour id.
Definition: regex.c:184
int regex_colors_parse_status_list(enum ColorId cid, const char *pat, struct AttrColor *ac, int match, struct Buffer *err)
Parse a Regex 'color status' command.
Definition: regex.c:390
bool regex_colors_parse_color_list(enum ColorId cid, const char *pat, struct AttrColor *ac, int *rc, struct Buffer *err)
Parse a Regex 'color' command.
Definition: regex.c:323
void regex_colors_init(void)
Initialise the Regex colours.
Definition: regex.c:68
void regex_color_free(struct RegexColorList *list, struct RegexColor **ptr)
Free a Regex colour.
Definition: regex.c:136
bool regex_colors_parse_uncolor(enum ColorId cid, const char *pat, bool uncolor)
Parse a Regex 'uncolor' command.
Definition: regex.c:418
void regex_colors_cleanup(void)
Clear the Regex colours.
Definition: regex.c:91
struct RegexColor * regex_color_new(void)
Create a new RegexColor.
Definition: regex.c:151
void regex_color_list_clear(struct RegexColorList *rcl)
Free the contents of a RegexColorList.
Definition: regex.c:166
void regex_color_clear(struct RegexColor *rcol)
Free the contents of a Regex colour.
Definition: regex.c:117
A curses colour and its attributes.
Definition: attr.h:66
String manipulation buffer.
Definition: buffer.h:36
A regular expression and a color to highlight a line.
Definition: regex4.h:36
regex_t regex
Compiled regex.
Definition: regex4.h:39
struct PatternList * color_pattern
Compiled pattern to speed up index color calculation.
Definition: regex4.h:41
struct AttrColor attr_color
Colour and attributes to apply.
Definition: regex4.h:37
char * pattern
Pattern to match.
Definition: regex4.h:38
bool stop_matching
Used by the pager for body patterns, to prevent the color from being retried once it fails.
Definition: regex4.h:43
int match
Substring to match, 0 for old behaviour.
Definition: regex4.h:40
STAILQ_ENTRY(RegexColor) entries
Linked list.