NeoMutt  2021-02-05-89-gabe350
Teaching an old dog new tricks
DOXYGEN
group.h
Go to the documentation of this file.
1 
25 #ifndef MUTT_GROUP_H
26 #define MUTT_GROUP_H
27 
28 #include <stdbool.h>
29 #include <stdint.h>
30 #include "mutt/lib.h"
31 #include "address.h"
32 
33 #define MUTT_GROUP 0
34 #define MUTT_UNGROUP 1
35 
36 
39 struct Group
40 {
41  struct AddressList al;
42  struct RegexList rs;
43  char *name;
44 };
45 
49 struct GroupNode
50 {
51  struct Group *group;
52  STAILQ_ENTRY(GroupNode) entries;
53 };
54 STAILQ_HEAD(GroupList, GroupNode);
55 
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);
65 
66 bool mutt_group_match (struct Group *g, const char *s);
67 struct Group *mutt_pattern_group(const char *pat);
68 
69 #endif /* MUTT_GROUP_H */
mutt_pattern_group
struct Group * mutt_pattern_group(const char *pat)
Match a pattern to a Group.
Definition: group.c:65
mutt_grouplist_add
void mutt_grouplist_add(struct GroupList *gl, struct Group *group)
Add a Group to a GroupList.
Definition: group.c:137
mutt_group_match
bool mutt_group_match(struct Group *g, const char *s)
Does a string match an entry in a Group?
Definition: group.c:325
mutt_grouplist_remove_addrlist
int mutt_grouplist_remove_addrlist(struct GroupList *gl, struct AddressList *a)
Remove an AddressList from a GroupList.
Definition: group.c:245
mutt_grouplist_free
void mutt_grouplist_free(void)
Free GroupList singleton resource.
Definition: group.c:55
Buffer
String manipulation buffer.
Definition: buffer.h:33
Group::name
char * name
Name of Group.
Definition: group.h:43
Group::rs
struct RegexList rs
Group Regex patterns.
Definition: group.h:42
STAILQ_HEAD
STAILQ_HEAD(GroupList, GroupNode)
mutt_grouplist_clear
void mutt_grouplist_clear(struct GroupList *gl)
Clear a GroupList.
Definition: group.c:103
Group
A set of email addresses.
Definition: group.h:39
GroupNode
An element in a GroupList.
Definition: group.h:49
mutt_grouplist_remove_regex
int mutt_grouplist_remove_regex(struct GroupList *gl, const char *s)
Remove matching addresses from a GroupList.
Definition: group.c:301
Group::al
struct AddressList al
List of Addresses.
Definition: group.h:41
mutt_grouplist_destroy
void mutt_grouplist_destroy(struct GroupList *gl)
Free a GroupList.
Definition: group.c:157
lib.h
mutt_grouplist_add_regex
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:276
GroupNode::group
struct Group * group
Address Group.
Definition: group.h:51
mutt_grouplist_add_addrlist
void mutt_grouplist_add_addrlist(struct GroupList *gl, struct AddressList *a)
Add Address list to a GroupList.
Definition: group.c:226
address.h
GroupNode::STAILQ_ENTRY
STAILQ_ENTRY(GroupNode) entries
Linked list.
mutt_grouplist_init
void mutt_grouplist_init(void)
Initialize the GroupList singleton.
Definition: group.c:45