NeoMutt  2024-02-01-23-g345d7b
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
commands.c
Go to the documentation of this file.
1
30#include "config.h"
31#include <stdint.h>
32#include "private.h"
33#include "mutt/lib.h"
34#include "core/lib.h"
35#include "parse/lib.h"
36#include "muttlib.h"
37
41enum CommandResult sb_parse_sidebar_pin(struct Buffer *buf, struct Buffer *s,
42 intptr_t data, struct Buffer *err)
43{
44 struct Buffer *path = buf_pool_get();
45
46 do
47 {
49 buf_expand_path(path);
51 } while (MoreArgs(s));
52 buf_pool_release(&path);
53
54 return MUTT_CMD_SUCCESS;
55}
56
61 intptr_t data, struct Buffer *err)
62{
63 struct Buffer *path = buf_pool_get();
64
65 do
66 {
68 /* Check for deletion of entire list */
69 if (mutt_str_equal(buf_string(path), "*"))
70 {
72 break;
73 }
74 buf_expand_path(path);
76 } while (MoreArgs(s));
77 buf_pool_release(&path);
78
79 return MUTT_CMD_SUCCESS;
80}
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:97
CommandResult
Error codes for command_t parse functions.
Definition: command.h:36
@ MUTT_CMD_SUCCESS
Success: Command worked.
Definition: command.h:39
Convenience wrapper for the core headers.
int parse_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags)
Extract one token from a string.
Definition: extract.c:50
#define TOKEN_BACKTICK_VARS
Expand variables within backticks.
Definition: extract.h:54
#define MoreArgs(buf)
Definition: extract.h:32
enum CommandResult sb_parse_sidebar_pin(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'sidebar_pin' command - Implements Command::parse() -.
Definition: commands.c:41
enum CommandResult sb_parse_sidebar_unpin(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'sidebar_unpin' command - Implements Command::parse() -.
Definition: commands.c:60
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:709
void remove_from_stailq(struct ListHead *head, const char *str)
Remove an item, matching a string, from a List.
Definition: muttlib.c:1715
void add_to_stailq(struct ListHead *head, const char *str)
Add a string to a list.
Definition: muttlib.c:1690
void buf_expand_path(struct Buffer *buf)
Create the canonical path.
Definition: muttlib.c:331
Some miscellaneous functions.
Text parsing functions.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition: pool.c:81
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition: pool.c:94
GUI display the mailboxes in a side panel.
struct ListHead SidebarPinned
List of mailboxes to always display in the sidebar.
Definition: sidebar.c:43
String manipulation buffer.
Definition: buffer.h:36
char * data
Pointer to data.
Definition: buffer.h:37