Handling for email address groups. More...
#include "config.h"#include <stdbool.h>#include <stdlib.h>#include "group.h"#include "address.h"
Include dependency graph for group.c: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 *name) |
| 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 -. | |
| static void | group_remove (struct HashTable *groups, struct Group *g) |
| Remove a Group from the Hash Table. | |
| static bool | group_is_empty (struct Group *g) |
| Is a Group empty? | |
| 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 *str, uint16_t flags, struct Buffer *err) |
| Add a Regex to a Group. | |
| static int | group_remove_regex (struct Group *g, const char *str) |
| Remove a Regex from a Group. | |
| bool | group_match (struct Group *g, const char *str) |
| Does a string match an entry in a Group? | |
| void | grouplist_add_group (struct GroupList *gl, struct Group *g) |
| Add a Group to a GroupList. | |
| void | grouplist_destroy (struct GroupList *gl) |
| Free a GroupList. | |
| void | grouplist_add_addrlist (struct GroupList *gl, struct AddressList *al) |
| Add Address list to a GroupList. | |
| int | grouplist_add_regex (struct GroupList *gl, const char *str, uint16_t flags, struct Buffer *err) |
| Add matching Addresses to a GroupList. | |
| struct HashTable * | groups_new (void) |
| Create a HashTable for the Address Groups. | |
| void | groups_free (struct HashTable **pptr) |
| Free Address Groups HashTable. | |
| struct Group * | groups_get_group (struct HashTable *groups, const char *name) |
| Get a Group by its name. | |
| void | groups_remove_grouplist (struct HashTable *groups, struct GroupList *gl) |
| Clear a GroupList. | |
| int | groups_remove_addrlist (struct HashTable *groups, struct GroupList *gl, struct AddressList *al) |
| Remove an AddressList from a GroupList. | |
| int | groups_remove_regex (struct HashTable *groups, struct GroupList *gl, const char *str) |
| Remove matching addresses from a GroupList. | |
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 42 of file group.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Remove a Group from the Hash Table.
Definition at line 88 of file group.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
|
static |
Add an Address List to a Group.
Definition at line 112 of file group.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
| g | Group to add to |
| str | Regex string to add |
| flags | Flags, e.g. REG_ICASE |
| err | Buffer for error message |
| 0 | Success |
| -1 | Error |
Definition at line 138 of file group.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
| 0 | Success |
| -1 | Error |
Definition at line 150 of file group.c.
Here is the call graph for this function:
Here is the caller graph for this function:| bool group_match | ( | struct Group * | g, |
| const char * | str ) |
Does a string match an entry in a Group?
| g | Group to match against |
| str | String to match |
| true | There's a match |
Definition at line 161 of file group.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void grouplist_add_group | ( | struct GroupList * | gl, |
| struct Group * | g ) |
Add a Group to a GroupList.
| gl | GroupList to add to |
| g | Group to add |
Definition at line 183 of file group.c.
Here is the caller graph for this function:| void grouplist_destroy | ( | struct GroupList * | gl | ) |
Free a GroupList.
| gl | GroupList to free |
Definition at line 203 of file group.c.
Here is the caller graph for this function:| void 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 224 of file group.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int grouplist_add_regex | ( | struct GroupList * | gl, |
| const char * | str, | ||
| uint16_t | flags, | ||
| struct Buffer * | err ) |
Add matching Addresses to a GroupList.
| gl | GroupList to add to |
| str | Address regex string to match |
| flags | Flags, e.g. REG_ICASE |
| err | Buffer for error message |
| 0 | Success |
| -1 | Error |
Definition at line 245 of file group.c.
Here is the call graph for this function:
Here is the caller graph for this function:| struct HashTable * groups_new | ( | void | ) |
Create a HashTable for the Address Groups.
| ptr | New Groups HashTable |
Definition at line 267 of file group.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void groups_free | ( | struct HashTable ** | pptr | ) |
Get a Group by its name.
| groups | Groups HashTable |
| name | Name to find |
Definition at line 291 of file group.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void groups_remove_grouplist | ( | struct HashTable * | groups, |
| struct GroupList * | gl ) |
Clear a GroupList.
| groups | Groups HashTable |
| gl | GroupList to clear |
Definition at line 312 of file group.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int groups_remove_addrlist | ( | struct HashTable * | groups, |
| struct GroupList * | gl, | ||
| struct AddressList * | al ) |
Remove an AddressList from a GroupList.
| groups | Groups HashTable |
| gl | GroupList to remove from |
| al | AddressList to remove |
| 0 | Success |
| -1 | Error |
Definition at line 337 of file group.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int groups_remove_regex | ( | struct HashTable * | groups, |
| struct GroupList * | gl, | ||
| const char * | str ) |
Remove matching addresses from a GroupList.
| 0 | Success |
| -1 | Error |
Definition at line 368 of file group.c.
Here is the call graph for this function:
Here is the caller graph for this function: