Handling for email address groups. More...
#include "config.h"
#include <stdbool.h>
#include <stdlib.h>
#include "group.h"
#include "address.h"
Go to the source code of this file.
Functions | |
static void | group_free (struct Group **ptr) |
Free an Address Group. | |
static struct Group * | group_new (const char *pat) |
Create a new Address Group. | |
static void | group_hash_free (int type, void *obj, intptr_t data) |
Free our hash table data - Implements hash_hdata_free_t -. | |
void | mutt_grouplist_init (void) |
Initialize the GroupList singleton. | |
void | mutt_grouplist_cleanup (void) |
Free GroupList singleton resource. | |
struct Group * | mutt_pattern_group (const char *pat) |
Match a pattern to a Group. | |
static void | group_remove (struct Group *g) |
Remove a Group from the Hash Table. | |
void | mutt_grouplist_clear (struct GroupList *gl) |
Clear a GroupList. | |
static bool | empty_group (struct Group *g) |
Is a Group empty? | |
void | mutt_grouplist_add (struct GroupList *gl, struct Group *group) |
Add a Group to a GroupList. | |
void | mutt_grouplist_destroy (struct GroupList *gl) |
Free a GroupList. | |
static void | group_add_addrlist (struct Group *g, const struct AddressList *al) |
Add an Address List to a Group. | |
static int | group_add_regex (struct Group *g, const char *s, uint16_t flags, struct Buffer *err) |
Add a Regex to a Group. | |
static int | group_remove_regex (struct Group *g, const char *s) |
Remove a Regex from a Group. | |
void | mutt_grouplist_add_addrlist (struct GroupList *gl, struct AddressList *al) |
Add Address list to a GroupList. | |
int | mutt_grouplist_remove_addrlist (struct GroupList *gl, struct AddressList *al) |
Remove an AddressList from a GroupList. | |
int | mutt_grouplist_add_regex (struct GroupList *gl, const char *s, uint16_t flags, struct Buffer *err) |
Add matching Addresses to a GroupList. | |
int | mutt_grouplist_remove_regex (struct GroupList *gl, const char *s) |
Remove matching addresses from a GroupList. | |
bool | mutt_group_match (struct Group *g, const char *s) |
Does a string match an entry in a Group? | |
Variables | |
static struct HashTable * | Groups = NULL |
Hash Table: "group-name" -> Group. | |
Handling for email address groups.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file group.c.
|
static |
ptr | Group to free |
Definition at line 49 of file group.c.
|
static |
void mutt_grouplist_init | ( | void | ) |
Initialize the GroupList singleton.
This is called once from init.c when initializing the global structures.
Definition at line 95 of file group.c.
void mutt_grouplist_cleanup | ( | void | ) |
struct Group * mutt_pattern_group | ( | const char * | pat | ) |
Match a pattern to a Group.
pat | Pattern to match |
Definition at line 117 of file group.c.
|
static |
Remove a Group from the Hash Table.
g | Group to remove |
Definition at line 137 of file group.c.
void mutt_grouplist_clear | ( | struct GroupList * | gl | ) |
Clear a GroupList.
gl | GroupList to clear |
Definition at line 148 of file group.c.
|
static |
void mutt_grouplist_add | ( | struct GroupList * | gl, |
struct Group * | group | ||
) |
Add a Group to a GroupList.
gl | GroupList to add to |
group | Group to add |
Definition at line 182 of file group.c.
void mutt_grouplist_destroy | ( | struct GroupList * | gl | ) |
Free a GroupList.
gl | GroupList to free |
Definition at line 202 of file group.c.
|
static |
Add an Address List to a Group.
Definition at line 223 of file group.c.
|
static |
g | Group to add to |
s | Regex string to add |
flags | Flags, e.g. REG_ICASE |
err | Buffer for error message |
0 | Success |
-1 | Error |
Definition at line 249 of file group.c.
|
static |
0 | Success |
-1 | Error |
Definition at line 261 of file group.c.
void mutt_grouplist_add_addrlist | ( | struct GroupList * | gl, |
struct AddressList * | al | ||
) |
Add Address list to a GroupList.
gl | GroupList to add to |
al | Address list to add |
Definition at line 271 of file group.c.
int mutt_grouplist_remove_addrlist | ( | struct GroupList * | gl, |
struct AddressList * | al | ||
) |
Remove an AddressList from a GroupList.
gl | GroupList to remove from |
al | AddressList to remove |
0 | Success |
-1 | Error |
Definition at line 290 of file group.c.
int mutt_grouplist_add_regex | ( | struct GroupList * | gl, |
const char * | s, | ||
uint16_t | flags, | ||
struct Buffer * | err | ||
) |
Add matching Addresses to a GroupList.
gl | GroupList to add to |
s | Address to match |
flags | Flags, e.g. REG_ICASE |
err | Buffer for error message |
0 | Success |
-1 | Error |
Definition at line 321 of file group.c.
int mutt_grouplist_remove_regex | ( | struct GroupList * | gl, |
const char * | s | ||
) |
Remove matching addresses from a GroupList.
gl | GroupList to remove from |
s | Address to match |
0 | Success |
-1 | Error |
Definition at line 346 of file group.c.
bool mutt_group_match | ( | struct Group * | g, |
const char * | s | ||
) |
Does a string match an entry in a Group?
g | Group to match against |
s | String to match |
true | There's a match |
Definition at line 370 of file group.c.