48 lines
1.6 KiB
C
48 lines
1.6 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 2026 <alex@vapaa.xyz>
|
|
* subrelay: a minimalistic maillist server based on external IMAPs/SMTPs
|
|
*
|
|
* local.h: local interface to maillist (UNIX socket)
|
|
*/
|
|
#ifndef __LOCAL_H__
|
|
#define __LOCAL_H__
|
|
|
|
#include <ilib/configuration.h>
|
|
#include <ilib/subscribers.h>
|
|
#include <ilib/pending.h>
|
|
|
|
typedef struct local_ctrl {
|
|
int server_fd;
|
|
char *socket_path;
|
|
subrelay_config_t *cfg;
|
|
subscriber_pool_t *subscribers;
|
|
pending_pool_t *pending;
|
|
} local_ctrl_t;
|
|
|
|
/* Initialize non-blocking UNIX domain socket server */
|
|
int local_ctrl_init(local_ctrl_t *server,
|
|
subrelay_config_t *cfg,
|
|
subscriber_pool_t *subscribers,
|
|
pending_pool_t *pending);
|
|
|
|
/* Non-blocking check for incoming client commands from subrelay-shell */
|
|
int local_ctrl_poll(local_ctrl_t *server);
|
|
|
|
/* Cleanup socket file and close descriptors */
|
|
void local_ctrl_destroy(local_ctrl_t *server);
|
|
|
|
#endif /* __LOCAL_H__ */
|