NeoMutt  2021-02-05-89-gabe350
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 "mutt.h"
34 #include "lib.h"
35 #include "init.h"
36 #include "mutt_commands.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 }
sb_parse_whitelist
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
MUTT_TOKEN_BACKTICK_VARS
#define MUTT_TOKEN_BACKTICK_VARS
Expand variables within backticks.
Definition: mutt.h:78
MoreArgs
#define MoreArgs(buf)
Definition: buffer.h:40
Buffer
String manipulation buffer.
Definition: buffer.h:33
private.h
mutt_buffer_pool_release
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
Definition: pool.c:112
mutt_str_equal
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:871
mutt_extract_token
int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags)
Extract one token from a string.
Definition: init.c:393
mutt_buffer_pool_get
struct Buffer * mutt_buffer_pool_get(void)
Get a Buffer from the pool.
Definition: pool.c:101
init.h
lib.h
muttlib.h
add_to_stailq
void add_to_stailq(struct ListHead *head, const char *str)
Add a string to a list.
Definition: muttlib.c:1704
MUTT_CMD_SUCCESS
@ MUTT_CMD_SUCCESS
Success: Command worked.
Definition: mutt_commands.h:38
SidebarWhitelist
struct ListHead SidebarWhitelist
List of mailboxes to always display in the sidebar.
Definition: sidebar.c:42
mutt_buffer_expand_path
void mutt_buffer_expand_path(struct Buffer *buf)
Create the canonical path.
Definition: muttlib.c:323
mutt_buffer_string
static const char * mutt_buffer_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:77
CommandResult
CommandResult
Error codes for command_t parse functions.
Definition: mutt_commands.h:34
sb_parse_unwhitelist
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
mutt.h
remove_from_stailq
void remove_from_stailq(struct ListHead *head, const char *str)
Remove an item, matching a string, from a List.
Definition: muttlib.c:1729
mutt_commands.h
Buffer::data
char * data
Pointer to data.
Definition: buffer.h:35
mutt_list_free
void mutt_list_free(struct ListHead *h)
Free a List AND its strings.
Definition: list.c:122