NeoMutt  2022-04-29-178-g3b62e6
Teaching an old dog new tricks
DOXYGEN
command.c File Reference

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"
+ Include dependency graph for command.c:

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...
 

Detailed Description

Parse colour commands.

Authors
  • Richard Russon

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.

Function Documentation

◆ parse_color_name()

static enum CommandResult parse_color_name ( const char *  s,
uint32_t *  col,
int *  attrs,
bool  is_fg,
struct Buffer err 
)
static

Parse a colour name.

Parameters
[in]sString to parse
[out]colNumber for 'colorNNN' colours
[out]attrsAttributes, e.g. A_UNDERLINE
[in]is_fgtrue if this is a foreground colour
[out]errBuffer for error messages
Return values
CommandResultResult e.g. MUTT_CMD_SUCCESS

Parse a colour name, such as "red", "brightgreen", "color123".

Definition at line 121 of file command.c.

123{
124 char *eptr = NULL;
125 bool is_alert = false, is_bright = false, is_light = false;
126 int clen;
127
128 if ((clen = mutt_istr_startswith(s, "bright")))
129 {
130 color_debug(LL_DEBUG5, "bright\n");
131 is_bright = true;
132 s += clen;
133 }
134 else if ((clen = mutt_istr_startswith(s, "alert")))
135 {
136 color_debug(LL_DEBUG5, "alert\n");
137 is_alert = true;
138 is_bright = true;
139 s += clen;
140 }
141 else if ((clen = mutt_istr_startswith(s, "light")))
142 {
143 color_debug(LL_DEBUG5, "light\n");
144 is_light = true;
145 s += clen;
146 }
147
148 /* allow aliases for xterm color resources */
149 if ((clen = mutt_istr_startswith(s, "color")))
150 {
151 s += clen;
152 *col = strtoul(s, &eptr, 10);
153 if ((*s == '\0') || (*eptr != '\0') || ((*col >= COLORS) && !OptNoCurses))
154 {
155 mutt_buffer_printf(err, _("%s: color not supported by term"), s);
156 return MUTT_CMD_ERROR;
157 }
158 color_debug(LL_DEBUG5, "colorNNN %d\n", *col);
159 }
160 else if ((*col = mutt_map_get_value(s, ColorNames)) == -1)
161 {
162 mutt_buffer_printf(err, _("%s: no such color"), s);
163 return MUTT_CMD_WARNING;
164 }
165 const char *name = mutt_map_get_name(*col, ColorNames);
166 if (name)
167 color_debug(LL_DEBUG5, "color: %s\n", name);
168
169 if (is_bright || is_light)
170 {
171 if (is_alert)
172 {
173 *attrs |= A_BOLD;
174 *attrs |= A_BLINK;
175 }
176 else if (is_fg)
177 {
178 if ((COLORS >= 16) && is_light)
179 {
180 if (*col <= 7)
181 {
182 /* Advance the color 0-7 by 8 to get the light version */
183 *col += 8;
184 }
185 }
186 else
187 {
188 *attrs |= A_BOLD;
189 }
190 }
191 else
192 {
193 if (COLORS >= 16)
194 {
195 if (*col <= 7)
196 {
197 /* Advance the color 0-7 by 8 to get the light version */
198 *col += 8;
199 }
200 }
201 }
202 }
203
204 return MUTT_CMD_SUCCESS;
205}
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition: buffer.c:158
const struct Mapping ColorNames[]
Definition: color.c:37
@ MUTT_CMD_SUCCESS
Success: Command worked.
Definition: command.h:37
@ MUTT_CMD_ERROR
Error: Can't help the user.
Definition: command.h:35
@ MUTT_CMD_WARNING
Warning: Help given to the user.
Definition: command.h:36
int color_debug(enum LogLevel level, const char *format,...)
Write to the log file.
Definition: debug.c:44
@ LL_DEBUG5
Log at debug level 5.
Definition: logging.h:44
int mutt_map_get_value(const char *name, const struct Mapping *map)
Lookup the constant for a string.
Definition: mapping.c:85
const char * mutt_map_get_name(int val, const struct Mapping *map)
Lookup a string for a constant.
Definition: mapping.c:42
#define _(a)
Definition: message.h:28
size_t mutt_istr_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix, ignoring case.
Definition: string.c:239
bool OptNoCurses
(pseudo) when sending in batch mode
Definition: options.h:53
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_colorid_name()

