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