Prototype for a function to parse color config.
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...
|
|
Prototype for a function to parse color config.
- Parameters
-
[in] | buf | Temporary Buffer space |
[in] | s | Buffer containing string to be parsed |
[out] | fg | Foreground colour (set to -1) |
[out] | bg | Background colour (set to -1) |
[out] | attrs | Attributes, e.g. A_UNDERLINE |
[out] | err | Buffer for error messages |
- Return values
-
◆ parse_attr_spec()
Parse an attribute description - Implements parser_callback_t -.
Definition at line 210 of file command.c.
213{
214 if (fg)
216 if (bg)
218
220 {
223 }
224
226
228 *attrs |= A_BOLD;
230 *attrs |= A_ITALIC;
232 *attrs = A_NORMAL;
234 *attrs = A_NORMAL;
236 *attrs |= A_REVERSE;
238 *attrs |= A_STANDOUT;
240 *attrs |= A_UNDERLINE;
241 else
242 {
245 }
246
248}
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
@ MUTT_CMD_SUCCESS
Success: Command worked.
@ MUTT_CMD_WARNING
Warning: Help given to the user.
int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags)
Extract one token from a string.
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
#define MUTT_TOKEN_NO_FLAGS
No flags are set.
char * data
Pointer to data.
◆ parse_color_pair()
Parse a pair of colours - Implements parser_callback_t -.
Parse a pair of colours, e.g. "red default"
Definition at line 255 of file command.c.
258{
259 while (true)
260 {
262 {
265 }
266
268
270 {
271 *attrs |= A_BOLD;
273 }
275 {
276 *attrs |= A_ITALIC;
278 }
280 {
281 *attrs = A_NORMAL;
283 }
285 {
286 *attrs = A_NORMAL;
288 }
290 {
291 *attrs |= A_REVERSE;
293 }
295 {
296 *attrs |= A_STANDOUT;
298 }
300 {
301 *attrs |= A_UNDERLINE;
303 }
304 else
305 {
308 return rc;
309 break;
310 }
311 }
312
314 {
317 }
318
320
322}
static enum CommandResult parse_color_name(const char *s, uint32_t *col, int *attrs, bool is_fg, struct Buffer *err)
Parse a colour name.
CommandResult
Error codes for command_t parse functions.
int color_debug(enum LogLevel level, const char *format,...)
Write to the log file.
@ LL_DEBUG5
Log at debug level 5.