NeoMutt
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 <stdint.h>
29#include "mutt/lib.h"
30#include "attr.h"
31#include "color.h"
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
50#ifdef USE_DEBUG_COLOR
51extern struct RegexColorList AttachList;
52extern struct RegexColorList BodyList;
53extern struct RegexColorList HeaderList;
54extern struct RegexColorList IndexAuthorList;
55extern struct RegexColorList IndexCollapsedList;
56extern struct RegexColorList IndexDateList;
57extern struct RegexColorList IndexFlagsList;
58extern struct RegexColorList IndexLabelList;
59extern struct RegexColorList IndexList;
60extern struct RegexColorList IndexNumberList;
61extern struct RegexColorList IndexSizeList;
62extern struct RegexColorList IndexSubjectList;
63extern struct RegexColorList IndexTagList;
64extern struct RegexColorList IndexTagsList;
65extern struct RegexColorList StatusList;
66#endif
67
68void regex_color_clear(struct RegexColor *rcol);
69void regex_color_free(struct RegexColorList *list, struct RegexColor **ptr);
70struct RegexColor * regex_color_new (void);
71
72void regex_colors_cleanup(void);
73struct RegexColorList *regex_colors_get_list(enum ColorId cid);
74void regex_colors_init(void);
75
76void regex_color_list_clear(struct RegexColorList *rcl);
77
78bool regex_colors_parse_color_list (enum ColorId cid, const char *pat, uint32_t fg, uint32_t bg, int attrs, int *rc, struct Buffer *err);
79int regex_colors_parse_status_list(enum ColorId cid, const char *pat, uint32_t fg, uint32_t bg, int attrs, int match, struct Buffer *err);
80bool regex_colors_parse_uncolor (enum ColorId cid, const char *pat, bool uncolor);
81
82#endif /* MUTT_COLOR_REGEX4_H */
Colour and attributes.
struct RegexColorList IndexCollapsedList
List of colours applied to a collapsed thread in the index.
Definition: regex.c:52
struct RegexColorList IndexFlagsList
List of colours applied to the flags in the index.
Definition: regex.c:54
struct RegexColorList IndexAuthorList
List of colours applied to the author in the index.
Definition: regex.c:51
struct RegexColorList IndexSubjectList
List of colours applied to the subject in the index.
Definition: regex.c:59
struct RegexColorList IndexLabelList
List of colours applied to the label in the index.
Definition: regex.c:55
struct RegexColorList StatusList
List of colours applied to the status bar.
Definition: regex.c:62
struct RegexColorList IndexList
List of default colours applied to the index.
Definition: regex.c:56
struct RegexColorList IndexTagList
List of colours applied to tags in the index.
Definition: regex.c:60
struct RegexColorList BodyList
List of colours applied to the email body.
Definition: regex.c:49
struct RegexColorList IndexTagsList
List of colours applied to the tags in the index.
Definition: regex.c:61
struct RegexColorList HeaderList
List of colours applied to the email headers.
Definition: regex.c:50
struct RegexColorList AttachList
List of colours applied to the attachment headers.
Definition: regex.c:48
struct RegexColorList IndexDateList
List of colours applied to the date in the index.
Definition: regex.c:53
struct RegexColorList IndexNumberList
List of colours applied to the message number in the index.
Definition: regex.c:57
struct RegexColorList IndexSizeList
List of colours applied to the size in the index.
Definition: regex.c:58
Color and attribute parsing.
ColorId
List of all colored objects.
Definition: color.h:38
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
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:439
bool regex_colors_parse_color_list(enum ColorId cid, const char *pat, uint32_t fg, uint32_t bg, int attrs, int *rc, struct Buffer *err)
Parse a Regex 'color' command.
Definition: regex.c:340
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
int regex_colors_parse_status_list(enum ColorId cid, const char *pat, uint32_t fg, uint32_t bg, int attrs, int match, struct Buffer *err)
Parse a Regex 'color status' command.
Definition: regex.c:410
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:35
String manipulation buffer.
Definition: buffer.h:34
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.