NeoMutt  2020-08-07-1-gab41a1
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 "mutt/lib.h"
30 #include "address.h"
32 #define MUTT_GROUP 0
33 #define MUTT_UNGROUP 1
38 struct Group
39 {
40  struct AddressList al;
41  struct RegexList rs;
42  char *name;
43 };
48 struct GroupNode
49 {
50  struct Group *group;
51  STAILQ_ENTRY(GroupNode) entries;
52 };
53 STAILQ_HEAD(GroupList, GroupNode);
55 void mutt_grouplist_add (struct GroupList *gl, struct Group *group);
56 void mutt_grouplist_add_addrlist (struct GroupList *gl, struct AddressList *a);
57 int mutt_grouplist_add_regex (struct GroupList *gl, const char *s, int flags, struct Buffer *err);
58 void mutt_grouplist_clear (struct GroupList *gl);
59 void mutt_grouplist_destroy (struct GroupList *gl);
60 void mutt_grouplist_free (void);
61 void mutt_grouplist_init (void);
62 int mutt_grouplist_remove_addrlist(struct GroupList *gl, struct AddressList *a);
63 int mutt_grouplist_remove_regex (struct GroupList *gl, const char *s);
65 bool mutt_group_match (struct Group *g, const char *s);
66 struct Group *mutt_pattern_group(const char *pat);
68 #endif /* MUTT_GROUP_H */
struct Group * group
Address Group.
Definition: group.h:50
Representation of an email address.
String manipulation buffer.
Definition: buffer.h:33
#define STAILQ_ENTRY(type)
Definition: queue.h:324
void mutt_grouplist_add(struct GroupList *gl, struct Group *group)
Add a Group to a GroupList.
Definition: group.c:137
bool mutt_group_match(struct Group *g, const char *s)
Does a string match an entry in a Group?
Definition: group.c:324
int mutt_grouplist_add_regex(struct GroupList *gl, const char *s, int flags, struct Buffer *err)
Add matching Addresses to a GroupList.
Definition: group.c:276
struct Group * mutt_pattern_group(const char *pat)
Match a pattern to a Group.
Definition: group.c:65
char * name
Name of Group.
Definition: group.h:42
void mutt_grouplist_clear(struct GroupList *gl)
Clear a GroupList.
Definition: group.c:103
int mutt_grouplist_remove_regex(struct GroupList *gl, const char *s)
Remove matching addresses from a GroupList.
Definition: group.c:300
void mutt_grouplist_add_addrlist(struct GroupList *gl, struct AddressList *a)
Add Address list to a GroupList.
Definition: group.c:226
An element in a GroupList.
Definition: group.h:48
void mutt_grouplist_init(void)
Initialize the GroupList singleton.
Definition: group.c:45
struct RegexList rs
Group Regex patterns.
Definition: group.h:41
struct AddressList al
List of Addresses.
Definition: group.h:40
void mutt_grouplist_free(void)
Free GroupList singleton resource.
Definition: group.c:55
void mutt_grouplist_destroy(struct GroupList *gl)
Free a GroupList.
Definition: group.c:157
A set of email addresses.
Definition: group.h:38
Convenience wrapper for the library headers.
int mutt_grouplist_remove_addrlist(struct GroupList *gl, struct AddressList *a)
Remove an AddressList from a GroupList.
Definition: group.c:245
STAILQ_HEAD(GroupList, GroupNode)