#include "config.h"#include <stdbool.h>#include <stddef.h>#include <stdint.h>#include "mutt/lib.h"#include "config/lib.h"#include "core/lib.h"#include "index/lib.h"#include "pattern/lib.h"#include "attr.h"#include "color.h"#include "commands.h"#include "debug.h"#include "notify2.h"#include "regex4.h"
Include dependency graph for regex.c:Go to the source code of this file.
Functions | |
| void | regex_colors_init (void) |
| Initialise the Regex colours. | |
| void | regex_colors_reset (void) |
| Reset the Regex colours. | |
| void | regex_colors_cleanup (void) |
| Cleanup the Regex colours. | |
| void | regex_color_clear (struct RegexColor *rcol) |
| Free the contents of a Regex colour. | |
| void | regex_color_free (struct RegexColor **ptr) |
| Free a Regex colour. | |
| struct RegexColor * | regex_color_new (void) |
| Create a new RegexColor. | |
| struct RegexColorList * | regex_color_list_new (void) |
| Create a new RegexColorList. | |
| void | regex_color_list_clear (struct RegexColorList *rcl) |
| Free the contents of a RegexColorList. | |
| struct RegexColorList * | regex_colors_get_list (enum ColorId cid) |
| Return the RegexColorList for a Colour ID. | |
| static enum CommandResult | add_pattern (struct RegexColorList *rcl, const char *s, struct AttrColor *ac_val, struct Buffer *err, bool is_index, int match) |
| Associate a colour to a pattern. | |
| 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. | |
| 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. | |
| bool | regex_colors_parse_uncolor (enum ColorId cid, const char *pat) |
| Parse a Regex 'uncolor' command. | |
Variables | |
| struct RegexColorList | AttachList |
| List of colours applied to the attachment headers. | |
| struct RegexColorList | BodyList |
| List of colours applied to the email body. | |
| struct RegexColorList | HeaderList |
| List of colours applied to the email headers. | |
| struct RegexColorList | IndexAuthorList |
| List of colours applied to the author in the index. | |
| struct RegexColorList | IndexCollapsedList |
| List of colours applied to a collapsed thread in the index. | |
| struct RegexColorList | IndexDateList |
| List of colours applied to the date in the index. | |
| struct RegexColorList | IndexFlagsList |
| List of colours applied to the flags in the index. | |
| struct RegexColorList | IndexLabelList |
| List of colours applied to the label in the index. | |
| struct RegexColorList | IndexList |
| List of default colours applied to the index. | |
| struct RegexColorList | IndexNumberList |
| List of colours applied to the message number in the index. | |
| struct RegexColorList | IndexSizeList |
| List of colours applied to the size in the index. | |
| struct RegexColorList | IndexSubjectList |
| List of colours applied to the subject in the index. | |
| struct RegexColorList | IndexTagList |
| List of colours applied to tags in the index. | |
| struct RegexColorList | IndexTagsList |
| List of colours applied to the tags in the index. | |
| struct RegexColorList | StatusList |
| List of colours applied to the status bar. | |
Regex Colour.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file regex.c.
| void regex_colors_init | ( | void | ) |
Initialise the Regex colours.
Definition at line 68 of file regex.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void regex_colors_reset | ( | void | ) |
Reset the Regex colours.
Definition at line 91 of file regex.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void regex_colors_cleanup | ( | void | ) |
Cleanup the Regex colours.
Definition at line 114 of file regex.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void regex_color_clear | ( | struct RegexColor * | rcol | ) |
Free the contents of a Regex colour.
| rcol | RegexColor to empty |
Definition at line 125 of file regex.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void regex_color_free | ( | struct RegexColor ** | ptr | ) |
Free a Regex colour.
| ptr | RegexColor to free |
Definition at line 143 of file regex.c.
Here is the call graph for this function:
Here is the caller graph for this function:| struct RegexColor * regex_color_new | ( | void | ) |
Create a new RegexColor.
| ptr | New RegexColor |
Definition at line 158 of file regex.c.
Here is the caller graph for this function:| struct RegexColorList * regex_color_list_new | ( | void | ) |
Create a new RegexColorList.
| ptr | New RegexColorList |
Definition at line 167 of file regex.c.
Here is the call graph for this function:| void regex_color_list_clear | ( | struct RegexColorList * | rcl | ) |
Free the contents of a RegexColorList.
| rcl | List to clear |
Free each of the RegexColorList in a list.
Definition at line 187 of file regex.c.
Here is the call graph for this function:
Here is the caller graph for this function:| struct RegexColorList * regex_colors_get_list | ( | enum ColorId | cid | ) |
Return the RegexColorList for a Colour ID.
| cid | Colour ID, e.g. MT_COLOR_BODY |
| ptr | RegexColorList |
Definition at line 205 of file regex.c.
Here is the caller graph for this function:
|
static |
Associate a colour to a pattern.
| rcl | List of existing colours |
| s | String to match |
| ac_val | Colour value to use |
| err | Buffer for error messages |
| is_index | true of this is for the index |
| match | Number of regex subexpression to match (0 for entire pattern) |
| CommandResult | Result e.g. MUTT_CMD_SUCCESS |
is_index used to store compiled pattern only for 'index' color object when called from parse_color()
Definition at line 257 of file regex.c.
Here is the call graph for this function:
Here is the caller graph for this function:| 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.
| cid | Colour ID, should be MT_COLOR_STATUS |
| pat | Regex pattern |
| ac | Colour value to use |
| rc | Return code, e.g. MUTT_CMD_SUCCESS |
| err | Buffer for error messages |
| true | Colour was parsed |
Parse a Regex 'color' command, e.g. "color index green default pattern"
Definition at line 336 of file regex.c.
Here is the call graph for this function:
Here is the caller graph for this function:| 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.
| cid | Colour ID, should be MT_COLOR_STATUS |
| pat | Regex pattern |
| ac | Colour value to use |
| match | Use the nth regex submatch |
| err | Buffer for error messages |
| CommandResult | Result e.g. MUTT_CMD_SUCCESS |
Definition at line 397 of file regex.c.
Here is the call graph for this function:
Here is the caller graph for this function:| bool regex_colors_parse_uncolor | ( | enum ColorId | cid, |
| const char * | pat ) |
Parse a Regex 'uncolor' command.
| cid | Colour ID, e.g. MT_COLOR_STATUS |
| pat | Pattern to remove (NULL to remove all) |
| true | If colours were unset |
Definition at line 424 of file regex.c.
Here is the call graph for this function:
Here is the caller graph for this function:| struct RegexColorList AttachList |
| struct RegexColorList BodyList |
| struct RegexColorList HeaderList |
| struct RegexColorList IndexAuthorList |
| struct RegexColorList IndexCollapsedList |
| struct RegexColorList IndexDateList |
| struct RegexColorList IndexFlagsList |
| struct RegexColorList IndexLabelList |
| struct RegexColorList IndexList |
| struct RegexColorList IndexNumberList |
| struct RegexColorList IndexSizeList |
| struct RegexColorList IndexSubjectList |
| struct RegexColorList IndexTagList |
| struct RegexColorList IndexTagsList |