128 struct ListNode *np = NULL, *tmp = NULL;
149 struct ListNode *np = NULL, *tmp = NULL;
153 fn((
void **) &np->
data);
171 struct ListNode *np = NULL, *tmp = NULL;
248 if (!src || (*src ==
'\0'))
254 const char *start = src;
255 while ((*src !=
'\0') && (*src != sep))
size_t buf_len(const struct Buffer *buf)
Calculate the length of a Buffer.
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
General purpose object for storing and parsing strings.
void mutt_list_copy_tail(struct ListHead *dst, const struct ListHead *src)
Copy a list into another list.
struct ListNode * mutt_list_insert_tail(struct ListHead *h, char *s)
Append a string to the end of a List.
struct ListNode * mutt_list_find(const struct ListHead *h, const char *data)
Find a string in a List.
struct ListNode * mutt_list_insert_head(struct ListHead *h, char *s)
Insert a string at the beginning of a List.
size_t mutt_list_write(const struct ListHead *h, struct Buffer *buf)
Write a list to a buffer.
void mutt_list_clear(struct ListHead *h)
Free a list, but NOT its strings.
size_t mutt_list_str_split(struct ListHead *head, const char *src, char sep)
Split a string into a list using a separator char.
bool mutt_list_equal(const struct ListHead *ah, const struct ListHead *bh)
Compare two string lists.
void mutt_list_free(struct ListHead *h)
Free a List AND its strings.
void mutt_list_free_type(struct ListHead *h, list_free_t fn)
Free a List of type.
bool mutt_list_match(const char *s, struct ListHead *h)
Is the string in the list (see notes)
struct ListNode * mutt_list_insert_after(struct ListHead *h, struct ListNode *n, char *s)
Insert a string after a given ListNode.
void(* list_free_t)(void **ptr)
Memory management wrappers.
#define MUTT_MEM_CALLOC(n, type)
char * mutt_strn_dup(const char *begin, size_t len)
Duplicate a sub-string.
char * mutt_str_dup(const char *str)
Copy a string, safely.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
size_t mutt_istr_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix, ignoring case.
#define STAILQ_REMOVE(head, elm, type, field)
#define STAILQ_INIT(head)
#define STAILQ_FIRST(head)
#define STAILQ_FOREACH(var, head, field)
#define STAILQ_INSERT_TAIL(head, elm, field)
#define STAILQ_INSERT_HEAD(head, elm, field)
#define STAILQ_FOREACH_SAFE(var, head, field, tvar)
#define STAILQ_NEXT(elm, field)
#define STAILQ_INSERT_AFTER(head, tqelm, elm, field)
String manipulation functions.
String manipulation buffer.