Parse colour commands. More...
#include "config.h"
#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include "mutt/lib.h"
#include "core/lib.h"
#include "gui/lib.h"
#include "mutt.h"
#include "lib.h"
#include "init.h"
#include "options.h"
Go to the source code of this file.
Functions | |
static enum CommandResult | parse_color_name (const char *s, uint32_t *col, int *attrs, bool is_fg, struct Buffer *err) |
Parse a colour name. More... | |
static enum CommandResult | parse_attr_spec (struct Buffer *buf, struct Buffer *s, uint32_t *fg, uint32_t *bg, int *attrs, struct Buffer *err) |
Parse an attribute description - Implements parser_callback_t -. More... | |
static enum CommandResult | parse_color_pair (struct Buffer *buf, struct Buffer *s, uint32_t *fg, uint32_t *bg, int *attrs, struct Buffer *err) |
Parse a pair of colours - Implements parser_callback_t -. More... | |
void | get_colorid_name (unsigned int cid, struct Buffer *buf) |
Get the name of a color id. More... | |
static enum CommandResult | parse_object (struct Buffer *buf, struct Buffer *s, enum ColorId *cid, int *ql, struct Buffer *err) |
Identify a colour object. More... | |
static enum CommandResult | parse_uncolor (struct Buffer *buf, struct Buffer *s, struct Buffer *err, bool uncolor) |
Parse an 'uncolor' command. More... | |
static enum CommandResult | parse_color (struct Buffer *buf, struct Buffer *s, struct Buffer *err, parser_callback_t callback, bool dry_run, bool color) |
Parse a 'color' command. More... | |
enum CommandResult | mutt_parse_uncolor (struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err) |
Parse the 'uncolor' command - Implements Command::parse() -. More... | |
enum CommandResult | mutt_parse_unmono (struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err) |
Parse the 'unmono' command - Implements Command::parse() -. More... | |
enum CommandResult | mutt_parse_color (struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err) |
Parse the 'color' command - Implements Command::parse() -. More... | |
enum CommandResult | mutt_parse_mono (struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err) |
Parse the 'mono' command - Implements Command::parse() -. More... | |
Variables | |
const struct Mapping | ColorFields [] |
Mapping of colour names to their IDs. More... | |
const struct Mapping | ComposeColorFields [] |
Mapping of compose colour names to their IDs. More... | |
Parse colour commands.
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 command.c.
|
static |
Parse a colour name.
[in] | s | String to parse |
[out] | col | Number for 'colorNNN' colours |
[out] | attrs | Attributes, e.g. A_UNDERLINE |
[in] | is_fg | true if this is a foreground colour |
[out] | err | Buffer for error messages |
CommandResult | Result e.g. MUTT_CMD_SUCCESS |
Parse a colour name, such as "red", "brightgreen", "color123".
Definition at line 121 of file command.c.
void get_colorid_name | ( | unsigned int | cid, |
struct Buffer * | buf | ||
) |
Get the name of a color id.
cid | Colour, e.g. MT_COLOR_HEADER |
buf | Buffer for result |
Definition at line 329 of file command.c.
|
static |
Identify a colour object.
[in] | buf | Temporary Buffer space |
[in] | s | Buffer containing string to be parsed |
[out] | cid | Object type, e.g. MT_COLOR_TILDE |
[out] | ql | Quote level, if type MT_COLOR_QUOTED |
[out] | err | Buffer for error messages |
CommandResult | Result e.g. MUTT_CMD_SUCCESS |
Identify a colour object, e.g. "quoted", "compose header"
Definition at line 361 of file command.c.
|
static |
Parse an 'uncolor' command.
buf | Temporary Buffer space |
s | Buffer containing string to be parsed |
err | Buffer for error messages |
uncolor | If true, 'uncolor', else 'unmono' |
CommandResult | Result e.g. MUTT_CMD_SUCCESS |
Usage:
Definition at line 431 of file command.c.
|
static |
Parse a 'color' command.
buf | Temporary Buffer space |
s | Buffer containing string to be parsed |
err | Buffer for error messages |
callback | Function to handle command - Implements parser_callback_t |
dry_run | If true, test the command, but don't apply it |
color | If true "color", else "mono" |
CommandResult | Result e.g. MUTT_CMD_SUCCESS |
Usage:
Definition at line 532 of file command.c.
const struct Mapping ColorFields[] |
const struct Mapping ComposeColorFields[] |
Mapping of compose colour names to their IDs.