2020-07-25 12:03:18 +00:00
|
|
|
/*
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2020-12-09 01:33:36 +00:00
|
|
|
#ifdef UIRCD_FEATURE_LIBCONFIG
|
|
|
|
#include <libconfig.h> // config_t config_setting_t config_init() ...
|
|
|
|
|
|
|
|
#endif /* UIRCD_FEATURE_LIBCONFIG */
|
2020-12-08 02:16:12 +00:00
|
|
|
#include "connection.h"
|
2020-07-25 12:03:18 +00:00
|
|
|
|
2020-12-08 02:16:12 +00:00
|
|
|
#ifndef UIRCD_GUARD_CONFIGURATION
|
|
|
|
#define UIRCD_GUARD_CONFIGURATION
|
2020-07-25 12:03:18 +00:00
|
|
|
|
2020-12-09 01:33:36 +00:00
|
|
|
#define UIRCD_DEFAULT_ADDR "localhost"
|
|
|
|
#define UIRCD_DEFAULT_PORT "6667"
|
|
|
|
#define UIRCD_DEFAULT_NICK "uirc-user"
|
|
|
|
#define UIRCD_DEFAULT_USER "uIRC-user"
|
|
|
|
#define UIRCD_DEFAULT_REAL "uIRC user"
|
2020-12-08 22:20:42 +00:00
|
|
|
#define UIRCD_DEFAULT_QUITMSG "uIRCd " UIRCD_VERSION
|
2020-12-08 02:16:12 +00:00
|
|
|
|
2020-12-09 02:29:24 +00:00
|
|
|
typedef struct {
|
|
|
|
const char* str;
|
|
|
|
char** save;
|
|
|
|
} Mapping;
|
|
|
|
|
2020-12-08 22:20:42 +00:00
|
|
|
#ifdef UIRCD_FEATURE_LIBCONFIG
|
2020-12-17 00:27:30 +00:00
|
|
|
int parse_configfile(char* config_path, Connection* conn);
|
|
|
|
void mapconf(config_setting_t* setting, Mapping* mapping, unsigned long len);
|
2020-12-08 22:20:42 +00:00
|
|
|
#endif /* UIRCD_FEATURE_LIBCONFIG */
|
|
|
|
|
2020-12-17 00:27:30 +00:00
|
|
|
int set_config_defaults(Connection* conn);
|
2020-12-08 02:16:12 +00:00
|
|
|
|
|
|
|
#endif /* UIRCD_GUARD_CONFIGURATION */
|
2020-10-02 12:38:11 +00:00
|
|
|
|