void get_colorid_name ( unsigned int  cid,
struct Buffer buf 
)

Get the name of a color id.

Parameters
cidColour, e.g. MT_COLOR_HEADER
bufBuffer for result

Definition at line 329 of file command.c.

330{
331 const char *name = NULL;
332
334 {
336 if (name)
337 {
338 mutt_buffer_printf(buf, "compose %s", name);
339 return;
340 }
341 }
342
343 name = mutt_map_get_name(cid, ColorFields);
344 if (name)
345 mutt_buffer_printf(buf, "%s", name);
346 else
347 mutt_buffer_printf(buf, "UNKNOWN %d", cid);
348}
const struct Mapping ComposeColorFields[]
Mapping of compose colour names to their IDs.
Definition: command.c:99
const struct Mapping ColorFields[]
Mapping of colour names to their IDs.
Definition: command.c:45
@ MT_COLOR_COMPOSE_SECURITY_SIGN
Mail will be signed.
Definition: color.h:45
@ MT_COLOR_COMPOSE_HEADER
Header labels, e.g. From:
Definition: color.h:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_object()

static enum CommandResult parse_object ( struct Buffer buf,
struct Buffer s,
enum ColorId cid,
int *  ql,
struct Buffer err 
)
static

Identify a colour object.

Parameters
[in]bufTemporary Buffer space
[in]sBuffer containing string to be parsed
[out]cidObject type, e.g. MT_COLOR_TILDE
[out]qlQuote level, if type MT_COLOR_QUOTED
[out]errBuffer for error messages
Return values
CommandResultResult e.g. MUTT_CMD_SUCCESS

Identify a colour object, e.g. "quoted", "compose header"

Definition at line 361 of file command.c.

363{
364 int rc;
365
366 if (mutt_str_startswith(buf->data, "quoted") != 0)
367 {
368 int val = 0;
369 if (buf->data[6] != '\0')
370 {
371 if (!mutt_str_atoi_full(buf->data + 6, &val) || (val > COLOR_QUOTES_MAX))
372 {
373 mutt_buffer_printf(err, _("%s: no such object"), buf->data);
374 return MUTT_CMD_WARNING;
375 }
376 }
377
378 *ql = val;
379 *cid = MT_COLOR_QUOTED;
380 return MUTT_CMD_SUCCESS;
381 }
382
383 if (mutt_istr_equal(buf->data, "compose"))
384 {
385 if (!MoreArgs(s))
386 {
387 mutt_buffer_printf(err, _("%s: too few arguments"), "color");
388 return MUTT_CMD_WARNING;
389 }
390
392
394 if (rc == -1)
395 {
396 mutt_buffer_printf(err, _("%s: no such object"), buf->data);
397 return MUTT_CMD_WARNING;
398 }
399
400 *cid = rc;
401 return MUTT_CMD_SUCCESS;
402 }
403
405 if (rc == -1)
406 {
407 mutt_buffer_printf(err, _("%s: no such object"), buf->data);
408 return MUTT_CMD_WARNING;
409 }
410 else
411 {
412 color_debug(LL_DEBUG5, "object: %s\n", mutt_map_get_name(rc, ColorFields));
413 }
414
415 *cid = rc;
416 return MUTT_CMD_SUCCESS;
417}
#define MoreArgs(buf)
Definition: buffer.h:40
@ MT_COLOR_QUOTED
Pager: quoted text.
Definition: color.h:58
int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags)
Extract one token from a string.
Definition: init.c:273
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
Definition: string.c:796
size_t mutt_str_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix.
Definition: string.c:227
#define MUTT_TOKEN_NO_FLAGS
No flags are set.
Definition: mutt.h:67
#define COLOR_QUOTES_MAX
Ten colours, quoted0..quoted9 (quoted and quoted0 are equivalent)
Definition: quoted.h:37
char * data
Pointer to data.
Definition: buffer.h:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_uncolor()

static enum CommandResult parse_uncolor ( struct Buffer buf,
struct Buffer s,
struct Buffer err,
bool  uncolor 
)
static

Parse an 'uncolor' command.

Parameters
bufTemporary Buffer space
sBuffer containing string to be parsed
errBuffer for error messages
uncolorIf true, 'uncolor', else 'unmono'
Return values
CommandResultResult e.g. MUTT_CMD_SUCCESS

Usage:

  • uncolor index pattern [pattern...]
  • unmono index pattern [pattern...]

Definition at line 431 of file command.c.

