NeoMutt  2022-04-29-178-g3b62e6
Teaching an old dog new tricks
DOXYGEN
group.h
Go to the documentation of this file.
1
25#ifndef MUTT_ADDRESS_GROUP_H
26#define MUTT_ADDRESS_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
39struct Group
40{
41 struct AddressList al;
42 struct RegexList rs;
43 char *name;
44};
45
50{
51 struct Group *group;
53};
55
56void mutt_grouplist_add (struct GroupList *gl, struct Group *group);
57void mutt_grouplist_add_addrlist (struct GroupList *gl, struct AddressList *a);
58int mutt_grouplist_add_regex (struct GroupList *gl, const char *s, uint16_t flags, struct Buffer *err);
59void mutt_grouplist_clear (struct GroupList *gl);
60void mutt_grouplist_destroy (struct GroupList *gl);
61void mutt_grouplist_free (void);
62void mutt_grouplist_init (void);
63int mutt_grouplist_remove_addrlist(struct GroupList *gl, struct AddressList *a);
64int mutt_grouplist_remove_regex (struct GroupList *gl, const char *s);
65
66bool mutt_group_match (struct Group *g, const char *s);
67struct Group *mutt_pattern_group(const char *pat);
68
69#endif /* MUTT_ADDRESS_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
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
struct Group * mutt_pattern_group(const char *pat)
Match a pattern to a Group.
Definition: group.c:112
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