NeoMutt  2025-12-11-694-ga89709
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
regex4.h
Go to the documentation of this file.
1
22
23#ifndef MUTT_COLOR_REGEX4_H
24#define MUTT_COLOR_REGEX4_H
25
26#include <stdbool.h>
27#include "mutt/lib.h"
28#include "attr.h"
29#include "color.h"
30
35{
37 char *pattern;
38 regex_t regex;
39 int match;
40 struct PatternList *color_pattern;
41
42 bool stop_matching : 1;
43
45};
46STAILQ_HEAD(RegexColorList, RegexColor);
47
48void regex_colors_init (void);
49void regex_colors_reset (void);
50void regex_colors_cleanup(void);
51
52void regex_color_clear(struct RegexColor *rcol);
53void regex_color_free (struct RegexColor **ptr);
54struct RegexColor * regex_color_new (void);
55
56struct RegexColorList *regex_colors_get_list(enum ColorId cid);
57
58void regex_color_list_clear(struct RegexColorList *rcl);
59struct RegexColorList *regex_color_list_new(void);
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);
64
65#endif /* MUTT_COLOR_REGEX4_H */
Colour and attributes.
Color and attribute parsing.
ColorId
List of all coloured objects.
Definition color.h:35
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:205
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:398
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:337
void regex_colors_init(void)
Initialise the Regex colours.
Definition regex.c:68
void regex_colors_reset(void)
Reset the Regex colours.
Definition regex.c:91
void regex_color_free(struct RegexColor **ptr)
Free a Regex colour.
Definition regex.c:143
bool regex_colors_parse_uncolor(enum ColorId cid, const char *pat)
Parse a Regex 'uncolor' command.
Definition regex.c:425
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:158
void regex_color_list_clear(struct RegexColorList *rcl)
Free the contents of a RegexColorList.
Definition regex.c:187
struct RegexColorList * regex_color_list_new(void)
Create a new RegexColorList.
Definition regex.c:167
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:65
String manipulation buffer.
Definition buffer.h:36
A regular expression and a color to highlight a line.
Definition regex4.h:35
regex_t regex
Compiled regex.
Definition regex4.h:38
struct PatternList * color_pattern
Compiled pattern to speed up index color calculation.
Definition regex4.h:40
struct AttrColor attr_color
Colour and attributes to apply.
Definition regex4.h:36
char * pattern
Pattern to match.
Definition regex4.h:37
bool stop_matching
Used by the pager for body patterns, to prevent the color from being retried once it fails.
Definition regex4.h:42
int match
Substring to match, 0 for old behaviour.
Definition regex4.h:39
STAILQ_ENTRY(RegexColor) entries
Linked list.