author | Tero Marttila <terom@fixme.fi> |
Thu, 28 May 2009 01:17:36 +0300 | |
branch | new-lib-errors |
changeset 219 | cefec18b8268 |
parent 217 | 7728d6ec3abf |
permissions | -rw-r--r-- |
25
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
1 |
#ifndef IRC_NET_H |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
2 |
#define IRC_NET_H |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
3 |
|
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
4 |
/** |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
5 |
* @file |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
6 |
* |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
7 |
* Support for IRC networks. This is similar to an IRC connection, but we keep track of channel state, and handle |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
8 |
* reconnects. |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
9 |
*/ |
72
43084f103c2a
add irc_user module for irc_chan to track users on a channel
Tero Marttila <terom@fixme.fi>
parents:
65
diff
changeset
|
10 |
|
43084f103c2a
add irc_user module for irc_chan to track users on a channel
Tero Marttila <terom@fixme.fi>
parents:
65
diff
changeset
|
11 |
struct irc_net; |
43084f103c2a
add irc_user module for irc_chan to track users on a channel
Tero Marttila <terom@fixme.fi>
parents:
65
diff
changeset
|
12 |
|
25
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
13 |
#include "irc_conn.h" |
26 | 14 |
#include "irc_chan.h" |
219
cefec18b8268
some of the lib/transport stuff compiles
Tero Marttila <terom@fixme.fi>
parents:
217
diff
changeset
|
15 |
#include <lib/error.h> |
cefec18b8268
some of the lib/transport stuff compiles
Tero Marttila <terom@fixme.fi>
parents:
217
diff
changeset
|
16 |
#include <lib/ssl.h> |
26 | 17 |
#include <sys/queue.h> |
25
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
18 |
|
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
19 |
/** |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
20 |
* Configuration info for an IRC network |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
21 |
*/ |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
22 |
struct irc_net_info { |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
23 |
/** The name of the network */ |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
24 |
const char *network; |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
25 |
|
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
26 |
/** The hostname to connect to */ |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
27 |
const char *hostname; |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
28 |
|
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
29 |
/** Service name (port) */ |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
30 |
const char *service; |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
31 |
|
140
aa390e52eda8
implement ssl_cafile/verify/cert/pkey for x509 credentials
Tero Marttila <terom@fixme.fi>
parents:
98
diff
changeset
|
32 |
/** Use SSL if given as non-NULL, a reference will be held by the irc_net */ |
180
22967b165692
rename sock_ssl/sock_gnutls -> ssl/ssl_client
Tero Marttila <terom@fixme.fi>
parents:
156
diff
changeset
|
33 |
struct ssl_client_cred *ssl_cred; |
25
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
34 |
|
86
5e7e64544cb7
some irc_net code to use said async connects
Tero Marttila <terom@fixme.fi>
parents:
74
diff
changeset
|
35 |
/** Protocol registration info (nickname etc) */ |
27
e6639132bead
add irc_conn_callbacks, and delay irc_chan_join until on_registered
Tero Marttila <terom@fixme.fi>
parents:
26
diff
changeset
|
36 |
struct irc_conn_register_info register_info; |
44 | 37 |
|
156
6534a4ac957b
add transport/sock/line_proto/etc code compiles
Tero Marttila <terom@fixme.fi>
parents:
153
diff
changeset
|
38 |
/** Alternatively, raw transport to use, mainly for testing purposes */ |
6534a4ac957b
add transport/sock/line_proto/etc code compiles
Tero Marttila <terom@fixme.fi>
parents:
153
diff
changeset
|
39 |
transport_t *transport; |
25
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
40 |
}; |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
41 |
|
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
42 |
/** |
86
5e7e64544cb7
some irc_net code to use said async connects
Tero Marttila <terom@fixme.fi>
parents:
74
diff
changeset
|
43 |
* The persistent IRC network state. This includes the "current" connection (which may change over time), the |
5e7e64544cb7
some irc_net code to use said async connects
Tero Marttila <terom@fixme.fi>
parents:
74
diff
changeset
|
44 |
* identifying info, the list of channels and their state, etc. |
5e7e64544cb7
some irc_net code to use said async connects
Tero Marttila <terom@fixme.fi>
parents:
74
diff
changeset
|
45 |
* |
5e7e64544cb7
some irc_net code to use said async connects
Tero Marttila <terom@fixme.fi>
parents:
74
diff
changeset
|
46 |
* This handles the irc_conn's messages, and propagates relevant messages to the appropriate irc_chan |
5e7e64544cb7
some irc_net code to use said async connects
Tero Marttila <terom@fixme.fi>
parents:
74
diff
changeset
|
47 |
* (using irc_chan::handlers). This includes NICK/QUIT events for users on said channel. |
5e7e64544cb7
some irc_net code to use said async connects
Tero Marttila <terom@fixme.fi>
parents:
74
diff
changeset
|
48 |
* |
5e7e64544cb7
some irc_net code to use said async connects
Tero Marttila <terom@fixme.fi>
parents:
74
diff
changeset
|
49 |
* For NICK events, the event is propagated *before* updating irc_user::nickname. |
5e7e64544cb7
some irc_net code to use said async connects
Tero Marttila <terom@fixme.fi>
parents:
74
diff
changeset
|
50 |
* |
5e7e64544cb7
some irc_net code to use said async connects
Tero Marttila <terom@fixme.fi>
parents:
74
diff
changeset
|
51 |
* XXX: needs some callbacks |
25
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
52 |
*/ |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
53 |
struct irc_net { |
86
5e7e64544cb7
some irc_net code to use said async connects
Tero Marttila <terom@fixme.fi>
parents:
74
diff
changeset
|
54 |
/** The current connection */ |
25
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
55 |
struct irc_conn *conn; |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
56 |
|
53
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
48
diff
changeset
|
57 |
/** Our connection info */ |
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
48
diff
changeset
|
58 |
struct irc_net_info info; |
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
48
diff
changeset
|
59 |
|
153
d35e7cb3a489
implement irc_net reconnect, requires testing
Tero Marttila <terom@fixme.fi>
parents:
140
diff
changeset
|
60 |
/** Are we currently connecting? */ |
d35e7cb3a489
implement irc_net reconnect, requires testing
Tero Marttila <terom@fixme.fi>
parents:
140
diff
changeset
|
61 |
bool connecting; |
d35e7cb3a489
implement irc_net reconnect, requires testing
Tero Marttila <terom@fixme.fi>
parents:
140
diff
changeset
|
62 |
|
d35e7cb3a489
implement irc_net reconnect, requires testing
Tero Marttila <terom@fixme.fi>
parents:
140
diff
changeset
|
63 |
/** Are we connected? */ |
d35e7cb3a489
implement irc_net reconnect, requires testing
Tero Marttila <terom@fixme.fi>
parents:
140
diff
changeset
|
64 |
bool connected; |
d35e7cb3a489
implement irc_net reconnect, requires testing
Tero Marttila <terom@fixme.fi>
parents:
140
diff
changeset
|
65 |
|
d35e7cb3a489
implement irc_net reconnect, requires testing
Tero Marttila <terom@fixme.fi>
parents:
140
diff
changeset
|
66 |
/** Succesfull connect time */ |
d35e7cb3a489
implement irc_net reconnect, requires testing
Tero Marttila <terom@fixme.fi>
parents:
140
diff
changeset
|
67 |
time_t connected_ts; |
d35e7cb3a489
implement irc_net reconnect, requires testing
Tero Marttila <terom@fixme.fi>
parents:
140
diff
changeset
|
68 |
|
26 | 69 |
/** The list of IRC channel states */ |
70 |
TAILQ_HEAD(irc_net_chan_list, irc_chan) channels; |
|
53
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
48
diff
changeset
|
71 |
|
72
43084f103c2a
add irc_user module for irc_chan to track users on a channel
Tero Marttila <terom@fixme.fi>
parents:
65
diff
changeset
|
72 |
/** Our set of valid irc_user items for use with irc_chan */ |
43084f103c2a
add irc_user module for irc_chan to track users on a channel
Tero Marttila <terom@fixme.fi>
parents:
65
diff
changeset
|
73 |
LIST_HEAD(irc_net_users_list, irc_user) users; |
43084f103c2a
add irc_user module for irc_chan to track users on a channel
Tero Marttila <terom@fixme.fi>
parents:
65
diff
changeset
|
74 |
|
153
d35e7cb3a489
implement irc_net reconnect, requires testing
Tero Marttila <terom@fixme.fi>
parents:
140
diff
changeset
|
75 |
/** Reconnect timer */ |
d35e7cb3a489
implement irc_net reconnect, requires testing
Tero Marttila <terom@fixme.fi>
parents:
140
diff
changeset
|
76 |
struct event *reconnect_timer; |
d35e7cb3a489
implement irc_net reconnect, requires testing
Tero Marttila <terom@fixme.fi>
parents:
140
diff
changeset
|
77 |
|
53
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
48
diff
changeset
|
78 |
/** The irc_client list */ |
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
48
diff
changeset
|
79 |
TAILQ_ENTRY(irc_net) client_networks; |
25
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
80 |
}; |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
81 |
|
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
82 |
/** |
86
5e7e64544cb7
some irc_net code to use said async connects
Tero Marttila <terom@fixme.fi>
parents:
74
diff
changeset
|
83 |
* Return the network's name, as per irc_net_info::network |
72
43084f103c2a
add irc_user module for irc_chan to track users on a channel
Tero Marttila <terom@fixme.fi>
parents:
65
diff
changeset
|
84 |
*/ |
43084f103c2a
add irc_user module for irc_chan to track users on a channel
Tero Marttila <terom@fixme.fi>
parents:
65
diff
changeset
|
85 |
const char* irc_net_name (struct irc_net *net); |
43084f103c2a
add irc_user module for irc_chan to track users on a channel
Tero Marttila <terom@fixme.fi>
parents:
65
diff
changeset
|
86 |
|
43084f103c2a
add irc_user module for irc_chan to track users on a channel
Tero Marttila <terom@fixme.fi>
parents:
65
diff
changeset
|
87 |
/** |
25
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
88 |
* Create a new IRC network state, using the given network info to connect/register. |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
89 |
* |
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
90 |
* Errors are returned via *err, also returning the error code. |
26 | 91 |
* |
98
f357f835f0d5
add irc_client_defaults to apply default values for irc_client_add_net irc_net_info, implement --defaults cmd opt and lua_client_connect
Tero Marttila <terom@fixme.fi>
parents:
86
diff
changeset
|
92 |
* The irc_net_info struct itself is copied, but the strings contained therein are not... |
f357f835f0d5
add irc_client_defaults to apply default values for irc_client_add_net irc_net_info, implement --defaults cmd opt and lua_client_connect
Tero Marttila <terom@fixme.fi>
parents:
86
diff
changeset
|
93 |
* |
26 | 94 |
* @param net the new irc_net struct is returned via this pointer |
86
5e7e64544cb7
some irc_net code to use said async connects
Tero Marttila <terom@fixme.fi>
parents:
74
diff
changeset
|
95 |
* @param info network information, used to connect and register |
65
d7508879ad01
add --module support, and tweak irc_net docs
Tero Marttila <terom@fixme.fi>
parents:
63
diff
changeset
|
96 |
* @param err return error info |
25
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
97 |
*/ |
217 | 98 |
err_t irc_net_create (struct irc_net **net, const struct irc_net_info *info, error_t *err); |
25
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
99 |
|
26 | 100 |
/** |
47
7d4094eb3117
add irc_net_destroy and fix code to be valgrind-clean on bin/test
Tero Marttila <terom@fixme.fi>
parents:
44
diff
changeset
|
101 |
* Destroy an irc_net state without closing anything cleanly. This destroys the irc_conn, if any, and any irc_chans as |
7d4094eb3117
add irc_net_destroy and fix code to be valgrind-clean on bin/test
Tero Marttila <terom@fixme.fi>
parents:
44
diff
changeset
|
102 |
* well. |
7d4094eb3117
add irc_net_destroy and fix code to be valgrind-clean on bin/test
Tero Marttila <terom@fixme.fi>
parents:
44
diff
changeset
|
103 |
*/ |
7d4094eb3117
add irc_net_destroy and fix code to be valgrind-clean on bin/test
Tero Marttila <terom@fixme.fi>
parents:
44
diff
changeset
|
104 |
void irc_net_destroy (struct irc_net *net); |
7d4094eb3117
add irc_net_destroy and fix code to be valgrind-clean on bin/test
Tero Marttila <terom@fixme.fi>
parents:
44
diff
changeset
|
105 |
|
7d4094eb3117
add irc_net_destroy and fix code to be valgrind-clean on bin/test
Tero Marttila <terom@fixme.fi>
parents:
44
diff
changeset
|
106 |
/** |
27
e6639132bead
add irc_conn_callbacks, and delay irc_chan_join until on_registered
Tero Marttila <terom@fixme.fi>
parents:
26
diff
changeset
|
107 |
* Create a new irc_chan and add it to our channel list. |
e6639132bead
add irc_conn_callbacks, and delay irc_chan_join until on_registered
Tero Marttila <terom@fixme.fi>
parents:
26
diff
changeset
|
108 |
* |
86
5e7e64544cb7
some irc_net code to use said async connects
Tero Marttila <terom@fixme.fi>
parents:
74
diff
changeset
|
109 |
* If we are connected and registered, join the channel right away, otherwise, join it once we register. |
65
d7508879ad01
add --module support, and tweak irc_net docs
Tero Marttila <terom@fixme.fi>
parents:
63
diff
changeset
|
110 |
* |
d7508879ad01
add --module support, and tweak irc_net docs
Tero Marttila <terom@fixme.fi>
parents:
63
diff
changeset
|
111 |
* @param net the irc_net the channel is on |
86
5e7e64544cb7
some irc_net code to use said async connects
Tero Marttila <terom@fixme.fi>
parents:
74
diff
changeset
|
112 |
* @param chan_ptr return the new irc_chan via this, if given |
65
d7508879ad01
add --module support, and tweak irc_net docs
Tero Marttila <terom@fixme.fi>
parents:
63
diff
changeset
|
113 |
* @param info the info required to identify and join the channel |
d7508879ad01
add --module support, and tweak irc_net docs
Tero Marttila <terom@fixme.fi>
parents:
63
diff
changeset
|
114 |
* @param err return error info |
26 | 115 |
*/ |
217 | 116 |
err_t irc_net_add_chan (struct irc_net *net, struct irc_chan **chan_ptr, const struct irc_chan_info *info, error_t *err); |
26 | 117 |
|
118 |
/** |
|
119 |
* Look up an existing irc_chan by name, returning NULL if not found. |
|
120 |
* |
|
72
43084f103c2a
add irc_user module for irc_chan to track users on a channel
Tero Marttila <terom@fixme.fi>
parents:
65
diff
changeset
|
121 |
* @param net the network context |
26 | 122 |
* @param channel the channel name |
123 |
*/ |
|
124 |
struct irc_chan* irc_net_get_chan (struct irc_net *net, const char *channel); |
|
125 |
||
48
4841f4398fd2
add irc_net_quit and signal handling
Tero Marttila <terom@fixme.fi>
parents:
47
diff
changeset
|
126 |
/** |
72
43084f103c2a
add irc_user module for irc_chan to track users on a channel
Tero Marttila <terom@fixme.fi>
parents:
65
diff
changeset
|
127 |
* Look up an existing irc_user by nickname, or create a new one if not found. |
43084f103c2a
add irc_user module for irc_chan to track users on a channel
Tero Marttila <terom@fixme.fi>
parents:
65
diff
changeset
|
128 |
* |
74
11ec458d1cbf
add irc_chan_on_PART, irc_net_put_user and test_irc_chan_user_part
Tero Marttila <terom@fixme.fi>
parents:
72
diff
changeset
|
129 |
* This will increment the reference count on the irc_user object, so do call irc_net_put_user once you're done with |
11ec458d1cbf
add irc_chan_on_PART, irc_net_put_user and test_irc_chan_user_part
Tero Marttila <terom@fixme.fi>
parents:
72
diff
changeset
|
130 |
* it, or you'll get reference-counting bugs... |
11ec458d1cbf
add irc_chan_on_PART, irc_net_put_user and test_irc_chan_user_part
Tero Marttila <terom@fixme.fi>
parents:
72
diff
changeset
|
131 |
* |
72
43084f103c2a
add irc_user module for irc_chan to track users on a channel
Tero Marttila <terom@fixme.fi>
parents:
65
diff
changeset
|
132 |
* @param user_ptr set to the new irc_user state |
43084f103c2a
add irc_user module for irc_chan to track users on a channel
Tero Marttila <terom@fixme.fi>
parents:
65
diff
changeset
|
133 |
* @param net the network context |
43084f103c2a
add irc_user module for irc_chan to track users on a channel
Tero Marttila <terom@fixme.fi>
parents:
65
diff
changeset
|
134 |
* @param nickname the user's current nickname |
43084f103c2a
add irc_user module for irc_chan to track users on a channel
Tero Marttila <terom@fixme.fi>
parents:
65
diff
changeset
|
135 |
*/ |
43084f103c2a
add irc_user module for irc_chan to track users on a channel
Tero Marttila <terom@fixme.fi>
parents:
65
diff
changeset
|
136 |
err_t irc_net_get_user (struct irc_net *net, struct irc_user **user_ptr, const char *nickname); |
43084f103c2a
add irc_user module for irc_chan to track users on a channel
Tero Marttila <terom@fixme.fi>
parents:
65
diff
changeset
|
137 |
|
43084f103c2a
add irc_user module for irc_chan to track users on a channel
Tero Marttila <terom@fixme.fi>
parents:
65
diff
changeset
|
138 |
/** |
74
11ec458d1cbf
add irc_chan_on_PART, irc_net_put_user and test_irc_chan_user_part
Tero Marttila <terom@fixme.fi>
parents:
72
diff
changeset
|
139 |
* Release a previously get'd irc_user, decrementing its refcount and destroying it if unused. |
11ec458d1cbf
add irc_chan_on_PART, irc_net_put_user and test_irc_chan_user_part
Tero Marttila <terom@fixme.fi>
parents:
72
diff
changeset
|
140 |
*/ |
11ec458d1cbf
add irc_chan_on_PART, irc_net_put_user and test_irc_chan_user_part
Tero Marttila <terom@fixme.fi>
parents:
72
diff
changeset
|
141 |
void irc_net_put_user (struct irc_net *net, struct irc_user *user); |
11ec458d1cbf
add irc_chan_on_PART, irc_net_put_user and test_irc_chan_user_part
Tero Marttila <terom@fixme.fi>
parents:
72
diff
changeset
|
142 |
|
11ec458d1cbf
add irc_chan_on_PART, irc_net_put_user and test_irc_chan_user_part
Tero Marttila <terom@fixme.fi>
parents:
72
diff
changeset
|
143 |
/** |
48
4841f4398fd2
add irc_net_quit and signal handling
Tero Marttila <terom@fixme.fi>
parents:
47
diff
changeset
|
144 |
* Quit from the IRC network, this sends a QUIT message to the server, and waits for the connection to be closed cleanly. |
86
5e7e64544cb7
some irc_net code to use said async connects
Tero Marttila <terom@fixme.fi>
parents:
74
diff
changeset
|
145 |
* |
5e7e64544cb7
some irc_net code to use said async connects
Tero Marttila <terom@fixme.fi>
parents:
74
diff
changeset
|
146 |
* XXX: nothing to indicate completion |
48
4841f4398fd2
add irc_net_quit and signal handling
Tero Marttila <terom@fixme.fi>
parents:
47
diff
changeset
|
147 |
*/ |
4841f4398fd2
add irc_net_quit and signal handling
Tero Marttila <terom@fixme.fi>
parents:
47
diff
changeset
|
148 |
err_t irc_net_quit (struct irc_net *net, const char *message); |
4841f4398fd2
add irc_net_quit and signal handling
Tero Marttila <terom@fixme.fi>
parents:
47
diff
changeset
|
149 |
|
25
56367df4ce5b
add irc_net module, and fix Makefile CFLAGS, add -Wextra
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
150 |
#endif |