/* This file is part of gacopyz.
Copyright (C) 2007-2024 Sergey Poznyakoff
This program 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 3, or (at your option)
any later version.
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/>. */
#include <gacopyz_priv.h>
typedef struct gacopyz_macro_def *gacopyz_macro_def_t;
struct gacopyz_macro_def {
char *name;
char *value;
};
#define _SRV_CONNECTED 0x0100
#define _SRV_READY 0x0200
#define _SRV_CLRDIS 0x0400
#define _SRV_SYS_MASK 0xff00
struct gacopyz_srv {
char *id; /* Server identifier (not used yet) */
char *portspec; /* Port spec */
struct gacopyz_iod iod;
int flags;
gacopyz_macro_def_t def;
size_t ndefs;
size_t maxdefs;
struct sockaddr *source_addr;
socklen_t source_addr_len;
int onerror;
void (*memerror)(gacopyz_srv_t