/* * This file is part of blabouncer (https://www.blatech.co.uk/l_bratch/blabouncer). * Copyright (C) 2019 Luke Bratch . * * Blabouncer 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, version 3. * * Blabouncer 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 blabouncer. If not, see . */ #ifndef CONFIG_H_INCLUDED #define CONFIG_H_INCLUDED #include #include #include #include #include #include #include "functions.h" #define DEBUG_CRIT 0 #define DEBUG_SOME 1 #define DEBUG_FULL 2 #define ECONFINT 1 // errno value if getconfint() failed #define MAXCHAR 1000 // Sets 'dest' to the value of the configuration option with name // 'confname' from configuration file 'filename'. // Returns 1 for success or 0 for error/failure as per what // getconfstr() returns. int getconfstr(char *confname, char *filename, char* dest); // Returns the value of the configuration option with name // 'confname' from configuration file 'filename'. // Sets errno to 0 on success, or ECONFINT if it fails, in which case the return value is undefined. int getconfint(char *confname, char *filename); // Create the default configuration file. // Return 1 on success, 0 on failure. int createconfigfile(char *filename); #endif