433{
435
436 if (mutt_str_equal(buf->data, "*"))
437 {
438 colors_clear();
439 return MUTT_CMD_SUCCESS;
440 }
441
442 unsigned int cid = MT_COLOR_NONE;
443 int ql = 0;
444 color_debug(LL_DEBUG5, "uncolor: %s\n", mutt_buffer_string(buf));
445 enum CommandResult rc = parse_object(buf, s, &cid, &ql, err);
446 if (rc != MUTT_CMD_SUCCESS)
447 return rc;
448
449 if (cid == -1)
450 {
451 mutt_buffer_printf(err, _("%s: no such object"), buf->data);
452 return MUTT_CMD_ERROR;
453 }
454
455 if (cid == MT_COLOR_QUOTED)
456 {
457 color_debug(LL_DEBUG5, "quoted\n");
458 return quoted_colors_parse_uncolor(cid, ql, err);
459 }
460
461 if ((cid == MT_COLOR_STATUS) && !MoreArgs(s))
462 {
463 color_debug(LL_DEBUG5, "simple\n");
464 simple_color_reset(cid); // default colour for the status bar
465 return MUTT_CMD_SUCCESS;
466 }
467
468 if ((cid != MT_COLOR_ATTACH_HEADERS) && (cid != MT_COLOR_BODY) &&
469 (cid != MT_COLOR_HEADER) && (cid != MT_COLOR_INDEX) && (cid != MT_COLOR_INDEX_AUTHOR) &&
470 (cid != MT_COLOR_INDEX_FLAGS) && (cid != MT_COLOR_INDEX_SUBJECT) &&
471 (cid != MT_COLOR_INDEX_TAG) && (cid != MT_COLOR_STATUS))
472 {
473 color_debug(LL_DEBUG5, "simple\n");
475 return MUTT_CMD_SUCCESS;
476 }
477
478 if (!MoreArgs(s))
479 {
480 mutt_buffer_printf(err, _("%s: too few arguments"), uncolor ? "uncolor" : "unmono");
481 return MUTT_CMD_WARNING;
482 }
483
484 if (OptNoCurses)
485 {
486 do
487 {
488 color_debug(LL_DEBUG5, "do nothing\n");
489 /* just eat the command, but don't do anything real about it */
491 } while (MoreArgs(s));
492
493 return MUTT_CMD_SUCCESS;
494 }
495
496 bool changes = false;
497 do
498 {
500 if (mutt_str_equal("*", buf->data))
501 {
502 if (regex_colors_parse_uncolor(cid, NULL, uncolor))
503 return MUTT_CMD_SUCCESS;
504 else
505 return MUTT_CMD_ERROR;
506 }
507
508 changes |= regex_colors_parse_uncolor(cid, buf->data, uncolor);
509
510 } while (MoreArgs(s));
511
512 if (changes)
514
515 return MUTT_CMD_SUCCESS;
516}
static const char * mutt_buffer_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:77
static enum CommandResult parse_object(struct Buffer *buf, struct Buffer *s, enum ColorId *cid, int *ql, struct Buffer *err)
Identify a colour object.
Definition: command.c:361
bool regex_colors_parse_uncolor(enum ColorId cid, const char *pat, bool uncolor)
Parse a Regex 'uncolor' command.
Definition: regex.c:403
void simple_color_reset(enum ColorId cid)
Clear the colour of a simple object.
Definition: simple.c:144
void colors_clear(void)
Reset all the simple, quoted and regex colours.
Definition: color.c:55
@ MT_COLOR_INDEX_AUTHOR
Index: author field (takes a pattern)
Definition: color.h:78
@ MT_COLOR_HEADER
Message headers (takes a pattern)
Definition: color.h:48
@ MT_COLOR_STATUS
Status bar (takes a pattern)
Definition: color.h:71
@ MT_COLOR_NONE
Definition: color.h:36
@ MT_COLOR_INDEX_SUBJECT
Index: subject field (takes a pattern)
Definition: color.h:80
@ MT_COLOR_BODY
Pager: highlight body of message (takes a pattern)
Definition: color.h:39
@ MT_COLOR_INDEX_TAG
Index: tag field (g, takes a pattern)
Definition: color.h:81
@ MT_COLOR_ATTACH_HEADERS
MIME attachment test (takes a pattern)
Definition: color.h:38
@ MT_COLOR_INDEX
Index: default colour (takes a pattern)
Definition: color.h:77
@ MT_COLOR_INDEX_FLAGS
Index: flags field (takes a pattern)
Definition: color.h:79
CommandResult
Error codes for command_t parse functions.
Definition: command.h:34
void regex_colors_dump_all(void)
Dump all the Regex colours to the log.
Definition: debug.c:380
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:784
enum CommandResult quoted_colors_parse_uncolor(enum ColorId cid, int q_level, struct Buffer *err)
Parse the 'uncolor quoted' command.
Definition: quoted.c:163
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_color()

