summaryrefslogtreecommitdiff
path: root/src/inspircd_io.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-07 17:26:30 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-07 17:26:30 +0000
commitb040f1c1a6b3140024a2eab0174415c0763ed6ae (patch)
tree38d09b749d99881279e2ceaf075631fdf3eb191f /src/inspircd_io.cpp
parentbd4c18aa1554e4fec0913b3c5f742080cbf0eab4 (diff)
Added preliminary support for ConfigReader::Verify at request of the slug :p
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@419 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd_io.cpp')
-rw-r--r--src/inspircd_io.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp
index 65597704f..bb78c2c4b 100644
--- a/src/inspircd_io.cpp
+++ b/src/inspircd_io.cpp
@@ -105,8 +105,12 @@ int DaemonSeed (void)
/* Make Sure Modules Are Avaliable!
- * (BugFix By Craig.. See? I do work! :p) */
-int FileExists (char* file)
+ * (BugFix By Craig.. See? I do work! :p)
+ * Modified by brain, requires const char*
+ * to work with other API functions
+ */
+
+bool FileExists (const char* file)
{
FILE *input;
@@ -115,9 +119,13 @@ int FileExists (char* file)
}
-void LoadConf(const char* filename, std::stringstream *target)
+bool LoadConf(const char* filename, std::stringstream *target)
{
FILE* conf = fopen(filename,"r");
+ if (!FileExists(filename))
+ {
+ return false;
+ }
char buffer[MAXBUF];
if (conf)
{
@@ -138,6 +146,7 @@ void LoadConf(const char* filename, std::stringstream *target)
fclose(conf);
}
target->seekg(0);
+ return true;
}
/* Counts the number of tags of a certain type within the config file, e.g. to enumerate opers */