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;
40 char ServerName[MAXBUF];
42 char ServerDesc[MAXBUF];
43 char AdminName[MAXBUF];
44 char AdminEmail[MAXBUF];
45 char AdminNick[MAXBUF];
47 char restartpass[MAXBUF];
50 char PrefixQuit[MAXBUF];
51 char DieValue[MAXBUF];
52 char DNSServer[MAXBUF];
53 char DisabledCommands[MAXBUF];
55 char MyExecutable[1024];
61 int NetBufferSize; // NetBufferSize used as the buffer size for all read() ops
62 int MaxConn; // size of accept() backlog (128 by default on *BSD)
63 unsigned int SoftLimit;
68 char addrs[MAXBUF][255];
72 std::stringstream config_f;
74 std::vector<std::string> module_names;
78 void Read(bool bail, userrec* user);
84 int DaemonSeed (void);
85 bool FileExists (const char* file);
86 int OpenTCPSocket (void);
87 int BindSocket (int sockfd, struct sockaddr_in client, struct sockaddr_in server, int port, char* addr);
89 bool LoadConf(const char* filename, std::stringstream *target, std::stringstream* errorstream);
90 int ConfValue(char* tag, char* var, int index, char *result, std::stringstream *config);
91 int ReadConf(std::stringstream *config_f,const char* tag, const char* var, int index, char *result);
92 int ConfValueEnum(char* tag,std::stringstream *config);
93 int EnumConf(std::stringstream *config_f,const char* tag);
94 int EnumValues(std::stringstream *config, const char* tag, int index);
95 void WritePID(std::string filename);