23#ifndef MUTT_PATTERN_PRIVATE_H
24#define MUTT_PATTERN_PRIVATE_H
98#define RANGE_NUM_RX "([[:digit:]]+|0x[[:xdigit:]]+)[MmKk]?"
99#define RANGE_REL_SLOT_RX "[[:blank:]]*([.^$]|-?" RANGE_NUM_RX ")?[[:blank:]]*"
100#define RANGE_REL_RX "^" RANGE_REL_SLOT_RX "," RANGE_REL_SLOT_RX
103#define RANGE_ABS_SLOT_RX "[[:blank:]]*([.^$]|" RANGE_NUM_RX ")?[[:blank:]]*"
104#define RANGE_ABS_RX "^" RANGE_ABS_SLOT_RX "-" RANGE_ABS_SLOT_RX
107#define RANGE_LT_RX "^()[[:blank:]]*(<[[:blank:]]*" RANGE_NUM_RX ")[[:blank:]]*"
108#define RANGE_GT_RX "^()[[:blank:]]*(>[[:blank:]]*" RANGE_NUM_RX ")[[:blank:]]*"
111#define RANGE_BARE_RX "^[[:blank:]]*([.^$]|" RANGE_NUM_RX ")[[:blank:]]*"
112#define RANGE_RX_GROUPS 5
115#define RANGE_CIRCUM '^'
116#define RANGE_DOLLAR '$'
129#define EMSG(e) (((e)->msgno) + 1)
131#define MUTT_MAXRANGE -1
bool eat_message_range(struct Pattern *pat, PatternCompFlags flags, struct Buffer *s, struct Buffer *err, struct MailboxView *mv)
Parse a range of message numbers - Implements eat_arg_t -.
Convenience wrapper for the library headers.
uint8_t PatternCompFlags
Flags for mutt_pattern_comp(), e.g. MUTT_PC_FULL_MSG.
RangeSide
Which side of the range.
@ RANGE_S_LEFT
Left side of range.
@ RANGE_S_RIGHT
Right side of range.
bool eval_date_minmax(struct Pattern *pat, const char *s, struct Buffer *err)
Evaluate a date-range pattern against 'now'.
PatternEat
Function to process pattern arguments.
@ EAT_NONE
No arguments required.
@ EAT_RANGE
Process a number (range)
@ EAT_MESSAGE_RANGE
Process a message number (range)
@ EAT_DATE
Process a date (range)
@ EAT_QUERY
Process a query string.
@ EAT_REGEX
Process a regex.
const struct PatternFlags Flags[]
Lookup table for all patterns.
const struct PatternFlags * lookup_tag(char tag)
Lookup a pattern modifier.
struct RangeRegex RangeRegexes[]
Set of Regexes for various range types.
const struct PatternFlags * lookup_op(int op)
Lookup the Pattern Flags for an op.
@ RANGE_K_REL
Relative range.
@ RANGE_K_ABS
Absolute range.
@ RANGE_K_LT
Less-than range.
@ RANGE_K_INVALID
Range is invalid.
@ RANGE_K_BARE
Single symbol.
@ RANGE_K_GT
Greater-than range.
String manipulation buffer.
A line in the Pattern Completion menu.
const char * desc
Description of pattern.
const char * tag
Copied to buffer if selected.
const char * expr
Displayed in the menu.
Mapping between user character and internal constant.
enum PatternEat eat_arg
Type of function needed to parse flag, e.g. EAT_DATE.
int tag
Character used to represent this operation, e.g. 'A' for '~A'.
char * desc
Description of flag.
PatternCompFlags flags
Pattern flags, e.g. MUTT_PC_FULL_MSG.
int op
Operation to perform, e.g. MUTT_PAT_SCORE.
A simple (non-regex) pattern.
Regular expression representing a range.
int lgrp
Paren group matching the left side.
int rgrp
Paren group matching the right side.
regex_t cooked
Compiled form.
const char * raw
Regex as string.