subscribers pool -- added a header;
This commit is contained in:
parent
4ebd9abd8c
commit
891010dd13
@ -1,4 +1,23 @@
|
|||||||
/* subscribers.h - Subscriber pool & persistence management */
|
/*
|
||||||
|
* 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__
|
#ifndef __SUBSCRIBERS_H__
|
||||||
#define __SUBSCRIBERS_H__
|
#define __SUBSCRIBERS_H__
|
||||||
|
|
||||||
@ -9,7 +28,6 @@ typedef struct subscriber_entry {
|
|||||||
char *email;
|
char *email;
|
||||||
} subscriber_entry_t;
|
} subscriber_entry_t;
|
||||||
|
|
||||||
/* Global state wrapper */
|
|
||||||
typedef struct subscriber_pool {
|
typedef struct subscriber_pool {
|
||||||
splay_t tree;
|
splay_t tree;
|
||||||
char *filepath;
|
char *filepath;
|
||||||
|
|||||||
@ -1,4 +1,25 @@
|
|||||||
/* subscribers.c - Subscriber pool implementation */
|
/*
|
||||||
|
* 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.c: mail list subscribers pool
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -127,7 +148,7 @@ int subscriber_save_file(subscriber_pool_t *pool)
|
|||||||
if (!fp) return -errno;
|
if (!fp) return -errno;
|
||||||
|
|
||||||
/* Write plain-text header */
|
/* Write plain-text header */
|
||||||
fprintf(fp, "# Subrelay Subscribers List\n");
|
fprintf(fp, "# Subrelay mail list subscribers\n");
|
||||||
fprintf(fp, "# Do not edit manually while subrelayd is running\n\n");
|
fprintf(fp, "# Do not edit manually while subrelayd is running\n\n");
|
||||||
|
|
||||||
/* In-order traversal across splay tree nodes */
|
/* In-order traversal across splay tree nodes */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user