NeoMutt  2021-10-29-220-g2b1eec
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 "lib.h"
36 #include "init.h"
37 #include "muttlib.h"
38 
42 enum CommandResult sb_parse_whitelist(struct Buffer *buf, struct Buffer *s,
43  intptr_t data, struct Buffer *err)
44 {
45  struct Buffer *path = mutt_buffer_pool_get();
46 
47  do
48  {
52  } while (MoreArgs(s));
54 
55  return MUTT_CMD_SUCCESS;
56 }
57 
61 enum CommandResult sb_parse_unwhitelist(struct Buffer *buf, struct Buffer *s,
62  intptr_t data, struct Buffer *err)
63 {
64  struct Buffer *path = mutt_buffer_pool_get();
65 
66  do
67  {
69  /* Check for deletion of entire list */
70  if (mutt_str_equal(mutt_buffer_string(path), "*"))
71  {
73  break;
74  }
77  } while (MoreArgs(s));
79 
80  return MUTT_CMD_SUCCESS;
81 }
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:42
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:61
int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags)
Extract one token from a string.
Definition: init.c:399
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:715
Many unsorted constants and some structs.
#define MUTT_TOKEN_BACKTICK_VARS
Expand variables within backticks.
Definition: mutt.h:74
void remove_from_stailq(struct ListHead *head, const char *str)
Remove an item, matching a string, from a List.
Definition: muttlib.c:1753
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:1728
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
Key value store.
String manipulation buffer.
Definition: buffer.h:34
char * data
Pointer to data.
Definition: buffer.h:35