static enum CommandResult parse_color ( struct Buffer buf,
struct Buffer s,
struct Buffer err,
parser_callback_t  callback,
bool  dry_run,
bool  color 
)
static

Parse a 'color' command.

Parameters
bufTemporary Buffer space
sBuffer containing string to be parsed
errBuffer for error messages
callbackFunction to handle command - Implements parser_callback_t
dry_runIf true, test the command, but don't apply it
colorIf true "color", else "mono"
Return values
CommandResultResult e.g. MUTT_CMD_SUCCESS

Usage:

  • color OBJECT [ ATTRS ] FG BG [ REGEX ]
  • mono OBJECT ATTRS [ REGEX ]

Definition at line 532 of file command.c.

535{
536 int attrs = 0, q_level = 0;
537 uint32_t fg = 0, bg = 0, match = 0;
538 enum ColorId cid = MT_COLOR_NONE;
539 enum CommandResult rc;
540
541 if (!MoreArgs(s))
542 {
543 mutt_buffer_printf(err, _("%s: too few arguments"), "color");
544 return MUTT_CMD_WARNING;
545 }
546
548 color_debug(LL_DEBUG5, "color: %s\n", mutt_buffer_string(buf));
549
550 rc = parse_object(buf, s, &cid, &q_level, err);
551 if (rc != MUTT_CMD_SUCCESS)
552 return rc;
553
554 rc = callback(buf, s, &fg, &bg, &attrs, err);
555 if (rc != MUTT_CMD_SUCCESS)
556 return rc;
557
558 /* extract a regular expression if needed */
559
560 if ((cid == MT_COLOR_ATTACH_HEADERS) || (cid == MT_COLOR_BODY) ||
561 (cid == MT_COLOR_HEADER) || (cid == MT_COLOR_INDEX) ||
562 (cid == MT_COLOR_INDEX_AUTHOR) || (cid == MT_COLOR_INDEX_FLAGS) ||
563 (cid == MT_COLOR_INDEX_SUBJECT) || (cid == MT_COLOR_INDEX_TAG))
564 {
565 color_debug(LL_DEBUG5, "regex needed\n");
566 if (!MoreArgs(s))
567 {
568 mutt_buffer_printf(err, _("%s: too few arguments"), color ? "color" : "mono");
569 return MUTT_CMD_WARNING;
570 }
571
573 }
574
575 if (MoreArgs(s) && (cid != MT_COLOR_STATUS))
576 {
577 mutt_buffer_printf(err, _("%s: too many arguments"), color ? "color" : "mono");
578 return MUTT_CMD_WARNING;
579 }
580
581 if (dry_run)
582 {
583 color_debug(LL_DEBUG5, "dry_run bailout\n");
584 *s->dptr = '\0'; /* fake that we're done parsing */
585 return MUTT_CMD_SUCCESS;
586 }
587
588 /* The case of the tree object is special, because a non-default fg color of
589 * the tree element may be combined dynamically with the default bg color of
590 * an index line, not necessarily defined in a rc file. */
591 if (!OptNoCurses &&
592 ((fg == COLOR_DEFAULT) || (bg == COLOR_DEFAULT) || (cid == MT_COLOR_TREE)) &&
593 (use_default_colors() != OK))
594 {
595 mutt_buffer_strcpy(err, _("default colors not supported"));
596 return MUTT_CMD_ERROR;
597 }
598
599 if (regex_colors_parse_color_list(cid, buf->data, fg, bg, attrs, &rc, err))
600 {
601 color_debug(LL_DEBUG5, "regex_colors_parse_color_list done\n");
602 return MUTT_CMD_SUCCESS;
603 // do nothing
604 }
605 else if (quoted_colors_parse_color(cid, fg, bg, attrs, q_level, &rc, err))
606 {
607 color_debug(LL_DEBUG5, "quoted_colors_parse_color done\n");
608 return MUTT_CMD_SUCCESS;
609 // do nothing
610 }
611 else if ((cid == MT_COLOR_STATUS) && MoreArgs(s))
612 {
613 color_debug(LL_DEBUG5, "status\n");
614 /* 'color status fg bg' can have up to 2 arguments:
615 * 0 arguments: sets the default status color (handled below by else part)
616 * 1 argument : colorize pattern on match
617 * 2 arguments: colorize nth submatch of pattern */
619
620 if (MoreArgs(s))
621 {
622 struct Buffer tmp = mutt_buffer_make(0);
624 if (!mutt_str_atoui_full(tmp.data, &match))
625 {
626 mutt_buffer_printf(err, _("%s: invalid number: %s"),
627 color ? "color" : "mono", tmp.data);
629 return MUTT_CMD_WARNING;
630 }
632 }
633
634 if (MoreArgs(s))
635 {
636 mutt_buffer_printf(err, _("%s: too many arguments"), color ? "color" : "mono");
637 return MUTT_CMD_WARNING;
638 }
639
640 rc = regex_colors_parse_status_list(cid, buf->data, fg, bg, attrs, match, err);
641 return rc;
642 }
643 else // Remaining simple colours
644 {
645 color_debug(LL_DEBUG5, "simple\n");
646 if (simple_color_set(cid, fg, bg, attrs))
647 rc = MUTT_CMD_SUCCESS;
648 else
649 rc = MUTT_CMD_ERROR;
650 }
651
652 if (rc == MUTT_CMD_SUCCESS)
653 {
654 get_colorid_name(cid, buf);
655 color_debug(LL_DEBUG5, "NT_COLOR_SET: %s\n", buf->data);
656 struct EventColor ev_c = { cid, NULL };
658 }
659
660 return rc;
661}
struct Buffer mutt_buffer_make(size_t size)
Make a new buffer on the stack.
Definition: buffer.c:63
size_t mutt_buffer_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition: buffer.c:310
void mutt_buffer_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
Definition: buffer.c:292
void get_colorid_name(unsigned int cid, struct Buffer *buf)
Get the name of a color id.
Definition: command.c:329
struct Notify * ColorsNotify
Notifications: ColorId, EventColor.
Definition: notify.c:34
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:310
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:374
struct AttrColor * simple_color_set(enum ColorId cid, int fg, int bg, int attrs)
Set the colour of a simple object.
Definition: simple.c:118
#define COLOR_DEFAULT
Definition: color.h:100
ColorId
List of all colored objects.
Definition: color.h:35
@ MT_COLOR_TREE
Index: tree-drawing characters.
Definition: color.h:73
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition: notify.c:171
@ NT_COLOR_SET
Color has been set.
Definition: notify2.h:41
@ NT_COLOR
Colour has changed, NotifyColor, EventColor.
Definition: notify_type.h:41
bool quoted_colors_parse_color(enum ColorId cid, uint32_t fg, uint32_t bg, int attrs, int q_level, int *rc, struct Buffer *err)
Parse the 'color quoted' command.
Definition: quoted.c:99
String manipulation buffer.
Definition: buffer.h:34
char * dptr
Current read/write position.
Definition: buffer.h:36
An Event that happened to a Colour.
Definition: notify2.h:53
enum ColorId cid
Colour ID that has changed.
Definition: notify2.h:54
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ ColorFields

const struct Mapping ColorFields[]

Mapping of colour names to their IDs.

Definition at line 45 of file command.c.

◆ ComposeColorFields

const struct Mapping ComposeColorFields[]
Initial value:
= {
{ "header", MT_COLOR_COMPOSE_HEADER },
{ "security_encrypt", MT_COLOR_COMPOSE_SECURITY_ENCRYPT },
{ "security_sign", MT_COLOR_COMPOSE_SECURITY_SIGN },
{ "security_both", MT_COLOR_COMPOSE_SECURITY_BOTH },
{ "security_none", MT_COLOR_COMPOSE_SECURITY_NONE },
{ NULL, 0 }
}
@ MT_COLOR_COMPOSE_SECURITY_ENCRYPT
Mail will be encrypted.
Definition: color.h:43
@ MT_COLOR_COMPOSE_SECURITY_NONE
Mail will not be encrypted or signed.
Definition: color.h:44
@ MT_COLOR_COMPOSE_SECURITY_BOTH
Mail will be encrypted and signed.
Definition: color.h:42

Mapping of compose colour names to their IDs.

Definition at line 99 of file command.c.