NeoMutt  2024-04-25-89-g194907
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
slist.h
Go to the documentation of this file.
1
23#ifndef MUTT_MUTT_SLIST_H
24#define MUTT_MUTT_SLIST_H
25
26#include <stdbool.h>
27#include <stddef.h>
28#include <stdint.h>
29#include "list.h"
30
31struct Buffer;
32
36struct Slist
37{
38 struct ListHead head;
39 size_t count;
40 uint32_t flags;
41};
42
43struct Slist *slist_add_string (struct Slist *list, const char *str);
44struct Slist *slist_dup (const struct Slist *list);
45bool slist_equal (const struct Slist *a, const struct Slist *b);
46void slist_free (struct Slist **ptr);
47bool slist_is_empty (const struct Slist *list);
48bool slist_is_member (const struct Slist *list, const char *str);
49struct Slist *slist_new (uint32_t flags);
50struct Slist *slist_parse (const char *str, uint32_t flags);
51struct Slist *slist_remove_string(struct Slist *list, const char *str);
52int slist_to_buffer (const struct Slist *list, struct Buffer *buf);
53
54#endif /* MUTT_MUTT_SLIST_H */
Singly-linked list type.
struct Slist * slist_remove_string(struct Slist *list, const char *str)
Remove a string from a list.
Definition: slist.c:233
struct Slist * slist_parse(const char *str, uint32_t flags)
Parse a list of strings into a list.
Definition: slist.c:175
bool slist_is_empty(const struct Slist *list)
Is the slist empty?
Definition: slist.c:138
void slist_free(struct Slist **ptr)
Free an Slist object.
Definition: slist.c:122
bool slist_equal(const struct Slist *a, const struct Slist *b)
Compare two string lists.
Definition: slist.c:89
struct Slist * slist_add_string(struct Slist *list, const char *str)
Add a string to a list.
Definition: slist.c:66
bool slist_is_member(const struct Slist *list, const char *str)
Is a string a member of a list?
Definition: slist.c:152
struct Slist * slist_dup(const struct Slist *list)
Create a copy of an Slist object.
Definition: slist.c:106
int slist_to_buffer(const struct Slist *list, struct Buffer *buf)
Export an Slist to a Buffer.
Definition: slist.c:267
struct Slist * slist_new(uint32_t flags)
Create a new string list.
Definition: slist.c:51
String manipulation buffer.
Definition: buffer.h:36
String list.
Definition: slist.h:37
struct ListHead head
List containing values.
Definition: slist.h:38
size_t count
Number of values in list.
Definition: slist.h:39
uint32_t flags
Flags controlling list, e.g. D_SLIST_SEP_SPACE.
Definition: slist.h:40