|
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 |
|
5
|
27 class Connection: public Network |
|
2
|
28 { |
|
|
29 public: |
|
|
30 Connection(); |
|
|
31 ~Connection(); |
|
|
32 |
|
|
33 void ircConnect(); |
|
|
34 |
|
|
35 void ircPass(string); |
|
|
36 void ircNick(string); |
|
|
37 void ircUser(string, string); |
|
|
38 void ircAway(string); |
|
|
39 void ircJoin(string, string); |
|
|
40 void ircPart(string); |
|
|
41 void ircCycle(string); |
|
|
42 |
|
|
43 void establish(); |
|
|
44 |
|
|
45 struct host_type { |
|
|
46 pchar host; |
|
|
47 int port; |
|
|
48 pchar password; |
|
|
49 host_type *next; |
|
|
50 |
|
|
51 host_type(pchar h, int p, pchar pw): |
|
|
52 host(h), |
|
|
53 port(p), |
|
|
54 password(pw), |
|
|
55 next(this) |
|
|
56 { |
|
|
57 }; |
|
|
58 host_type(pchar h, int p, pchar pw, host_type *t): |
|
|
59 host(h), |
|
|
60 port(p), |
|
|
61 password(pw), |
|
|
62 next(t) |
|
|
63 { |
|
|
64 }; |
|
|
65 } *hosts, *current; |
|
|
66 |
|
|
67 host_type *addHost(host_type *, pchar, int, pchar); |
|
|
68 |
|
|
69 pchar virtualhost, nick, user, name, chan, key; |
|
|
70 |
|
|
71 time_t now, uptime; |
|
|
72 }; |
|
|
73 |
|
|
74 #endif // _CONNECTION_HPP_ |