#ifndef _MailingList_Header
#define _MailingList_Header

#include "array.h"
#include "lib.h"

typedef struct mailing_list {
	Pair *settings;
	int deleted;
	char *name;
} Mailing;

Array *mailing_lists(char *file, char *reason, int bfsz, int *nfound);
int mailing_settings(char *listname, char *file, Pair **listp, char *reason, int bfsz);

int mailing_save(Mailing *m, char *file, char *reason, int bfsz);
int mailing_save_list(Array *lists, char *file, int replace, char *reason, int bfsz, char *whence);
int mailing_save_settings(Pair *settings, char *listname, char *file, char *reason, int bfsz);

int mailing_cmp(Mailing **m1, Mailing **m2);
void mailing_free(Mailing **m);

int mailing_match_moderator(Pair *settings, char *match, int primary);

#endif
