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 * ---------------------------------------------------
19 #include "inspircd_config.h"
21 #include "inspircd_io.h"
22 #include "inspircd_util.h"
24 #include <sys/errno.h>
28 #include <ext/hash_map>
46 #include "inspstring.h"
47 #include "helperfuncs.h"
50 #include "socketengine.h"
52 extern SocketEngine* SE;
53 extern ServerConfig *Config;
55 extern std::vector<Module*> modules;
56 extern std::vector<ircd_module*> factory;
57 extern std::vector<std::string> include_stack;
58 extern std::vector<InspSocket*> module_sockets;
61 extern int WHOWAS_STALE;
62 extern int WHOWAS_MAX;
63 extern time_t startup_time;
64 extern std::vector<std::string> module_names;
65 extern int boundPortCount;
67 extern int ports[MAXSOCKS];
71 extern std::stringstream config_f;
72 extern userrec* fd_ref_table[65536];
74 typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, irc::StrHashComp> user_hash;
75 typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, irc::StrHashComp> chan_hash;
76 typedef nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, irc::InAddr_HashComp> address_cache;
77 typedef nspace::hash_map<std::string, WhoWasUser*, nspace::hash<string>, irc::StrHashComp> whowas_hash;
78 typedef std::deque<command_t> command_table;
81 extern user_hash clientlist;
82 extern chan_hash chanlist;
83 extern whowas_hash whowas;
84 extern command_table cmdlist;
85 extern file_cache MOTD;
86 extern file_cache RULES;
87 extern address_cache IP;
90 // class type for holding an extended mode character - internal to core
92 class ExtMode : public classbase
101 ExtMode(char mc, int ty, bool oper, int p_on, int p_off) : modechar(mc), type(ty), needsoper(oper), params_when_on(p_on), params_when_off(p_off) { };
104 typedef std::vector<ExtMode> ExtModeList;
105 typedef ExtModeList::iterator ExtModeListIter;
110 // returns true if an extended mode character is in use
111 bool ModeDefined(char modechar, int type)
113 for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
115 if ((i->modechar == modechar) && (i->type == type))
123 bool ModeIsListMode(char modechar, int type)
125 for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
127 if ((i->modechar == modechar) && (i->type == type) && (i->list == true))
135 bool ModeDefinedOper(char modechar, int type)
137 for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
139 if ((i->modechar == modechar) && (i->type == type) && (i->needsoper == true))
147 // returns number of parameters for a custom mode when it is switched on
148 int ModeDefinedOn(char modechar, int type)
150 for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
152 if ((i->modechar == modechar) && (i->type == type))
154 return i->params_when_on;
160 // returns number of parameters for a custom mode when it is switched on
161 int ModeDefinedOff(char modechar, int type)
163 for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
165 if ((i->modechar == modechar) && (i->type == type))
167 return i->params_when_off;
173 // returns true if an extended mode character is in use
174 bool DoAddExtendedMode(char modechar, int type, bool requires_oper, int params_on, int params_off)
176 if (ModeDefined(modechar,type)) {
179 EMode.push_back(ExtMode(modechar,type,requires_oper,params_on,params_off));
183 // turns a mode into a listmode
184 void ModeMakeList(char modechar)
186 for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
188 if ((i->modechar == modechar) && (i->type == MT_CHANNEL))
197 // version is a simple class for holding a modules version number
199 Version::Version(int major, int minor, int revision, int build, int flags) : Major(major), Minor(minor), Revision(revision), Build(build), Flags(flags) { };
201 // admin is a simple class for holding a server's administrative info
203 Admin::Admin(std::string name, std::string email, std::string nick) : Name(name), Email(email), Nick(nick) { };
205 Request::Request(char* anydata, Module* src, Module* dst) : data(anydata), source(src), dest(dst) { };
207 char* Request::GetData()
212 Module* Request::GetSource()
217 Module* Request::GetDest()
222 char* Request::Send()
226 return dest->OnRequest(this);
234 Event::Event(char* anydata, Module* src, std::string eventid) : data(anydata), source(src), id(eventid) { };
236 char* Event::GetData()
241 Module* Event::GetSource()
248 FOREACH_MOD OnEvent(this);
252 std::string Event::GetEventID()
258 // These declarations define the behavours of the base class Module (which does nothing at all)
260 Module::Module(Server* Me) { }
261 Module::~Module() { }
262 void Module::OnUserConnect(userrec* user) { }
263 void Module::OnUserQuit(userrec* user, std::string message) { }
264 void Module::OnUserDisconnect(userrec* user) { }
265 void Module::OnUserJoin(userrec* user, chanrec* channel) { }
266 void Module::OnUserPart(userrec* user, chanrec* channel) { }
267 void Module::OnRehash(std::string parameter) { }
268 void Module::OnServerRaw(std::string &raw, bool inbound, userrec* user) { }
269 int Module::OnUserPreJoin(userrec* user, chanrec* chan, const char* cname) { return 0; }
270 int Module::OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms) { return false; }
271 void Module::OnMode(userrec* user, void* dest, int target_type, std::string text) { };
272 Version Module::GetVersion() { return Version(1,0,0,0,VF_VENDOR); }
273 void Module::OnOper(userrec* user, std::string opertype) { };
274 void Module::OnInfo(userrec* user) { };
275 void Module::OnWhois(userrec* source, userrec* dest) { };
276 int Module::OnUserPreInvite(userrec* source,userrec* dest,chanrec* channel) { return 0; };
277 int Module::OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text) { return 0; };
278 int Module::OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text) { return 0; };
279 int Module::OnUserPreNick(userrec* user, std::string newnick) { return 0; };
280 void Module::OnUserPostNick(userrec* user, std::string oldnick) { };
281 int Module::OnAccessCheck(userrec* source,userrec* dest,chanrec* channel,int access_type) { return ACR_DEFAULT; };
282 void Module::On005Numeric(std::string &output) { };
283 int Module::OnKill(userrec* source, userrec* dest, std::string reason) { return 0; };
284 void Module::OnLoadModule(Module* mod,std::string name) { };
285 void Module::OnUnloadModule(Module* mod,std::string name) { };
286 void Module::OnBackgroundTimer(time_t curtime) { };
287 void Module::OnSendList(userrec* user, chanrec* channel, char mode) { };
288 int Module::OnPreCommand(std::string command, char **parameters, int pcnt, userrec *user) { return 0; };
289 bool Module::OnCheckReady(userrec* user) { return true; };
290 void Module::OnUserRegister(userrec* user) { };
291 int Module::OnUserPreKick(userrec* source, userrec* user, chanrec* chan, std::string reason) { return 0; };
292 void Module::OnUserKick(userrec* source, userrec* user, chanrec* chan, std::string reason) { };
293 int Module::OnRawMode(userrec* user, chanrec* chan, char mode, std::string param, bool adding, int pcnt) { return 0; };
294 int Module::OnCheckInvite(userrec* user, chanrec* chan) { return 0; };
295 int Module::OnCheckKey(userrec* user, chanrec* chan, std::string keygiven) { return 0; };
296 int Module::OnCheckLimit(userrec* user, chanrec* chan) { return 0; };
297 int Module::OnCheckBan(userrec* user, chanrec* chan) { return 0; };
298 void Module::OnStats(char symbol) { };
299 int Module::OnChangeLocalUserHost(userrec* user, std::string newhost) { return 0; };
300 int Module::OnChangeLocalUserGECOS(userrec* user, std::string newhost) { return 0; };
301 int Module::OnLocalTopicChange(userrec* user, chanrec* chan, std::string topic) { return 0; };
302 void Module::OnEvent(Event* event) { return; };
303 char* Module::OnRequest(Request* request) { return NULL; };
304 int Module::OnOperCompare(std::string password, std::string input) { return 0; };
305 void Module::OnGlobalOper(userrec* user) { };
306 void Module::OnGlobalConnect(userrec* user) { };
307 int Module::OnAddBan(userrec* source, chanrec* channel,std::string banmask) { return 0; };
308 int Module::OnDelBan(userrec* source, chanrec* channel,std::string banmask) { return 0; };
309 void Module::OnRawSocketAccept(int fd, std::string ip, int localport) { };
310 int Module::OnRawSocketWrite(int fd, char* buffer, int count) { return 0; };
311 void Module::OnRawSocketClose(int fd) { };
312 int Module::OnRawSocketRead(int fd, char* buffer, unsigned int count, int &readresult) { return 0; };
313 void Module::OnUserMessage(userrec* user, void* dest, int target_type, std::string text) { };
314 void Module::OnUserNotice(userrec* user, void* dest, int target_type, std::string text) { };
315 void Module::OnRemoteKill(userrec* source, userrec* dest, std::string reason) { };
316 void Module::OnUserInvite(userrec* source,userrec* dest,chanrec* channel) { };
317 void Module::OnPostLocalTopicChange(userrec* user, chanrec* chan, std::string topic) { };
318 void Module::OnGetServerDescription(std::string servername,std::string &description) { };
319 void Module::OnSyncUser(userrec* user, Module* proto, void* opaque) { };
320 void Module::OnSyncChannel(chanrec* chan, Module* proto, void* opaque) { };
321 void Module::ProtoSendMode(void* opaque, int target_type, void* target, std::string modeline) { };
322 void Module::OnSyncChannelMetaData(chanrec* chan, Module* proto,void* opaque, std::string extname) { };
323 void Module::OnSyncUserMetaData(userrec* user, Module* proto,void* opaque, std::string extname) { };
324 void Module::OnDecodeMetaData(int target_type, void* target, std::string extname, std::string extdata) { };
325 void Module::ProtoSendMetaData(void* opaque, int target_type, void* target, std::string extname, std::string extdata) { };
326 void Module::OnWallops(userrec* user, std::string text) { };
327 void Module::OnChangeHost(userrec* user, std::string newhost) { };
328 void Module::OnChangeName(userrec* user, std::string gecos) { };
329 void Module::OnAddGLine(long duration, userrec* source, std::string reason, std::string hostmask) { };
330 void Module::OnAddZLine(long duration, userrec* source, std::string reason, std::string ipmask) { };
331 void Module::OnAddKLine(long duration, userrec* source, std::string reason, std::string hostmask) { };
332 void Module::OnAddQLine(long duration, userrec* source, std::string reason, std::string nickmask) { };
333 void Module::OnAddELine(long duration, userrec* source, std::string reason, std::string hostmask) { };
334 void Module::OnDelGLine(userrec* source, std::string hostmask) { };
335 void Module::OnDelZLine(userrec* source, std::string ipmask) { };
336 void Module::OnDelKLine(userrec* source, std::string hostmask) { };
337 void Module::OnDelQLine(userrec* source, std::string nickmask) { };
338 void Module::OnDelELine(userrec* source, std::string hostmask) { };
339 void Module::OnCleanup(int target_type, void* item) { };
341 /* server is a wrapper class that provides methods to all of the C-style
342 * exports in the core
353 void Server::AddSocket(InspSocket* sock)
355 module_sockets.push_back(sock);
358 void Server::RehashServer()
360 WriteOpers("*** Rehashing config file");
361 ReadConfig(false,NULL);
364 void Server::DelSocket(InspSocket* sock)
366 for (std::vector<InspSocket*>::iterator a = module_sockets.begin(); a < module_sockets.end(); a++)
370 module_sockets.erase(a);
376 void Server::SendOpers(std::string s)
378 WriteOpers("%s",s.c_str());
381 bool Server::MatchText(std::string sliteral, std::string spattern)
383 char literal[MAXBUF],pattern[MAXBUF];
384 strlcpy(literal,sliteral.c_str(),MAXBUF);
385 strlcpy(pattern,spattern.c_str(),MAXBUF);
386 return match(literal,pattern);
389 void Server::SendToModeMask(std::string modes, int flags, std::string text)
391 WriteMode(modes.c_str(),flags,"%s",text.c_str());
394 chanrec* Server::JoinUserToChannel(userrec* user, std::string cname, std::string key)
396 return add_channel(user,cname.c_str(),key.c_str(),false);
399 chanrec* Server::PartUserFromChannel(userrec* user, std::string cname, std::string reason)
401 return del_channel(user,cname.c_str(),reason.c_str(),false);
404 chanuserlist Server::GetUsers(chanrec* chan)
408 std::vector<char*> *list = chan->GetUsers();
409 for (std::vector<char*>::iterator i = list->begin(); i != list->end(); i++)
412 userl.push_back((userrec*)o);
416 void Server::ChangeUserNick(userrec* user, std::string nickname)
418 force_nickchange(user,nickname.c_str());
421 void Server::QuitUser(userrec* user, std::string reason)
423 kill_link(user,reason.c_str());
426 bool Server::IsUlined(std::string server)
428 return is_uline(server.c_str());
431 void Server::CallCommandHandler(std::string commandname, char** parameters, int pcnt, userrec* user)
433 call_handler(commandname.c_str(),parameters,pcnt,user);
436 bool Server::IsValidModuleCommand(std::string commandname, int pcnt, userrec* user)
438 return is_valid_cmd(commandname.c_str(), pcnt, user);
441 void Server::Log(int level, std::string s)
443 log(level,"%s",s.c_str());
446 void Server::AddCommand(char* cmd, handlerfunc f, char flags, int minparams, char* source)
448 createcommand(cmd,f,flags,minparams,source);
451 void Server::SendMode(char **parameters, int pcnt, userrec *user)
453 server_mode(parameters,pcnt,user);
456 void Server::Send(int Socket, std::string s)
458 Write(Socket,"%s",s.c_str());
461 void Server::SendServ(int Socket, std::string s)
463 WriteServ(Socket,"%s",s.c_str());
466 void Server::SendFrom(int Socket, userrec* User, std::string s)
468 WriteFrom(Socket,User,"%s",s.c_str());
471 void Server::SendTo(userrec* Source, userrec* Dest, std::string s)
475 // if source is NULL, then the message originates from the local server
476 Write(Dest->fd,":%s %s",this->GetServerName().c_str(),s.c_str());
480 // otherwise it comes from the user specified
481 WriteTo(Source,Dest,"%s",s.c_str());
485 void Server::SendChannelServerNotice(std::string ServName, chanrec* Channel, std::string text)
487 WriteChannelWithServ((char*)ServName.c_str(), Channel, "%s", text.c_str());
490 void Server::SendChannel(userrec* User, chanrec* Channel, std::string s,bool IncludeSender)
494 WriteChannel(Channel,User,"%s",s.c_str());
498 ChanExceptSender(Channel,User,"%s",s.c_str());
502 bool Server::CommonChannels(userrec* u1, userrec* u2)
504 return (common_channels(u1,u2) != 0);
507 void Server::SendCommon(userrec* User, std::string text,bool IncludeSender)
511 WriteCommon(User,"%s",text.c_str());
515 WriteCommonExcept(User,"%s",text.c_str());
519 void Server::SendWallops(userrec* User, std::string text)
521 WriteWallOps(User,false,"%s",text.c_str());
524 void Server::ChangeHost(userrec* user, std::string host)
526 ChangeDisplayedHost(user,host.c_str());
529 void Server::ChangeGECOS(userrec* user, std::string gecos)
531 ChangeName(user,gecos.c_str());
534 bool Server::IsNick(std::string nick)
536 return (isnick(nick.c_str()) != 0);
539 userrec* Server::FindNick(std::string nick)
544 userrec* Server::FindDescriptor(int socket)
546 return (socket < 65536 ? fd_ref_table[socket] : NULL);
549 chanrec* Server::FindChannel(std::string channel)
551 return FindChan(channel.c_str());
554 std::string Server::ChanMode(userrec* User, chanrec* Chan)
556 return cmode(User,Chan);
559 bool Server::IsOnChannel(userrec* User, chanrec* Chan)
561 return has_channel(User,Chan);
564 std::string Server::GetServerName()
566 return getservername();
569 std::string Server::GetNetworkName()
571 return getnetworkname();
574 std::string Server::GetServerDescription()
576 return getserverdesc();
579 Admin Server::GetAdmin()
581 return Admin(getadminname(),getadminemail(),getadminnick());
586 bool Server::AddExtendedMode(char modechar, int type, bool requires_oper, int params_when_on, int params_when_off)
588 if (((modechar >= 'A') && (modechar <= 'Z')) || ((modechar >= 'a') && (modechar <= 'z')))
590 if (type == MT_SERVER)
592 log(DEBUG,"*** API ERROR *** Modes of type MT_SERVER are reserved for future expansion");
595 if (((params_when_on>0) || (params_when_off>0)) && (type == MT_CLIENT))
597 log(DEBUG,"*** API ERROR *** Parameters on MT_CLIENT modes are not supported");
600 if ((params_when_on>1) || (params_when_off>1))
602 log(DEBUG,"*** API ERROR *** More than one parameter for an MT_CHANNEL mode is not yet supported");
605 return DoAddExtendedMode(modechar,type,requires_oper,params_when_on,params_when_off);
609 log(DEBUG,"*** API ERROR *** Muppet modechar detected.");
614 bool Server::AddExtendedListMode(char modechar)
616 bool res = DoAddExtendedMode(modechar,MT_CHANNEL,false,1,1);
618 ModeMakeList(modechar);
622 int Server::CountUsers(chanrec* c)
628 bool Server::UserToPseudo(userrec* user,std::string message)
630 unsigned int old_fd = user->fd;
631 user->fd = FD_MAGIC_NUMBER;
633 Write(old_fd,"ERROR :Closing link (%s@%s) [%s]",user->ident,user->host,message.c_str());
640 bool Server::PseudoToUser(userrec* alive,userrec* zombie,std::string message)
642 zombie->fd = alive->fd;
643 alive->fd = FD_MAGIC_NUMBER;
644 alive->ClearBuffer();
645 Write(zombie->fd,":%s!%s@%s NICK %s",alive->nick,alive->ident,alive->host,zombie->nick);
646 kill_link(alive,message.c_str());
647 fd_ref_table[zombie->fd] = zombie;
648 for (unsigned int i = 0; i < zombie->chans.size(); i++)
650 if (zombie->chans[i].channel != NULL)
652 if (zombie->chans[i].channel->name)
654 chanrec* Ptr = zombie->chans[i].channel;
655 WriteFrom(zombie->fd,zombie,"JOIN %s",Ptr->name);
658 WriteServ(zombie->fd,"332 %s %s :%s", zombie->nick, Ptr->name, Ptr->topic);
659 WriteServ(zombie->fd,"333 %s %s %s %d", zombie->nick, Ptr->name, Ptr->setby, Ptr->topicset);
661 userlist(zombie,Ptr);
662 WriteServ(zombie->fd,"366 %s %s :End of /NAMES list.", zombie->nick, Ptr->name);
670 void Server::AddGLine(long duration, std::string source, std::string reason, std::string hostmask)
672 add_gline(duration, source.c_str(), reason.c_str(), hostmask.c_str());
675 void Server::AddQLine(long duration, std::string source, std::string reason, std::string nickname)
677 add_qline(duration, source.c_str(), reason.c_str(), nickname.c_str());
680 void Server::AddZLine(long duration, std::string source, std::string reason, std::string ipaddr)
682 add_zline(duration, source.c_str(), reason.c_str(), ipaddr.c_str());
685 void Server::AddKLine(long duration, std::string source, std::string reason, std::string hostmask)
687 add_kline(duration, source.c_str(), reason.c_str(), hostmask.c_str());
690 void Server::AddELine(long duration, std::string source, std::string reason, std::string hostmask)
692 add_eline(duration, source.c_str(), reason.c_str(), hostmask.c_str());
695 bool Server::DelGLine(std::string hostmask)
697 return del_gline(hostmask.c_str());
700 bool Server::DelQLine(std::string nickname)
702 return del_qline(nickname.c_str());
705 bool Server::DelZLine(std::string ipaddr)
707 return del_zline(ipaddr.c_str());
710 bool Server::DelKLine(std::string hostmask)
712 return del_kline(hostmask.c_str());
715 bool Server::DelELine(std::string hostmask)
717 return del_eline(hostmask.c_str());
720 long Server::CalcDuration(std::string delta)
722 return duration(delta.c_str());
725 bool Server::IsValidMask(std::string mask)
727 const char* dest = mask.c_str();
728 if (strchr(dest,'!')==0)
730 if (strchr(dest,'@')==0)
732 for (unsigned int i = 0; i < strlen(dest); i++)
735 for (unsigned int i = 0; i < strlen(dest); i++)
739 for (unsigned int i = 0; i < strlen(dest); i++)
745 for (unsigned int i = 0; i < strlen(dest); i++)
754 Module* Server::FindModule(std::string name)
756 for (int i = 0; i <= MODCOUNT; i++)
758 if (module_names[i] == name)
766 ConfigReader::ConfigReader()
768 include_stack.clear();
769 this->cache = new std::stringstream(std::stringstream::in | std::stringstream::out);
770 this->errorlog = new std::stringstream(std::stringstream::in | std::stringstream::out);
771 this->readerror = LoadConf(CONFIG_FILE,this->cache,this->errorlog);
772 if (!this->readerror)
773 this->error = CONF_FILE_NOT_FOUND;
777 ConfigReader::~ConfigReader()
782 delete this->errorlog;
786 ConfigReader::ConfigReader(std::string filename)
788 this->cache = new std::stringstream(std::stringstream::in | std::stringstream::out);
789 this->errorlog = new std::stringstream(std::stringstream::in | std::stringstream::out);
790 this->readerror = LoadConf(filename.c_str(),this->cache,this->errorlog);
791 if (!this->readerror)
792 this->error = CONF_FILE_NOT_FOUND;
795 std::string ConfigReader::ReadValue(std::string tag, std::string name, int index)
800 strlcpy(t,tag.c_str(),MAXBUF);
801 strlcpy(n,name.c_str(),MAXBUF);
802 int res = ReadConf(cache,t,n,index,val);
805 this->error = CONF_VALUE_NOT_FOUND;
811 bool ConfigReader::ReadFlag(std::string tag, std::string name, int index)
816 strlcpy(t,tag.c_str(),MAXBUF);
817 strlcpy(n,name.c_str(),MAXBUF);
818 int res = ReadConf(cache,t,n,index,val);
821 this->error = CONF_VALUE_NOT_FOUND;
825 return ((s == "yes") || (s == "YES") || (s == "true") || (s == "TRUE") || (s == "1"));
828 long ConfigReader::ReadInteger(std::string tag, std::string name, int index, bool needs_unsigned)
833 strlcpy(t,tag.c_str(),MAXBUF);
834 strlcpy(n,name.c_str(),MAXBUF);
835 int res = ReadConf(cache,t,n,index,val);
838 this->error = CONF_VALUE_NOT_FOUND;
841 for (unsigned int i = 0; i < strlen(val); i++)
843 if (!isdigit(val[i]))
845 this->error = CONF_NOT_A_NUMBER;
849 if ((needs_unsigned) && (atoi(val)<0))
851 this->error = CONF_NOT_UNSIGNED;
857 long ConfigReader::GetError()
859 long olderr = this->error;
864 void ConfigReader::DumpErrors(bool bail, userrec* user)
868 printf("There were errors in your configuration:\n%s",errorlog->str().c_str());
876 WriteServ(user->fd,"NOTICE %s :There were errors in the configuration file:",user->nick);
877 while (!errorlog->eof())
879 errorlog->getline(dataline,1024);
880 WriteServ(user->fd,"NOTICE %s :%s",user->nick,dataline);
885 WriteOpers("There were errors in the configuration file:",user->nick);
886 while (!errorlog->eof())
888 errorlog->getline(dataline,1024);
889 WriteOpers(dataline);
897 int ConfigReader::Enumerate(std::string tag)
899 return EnumConf(cache,tag.c_str());
902 int ConfigReader::EnumerateValues(std::string tag, int index)
904 return EnumValues(cache, tag.c_str(), index);
907 bool ConfigReader::Verify()
909 return this->readerror;
913 FileReader::FileReader(std::string filename)
916 readfile(c,filename.c_str());
920 FileReader::FileReader()
924 void FileReader::LoadFile(std::string filename)
927 readfile(c,filename.c_str());
932 FileReader::~FileReader()
936 bool FileReader::Exists()
948 std::string FileReader::GetLine(int x)
950 if ((x<0) || ((unsigned)x>fc.size()))
955 int FileReader::FileSize()
961 std::vector<Module*> modules(255);
962 std::vector<ircd_module*> factory(255);