-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuffer_8h.html
2729 lines (2546 loc) · 162 KB
/
buffer_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
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
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!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.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="#nested-classes">Data Structures</a> |
<a href="#define-members">Macros</a> |
<a href="#typedef-members">Typedefs</a> |
<a href="#enum-members">Enumerations</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">buffer.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Functions for buffering data for network sending or receiving.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include <event2/visibility.h></code><br />
<code>#include <event2/event-config.h></code><br />
<code>#include <stdarg.h></code><br />
<code>#include <<a class="el" href="util_8h_source.html">event2/util.h</a>></code><br />
</div>
<p><a href="buffer_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="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structevbuffer.html">evbuffer</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">An evbuffer is an opaque data type for efficiently buffering data to be sent or received on the network. <a href="structevbuffer.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structevbuffer__cb__info.html">evbuffer_cb_info</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Structure passed to an evbuffer_cb_func evbuffer callback. <a href="structevbuffer__cb__info.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structevbuffer__iovec.html">evbuffer_iovec</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Describes a single extent of memory inside an evbuffer. <a href="structevbuffer__iovec.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structevbuffer__ptr.html">evbuffer_ptr</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Pointer to a position within an evbuffer. <a href="structevbuffer__ptr.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a647759a5dec0745de7b17aefc928e3d6"><td class="memItemLeft" align="right" valign="top"><a id="a647759a5dec0745de7b17aefc928e3d6"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a647759a5dec0745de7b17aefc928e3d6">EVBUF_FS_CLOSE_ON_FREE</a>   0x01</td></tr>
<tr class="memdesc:a647759a5dec0745de7b17aefc928e3d6"><td class="mdescLeft"> </td><td class="mdescRight">Flag for creating evbuffer_file_segment: If this flag is set, then when the evbuffer_file_segment is freed and no longer in use by any evbuffer, the underlying fd is closed. <br /></td></tr>
<tr class="separator:a647759a5dec0745de7b17aefc928e3d6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad9d19b50a501babad4cbe7f0f9a42691"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#ad9d19b50a501babad4cbe7f0f9a42691">EVBUF_FS_DISABLE_LOCKING</a>   0x08</td></tr>
<tr class="memdesc:ad9d19b50a501babad4cbe7f0f9a42691"><td class="mdescLeft"> </td><td class="mdescRight">Flag for creating evbuffer_file_segment: Do not allocate a lock for this segment. <a href="buffer_8h.html#ad9d19b50a501babad4cbe7f0f9a42691">More...</a><br /></td></tr>
<tr class="separator:ad9d19b50a501babad4cbe7f0f9a42691"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0749ba245d15e70bc99cee90a3d02ac9"><td class="memItemLeft" align="right" valign="top"><a id="a0749ba245d15e70bc99cee90a3d02ac9"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a0749ba245d15e70bc99cee90a3d02ac9">EVBUF_FS_DISABLE_MMAP</a>   0x02</td></tr>
<tr class="memdesc:a0749ba245d15e70bc99cee90a3d02ac9"><td class="mdescLeft"> </td><td class="mdescRight">Flag for creating evbuffer_file_segment: Disable memory-map based implementations. <br /></td></tr>
<tr class="separator:a0749ba245d15e70bc99cee90a3d02ac9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a553dd6c9a5cbbc112ffe32401cacd705"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a553dd6c9a5cbbc112ffe32401cacd705">EVBUF_FS_DISABLE_SENDFILE</a>   0x04</td></tr>
<tr class="memdesc:a553dd6c9a5cbbc112ffe32401cacd705"><td class="mdescLeft"> </td><td class="mdescRight">Flag for creating evbuffer_file_segment: Disable direct fd-to-fd implementations (sendfile). <a href="buffer_8h.html#a553dd6c9a5cbbc112ffe32401cacd705">More...</a><br /></td></tr>
<tr class="separator:a553dd6c9a5cbbc112ffe32401cacd705"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aeb635643a72f8e57d50d7dee37308148"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#aeb635643a72f8e57d50d7dee37308148">EVBUFFER_CB_ENABLED</a>   1</td></tr>
<tr class="memdesc:aeb635643a72f8e57d50d7dee37308148"><td class="mdescLeft"> </td><td class="mdescRight">If this flag is not set, then a callback is temporarily disabled, and should not be invoked. <a href="buffer_8h.html#aeb635643a72f8e57d50d7dee37308148">More...</a><br /></td></tr>
<tr class="separator:aeb635643a72f8e57d50d7dee37308148"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0d9db8b232ebf8d63c660ec429981e91"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a0d9db8b232ebf8d63c660ec429981e91">EVBUFFER_FLAG_DRAINS_TO_FD</a>   1</td></tr>
<tr class="memdesc:a0d9db8b232ebf8d63c660ec429981e91"><td class="mdescLeft"> </td><td class="mdescRight">If this flag is set, then we will not use <a class="el" href="buffer_8h.html#aad7c208f2afca3e7e46a1a95fb79eec1" title="Function to peek at data inside an evbuffer without removing it or copying it out.">evbuffer_peek()</a>, <a class="el" href="buffer_8h.html#aa53da314581de5e13bb0d92aa05e2301" title="Read data from an evbuffer and drain the bytes read.">evbuffer_remove()</a>, <a class="el" href="buffer_8h.html#a863342bdbdb4f91d0415ae29ef25494b" title="Read data from an evbuffer into another evbuffer, draining the bytes from the source buffer.">evbuffer_remove_buffer()</a>, and so on to read bytes from this buffer: we'll only take bytes out of this buffer by writing them to the network (as with evbuffer_write_atmost), by removing them without observing them (as with evbuffer_drain), or by copying them all out at once (as with evbuffer_add_buffer). <a href="buffer_8h.html#a0d9db8b232ebf8d63c660ec429981e91">More...</a><br /></td></tr>
<tr class="separator:a0d9db8b232ebf8d63c660ec429981e91"><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:a8f16422514b698553f34c0eba180f3fa"><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a8f16422514b698553f34c0eba180f3fa">evbuffer_cb_func</a>) (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer, const struct <a class="el" href="structevbuffer__cb__info.html">evbuffer_cb_info</a> *info, void *arg)</td></tr>
<tr class="memdesc:a8f16422514b698553f34c0eba180f3fa"><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_8h.html#a8f16422514b698553f34c0eba180f3fa">More...</a><br /></td></tr>
<tr class="separator:a8f16422514b698553f34c0eba180f3fa"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa0e56a17ff87cf097011902b80dd53bf"><td class="memItemLeft" align="right" valign="top"><a id="aa0e56a17ff87cf097011902b80dd53bf"></a>
typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#aa0e56a17ff87cf097011902b80dd53bf">evbuffer_file_segment_cleanup_cb</a>) (struct evbuffer_file_segment const *seg, int flags, void *arg)</td></tr>
<tr class="memdesc:aa0e56a17ff87cf097011902b80dd53bf"><td class="mdescLeft"> </td><td class="mdescRight">A cleanup function for a evbuffer_file_segment added to an evbuffer for reference. <br /></td></tr>
<tr class="separator:aa0e56a17ff87cf097011902b80dd53bf"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a66c442353fa5159e2acd808794fa92d6"><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a66c442353fa5159e2acd808794fa92d6">evbuffer_ref_cleanup_cb</a>) (const void *data, size_t datalen, void *extra)</td></tr>
<tr class="memdesc:a66c442353fa5159e2acd808794fa92d6"><td class="mdescLeft"> </td><td class="mdescRight">A cleanup function for a piece of memory added to an evbuffer by reference. <a href="buffer_8h.html#a66c442353fa5159e2acd808794fa92d6">More...</a><br /></td></tr>
<tr class="separator:a66c442353fa5159e2acd808794fa92d6"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ad8daf54669a1d2094ce4251dbb502178"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#ad8daf54669a1d2094ce4251dbb502178">evbuffer_eol_style</a> { <br />
  <a class="el" href="buffer_8h.html#ad8daf54669a1d2094ce4251dbb502178ab7c6da1408b1b2ec3a6657e5a71a50c3">EVBUFFER_EOL_ANY</a>,
<a class="el" href="buffer_8h.html#ad8daf54669a1d2094ce4251dbb502178a4aec5353e85fbb57ce3b1ee68f36f641">EVBUFFER_EOL_CRLF</a>,
<a class="el" href="buffer_8h.html#ad8daf54669a1d2094ce4251dbb502178a814775b4a9773d34421e7e88ca8c58de">EVBUFFER_EOL_CRLF_STRICT</a>,
<a class="el" href="buffer_8h.html#ad8daf54669a1d2094ce4251dbb502178ac572ea90e5a96a7ceb878f2a8ef48993">EVBUFFER_EOL_LF</a>,
<br />
  <a class="el" href="buffer_8h.html#ad8daf54669a1d2094ce4251dbb502178a7b93c5a9f595c62c9d016562356159b7">EVBUFFER_EOL_NUL</a>
<br />
}</td></tr>
<tr class="memdesc:ad8daf54669a1d2094ce4251dbb502178"><td class="mdescLeft"> </td><td class="mdescRight">Used to tell evbuffer_readln what kind of line-ending to look for. <a href="buffer_8h.html#ad8daf54669a1d2094ce4251dbb502178">More...</a><br /></td></tr>
<tr class="separator:ad8daf54669a1d2094ce4251dbb502178"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a13a9ee759900ce2964d16acd5f309014"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a13a9ee759900ce2964d16acd5f309014">evbuffer_ptr_how</a> { <a class="el" href="buffer_8h.html#a13a9ee759900ce2964d16acd5f309014a78a0ff3721ff5f1647f743dcfb2f13ee">EVBUFFER_PTR_SET</a>,
<a class="el" href="buffer_8h.html#a13a9ee759900ce2964d16acd5f309014a0bce00d78b5fbc55c478ff362269f428">EVBUFFER_PTR_ADD</a>
}</td></tr>
<tr class="memdesc:a13a9ee759900ce2964d16acd5f309014"><td class="mdescLeft"> </td><td class="mdescRight">Defines how to adjust an <a class="el" href="structevbuffer__ptr.html" title="Pointer to a position within an evbuffer.">evbuffer_ptr</a> by <a class="el" href="buffer_8h.html#a22137a538067a8450d52af0e6601ca49" title="Sets the search pointer in the buffer to position.">evbuffer_ptr_set()</a> <a href="buffer_8h.html#a13a9ee759900ce2964d16acd5f309014">More...</a><br /></td></tr>
<tr class="separator:a13a9ee759900ce2964d16acd5f309014"><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:a8abedc30187fe00d86b7b1cc4d3ce643"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a8abedc30187fe00d86b7b1cc4d3ce643">evbuffer_add</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf, const void *data, size_t datlen)</td></tr>
<tr class="memdesc:a8abedc30187fe00d86b7b1cc4d3ce643"><td class="mdescLeft"> </td><td class="mdescRight">Append data to the end of an evbuffer. <a href="buffer_8h.html#a8abedc30187fe00d86b7b1cc4d3ce643">More...</a><br /></td></tr>
<tr class="separator:a8abedc30187fe00d86b7b1cc4d3ce643"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af95837e510c03d5e5fcf9c05db019f14"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#af95837e510c03d5e5fcf9c05db019f14">evbuffer_add_buffer</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *outbuf, struct <a class="el" href="structevbuffer.html">evbuffer</a> *inbuf)</td></tr>
<tr class="memdesc:af95837e510c03d5e5fcf9c05db019f14"><td class="mdescLeft"> </td><td class="mdescRight">Move all data from one evbuffer into another evbuffer. <a href="buffer_8h.html#af95837e510c03d5e5fcf9c05db019f14">More...</a><br /></td></tr>
<tr class="separator:af95837e510c03d5e5fcf9c05db019f14"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a60aa7eb8766fcbeadc17f722a095c624"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a60aa7eb8766fcbeadc17f722a095c624">evbuffer_add_buffer_reference</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *outbuf, struct <a class="el" href="structevbuffer.html">evbuffer</a> *inbuf)</td></tr>
<tr class="memdesc:a60aa7eb8766fcbeadc17f722a095c624"><td class="mdescLeft"> </td><td class="mdescRight">Copy data from one evbuffer into another evbuffer. <a href="buffer_8h.html#a60aa7eb8766fcbeadc17f722a095c624">More...</a><br /></td></tr>
<tr class="separator:a60aa7eb8766fcbeadc17f722a095c624"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3885fb5ca54eff0778916183f58a9c25"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL struct evbuffer_cb_entry * </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a3885fb5ca54eff0778916183f58a9c25">evbuffer_add_cb</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer, <a class="el" href="buffer_8h.html#a8f16422514b698553f34c0eba180f3fa">evbuffer_cb_func</a> cb, void *cbarg)</td></tr>
<tr class="memdesc:a3885fb5ca54eff0778916183f58a9c25"><td class="mdescLeft"> </td><td class="mdescRight">Add a new callback to an evbuffer. <a href="buffer_8h.html#a3885fb5ca54eff0778916183f58a9c25">More...</a><br /></td></tr>
<tr class="separator:a3885fb5ca54eff0778916183f58a9c25"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a601996b1fc1f5c165dc62b89acbd069e"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a601996b1fc1f5c165dc62b89acbd069e">evbuffer_add_file</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *outbuf, int fd, ev_off_t offset, ev_off_t length)</td></tr>
<tr class="memdesc:a601996b1fc1f5c165dc62b89acbd069e"><td class="mdescLeft"> </td><td class="mdescRight">Copy data from a file into the evbuffer for writing to a socket. <a href="buffer_8h.html#a601996b1fc1f5c165dc62b89acbd069e">More...</a><br /></td></tr>
<tr class="separator:a601996b1fc1f5c165dc62b89acbd069e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a300f9e6d1db3d6f834284c47fc77e1bc"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a300f9e6d1db3d6f834284c47fc77e1bc">evbuffer_add_file_segment</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf, struct evbuffer_file_segment *seg, ev_off_t offset, ev_off_t length)</td></tr>
<tr class="memdesc:a300f9e6d1db3d6f834284c47fc77e1bc"><td class="mdescLeft"> </td><td class="mdescRight">Insert some or all of an evbuffer_file_segment at the end of an evbuffer. <a href="buffer_8h.html#a300f9e6d1db3d6f834284c47fc77e1bc">More...</a><br /></td></tr>
<tr class="separator:a300f9e6d1db3d6f834284c47fc77e1bc"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acd12f9e37353ed2b72d6a1cc2064f998"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#acd12f9e37353ed2b72d6a1cc2064f998">evbuffer_add_iovec</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer, struct <a class="el" href="structevbuffer__iovec.html">evbuffer_iovec</a> *vec, int n_vec)</td></tr>
<tr class="memdesc:acd12f9e37353ed2b72d6a1cc2064f998"><td class="mdescLeft"> </td><td class="mdescRight">Append data from 1 or more iovec's to an evbuffer. <a href="buffer_8h.html#acd12f9e37353ed2b72d6a1cc2064f998">More...</a><br /></td></tr>
<tr class="separator:acd12f9e37353ed2b72d6a1cc2064f998"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abd34b7bd9e698e15f868bf05fa6abc59"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#abd34b7bd9e698e15f868bf05fa6abc59">evbuffer_add_printf</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf, const char *fmt,...)</td></tr>
<tr class="memdesc:abd34b7bd9e698e15f868bf05fa6abc59"><td class="mdescLeft"> </td><td class="mdescRight">Append a formatted string to the end of an evbuffer. <a href="buffer_8h.html#abd34b7bd9e698e15f868bf05fa6abc59">More...</a><br /></td></tr>
<tr class="separator:abd34b7bd9e698e15f868bf05fa6abc59"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a35e99b5370b59b0c0b391ada3a59befe"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a35e99b5370b59b0c0b391ada3a59befe">evbuffer_add_reference</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *outbuf, const void *data, size_t datlen, <a class="el" href="buffer_8h.html#a66c442353fa5159e2acd808794fa92d6">evbuffer_ref_cleanup_cb</a> cleanupfn, void *cleanupfn_arg)</td></tr>
<tr class="memdesc:a35e99b5370b59b0c0b391ada3a59befe"><td class="mdescLeft"> </td><td class="mdescRight">Reference memory into an evbuffer without copying. <a href="buffer_8h.html#a35e99b5370b59b0c0b391ada3a59befe">More...</a><br /></td></tr>
<tr class="separator:a35e99b5370b59b0c0b391ada3a59befe"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abf2b931577be86b72418252207ca221b"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#abf2b931577be86b72418252207ca221b">evbuffer_add_reference_with_offset</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *outbuf, const void *data, size_t offset, size_t datlen, <a class="el" href="buffer_8h.html#a66c442353fa5159e2acd808794fa92d6">evbuffer_ref_cleanup_cb</a> cleanupfn, void *cleanupfn_arg)</td></tr>
<tr class="memdesc:abf2b931577be86b72418252207ca221b"><td class="mdescLeft"> </td><td class="mdescRight">Reference memory into an evbuffer without copying. <a href="buffer_8h.html#abf2b931577be86b72418252207ca221b">More...</a><br /></td></tr>
<tr class="separator:abf2b931577be86b72418252207ca221b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abb5d7931c7be6b2bde597cbb9b6dc72d"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#abb5d7931c7be6b2bde597cbb9b6dc72d">evbuffer_add_vprintf</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf, const char *fmt, va_list ap)</td></tr>
<tr class="memdesc:abb5d7931c7be6b2bde597cbb9b6dc72d"><td class="mdescLeft"> </td><td class="mdescRight">Append a va_list formatted string to the end of an evbuffer. <a href="buffer_8h.html#abb5d7931c7be6b2bde597cbb9b6dc72d">More...</a><br /></td></tr>
<tr class="separator:abb5d7931c7be6b2bde597cbb9b6dc72d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae384dcadf478c364d005f57be899b21b"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#ae384dcadf478c364d005f57be899b21b">evbuffer_cb_clear_flags</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer, struct evbuffer_cb_entry *cb, ev_uint32_t flags)</td></tr>
<tr class="memdesc:ae384dcadf478c364d005f57be899b21b"><td class="mdescLeft"> </td><td class="mdescRight">Change the flags that are set for a callback on a buffer by removing some. <a href="buffer_8h.html#ae384dcadf478c364d005f57be899b21b">More...</a><br /></td></tr>
<tr class="separator:ae384dcadf478c364d005f57be899b21b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af5fa49788238edd197d3f242878576f3"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#af5fa49788238edd197d3f242878576f3">evbuffer_cb_set_flags</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer, struct evbuffer_cb_entry *cb, ev_uint32_t flags)</td></tr>
<tr class="memdesc:af5fa49788238edd197d3f242878576f3"><td class="mdescLeft"> </td><td class="mdescRight">Change the flags that are set for a callback on a buffer by adding more. <a href="buffer_8h.html#af5fa49788238edd197d3f242878576f3">More...</a><br /></td></tr>
<tr class="separator:af5fa49788238edd197d3f242878576f3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a256652150a256e8e09d9c1ca5ad24881"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a256652150a256e8e09d9c1ca5ad24881">evbuffer_clear_flags</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf, ev_uint64_t flags)</td></tr>
<tr class="memdesc:a256652150a256e8e09d9c1ca5ad24881"><td class="mdescLeft"> </td><td class="mdescRight">Change the flags that are set for an evbuffer by removing some. <a href="buffer_8h.html#a256652150a256e8e09d9c1ca5ad24881">More...</a><br /></td></tr>
<tr class="separator:a256652150a256e8e09d9c1ca5ad24881"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab9cd3918d883d90acda2d9a9c530bf84"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#ab9cd3918d883d90acda2d9a9c530bf84">evbuffer_commit_space</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf, struct <a class="el" href="structevbuffer__iovec.html">evbuffer_iovec</a> *vec, int n_vecs)</td></tr>
<tr class="memdesc:ab9cd3918d883d90acda2d9a9c530bf84"><td class="mdescLeft"> </td><td class="mdescRight">Commits previously reserved space. <a href="buffer_8h.html#ab9cd3918d883d90acda2d9a9c530bf84">More...</a><br /></td></tr>
<tr class="separator:ab9cd3918d883d90acda2d9a9c530bf84"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afdc539f4c3dbae7c671a4a857833a3d5"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL ev_ssize_t </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#afdc539f4c3dbae7c671a4a857833a3d5">evbuffer_copyout</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf, void *data_out, size_t datlen)</td></tr>
<tr class="memdesc:afdc539f4c3dbae7c671a4a857833a3d5"><td class="mdescLeft"> </td><td class="mdescRight">Read data from an evbuffer, and leave the buffer unchanged. <a href="buffer_8h.html#afdc539f4c3dbae7c671a4a857833a3d5">More...</a><br /></td></tr>
<tr class="separator:afdc539f4c3dbae7c671a4a857833a3d5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3cf708e4e9384d70a5d2fd7158fd94cb"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL ev_ssize_t </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a3cf708e4e9384d70a5d2fd7158fd94cb">evbuffer_copyout_from</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf, const struct <a class="el" href="structevbuffer__ptr.html">evbuffer_ptr</a> *pos, void *data_out, size_t datlen)</td></tr>
<tr class="memdesc:a3cf708e4e9384d70a5d2fd7158fd94cb"><td class="mdescLeft"> </td><td class="mdescRight">Read data from the middle of an evbuffer, and leave the buffer unchanged. <a href="buffer_8h.html#a3cf708e4e9384d70a5d2fd7158fd94cb">More...</a><br /></td></tr>
<tr class="separator:a3cf708e4e9384d70a5d2fd7158fd94cb"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a97293fcb83dd9d073af4cf370b9d094d"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a97293fcb83dd9d073af4cf370b9d094d">evbuffer_defer_callbacks</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer, struct <a class="el" href="structevent__base.html">event_base</a> *base)</td></tr>
<tr class="memdesc:a97293fcb83dd9d073af4cf370b9d094d"><td class="mdescLeft"> </td><td class="mdescRight">Force all the callbacks on an evbuffer to be run, not immediately after the evbuffer is altered, but instead from inside the event loop. <a href="buffer_8h.html#a97293fcb83dd9d073af4cf370b9d094d">More...</a><br /></td></tr>
<tr class="separator:a97293fcb83dd9d073af4cf370b9d094d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a08599d8165ea785b9b6a4ddf44ec24f7"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a08599d8165ea785b9b6a4ddf44ec24f7">evbuffer_drain</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf, size_t len)</td></tr>
<tr class="memdesc:a08599d8165ea785b9b6a4ddf44ec24f7"><td class="mdescLeft"> </td><td class="mdescRight">Remove a specified number of bytes data from the beginning of an evbuffer. <a href="buffer_8h.html#a08599d8165ea785b9b6a4ddf44ec24f7">More...</a><br /></td></tr>
<tr class="separator:a08599d8165ea785b9b6a4ddf44ec24f7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af68e729ac81d8a1c02b716653af45ded"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#af68e729ac81d8a1c02b716653af45ded">evbuffer_enable_locking</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf, void *lock)</td></tr>
<tr class="memdesc:af68e729ac81d8a1c02b716653af45ded"><td class="mdescLeft"> </td><td class="mdescRight">Enable locking on an evbuffer so that it can safely be used by multiple threads at the same time. <a href="buffer_8h.html#af68e729ac81d8a1c02b716653af45ded">More...</a><br /></td></tr>
<tr class="separator:af68e729ac81d8a1c02b716653af45ded"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8d4919171c71fc41515c0373e8264527"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a8d4919171c71fc41515c0373e8264527">evbuffer_expand</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf, size_t datlen)</td></tr>
<tr class="memdesc:a8d4919171c71fc41515c0373e8264527"><td class="mdescLeft"> </td><td class="mdescRight">Expands the available space in an evbuffer. <a href="buffer_8h.html#a8d4919171c71fc41515c0373e8264527">More...</a><br /></td></tr>
<tr class="separator:a8d4919171c71fc41515c0373e8264527"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab0767fa82fecc6255129928b02ecc1d6"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL void </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#ab0767fa82fecc6255129928b02ecc1d6">evbuffer_file_segment_add_cleanup_cb</a> (struct evbuffer_file_segment *seg, <a class="el" href="buffer_8h.html#aa0e56a17ff87cf097011902b80dd53bf">evbuffer_file_segment_cleanup_cb</a> cb, void *arg)</td></tr>
<tr class="memdesc:ab0767fa82fecc6255129928b02ecc1d6"><td class="mdescLeft"> </td><td class="mdescRight">Add cleanup callback and argument for the callback to an evbuffer_file_segment. <a href="buffer_8h.html#ab0767fa82fecc6255129928b02ecc1d6">More...</a><br /></td></tr>
<tr class="separator:ab0767fa82fecc6255129928b02ecc1d6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0b82a4d7dd6853882ed5a87559edbad1"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL void </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a0b82a4d7dd6853882ed5a87559edbad1">evbuffer_file_segment_free</a> (struct evbuffer_file_segment *seg)</td></tr>
<tr class="memdesc:a0b82a4d7dd6853882ed5a87559edbad1"><td class="mdescLeft"> </td><td class="mdescRight">Free an evbuffer_file_segment. <a href="buffer_8h.html#a0b82a4d7dd6853882ed5a87559edbad1">More...</a><br /></td></tr>
<tr class="separator:a0b82a4d7dd6853882ed5a87559edbad1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa52264c1529ee486400bbad0bf9f4271"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL struct evbuffer_file_segment * </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#aa52264c1529ee486400bbad0bf9f4271">evbuffer_file_segment_new</a> (int fd, ev_off_t offset, ev_off_t length, unsigned flags)</td></tr>
<tr class="memdesc:aa52264c1529ee486400bbad0bf9f4271"><td class="mdescLeft"> </td><td class="mdescRight">Create and return a new evbuffer_file_segment for reading data from a file and sending it out via an evbuffer. <a href="buffer_8h.html#aa52264c1529ee486400bbad0bf9f4271">More...</a><br /></td></tr>
<tr class="separator:aa52264c1529ee486400bbad0bf9f4271"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab255015b91f7b43ba09d8f9da54ed865"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL void </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#ab255015b91f7b43ba09d8f9da54ed865">evbuffer_free</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf)</td></tr>
<tr class="memdesc:ab255015b91f7b43ba09d8f9da54ed865"><td class="mdescLeft"> </td><td class="mdescRight">Deallocate storage for an evbuffer. <a href="buffer_8h.html#ab255015b91f7b43ba09d8f9da54ed865">More...</a><br /></td></tr>
<tr class="separator:ab255015b91f7b43ba09d8f9da54ed865"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2b32b99d60603aac9bbadb9e463a6bc1"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a2b32b99d60603aac9bbadb9e463a6bc1">evbuffer_freeze</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf, int at_front)</td></tr>
<tr class="memdesc:a2b32b99d60603aac9bbadb9e463a6bc1"><td class="mdescLeft"> </td><td class="mdescRight">Prevent calls that modify an evbuffer from succeeding. <a href="buffer_8h.html#a2b32b99d60603aac9bbadb9e463a6bc1">More...</a><br /></td></tr>
<tr class="separator:a2b32b99d60603aac9bbadb9e463a6bc1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3f0b89841da394aebf6dfd620dd787d1"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a3f0b89841da394aebf6dfd620dd787d1">evbuffer_get_contiguous_space</a> (const struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf)</td></tr>
<tr class="memdesc:a3f0b89841da394aebf6dfd620dd787d1"><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of contiguous available bytes in the first buffer chain. <a href="buffer_8h.html#a3f0b89841da394aebf6dfd620dd787d1">More...</a><br /></td></tr>
<tr class="separator:a3f0b89841da394aebf6dfd620dd787d1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a808db707e84e20229b2aafdcaba6c708"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a808db707e84e20229b2aafdcaba6c708">evbuffer_get_length</a> (const struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf)</td></tr>
<tr class="memdesc:a808db707e84e20229b2aafdcaba6c708"><td class="mdescLeft"> </td><td class="mdescRight">Returns the total number of bytes stored in the evbuffer. <a href="buffer_8h.html#a808db707e84e20229b2aafdcaba6c708">More...</a><br /></td></tr>
<tr class="separator:a808db707e84e20229b2aafdcaba6c708"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a94fa0f064f3a5d273a362762eb6b1410"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a94fa0f064f3a5d273a362762eb6b1410">evbuffer_get_max_read</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf)</td></tr>
<tr class="memdesc:a94fa0f064f3a5d273a362762eb6b1410"><td class="mdescLeft"> </td><td class="mdescRight">Get maximum read buffer size. <a href="buffer_8h.html#a94fa0f064f3a5d273a362762eb6b1410">More...</a><br /></td></tr>
<tr class="separator:a94fa0f064f3a5d273a362762eb6b1410"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afe1a938f5728ca0770419119cd90359d"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL void </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#afe1a938f5728ca0770419119cd90359d">evbuffer_lock</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf)</td></tr>
<tr class="memdesc:afe1a938f5728ca0770419119cd90359d"><td class="mdescLeft"> </td><td class="mdescRight">Acquire the lock on an evbuffer. <a href="buffer_8h.html#afe1a938f5728ca0770419119cd90359d">More...</a><br /></td></tr>
<tr class="separator:afe1a938f5728ca0770419119cd90359d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7a853e8ebc063d32cd11f1554c77615d"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL struct <a class="el" href="structevbuffer.html">evbuffer</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a7a853e8ebc063d32cd11f1554c77615d">evbuffer_new</a> (void)</td></tr>
<tr class="memdesc:a7a853e8ebc063d32cd11f1554c77615d"><td class="mdescLeft"> </td><td class="mdescRight">Allocate storage for a new evbuffer. <a href="buffer_8h.html#a7a853e8ebc063d32cd11f1554c77615d">More...</a><br /></td></tr>
<tr class="separator:a7a853e8ebc063d32cd11f1554c77615d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aad7c208f2afca3e7e46a1a95fb79eec1"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#aad7c208f2afca3e7e46a1a95fb79eec1">evbuffer_peek</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer, ev_ssize_t len, struct <a class="el" href="structevbuffer__ptr.html">evbuffer_ptr</a> *start_at, struct <a class="el" href="structevbuffer__iovec.html">evbuffer_iovec</a> *vec_out, int n_vec)</td></tr>
<tr class="memdesc:aad7c208f2afca3e7e46a1a95fb79eec1"><td class="mdescLeft"> </td><td class="mdescRight">Function to peek at data inside an evbuffer without removing it or copying it out. <a href="buffer_8h.html#aad7c208f2afca3e7e46a1a95fb79eec1">More...</a><br /></td></tr>
<tr class="separator:aad7c208f2afca3e7e46a1a95fb79eec1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1112b433d2554b8b80b814feb37fdc95"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a1112b433d2554b8b80b814feb37fdc95">evbuffer_prepend</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf, const void *data, size_t size)</td></tr>
<tr class="memdesc:a1112b433d2554b8b80b814feb37fdc95"><td class="mdescLeft"> </td><td class="mdescRight">Prepends data to the beginning of the evbuffer. <a href="buffer_8h.html#a1112b433d2554b8b80b814feb37fdc95">More...</a><br /></td></tr>
<tr class="separator:a1112b433d2554b8b80b814feb37fdc95"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1d26aa5a48b549d702bc5175b0444d33"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a1d26aa5a48b549d702bc5175b0444d33">evbuffer_prepend_buffer</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *dst, struct <a class="el" href="structevbuffer.html">evbuffer</a> *src)</td></tr>
<tr class="memdesc:a1d26aa5a48b549d702bc5175b0444d33"><td class="mdescLeft"> </td><td class="mdescRight">Prepends all data from the src evbuffer to the beginning of the dst evbuffer. <a href="buffer_8h.html#a1d26aa5a48b549d702bc5175b0444d33">More...</a><br /></td></tr>
<tr class="separator:a1d26aa5a48b549d702bc5175b0444d33"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a22137a538067a8450d52af0e6601ca49"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a22137a538067a8450d52af0e6601ca49">evbuffer_ptr_set</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer, struct <a class="el" href="structevbuffer__ptr.html">evbuffer_ptr</a> *ptr, size_t position, enum <a class="el" href="buffer_8h.html#a13a9ee759900ce2964d16acd5f309014">evbuffer_ptr_how</a> how)</td></tr>
<tr class="memdesc:a22137a538067a8450d52af0e6601ca49"><td class="mdescLeft"> </td><td class="mdescRight">Sets the search pointer in the buffer to position. <a href="buffer_8h.html#a22137a538067a8450d52af0e6601ca49">More...</a><br /></td></tr>
<tr class="separator:a22137a538067a8450d52af0e6601ca49"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acd73ca99c3a793ea26c43307b9723bd6"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL unsigned char * </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#acd73ca99c3a793ea26c43307b9723bd6">evbuffer_pullup</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf, ev_ssize_t size)</td></tr>
<tr class="memdesc:acd73ca99c3a793ea26c43307b9723bd6"><td class="mdescLeft"> </td><td class="mdescRight">Makes the data at the beginning of an evbuffer contiguous. <a href="buffer_8h.html#acd73ca99c3a793ea26c43307b9723bd6">More...</a><br /></td></tr>
<tr class="separator:acd73ca99c3a793ea26c43307b9723bd6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2664ab1d68d21acf3185a01c85cf29af"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a2664ab1d68d21acf3185a01c85cf29af">evbuffer_read</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer, <a class="el" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> fd, int howmuch)</td></tr>
<tr class="memdesc:a2664ab1d68d21acf3185a01c85cf29af"><td class="mdescLeft"> </td><td class="mdescRight">Read from a file descriptor and store the result in an evbuffer. <a href="buffer_8h.html#a2664ab1d68d21acf3185a01c85cf29af">More...</a><br /></td></tr>
<tr class="separator:a2664ab1d68d21acf3185a01c85cf29af"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8bcc94903283574331994c9364be3d7b"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL char * </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a8bcc94903283574331994c9364be3d7b">evbuffer_readln</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer, size_t *n_read_out, enum <a class="el" href="buffer_8h.html#ad8daf54669a1d2094ce4251dbb502178">evbuffer_eol_style</a> eol_style)</td></tr>
<tr class="memdesc:a8bcc94903283574331994c9364be3d7b"><td class="mdescLeft"> </td><td class="mdescRight">Read a single line from an evbuffer. <a href="buffer_8h.html#a8bcc94903283574331994c9364be3d7b">More...</a><br /></td></tr>
<tr class="separator:a8bcc94903283574331994c9364be3d7b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa53da314581de5e13bb0d92aa05e2301"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#aa53da314581de5e13bb0d92aa05e2301">evbuffer_remove</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf, void *data, size_t datlen)</td></tr>
<tr class="memdesc:aa53da314581de5e13bb0d92aa05e2301"><td class="mdescLeft"> </td><td class="mdescRight">Read data from an evbuffer and drain the bytes read. <a href="buffer_8h.html#aa53da314581de5e13bb0d92aa05e2301">More...</a><br /></td></tr>
<tr class="separator:aa53da314581de5e13bb0d92aa05e2301"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a863342bdbdb4f91d0415ae29ef25494b"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a863342bdbdb4f91d0415ae29ef25494b">evbuffer_remove_buffer</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *src, struct <a class="el" href="structevbuffer.html">evbuffer</a> *dst, size_t datlen)</td></tr>
<tr class="memdesc:a863342bdbdb4f91d0415ae29ef25494b"><td class="mdescLeft"> </td><td class="mdescRight">Read data from an evbuffer into another evbuffer, draining the bytes from the source buffer. <a href="buffer_8h.html#a863342bdbdb4f91d0415ae29ef25494b">More...</a><br /></td></tr>
<tr class="separator:a863342bdbdb4f91d0415ae29ef25494b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abc4912118c60071766c6a9d343186137"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#abc4912118c60071766c6a9d343186137">evbuffer_remove_cb</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer, <a class="el" href="buffer_8h.html#a8f16422514b698553f34c0eba180f3fa">evbuffer_cb_func</a> cb, void *cbarg)</td></tr>
<tr class="memdesc:abc4912118c60071766c6a9d343186137"><td class="mdescLeft"> </td><td class="mdescRight">Remove a callback from an evbuffer, given the function and argument used to add it. <a href="buffer_8h.html#abc4912118c60071766c6a9d343186137">More...</a><br /></td></tr>
<tr class="separator:abc4912118c60071766c6a9d343186137"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ade150950a995af06cd3c6321f71eb3c1"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#ade150950a995af06cd3c6321f71eb3c1">evbuffer_remove_cb_entry</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer, struct evbuffer_cb_entry *ent)</td></tr>
<tr class="memdesc:ade150950a995af06cd3c6321f71eb3c1"><td class="mdescLeft"> </td><td class="mdescRight">Remove a callback from an evbuffer, given a handle returned from evbuffer_add_cb. <a href="buffer_8h.html#ade150950a995af06cd3c6321f71eb3c1">More...</a><br /></td></tr>
<tr class="separator:ade150950a995af06cd3c6321f71eb3c1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a18e9703ca1a062669412684543f7f537"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a18e9703ca1a062669412684543f7f537">evbuffer_reserve_space</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf, ev_ssize_t size, struct <a class="el" href="structevbuffer__iovec.html">evbuffer_iovec</a> *vec, int n_vec)</td></tr>
<tr class="memdesc:a18e9703ca1a062669412684543f7f537"><td class="mdescLeft"> </td><td class="mdescRight">Reserves space in the last chain or chains of an evbuffer. <a href="buffer_8h.html#a18e9703ca1a062669412684543f7f537">More...</a><br /></td></tr>
<tr class="separator:a18e9703ca1a062669412684543f7f537"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a06e9211319a369ffb072d4f4a83b48e7"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL struct <a class="el" href="structevbuffer__ptr.html">evbuffer_ptr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a06e9211319a369ffb072d4f4a83b48e7">evbuffer_search</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer, const char *what, size_t len, const struct <a class="el" href="structevbuffer__ptr.html">evbuffer_ptr</a> *start)</td></tr>
<tr class="memdesc:a06e9211319a369ffb072d4f4a83b48e7"><td class="mdescLeft"> </td><td class="mdescRight">Search for a string within an evbuffer. <a href="buffer_8h.html#a06e9211319a369ffb072d4f4a83b48e7">More...</a><br /></td></tr>
<tr class="separator:a06e9211319a369ffb072d4f4a83b48e7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a28e2fa6852a5a49285933b1c95c7465f"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL struct <a class="el" href="structevbuffer__ptr.html">evbuffer_ptr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a28e2fa6852a5a49285933b1c95c7465f">evbuffer_search_eol</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer, struct <a class="el" href="structevbuffer__ptr.html">evbuffer_ptr</a> *start, size_t *eol_len_out, enum <a class="el" href="buffer_8h.html#ad8daf54669a1d2094ce4251dbb502178">evbuffer_eol_style</a> eol_style)</td></tr>
<tr class="memdesc:a28e2fa6852a5a49285933b1c95c7465f"><td class="mdescLeft"> </td><td class="mdescRight">Search for an end-of-line string within an evbuffer. <a href="buffer_8h.html#a28e2fa6852a5a49285933b1c95c7465f">More...</a><br /></td></tr>
<tr class="separator:a28e2fa6852a5a49285933b1c95c7465f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3b1e093af8bc1a86963729ec1290de8f"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL struct <a class="el" href="structevbuffer__ptr.html">evbuffer_ptr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a3b1e093af8bc1a86963729ec1290de8f">evbuffer_search_range</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer, const char *what, size_t len, const struct <a class="el" href="structevbuffer__ptr.html">evbuffer_ptr</a> *start, const struct <a class="el" href="structevbuffer__ptr.html">evbuffer_ptr</a> *end)</td></tr>
<tr class="memdesc:a3b1e093af8bc1a86963729ec1290de8f"><td class="mdescLeft"> </td><td class="mdescRight">Search for a string within part of an evbuffer. <a href="buffer_8h.html#a3b1e093af8bc1a86963729ec1290de8f">More...</a><br /></td></tr>
<tr class="separator:a3b1e093af8bc1a86963729ec1290de8f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8649a5edeb1fcf06490d4d35ac76c13a"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a8649a5edeb1fcf06490d4d35ac76c13a">evbuffer_set_flags</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf, ev_uint64_t flags)</td></tr>
<tr class="memdesc:a8649a5edeb1fcf06490d4d35ac76c13a"><td class="mdescLeft"> </td><td class="mdescRight">Change the flags that are set for an evbuffer by adding more. <a href="buffer_8h.html#a8649a5edeb1fcf06490d4d35ac76c13a">More...</a><br /></td></tr>
<tr class="separator:a8649a5edeb1fcf06490d4d35ac76c13a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac5441fc0ce576ad997bf1a869f8c4ba9"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#ac5441fc0ce576ad997bf1a869f8c4ba9">evbuffer_set_max_read</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf, size_t max)</td></tr>
<tr class="memdesc:ac5441fc0ce576ad997bf1a869f8c4ba9"><td class="mdescLeft"> </td><td class="mdescRight">Set maximum read buffer size. <a href="buffer_8h.html#ac5441fc0ce576ad997bf1a869f8c4ba9">More...</a><br /></td></tr>
<tr class="separator:ac5441fc0ce576ad997bf1a869f8c4ba9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af36bd50996e2db4445282e6a194328a2"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#af36bd50996e2db4445282e6a194328a2">evbuffer_unfreeze</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf, int at_front)</td></tr>
<tr class="memdesc:af36bd50996e2db4445282e6a194328a2"><td class="mdescLeft"> </td><td class="mdescRight">Re-enable calls that modify an evbuffer. <a href="buffer_8h.html#af36bd50996e2db4445282e6a194328a2">More...</a><br /></td></tr>
<tr class="separator:af36bd50996e2db4445282e6a194328a2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a25e8be33a5d5cb2684594b9b3cb6c7c9"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL void </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a25e8be33a5d5cb2684594b9b3cb6c7c9">evbuffer_unlock</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buf)</td></tr>
<tr class="memdesc:a25e8be33a5d5cb2684594b9b3cb6c7c9"><td class="mdescLeft"> </td><td class="mdescRight">Release the lock on an evbuffer. <a href="buffer_8h.html#a25e8be33a5d5cb2684594b9b3cb6c7c9">More...</a><br /></td></tr>
<tr class="separator:a25e8be33a5d5cb2684594b9b3cb6c7c9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7d9605737ec9ba876f0ba49e937b9bd7"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a7d9605737ec9ba876f0ba49e937b9bd7">evbuffer_write</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer, <a class="el" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> fd)</td></tr>
<tr class="memdesc:a7d9605737ec9ba876f0ba49e937b9bd7"><td class="mdescLeft"> </td><td class="mdescRight">Write the contents of an evbuffer to a file descriptor. <a href="buffer_8h.html#a7d9605737ec9ba876f0ba49e937b9bd7">More...</a><br /></td></tr>
<tr class="separator:a7d9605737ec9ba876f0ba49e937b9bd7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a69f9cbac8f6dbd2d8f3c2706fbbdc7cd"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="buffer_8h.html#a69f9cbac8f6dbd2d8f3c2706fbbdc7cd">evbuffer_write_atmost</a> (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer, <a class="el" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> fd, ev_ssize_t howmuch)</td></tr>
<tr class="memdesc:a69f9cbac8f6dbd2d8f3c2706fbbdc7cd"><td class="mdescLeft"> </td><td class="mdescRight">Write some of the contents of an evbuffer to a file descriptor. <a href="buffer_8h.html#a69f9cbac8f6dbd2d8f3c2706fbbdc7cd">More...</a><br /></td></tr>
<tr class="separator:a69f9cbac8f6dbd2d8f3c2706fbbdc7cd"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Functions for buffering data for network sending or receiving. </p>
<p>An evbuffer can be used for preparing data before sending it to the network or conversely for reading data from the network. Evbuffers try to avoid memory copies as much as possible. As a result, evbuffers can be used to pass data around without actually incurring the overhead of copying the data.</p>
<p>A new evbuffer can be allocated with <a class="el" href="buffer_8h.html#a7a853e8ebc063d32cd11f1554c77615d" title="Allocate storage for a new evbuffer.">evbuffer_new()</a>, and can be freed with <a class="el" href="buffer_8h.html#ab255015b91f7b43ba09d8f9da54ed865" title="Deallocate storage for an evbuffer.">evbuffer_free()</a>. Most users will be using evbuffers via the bufferevent interface. To access a bufferevent's evbuffers, use <a class="el" href="bufferevent_8h.html#a3ddbf50178b96b3f243ddc83d67e88b0" title="Returns the input buffer.">bufferevent_get_input()</a> and <a class="el" href="bufferevent_8h.html#ac6e45fa1fc577c4f0e6c4689e72c0a15" title="Returns the output buffer.">bufferevent_get_output()</a>.</p>
<p>There are several guidelines for using evbuffers.</p>
<ul>
<li>if you already know how much data you are going to add as a result of calling <a class="el" href="buffer_8h.html#a8abedc30187fe00d86b7b1cc4d3ce643" title="Append data to the end of an evbuffer.">evbuffer_add()</a> multiple times, it makes sense to use <a class="el" href="buffer_8h.html#a8d4919171c71fc41515c0373e8264527" title="Expands the available space in an evbuffer.">evbuffer_expand()</a> first to make sure that enough memory is allocated before hand.</li>
<li><a class="el" href="buffer_8h.html#af95837e510c03d5e5fcf9c05db019f14" title="Move all data from one evbuffer into another evbuffer.">evbuffer_add_buffer()</a> adds the contents of one buffer to the other without incurring any unnecessary memory copies.</li>
<li><a class="el" href="buffer_8h.html#a8abedc30187fe00d86b7b1cc4d3ce643" title="Append data to the end of an evbuffer.">evbuffer_add()</a> and <a class="el" href="buffer_8h.html#af95837e510c03d5e5fcf9c05db019f14" title="Move all data from one evbuffer into another evbuffer.">evbuffer_add_buffer()</a> do not mix very well: if you use them, you will wind up with fragmented memory in your buffer.</li>
<li>For high-performance code, you may want to avoid copying data into and out of buffers. You can skip the copy step by using <a class="el" href="buffer_8h.html#a18e9703ca1a062669412684543f7f537" title="Reserves space in the last chain or chains of an evbuffer.">evbuffer_reserve_space()</a>/evbuffer_commit_space() when writing into a buffer, and <a class="el" href="buffer_8h.html#aad7c208f2afca3e7e46a1a95fb79eec1" title="Function to peek at data inside an evbuffer without removing it or copying it out.">evbuffer_peek()</a> when reading.</li>
</ul>
<p>In Libevent 2.0 and later, evbuffers are represented using a linked list of memory chunks, with pointers to the first and last chunk in the chain.</p>
<p>As the contents of an evbuffer can be stored in multiple different memory blocks, it cannot be accessed directly. Instead, <a class="el" href="buffer_8h.html#acd73ca99c3a793ea26c43307b9723bd6" title="Makes the data at the beginning of an evbuffer contiguous.">evbuffer_pullup()</a> can be used to force a specified number of bytes to be contiguous. This will cause memory reallocation and memory copies if the data is split across multiple blocks. It is more efficient, however, to use <a class="el" href="buffer_8h.html#aad7c208f2afca3e7e46a1a95fb79eec1" title="Function to peek at data inside an evbuffer without removing it or copying it out.">evbuffer_peek()</a> if you don't require that the memory to be contiguous. </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ad9d19b50a501babad4cbe7f0f9a42691"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad9d19b50a501babad4cbe7f0f9a42691">◆ </a></span>EVBUF_FS_DISABLE_LOCKING</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define EVBUF_FS_DISABLE_LOCKING   0x08</td>
</tr>
</table>
</div><div class="memdoc">
<p>Flag for creating evbuffer_file_segment: Do not allocate a lock for this segment. </p>
<p>If this option is set, then neither the segment nor any evbuffer it is added to may ever be accessed from more than one thread at a time. </p>
</div>
</div>
<a id="a553dd6c9a5cbbc112ffe32401cacd705"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a553dd6c9a5cbbc112ffe32401cacd705">◆ </a></span>EVBUF_FS_DISABLE_SENDFILE</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define EVBUF_FS_DISABLE_SENDFILE   0x04</td>
</tr>
</table>
</div><div class="memdoc">
<p>Flag for creating evbuffer_file_segment: Disable direct fd-to-fd implementations (sendfile). </p>
<p>You might want to use this option if data needs to be taken from the evbuffer by any means other than writing it to the network: the sendfile backend is fast, but it only works for sending files directly to the network. </p>
</div>
</div>
<a id="aeb635643a72f8e57d50d7dee37308148"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeb635643a72f8e57d50d7dee37308148">◆ </a></span>EVBUFFER_CB_ENABLED</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define EVBUFFER_CB_ENABLED   1</td>
</tr>
</table>
</div><div class="memdoc">
<p>If this flag is not set, then a callback is temporarily disabled, and should not be invoked. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="buffer_8h.html#af5fa49788238edd197d3f242878576f3" title="Change the flags that are set for a callback on a buffer by adding more.">evbuffer_cb_set_flags()</a>, <a class="el" href="buffer_8h.html#ae384dcadf478c364d005f57be899b21b" title="Change the flags that are set for a callback on a buffer by removing some.">evbuffer_cb_clear_flags()</a> </dd></dl>
</div>
</div>
<a id="a0d9db8b232ebf8d63c660ec429981e91"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0d9db8b232ebf8d63c660ec429981e91">◆ </a></span>EVBUFFER_FLAG_DRAINS_TO_FD</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define EVBUFFER_FLAG_DRAINS_TO_FD   1</td>
</tr>
</table>
</div><div class="memdoc">
<p>If this flag is set, then we will not use <a class="el" href="buffer_8h.html#aad7c208f2afca3e7e46a1a95fb79eec1" title="Function to peek at data inside an evbuffer without removing it or copying it out.">evbuffer_peek()</a>, <a class="el" href="buffer_8h.html#aa53da314581de5e13bb0d92aa05e2301" title="Read data from an evbuffer and drain the bytes read.">evbuffer_remove()</a>, <a class="el" href="buffer_8h.html#a863342bdbdb4f91d0415ae29ef25494b" title="Read data from an evbuffer into another evbuffer, draining the bytes from the source buffer.">evbuffer_remove_buffer()</a>, and so on to read bytes from this buffer: we'll only take bytes out of this buffer by writing them to the network (as with evbuffer_write_atmost), by removing them without observing them (as with evbuffer_drain), or by copying them all out at once (as with evbuffer_add_buffer). </p>
<p>Using this option allows the implementation to use sendfile-based operations for <a class="el" href="buffer_8h.html#a601996b1fc1f5c165dc62b89acbd069e" title="Copy data from a file into the evbuffer for writing to a socket.">evbuffer_add_file()</a>; see that function for more information.</p>
<p>This flag is on by default for bufferevents that can take advantage of it; you should never actually need to set it on a bufferevent's output buffer. </p>
</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="a8f16422514b698553f34c0eba180f3fa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8f16422514b698553f34c0eba180f3fa">◆ </a></span>evbuffer_cb_func</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* evbuffer_cb_func) (struct <a class="el" href="structevbuffer.html">evbuffer</a> *buffer, const struct <a class="el" href="structevbuffer__cb__info.html">evbuffer_cb_info</a> *info, 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">info</td><td>a structure describing how the buffer changed. </td></tr>
<tr><td class="paramname">arg</td><td>a pointer to user data </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a66c442353fa5159e2acd808794fa92d6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a66c442353fa5159e2acd808794fa92d6">◆ </a></span>evbuffer_ref_cleanup_cb</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* evbuffer_ref_cleanup_cb) (const void *data, size_t datalen, void *extra)</td>
</tr>
</table>
</div><div class="memdoc">
<p>A cleanup function for a piece of memory added to an evbuffer by reference. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">data</td><td>buffer </td></tr>
<tr><td class="paramname">datalen</td><td>- total buffer len (including @offset if any, </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="buffer_8h.html#abf2b931577be86b72418252207ca221b" title="Reference memory into an evbuffer without copying.">evbuffer_add_reference_with_offset()</a>)</dd>
<dd>
<a class="el" href="buffer_8h.html#a35e99b5370b59b0c0b391ada3a59befe" title="Reference memory into an evbuffer without copying.">evbuffer_add_reference()</a> </dd>
<dd>
<a class="el" href="buffer_8h.html#abf2b931577be86b72418252207ca221b" title="Reference memory into an evbuffer without copying.">evbuffer_add_reference_with_offset()</a> </dd></dl>
</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="ad8daf54669a1d2094ce4251dbb502178"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad8daf54669a1d2094ce4251dbb502178">◆ </a></span>evbuffer_eol_style</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="buffer_8h.html#ad8daf54669a1d2094ce4251dbb502178">evbuffer_eol_style</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Used to tell evbuffer_readln what kind of line-ending to look for. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ad8daf54669a1d2094ce4251dbb502178ab7c6da1408b1b2ec3a6657e5a71a50c3"></a>EVBUFFER_EOL_ANY </td><td class="fielddoc"><p>Any sequence of CR and LF characters is acceptable as an EOL. </p>
<p>Note that this style can produce ambiguous results: the sequence "CRLF" will be treated as a single EOL if it is all in the buffer at once, but if you first read a CR from the network and later read an LF from the network, it will be treated as two EOLs. </p>
</td></tr>
<tr><td class="fieldname"><a id="ad8daf54669a1d2094ce4251dbb502178a4aec5353e85fbb57ce3b1ee68f36f641"></a>EVBUFFER_EOL_CRLF </td><td class="fielddoc"><p>An EOL is an LF, optionally preceded by a CR. </p>
<p>This style is most useful for implementing text-based internet protocols. </p>
</td></tr>
<tr><td class="fieldname"><a id="ad8daf54669a1d2094ce4251dbb502178a814775b4a9773d34421e7e88ca8c58de"></a>EVBUFFER_EOL_CRLF_STRICT </td><td class="fielddoc"><p>An EOL is a CR followed by an LF. </p>
</td></tr>
<tr><td class="fieldname"><a id="ad8daf54669a1d2094ce4251dbb502178ac572ea90e5a96a7ceb878f2a8ef48993"></a>EVBUFFER_EOL_LF </td><td class="fielddoc"><p>An EOL is a LF. </p>
</td></tr>
<tr><td class="fieldname"><a id="ad8daf54669a1d2094ce4251dbb502178a7b93c5a9f595c62c9d016562356159b7"></a>EVBUFFER_EOL_NUL </td><td class="fielddoc"><p>An EOL is a NUL character (that is, a single byte with value 0) </p>
</td></tr>
</table>
</div>
</div>
<a id="a13a9ee759900ce2964d16acd5f309014"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a13a9ee759900ce2964d16acd5f309014">◆ </a></span>evbuffer_ptr_how</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="buffer_8h.html#a13a9ee759900ce2964d16acd5f309014">evbuffer_ptr_how</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Defines how to adjust an <a class="el" href="structevbuffer__ptr.html" title="Pointer to a position within an evbuffer.">evbuffer_ptr</a> by <a class="el" href="buffer_8h.html#a22137a538067a8450d52af0e6601ca49" title="Sets the search pointer in the buffer to position.">evbuffer_ptr_set()</a> </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="buffer_8h.html#a22137a538067a8450d52af0e6601ca49" title="Sets the search pointer in the buffer to position.">evbuffer_ptr_set()</a> </dd></dl>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a13a9ee759900ce2964d16acd5f309014a78a0ff3721ff5f1647f743dcfb2f13ee"></a>EVBUFFER_PTR_SET </td><td class="fielddoc"><p>Sets the pointer to the position; can be called on with an uninitialized <a class="el" href="structevbuffer__ptr.html" title="Pointer to a position within an evbuffer.">evbuffer_ptr</a>. </p>
</td></tr>
<tr><td class="fieldname"><a id="a13a9ee759900ce2964d16acd5f309014a0bce00d78b5fbc55c478ff362269f428"></a>EVBUFFER_PTR_ADD </td><td class="fielddoc"><p>Advances the pointer by adding to the current position. </p>
</td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a8abedc30187fe00d86b7b1cc4d3ce643"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8abedc30187fe00d86b7b1cc4d3ce643">◆ </a></span>evbuffer_add()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL int evbuffer_add </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structevbuffer.html">evbuffer</a> * </td>
<td class="paramname"><em>buf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const void * </td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>datlen</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Append data to the end of an evbuffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">buf</td><td>the evbuffer to be appended to </td></tr>
<tr><td class="paramname">data</td><td>pointer to the beginning of the data buffer </td></tr>
<tr><td class="paramname">datlen</td><td>the number of bytes to be copied from the data buffer </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on failure. </dd></dl>
</div>
</div>
<a id="af95837e510c03d5e5fcf9c05db019f14"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af95837e510c03d5e5fcf9c05db019f14">◆ </a></span>evbuffer_add_buffer()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL int evbuffer_add_buffer </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structevbuffer.html">evbuffer</a> * </td>
<td class="paramname"><em>outbuf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="structevbuffer.html">evbuffer</a> * </td>
<td class="paramname"><em>inbuf</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Move all data from one evbuffer into another evbuffer. </p>
<p>This is a destructive add. The data from one buffer moves into the other buffer. However, no unnecessary memory copies occur.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">outbuf</td><td>the output buffer </td></tr>
<tr><td class="paramname">inbuf</td><td>the input buffer </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="buffer_8h.html#a863342bdbdb4f91d0415ae29ef25494b" title="Read data from an evbuffer into another evbuffer, draining the bytes from the source buffer.">evbuffer_remove_buffer()</a> </dd></dl>
</div>
</div>
<a id="a60aa7eb8766fcbeadc17f722a095c624"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a60aa7eb8766fcbeadc17f722a095c624">◆ </a></span>evbuffer_add_buffer_reference()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL int evbuffer_add_buffer_reference </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structevbuffer.html">evbuffer</a> * </td>
<td class="paramname"><em>outbuf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="structevbuffer.html">evbuffer</a> * </td>
<td class="paramname"><em>inbuf</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Copy data from one evbuffer into another evbuffer. </p>
<p>This is a non-destructive add. The data from one buffer is copied into the other buffer. However, no unnecessary memory copies occur.</p>
<p>Note that buffers already containing buffer references can't be added to other buffers.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">outbuf</td><td>the output buffer </td></tr>
<tr><td class="paramname">inbuf</td><td>the input buffer </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred </dd></dl>
</div>
</div>
<a id="a3885fb5ca54eff0778916183f58a9c25"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3885fb5ca54eff0778916183f58a9c25">◆ </a></span>evbuffer_add_cb()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL struct evbuffer_cb_entry* evbuffer_add_cb </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_8h.html#a8f16422514b698553f34c0eba180f3fa">evbuffer_cb_func</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>Add a new callback to an evbuffer. </p>
<p>Subsequent calls to <a class="el" href="buffer_8h.html#a3885fb5ca54eff0778916183f58a9c25" title="Add a new callback to an evbuffer.">evbuffer_add_cb()</a> add new callbacks. To remove this callback, call evbuffer_remove_cb or evbuffer_remove_cb_entry.</p>
<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>a handle to the callback on success, or NULL on failure. </dd></dl>
</div>
</div>
<a id="a601996b1fc1f5c165dc62b89acbd069e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a601996b1fc1f5c165dc62b89acbd069e">◆ </a></span>evbuffer_add_file()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL int evbuffer_add_file </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structevbuffer.html">evbuffer</a> * </td>
<td class="paramname"><em>outbuf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>fd</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">ev_off_t </td>
<td class="paramname"><em>offset</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">ev_off_t </td>
<td class="paramname"><em>length</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Copy data from a file into the evbuffer for writing to a socket. </p>
<p>This function avoids unnecessary data copies between userland and kernel. If sendfile is available and the EVBUFFER_FLAG_DRAINS_TO_FD flag is set, it uses those functions. Otherwise, it tries to use mmap (or CreateFileMapping on Windows).</p>
<p>The function owns the resulting file descriptor and will close (even in case of error) it when finished transferring data.</p>
<p>The results of using <a class="el" href="buffer_8h.html#aa53da314581de5e13bb0d92aa05e2301" title="Read data from an evbuffer and drain the bytes read.">evbuffer_remove()</a> or <a class="el" href="buffer_8h.html#acd73ca99c3a793ea26c43307b9723bd6" title="Makes the data at the beginning of an evbuffer contiguous.">evbuffer_pullup()</a> on evbuffers whose data was added using this function are undefined.</p>
<p>For more fine-grained control, use evbuffer_add_file_segment.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">outbuf</td><td>the output buffer </td></tr>
<tr><td class="paramname">fd</td><td>the file descriptor </td></tr>
<tr><td class="paramname">offset</td><td>the offset from which to read data </td></tr>
<tr><td class="paramname">length</td><td>how much data to read, or -1 to read as much as possible. (-1 requires that 'fd' support fstat.) </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred </dd></dl>
</div>
</div>
<a id="a300f9e6d1db3d6f834284c47fc77e1bc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a300f9e6d1db3d6f834284c47fc77e1bc">◆ </a></span>evbuffer_add_file_segment()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL int evbuffer_add_file_segment </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structevbuffer.html">evbuffer</a> * </td>
<td class="paramname"><em>buf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct evbuffer_file_segment * </td>
<td class="paramname"><em>seg</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">ev_off_t </td>
<td class="paramname"><em>offset</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">ev_off_t </td>
<td class="paramname"><em>length</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Insert some or all of an evbuffer_file_segment at the end of an evbuffer. </p>
<p>Note that the offset and length parameters of this function have a different meaning from those provided to evbuffer_file_segment_new: When you create the segment, the offset is the offset <em>within the file</em>, and the length is the length <em>of the segment</em>, whereas when you add a segment to an evbuffer, the offset is <em>within the segment</em> and the length is the length of the _part of the segment you want to use.</p>
<p>In other words, if you have a 10 KiB file, and you create an evbuffer_file_segment for it with offset 20 and length 1000, it will refer to bytes 20..1019 inclusive. If you then pass this segment to evbuffer_add_file_segment and specify an offset of 20 and a length of 50, you will be adding bytes 40..99 inclusive.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">buf</td><td>the evbuffer to append to </td></tr>
<tr><td class="paramname">seg</td><td>the segment to add </td></tr>
<tr><td class="paramname">offset</td><td>the offset within the segment to start from </td></tr>
<tr><td class="paramname">length</td><td>the amount of data to add, or -1 to add it all. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on failure. </dd></dl>
</div>
</div>
<a id="acd12f9e37353ed2b72d6a1cc2064f998"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acd12f9e37353ed2b72d6a1cc2064f998">◆ </a></span>evbuffer_add_iovec()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL size_t evbuffer_add_iovec </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">struct <a class="el" href="structevbuffer__iovec.html">evbuffer_iovec</a> * </td>
<td class="paramname"><em>vec</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>n_vec</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Append data from 1 or more iovec's to an evbuffer. </p>
<p>Calculates the number of bytes needed for an iovec structure and guarantees all data will fit into a single chain. Can be used in lieu of functionality which calls <a class="el" href="buffer_8h.html#a8abedc30187fe00d86b7b1cc4d3ce643" title="Append data to the end of an evbuffer.">evbuffer_add()</a> constantly before being used to increase performance.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">buffer</td><td>the destination buffer </td></tr>
<tr><td class="paramname">vec</td><td>the source iovec </td></tr>
<tr><td class="paramname">n_vec</td><td>the number of iovec structures. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the number of bytes successfully written to the output buffer. </dd></dl>
</div>
</div>
<a id="abd34b7bd9e698e15f868bf05fa6abc59"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abd34b7bd9e698e15f868bf05fa6abc59">◆ </a></span>evbuffer_add_printf()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL int evbuffer_add_printf </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structevbuffer.html">evbuffer</a> * </td>
<td class="paramname"><em>buf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>fmt</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname"><em>...</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Append a formatted string to the end of an evbuffer. </p>
<p>The string is formated as printf.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">buf</td><td>the evbuffer that will be appended to </td></tr>
<tr><td class="paramname">fmt</td><td>a format string </td></tr>
<tr><td class="paramname">...</td><td>arguments that will be passed to printf(3) </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes added if successful, or -1 if an error occurred.</dd></dl>
<dl class="section see"><dt>See also</dt><dd>evutil_printf(), <a class="el" href="buffer_8h.html#abb5d7931c7be6b2bde597cbb9b6dc72d" title="Append a va_list formatted string to the end of an evbuffer.">evbuffer_add_vprintf()</a> </dd></dl>
</div>
</div>
<a id="a35e99b5370b59b0c0b391ada3a59befe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a35e99b5370b59b0c0b391ada3a59befe">◆ </a></span>evbuffer_add_reference()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL int evbuffer_add_reference </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structevbuffer.html">evbuffer</a> * </td>
<td class="paramname"><em>outbuf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const void * </td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>datlen</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="buffer_8h.html#a66c442353fa5159e2acd808794fa92d6">evbuffer_ref_cleanup_cb</a> </td>
<td class="paramname"><em>cleanupfn</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"><em>cleanupfn_arg</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Reference memory into an evbuffer without copying. </p>
<p>The memory needs to remain valid until all the added data has been read. This function keeps just a reference to the memory without actually incurring the overhead of a copy.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">outbuf</td><td>the output buffer </td></tr>
<tr><td class="paramname">data</td><td>the memory to reference </td></tr>
<tr><td class="paramname">datlen</td><td>how memory to reference </td></tr>
<tr><td class="paramname">cleanupfn</td><td>callback to be invoked when the memory is no longer referenced by this evbuffer. </td></tr>
<tr><td class="paramname">cleanupfn_arg</td><td>optional argument to the cleanup callback </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred </dd></dl>
</div>
</div>
<a id="abf2b931577be86b72418252207ca221b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf2b931577be86b72418252207ca221b">◆ </a></span>evbuffer_add_reference_with_offset()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL int evbuffer_add_reference_with_offset </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structevbuffer.html">evbuffer</a> * </td>
<td class="paramname"><em>outbuf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const void * </td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>offset</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>datlen</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="buffer_8h.html#a66c442353fa5159e2acd808794fa92d6">evbuffer_ref_cleanup_cb</a> </td>
<td class="paramname"><em>cleanupfn</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"><em>cleanupfn_arg</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Reference memory into an evbuffer without copying. </p>
<p>The memory needs to remain valid until all the added data has been read. This function keeps just a reference to the memory without actually incurring the overhead of a copy.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">