annotate sources/headers/core.hpp @ 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 9be05a31b7f9
children
rev   line source
7
8d54d9fdeca3 fixed comments
Vlad Glagolev <enqlave@gmail.com>
parents: 6
diff changeset
1 /** core.hpp (2007-03-04)
2
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
2 *
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
3 * -- CABAL -- core header
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
4 *
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
5 * Copyright (c) 2007-2008 Vlad Glagolev <enqlave@gmail.com>
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
6 * All rights reserved.
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
7 *
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
8 * Permission to use, copy, modify, and distribute this software for any
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
9 * purpose with or without fee is hereby granted, provided that the above
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
10 * copyright notice and this permission notice appear in all copies.
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
11 *
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
19 */
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
20
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
21 #ifndef _CORE_HPP_
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
22 #define _CORE_HPP_
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
23
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
24 #define VERSION_CORE "0.0.7" // 2007-05-13
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
25
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
26 #include "engine.hpp"
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
27 #include "connection.hpp"
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
28 #include "parser.hpp"
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
29
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
30 class Core
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
31 {
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
32 public:
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
33 Core();
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
34 ~Core();
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
35
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
36 void parseCommandLine(int, char **);
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
37 void parseConfig();
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
38 void checkPID();
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
39 void writePID();
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
40
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
41 void work();
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
42
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
43 int servers;
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
44 Connection *connections[MAX_SERVERS];
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
45
6
9be05a31b7f9 Enqlave IRC Network => Vaygr IRC Network
Vlad Glagolev <enqlave@gmail.com>
parents: 5
diff changeset
46 pchar pid;
2
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
47 char *config;
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
48
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
49 char commander;
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
50
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
51 bool debug;
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
52
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
53 time_t now;
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
54 };
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
55
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
56 extern Connection *C;
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
57
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
58 #endif // _CORE_HPP_