|
2
|
1 /** |
|
|
2 * connection.hpp (2007-04-12) |
|
|
3 * |
|
|
4 * -- CABAL -- connection header |
|
|
5 * |
|
|
6 * Copyright (c) 2007-2008 Vlad Glagolev <enqlave@gmail.com> |
|
|
7 * All rights reserved. |
|
|
8 * |
|
|
9 * Permission to use, copy, modify, and distribute this software for any |
|
|
10 * purpose with or without fee is hereby granted, provided that the above |
|
|
11 * copyright notice and this permission notice appear in all copies. |
|
|
12 * |
|
|
13 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
|
|
14 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
|
|
15 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
|
|
16 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
|
|
17 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
|
|
18 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
|
|
19 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
|
|
20 */ |
|
|
21 |
|
|
22 #ifndef _CONNECTION_HPP_ |
|
|
23 #define _CONNECTION_HPP_ |
|
|
24 |
|
|
25 #include "network.hpp" |
|
|
26 |
|
|
27 class Connection |
|
|
28 : public Network |
|
|
29 { |
|
|
30 public: |
|
|
31 Connection(); |
|
|
32 ~Connection(); |
|
|
33 |
|
|
34 void ircConnect(); |
|
|
35 |
|
|
36 void ircPass(string); |
|
|
37 void ircNick(string); |
|
|
38 void ircUser(string, string); |
|
|
39 void ircAway(string); |
|
|
40 void ircJoin(string, string); |
|
|
41 void ircPart(string); |
|
|
42 void ircCycle(string); |
|
|
43 |
|
|
44 void establish(); |
|
|
45 |
|
|
46 struct host_type { |
|
|
47 pchar host; |
|
|
48 int port; |
|
|
49 pchar password; |
|
|
50 host_type *next; |
|
|
51 |
|
|
52 host_type(pchar h, int p, pchar pw): |
|
|
53 host(h), |
|
|
54 port(p), |
|
|
55 password(pw), |
|
|
56 next(this) |
|
|
57 { |
|
|
58 }; |
|
|
59 host_type(pchar h, int p, pchar pw, host_type *t): |
|
|
60 host(h), |
|
|
61 port(p), |
|
|
62 password(pw), |
|
|
63 next(t) |
|
|
64 { |
|
|
65 }; |
|
|
66 } *hosts, *current; |
|
|
67 |
|
|
68 host_type *addHost(host_type *, pchar, int, pchar); |
|
|
69 |
|
|
70 pchar virtualhost, nick, user, name, chan, key; |
|
|
71 |
|
|
72 time_t now, uptime; |
|
|
73 }; |
|
|
74 |
|
|
75 #endif // _CONNECTION_HPP_ |