#define _global_\r
\r
#include <vector>\r
-//#include <zthread/Thread.h>\r
#include "pthreadwrapper/thread.h"\r
\r
-#define FMS_VERSION "0.2.2"\r
+#define FMS_VERSION "0.2.3"\r
\r
// opens database and creates tables and initial inserts if necessary\r
void SetupDB();\r
void MainFunction();\r
void Shutdown();\r
\r
-//void StartThreads(std::vector<PThread::Thread *> &threads);\r
-//void ShutdownThreads(std::vector<PThread::Thread *> &threads);\r
-\r
// needed for Windows to setup network\r
void SetupNetwork();\r
// cleanup network on Windows\r
exit(0);\r
}\r
\r
-/*\r
-void ShutdownThreads(std::vector<PThread::Thread *> &threads)\r
-{\r
- std::vector<PThread::Thread *>::iterator i;\r
- for(i=threads.begin(); i!=threads.end(); i++)\r
- {\r
- (*i)->Cancel();\r
- }\r
-\r
- for(i=threads.begin(); i!=threads.end(); i++)\r
- {\r
- LogFile::Instance()->WriteLog(LogFile::LOGLEVEL_DEBUG,"ShutdownThreads waiting for thread to exit.");\r
- //(*i)->wait();\r
- (*i)->Join();\r
- delete (*i);\r
- }\r
-\r
- threads.clear();\r
-\r
-}\r
-\r
-void StartThreads(std::vector<PThread::Thread *> &threads)\r
-{\r
- std::string startfreenet;\r
- std::string startnntp;\r
- std::string starthttp;\r
-\r
- if(Option::Instance()->Get("StartFreenetUpdater",startfreenet)==false)\r
- {\r
- startfreenet="true";\r
- Option::Instance()->Set("StartFreenetUpdater","true");\r
- }\r
-\r
- if(Option::Instance()->Get("StartNNTP",startnntp)==false)\r
- {\r
- startnntp="true";\r
- Option::Instance()->Set("StartNNTP","true");\r
- }\r
-\r
- if(Option::Instance()->Get("StartHTTP",starthttp)==false)\r
- {\r
- starthttp="true";\r
- Option::Instance()->Set("StartHTTP","true");\r
- }\r
-\r
- if(startfreenet=="true")\r
- {\r
- PThread::Thread *t=new PThread::Thread(new FreenetMasterThread());\r
- threads.push_back(t);\r
- }\r
-\r
- if(startnntp=="true")\r
- {\r
- PThread::Thread *t=new PThread::Thread(new NNTPListener());\r
- threads.push_back(t);\r
- }\r
-\r
- if(starthttp=="true")\r
- {\r
- PThread::Thread *t=new PThread::Thread(new HTTPThread());\r
- threads.push_back(t);\r
- }\r
-\r
-}\r
-*/\r
-\r
void FixCapitalBoardNames()\r
{\r
SQLite3DB::DB *db=SQLite3DB::DB::Instance();\r