File: group__dccstuff.html

package info (click to toggle)
libircclient 1.3%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 2,492 kB
  • ctags: 691
  • sloc: ansic: 2,706; cpp: 313; makefile: 132; sh: 120
file content (408 lines) | stat: -rw-r--r-- 31,394 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>libircclient: DCC chat/send requests and replies.</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>DCC chat/send requests and replies.</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef void(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dccstuff.html#g92d4d3f7866bd8c4f1d6df8f05d939f9">irc_dcc_callback_t</a> )(<a class="el" href="libircclient_8h.html#0030a976ab3e6a247d57e30fd5979cd5">irc_session_t</a> *session, <a class="el" href="libircclient_8h.html#4136d52803e88f369d728e1e3b0e70f7">irc_dcc_t</a> id, int status, void *ctx, const char *data, unsigned int length)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A common DCC callback, used to inform you about the current DCC state or event.  <a href="#g92d4d3f7866bd8c4f1d6df8f05d939f9"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dccstuff.html#gd6958aac6d67f595966949d1ec5ae4a0">irc_dcc_chat</a> (<a class="el" href="libircclient_8h.html#0030a976ab3e6a247d57e30fd5979cd5">irc_session_t</a> *session, void *ctx, const char *nick, <a class="el" href="group__dccstuff.html#g92d4d3f7866bd8c4f1d6df8f05d939f9">irc_dcc_callback_t</a> callback, <a class="el" href="libircclient_8h.html#4136d52803e88f369d728e1e3b0e70f7">irc_dcc_t</a> *dccid)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initiates a DCC CHAT.  <a href="#gd6958aac6d67f595966949d1ec5ae4a0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dccstuff.html#gb98b7ea58a36d7649c2dca6c4b3c8a7d">irc_dcc_msg</a> (<a class="el" href="libircclient_8h.html#0030a976ab3e6a247d57e30fd5979cd5">irc_session_t</a> *session, <a class="el" href="libircclient_8h.html#4136d52803e88f369d728e1e3b0e70f7">irc_dcc_t</a> dccid, const char *text)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sends the message to the specific DCC CHAT.  <a href="#gb98b7ea58a36d7649c2dca6c4b3c8a7d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dccstuff.html#g43f747d3b2252109f9d811ea8414745b">irc_dcc_accept</a> (<a class="el" href="libircclient_8h.html#0030a976ab3e6a247d57e30fd5979cd5">irc_session_t</a> *session, <a class="el" href="libircclient_8h.html#4136d52803e88f369d728e1e3b0e70f7">irc_dcc_t</a> dccid, void *ctx, <a class="el" href="group__dccstuff.html#g92d4d3f7866bd8c4f1d6df8f05d939f9">irc_dcc_callback_t</a> callback)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Accepts a remote DCC CHAT or DCC RECVFILE request.  <a href="#g43f747d3b2252109f9d811ea8414745b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dccstuff.html#g3ff4ca78d346b7acf847cf28a7211bf4">irc_dcc_decline</a> (<a class="el" href="libircclient_8h.html#0030a976ab3e6a247d57e30fd5979cd5">irc_session_t</a> *session, <a class="el" href="libircclient_8h.html#4136d52803e88f369d728e1e3b0e70f7">irc_dcc_t</a> dccid)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Declines a remote DCC CHAT or DCC RECVFILE request.  <a href="#g3ff4ca78d346b7acf847cf28a7211bf4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dccstuff.html#gf9e8a307113cd27d08e082fda6264262">irc_dcc_sendfile</a> (<a class="el" href="libircclient_8h.html#0030a976ab3e6a247d57e30fd5979cd5">irc_session_t</a> *session, void *ctx, const char *nick, const char *filename, <a class="el" href="group__dccstuff.html#g92d4d3f7866bd8c4f1d6df8f05d939f9">irc_dcc_callback_t</a> callback, <a class="el" href="libircclient_8h.html#4136d52803e88f369d728e1e3b0e70f7">irc_dcc_t</a> *dccid)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sends a file via DCC.  <a href="#gf9e8a307113cd27d08e082fda6264262"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dccstuff.html#g8b8aa3363ee93cc395bc89ac5cc9501c">irc_dcc_destroy</a> (<a class="el" href="libircclient_8h.html#0030a976ab3e6a247d57e30fd5979cd5">irc_session_t</a> *session, <a class="el" href="libircclient_8h.html#4136d52803e88f369d728e1e3b0e70f7">irc_dcc_t</a> dccid)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destroys a DCC session.  <a href="#g8b8aa3363ee93cc395bc89ac5cc9501c"></a><br></td></tr>
</table>
<hr><h2>Typedef Documentation</h2>
<a class="anchor" name="g92d4d3f7866bd8c4f1d6df8f05d939f9"></a><!-- doxytag: member="libircclient.h::irc_dcc_callback_t" ref="g92d4d3f7866bd8c4f1d6df8f05d939f9" args=")(irc_session_t *session, irc_dcc_t id, int status, void *ctx, const char *data, unsigned int length)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void(* <a class="el" href="group__dccstuff.html#g92d4d3f7866bd8c4f1d6df8f05d939f9">irc_dcc_callback_t</a>)(<a class="el" href="libircclient_8h.html#0030a976ab3e6a247d57e30fd5979cd5">irc_session_t</a> *session, <a class="el" href="libircclient_8h.html#4136d52803e88f369d728e1e3b0e70f7">irc_dcc_t</a> id, int status, void *ctx, const char *data, unsigned int length)          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
A common DCC callback, used to inform you about the current DCC state or event. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>session</em>&nbsp;</td><td>An IRC session which generates the callback </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>A DCC session id. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>status</em>&nbsp;</td><td>An error status. 0 means no error, otherwise error code. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>ctx</em>&nbsp;</td><td>A user-supplied context. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>data</em>&nbsp;</td><td>Data supplied (if available) </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>length</em>&nbsp;</td><td>data length (if available)</td></tr>
  </table>
</dl>
This callback is called for all DCC functions when state change occurs.<p>
For DCC CHAT, the callback is called in next circumstances:<ul>
<li><em>status</em> is LIBIRC_ERR_CLOSED: connection is closed by remote peer. After returning from the callback, the DCC session is automatically destroyed.</li><li><em>status</em> is neither 0 nor LIBIRC_ERR_CLOSED: socket I/O error (connect error, accept error, recv error, send error). After returning from the callback, the DCC session is automatically destroyed.</li><li><em>status</em> is 0: new chat message received, <em>data</em> contains the message (null-terminated string), <em>length</em> contains the message length.</li></ul>
<p>
For DCC SEND, while file is sending, callback called in next circumstances:<ul>
<li><em>status</em> is neither 0 nor LIBIRC_ERR_CLOSED: socket I/O error (connect error, accept error, recv error, send error). After returning from the callback, the DCC session is automatically destroyed.</li><li><em>status</em> is 0: new data received, <em>data</em> contains the data received, <em>length</em> contains the amount of data received.</li></ul>
<p>
For DCC RECV, while file is sending, callback called in next circumstances:<ul>
<li><em>status</em> is neither 0 nor LIBIRC_ERR_CLOSED: socket I/O error (connect error, accept error, recv error, send error). After returning from the callback, the DCC session is automatically destroyed.</li><li><em>status</em> is 0, and <em>data</em> is 0: file has been received successfully. After returning from the callback, the DCC session is automatically destroyed.</li><li><em>status</em> is 0, and <em>data</em> is not 0: new data received, <em>data</em> contains the data received, <em>length</em> contains the amount of data received. </li></ul>

</div>
</div><p>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="g43f747d3b2252109f9d811ea8414745b"></a><!-- doxytag: member="libircclient.h::irc_dcc_accept" ref="g43f747d3b2252109f9d811ea8414745b" args="(irc_session_t *session, irc_dcc_t dccid, void *ctx, irc_dcc_callback_t callback)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int irc_dcc_accept           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="libircclient_8h.html#0030a976ab3e6a247d57e30fd5979cd5">irc_session_t</a> *&nbsp;</td>
          <td class="paramname"> <em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="libircclient_8h.html#4136d52803e88f369d728e1e3b0e70f7">irc_dcc_t</a>&nbsp;</td>
          <td class="paramname"> <em>dccid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__dccstuff.html#g92d4d3f7866bd8c4f1d6df8f05d939f9">irc_dcc_callback_t</a>&nbsp;</td>
          <td class="paramname"> <em>callback</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Accepts a remote DCC CHAT or DCC RECVFILE request. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>session</em>&nbsp;</td><td>An initiated and connected session. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>dccid</em>&nbsp;</td><td>A DCC session ID, returned by appropriate callback. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>ctx</em>&nbsp;</td><td>A user-supplied DCC session context, which will be passed to the DCC callback function. May be NULL. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>callback</em>&nbsp;</td><td>A DCC callback function, which will be called when anything is said by other party. Must not be NULL.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Return code 0 means success. Other value means error, the error code may be obtained through <a class="el" href="group__errors.html#g3a18336093ee74751244d996bc32247d" title="Returns the last error code.">irc_errno()</a>.</dd></dl>
This function accepts a remote DCC request - either DCC CHAT or DCC FILE. After the request is accepted, the supplied callback will be called, and you can start sending messages or receiving the file.<p>
This function should be called only after either event_dcc_chat_req or event_dcc_send_req events are generated, and should react to them. It is possible not to call irc_dcc_accept or irc_dcc_decline immediately in callback function - you may just return, and call it later. However, to prevent memory leaks, you must call either irc_dcc_decline or irc_dcc_accept for any incoming DCC request.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__dccstuff.html#g3ff4ca78d346b7acf847cf28a7211bf4" title="Declines a remote DCC CHAT or DCC RECVFILE request.">irc_dcc_decline</a> event_dcc_chat_req event_dcc_send_req </dd></dl>

</div>
</div><p>
<a class="anchor" name="gd6958aac6d67f595966949d1ec5ae4a0"></a><!-- doxytag: member="libircclient.h::irc_dcc_chat" ref="gd6958aac6d67f595966949d1ec5ae4a0" args="(irc_session_t *session, void *ctx, const char *nick, irc_dcc_callback_t callback, irc_dcc_t *dccid)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int irc_dcc_chat           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="libircclient_8h.html#0030a976ab3e6a247d57e30fd5979cd5">irc_session_t</a> *&nbsp;</td>
          <td class="paramname"> <em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>nick</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__dccstuff.html#g92d4d3f7866bd8c4f1d6df8f05d939f9">irc_dcc_callback_t</a>&nbsp;</td>
          <td class="paramname"> <em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="libircclient_8h.html#4136d52803e88f369d728e1e3b0e70f7">irc_dcc_t</a> *&nbsp;</td>
          <td class="paramname"> <em>dccid</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Initiates a DCC CHAT. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>session</em>&nbsp;</td><td>An initiated and connected session. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>ctx</em>&nbsp;</td><td>A user-supplied DCC session context, which will be passed to the DCC callback function. May be NULL. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>nick</em>&nbsp;</td><td>A nick to DCC CHAT with. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>callback</em>&nbsp;</td><td>A DCC callback function, which will be called when anything is said by other party. Must not be NULL. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>dccid</em>&nbsp;</td><td>On success, DCC session ID will be stored in this var.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Return code 0 means success. Other value means error, the error code may be obtained through <a class="el" href="group__errors.html#g3a18336093ee74751244d996bc32247d" title="Returns the last error code.">irc_errno()</a>. Any error, generated by the IRC server, is available through <a class="el" href="structirc__callbacks__t.html#85951d45acff22aea37a822bb9c7aef7">irc_callbacks_t::event_numeric</a>.</dd></dl>
This function requests a DCC CHAT between you and other user. For newbies, DCC chat is like private chat, but it goes directly between two users, and bypasses IRC server. DCC CHAT request must be accepted by other side before you can send anything.<p>
When the chat is accepted, terminated, or some data is received, the callback function is called. See the details in irc_dcc_callback_t declaration.<p>
Possible error responces for this command from the RFC1459:<ul>
<li><a class="el" href="group__rfcnumbers.html#g73d5c17577fddd176f2d89e15b657c1a" title="411 :No recipient given (&lt;command&gt;)">LIBIRC_RFC_ERR_NORECIPIENT</a></li><li><a class="el" href="group__rfcnumbers.html#gc9851022435108cc6074c8cab2311b58" title="412 :No text to send">LIBIRC_RFC_ERR_NOTEXTTOSEND</a></li><li><a class="el" href="group__rfcnumbers.html#g3624990fe128d867c11b213228e62df8" title="404 &lt;channel name&gt; :Cannot send to channel">LIBIRC_RFC_ERR_CANNOTSENDTOCHAN</a></li><li><a class="el" href="group__rfcnumbers.html#gb20af2b80994d5c9d7c1e96d88f2e577" title="442 &lt;channel&gt; :You&#39;re not on that channel">LIBIRC_RFC_ERR_NOTONCHANNEL</a></li><li><a class="el" href="group__rfcnumbers.html#gfcad763cc97b268aa585311350989dca" title="413 &lt;mask&gt; :No toplevel domain specified">LIBIRC_RFC_ERR_NOTOPLEVEL</a></li><li><a class="el" href="group__rfcnumbers.html#g4cf5ceeec3305180731860436650c955" title="414 &lt;mask&gt; :Wildcard in toplevel domain">LIBIRC_RFC_ERR_WILDTOPLEVEL</a></li><li><a class="el" href="group__rfcnumbers.html#g807eab621113410281fd574de71236ea" title="407 &lt;target&gt; :&lt;error code&gt; recipients. &lt;abort message&gt;">LIBIRC_RFC_ERR_TOOMANYTARGETS</a></li><li><a class="el" href="group__rfcnumbers.html#g28f90d5f34a3056127516c0edc7c511f" title="401 &lt;nickname&gt; :No such nick/channel">LIBIRC_RFC_ERR_NOSUCHNICK</a></li></ul>
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__dccstuff.html#g92d4d3f7866bd8c4f1d6df8f05d939f9" title="A common DCC callback, used to inform you about the current DCC state or event.">irc_dcc_callback_t</a> <a class="el" href="group__dccstuff.html#gb98b7ea58a36d7649c2dca6c4b3c8a7d" title="Sends the message to the specific DCC CHAT.">irc_dcc_msg</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="g3ff4ca78d346b7acf847cf28a7211bf4"></a><!-- doxytag: member="libircclient.h::irc_dcc_decline" ref="g3ff4ca78d346b7acf847cf28a7211bf4" args="(irc_session_t *session, irc_dcc_t dccid)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int irc_dcc_decline           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="libircclient_8h.html#0030a976ab3e6a247d57e30fd5979cd5">irc_session_t</a> *&nbsp;</td>
          <td class="paramname"> <em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="libircclient_8h.html#4136d52803e88f369d728e1e3b0e70f7">irc_dcc_t</a>&nbsp;</td>
          <td class="paramname"> <em>dccid</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Declines a remote DCC CHAT or DCC RECVFILE request. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>session</em>&nbsp;</td><td>An initiated and connected session. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>dccid</em>&nbsp;</td><td>A DCC session ID, returned by appropriate callback.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Return code 0 means success. Other value means error, the error code may be obtained through <a class="el" href="group__errors.html#g3a18336093ee74751244d996bc32247d" title="Returns the last error code.">irc_errno()</a>.</dd></dl>
This function declines a remote DCC request - either DCC CHAT or DCC FILE.<p>
This function should be called only after either event_dcc_chat_req or event_dcc_send_req events are generated, and should react to them. It is possible not to call irc_dcc_accept or irc_dcc_decline immediately in callback function - you may just return, and call it later. However, to prevent memory leaks, you must call either irc_dcc_decline or irc_dcc_accept for any incoming DCC request.<p>
Do not use this function to close the accepted or initiated DCC session. Use irc_dcc_destroy instead.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__dccstuff.html#g43f747d3b2252109f9d811ea8414745b" title="Accepts a remote DCC CHAT or DCC RECVFILE request.">irc_dcc_accept</a> <a class="el" href="structirc__callbacks__t.html#fbaf019778a64b544093ee29da5b3c81">irc_callbacks_t::event_dcc_chat_req</a> <a class="el" href="structirc__callbacks__t.html#2ac9d08921faee2472ed16d41799887d">irc_callbacks_t::event_dcc_send_req</a> <a class="el" href="group__dccstuff.html#g8b8aa3363ee93cc395bc89ac5cc9501c" title="Destroys a DCC session.">irc_dcc_destroy</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="g8b8aa3363ee93cc395bc89ac5cc9501c"></a><!-- doxytag: member="libircclient.h::irc_dcc_destroy" ref="g8b8aa3363ee93cc395bc89ac5cc9501c" args="(irc_session_t *session, irc_dcc_t dccid)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int irc_dcc_destroy           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="libircclient_8h.html#0030a976ab3e6a247d57e30fd5979cd5">irc_session_t</a> *&nbsp;</td>
          <td class="paramname"> <em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="libircclient_8h.html#4136d52803e88f369d728e1e3b0e70f7">irc_dcc_t</a>&nbsp;</td>
          <td class="paramname"> <em>dccid</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Destroys a DCC session. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>session</em>&nbsp;</td><td>An initiated and connected session. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>dccid</em>&nbsp;</td><td>A DCC session ID.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Return code 0 means success. Other value means error, the error code may be obtained through <a class="el" href="group__errors.html#g3a18336093ee74751244d996bc32247d" title="Returns the last error code.">irc_errno()</a>.</dd></dl>
This function closes the DCC connection (if available), and destroys the DCC session, freeing the used resources. It can be called in any moment, even from callbacks or from different threads.<p>
Note that when DCC session is finished (either with success or failure), you should not destroy it - it will be destroyed automatically. 
</div>
</div><p>
<a class="anchor" name="gb98b7ea58a36d7649c2dca6c4b3c8a7d"></a><!-- doxytag: member="libircclient.h::irc_dcc_msg" ref="gb98b7ea58a36d7649c2dca6c4b3c8a7d" args="(irc_session_t *session, irc_dcc_t dccid, const char *text)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int irc_dcc_msg           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="libircclient_8h.html#0030a976ab3e6a247d57e30fd5979cd5">irc_session_t</a> *&nbsp;</td>
          <td class="paramname"> <em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="libircclient_8h.html#4136d52803e88f369d728e1e3b0e70f7">irc_dcc_t</a>&nbsp;</td>
          <td class="paramname"> <em>dccid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>text</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Sends the message to the specific DCC CHAT. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>session</em>&nbsp;</td><td>An IRC session. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>dccid</em>&nbsp;</td><td>A DCC session ID, which chat request must have been accepted. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>text</em>&nbsp;</td><td>Message text. Must not be NULL.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Return code 0 means success. Other value means error, the error code may be obtained through <a class="el" href="group__errors.html#g3a18336093ee74751244d996bc32247d" title="Returns the last error code.">irc_errno()</a>.</dd></dl>
This function is used to send the DCC CHAT messages. DCC CHAT request must be initiated and accepted first (or just accepted, if initiated by other side).<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__dccstuff.html#gd6958aac6d67f595966949d1ec5ae4a0" title="Initiates a DCC CHAT.">irc_dcc_chat</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="gf9e8a307113cd27d08e082fda6264262"></a><!-- doxytag: member="libircclient.h::irc_dcc_sendfile" ref="gf9e8a307113cd27d08e082fda6264262" args="(irc_session_t *session, void *ctx, const char *nick, const char *filename, irc_dcc_callback_t callback, irc_dcc_t *dccid)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int irc_dcc_sendfile           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="libircclient_8h.html#0030a976ab3e6a247d57e30fd5979cd5">irc_session_t</a> *&nbsp;</td>
          <td class="paramname"> <em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>nick</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>filename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__dccstuff.html#g92d4d3f7866bd8c4f1d6df8f05d939f9">irc_dcc_callback_t</a>&nbsp;</td>
          <td class="paramname"> <em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="libircclient_8h.html#4136d52803e88f369d728e1e3b0e70f7">irc_dcc_t</a> *&nbsp;</td>
          <td class="paramname"> <em>dccid</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Sends a file via DCC. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>session</em>&nbsp;</td><td>An initiated and connected session. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>ctx</em>&nbsp;</td><td>A user-supplied DCC session context, which will be passed to the DCC callback function. May be NULL. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>nick</em>&nbsp;</td><td>A nick to send file via DCC to. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>filename</em>&nbsp;</td><td>A file name to sent. Must be an existing file. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>callback</em>&nbsp;</td><td>A DCC callback function, which will be called when file sent operation is failed, progressed or completed. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>dccid</em>&nbsp;</td><td>On success, DCC session ID will be stored in this var.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Return code 0 means success. Other value means error, the error code may be obtained through <a class="el" href="group__errors.html#g3a18336093ee74751244d996bc32247d" title="Returns the last error code.">irc_errno()</a>. Any error, generated by the IRC server, is available through <a class="el" href="structirc__callbacks__t.html#85951d45acff22aea37a822bb9c7aef7">irc_callbacks_t::event_numeric</a>.</dd></dl>
This function generates a DCC SEND request to send the file. When it is accepted, the file is sent to the remote party, and the DCC session is closed. The send operation progress and result can be checked in callback. See the details in irc_dcc_callback_t declaration.<p>
Possible error responces for this command from the RFC1459:<ul>
<li><a class="el" href="group__rfcnumbers.html#g73d5c17577fddd176f2d89e15b657c1a" title="411 :No recipient given (&lt;command&gt;)">LIBIRC_RFC_ERR_NORECIPIENT</a></li><li><a class="el" href="group__rfcnumbers.html#gc9851022435108cc6074c8cab2311b58" title="412 :No text to send">LIBIRC_RFC_ERR_NOTEXTTOSEND</a></li><li><a class="el" href="group__rfcnumbers.html#g3624990fe128d867c11b213228e62df8" title="404 &lt;channel name&gt; :Cannot send to channel">LIBIRC_RFC_ERR_CANNOTSENDTOCHAN</a></li><li><a class="el" href="group__rfcnumbers.html#gb20af2b80994d5c9d7c1e96d88f2e577" title="442 &lt;channel&gt; :You&#39;re not on that channel">LIBIRC_RFC_ERR_NOTONCHANNEL</a></li><li><a class="el" href="group__rfcnumbers.html#gfcad763cc97b268aa585311350989dca" title="413 &lt;mask&gt; :No toplevel domain specified">LIBIRC_RFC_ERR_NOTOPLEVEL</a></li><li><a class="el" href="group__rfcnumbers.html#g4cf5ceeec3305180731860436650c955" title="414 &lt;mask&gt; :Wildcard in toplevel domain">LIBIRC_RFC_ERR_WILDTOPLEVEL</a></li><li><a class="el" href="group__rfcnumbers.html#g807eab621113410281fd574de71236ea" title="407 &lt;target&gt; :&lt;error code&gt; recipients. &lt;abort message&gt;">LIBIRC_RFC_ERR_TOOMANYTARGETS</a></li><li><a class="el" href="group__rfcnumbers.html#g28f90d5f34a3056127516c0edc7c511f" title="401 &lt;nickname&gt; :No such nick/channel">LIBIRC_RFC_ERR_NOSUCHNICK</a></li></ul>
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__dccstuff.html#g92d4d3f7866bd8c4f1d6df8f05d939f9" title="A common DCC callback, used to inform you about the current DCC state or event.">irc_dcc_callback_t</a> </dd></dl>

</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sat Jan 3 15:01:06 2009 for libircclient by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>