NeoMutt  2025-12-11-860-g80c9cc
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
31struct ColorModuleData;
32
37{
39 char *pattern;
40 regex_t regex;
41 int match;
42 struct PatternList *color_pattern;
43
44 bool stop_matching : 1;
45
47};
48STAILQ_HEAD(RegexColorList, RegexColor);
49
50void regex_colors_init (struct ColorModuleData *mod_data);
51void regex_colors_reset (struct ColorModuleData *mod_data);
52void regex_colors_cleanup(struct ColorModuleData *mod_data);
53
54void regex_color_clear(struct RegexColor *rcol);
55void regex_color_free (struct RegexColor **ptr);
56struct RegexColor * regex_color_new (void);
57
58struct RegexColorList *regex_colors_get_list(enum ColorId cid);
59
60void regex_color_list_clear(struct RegexColorList *rcl);
61struct RegexColorList *regex_color_list_new(void);
62
63bool regex_colors_parse_color_list (enum ColorId cid, const char *pat, struct AttrColor *ac, int *rc, struct Buffer *err);
64int regex_colors_parse_status_list(enum ColorId cid, const char *pat, struct AttrColor *ac, int match, struct Buffer *err);
65bool regex_colors_parse_uncolor (enum ColorId cid, const char *pat);
66
67#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:191
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:387
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:325
void regex_color_free(struct RegexColor **ptr)
Free a Regex colour.
Definition regex.c:129
bool regex_colors_parse_uncolor(enum ColorId cid, const char *pat)
Parse a Regex 'uncolor' command.
Definition regex.c:415
void regex_colors_cleanup(struct ColorModuleData *mod_data)
Cleanup the Regex colours.
Definition regex.c:100
void regex_colors_reset(struct ColorModuleData *mod_data)
Reset the Regex colours.
Definition regex.c:76
struct RegexColor * regex_color_new(void)
Create a new RegexColor.
Definition regex.c:144
void regex_colors_init(struct ColorModuleData *mod_data)
Initialise the Regex colours.
Definition regex.c:52
void regex_color_list_clear(struct RegexColorList *rcl)
Free the contents of a RegexColorList.
Definition regex.c:173
struct RegexColorList * regex_color_list_new(void)
Create a new RegexColorList.
Definition regex.c:153
void regex_color_clear(struct RegexColor *rcol)
Free the contents of a Regex colour.
Definition regex.c:111
A curses colour and its attributes.
Definition attr.h:65
String manipulation buffer.
Definition buffer.h:36
Color private Module data.
Definition module_data.h:35
A regular expression and a color to highlight a line.
Definition regex4.h:37
regex_t regex
Compiled regex.
Definition regex4.h:40
struct PatternList * color_pattern
Compiled pattern to speed up index color calculation.
Definition regex4.h:42
struct AttrColor attr_color
Colour and attributes to apply.
Definition regex4.h:38
char * pattern
Pattern to match.
Definition regex4.h:39
bool stop_matching
Used by the pager for body patterns, to prevent the color from being retried once it fails.
Definition regex4.h:44
int match
Substring to match, 0 for old behaviour.
Definition regex4.h:41
STAILQ_ENTRY(RegexColor) entries
Linked list.