NeoMutt  2024-11-14-34-g5aaf0d
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
common.c
Go to the documentation of this file.
1
29#include "config.h"
30#include <stdbool.h>
31#include "mutt/lib.h"
32#include "lib.h"
33
34void add_flag(struct Buffer *buf, bool is_set, const char *name)
35{
36 if (!buf || !name)
37 return;
38
39 if (is_set)
40 {
41 if (!buf_is_empty(buf))
42 buf_addch(buf, ',');
43 buf_addstr(buf, name);
44 }
45}
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
Definition: buffer.c:291
size_t buf_addch(struct Buffer *buf, char c)
Add a single character to a Buffer.
Definition: buffer.c:241
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
Definition: buffer.c:226
void add_flag(struct Buffer *buf, bool is_set, const char *name)
Definition: common.c:34
Convenience wrapper for the library headers.
Key value store.
String manipulation buffer.
Definition: buffer.h:36