-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuffer__compat_8h.html
274 lines (259 loc) · 16.2 KB
/
buffer__compat_8h.html
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libevent: event2/buffer_compat.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">libevent
 <span id="projectnumber">2.2.1</span>
</div>
<div id="projectbrief">Event notification library</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_db160b4728e6067cf5f9cc14ec42c79d.html">event2</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#define-members">Macros</a> |
<a href="#typedef-members">Typedefs</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">buffer_compat.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Obsolete and deprecated versions of the functions in <a class="el" href="buffer_8h.html" title="Functions for buffering data for network sending or receiving.">buffer.h</a>: provided only for backward compatibility.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include <event2/visibility.h></code><br />
</div>
<p><a href="buffer__compat_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a1c57a451c56dc1483a1c8aaeb9b92cc6"><td class="memItemLeft" align="right" valign="top"><a id="a1c57a451c56dc1483a1c8aaeb9b92cc6"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer__compat_8h.html#a1c57a451c56dc1483a1c8aaeb9b92cc6">EVBUFFER_DATA</a>(x)   <a class="el" href="buffer_8h.html#acd73ca99c3a793ea26c43307b9723bd6">evbuffer_pullup</a>((x), -1)</td></tr>
<tr class="memdesc:a1c57a451c56dc1483a1c8aaeb9b92cc6"><td class="mdescLeft"> </td><td class="mdescRight">deprecated in favor of calling the functions directly <br /></td></tr>
<tr class="separator:a1c57a451c56dc1483a1c8aaeb9b92cc6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab8d9564980e380cf1887f2be70f687ad"><td class="memItemLeft" align="right" valign="top"><a id="ab8d9564980e380cf1887f2be70f687ad"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer__compat_8h.html#ab8d9564980e380cf1887f2be70f687ad">EVBUFFER_LENGTH</a>(x)   <a class="el" href="buffer_8h.html#a808db707e84e20229b2aafdcaba6c708">evbuffer_get_length</a>(x)</td></tr>
<tr class="memdesc:ab8d9564980e380cf1887f2be70f687ad"><td class="mdescLeft"> </td><td class="mdescRight">deprecated in favor of calling the functions directly <br /></td></tr>
<tr class="separator:ab8d9564980e380cf1887f2be70f687ad"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a6df4ae9e3d819c487ded545d2e1d41b0"><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer__compat_8h.html#a6df4ae9e3d819c487ded545d2e1d41b0">evbuffer_cb</a>) (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer, size_t old_len, size_t new_len, void *arg)</td></tr>
<tr class="memdesc:a6df4ae9e3d819c487ded545d2e1d41b0"><td class="mdescLeft"> </td><td class="mdescRight">Type definition for a callback that is invoked whenever data is added or removed from an evbuffer. <a href="buffer__compat_8h.html#a6df4ae9e3d819c487ded545d2e1d41b0">More...</a><br /></td></tr>
<tr class="separator:a6df4ae9e3d819c487ded545d2e1d41b0"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:af44d0b893f624295a4eeb5da8bbca100"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL unsigned char * </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer__compat_8h.html#af44d0b893f624295a4eeb5da8bbca100">evbuffer_find</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer, const unsigned char *what, size_t len)</td></tr>
<tr class="memdesc:af44d0b893f624295a4eeb5da8bbca100"><td class="mdescLeft"> </td><td class="mdescRight">Find a string within an evbuffer. <a href="buffer__compat_8h.html#af44d0b893f624295a4eeb5da8bbca100">More...</a><br /></td></tr>
<tr class="separator:af44d0b893f624295a4eeb5da8bbca100"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4fea308404ec34c5daeec61f5e05bc08"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL char * </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer__compat_8h.html#a4fea308404ec34c5daeec61f5e05bc08">evbuffer_readline</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer)</td></tr>
<tr class="memdesc:a4fea308404ec34c5daeec61f5e05bc08"><td class="mdescLeft"> </td><td class="mdescRight">Obsolete alias for evbuffer_readln(buffer, NULL, EVBUFFER_EOL_ANY). <a href="buffer__compat_8h.html#a4fea308404ec34c5daeec61f5e05bc08">More...</a><br /></td></tr>
<tr class="separator:a4fea308404ec34c5daeec61f5e05bc08"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aaae25109e21cb9f7417922592ed495a4"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer__compat_8h.html#aaae25109e21cb9f7417922592ed495a4">evbuffer_setcb</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer, <a class="el" href="buffer__compat_8h.html#a6df4ae9e3d819c487ded545d2e1d41b0">evbuffer_cb</a> cb, void *cbarg)</td></tr>
<tr class="memdesc:aaae25109e21cb9f7417922592ed495a4"><td class="mdescLeft"> </td><td class="mdescRight">Replace all callbacks on an evbuffer with a single new callback, or remove them. <a href="buffer__compat_8h.html#aaae25109e21cb9f7417922592ed495a4">More...</a><br /></td></tr>
<tr class="separator:aaae25109e21cb9f7417922592ed495a4"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Obsolete and deprecated versions of the functions in <a class="el" href="buffer_8h.html" title="Functions for buffering data for network sending or receiving.">buffer.h</a>: provided only for backward compatibility. </p>
</div><h2 class="groupheader">Typedef Documentation</h2>
<a id="a6df4ae9e3d819c487ded545d2e1d41b0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6df4ae9e3d819c487ded545d2e1d41b0">◆ </a></span>evbuffer_cb</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* evbuffer_cb) (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer, size_t old_len, size_t new_len, void *arg)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Type definition for a callback that is invoked whenever data is added or removed from an evbuffer. </p>
<p>An evbuffer may have one or more callbacks set at a time. The order in which they are executed is undefined.</p>
<p>A callback function may add more callbacks, or remove itself from the list of callbacks, or add or remove data from the buffer. It may not remove another callback from the list.</p>
<p>If a callback adds or removes data from the buffer or from another buffer, this can cause a recursive invocation of your callback or other callbacks. If you ask for an infinite loop, you might just get one: watch out!</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">buffer</td><td>the buffer whose size has changed </td></tr>
<tr><td class="paramname">old_len</td><td>the previous length of the buffer </td></tr>
<tr><td class="paramname">new_len</td><td>the current length of the buffer </td></tr>
<tr><td class="paramname">arg</td><td>a pointer to user data </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="af44d0b893f624295a4eeb5da8bbca100"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af44d0b893f624295a4eeb5da8bbca100">◆ </a></span>evbuffer_find()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL unsigned char* evbuffer_find </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structevbuffer.html">evbuffer</a> * </td>
<td class="paramname"><em>buffer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const unsigned char * </td>
<td class="paramname"><em>what</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>len</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Find a string within an evbuffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">buffer</td><td>the evbuffer to be searched </td></tr>
<tr><td class="paramname">what</td><td>the string to be searched for </td></tr>
<tr><td class="paramname">len</td><td>the length of the search string </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a pointer to the beginning of the search string, or NULL if the search failed. </dd></dl>
</div>
</div>
<a id="a4fea308404ec34c5daeec61f5e05bc08"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4fea308404ec34c5daeec61f5e05bc08">◆ </a></span>evbuffer_readline()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL char* evbuffer_readline </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structevbuffer.html">evbuffer</a> * </td>
<td class="paramname"><em>buffer</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Obsolete alias for evbuffer_readln(buffer, NULL, EVBUFFER_EOL_ANY). </p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000001">Deprecated:</a></b></dt><dd>This function is deprecated because its behavior is not correct for almost any protocol, and also because it's wholly subsumed by <a class="el" href="buffer_8h.html#a8bcc94903283574331994c9364be3d7b" title="Read a single line from an evbuffer.">evbuffer_readln()</a>.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">buffer</td><td>the evbuffer to read from </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>pointer to a single line, or NULL if an error occurred </dd></dl>
</div>
</div>
<a id="aaae25109e21cb9f7417922592ed495a4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaae25109e21cb9f7417922592ed495a4">◆ </a></span>evbuffer_setcb()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL int evbuffer_setcb </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structevbuffer.html">evbuffer</a> * </td>
<td class="paramname"><em>buffer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="buffer__compat_8h.html#a6df4ae9e3d819c487ded545d2e1d41b0">evbuffer_cb</a> </td>
<td class="paramname"><em>cb</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"><em>cbarg</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Replace all callbacks on an evbuffer with a single new callback, or remove them. </p>
<p>Subsequent calls to <a class="el" href="buffer__compat_8h.html#aaae25109e21cb9f7417922592ed495a4" title="Replace all callbacks on an evbuffer with a single new callback, or remove them.">evbuffer_setcb()</a> replace callbacks set by previous calls. Setting the callback to NULL removes any previously set callback.</p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000002">Deprecated:</a></b></dt><dd>This function is deprecated because it clears all previous callbacks set on the evbuffer, which can cause confusing behavior if multiple parts of the code all want to add their own callbacks on a buffer. Instead, use <a class="el" href="buffer_8h.html#a8abedc30187fe00d86b7b1cc4d3ce643" title="Append data to the end of an evbuffer.">evbuffer_add()</a>, evbuffer_del(), and evbuffer_setflags() to manage your own evbuffer callbacks without interfering with callbacks set by others.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">buffer</td><td>the evbuffer to be monitored </td></tr>
<tr><td class="paramname">cb</td><td>the callback function to invoke when the evbuffer is modified, or NULL to remove all callbacks. </td></tr>
<tr><td class="paramname">cbarg</td><td>an argument to be provided to the callback function </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 on error </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>