1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd is copyright (C) 2002-2006 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 #include "inspircd_config.h"
19 #include "configreader.h"
21 #include <sys/errno.h>
38 #include "inspstring.h"
39 #include "helperfuncs.h"
42 #include "socketengine.h"
45 #include "command_parse.h"
48 extern InspIRCd* ServerInstance;
50 extern ModuleList modules;
51 extern FactoryList factory;
52 extern std::vector<userrec*> local_users;
54 extern user_hash clientlist;
55 extern chan_hash chanlist;
56 extern command_table cmdlist;
62 // version is a simple class for holding a modules version number
64 Version::Version(int major, int minor, int revision, int build, int flags)
65 : Major(major), Minor(minor), Revision(revision), Build(build), Flags(flags)
69 // admin is a simple class for holding a server's administrative info
71 Admin::Admin(std::string name, std::string email, std::string nick)
72 : Name(name), Email(email), Nick(nick)
76 Request::Request(char* anydata, Module* src, Module* dst)
77 : data(anydata), source(src), dest(dst)
79 /* Ensure that because this module doesnt support ID strings, it doesnt break modules that do
80 * by passing them uninitialized pointers (could happen)
85 Request::Request(Module* src, Module* dst, const char* idstr)
86 : id(idstr), source(src), dest(dst)
90 char* Request::GetData()
95 const char* Request::GetId()
100 Module* Request::GetSource()
105 Module* Request::GetDest()
110 char* Request::Send()
114 return dest->OnRequest(this);
122 Event::Event(char* anydata, Module* src, const std::string &eventid) : data(anydata), source(src), id(eventid) { };
124 char* Event::GetData()
126 return (char*)this->data;
129 Module* Event::GetSource()
136 FOREACH_MOD(I_OnEvent,OnEvent(this));
140 std::string Event::GetEventID()
146 // These declarations define the behavours of the base class Module (which does nothing at all)
148 Module::Module(Server* Me) { }
149 Module::~Module() { }
150 void Module::OnUserConnect(userrec* user) { }
151 void Module::OnUserQuit(userrec* user, const std::string& message) { }
152 void Module::OnUserDisconnect(userrec* user) { }
153 void Module::OnUserJoin(userrec* user, chanrec* channel) { }
154 void Module::OnUserPart(userrec* user, chanrec* channel, const std::string &partmessage) { }
155 void Module::OnRehash(const std::string ¶meter) { }
156 void Module::OnServerRaw(std::string &raw, bool inbound, userrec* user) { }
157 int Module::OnUserPreJoin(userrec* user, chanrec* chan, const char* cname) { return 0; }
158 void Module::OnMode(userrec* user, void* dest, int target_type, const std::string &text) { };
159 Version Module::GetVersion() { return Version(1,0,0,0,VF_VENDOR); }
160 void Module::OnOper(userrec* user, const std::string &opertype) { };
161 void Module::OnPostOper(userrec* user, const std::string &opertype) { };
162 void Module::OnInfo(userrec* user) { };
163 void Module::OnWhois(userrec* source, userrec* dest) { };
164 int Module::OnUserPreInvite(userrec* source,userrec* dest,chanrec* channel) { return 0; };
165 int Module::OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text,char status) { return 0; };
166 int Module::OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text,char status) { return 0; };
167 int Module::OnUserPreNick(userrec* user, const std::string &newnick) { return 0; };
168 void Module::OnUserPostNick(userrec* user, const std::string &oldnick) { };
169 int Module::OnAccessCheck(userrec* source,userrec* dest,chanrec* channel,int access_type) { return ACR_DEFAULT; };
170 void Module::On005Numeric(std::string &output) { };
171 int Module::OnKill(userrec* source, userrec* dest, const std::string &reason) { return 0; };
172 void Module::OnLoadModule(Module* mod,const std::string &name) { };
173 void Module::OnUnloadModule(Module* mod,const std::string &name) { };
174 void Module::OnBackgroundTimer(time_t curtime) { };
175 int Module::OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated) { return 0; };
176 bool Module::OnCheckReady(userrec* user) { return true; };
177 void Module::OnUserRegister(userrec* user) { };
178 int Module::OnUserPreKick(userrec* source, userrec* user, chanrec* chan, const std::string &reason) { return 0; };
179 void Module::OnUserKick(userrec* source, userrec* user, chanrec* chan, const std::string &reason) { };
180 int Module::OnRawMode(userrec* user, chanrec* chan, char mode, const std::string ¶m, bool adding, int pcnt) { return 0; };
181 int Module::OnCheckInvite(userrec* user, chanrec* chan) { return 0; };
182 int Module::OnCheckKey(userrec* user, chanrec* chan, const std::string &keygiven) { return 0; };
183 int Module::OnCheckLimit(userrec* user, chanrec* chan) { return 0; };
184 int Module::OnCheckBan(userrec* user, chanrec* chan) { return 0; };
185 int Module::OnStats(char symbol, userrec* user, string_list &results) { return 0; };
186 int Module::OnChangeLocalUserHost(userrec* user, const std::string &newhost) { return 0; };
187 int Module::OnChangeLocalUserGECOS(userrec* user, const std::string &newhost) { return 0; };
188 int Module::OnLocalTopicChange(userrec* user, chanrec* chan, const std::string &topic) { return 0; };
189 void Module::OnEvent(Event* event) { return; };
190 char* Module::OnRequest(Request* request) { return NULL; };
191 int Module::OnOperCompare(const std::string &password, const std::string &input) { return 0; };
192 void Module::OnGlobalOper(userrec* user) { };
193 void Module::OnGlobalConnect(userrec* user) { };
194 int Module::OnAddBan(userrec* source, chanrec* channel,const std::string &banmask) { return 0; };
195 int Module::OnDelBan(userrec* source, chanrec* channel,const std::string &banmask) { return 0; };
196 void Module::OnRawSocketAccept(int fd, const std::string &ip, int localport) { };
197 int Module::OnRawSocketWrite(int fd, const char* buffer, int count) { return 0; };
198 void Module::OnRawSocketClose(int fd) { };
199 int Module::OnRawSocketRead(int fd, char* buffer, unsigned int count, int &readresult) { return 0; };
200 void Module::OnUserMessage(userrec* user, void* dest, int target_type, const std::string &text, char status) { };
201 void Module::OnUserNotice(userrec* user, void* dest, int target_type, const std::string &text, char status) { };
202 void Module::OnRemoteKill(userrec* source, userrec* dest, const std::string &reason) { };
203 void Module::OnUserInvite(userrec* source,userrec* dest,chanrec* channel) { };
204 void Module::OnPostLocalTopicChange(userrec* user, chanrec* chan, const std::string &topic) { };
205 void Module::OnGetServerDescription(const std::string &servername,std::string &description) { };
206 void Module::OnSyncUser(userrec* user, Module* proto, void* opaque) { };
207 void Module::OnSyncChannel(chanrec* chan, Module* proto, void* opaque) { };
208 void Module::ProtoSendMode(void* opaque, int target_type, void* target, const std::string &modeline) { };
209 void Module::OnSyncChannelMetaData(chanrec* chan, Module* proto,void* opaque, const std::string &extname) { };
210 void Module::OnSyncUserMetaData(userrec* user, Module* proto,void* opaque, const std::string &extname) { };
211 void Module::OnSyncOtherMetaData(Module* proto, void* opaque) { };
212 void Module::OnDecodeMetaData(int target_type, void* target, const std::string &extname, const std::string &extdata) { };
213 void Module::ProtoSendMetaData(void* opaque, int target_type, void* target, const std::string &extname, const std::string &extdata) { };
214 void Module::OnWallops(userrec* user, const std::string &text) { };
215 void Module::OnChangeHost(userrec* user, const std::string &newhost) { };
216 void Module::OnChangeName(userrec* user, const std::string &gecos) { };
217 void Module::OnAddGLine(long duration, userrec* source, const std::string &reason, const std::string &hostmask) { };
218 void Module::OnAddZLine(long duration, userrec* source, const std::string &reason, const std::string &ipmask) { };
219 void Module::OnAddKLine(long duration, userrec* source, const std::string &reason, const std::string &hostmask) { };
220 void Module::OnAddQLine(long duration, userrec* source, const std::string &reason, const std::string &nickmask) { };
221 void Module::OnAddELine(long duration, userrec* source, const std::string &reason, const std::string &hostmask) { };
222 void Module::OnDelGLine(userrec* source, const std::string &hostmask) { };
223 void Module::OnDelZLine(userrec* source, const std::string &ipmask) { };
224 void Module::OnDelKLine(userrec* source, const std::string &hostmask) { };
225 void Module::OnDelQLine(userrec* source, const std::string &nickmask) { };
226 void Module::OnDelELine(userrec* source, const std::string &hostmask) { };
227 void Module::OnCleanup(int target_type, void* item) { };
228 void Module::Implements(char* Implements) { for (int j = 0; j < 255; j++) Implements[j] = 0; };
229 void Module::OnChannelDelete(chanrec* chan) { };
230 Priority Module::Prioritize() { return PRIORITY_DONTCARE; }
231 void Module::OnSetAway(userrec* user) { };
232 void Module::OnCancelAway(userrec* user) { };
234 /* server is a wrapper class that provides methods to all of the C-style
235 * exports in the core
246 void Server::AddSocket(InspSocket* sock)
248 ServerInstance->module_sockets.push_back(sock);
251 void Server::RemoveSocket(InspSocket* sock)
253 for (std::vector<InspSocket*>::iterator a = ServerInstance->module_sockets.begin(); a < ServerInstance->module_sockets.end(); a++)
255 InspSocket* s = (InspSocket*)*a;
261 long Server::PriorityAfter(const std::string &modulename)
263 for (unsigned int j = 0; j < ServerInstance->Config->module_names.size(); j++)
265 if (ServerInstance->Config->module_names[j] == modulename)
267 return ((j << 8) | PRIORITY_AFTER);
270 return PRIORITY_DONTCARE;
273 long Server::PriorityBefore(const std::string &modulename)
275 for (unsigned int j = 0; j < ServerInstance->Config->module_names.size(); j++)
277 if (ServerInstance->Config->module_names[j] == modulename)
279 return ((j << 8) | PRIORITY_BEFORE);
282 return PRIORITY_DONTCARE;
285 bool Server::PublishFeature(const std::string &FeatureName, Module* Mod)
287 if (Features.find(FeatureName) == Features.end())
289 Features[FeatureName] = Mod;
295 bool Server::UnpublishFeature(const std::string &FeatureName)
297 featurelist::iterator iter = Features.find(FeatureName);
299 if (iter == Features.end())
302 Features.erase(iter);
306 Module* Server::FindFeature(const std::string &FeatureName)
308 featurelist::iterator iter = Features.find(FeatureName);
310 if (iter == Features.end())
316 const std::string& Server::GetModuleName(Module* m)
318 static std::string nothing = ""; /* Prevent compiler warning */
319 for (int i = 0; i <= MODCOUNT; i++)
323 return ServerInstance->Config->module_names[i];
326 return nothing; /* As above */
329 void Server::RehashServer()
331 WriteOpers("*** Rehashing config file");
332 ServerInstance->Config->Read(false,NULL);
335 ServerConfig* Server::GetConfig()
337 return ServerInstance->Config;
340 std::string Server::GetVersion()
342 return ServerInstance->GetVersionString();
345 void Server::DelSocket(InspSocket* sock)
347 for (std::vector<InspSocket*>::iterator a = ServerInstance->module_sockets.begin(); a < ServerInstance->module_sockets.end(); a++)
351 ServerInstance->module_sockets.erase(a);
357 long Server::GetChannelCount()
359 return (long)chanlist.size();
362 /* This is ugly, yes, but hash_map's arent designed to be
363 * addressed in this manner, and this is a bit of a kludge.
364 * Luckily its a specialist function and rarely used by
365 * many modules (in fact, it was specially created to make
366 * m_safelist possible, initially).
369 chanrec* Server::GetChannelIndex(long index)
372 for (chan_hash::iterator n = chanlist.begin(); n != chanlist.end(); n++, target++)
380 void Server::AddTimer(InspTimer* T)
385 void Server::SendOpers(const std::string &s)
387 WriteOpers("%s",s.c_str());
390 bool Server::MatchText(const std::string &sliteral, const std::string &spattern)
392 return match(sliteral.c_str(),spattern.c_str());
395 void Server::SendToModeMask(const std::string &modes, int flags, const std::string &text)
397 WriteMode(modes.c_str(),flags,"%s",text.c_str());
400 bool Server::IsUlined(const std::string &server)
402 return is_uline(server.c_str());
405 bool Server::CallCommandHandler(const std::string &commandname, const char** parameters, int pcnt, userrec* user)
407 return ServerInstance->Parser->CallHandler(commandname,parameters,pcnt,user);
410 bool Server::IsValidModuleCommand(const std::string &commandname, int pcnt, userrec* user)
412 return ServerInstance->Parser->IsValidCommand(commandname, pcnt, user);
415 void Server::Log(int level, const std::string &s)
417 log(level,"%s",s.c_str());
420 void Server::AddCommand(command_t *f)
422 if (!ServerInstance->Parser->CreateCommand(f))
424 ModuleException err("Command "+std::string(f->command)+" already exists.");
429 void Server::SendMode(const char** parameters, int pcnt, userrec *user)
431 ServerInstance->ModeGrok->Process(parameters,pcnt,user,true);
434 void Server::DumpText(userrec* User, const std::string &LinePrefix, stringstream &TextStream)
436 std::string CompleteLine = LinePrefix;
437 std::string Word = "";
438 while (TextStream >> Word)
440 if (CompleteLine.length() + Word.length() + 3 > 500)
442 User->WriteServ(CompleteLine);
443 CompleteLine = LinePrefix;
445 CompleteLine = CompleteLine + Word + " ";
447 User->WriteServ(CompleteLine);
450 bool Server::IsNick(const std::string &nick)
452 return (isnick(nick.c_str()) != 0);
455 userrec* Server::FindNick(const std::string &nick)
460 userrec* Server::FindDescriptor(int socket)
462 return (socket < 65536 ? ServerInstance->fd_ref_table[socket] : NULL);
465 chanrec* Server::FindChannel(const std::string &channel)
467 return FindChan(channel.c_str());
470 std::string Server::ChanMode(userrec* User, chanrec* Chan)
472 return cmode(User,Chan);
475 std::string Server::GetServerName()
477 return ServerInstance->Config->ServerName;
480 std::string Server::GetNetworkName()
482 return ServerInstance->Config->Network;
485 std::string Server::GetServerDescription()
487 return ServerInstance->Config->ServerDesc;
490 Admin Server::GetAdmin()
492 return Admin(ServerInstance->Config->AdminName,ServerInstance->Config->AdminEmail,ServerInstance->Config->AdminNick);
496 bool Server::AddMode(ModeHandler* mh, const unsigned char mode)
498 return ServerInstance->ModeGrok->AddMode(mh,mode);
501 bool Server::AddModeWatcher(ModeWatcher* mw)
503 return ServerInstance->ModeGrok->AddModeWatcher(mw);
506 bool Server::DelModeWatcher(ModeWatcher* mw)
508 return ServerInstance->ModeGrok->DelModeWatcher(mw);
511 bool Server::AddResolver(Resolver* r)
513 return ServerInstance->Res->AddResolverClass(r);
516 int Server::CountUsers(chanrec* c)
521 bool Server::UserToPseudo(userrec* user, const std::string &message)
523 unsigned int old_fd = user->fd;
524 user->Write("ERROR :Closing link (%s@%s) [%s]",user->ident,user->host,message.c_str());
525 user->FlushWriteBuf();
527 user->fd = FD_MAGIC_NUMBER;
529 if (find(local_users.begin(),local_users.end(),user) != local_users.end())
531 local_users.erase(find(local_users.begin(),local_users.end(),user));
532 log(DEBUG,"Delete local user");
535 ServerInstance->SE->DelFd(old_fd);
541 bool Server::PseudoToUser(userrec* alive, userrec* zombie, const std::string &message)
543 log(DEBUG,"PseudoToUser");
544 zombie->fd = alive->fd;
545 FOREACH_MOD(I_OnUserQuit,OnUserQuit(alive,message));
546 alive->fd = FD_MAGIC_NUMBER;
547 alive->FlushWriteBuf();
548 alive->ClearBuffer();
549 // save these for later
550 std::string oldnick = alive->nick;
551 std::string oldhost = alive->host;
552 std::string oldident = alive->ident;
553 userrec::QuitUser(alive,message.c_str());
554 if (find(local_users.begin(),local_users.end(),alive) != local_users.end())
556 local_users.erase(find(local_users.begin(),local_users.end(),alive));
557 log(DEBUG,"Delete local user");
559 // Fix by brain - cant write the user until their fd table entry is updated
560 ServerInstance->fd_ref_table[zombie->fd] = zombie;
561 zombie->Write(":%s!%s@%s NICK %s",oldnick.c_str(),oldident.c_str(),oldhost.c_str(),zombie->nick);
562 for (std::vector<ucrec*>::const_iterator i = zombie->chans.begin(); i != zombie->chans.end(); i++)
564 if (((ucrec*)(*i))->channel != NULL)
566 chanrec* Ptr = ((ucrec*)(*i))->channel;
567 zombie->WriteFrom(zombie,"JOIN %s",Ptr->name);
570 zombie->WriteServ("332 %s %s :%s", zombie->nick, Ptr->name, Ptr->topic);
571 zombie->WriteServ("333 %s %s %s %d", zombie->nick, Ptr->name, Ptr->setby, Ptr->topicset);
573 userlist(zombie,Ptr);
574 zombie->WriteServ("366 %s %s :End of /NAMES list.", zombie->nick, Ptr->name);
577 if ((find(local_users.begin(),local_users.end(),zombie) == local_users.end()) && (zombie->fd != FD_MAGIC_NUMBER))
578 local_users.push_back(zombie);
583 void Server::AddGLine(long duration, const std::string &source, const std::string &reason, const std::string &hostmask)
585 add_gline(duration, source.c_str(), reason.c_str(), hostmask.c_str());
586 apply_lines(APPLY_GLINES);
589 void Server::AddQLine(long duration, const std::string &source, const std::string &reason, const std::string &nickname)
591 add_qline(duration, source.c_str(), reason.c_str(), nickname.c_str());
592 apply_lines(APPLY_QLINES);
595 void Server::AddZLine(long duration, const std::string &source, const std::string &reason, const std::string &ipaddr)
597 add_zline(duration, source.c_str(), reason.c_str(), ipaddr.c_str());
598 apply_lines(APPLY_ZLINES);
601 void Server::AddKLine(long duration, const std::string &source, const std::string &reason, const std::string &hostmask)
603 add_kline(duration, source.c_str(), reason.c_str(), hostmask.c_str());
604 apply_lines(APPLY_KLINES);
607 void Server::AddELine(long duration, const std::string &source, const std::string &reason, const std::string &hostmask)
609 add_eline(duration, source.c_str(), reason.c_str(), hostmask.c_str());
612 bool Server::DelGLine(const std::string &hostmask)
614 return del_gline(hostmask.c_str());
617 bool Server::DelQLine(const std::string &nickname)
619 return del_qline(nickname.c_str());
622 bool Server::DelZLine(const std::string &ipaddr)
624 return del_zline(ipaddr.c_str());
627 bool Server::DelKLine(const std::string &hostmask)
629 return del_kline(hostmask.c_str());
632 bool Server::DelELine(const std::string &hostmask)
634 return del_eline(hostmask.c_str());
637 long Server::CalcDuration(const std::string &delta)
639 return duration(delta.c_str());
643 * XXX why on *earth* is this in modules.cpp...? I think
644 * perhaps we need a server.cpp for Server:: stuff where possible. -- w00t
646 bool Server::IsValidMask(const std::string &mask)
648 char* dest = (char*)mask.c_str();
649 if (strchr(dest,'!')==0)
651 if (strchr(dest,'@')==0)
653 for (char* i = dest; *i; i++)
656 for (char* i = dest; *i; i++)
660 for (char* i = dest; *i; i++)
666 for (char* i = dest; *i; i++)
675 Module* Server::FindModule(const std::string &name)
677 for (int i = 0; i <= MODCOUNT; i++)
679 if (ServerInstance->Config->module_names[i] == name)
687 ConfigReader::ConfigReader()
689 // ServerInstance->Config->ClearStack();
691 /* Is there any reason to load the entire config file again here?
692 * it's needed if they specify another config file, but using the
693 * default one we can just use the global config data - pre-parsed!
695 //~ this->cache = new std::stringstream(std::stringstream::in | std::stringstream::out);
696 this->errorlog = new std::ostringstream(std::stringstream::in | std::stringstream::out);
698 //~ this->readerror = ServerInstance->Config->LoadConf(CONFIG_FILE, this->cache,this->errorlog);
699 //~ if (!this->readerror)
700 //~ this->error = CONF_FILE_NOT_FOUND;
702 this->data = &ServerInstance->Config->config_data;
703 this->privatehash = false;
707 ConfigReader::~ConfigReader()
710 //~ delete this->cache;
712 DELETE(this->errorlog);
713 if(this->privatehash)
718 ConfigReader::ConfigReader(const std::string &filename)
720 ServerInstance->Config->ClearStack();
722 this->data = new ConfigDataHash;
723 this->privatehash = true;
724 this->errorlog = new std::ostringstream(std::stringstream::in | std::stringstream::out);
725 this->readerror = ServerInstance->Config->LoadConf(*this->data, filename, *this->errorlog);
726 if (!this->readerror)
727 this->error = CONF_FILE_NOT_FOUND;
730 std::string ConfigReader::ReadValue(const std::string &tag, const std::string &name, int index)
732 /* Don't need to strlcpy() tag and name anymore, ReadConf() takes const char* */
735 if (!ServerInstance->Config->ConfValue(*this->data, tag, name, index, result))
737 this->error = CONF_VALUE_NOT_FOUND;
744 bool ConfigReader::ReadFlag(const std::string &tag, const std::string &name, int index)
746 return ServerInstance->Config->ConfValueBool(*this->data, tag, name, index);
749 long ConfigReader::ReadInteger(const std::string &tag, const std::string &name, int index, bool needs_unsigned)
753 if(!ServerInstance->Config->ConfValueInteger(*this->data, tag, name, index, result))
755 this->error = CONF_VALUE_NOT_FOUND;
759 if ((needs_unsigned) && (result < 0))
761 this->error = CONF_NOT_UNSIGNED;
768 long ConfigReader::GetError()
770 long olderr = this->error;
775 void ConfigReader::DumpErrors(bool bail, userrec* user)
777 /* XXX - Duplicated code */
781 printf("There were errors in your configuration:\n%s", this->errorlog->str().c_str());
786 std::string errors = this->errorlog->str();
787 std::string::size_type start;
788 unsigned int prefixlen;
791 /* ":ServerInstance->Config->ServerName NOTICE user->nick :" */
792 prefixlen = strlen(ServerInstance->Config->ServerName) + strlen(user->nick) + 11;
796 user->WriteServ("NOTICE %s :There were errors in the configuration file:",user->nick);
798 while(start < errors.length())
800 user->WriteServ("NOTICE %s :%s",user->nick, errors.substr(start, 510 - prefixlen).c_str());
801 start += 510 - prefixlen;
806 WriteOpers("There were errors in the configuration file:");
808 while(start < errors.length())
810 WriteOpers(errors.substr(start, 360).c_str());
820 int ConfigReader::Enumerate(const std::string &tag)
822 return ServerInstance->Config->ConfValueEnum(*this->data, tag);
825 int ConfigReader::EnumerateValues(const std::string &tag, int index)
827 return ServerInstance->Config->ConfVarEnum(*this->data, tag, index);
830 bool ConfigReader::Verify()
832 return this->readerror;
836 FileReader::FileReader(const std::string &filename)
839 ServerInstance->Config->ReadFile(c,filename.c_str());
844 FileReader::FileReader()
848 std::string FileReader::Contents()
851 for (file_cache::iterator a = this->fc.begin(); a != this->fc.end(); a++)
859 unsigned long FileReader::ContentSize()
861 return this->contentsize;
864 void FileReader::CalcSize()
867 for (file_cache::iterator a = this->fc.begin(); a != this->fc.end(); a++)
868 n += (a->length() + 2);
869 this->contentsize = n;
872 void FileReader::LoadFile(const std::string &filename)
875 ServerInstance->Config->ReadFile(c,filename.c_str());
881 FileReader::~FileReader()
885 bool FileReader::Exists()
887 return (!(fc.size() == 0));
890 std::string FileReader::GetLine(int x)
892 if ((x<0) || ((unsigned)x>fc.size()))
897 int FileReader::FileSize()
903 std::vector<Module*> modules(255);
904 std::vector<ircd_module*> factory(255);