-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathutil_8h.html
1490 lines (1399 loc) · 99.4 KB
/
util_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/util.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="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">util.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Common convenience functions for cross-platform portability and related socket manipulations.
<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 <sys/socket.h></code><br />
<code>#include <time.h></code><br />
</div>
<p><a href="util_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="structevutil__addrinfo.html">evutil_addrinfo</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">A definition of struct addrinfo for systems that lack it. <a href="structevutil__addrinfo.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="structevutil__monotonic__timer.html">evutil_monotonic_timer</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Structure to hold information about a monotonic timer. <a href="structevutil__monotonic__timer.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:a69bb004732dec77429200727420ad50c"><td class="memItemLeft" align="right" valign="top"><a id="a69bb004732dec77429200727420ad50c"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EV_MONOT_FALLBACK</b>   2</td></tr>
<tr class="separator:a69bb004732dec77429200727420ad50c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afb16e8c516213aebb503b6d764139d55"><td class="memItemLeft" align="right" valign="top"><a id="afb16e8c516213aebb503b6d764139d55"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EV_MONOT_PRECISE</b>   1</td></tr>
<tr class="separator:afb16e8c516213aebb503b6d764139d55"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1aa9b4bfabbeaae5ba828e808938fa2c"><td class="memItemLeft" align="right" valign="top"><a id="a1aa9b4bfabbeaae5ba828e808938fa2c"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ev_socklen_t</b>   socklen_t</td></tr>
<tr class="separator:a1aa9b4bfabbeaae5ba828e808938fa2c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa70c6baf0f9ac418407245579ec2a168"><td class="memItemLeft" align="right" valign="top"><a id="aa70c6baf0f9ac418407245579ec2a168"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EVUTIL_CLOSESOCKET</b>(s)   <a class="el" href="util_8h.html#a5cfa6c13c62d17570a7d5f6d3541ff5b">evutil_closesocket</a>(s)</td></tr>
<tr class="separator:aa70c6baf0f9ac418407245579ec2a168"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4c296955d33624c18bd4811730caa417"><td class="memItemLeft" align="right" valign="top"><a id="a4c296955d33624c18bd4811730caa417"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a4c296955d33624c18bd4811730caa417">evutil_offsetof</a>(type, field)   ((off_t)(&((type *)0)->field))</td></tr>
<tr class="memdesc:a4c296955d33624c18bd4811730caa417"><td class="mdescLeft"> </td><td class="mdescRight">Replacement for offsetof on platforms that don't define it. <br /></td></tr>
<tr class="separator:a4c296955d33624c18bd4811730caa417"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7ef0023565082a65020f6e56be59fd0b"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a>   int</td></tr>
<tr class="memdesc:a7ef0023565082a65020f6e56be59fd0b"><td class="mdescLeft"> </td><td class="mdescRight">A type wide enough to hold the output of "socket()" or "accept()". <a href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">More...</a><br /></td></tr>
<tr class="separator:a7ef0023565082a65020f6e56be59fd0b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1a42f43db6aaf6e99736329b6611175d"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a1a42f43db6aaf6e99736329b6611175d">evutil_timercmp</a>(tvp, uvp, cmp)</td></tr>
<tr class="memdesc:a1a42f43db6aaf6e99736329b6611175d"><td class="mdescLeft"> </td><td class="mdescRight">Return true iff the tvp is related to uvp according to the relational operator cmp. <a href="util_8h.html#a1a42f43db6aaf6e99736329b6611175d">More...</a><br /></td></tr>
<tr class="separator:a1a42f43db6aaf6e99736329b6611175d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a393a0aee6129d132a3dd488366352bf2"><td class="memItemLeft" align="right" valign="top"><a id="a393a0aee6129d132a3dd488366352bf2"></a>
#define </td><td class="memItemRight" valign="bottom"><b>evutil_timerisset</b>(tvp)   ((tvp)->tv_sec || (tvp)->tv_usec)</td></tr>
<tr class="separator:a393a0aee6129d132a3dd488366352bf2"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader">Standard integer types.</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>Integer type definitions for types that are supposed to be defined in the C99-specified stdint.h.</p>
<p>Shamefully, some platforms do not include stdint.h, so we need to replace it. (If you are on a platform like this, your C headers are now over 10 years out of date. You should bug them to do something about this.)</p>
<p>We define:</p>
<dl>
<dt>ev_uint64_t, ev_uint32_t, ev_uint16_t, ev_uint8_t </dt>
<dd>unsigned integer types of exactly 64, 32, 16, and 8 bits respectively. </dd>
<dt>ev_int64_t, ev_int32_t, ev_int16_t, ev_int8_t </dt>
<dd>signed integer types of exactly 64, 32, 16, and 8 bits respectively. </dd>
<dt>ev_uintptr_t, ev_intptr_t </dt>
<dd>unsigned/signed integers large enough to hold a pointer without loss of bits. </dd>
<dt>ev_ssize_t </dt>
<dd>A signed type of the same size as size_t </dd>
<dt>ev_off_t </dt>
<dd>A signed type typically used to represent offsets within a (potentially large) file </dd>
</dl>
</div></td></tr>
<tr class="memitem:a5943ff8aa2063dd531c7cbc7f20a1e55"><td class="memItemLeft" align="right" valign="top"><a id="a5943ff8aa2063dd531c7cbc7f20a1e55"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ev_int16_t</b>   ...</td></tr>
<tr class="separator:a5943ff8aa2063dd531c7cbc7f20a1e55"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a91a83fba6bcb61a80774e2533fa1da1b"><td class="memItemLeft" align="right" valign="top"><a id="a91a83fba6bcb61a80774e2533fa1da1b"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ev_int32_t</b>   ...</td></tr>
<tr class="separator:a91a83fba6bcb61a80774e2533fa1da1b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a22ebbcfd82e30a022792cc0aef0a0049"><td class="memItemLeft" align="right" valign="top"><a id="a22ebbcfd82e30a022792cc0aef0a0049"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ev_int64_t</b>   ...</td></tr>
<tr class="separator:a22ebbcfd82e30a022792cc0aef0a0049"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab642ae86b43a6d75c52811eb686f0837"><td class="memItemLeft" align="right" valign="top"><a id="ab642ae86b43a6d75c52811eb686f0837"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ev_int8_t</b>   ...</td></tr>
<tr class="separator:ab642ae86b43a6d75c52811eb686f0837"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4913c495b489d419353b3d1512505ea2"><td class="memItemLeft" align="right" valign="top"><a id="a4913c495b489d419353b3d1512505ea2"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ev_intptr_t</b>   ev_int32_t</td></tr>
<tr class="separator:a4913c495b489d419353b3d1512505ea2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2f968b0d453ef37a233e2d40860296a6"><td class="memItemLeft" align="right" valign="top"><a id="a2f968b0d453ef37a233e2d40860296a6"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ev_off_t</b>   ...</td></tr>
<tr class="separator:a2f968b0d453ef37a233e2d40860296a6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9fce2c187cee381db4bf5276f76a39e8"><td class="memItemLeft" align="right" valign="top"><a id="a9fce2c187cee381db4bf5276f76a39e8"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ev_ssize_t</b>   ssize_t</td></tr>
<tr class="separator:a9fce2c187cee381db4bf5276f76a39e8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9cc03c0ef4fc4327e373b079528ca049"><td class="memItemLeft" align="right" valign="top"><a id="a9cc03c0ef4fc4327e373b079528ca049"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ev_uint16_t</b>   ...</td></tr>
<tr class="separator:a9cc03c0ef4fc4327e373b079528ca049"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a43b2386e75123100c6179f7f14f8fda2"><td class="memItemLeft" align="right" valign="top"><a id="a43b2386e75123100c6179f7f14f8fda2"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ev_uint32_t</b>   ...</td></tr>
<tr class="separator:a43b2386e75123100c6179f7f14f8fda2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a58f6d4822116b1492238ea9b0b1469f9"><td class="memItemLeft" align="right" valign="top"><a id="a58f6d4822116b1492238ea9b0b1469f9"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ev_uint64_t</b>   ...</td></tr>
<tr class="separator:a58f6d4822116b1492238ea9b0b1469f9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad9052cd1d14b92812de0796d84af5604"><td class="memItemLeft" align="right" valign="top"><a id="ad9052cd1d14b92812de0796d84af5604"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ev_uint8_t</b>   ...</td></tr>
<tr class="separator:ad9052cd1d14b92812de0796d84af5604"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6bf36939a205bd52df25c40fe44b7fd7"><td class="memItemLeft" align="right" valign="top"><a id="a6bf36939a205bd52df25c40fe44b7fd7"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ev_uintptr_t</b>   ev_uint32_t</td></tr>
<tr class="separator:a6bf36939a205bd52df25c40fe44b7fd7"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader">Limits for integer types</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>These macros hold the largest or smallest values possible for the ev_[u]int*_t types. </p>
</div></td></tr>
<tr class="memitem:af6271a010b87f8e78edfb3d576d16909"><td class="memItemLeft" align="right" valign="top"><a id="af6271a010b87f8e78edfb3d576d16909"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EV_INT16_MAX</b>   ((ev_int16_t) 0x7fffL)</td></tr>
<tr class="separator:af6271a010b87f8e78edfb3d576d16909"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a10afd44462363963e6cdfc20e10d250a"><td class="memItemLeft" align="right" valign="top"><a id="a10afd44462363963e6cdfc20e10d250a"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EV_INT16_MIN</b>   ((-EV_INT16_MAX) - 1)</td></tr>
<tr class="separator:a10afd44462363963e6cdfc20e10d250a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adbfb8c4ad3c2b8d2bec82787c9f0eaa3"><td class="memItemLeft" align="right" valign="top"><a id="adbfb8c4ad3c2b8d2bec82787c9f0eaa3"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EV_INT32_MAX</b>   ((ev_int32_t) 0x7fffffffL)</td></tr>
<tr class="separator:adbfb8c4ad3c2b8d2bec82787c9f0eaa3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7899efdfa42ebe54093c85fbc35ba8e5"><td class="memItemLeft" align="right" valign="top"><a id="a7899efdfa42ebe54093c85fbc35ba8e5"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EV_INT32_MIN</b>   ((-EV_INT32_MAX) - 1)</td></tr>
<tr class="separator:a7899efdfa42ebe54093c85fbc35ba8e5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7a5b615c4a5ffb69122263c69d8bb091"><td class="memItemLeft" align="right" valign="top"><a id="a7a5b615c4a5ffb69122263c69d8bb091"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EV_INT64_MAX</b>   ((((ev_int64_t) 0x7fffffffL) << 32) | 0xffffffffL)</td></tr>
<tr class="separator:a7a5b615c4a5ffb69122263c69d8bb091"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a20073b67f3e9cdda20215246b11c4f6d"><td class="memItemLeft" align="right" valign="top"><a id="a20073b67f3e9cdda20215246b11c4f6d"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EV_INT64_MIN</b>   ((-EV_INT64_MAX) - 1)</td></tr>
<tr class="separator:a20073b67f3e9cdda20215246b11c4f6d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae959d5851ca0690f9da6e47fbb8056c9"><td class="memItemLeft" align="right" valign="top"><a id="ae959d5851ca0690f9da6e47fbb8056c9"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EV_INT8_MAX</b>   127</td></tr>
<tr class="separator:ae959d5851ca0690f9da6e47fbb8056c9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa4adcc386a7cb06436af4618301c8b03"><td class="memItemLeft" align="right" valign="top"><a id="aa4adcc386a7cb06436af4618301c8b03"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EV_INT8_MIN</b>   ((-EV_INT8_MAX) - 1)</td></tr>
<tr class="separator:aa4adcc386a7cb06436af4618301c8b03"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af85ec3c0198df9bbb370d9c70f1fd2f4"><td class="memItemLeft" align="right" valign="top"><a id="af85ec3c0198df9bbb370d9c70f1fd2f4"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EV_UINT16_MAX</b>   ((ev_uint16_t)0xffffUL)</td></tr>
<tr class="separator:af85ec3c0198df9bbb370d9c70f1fd2f4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a815ab1b931ad8d2b11da526b9071282a"><td class="memItemLeft" align="right" valign="top"><a id="a815ab1b931ad8d2b11da526b9071282a"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EV_UINT32_MAX</b>   ((ev_uint32_t)0xffffffffUL)</td></tr>
<tr class="separator:a815ab1b931ad8d2b11da526b9071282a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a34cff4b5f64165a133fd51d3004964db"><td class="memItemLeft" align="right" valign="top"><a id="a34cff4b5f64165a133fd51d3004964db"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EV_UINT64_MAX</b>   ((((ev_uint64_t)0xffffffffUL) << 32) | 0xffffffffUL)</td></tr>
<tr class="separator:a34cff4b5f64165a133fd51d3004964db"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8af5a509193ad75cdd20e77a8422d84d"><td class="memItemLeft" align="right" valign="top"><a id="a8af5a509193ad75cdd20e77a8422d84d"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EV_UINT8_MAX</b>   255</td></tr>
<tr class="separator:a8af5a509193ad75cdd20e77a8422d84d"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader">Limits for SIZE_T and SSIZE_T</div></td></tr>
<tr class="memitem:a2b6a9c2fa6a1ba42d79e2f9118f9670c"><td class="memItemLeft" align="right" valign="top"><a id="a2b6a9c2fa6a1ba42d79e2f9118f9670c"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EV_SIZE_MAX</b>   ...</td></tr>
<tr class="separator:a2b6a9c2fa6a1ba42d79e2f9118f9670c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a142028f0a0d7248168a3aaca652851c3"><td class="memItemLeft" align="right" valign="top"><a id="a142028f0a0d7248168a3aaca652851c3"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EV_SSIZE_MAX</b>   ...</td></tr>
<tr class="separator:a142028f0a0d7248168a3aaca652851c3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a59e6c7724ce1f7e0562d6e24021acb10"><td class="memItemLeft" align="right" valign="top"><a id="a59e6c7724ce1f7e0562d6e24021acb10"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EV_SSIZE_MIN</b>   ((-EV_SSIZE_MAX) - 1)</td></tr>
<tr class="separator:a59e6c7724ce1f7e0562d6e24021acb10"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader">Socket error functions</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>These functions are needed for making programs compatible between Windows and Unix-like platforms.</p>
<p>You see, Winsock handles socket errors differently from the rest of the world. Elsewhere, a socket error is like any other error and is stored in errno. But winsock functions require you to retrieve the error with a special function, and don't let you use strerror for the error codes. And handling EWOULDBLOCK is ... different. </p>
</div></td></tr>
<tr class="memitem:a3c79bbe4f3ac17dd484e6d5c262b17df"><td class="memItemLeft" align="right" valign="top"><a id="a3c79bbe4f3ac17dd484e6d5c262b17df"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EVUTIL_INVALID_SOCKET</b>   -1</td></tr>
<tr class="separator:a3c79bbe4f3ac17dd484e6d5c262b17df"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae8b4fae7790599f7b58e8c269f6b29d8"><td class="memItemLeft" align="right" valign="top"><a id="ae8b4fae7790599f7b58e8c269f6b29d8"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#ae8b4fae7790599f7b58e8c269f6b29d8">EVUTIL_SET_SOCKET_ERROR</a>(errcode)   ...</td></tr>
<tr class="memdesc:ae8b4fae7790599f7b58e8c269f6b29d8"><td class="mdescLeft"> </td><td class="mdescRight">Replace the most recent socket error with errcode. <br /></td></tr>
<tr class="separator:ae8b4fae7790599f7b58e8c269f6b29d8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9a94a2e72982e708333486cf72aab941"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a9a94a2e72982e708333486cf72aab941">EVUTIL_SOCKET_ERROR</a>()   ...</td></tr>
<tr class="memdesc:a9a94a2e72982e708333486cf72aab941"><td class="mdescLeft"> </td><td class="mdescRight">Return the most recent socket error. <a href="util_8h.html#a9a94a2e72982e708333486cf72aab941">More...</a><br /></td></tr>
<tr class="separator:a9a94a2e72982e708333486cf72aab941"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad5ea5ef81ddcfb299e4867d362ad8654"><td class="memItemLeft" align="right" valign="top"><a id="ad5ea5ef81ddcfb299e4867d362ad8654"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#ad5ea5ef81ddcfb299e4867d362ad8654">evutil_socket_error_to_string</a>(errcode)   ...</td></tr>
<tr class="memdesc:ad5ea5ef81ddcfb299e4867d362ad8654"><td class="mdescLeft"> </td><td class="mdescRight">Convert a socket error to a string. <br /></td></tr>
<tr class="separator:ad5ea5ef81ddcfb299e4867d362ad8654"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a28f952fb0f16b057d931fd38ee9bdf5e"><td class="memItemLeft" align="right" valign="top"><a id="a28f952fb0f16b057d931fd38ee9bdf5e"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a28f952fb0f16b057d931fd38ee9bdf5e">evutil_socket_geterror</a>(sock)   ...</td></tr>
<tr class="memdesc:a28f952fb0f16b057d931fd38ee9bdf5e"><td class="mdescLeft"> </td><td class="mdescRight">Return the most recent socket error to occur on sock. <br /></td></tr>
<tr class="separator:a28f952fb0f16b057d931fd38ee9bdf5e"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader">Manipulation macros for struct timeval.</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>We define replacements for timeradd, timersub, timerclear, timercmp, and timerisset. </p>
</div></td></tr>
<tr class="memitem:a6182f91a8aede88fac748b3f424cbb6d"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>evutil_timeradd</b>(tvp, uvp, vvp)</td></tr>
<tr class="separator:a6182f91a8aede88fac748b3f424cbb6d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:add4999b82eab8bcb8becc8cb079341a0"><td class="memItemLeft" align="right" valign="top"><a id="add4999b82eab8bcb8becc8cb079341a0"></a>
#define </td><td class="memItemRight" valign="bottom"><b>evutil_timerclear</b>(tvp)   (tvp)->tv_sec = (tvp)->tv_usec = 0</td></tr>
<tr class="separator:add4999b82eab8bcb8becc8cb079341a0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab75cdb8eae7b33eac738c46356967399"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>evutil_timersub</b>(tvp, uvp, vvp)</td></tr>
<tr class="separator:ab75cdb8eae7b33eac738c46356967399"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader">evutil_getaddrinfo() error codes</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>These values are possible error codes for <a class="el" href="util_8h.html#a0f36c2fc48c644a4f56347a25c585cc9" title="This function clones getaddrinfo for systems that don't have it.">evutil_getaddrinfo()</a> and related functions. </p>
</div></td></tr>
<tr class="memitem:a1162c61313f61eff48a9533a3309f739"><td class="memItemLeft" align="right" valign="top"><a id="a1162c61313f61eff48a9533a3309f739"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EVUTIL_AI_ADDRCONFIG</b>   0x40000</td></tr>
<tr class="separator:a1162c61313f61eff48a9533a3309f739"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a437bacd5a8915b541a3e38c965932297"><td class="memItemLeft" align="right" valign="top"><a id="a437bacd5a8915b541a3e38c965932297"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EVUTIL_AI_ALL</b>   0x20000</td></tr>
<tr class="separator:a437bacd5a8915b541a3e38c965932297"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1b1fbbc2f3b038e60fd97a620bff9230"><td class="memItemLeft" align="right" valign="top"><a id="a1b1fbbc2f3b038e60fd97a620bff9230"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EVUTIL_AI_CANONNAME</b>   0x2000</td></tr>
<tr class="separator:a1b1fbbc2f3b038e60fd97a620bff9230"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a145a3766f56a33a6d845cfd0dba1890d"><td class="memItemLeft" align="right" valign="top"><a id="a145a3766f56a33a6d845cfd0dba1890d"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EVUTIL_AI_NUMERICHOST</b>   0x4000</td></tr>
<tr class="separator:a145a3766f56a33a6d845cfd0dba1890d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a067c788a683f74e43e87098a68b37e69"><td class="memItemLeft" align="right" valign="top"><a id="a067c788a683f74e43e87098a68b37e69"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EVUTIL_AI_NUMERICSERV</b>   0x8000</td></tr>
<tr class="separator:a067c788a683f74e43e87098a68b37e69"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2611f48d74207f6e996189e71ca9742f"><td class="memItemLeft" align="right" valign="top"><a id="a2611f48d74207f6e996189e71ca9742f"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EVUTIL_AI_PASSIVE</b>   0x1000</td></tr>
<tr class="separator:a2611f48d74207f6e996189e71ca9742f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abbc6a3beb4ecf5b653a871949a49b53a"><td class="memItemLeft" align="right" valign="top"><a id="abbc6a3beb4ecf5b653a871949a49b53a"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EVUTIL_AI_V4MAPPED</b>   0x10000</td></tr>
<tr class="separator:abbc6a3beb4ecf5b653a871949a49b53a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aaf1a2e7213ceab1be80a752ec8cbd109"><td class="memItemLeft" align="right" valign="top"><a id="aaf1a2e7213ceab1be80a752ec8cbd109"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EVUTIL_EAI_ADDRFAMILY</b>   -901</td></tr>
<tr class="separator:aaf1a2e7213ceab1be80a752ec8cbd109"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae1cb726c0bf1ff8907dfc3b4171742ac"><td class="memItemLeft" align="right" valign="top"><a id="ae1cb726c0bf1ff8907dfc3b4171742ac"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EVUTIL_EAI_AGAIN</b>   -902</td></tr>
<tr class="separator:ae1cb726c0bf1ff8907dfc3b4171742ac"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac5f1ed6215f25714f371551cb7467ad7"><td class="memItemLeft" align="right" valign="top"><a id="ac5f1ed6215f25714f371551cb7467ad7"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EVUTIL_EAI_BADFLAGS</b>   -903</td></tr>
<tr class="separator:ac5f1ed6215f25714f371551cb7467ad7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a34127164b338d82707034566b100b4cb"><td class="memItemLeft" align="right" valign="top"><a id="a34127164b338d82707034566b100b4cb"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EVUTIL_EAI_CANCEL</b>   -90001</td></tr>
<tr class="separator:a34127164b338d82707034566b100b4cb"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a76916ba557e677dafe9c1fd7da89f2b3"><td class="memItemLeft" align="right" valign="top"><a id="a76916ba557e677dafe9c1fd7da89f2b3"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EVUTIL_EAI_FAIL</b>   -904</td></tr>
<tr class="separator:a76916ba557e677dafe9c1fd7da89f2b3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0df5ae5495d39cb471ef5403c2823ab4"><td class="memItemLeft" align="right" valign="top"><a id="a0df5ae5495d39cb471ef5403c2823ab4"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EVUTIL_EAI_FAMILY</b>   -905</td></tr>
<tr class="separator:a0df5ae5495d39cb471ef5403c2823ab4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a03351808979dfac04060773ebfd3c06b"><td class="memItemLeft" align="right" valign="top"><a id="a03351808979dfac04060773ebfd3c06b"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EVUTIL_EAI_MEMORY</b>   -906</td></tr>
<tr class="separator:a03351808979dfac04060773ebfd3c06b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1d7b69a78006c0f48d88f88e9b55334b"><td class="memItemLeft" align="right" valign="top"><a id="a1d7b69a78006c0f48d88f88e9b55334b"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EVUTIL_EAI_NODATA</b>   -907</td></tr>
<tr class="separator:a1d7b69a78006c0f48d88f88e9b55334b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab100c4d4e222d5cdfa2aebcf3a0140e9"><td class="memItemLeft" align="right" valign="top"><a id="ab100c4d4e222d5cdfa2aebcf3a0140e9"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EVUTIL_EAI_NONAME</b>   -908</td></tr>
<tr class="separator:ab100c4d4e222d5cdfa2aebcf3a0140e9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab2cc1d8d4eead1bc0e15eaae2edaf668"><td class="memItemLeft" align="right" valign="top"><a id="ab2cc1d8d4eead1bc0e15eaae2edaf668"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EVUTIL_EAI_SERVICE</b>   -909</td></tr>
<tr class="separator:ab2cc1d8d4eead1bc0e15eaae2edaf668"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac30b335f48757b2ba10da69f80a87a46"><td class="memItemLeft" align="right" valign="top"><a id="ac30b335f48757b2ba10da69f80a87a46"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EVUTIL_EAI_SOCKTYPE</b>   -910</td></tr>
<tr class="separator:ac30b335f48757b2ba10da69f80a87a46"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a03273ded49de60ab08e489b7d5d5e17e"><td class="memItemLeft" align="right" valign="top"><a id="a03273ded49de60ab08e489b7d5d5e17e"></a>
#define </td><td class="memItemRight" valign="bottom"><b>EVUTIL_EAI_SYSTEM</b>   -911</td></tr>
<tr class="separator:a03273ded49de60ab08e489b7d5d5e17e"><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:aae46d8f8407906b79216f9be88803126"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#aae46d8f8407906b79216f9be88803126">evutil_ascii_strcasecmp</a> (const char *str1, const char *str2)</td></tr>
<tr class="memdesc:aae46d8f8407906b79216f9be88803126"><td class="mdescLeft"> </td><td class="mdescRight">As strcasecmp, but always compares the characters in locale-independent ASCII. <a href="util_8h.html#aae46d8f8407906b79216f9be88803126">More...</a><br /></td></tr>
<tr class="separator:aae46d8f8407906b79216f9be88803126"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a03b44d66883df5bfed32c9ac6df93aac"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a03b44d66883df5bfed32c9ac6df93aac">evutil_ascii_strncasecmp</a> (const char *str1, const char *str2, size_t n)</td></tr>
<tr class="memdesc:a03b44d66883df5bfed32c9ac6df93aac"><td class="mdescLeft"> </td><td class="mdescRight">As strncasecmp, but always compares the characters in locale-independent ASCII. <a href="util_8h.html#a03b44d66883df5bfed32c9ac6df93aac">More...</a><br /></td></tr>
<tr class="separator:a03b44d66883df5bfed32c9ac6df93aac"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5cfa6c13c62d17570a7d5f6d3541ff5b"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a5cfa6c13c62d17570a7d5f6d3541ff5b">evutil_closesocket</a> (<a class="el" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> sock)</td></tr>
<tr class="memdesc:a5cfa6c13c62d17570a7d5f6d3541ff5b"><td class="mdescLeft"> </td><td class="mdescRight">Do the platform-specific call needed to close a socket returned from socket() or accept(). <a href="util_8h.html#a5cfa6c13c62d17570a7d5f6d3541ff5b">More...</a><br /></td></tr>
<tr class="separator:a5cfa6c13c62d17570a7d5f6d3541ff5b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab486d1e10fd1e3102b4e53beed8d9baa"><td class="memItemLeft" align="right" valign="top"><a id="ab486d1e10fd1e3102b4e53beed8d9baa"></a>
EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#ab486d1e10fd1e3102b4e53beed8d9baa">evutil_configure_monotonic_time</a> (struct <a class="el" href="structevutil__monotonic__timer.html">evutil_monotonic_timer</a> *timer, int flags)</td></tr>
<tr class="memdesc:ab486d1e10fd1e3102b4e53beed8d9baa"><td class="mdescLeft"> </td><td class="mdescRight">Set up a struct <a class="el" href="structevutil__monotonic__timer.html" title="Structure to hold information about a monotonic timer.">evutil_monotonic_timer</a>; flags can include EV_MONOT_PRECISE and EV_MONOT_FALLBACK. <br /></td></tr>
<tr class="separator:ab486d1e10fd1e3102b4e53beed8d9baa"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9d2f7f9996a6ff28db2aeb8ac8a58187"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a9d2f7f9996a6ff28db2aeb8ac8a58187">evutil_date_rfc1123</a> (char *date, const size_t datelen, const struct tm *tm)</td></tr>
<tr class="memdesc:a9d2f7f9996a6ff28db2aeb8ac8a58187"><td class="mdescLeft"> </td><td class="mdescRight">Format a date string using RFC 1123 format (used in HTTP). <a href="util_8h.html#a9d2f7f9996a6ff28db2aeb8ac8a58187">More...</a><br /></td></tr>
<tr class="separator:a9d2f7f9996a6ff28db2aeb8ac8a58187"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a58a472b3afc5cef1e6b1c9912604381b"><td class="memItemLeft" align="right" valign="top"><a id="a58a472b3afc5cef1e6b1c9912604381b"></a>
EVENT2_EXPORT_SYMBOL void </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a58a472b3afc5cef1e6b1c9912604381b">evutil_freeaddrinfo</a> (struct <a class="el" href="structevutil__addrinfo.html">evutil_addrinfo</a> *ai)</td></tr>
<tr class="memdesc:a58a472b3afc5cef1e6b1c9912604381b"><td class="mdescLeft"> </td><td class="mdescRight">Release storage allocated by evutil_getaddrinfo or evdns_getaddrinfo. <br /></td></tr>
<tr class="separator:a58a472b3afc5cef1e6b1c9912604381b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aef926a2044f1b23807f7f8387dc6d2e5"><td class="memItemLeft" align="right" valign="top"><a id="aef926a2044f1b23807f7f8387dc6d2e5"></a>
const EVENT2_EXPORT_SYMBOL char * </td><td class="memItemRight" valign="bottom"><b>evutil_gai_strerror</b> (int err)</td></tr>
<tr class="separator:aef926a2044f1b23807f7f8387dc6d2e5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0f36c2fc48c644a4f56347a25c585cc9"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a0f36c2fc48c644a4f56347a25c585cc9">evutil_getaddrinfo</a> (const char *nodename, const char *servname, const struct <a class="el" href="structevutil__addrinfo.html">evutil_addrinfo</a> *hints_in, struct <a class="el" href="structevutil__addrinfo.html">evutil_addrinfo</a> **res)</td></tr>
<tr class="memdesc:a0f36c2fc48c644a4f56347a25c585cc9"><td class="mdescLeft"> </td><td class="mdescRight">This function clones getaddrinfo for systems that don't have it. <a href="util_8h.html#a0f36c2fc48c644a4f56347a25c585cc9">More...</a><br /></td></tr>
<tr class="separator:a0f36c2fc48c644a4f56347a25c585cc9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abe94df86960981b69411f20c0c5235dc"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#abe94df86960981b69411f20c0c5235dc">evutil_gettime_monotonic</a> (struct <a class="el" href="structevutil__monotonic__timer.html">evutil_monotonic_timer</a> *timer, struct timeval *tp)</td></tr>
<tr class="memdesc:abe94df86960981b69411f20c0c5235dc"><td class="mdescLeft"> </td><td class="mdescRight">Query the current monotonic time from a struct <a class="el" href="structevutil__monotonic__timer.html" title="Structure to hold information about a monotonic timer.">evutil_monotonic_timer</a> previously configured with <a class="el" href="util_8h.html#ab486d1e10fd1e3102b4e53beed8d9baa" title="Set up a struct evutil_monotonic_timer; flags can include EV_MONOT_PRECISE and EV_MONOT_FALLBACK.">evutil_configure_monotonic_time()</a>. <a href="util_8h.html#abe94df86960981b69411f20c0c5235dc">More...</a><br /></td></tr>
<tr class="separator:abe94df86960981b69411f20c0c5235dc"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a12557f3d4c54dd80fc13f07b28ec20fd"><td class="memItemLeft" align="right" valign="top"><a id="a12557f3d4c54dd80fc13f07b28ec20fd"></a>
EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><b>evutil_gettimeofday</b> (struct timeval *tv, struct timezone *tz)</td></tr>
<tr class="separator:a12557f3d4c54dd80fc13f07b28ec20fd"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afa98d48bdd6ad06c1fd013a44621d567"><td class="memItemLeft" align="right" valign="top">const EVENT2_EXPORT_SYMBOL char * </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#afa98d48bdd6ad06c1fd013a44621d567">evutil_inet_ntop</a> (int af, const void *src, char *dst, size_t len)</td></tr>
<tr class="memdesc:afa98d48bdd6ad06c1fd013a44621d567"><td class="mdescLeft"> </td><td class="mdescRight">Replacement for inet_ntop for platforms which lack it. <a href="util_8h.html#afa98d48bdd6ad06c1fd013a44621d567">More...</a><br /></td></tr>
<tr class="separator:afa98d48bdd6ad06c1fd013a44621d567"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4065af1c9c995010ef7df66154c313b2"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a4065af1c9c995010ef7df66154c313b2">evutil_inet_pton</a> (int af, const char *src, void *dst)</td></tr>
<tr class="memdesc:a4065af1c9c995010ef7df66154c313b2"><td class="mdescLeft"> </td><td class="mdescRight">Replacement for inet_pton for platforms which lack it. <a href="util_8h.html#a4065af1c9c995010ef7df66154c313b2">More...</a><br /></td></tr>
<tr class="separator:a4065af1c9c995010ef7df66154c313b2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad586fc57f596616d810a8b5fe4f8c111"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#ad586fc57f596616d810a8b5fe4f8c111">evutil_inet_pton_scope</a> (int af, const char *src, void *dst, unsigned *indexp)</td></tr>
<tr class="memdesc:ad586fc57f596616d810a8b5fe4f8c111"><td class="mdescLeft"> </td><td class="mdescRight">Variation of inet_pton that also parses IPv6 scopes. <a href="util_8h.html#ad586fc57f596616d810a8b5fe4f8c111">More...</a><br /></td></tr>
<tr class="separator:ad586fc57f596616d810a8b5fe4f8c111"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad361aa5727c88f05633a9032ad8c850f"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#ad361aa5727c88f05633a9032ad8c850f">evutil_make_listen_socket_ipv6only</a> (<a class="el" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> sock)</td></tr>
<tr class="memdesc:ad361aa5727c88f05633a9032ad8c850f"><td class="mdescLeft"> </td><td class="mdescRight">Set ipv6 only bind socket option to make listener work only in ipv6 sockets. <a href="util_8h.html#ad361aa5727c88f05633a9032ad8c850f">More...</a><br /></td></tr>
<tr class="separator:ad361aa5727c88f05633a9032ad8c850f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a031699658b52069610d660919d0c2b9d"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a031699658b52069610d660919d0c2b9d">evutil_make_listen_socket_not_ipv6only</a> (<a class="el" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> sock)</td></tr>
<tr class="memdesc:a031699658b52069610d660919d0c2b9d"><td class="mdescLeft"> </td><td class="mdescRight">Set ipv6 only bind socket option to make listener work in both ipv4 and ipv6 sockets. <a href="util_8h.html#a031699658b52069610d660919d0c2b9d">More...</a><br /></td></tr>
<tr class="separator:a031699658b52069610d660919d0c2b9d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7a8e18b7861ed856bde592257f6b6e11"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a7a8e18b7861ed856bde592257f6b6e11">evutil_make_listen_socket_reuseable</a> (<a class="el" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> sock)</td></tr>
<tr class="memdesc:a7a8e18b7861ed856bde592257f6b6e11"><td class="mdescLeft"> </td><td class="mdescRight">Do platform-specific operations to make a listener socket reusable. <a href="util_8h.html#a7a8e18b7861ed856bde592257f6b6e11">More...</a><br /></td></tr>
<tr class="separator:a7a8e18b7861ed856bde592257f6b6e11"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9e4e68f77ce876ceecc6fb65f2dbe506"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a9e4e68f77ce876ceecc6fb65f2dbe506">evutil_make_listen_socket_reuseable_port</a> (<a class="el" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> sock)</td></tr>
<tr class="memdesc:a9e4e68f77ce876ceecc6fb65f2dbe506"><td class="mdescLeft"> </td><td class="mdescRight">Do platform-specific operations to make a listener port reusable. <a href="util_8h.html#a9e4e68f77ce876ceecc6fb65f2dbe506">More...</a><br /></td></tr>
<tr class="separator:a9e4e68f77ce876ceecc6fb65f2dbe506"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7edc3874139e863f61edf6c705030430"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a7edc3874139e863f61edf6c705030430">evutil_make_socket_closeonexec</a> (<a class="el" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> sock)</td></tr>
<tr class="memdesc:a7edc3874139e863f61edf6c705030430"><td class="mdescLeft"> </td><td class="mdescRight">Do platform-specific operations as needed to close a socket upon a successful execution of one of the exec*() functions. <a href="util_8h.html#a7edc3874139e863f61edf6c705030430">More...</a><br /></td></tr>
<tr class="separator:a7edc3874139e863f61edf6c705030430"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4f8f2384311baf5d7308c7ab079f9b84"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a4f8f2384311baf5d7308c7ab079f9b84">evutil_make_socket_nonblocking</a> (<a class="el" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> sock)</td></tr>
<tr class="memdesc:a4f8f2384311baf5d7308c7ab079f9b84"><td class="mdescLeft"> </td><td class="mdescRight">Do platform-specific operations as needed to make a socket nonblocking. <a href="util_8h.html#a4f8f2384311baf5d7308c7ab079f9b84">More...</a><br /></td></tr>
<tr class="separator:a4f8f2384311baf5d7308c7ab079f9b84"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a988b1fc98edeac63efc8b13c4f822a0d"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a988b1fc98edeac63efc8b13c4f822a0d">evutil_make_tcp_listen_socket_deferred</a> (<a class="el" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> sock)</td></tr>
<tr class="memdesc:a988b1fc98edeac63efc8b13c4f822a0d"><td class="mdescLeft"> </td><td class="mdescRight">Do platform-specific operations, if possible, to make a tcp listener socket defer accept()s until there is data to read. <a href="util_8h.html#a988b1fc98edeac63efc8b13c4f822a0d">More...</a><br /></td></tr>
<tr class="separator:a988b1fc98edeac63efc8b13c4f822a0d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2874062ff988293cd4e40b220933e209"><td class="memItemLeft" align="right" valign="top"><a id="a2874062ff988293cd4e40b220933e209"></a>
EVENT2_EXPORT_SYMBOL void </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a2874062ff988293cd4e40b220933e209">evutil_monotonic_timer_free</a> (struct <a class="el" href="structevutil__monotonic__timer.html">evutil_monotonic_timer</a> *timer)</td></tr>
<tr class="memdesc:a2874062ff988293cd4e40b220933e209"><td class="mdescLeft"> </td><td class="mdescRight">Free a struct <a class="el" href="structevutil__monotonic__timer.html" title="Structure to hold information about a monotonic timer.">evutil_monotonic_timer</a> that was allocated using <a class="el" href="util_8h.html#a87b00e2754d908ba05c5aa8e9c8e4f28" title="Allocate a new struct evutil_monotonic_timer for use with the evutil_configure_monotonic_time() and e...">evutil_monotonic_timer_new()</a>. <br /></td></tr>
<tr class="separator:a2874062ff988293cd4e40b220933e209"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a87b00e2754d908ba05c5aa8e9c8e4f28"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL struct <a class="el" href="structevutil__monotonic__timer.html">evutil_monotonic_timer</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a87b00e2754d908ba05c5aa8e9c8e4f28">evutil_monotonic_timer_new</a> (void)</td></tr>
<tr class="memdesc:a87b00e2754d908ba05c5aa8e9c8e4f28"><td class="mdescLeft"> </td><td class="mdescRight">Allocate a new struct <a class="el" href="structevutil__monotonic__timer.html" title="Structure to hold information about a monotonic timer.">evutil_monotonic_timer</a> for use with the <a class="el" href="util_8h.html#ab486d1e10fd1e3102b4e53beed8d9baa" title="Set up a struct evutil_monotonic_timer; flags can include EV_MONOT_PRECISE and EV_MONOT_FALLBACK.">evutil_configure_monotonic_time()</a> and <a class="el" href="util_8h.html#abe94df86960981b69411f20c0c5235dc" title="Query the current monotonic time from a struct evutil_monotonic_timer previously configured with evut...">evutil_gettime_monotonic()</a> functions. <a href="util_8h.html#a87b00e2754d908ba05c5aa8e9c8e4f28">More...</a><br /></td></tr>
<tr class="separator:a87b00e2754d908ba05c5aa8e9c8e4f28"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a97d4f315d5c40c4f604f6c9ae694a684"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a97d4f315d5c40c4f604f6c9ae694a684">evutil_parse_sockaddr_port</a> (const char *str, struct sockaddr *out, int *outlen)</td></tr>
<tr class="memdesc:a97d4f315d5c40c4f604f6c9ae694a684"><td class="mdescLeft"> </td><td class="mdescRight">Parse an IPv4 or IPv6 address, with optional port, from a string. <a href="util_8h.html#a97d4f315d5c40c4f604f6c9ae694a684">More...</a><br /></td></tr>
<tr class="separator:a97d4f315d5c40c4f604f6c9ae694a684"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3b5b7d22b368ffdd6ed77838bf4fcea6"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL void </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a3b5b7d22b368ffdd6ed77838bf4fcea6">evutil_secure_rng_add_bytes</a> (const char *dat, size_t datlen)</td></tr>
<tr class="memdesc:a3b5b7d22b368ffdd6ed77838bf4fcea6"><td class="mdescLeft"> </td><td class="mdescRight">Seed the random number generator with extra random bytes. <a href="util_8h.html#a3b5b7d22b368ffdd6ed77838bf4fcea6">More...</a><br /></td></tr>
<tr class="separator:a3b5b7d22b368ffdd6ed77838bf4fcea6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0836ed5d00ccab1957419a07b7acbb56"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL void </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a0836ed5d00ccab1957419a07b7acbb56">evutil_secure_rng_get_bytes</a> (void *buf, size_t n)</td></tr>
<tr class="memdesc:a0836ed5d00ccab1957419a07b7acbb56"><td class="mdescLeft"> </td><td class="mdescRight">Generate n bytes of secure pseudorandom data, and store them in buf. <a href="util_8h.html#a0836ed5d00ccab1957419a07b7acbb56">More...</a><br /></td></tr>
<tr class="separator:a0836ed5d00ccab1957419a07b7acbb56"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a49ffe53dcbe32ad55f1582a0da358ac0"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a49ffe53dcbe32ad55f1582a0da358ac0">evutil_secure_rng_init</a> (void)</td></tr>
<tr class="memdesc:a49ffe53dcbe32ad55f1582a0da358ac0"><td class="mdescLeft"> </td><td class="mdescRight">Seed the secure random number generator if needed, and return 0 on success or -1 on failure. <a href="util_8h.html#a49ffe53dcbe32ad55f1582a0da358ac0">More...</a><br /></td></tr>
<tr class="separator:a49ffe53dcbe32ad55f1582a0da358ac0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4544ddceb4e20c8c52985641ca829b7e"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a4544ddceb4e20c8c52985641ca829b7e">evutil_secure_rng_set_urandom_device_file</a> (char *fname)</td></tr>
<tr class="memdesc:a4544ddceb4e20c8c52985641ca829b7e"><td class="mdescLeft"> </td><td class="mdescRight">Set a filename to use in place of /dev/urandom for seeding the secure PRNG. <a href="util_8h.html#a4544ddceb4e20c8c52985641ca829b7e">More...</a><br /></td></tr>
<tr class="separator:a4544ddceb4e20c8c52985641ca829b7e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a96f11bb3a6bf772201a0a2010689a250"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a96f11bb3a6bf772201a0a2010689a250">evutil_set_tcp_keepalive</a> (<a class="el" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> sock, int on, int timeout)</td></tr>
<tr class="memdesc:a96f11bb3a6bf772201a0a2010689a250"><td class="mdescLeft"> </td><td class="mdescRight">Do platform-specific operations to set/unset TCP keep-alive options TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT on a socket. <a href="util_8h.html#a96f11bb3a6bf772201a0a2010689a250">More...</a><br /></td></tr>
<tr class="separator:a96f11bb3a6bf772201a0a2010689a250"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a198e8db3626746515792e28b1380be67"><td class="memItemLeft" align="right" valign="top"><a id="a198e8db3626746515792e28b1380be67"></a>
EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a198e8db3626746515792e28b1380be67">evutil_snprintf</a> (char *buf, size_t buflen, const char *format,...)</td></tr>
<tr class="memdesc:a198e8db3626746515792e28b1380be67"><td class="mdescLeft"> </td><td class="mdescRight">Replacement for snprintf to get consistent behavior on platforms for which the return value of snprintf does not conform to C99. <br /></td></tr>
<tr class="separator:a198e8db3626746515792e28b1380be67"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7b5ad1074f1effe2dbfa18b3f44b589f"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a7b5ad1074f1effe2dbfa18b3f44b589f">evutil_sockaddr_cmp</a> (const struct sockaddr *sa1, const struct sockaddr *sa2, int include_port)</td></tr>
<tr class="memdesc:a7b5ad1074f1effe2dbfa18b3f44b589f"><td class="mdescLeft"> </td><td class="mdescRight">Compare two sockaddrs; return 0 if they are equal, or less than 0 if sa1 preceeds sa2, or greater than 0 if sa1 follows sa2. <a href="util_8h.html#a7b5ad1074f1effe2dbfa18b3f44b589f">More...</a><br /></td></tr>
<tr class="separator:a7b5ad1074f1effe2dbfa18b3f44b589f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a050a74274e08eb89a53cb8cb1d617939"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a050a74274e08eb89a53cb8cb1d617939">evutil_socketpair</a> (int domain, int type, int protocol, <a class="el" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> sv[2])</td></tr>
<tr class="memdesc:a050a74274e08eb89a53cb8cb1d617939"><td class="mdescLeft"> </td><td class="mdescRight">Create two new sockets that are connected to each other. <a href="util_8h.html#a050a74274e08eb89a53cb8cb1d617939">More...</a><br /></td></tr>
<tr class="separator:a050a74274e08eb89a53cb8cb1d617939"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9175e63729c256eb2646e11e8211f4f7"><td class="memItemLeft" align="right" valign="top">EVENT2_EXPORT_SYMBOL ev_int64_t </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a9175e63729c256eb2646e11e8211f4f7">evutil_strtoll</a> (const char *s, char **endptr, int base)</td></tr>
<tr class="memdesc:a9175e63729c256eb2646e11e8211f4f7"><td class="mdescLeft"> </td><td class="mdescRight">Parse a 64-bit value from a string. <a href="util_8h.html#a9175e63729c256eb2646e11e8211f4f7">More...</a><br /></td></tr>
<tr class="separator:a9175e63729c256eb2646e11e8211f4f7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a30bbdc509d150e5dfac1f74dd4e4c212"><td class="memItemLeft" align="right" valign="top"><a id="a30bbdc509d150e5dfac1f74dd4e4c212"></a>
EVENT2_EXPORT_SYMBOL int </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8h.html#a30bbdc509d150e5dfac1f74dd4e4c212">evutil_vsnprintf</a> (char *buf, size_t buflen, const char *format, va_list ap)</td></tr>
<tr class="memdesc:a30bbdc509d150e5dfac1f74dd4e4c212"><td class="mdescLeft"> </td><td class="mdescRight">Replacement for vsnprintf to get consistent behavior on platforms for which the return value of snprintf does not conform to C99. <br /></td></tr>
<tr class="separator:a30bbdc509d150e5dfac1f74dd4e4c212"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Common convenience functions for cross-platform portability and related socket manipulations. </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a9a94a2e72982e708333486cf72aab941"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9a94a2e72982e708333486cf72aab941">◆ </a></span>EVUTIL_SOCKET_ERROR</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define EVUTIL_SOCKET_ERROR</td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td>   ...</td>
</tr>
</table>
</div><div class="memdoc">
<p>Return the most recent socket error. </p>
<p>Not idempotent on all platforms. </p>
</div>
</div>
<a id="a7ef0023565082a65020f6e56be59fd0b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7ef0023565082a65020f6e56be59fd0b">◆ </a></span>evutil_socket_t</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define evutil_socket_t   int</td>
</tr>
</table>
</div><div class="memdoc">
<p>A type wide enough to hold the output of "socket()" or "accept()". </p>
<p>On Windows, this is an intptr_t; elsewhere, it is an int. </p>
</div>
</div>
<a id="a6182f91a8aede88fac748b3f424cbb6d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6182f91a8aede88fac748b3f424cbb6d">◆ </a></span>evutil_timeradd</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define evutil_timeradd</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">tvp, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">uvp, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">vvp </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"> <span class="keywordflow">do</span> { \</div>
<div class="line"> (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \</div>
<div class="line"> (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \</div>
<div class="line"> if ((vvp)->tv_usec >= 1000000) { \</div>
<div class="line"> (vvp)->tv_sec++; \</div>
<div class="line"> (vvp)->tv_usec -= 1000000; \</div>
<div class="line"> } \</div>
<div class="line"> } <span class="keywordflow">while</span> (0)</div>
</div><!-- fragment -->
</div>
</div>
<a id="a1a42f43db6aaf6e99736329b6611175d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1a42f43db6aaf6e99736329b6611175d">◆ </a></span>evutil_timercmp</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define evutil_timercmp</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">tvp, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">uvp, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">cmp </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"> (((tvp)->tv_sec == (uvp)->tv_sec) ? \</div>
<div class="line"> ((tvp)->tv_usec cmp (uvp)->tv_usec) : \</div>
<div class="line"> ((tvp)->tv_sec cmp (uvp)->tv_sec))</div>
</div><!-- fragment -->
<p>Return true iff the tvp is related to uvp according to the relational operator cmp. </p>
<p>Recognized values for cmp are ==, <=, <, >=, and >. </p>
</div>
</div>
<a id="ab75cdb8eae7b33eac738c46356967399"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab75cdb8eae7b33eac738c46356967399">◆ </a></span>evutil_timersub</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define evutil_timersub</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">tvp, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">uvp, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">vvp </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"> <span class="keywordflow">do</span> { \</div>
<div class="line"> (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \</div>
<div class="line"> (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \</div>
<div class="line"> if ((vvp)->tv_usec < 0) { \</div>
<div class="line"> (vvp)->tv_sec--; \</div>
<div class="line"> (vvp)->tv_usec += 1000000; \</div>
<div class="line"> } \</div>
<div class="line"> } <span class="keywordflow">while</span> (0)</div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="aae46d8f8407906b79216f9be88803126"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aae46d8f8407906b79216f9be88803126">◆ </a></span>evutil_ascii_strcasecmp()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL int evutil_ascii_strcasecmp </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>str1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>str2</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>As strcasecmp, but always compares the characters in locale-independent ASCII. </p>
<p>That's useful if you're handling data in ASCII-based protocols. str1 and str2 must not be NULL. </p>
</div>
</div>
<a id="a03b44d66883df5bfed32c9ac6df93aac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a03b44d66883df5bfed32c9ac6df93aac">◆ </a></span>evutil_ascii_strncasecmp()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL int evutil_ascii_strncasecmp </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>str1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>str2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>n</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>As strncasecmp, but always compares the characters in locale-independent ASCII. </p>
<p>That's useful if you're handling data in ASCII-based protocols. </p>
</div>
</div>
<a id="a5cfa6c13c62d17570a7d5f6d3541ff5b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5cfa6c13c62d17570a7d5f6d3541ff5b">◆ </a></span>evutil_closesocket()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL int evutil_closesocket </td>
<td>(</td>
<td class="paramtype"><a class="el" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> </td>
<td class="paramname"><em>sock</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Do the platform-specific call needed to close a socket returned from socket() or accept(). </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">sock</td><td>The socket to be closed </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success (whether the operation is supported or not), -1 on failure </dd></dl>
</div>
</div>
<a id="a9d2f7f9996a6ff28db2aeb8ac8a58187"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9d2f7f9996a6ff28db2aeb8ac8a58187">◆ </a></span>evutil_date_rfc1123()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL int evutil_date_rfc1123 </td>
<td>(</td>
<td class="paramtype">char * </td>
<td class="paramname"><em>date</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const size_t </td>
<td class="paramname"><em>datelen</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const struct tm * </td>
<td class="paramname"><em>tm</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Format a date string using RFC 1123 format (used in HTTP). </p>
<p>If <code>tm</code> is NULL, current system's time will be used. The number of characters written will be returned. One should check if the return value is smaller than <code>datelen</code> to check if the result is truncated or not. </p>
</div>
</div>
<a id="a0f36c2fc48c644a4f56347a25c585cc9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0f36c2fc48c644a4f56347a25c585cc9">◆ </a></span>evutil_getaddrinfo()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL int evutil_getaddrinfo </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>nodename</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>servname</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const struct <a class="el" href="structevutil__addrinfo.html">evutil_addrinfo</a> * </td>
<td class="paramname"><em>hints_in</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="structevutil__addrinfo.html">evutil_addrinfo</a> ** </td>
<td class="paramname"><em>res</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>This function clones getaddrinfo for systems that don't have it. </p>
<p>For full details, see RFC 3493, section 6.1.</p>
<p>Limitations:</p><ul>
<li>When the system has no getaddrinfo, we fall back to gethostbyname_r or gethostbyname, with their attendant issues.</li>
<li>The AI_V4MAPPED and AI_ALL flags are not currently implemented.</li>
</ul>
<p>For a nonblocking variant, see evdns_getaddrinfo. </p>
</div>
</div>
<a id="abe94df86960981b69411f20c0c5235dc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abe94df86960981b69411f20c0c5235dc">◆ </a></span>evutil_gettime_monotonic()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL int evutil_gettime_monotonic </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structevutil__monotonic__timer.html">evutil_monotonic_timer</a> * </td>
<td class="paramname"><em>timer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct timeval * </td>
<td class="paramname"><em>tp</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Query the current monotonic time from a struct <a class="el" href="structevutil__monotonic__timer.html" title="Structure to hold information about a monotonic timer.">evutil_monotonic_timer</a> previously configured with <a class="el" href="util_8h.html#ab486d1e10fd1e3102b4e53beed8d9baa" title="Set up a struct evutil_monotonic_timer; flags can include EV_MONOT_PRECISE and EV_MONOT_FALLBACK.">evutil_configure_monotonic_time()</a>. </p>
<p>Monotonic time is guaranteed never to run in reverse, but is not necessarily epoch- based, or relative to any other definite point. Use it to make reliable measurements of elapsed time between events even when the system time may be changed.</p>
<p>It is not safe to use this function on the same timer from multiple threads. </p>
</div>
</div>
<a id="afa98d48bdd6ad06c1fd013a44621d567"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afa98d48bdd6ad06c1fd013a44621d567">◆ </a></span>evutil_inet_ntop()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const EVENT2_EXPORT_SYMBOL char* evutil_inet_ntop </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>af</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const void * </td>
<td class="paramname"><em>src</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char * </td>
<td class="paramname"><em>dst</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>Replacement for inet_ntop for platforms which lack it. </p>
<p>src must not be NULL. </p>
</div>
</div>
<a id="a4065af1c9c995010ef7df66154c313b2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4065af1c9c995010ef7df66154c313b2">◆ </a></span>evutil_inet_pton()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL int evutil_inet_pton </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>af</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>src</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"><em>dst</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Replacement for inet_pton for platforms which lack it. </p>
<p>src must not be NULL. </p>
</div>
</div>
<a id="ad586fc57f596616d810a8b5fe4f8c111"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad586fc57f596616d810a8b5fe4f8c111">◆ </a></span>evutil_inet_pton_scope()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL int evutil_inet_pton_scope </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>af</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>src</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"><em>dst</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned * </td>
<td class="paramname"><em>indexp</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Variation of inet_pton that also parses IPv6 scopes. </p>
<p>Public for unit tests. No reason to call this directly. </p>
</div>
</div>
<a id="ad361aa5727c88f05633a9032ad8c850f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad361aa5727c88f05633a9032ad8c850f">◆ </a></span>evutil_make_listen_socket_ipv6only()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL int evutil_make_listen_socket_ipv6only </td>
<td>(</td>
<td class="paramtype"><a class="el" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> </td>
<td class="paramname"><em>sock</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set ipv6 only bind socket option to make listener work only in ipv6 sockets. </p>
<p>According to RFC3493 and most Linux distributions, default value for the sockets is to work in IPv4-mapped mode. In IPv4-mapped mode, it is not possible to bind same port from different IPv4 and IPv6 handlers.</p>
<p>On Windows the default value is instead to only work in IPv6 mode.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">sock</td><td>The socket to make in ipv6only working mode </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="a031699658b52069610d660919d0c2b9d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a031699658b52069610d660919d0c2b9d">◆ </a></span>evutil_make_listen_socket_not_ipv6only()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL int evutil_make_listen_socket_not_ipv6only </td>
<td>(</td>
<td class="paramtype"><a class="el" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> </td>
<td class="paramname"><em>sock</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set ipv6 only bind socket option to make listener work in both ipv4 and ipv6 sockets. </p>
<p>According to RFC3493 and most Linux distributions, default value for the sockets is to work in IPv4-mapped mode. In IPv4-mapped mode, it is not possible to bind same port from different IPv4 and IPv6 handlers.</p>
<p>On Windows the default value is instead to only work in IPv6 mode.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">sock</td><td>The socket to make in ipv6only working mode </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="a7a8e18b7861ed856bde592257f6b6e11"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7a8e18b7861ed856bde592257f6b6e11">◆ </a></span>evutil_make_listen_socket_reuseable()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EVENT2_EXPORT_SYMBOL int evutil_make_listen_socket_reuseable </td>
<td>(</td>
<td class="paramtype"><a class="el" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> </td>
<td class="paramname"><em>sock</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">