47 lines
1.5 KiB
C
47 lines
1.5 KiB
C
/*
|
|
* this is free software: you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published
|
|
* by the Free Software Foundation, either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* this 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/>.";
|
|
*
|
|
* (c) Alexander Vdolainen 2007, 2026 <alex@vapaa.xyz>
|
|
* subrelay: a minimalistic maillist server based on external IMAPs/SMTPs
|
|
*
|
|
* subscribers.h: mail list subscribers pool
|
|
*
|
|
*/
|
|
#ifndef __SUBSCRIBERS_H__
|
|
#define __SUBSCRIBERS_H__
|
|
|
|
#include <ilib/splay.h>
|
|
|
|
typedef struct subscriber_entry {
|
|
splay_node_t node;
|
|
char *email;
|
|
} subscriber_entry_t;
|
|
|
|
typedef struct subscriber_pool {
|
|
splay_t tree;
|
|
char *filepath;
|
|
} subscriber_pool_t;
|
|
|
|
int subscriber_pool_init(subscriber_pool_t *pool, const char *filepath);
|
|
void subscriber_pool_destroy(subscriber_pool_t *pool);
|
|
|
|
int subscriber_add(subscriber_pool_t *pool, const char *email);
|
|
int subscriber_remove(subscriber_pool_t *pool, const char *email);
|
|
int subscriber_exists(subscriber_pool_t *pool, const char *email);
|
|
|
|
int subscriber_load_file(subscriber_pool_t *pool);
|
|
int subscriber_save_file(subscriber_pool_t *pool);
|
|
|
|
#endif /* __SUBSCRIBERS_H__ */
|