Mercurial > cabal
comparison sources/core.cpp @ 7:8d54d9fdeca3
fixed comments
removed daemonization verbose
strings' size() -> length()
| author | Vlad Glagolev <enqlave@gmail.com> |
|---|---|
| date | Sun, 03 Feb 2008 21:29:41 +0300 |
| parents | 0faceb076254 |
| children |
comparison
equal
deleted
inserted
replaced
| 6:9be05a31b7f9 | 7:8d54d9fdeca3 |
|---|---|
| 16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 19 */ | 19 */ |
| 20 | 20 |
| 21 #include "core.hpp" | 21 #include "cabal.hpp" // needed: core.hpp |
| 22 | 22 |
| 23 Connection *C; | 23 Connection *C; |
| 24 | 24 |
| 25 Core::Core(): | 25 Core::Core(): |
| 26 pid(PID), | 26 pid(PID), |
| 45 | 45 |
| 46 servers = 0; | 46 servers = 0; |
| 47 | 47 |
| 48 remove(pid); | 48 remove(pid); |
| 49 | 49 |
| 50 cout << "CORE: shutdown complete\n"; | 50 if (CABAL->debug) |
| 51 cout << "CORE: shutdown complete\n"; | |
| 51 } | 52 } |
| 52 | 53 |
| 53 void Core::parseCommandLine(int argc, char **argv) | 54 void Core::parseCommandLine(int argc, char **argv) |
| 54 { | 55 { |
| 55 for (int e = 1; e < argc; e++) { | 56 for (int e = 1; e < argc; e++) { |
| 80 ifstream sysconfig(config, ios::in); | 81 ifstream sysconfig(config, ios::in); |
| 81 | 82 |
| 82 if (!sysconfig) | 83 if (!sysconfig) |
| 83 shut("unable to open configuration file"); | 84 shut("unable to open configuration file"); |
| 84 else { | 85 else { |
| 85 cout << "CORE: parsing configuration file: " << config << endl; | 86 if (CABAL->debug) |
| 87 cout << "CORE: parsing configuration file: " << config << endl; | |
| 86 | 88 |
| 87 if (servers + 1 < MAX_SERVERS) { | 89 if (servers + 1 < MAX_SERVERS) { |
| 88 connections[++servers] = new Connection(); | 90 connections[++servers] = new Connection(); |
| 89 C = connections[servers]; | 91 C = connections[servers]; |
| 90 } | 92 } |
