summaryrefslogtreecommitdiff
path: root/src/modules.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-04-25 03:16:57 -0400
committerAdam <Adam@anope.org>2011-05-16 04:07:56 -0400
commit076ebafa1b4cc935c466c615b94eaac415af9a67 (patch)
treedbc8b0f9e7b6f954569c13ad35598f5ebe8a081d /src/modules.cpp
parent6922bd239c778e8f6f2081476ce20b9426c515ad (diff)
Moved some global functions to be member functions and misc cleanup
Diffstat (limited to 'src/modules.cpp')
-rw-r--r--src/modules.cpp100
1 files changed, 0 insertions, 100 deletions
diff --git a/src/modules.cpp b/src/modules.cpp
index cebe58987..3e62cd2fb 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -179,106 +179,6 @@ int Module::DelCommand(BotInfo *bi, Command *c)
return MOD_ERR_OK;
}
-
-/*******************************************************************************
- * Module Callback Functions
- *******************************************************************************/
-
- /* Check the current version of anope against a given version number
- * Specifiying -1 for minor,patch or build
- * @param major The major version of anope, the first part of the verison number
- * @param minor The minor version of anope, the second part of the version number
- * @param patch The patch version of anope, the third part of the version number
- * @param build The build revision of anope from SVN
- * @return True if the version newer than the version specified.
- **/
-bool moduleMinVersion(int major, int minor, int patch, int build)
-{
- bool ret = false;
- if (Anope::VersionMajor() > major) /* Def. new */
- ret = true;
- else if (Anope::VersionMajor() == major) /* Might be newer */
- {
- if (minor == -1)
- return true; /* They dont care about minor */
- if (Anope::VersionMinor() > minor) /* Def. newer */
- ret = true;
- else if (Anope::VersionMinor() == minor) /* Might be newer */
- {
- if (patch == -1)
- return true; /* They dont care about patch */
- if (Anope::VersionPatch() > patch)
- ret = true;
- else if (Anope::VersionPatch() == patch)
- {
-#if 0
-// XXX
- if (build == -1)
- return true; /* They dont care about build */
- if (Anope::VersionBuild >= build)
- ret = true;
-#endif
- }
- }
- }
- return ret;
-}
-
-void ModuleRunTimeDirCleanUp()
-{
- Anope::string dirbuf = services_dir + "/modules/runtime";
-
- Log(LOG_DEBUG) << "Cleaning out Module run time directory (" << dirbuf << ") - this may take a moment please wait";
-
-#ifndef _WIN32
- DIR *dirp = opendir(dirbuf.c_str());
- if (!dirp)
- {
- Log(LOG_DEBUG) << "Cannot open directory (" << dirbuf << ")";
- return;
- }
- struct dirent *dp;
- while ((dp = readdir(dirp)))
- {
- if (!dp->d_ino)
- continue;
- if (Anope::string(dp->d_name).equals_cs(".") || Anope::string(dp->d_name).equals_cs(".."))
- continue;
- Anope::string filebuf = dirbuf + "/" + dp->d_name;
- DeleteFile(filebuf.c_str());
- }
- closedir(dirp);
-#else
- Anope::string szDir = dirbuf + "/*";
-
- WIN32_FIND_DATA FileData;
- HANDLE hList = FindFirstFile(szDir.c_str(), &FileData);
- if (hList != INVALID_HANDLE_VALUE)
- {
- bool fFinished = false;
- while (!fFinished)
- {
- if (!(FileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
- {
- Anope::string filebuf = dirbuf + "/" + FileData.cFileName;
- if (!DeleteFile(filebuf.c_str()))
- Log(LOG_DEBUG) << "Error deleting file " << filebuf << " - GetLastError() reports " << Anope::LastError();
- }
- if (!FindNextFile(hList, &FileData))
- {
- if (GetLastError() == ERROR_NO_MORE_FILES)
- fFinished = true;
- }
- }
- }
- else
- Log(LOG_DEBUG) << "Invalid File Handle. GetLastError() reports "<< static_cast<int>(GetLastError());
-
- FindClose(hList);
-#endif
- Log(LOG_DEBUG) << "Module run time directory has been cleaned out";
-}
-
void Module::SendMessage(CommandSource &source, const char *fmt, ...)
{
Anope::string language = (source.u && source.u->Account() ? source.u->Account()->language : "");