NeoMutt  2024-12-12-19-ge4b57e
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_colors_init (void);
50void regex_colors_reset (void);
51void regex_colors_cleanup(void);
52
53void regex_color_clear(struct RegexColor *rcol);
54void regex_color_free(struct RegexColorList *list, struct RegexColor **ptr);
55struct RegexColor * regex_color_new (void);
56
57struct RegexColorList *regex_colors_get_list(enum ColorId cid);
58
59void regex_color_list_clear(struct RegexColorList *rcl);
60
61bool regex_colors_parse_color_list (enum ColorId cid, const char *pat, struct AttrColor *ac, int *rc, struct Buffer *err);
62int regex_colors_parse_status_list(enum ColorId cid, const char *pat, struct AttrColor *ac, int match, struct Buffer *err);
63bool regex_colors_parse_uncolor (enum ColorId cid, const char *pat, bool uncolor);
64
65#endif /* MUTT_COLOR_REGEX4_H */
Colour and attributes.
Color and attribute parsing.
ColorId
List of all coloured objects.
Definition: color.h:36
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:190
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:396
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:329
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:144
bool regex_colors_parse_uncolor(enum ColorId cid, const char *pat, bool uncolor)
Parse a Regex 'uncolor' command.
Definition: regex.c:424
void regex_colors_reset(void)
Reset the Regex colours.
Definition: regex.c:91
void regex_colors_cleanup(void)
Cleanup the Regex colours.
Definition: regex.c:114
struct RegexColor * regex_color_new(void)
Create a new RegexColor.
Definition: regex.c:159
void regex_color_list_clear(struct RegexColorList *rcl)
Free the contents of a RegexColorList.
Definition: regex.c:172
void regex_color_clear(struct RegexColor *rcol)
Free the contents of a Regex colour.
Definition: regex.c:125
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.