44 lines
1.4 KiB
C
44 lines
1.4 KiB
C
|
/*
|
||
|
* This file is part of uIRCd. (https://git.redxen.eu/caskd/uIRCd)
|
||
|
* Copyright (c) 2019, 2020 Alex-David Denes
|
||
|
*
|
||
|
* uIRCd 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 of the License, or
|
||
|
* any later version.
|
||
|
*
|
||
|
* uIRCd 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 uIRCd. If not, see <https://www.gnu.org/licenses/>.
|
||
|
*/
|
||
|
|
||
|
#include "logging.h" // LOG()
|
||
|
#include "memory.h" // allocate_copy()
|
||
|
|
||
|
#include <errno.h> // errno
|
||
|
#include <stdbool.h> // bool
|
||
|
#include <stdio.h> // snprintf()
|
||
|
#include <string.h> // strerror()
|
||
|
#include <sys/socket.h> // sockaddr connect()
|
||
|
#include <sys/types.h> // size_t ssize_t socklen_t
|
||
|
|
||
|
#ifndef UIRCD_GUARD_CHANNELS
|
||
|
#define UIRCD_GUARD_CHANNELS
|
||
|
|
||
|
typedef struct {
|
||
|
char *name, *key;
|
||
|
bool joined;
|
||
|
} Channel;
|
||
|
|
||
|
int init_chanarray(Channel** chans);
|
||
|
signed int resize_chanarray(Channel** chans);
|
||
|
int set_channel(Channel* chans, const char* name, const char* key, bool joined);
|
||
|
unsigned int get_channelindex(const char* name, Channel* chans);
|
||
|
|
||
|
#endif /* UIRCD_GUARD_CHANNELS */
|
||
|
|