1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
17 #ifndef __INSPIRCD_IO_H__
18 #define __INSPIRCD_IO_H__
26 // flags for use with log()
37 std::vector<std::string> include_stack;
38 int fgets_safe(char* buffer, size_t maxsize, FILE* &file);
39 std::string ConfProcess(char* buffer, long linenumber, std::stringstream* errorstream, bool &error, std::string filename);
42 char ServerName[MAXBUF];
44 char ServerDesc[MAXBUF];
45 char AdminName[MAXBUF];
46 char AdminEmail[MAXBUF];
47 char AdminNick[MAXBUF];
49 char restartpass[MAXBUF];
52 char PrefixQuit[MAXBUF];
53 char DieValue[MAXBUF];
54 char DNSServer[MAXBUF];
55 char DisabledCommands[MAXBUF];
57 char MyExecutable[1024];
63 int NetBufferSize; // NetBufferSize used as the buffer size for all read() ops
64 int MaxConn; // size of accept() backlog (128 by default on *BSD)
65 unsigned int SoftLimit;
70 char addrs[MAXBUF][255];
74 std::stringstream config_f;
76 std::vector<std::string> module_names;
80 void Read(bool bail, userrec* user);
81 bool LoadConf(const char* filename, std::stringstream *target, std::stringstream* errorstream);
82 int ConfValue(char* tag, char* var, int index, char *result, std::stringstream *config);
83 int ReadConf(std::stringstream *config_f,const char* tag, const char* var, int index, char *result);
84 int ConfValueEnum(char* tag,std::stringstream *config);
85 int EnumConf(std::stringstream *config_f,const char* tag);
86 int EnumValues(std::stringstream *config, const char* tag, int index);
92 int DaemonSeed (void);
93 bool FileExists (const char* file);
94 int OpenTCPSocket (void);
95 int BindSocket (int sockfd, struct sockaddr_in client, struct sockaddr_in server, int port, char* addr);
97 /*bool LoadConf(const char* filename, std::stringstream *target, std::stringstream* errorstream);
98 int ConfValue(char* tag, char* var, int index, char *result, std::stringstream *config);
99 int ReadConf(std::stringstream *config_f,const char* tag, const char* var, int index, char *result);
100 int ConfValueEnum(char* tag,std::stringstream *config);
101 int EnumConf(std::stringstream *config_f,const char* tag);
102 int EnumValues(std::stringstream *config, const char* tag, int index);*/
104 void WritePID(std::string filename);