NeoMutt  2021-10-29-220-g2b1eec
Teaching an old dog new tricks
Go to the documentation of this file.
25 #ifndef MUTT_GROUP_H
26 #define MUTT_GROUP_H
28 #include <stdbool.h>
29 #include <stdint.h>
30 #include "mutt/lib.h"
31 #include "address.h"
33 #define MUTT_GROUP 0
34 #define MUTT_UNGROUP 1
39 struct Group
40 {
41  struct AddressList al;
42  struct RegexList rs;
43  char *name;
44 };
49 struct GroupNode
50 {
51  struct Group *group;
53 };
54 STAILQ_HEAD(GroupList, GroupNode);
56 void mutt_grouplist_add (struct GroupList *gl, struct Group *group);
57 void mutt_grouplist_add_addrlist (struct GroupList *gl, struct AddressList *a);
58 int mutt_grouplist_add_regex (struct GroupList *gl, const char *s, uint16_t flags, struct Buffer *err);
59 void mutt_grouplist_clear (struct GroupList *gl);
60 void mutt_grouplist_destroy (struct GroupList *gl);
61 void mutt_grouplist_free (void);
62 void mutt_grouplist_init (void);
63 int mutt_grouplist_remove_addrlist(struct GroupList *gl, struct AddressList *a);
64 int mutt_grouplist_remove_regex (struct GroupList *gl, const char *s);
66 bool mutt_group_match (struct Group *g, const char *s);
67 struct Group *mutt_pattern_group(const char *pat);
69 #endif /* MUTT_GROUP_H */
Type representing an email address.
void mutt_grouplist_add(struct GroupList *gl, struct Group *group)
Add a Group to a GroupList.
Definition: group.c:181
struct Group * mutt_pattern_group(const char *pat)
Match a pattern to a Group.
Definition: group.c:112
void mutt_grouplist_free(void)
Free GroupList singleton resource.
Definition: group.c:102
STAILQ_HEAD(GroupList, GroupNode)
bool mutt_group_match(struct Group *g, const char *s)
Does a string match an entry in a Group?
Definition: group.c:369
int mutt_grouplist_add_regex(struct GroupList *gl, const char *s, uint16_t flags, struct Buffer *err)
Add matching Addresses to a GroupList.
Definition: group.c:320
int mutt_grouplist_remove_addrlist(struct GroupList *gl, struct AddressList *a)
Remove an AddressList from a GroupList.
Definition: group.c:289
void mutt_grouplist_add_addrlist(struct GroupList *gl, struct AddressList *a)
Add Address list to a GroupList.
Definition: group.c:270
int mutt_grouplist_remove_regex(struct GroupList *gl, const char *s)
Remove matching addresses from a GroupList.
Definition: group.c:345
void mutt_grouplist_init(void)
Initialize the GroupList singleton.
Definition: group.c:90
void mutt_grouplist_destroy(struct GroupList *gl)
Free a GroupList.
Definition: group.c:201
void mutt_grouplist_clear(struct GroupList *gl)
Clear a GroupList.
Definition: group.c:147
Convenience wrapper for the library headers.
String manipulation buffer.
Definition: buffer.h:34
An element in a GroupList.
Definition: group.h:50
STAILQ_ENTRY(GroupNode) entries
Linked list.
struct Group * group
Address Group.
Definition: group.h:51
A set of email addresses.
Definition: group.h:40
char * name
Name of Group.
Definition: group.h:43
struct AddressList al
List of Addresses.
Definition: group.h:41
struct RegexList rs
Group Regex patterns.
Definition: group.h:42