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__
24 // flags for use with log()
35 char ServerName[MAXBUF];
37 char ServerDesc[MAXBUF];
38 char AdminName[MAXBUF];
39 char AdminEmail[MAXBUF];
40 char AdminNick[MAXBUF];
42 char restartpass[MAXBUF];
45 char PrefixQuit[MAXBUF];
46 char DieValue[MAXBUF];
47 char DNSServer[MAXBUF];
48 char DisabledCommands[MAXBUF];
50 char MyExecutable[1024];
56 int NetBufferSize; // NetBufferSize used as the buffer size for all read() ops
57 int MaxConn; // size of accept() backlog (128 by default on *BSD)
58 unsigned int SoftLimit;
63 char addrs[MAXBUF][255];
67 std::stringstream config_f;
86 *DisabledCommands = '\0';
93 NetBufferSize = 10240;
94 SoftLimit = MAXCLIENTS;
106 int DaemonSeed (void);
107 bool FileExists (const char* file);
108 int OpenTCPSocket (void);
109 int BindSocket (int sockfd, struct sockaddr_in client, struct sockaddr_in server, int port, char* addr);
111 bool LoadConf(const char* filename, std::stringstream *target, std::stringstream* errorstream);
112 int ConfValue(char* tag, char* var, int index, char *result, std::stringstream *config);
113 int ReadConf(std::stringstream *config_f,const char* tag, const char* var, int index, char *result);
114 int ConfValueEnum(char* tag,std::stringstream *config);
115 int EnumConf(std::stringstream *config_f,const char* tag);
116 int EnumValues(std::stringstream *config, const char* tag, int index);
117 void WritePID(std::string filename);