NeoMutt  2022-04-29-249-gaae397
Teaching an old dog new tricks
DOXYGEN
commands.c
Go to the documentation of this file.
1
29#include "config.h"
30#include <stdint.h>
31#include "private.h"
32#include "mutt/lib.h"
33#include "core/lib.h"
34#include "mutt.h"
35#include "init.h"
36#include "muttlib.h"
37
41enum CommandResult sb_parse_whitelist(struct Buffer *buf, struct Buffer *s,
42 intptr_t data, struct Buffer *err)
43{
44 struct Buffer *path = mutt_buffer_pool_get();
45
46 do
47 {
51 } while (MoreArgs(s));
53
54 return MUTT_CMD_SUCCESS;
55}
56
60enum CommandResult sb_parse_unwhitelist(struct Buffer *buf, struct Buffer *s,
61 intptr_t data, struct Buffer *err)
62{
63 struct Buffer *path = mutt_buffer_pool_get();
64
65 do
66 {
68 /* Check for deletion of entire list */
69 if (mutt_str_equal(mutt_buffer_string(path), "*"))
70 {
72 break;
73 }
76 } while (MoreArgs(s));
78
79 return MUTT_CMD_SUCCESS;
80}
static const char * mutt_buffer_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:77
#define MoreArgs(buf)
Definition: buffer.h:40
CommandResult
Error codes for command_t parse functions.
Definition: command.h:34
@ MUTT_CMD_SUCCESS
Success: Command worked.
Definition: command.h:37
Convenience wrapper for the core headers.
enum CommandResult sb_parse_whitelist(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'sidebar_whitelist' command - Implements Command::parse() -.
Definition: commands.c:41
enum CommandResult sb_parse_unwhitelist(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'unsidebar_whitelist' command - Implements Command::parse() -.
Definition: commands.c:60
int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags)
Extract one token from a string.
Definition: init.c:273
Config/command parsing.
void mutt_list_free(struct ListHead *h)
Free a List AND its strings.
Definition: list.c:122
Convenience wrapper for the library headers.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:807
Many unsorted constants and some structs.
#define MUTT_TOKEN_BACKTICK_VARS
Expand variables within backticks.
Definition: mutt.h:75
void remove_from_stailq(struct ListHead *head, const char *str)
Remove an item, matching a string, from a List.
Definition: muttlib.c:1744
void mutt_buffer_expand_path(struct Buffer *buf)
Create the canonical path.
Definition: muttlib.c:322
void add_to_stailq(struct ListHead *head, const char *str)
Add a string to a list.
Definition: muttlib.c:1719
Some miscellaneous functions.
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
Definition: pool.c:112
struct Buffer * mutt_buffer_pool_get(void)
Get a Buffer from the pool.
Definition: pool.c:101
GUI display the mailboxes in a side panel.
struct ListHead SidebarWhitelist
List of mailboxes to always display in the sidebar.
Definition: sidebar.c:44
String manipulation buffer.
Definition: buffer.h:34
char * data
Pointer to data.
Definition: buffer.h:35