Pattern handling for messages. More...
#include "config.h"
#include <ctype.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "private.h"
#include "mutt/lib.h"
#include "core/lib.h"
#include "lib.h"
#include "menu/lib.h"
#include "mview.h"
Go to the source code of this file.
Macros | |
#define | KILO 1024 |
#define | MEGA 1048576 |
Enumerations | |
enum | EatRangeError { RANGE_E_OK , RANGE_E_SYNTAX , RANGE_E_MVIEW } |
Error codes for eat_range_by_regex() More... | |
Functions | |
static int | report_regerror (int regerr, regex_t *preg, struct Buffer *err) |
Create a regex error message. | |
static bool | is_menu_available (struct Buffer *s, regmatch_t pmatch[], int kind, struct Buffer *err, const struct Menu *menu) |
Do we need a MailboxView for this Pattern? | |
static int | scan_range_num (struct Buffer *s, regmatch_t pmatch[], int group, int kind, struct MailboxView *mv) |
Parse a number range. | |
static int | scan_range_slot (struct Buffer *s, regmatch_t pmatch[], int grp, int side, int kind, struct MailboxView *mv) |
Parse a range of message numbers. | |
static void | order_range (struct Pattern *pat) |
Put a range in order. | |
static int | eat_range_by_regex (struct Pattern *pat, struct Buffer *s, int kind, struct Buffer *err, struct MailboxView *mv) |
Parse a range given as a regex. | |
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 -. | |
Pattern handling for messages.
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 message.c.
enum EatRangeError |
Error codes for eat_range_by_regex()
Enumerator | |
---|---|
RANGE_E_OK | Range is valid. |
RANGE_E_SYNTAX | Range contains syntax error. |
RANGE_E_MVIEW | Range requires MailboxView, but none available. |
|
static |
Create a regex error message.
RANGE_E_SYNTAX | Always |
Definition at line 62 of file message.c.
|
static |
Do we need a MailboxView for this Pattern?
s | String to check |
pmatch | Regex matches |
kind | Range type, e.g. RANGE_K_REL |
err | Buffer for error messages |
menu | Current Menu |
false | MailboxView is required, but not available |
true | Otherwise |
Definition at line 82 of file message.c.
|
static |
Parse a number range.
s | String to parse |
pmatch | Array of regex matches |
group | Index of regex match to use |
kind | Range type, e.g. RANGE_K_REL |
mv | Mailbox view |
num | Parse number |
Definition at line 118 of file message.c.
|
static |
Parse a range of message numbers.
s | String to parse |
pmatch | Regex matches |
grp | Which regex match to use |
side | Which side of the range is this? RANGE_S_LEFT or RANGE_S_RIGHT |
kind | Range type, e.g. RANGE_K_REL |
mv | Mailbox view |
num | Index number for the message specified |
Definition at line 157 of file message.c.
|
static |
|
static |
Parse a range given as a regex.
pat | Pattern to store the range in |
s | String to parse |
kind | Range type, e.g. RANGE_K_REL |
err | Buffer for error messages |
mv | Mailbox view |
num | EatRangeError code, e.g. RANGE_E_OK |
Definition at line 217 of file message.c.