diff options
author | om <om@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-04-08 17:05:48 +0000 |
---|---|---|
committer | om <om@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-04-08 17:05:48 +0000 |
commit | d54fbc71e2a2e0f70002e2d36c669c4aa3d59e17 (patch) | |
tree | 9e22656474f0fc034de7cf317d7aa7ae22a8abe8 /src/helperfuncs.cpp | |
parent | 315cd88a911eaa327df520e8533be82efea0c66f (diff) |
Split inspircd_io.* insp inspsocket.* and configreader.* with a few odd bits going into inspircd.*, doesn't look like I've broken anything... :P
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3847 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r-- | src/helperfuncs.cpp | 45 |
1 files changed, 31 insertions, 14 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index c467172d8..3a0f39c6d 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -14,25 +14,16 @@ * --------------------------------------------------- */ -using namespace std; - +#include <stdarg.h> #include "inspircd_config.h" #include "inspircd.h" -#include "inspircd_io.h" +#include "configreader.h" #include <unistd.h> #include <fcntl.h> #include <sys/errno.h> #include <time.h> #include <string> -#ifdef GCC3 -#include <ext/hash_map> -#else -#include <hash_map> -#endif #include <sstream> -#include <vector> -#include <deque> -#include <stdarg.h> #include "connection.h" #include "users.h" #include "ctables.h" @@ -50,7 +41,7 @@ using namespace std; #include "typedefs.h" extern int MODCOUNT; -extern std::vector<Module*> modules; +extern ModuleList modules; extern ServerConfig *Config; extern InspIRCd* ServerInstance; extern time_t TIME; @@ -278,8 +269,6 @@ void WriteServ(int sock, char* text, ...) { va_list argsPtr; char textbuffer[MAXBUF]; - char tb[MAXBUF]; - int bytes; if ((sock < 0) || (sock > MAX_DESCRIPTORS)) return; @@ -1603,6 +1592,34 @@ bool AllModulesReportReady(userrec* user) return true; } +/* Make Sure Modules Are Avaliable! + * (BugFix By Craig.. See? I do work! :p) + * Modified by brain, requires const char* + * to work with other API functions + */ + +/* XXX - Needed? */ +bool FileExists (const char* file) +{ + FILE *input; + if ((input = fopen (file, "r")) == NULL) + { + return(false); + } + else + { + fclose (input); + return(true); + } +} + +char* CleanFilename(char* name) +{ + char* p = name + strlen(name); + while ((p != name) && (*p != '/')) p--; + return (p != name ? ++p : p); +} + bool DirValid(char* dirandfile) { char work[MAXBUF]; |