-
Notifications
You must be signed in to change notification settings - Fork 4
/
util_8h_source.html
717 lines (715 loc) · 107 KB
/
util_8h_source.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
<!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 Source File</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="headertitle">
<div class="title">util.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="util_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * Redistribution and use in source and binary forms, with or without</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * modification, are permitted provided that the following conditions</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * are met:</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> * 1. Redistributions of source code must retain the above copyright</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> * notice, this list of conditions and the following disclaimer.</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> * notice, this list of conditions and the following disclaimer in the</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> * documentation and/or other materials provided with the distribution.</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> * 3. The name of the author may not be used to endorse or promote products</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> * derived from this software without specific prior written permission.</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> *</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"> * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment"> * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment"> * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment"> * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment"> * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="comment"> * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#ifndef EVENT2_UTIL_H_INCLUDED_</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#define EVENT2_UTIL_H_INCLUDED_</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  </div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="preprocessor">#include <event2/visibility.h></span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  </div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="keyword">extern</span> <span class="stringliteral">"C"</span> {</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  </div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="preprocessor">#include <event2/event-config.h></span></div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="preprocessor">#ifdef EVENT__HAVE_SYS_TIME_H</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="preprocessor">#include <sys/time.h></span></div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="preprocessor">#ifdef EVENT__HAVE_STDINT_H</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="preprocessor">#include <stdint.h></span></div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="preprocessor">#elif defined(EVENT__HAVE_INTTYPES_H)</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="preprocessor">#include <inttypes.h></span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <span class="preprocessor">#ifdef EVENT__HAVE_SYS_TYPES_H</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="preprocessor">#include <sys/types.h></span></div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> <span class="preprocessor">#ifdef EVENT__HAVE_STDDEF_H</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="preprocessor">#include <stddef.h></span></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="preprocessor">#ifdef _MSC_VER</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="preprocessor">#include <BaseTsd.h></span></div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span> <span class="preprocessor">#include <stdarg.h></span></div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span> <span class="preprocessor">#ifdef EVENT__HAVE_NETDB_H</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <span class="preprocessor">#include <netdb.h></span></div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  </div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="preprocessor">#ifdef _WIN32</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="preprocessor">#include <winsock2.h></span></div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="preprocessor">#ifdef EVENT__HAVE_GETADDRINFO</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <span class="comment">/* for EAI_* definitions. */</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="preprocessor">#include <ws2tcpip.h></span></div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="preprocessor">#ifdef EVENT__HAVE_ERRNO_H</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="preprocessor">#include <errno.h></span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span> <span class="preprocessor">#include <sys/socket.h></span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  </div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span> <span class="preprocessor">#include <time.h></span></div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  </div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span> <span class="preprocessor">#ifdef __sun</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <span class="preprocessor">#ifdef SO_FLOW_NAME</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span> <span class="comment">/* Since it's impossible to detect the Solaris 11.4 version via OS macros,</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="comment"> * so we check the presence of the socket option SO_FLOW_NAME that was first</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span> <span class="comment"> * introduced to Solaris 11.4 and define a custom macro for determining 11.4.</span></div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span> <span class="comment"> *</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span> <span class="comment"> * Note that this might be a false positive if the code is compiled on a system</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span> <span class="comment"> * but run on another system with an older version of Solaris.</span></div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span> <span class="preprocessor">#define EVENT__SOLARIS_11_4 (1)</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span> <span class="preprocessor">#define EVENT__SOLARIS_11_4 (0)</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  </div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span> <span class="comment">/* Some openbsd autoconf versions get the name of this macro wrong. */</span></div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span> <span class="preprocessor">#if defined(EVENT__SIZEOF_VOID__) && !defined(EVENT__SIZEOF_VOID_P)</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span> <span class="preprocessor">#define EVENT__SIZEOF_VOID_P EVENT__SIZEOF_VOID__</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  </div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span> <span class="preprocessor">#ifdef EVENT__HAVE_UINT64_T</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span> <span class="preprocessor">#define ev_uint64_t uint64_t</span></div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span> <span class="preprocessor">#define ev_int64_t int64_t</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span> <span class="preprocessor">#elif defined(_WIN32)</span></div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span> <span class="preprocessor">#define ev_uint64_t unsigned __int64</span></div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span> <span class="preprocessor">#define ev_int64_t signed __int64</span></div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span> <span class="preprocessor">#elif EVENT__SIZEOF_LONG_LONG == 8</span></div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span> <span class="preprocessor">#define ev_uint64_t unsigned long long</span></div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span> <span class="preprocessor">#define ev_int64_t long long</span></div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span> <span class="preprocessor">#elif EVENT__SIZEOF_LONG == 8</span></div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span> <span class="preprocessor">#define ev_uint64_t unsigned long</span></div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span> <span class="preprocessor">#define ev_int64_t long</span></div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span> <span class="preprocessor">#elif defined(EVENT_IN_DOXYGEN_)</span></div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span> <span class="preprocessor">#define ev_uint64_t ...</span></div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span> <span class="preprocessor">#define ev_int64_t ...</span></div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span> <span class="preprocessor">#error "No way to define ev_uint64_t"</span></div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  </div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span> <span class="preprocessor">#ifdef EVENT__HAVE_UINT32_T</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span> <span class="preprocessor">#define ev_uint32_t uint32_t</span></div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span> <span class="preprocessor">#define ev_int32_t int32_t</span></div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span> <span class="preprocessor">#elif defined(_WIN32)</span></div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span> <span class="preprocessor">#define ev_uint32_t unsigned int</span></div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span> <span class="preprocessor">#define ev_int32_t signed int</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span> <span class="preprocessor">#elif EVENT__SIZEOF_LONG == 4</span></div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span> <span class="preprocessor">#define ev_uint32_t unsigned long</span></div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span> <span class="preprocessor">#define ev_int32_t signed long</span></div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span> <span class="preprocessor">#elif EVENT__SIZEOF_INT == 4</span></div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span> <span class="preprocessor">#define ev_uint32_t unsigned int</span></div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span> <span class="preprocessor">#define ev_int32_t signed int</span></div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span> <span class="preprocessor">#elif defined(EVENT_IN_DOXYGEN_)</span></div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span> <span class="preprocessor">#define ev_uint32_t ...</span></div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span> <span class="preprocessor">#define ev_int32_t ...</span></div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span> <span class="preprocessor">#error "No way to define ev_uint32_t"</span></div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  </div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span> <span class="preprocessor">#ifdef EVENT__HAVE_UINT16_T</span></div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span> <span class="preprocessor">#define ev_uint16_t uint16_t</span></div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span> <span class="preprocessor">#define ev_int16_t int16_t</span></div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span> <span class="preprocessor">#elif defined(_WIN32)</span></div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span> <span class="preprocessor">#define ev_uint16_t unsigned short</span></div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span> <span class="preprocessor">#define ev_int16_t signed short</span></div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span> <span class="preprocessor">#elif EVENT__SIZEOF_INT == 2</span></div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span> <span class="preprocessor">#define ev_uint16_t unsigned int</span></div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span> <span class="preprocessor">#define ev_int16_t signed int</span></div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span> <span class="preprocessor">#elif EVENT__SIZEOF_SHORT == 2</span></div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span> <span class="preprocessor">#define ev_uint16_t unsigned short</span></div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span> <span class="preprocessor">#define ev_int16_t signed short</span></div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span> <span class="preprocessor">#elif defined(EVENT_IN_DOXYGEN_)</span></div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span> <span class="preprocessor">#define ev_uint16_t ...</span></div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span> <span class="preprocessor">#define ev_int16_t ...</span></div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span> <span class="preprocessor">#error "No way to define ev_uint16_t"</span></div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  </div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span> <span class="preprocessor">#ifdef EVENT__HAVE_UINT8_T</span></div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span> <span class="preprocessor">#define ev_uint8_t uint8_t</span></div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span> <span class="preprocessor">#define ev_int8_t int8_t</span></div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span> <span class="preprocessor">#elif defined(EVENT_IN_DOXYGEN_)</span></div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span> <span class="preprocessor">#define ev_uint8_t ...</span></div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span> <span class="preprocessor">#define ev_int8_t ...</span></div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span> <span class="preprocessor">#define ev_uint8_t unsigned char</span></div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span> <span class="preprocessor">#define ev_int8_t signed char</span></div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  </div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span> <span class="preprocessor">#ifdef EVENT__HAVE_UINTPTR_T</span></div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span> <span class="preprocessor">#define ev_uintptr_t uintptr_t</span></div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span> <span class="preprocessor">#define ev_intptr_t intptr_t</span></div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span> <span class="preprocessor">#elif EVENT__SIZEOF_VOID_P <= 4</span></div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span> <span class="preprocessor">#define ev_uintptr_t ev_uint32_t</span></div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span> <span class="preprocessor">#define ev_intptr_t ev_int32_t</span></div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span> <span class="preprocessor">#elif EVENT__SIZEOF_VOID_P <= 8</span></div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span> <span class="preprocessor">#define ev_uintptr_t ev_uint64_t</span></div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span> <span class="preprocessor">#define ev_intptr_t ev_int64_t</span></div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span> <span class="preprocessor">#elif defined(EVENT_IN_DOXYGEN_)</span></div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span> <span class="preprocessor">#define ev_uintptr_t ...</span></div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span> <span class="preprocessor">#define ev_intptr_t ...</span></div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span> <span class="preprocessor">#error "No way to define ev_uintptr_t"</span></div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  </div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span> <span class="preprocessor">#ifdef EVENT__ssize_t</span></div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span> <span class="preprocessor">#define ev_ssize_t EVENT__ssize_t</span></div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span> <span class="preprocessor">#define ev_ssize_t ssize_t</span></div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  </div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span> <span class="comment">/* Note that we define ev_off_t based on the compile-time size of off_t that</span></div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span> <span class="comment"> * we used to build Libevent, and not based on the current size of off_t.</span></div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span> <span class="comment"> * (For example, we don't define ev_off_t to off_t.). We do this because</span></div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span> <span class="comment"> * some systems let you build your software with different off_t sizes</span></div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span> <span class="comment"> * at runtime, and so putting in any dependency on off_t would risk API</span></div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span> <span class="comment"> * mismatch.</span></div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span> <span class="preprocessor">#ifdef _WIN32</span></div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span> <span class="preprocessor">#define ev_off_t ev_int64_t</span></div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span> <span class="preprocessor">#elif EVENT__SIZEOF_OFF_T == 8</span></div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span> <span class="preprocessor">#define ev_off_t ev_int64_t</span></div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span> <span class="preprocessor">#elif EVENT__SIZEOF_OFF_T == 4</span></div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span> <span class="preprocessor">#define ev_off_t ev_int32_t</span></div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span> <span class="preprocessor">#elif defined(EVENT_IN_DOXYGEN_)</span></div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span> <span class="preprocessor">#define ev_off_t ...</span></div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span> <span class="preprocessor">#define ev_off_t off_t</span></div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  </div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span> <span class="comment">/* Limits for integer types.</span></div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span> <span class="comment"></span> </div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span> <span class="comment"> We're making two assumptions here:</span></div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span> <span class="comment"> - The compiler does constant folding properly.</span></div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span> <span class="comment"> - The platform does signed arithmetic in two's complement.</span></div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span> <span class="comment">*/</span></div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  </div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span> <span class="preprocessor">#ifndef EVENT__HAVE_STDINT_H</span></div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span> <span class="preprocessor">#define EV_UINT64_MAX ((((ev_uint64_t)0xffffffffUL) << 32) | 0xffffffffUL)</span></div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span> <span class="preprocessor">#define EV_INT64_MAX ((((ev_int64_t) 0x7fffffffL) << 32) | 0xffffffffL)</span></div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span> <span class="preprocessor">#define EV_INT64_MIN ((-EV_INT64_MAX) - 1)</span></div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span> <span class="preprocessor">#define EV_UINT32_MAX ((ev_uint32_t)0xffffffffUL)</span></div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span> <span class="preprocessor">#define EV_INT32_MAX ((ev_int32_t) 0x7fffffffL)</span></div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span> <span class="preprocessor">#define EV_INT32_MIN ((-EV_INT32_MAX) - 1)</span></div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span> <span class="preprocessor">#define EV_UINT16_MAX ((ev_uint16_t)0xffffUL)</span></div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span> <span class="preprocessor">#define EV_INT16_MAX ((ev_int16_t) 0x7fffL)</span></div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span> <span class="preprocessor">#define EV_INT16_MIN ((-EV_INT16_MAX) - 1)</span></div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span> <span class="preprocessor">#define EV_UINT8_MAX 255</span></div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span> <span class="preprocessor">#define EV_INT8_MAX 127</span></div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span> <span class="preprocessor">#define EV_INT8_MIN ((-EV_INT8_MAX) - 1)</span></div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span> <span class="preprocessor">#define EV_UINT64_MAX UINT64_MAX</span></div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span> <span class="preprocessor">#define EV_INT64_MAX INT64_MAX</span></div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span> <span class="preprocessor">#define EV_INT64_MIN INT64_MIN</span></div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span> <span class="preprocessor">#define EV_UINT32_MAX UINT32_MAX</span></div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span> <span class="preprocessor">#define EV_INT32_MAX INT32_MAX</span></div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span> <span class="preprocessor">#define EV_INT32_MIN INT32_MIN</span></div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span> <span class="preprocessor">#define EV_UINT16_MAX UINT16_MAX</span></div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span> <span class="preprocessor">#define EV_INT16_MIN INT16_MIN</span></div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span> <span class="preprocessor">#define EV_INT16_MAX INT16_MAX</span></div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span> <span class="preprocessor">#define EV_UINT8_MAX UINT8_MAX</span></div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span> <span class="preprocessor">#define EV_INT8_MAX INT8_MAX</span></div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span> <span class="preprocessor">#define EV_INT8_MIN INT8_MIN</span></div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  </div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  </div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  </div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span> <span class="preprocessor">#if EVENT__SIZEOF_SIZE_T == 8</span></div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span> <span class="preprocessor">#define EV_SIZE_MAX EV_UINT64_MAX</span></div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span> <span class="preprocessor">#define EV_SSIZE_MAX EV_INT64_MAX</span></div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span> <span class="preprocessor">#elif EVENT__SIZEOF_SIZE_T == 4</span></div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span> <span class="preprocessor">#define EV_SIZE_MAX EV_UINT32_MAX</span></div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span> <span class="preprocessor">#define EV_SSIZE_MAX EV_INT32_MAX</span></div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span> <span class="preprocessor">#elif defined(EVENT_IN_DOXYGEN_)</span></div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span> <span class="preprocessor">#define EV_SIZE_MAX ...</span></div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span> <span class="preprocessor">#define EV_SSIZE_MAX ...</span></div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span> <span class="preprocessor">#error "No way to define SIZE_MAX"</span></div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  </div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span> <span class="preprocessor">#define EV_SSIZE_MIN ((-EV_SSIZE_MAX) - 1)</span></div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  </div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span> <span class="preprocessor">#ifdef _WIN32</span></div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span> <span class="preprocessor">#define ev_socklen_t int</span></div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span> <span class="preprocessor">#elif defined(EVENT__socklen_t)</span></div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span> <span class="preprocessor">#define ev_socklen_t EVENT__socklen_t</span></div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span> <span class="preprocessor">#define ev_socklen_t socklen_t</span></div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  </div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span> <span class="preprocessor">#ifdef EVENT__HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY</span></div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span> <span class="preprocessor">#if !defined(EVENT__HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY) \</span></div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span> <span class="preprocessor"> && !defined(ss_family)</span></div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span> <span class="preprocessor">#define ss_family __ss_family</span></div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  </div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span> <span class="preprocessor">#ifdef _WIN32</span></div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span> <span class="preprocessor">#define evutil_socket_t intptr_t</span></div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00325"></a><span class="lineno"><a class="line" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b"> 325</a></span> <span class="preprocessor">#define evutil_socket_t int</span></div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  </div>
<div class="line"><a name="l00340"></a><span class="lineno"><a class="line" href="structevutil__monotonic__timer.html"> 340</a></span> <span class="keyword">struct </span><a class="code" href="structevutil__monotonic__timer.html">evutil_monotonic_timer</a></div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span> #ifdef EVENT_IN_DOXYGEN_</div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span> {<span class="comment">/*Empty body so that doxygen will generate documentation here.*/</span>}</div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span> ;</div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>  </div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span> <span class="preprocessor">#define EV_MONOT_PRECISE 1</span></div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span> <span class="preprocessor">#define EV_MONOT_FALLBACK 2</span></div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  </div>
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span> EVENT2_EXPORT_SYMBOL <span class="keywordtype">int</span></div>
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span> <a class="code" href="util_8h.html#a9d2f7f9996a6ff28db2aeb8ac8a58187">evutil_date_rfc1123</a>(<span class="keywordtype">char</span> *date, <span class="keyword">const</span> <span class="keywordtype">size_t</span> datelen, <span class="keyword">const</span> <span class="keyword">struct</span> tm *tm);</div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  </div>
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00364"></a><span class="lineno"> 364</span> <span class="keyword">struct </span><a class="code" href="structevutil__monotonic__timer.html">evutil_monotonic_timer</a> * <a class="code" href="util_8h.html#a87b00e2754d908ba05c5aa8e9c8e4f28">evutil_monotonic_timer_new</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>  </div>
<div class="line"><a name="l00369"></a><span class="lineno"> 369</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00370"></a><span class="lineno"> 370</span> <span class="keywordtype">void</span> <a class="code" href="util_8h.html#a2874062ff988293cd4e40b220933e209">evutil_monotonic_timer_free</a>(<span class="keyword">struct</span> <a class="code" href="structevutil__monotonic__timer.html">evutil_monotonic_timer</a> *timer);</div>
<div class="line"><a name="l00371"></a><span class="lineno"> 371</span>  </div>
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00376"></a><span class="lineno"> 376</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#ab486d1e10fd1e3102b4e53beed8d9baa">evutil_configure_monotonic_time</a>(<span class="keyword">struct</span> <a class="code" href="structevutil__monotonic__timer.html">evutil_monotonic_timer</a> *timer,</div>
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>  <span class="keywordtype">int</span> flags);</div>
<div class="line"><a name="l00378"></a><span class="lineno"> 378</span>  </div>
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#abe94df86960981b69411f20c0c5235dc">evutil_gettime_monotonic</a>(<span class="keyword">struct</span> <a class="code" href="structevutil__monotonic__timer.html">evutil_monotonic_timer</a> *timer,</div>
<div class="line"><a name="l00391"></a><span class="lineno"> 391</span>  <span class="keyword">struct</span> timeval *tp);</div>
<div class="line"><a name="l00392"></a><span class="lineno"> 392</span>  </div>
<div class="line"><a name="l00409"></a><span class="lineno"> 409</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00410"></a><span class="lineno"> 410</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#a050a74274e08eb89a53cb8cb1d617939">evutil_socketpair</a>(<span class="keywordtype">int</span> domain, <span class="keywordtype">int</span> type, <span class="keywordtype">int</span> protocol, <a class="code" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> sv[2]);</div>
<div class="line"><a name="l00416"></a><span class="lineno"> 416</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00417"></a><span class="lineno"> 417</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#a4f8f2384311baf5d7308c7ab079f9b84">evutil_make_socket_nonblocking</a>(<a class="code" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> sock);</div>
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>  </div>
<div class="line"><a name="l00430"></a><span class="lineno"> 430</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00431"></a><span class="lineno"> 431</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#a7a8e18b7861ed856bde592257f6b6e11">evutil_make_listen_socket_reuseable</a>(<a class="code" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> sock);</div>
<div class="line"><a name="l00432"></a><span class="lineno"> 432</span>  </div>
<div class="line"><a name="l00446"></a><span class="lineno"> 446</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00447"></a><span class="lineno"> 447</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#a9e4e68f77ce876ceecc6fb65f2dbe506">evutil_make_listen_socket_reuseable_port</a>(<a class="code" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> sock);</div>
<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>  </div>
<div class="line"><a name="l00460"></a><span class="lineno"> 460</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00461"></a><span class="lineno"> 461</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#ad361aa5727c88f05633a9032ad8c850f">evutil_make_listen_socket_ipv6only</a>(<a class="code" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> sock);</div>
<div class="line"><a name="l00462"></a><span class="lineno"> 462</span>  </div>
<div class="line"><a name="l00474"></a><span class="lineno"> 474</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00475"></a><span class="lineno"> 475</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#a031699658b52069610d660919d0c2b9d">evutil_make_listen_socket_not_ipv6only</a>(<a class="code" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> sock);</div>
<div class="line"><a name="l00476"></a><span class="lineno"> 476</span>  </div>
<div class="line"><a name="l00483"></a><span class="lineno"> 483</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00484"></a><span class="lineno"> 484</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#a7edc3874139e863f61edf6c705030430">evutil_make_socket_closeonexec</a>(<a class="code" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> sock);</div>
<div class="line"><a name="l00485"></a><span class="lineno"> 485</span>  </div>
<div class="line"><a name="l00493"></a><span class="lineno"> 493</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00494"></a><span class="lineno"> 494</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#a5cfa6c13c62d17570a7d5f6d3541ff5b">evutil_closesocket</a>(<a class="code" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> sock);</div>
<div class="line"><a name="l00495"></a><span class="lineno"> 495</span> <span class="preprocessor">#define EVUTIL_CLOSESOCKET(s) evutil_closesocket(s)</span></div>
<div class="line"><a name="l00496"></a><span class="lineno"> 496</span>  </div>
<div class="line"><a name="l00508"></a><span class="lineno"> 508</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00509"></a><span class="lineno"> 509</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#a988b1fc98edeac63efc8b13c4f822a0d">evutil_make_tcp_listen_socket_deferred</a>(<a class="code" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> sock);</div>
<div class="line"><a name="l00510"></a><span class="lineno"> 510</span>  </div>
<div class="line"><a name="l00520"></a><span class="lineno"> 520</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00521"></a><span class="lineno"> 521</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#a96f11bb3a6bf772201a0a2010689a250">evutil_set_tcp_keepalive</a>(<a class="code" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> sock, <span class="keywordtype">int</span> on, <span class="keywordtype">int</span> timeout);</div>
<div class="line"><a name="l00522"></a><span class="lineno"> 522</span>  </div>
<div class="line"><a name="l00523"></a><span class="lineno"> 523</span> <span class="preprocessor">#ifdef _WIN32</span></div>
<div class="line"><a name="l00524"></a><span class="lineno"> 524</span>  </div>
<div class="line"><a name="l00525"></a><span class="lineno"> 525</span> <span class="preprocessor">#define EVUTIL_SOCKET_ERROR() WSAGetLastError()</span></div>
<div class="line"><a name="l00526"></a><span class="lineno"> 526</span>  </div>
<div class="line"><a name="l00527"></a><span class="lineno"> 527</span> <span class="preprocessor">#define EVUTIL_SET_SOCKET_ERROR(errcode) \</span></div>
<div class="line"><a name="l00528"></a><span class="lineno"> 528</span> <span class="preprocessor"> do { WSASetLastError(errcode); } while (0)</span></div>
<div class="line"><a name="l00529"></a><span class="lineno"> 529</span>  </div>
<div class="line"><a name="l00530"></a><span class="lineno"> 530</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00531"></a><span class="lineno"> 531</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#a28f952fb0f16b057d931fd38ee9bdf5e">evutil_socket_geterror</a>(<a class="code" href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a> sock);</div>
<div class="line"><a name="l00533"></a><span class="lineno"> 533</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00534"></a><span class="lineno"> 534</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="util_8h.html#ad5ea5ef81ddcfb299e4867d362ad8654">evutil_socket_error_to_string</a>(<span class="keywordtype">int</span> errcode);</div>
<div class="line"><a name="l00535"></a><span class="lineno"> 535</span> <span class="preprocessor">#define EVUTIL_INVALID_SOCKET INVALID_SOCKET</span></div>
<div class="line"><a name="l00536"></a><span class="lineno"> 536</span> <span class="preprocessor">#elif defined(EVENT_IN_DOXYGEN_)</span></div>
<div class="line"><a name="l00537"></a><span class="lineno"> 537</span>  </div>
<div class="line"><a name="l00552"></a><span class="lineno"><a class="line" href="util_8h.html#a9a94a2e72982e708333486cf72aab941"> 552</a></span> <span class="preprocessor">#define EVUTIL_SOCKET_ERROR() ...</span></div>
<div class="line"><a name="l00553"></a><span class="lineno"> 553</span>  </div>
<div class="line"><a name="l00554"></a><span class="lineno"><a class="line" href="util_8h.html#ae8b4fae7790599f7b58e8c269f6b29d8"> 554</a></span> <span class="preprocessor">#define EVUTIL_SET_SOCKET_ERROR(errcode) ...</span></div>
<div class="line"><a name="l00555"></a><span class="lineno"> 555</span>  </div>
<div class="line"><a name="l00556"></a><span class="lineno"><a class="line" href="util_8h.html#a28f952fb0f16b057d931fd38ee9bdf5e"> 556</a></span> <span class="preprocessor">#define evutil_socket_geterror(sock) ...</span></div>
<div class="line"><a name="l00557"></a><span class="lineno"> 557</span>  </div>
<div class="line"><a name="l00558"></a><span class="lineno"><a class="line" href="util_8h.html#ad5ea5ef81ddcfb299e4867d362ad8654"> 558</a></span> <span class="preprocessor">#define evutil_socket_error_to_string(errcode) ...</span></div>
<div class="line"><a name="l00559"></a><span class="lineno"> 559</span> <span class="preprocessor">#define EVUTIL_INVALID_SOCKET -1</span></div>
<div class="line"><a name="l00560"></a><span class="lineno"> 560</span>  </div>
<div class="line"><a name="l00561"></a><span class="lineno"> 561</span> <span class="preprocessor">#else </span><span class="comment">/* !EVENT_IN_DOXYGEN_ && !_WIN32 */</span><span class="preprocessor"></span></div>
<div class="line"><a name="l00562"></a><span class="lineno"> 562</span> <span class="preprocessor">#define EVUTIL_SOCKET_ERROR() (errno)</span></div>
<div class="line"><a name="l00563"></a><span class="lineno"> 563</span> <span class="preprocessor">#define EVUTIL_SET_SOCKET_ERROR(errcode) \</span></div>
<div class="line"><a name="l00564"></a><span class="lineno"> 564</span> <span class="preprocessor"> do { errno = (errcode); } while (0)</span></div>
<div class="line"><a name="l00565"></a><span class="lineno"> 565</span> <span class="preprocessor">#define evutil_socket_geterror(sock) (errno)</span></div>
<div class="line"><a name="l00566"></a><span class="lineno"> 566</span> <span class="preprocessor">#define evutil_socket_error_to_string(errcode) (strerror(errcode))</span></div>
<div class="line"><a name="l00567"></a><span class="lineno"> 567</span> <span class="preprocessor">#define EVUTIL_INVALID_SOCKET -1</span></div>
<div class="line"><a name="l00568"></a><span class="lineno"> 568</span> <span class="preprocessor">#endif </span><span class="comment">/* !_WIN32 */</span><span class="preprocessor"></span></div>
<div class="line"><a name="l00569"></a><span class="lineno"> 569</span>  </div>
<div class="line"><a name="l00570"></a><span class="lineno"> 570</span>  </div>
<div class="line"><a name="l00579"></a><span class="lineno"> 579</span> <span class="preprocessor">#ifdef EVENT__HAVE_TIMERADD</span></div>
<div class="line"><a name="l00580"></a><span class="lineno"> 580</span> <span class="preprocessor">#define evutil_timeradd(tvp, uvp, vvp) timeradd((tvp), (uvp), (vvp))</span></div>
<div class="line"><a name="l00581"></a><span class="lineno"> 581</span> <span class="preprocessor">#define evutil_timersub(tvp, uvp, vvp) timersub((tvp), (uvp), (vvp))</span></div>
<div class="line"><a name="l00582"></a><span class="lineno"> 582</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00583"></a><span class="lineno"> 583</span> <span class="preprocessor">#define evutil_timeradd(tvp, uvp, vvp) \</span></div>
<div class="line"><a name="l00584"></a><span class="lineno"> 584</span> <span class="preprocessor"> do { \</span></div>
<div class="line"><a name="l00585"></a><span class="lineno"> 585</span> <span class="preprocessor"> (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \</span></div>
<div class="line"><a name="l00586"></a><span class="lineno"> 586</span> <span class="preprocessor"> (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \</span></div>
<div class="line"><a name="l00587"></a><span class="lineno"> 587</span> <span class="preprocessor"> if ((vvp)->tv_usec >= 1000000) { \</span></div>
<div class="line"><a name="l00588"></a><span class="lineno"> 588</span> <span class="preprocessor"> (vvp)->tv_sec++; \</span></div>
<div class="line"><a name="l00589"></a><span class="lineno"> 589</span> <span class="preprocessor"> (vvp)->tv_usec -= 1000000; \</span></div>
<div class="line"><a name="l00590"></a><span class="lineno"> 590</span> <span class="preprocessor"> } \</span></div>
<div class="line"><a name="l00591"></a><span class="lineno"> 591</span> <span class="preprocessor"> } while (0)</span></div>
<div class="line"><a name="l00592"></a><span class="lineno"> 592</span> <span class="preprocessor">#define evutil_timersub(tvp, uvp, vvp) \</span></div>
<div class="line"><a name="l00593"></a><span class="lineno"> 593</span> <span class="preprocessor"> do { \</span></div>
<div class="line"><a name="l00594"></a><span class="lineno"> 594</span> <span class="preprocessor"> (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \</span></div>
<div class="line"><a name="l00595"></a><span class="lineno"> 595</span> <span class="preprocessor"> (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \</span></div>
<div class="line"><a name="l00596"></a><span class="lineno"> 596</span> <span class="preprocessor"> if ((vvp)->tv_usec < 0) { \</span></div>
<div class="line"><a name="l00597"></a><span class="lineno"> 597</span> <span class="preprocessor"> (vvp)->tv_sec--; \</span></div>
<div class="line"><a name="l00598"></a><span class="lineno"> 598</span> <span class="preprocessor"> (vvp)->tv_usec += 1000000; \</span></div>
<div class="line"><a name="l00599"></a><span class="lineno"> 599</span> <span class="preprocessor"> } \</span></div>
<div class="line"><a name="l00600"></a><span class="lineno"> 600</span> <span class="preprocessor"> } while (0)</span></div>
<div class="line"><a name="l00601"></a><span class="lineno"> 601</span> <span class="preprocessor">#endif </span><span class="comment">/* !EVENT__HAVE_TIMERADD */</span><span class="preprocessor"></span></div>
<div class="line"><a name="l00602"></a><span class="lineno"> 602</span>  </div>
<div class="line"><a name="l00603"></a><span class="lineno"> 603</span> <span class="preprocessor">#ifdef EVENT__HAVE_TIMERCLEAR</span></div>
<div class="line"><a name="l00604"></a><span class="lineno"> 604</span> <span class="preprocessor">#define evutil_timerclear(tvp) timerclear(tvp)</span></div>
<div class="line"><a name="l00605"></a><span class="lineno"> 605</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00606"></a><span class="lineno"> 606</span> <span class="preprocessor">#define evutil_timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0</span></div>
<div class="line"><a name="l00607"></a><span class="lineno"> 607</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00608"></a><span class="lineno"> 608</span>  </div>
<div class="line"><a name="l00612"></a><span class="lineno"><a class="line" href="util_8h.html#a1a42f43db6aaf6e99736329b6611175d"> 612</a></span> <span class="preprocessor">#define evutil_timercmp(tvp, uvp, cmp) \</span></div>
<div class="line"><a name="l00613"></a><span class="lineno"> 613</span> <span class="preprocessor"> (((tvp)->tv_sec == (uvp)->tv_sec) ? \</span></div>
<div class="line"><a name="l00614"></a><span class="lineno"> 614</span> <span class="preprocessor"> ((tvp)->tv_usec cmp (uvp)->tv_usec) : \</span></div>
<div class="line"><a name="l00615"></a><span class="lineno"> 615</span> <span class="preprocessor"> ((tvp)->tv_sec cmp (uvp)->tv_sec))</span></div>
<div class="line"><a name="l00616"></a><span class="lineno"> 616</span>  </div>
<div class="line"><a name="l00617"></a><span class="lineno"> 617</span> <span class="preprocessor">#ifdef EVENT__HAVE_TIMERISSET</span></div>
<div class="line"><a name="l00618"></a><span class="lineno"> 618</span> <span class="preprocessor">#define evutil_timerisset(tvp) timerisset(tvp)</span></div>
<div class="line"><a name="l00619"></a><span class="lineno"> 619</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00620"></a><span class="lineno"> 620</span> <span class="preprocessor">#define evutil_timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)</span></div>
<div class="line"><a name="l00621"></a><span class="lineno"> 621</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00622"></a><span class="lineno"> 622</span>  </div>
<div class="line"><a name="l00624"></a><span class="lineno"> 624</span> <span class="preprocessor">#ifdef offsetof</span></div>
<div class="line"><a name="l00625"></a><span class="lineno"> 625</span> <span class="preprocessor">#define evutil_offsetof(type, field) offsetof(type, field)</span></div>
<div class="line"><a name="l00626"></a><span class="lineno"> 626</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00627"></a><span class="lineno"><a class="line" href="util_8h.html#a4c296955d33624c18bd4811730caa417"> 627</a></span> <span class="preprocessor">#define evutil_offsetof(type, field) ((off_t)(&((type *)0)->field))</span></div>
<div class="line"><a name="l00628"></a><span class="lineno"> 628</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00629"></a><span class="lineno"> 629</span>  </div>
<div class="line"><a name="l00630"></a><span class="lineno"> 630</span> <span class="comment">/* big-int related functions */</span></div>
<div class="line"><a name="l00632"></a><span class="lineno"> 632</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00633"></a><span class="lineno"> 633</span> ev_int64_t <a class="code" href="util_8h.html#a9175e63729c256eb2646e11e8211f4f7">evutil_strtoll</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *s, <span class="keywordtype">char</span> **endptr, <span class="keywordtype">int</span> base);</div>
<div class="line"><a name="l00634"></a><span class="lineno"> 634</span>  </div>
<div class="line"><a name="l00636"></a><span class="lineno"> 636</span> <span class="preprocessor">#ifdef EVENT__HAVE_GETTIMEOFDAY</span></div>
<div class="line"><a name="l00637"></a><span class="lineno"> 637</span> <span class="preprocessor">#define evutil_gettimeofday(tv, tz) gettimeofday((tv), (tz))</span></div>
<div class="line"><a name="l00638"></a><span class="lineno"> 638</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00639"></a><span class="lineno"> 639</span> <span class="keyword">struct </span>timezone;</div>
<div class="line"><a name="l00640"></a><span class="lineno"> 640</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00641"></a><span class="lineno"> 641</span> <span class="keywordtype">int</span> evutil_gettimeofday(<span class="keyword">struct</span> timeval *tv, <span class="keyword">struct</span> timezone *tz);</div>
<div class="line"><a name="l00642"></a><span class="lineno"> 642</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00643"></a><span class="lineno"> 643</span>  </div>
<div class="line"><a name="l00647"></a><span class="lineno"> 647</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00648"></a><span class="lineno"> 648</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#a198e8db3626746515792e28b1380be67">evutil_snprintf</a>(<span class="keywordtype">char</span> *buf, <span class="keywordtype">size_t</span> buflen, <span class="keyword">const</span> <span class="keywordtype">char</span> *format, ...)</div>
<div class="line"><a name="l00649"></a><span class="lineno"> 649</span> <span class="preprocessor">#ifdef __GNUC__</span></div>
<div class="line"><a name="l00650"></a><span class="lineno"> 650</span>  __attribute__((format(printf, 3, 4)))</div>
<div class="line"><a name="l00651"></a><span class="lineno"> 651</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00652"></a><span class="lineno"> 652</span> ;</div>
<div class="line"><a name="l00656"></a><span class="lineno"> 656</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00657"></a><span class="lineno"> 657</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#a30bbdc509d150e5dfac1f74dd4e4c212">evutil_vsnprintf</a>(<span class="keywordtype">char</span> *buf, <span class="keywordtype">size_t</span> buflen, <span class="keyword">const</span> <span class="keywordtype">char</span> *format, va_list ap)</div>
<div class="line"><a name="l00658"></a><span class="lineno"> 658</span> <span class="preprocessor">#ifdef __GNUC__</span></div>
<div class="line"><a name="l00659"></a><span class="lineno"> 659</span>  __attribute__((format(printf, 3, 0)))</div>
<div class="line"><a name="l00660"></a><span class="lineno"> 660</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00661"></a><span class="lineno"> 661</span> ;</div>
<div class="line"><a name="l00662"></a><span class="lineno"> 662</span>  </div>
<div class="line"><a name="l00664"></a><span class="lineno"> 664</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00665"></a><span class="lineno"> 665</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="util_8h.html#afa98d48bdd6ad06c1fd013a44621d567">evutil_inet_ntop</a>(<span class="keywordtype">int</span> af, <span class="keyword">const</span> <span class="keywordtype">void</span> *src, <span class="keywordtype">char</span> *dst, <span class="keywordtype">size_t</span> len);</div>
<div class="line"><a name="l00669"></a><span class="lineno"> 669</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00670"></a><span class="lineno"> 670</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#ad586fc57f596616d810a8b5fe4f8c111">evutil_inet_pton_scope</a>(<span class="keywordtype">int</span> af, <span class="keyword">const</span> <span class="keywordtype">char</span> *src, <span class="keywordtype">void</span> *dst,</div>
<div class="line"><a name="l00671"></a><span class="lineno"> 671</span>  <span class="keywordtype">unsigned</span> *indexp);</div>
<div class="line"><a name="l00673"></a><span class="lineno"> 673</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00674"></a><span class="lineno"> 674</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#a4065af1c9c995010ef7df66154c313b2">evutil_inet_pton</a>(<span class="keywordtype">int</span> af, <span class="keyword">const</span> <span class="keywordtype">char</span> *src, <span class="keywordtype">void</span> *dst);</div>
<div class="line"><a name="l00675"></a><span class="lineno"> 675</span> <span class="keyword">struct </span>sockaddr;</div>
<div class="line"><a name="l00676"></a><span class="lineno"> 676</span>  </div>
<div class="line"><a name="l00697"></a><span class="lineno"> 697</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00698"></a><span class="lineno"> 698</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#a97d4f315d5c40c4f604f6c9ae694a684">evutil_parse_sockaddr_port</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *str, <span class="keyword">struct</span> sockaddr *out, <span class="keywordtype">int</span> *outlen);</div>
<div class="line"><a name="l00699"></a><span class="lineno"> 699</span>  </div>
<div class="line"><a name="l00705"></a><span class="lineno"> 705</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00706"></a><span class="lineno"> 706</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#a7b5ad1074f1effe2dbfa18b3f44b589f">evutil_sockaddr_cmp</a>(<span class="keyword">const</span> <span class="keyword">struct</span> sockaddr *sa1, <span class="keyword">const</span> <span class="keyword">struct</span> sockaddr *sa2,</div>
<div class="line"><a name="l00707"></a><span class="lineno"> 707</span>  <span class="keywordtype">int</span> include_port);</div>
<div class="line"><a name="l00708"></a><span class="lineno"> 708</span>  </div>
<div class="line"><a name="l00713"></a><span class="lineno"> 713</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00714"></a><span class="lineno"> 714</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#aae46d8f8407906b79216f9be88803126">evutil_ascii_strcasecmp</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *str1, <span class="keyword">const</span> <span class="keywordtype">char</span> *str2);</div>
<div class="line"><a name="l00718"></a><span class="lineno"> 718</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00719"></a><span class="lineno"> 719</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#a03b44d66883df5bfed32c9ac6df93aac">evutil_ascii_strncasecmp</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *str1, <span class="keyword">const</span> <span class="keywordtype">char</span> *str2, <span class="keywordtype">size_t</span> n);</div>
<div class="line"><a name="l00720"></a><span class="lineno"> 720</span>  </div>
<div class="line"><a name="l00721"></a><span class="lineno"> 721</span> <span class="comment">/* Here we define evutil_addrinfo to the native addrinfo type, or redefine it</span></div>
<div class="line"><a name="l00722"></a><span class="lineno"> 722</span> <span class="comment"> * if this system has no getaddrinfo(). */</span></div>
<div class="line"><a name="l00723"></a><span class="lineno"> 723</span> <span class="preprocessor">#ifdef EVENT__HAVE_STRUCT_ADDRINFO</span></div>
<div class="line"><a name="l00724"></a><span class="lineno"> 724</span> <span class="preprocessor">#define evutil_addrinfo addrinfo</span></div>
<div class="line"><a name="l00725"></a><span class="lineno"> 725</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00726"></a><span class="lineno"> 726</span>  </div>
<div class="line"><a name="l00731"></a><span class="lineno"><a class="line" href="structevutil__addrinfo.html"> 731</a></span> <span class="keyword">struct </span><a class="code" href="structevutil__addrinfo.html">evutil_addrinfo</a> {</div>
<div class="line"><a name="l00732"></a><span class="lineno"> 732</span>  <span class="keywordtype">int</span> ai_flags; <span class="comment">/* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */</span></div>
<div class="line"><a name="l00733"></a><span class="lineno"> 733</span>  <span class="keywordtype">int</span> ai_family; <span class="comment">/* PF_xxx */</span></div>
<div class="line"><a name="l00734"></a><span class="lineno"> 734</span>  <span class="keywordtype">int</span> ai_socktype; <span class="comment">/* SOCK_xxx */</span></div>
<div class="line"><a name="l00735"></a><span class="lineno"> 735</span>  <span class="keywordtype">int</span> ai_protocol; <span class="comment">/* 0 or IPPROTO_xxx for IPv4 and IPv6 */</span></div>
<div class="line"><a name="l00736"></a><span class="lineno"> 736</span>  <span class="keywordtype">size_t</span> ai_addrlen; <span class="comment">/* length of ai_addr */</span></div>
<div class="line"><a name="l00737"></a><span class="lineno"> 737</span>  <span class="keywordtype">char</span> *ai_canonname; <span class="comment">/* canonical name for nodename */</span></div>
<div class="line"><a name="l00738"></a><span class="lineno"> 738</span>  <span class="keyword">struct </span>sockaddr *ai_addr; <span class="comment">/* binary address */</span></div>
<div class="line"><a name="l00739"></a><span class="lineno"> 739</span>  <span class="keyword">struct </span><a class="code" href="structevutil__addrinfo.html">evutil_addrinfo</a> *ai_next; <span class="comment">/* next structure in linked list */</span></div>
<div class="line"><a name="l00740"></a><span class="lineno"> 740</span> };</div>
<div class="line"><a name="l00741"></a><span class="lineno"> 741</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00742"></a><span class="lineno"> 742</span>  </div>
<div class="line"><a name="l00749"></a><span class="lineno"> 749</span> <span class="preprocessor">#if defined(EAI_ADDRFAMILY) && defined(EVENT__HAVE_GETADDRINFO)</span></div>
<div class="line"><a name="l00750"></a><span class="lineno"> 750</span> <span class="preprocessor">#define EVUTIL_EAI_ADDRFAMILY EAI_ADDRFAMILY</span></div>
<div class="line"><a name="l00751"></a><span class="lineno"> 751</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00752"></a><span class="lineno"> 752</span> <span class="preprocessor">#define EVUTIL_EAI_ADDRFAMILY -901</span></div>
<div class="line"><a name="l00753"></a><span class="lineno"> 753</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00754"></a><span class="lineno"> 754</span> <span class="preprocessor">#if defined(EAI_AGAIN) && defined(EVENT__HAVE_GETADDRINFO)</span></div>
<div class="line"><a name="l00755"></a><span class="lineno"> 755</span> <span class="preprocessor">#define EVUTIL_EAI_AGAIN EAI_AGAIN</span></div>
<div class="line"><a name="l00756"></a><span class="lineno"> 756</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00757"></a><span class="lineno"> 757</span> <span class="preprocessor">#define EVUTIL_EAI_AGAIN -902</span></div>
<div class="line"><a name="l00758"></a><span class="lineno"> 758</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00759"></a><span class="lineno"> 759</span> <span class="preprocessor">#if defined(EAI_BADFLAGS) && defined(EVENT__HAVE_GETADDRINFO)</span></div>
<div class="line"><a name="l00760"></a><span class="lineno"> 760</span> <span class="preprocessor">#define EVUTIL_EAI_BADFLAGS EAI_BADFLAGS</span></div>
<div class="line"><a name="l00761"></a><span class="lineno"> 761</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00762"></a><span class="lineno"> 762</span> <span class="preprocessor">#define EVUTIL_EAI_BADFLAGS -903</span></div>
<div class="line"><a name="l00763"></a><span class="lineno"> 763</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00764"></a><span class="lineno"> 764</span> <span class="preprocessor">#if defined(EAI_FAIL) && defined(EVENT__HAVE_GETADDRINFO)</span></div>
<div class="line"><a name="l00765"></a><span class="lineno"> 765</span> <span class="preprocessor">#define EVUTIL_EAI_FAIL EAI_FAIL</span></div>
<div class="line"><a name="l00766"></a><span class="lineno"> 766</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00767"></a><span class="lineno"> 767</span> <span class="preprocessor">#define EVUTIL_EAI_FAIL -904</span></div>
<div class="line"><a name="l00768"></a><span class="lineno"> 768</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00769"></a><span class="lineno"> 769</span> <span class="preprocessor">#if defined(EAI_FAMILY) && defined(EVENT__HAVE_GETADDRINFO)</span></div>
<div class="line"><a name="l00770"></a><span class="lineno"> 770</span> <span class="preprocessor">#define EVUTIL_EAI_FAMILY EAI_FAMILY</span></div>
<div class="line"><a name="l00771"></a><span class="lineno"> 771</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00772"></a><span class="lineno"> 772</span> <span class="preprocessor">#define EVUTIL_EAI_FAMILY -905</span></div>
<div class="line"><a name="l00773"></a><span class="lineno"> 773</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00774"></a><span class="lineno"> 774</span> <span class="preprocessor">#if defined(EAI_MEMORY) && defined(EVENT__HAVE_GETADDRINFO)</span></div>
<div class="line"><a name="l00775"></a><span class="lineno"> 775</span> <span class="preprocessor">#define EVUTIL_EAI_MEMORY EAI_MEMORY</span></div>
<div class="line"><a name="l00776"></a><span class="lineno"> 776</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00777"></a><span class="lineno"> 777</span> <span class="preprocessor">#define EVUTIL_EAI_MEMORY -906</span></div>
<div class="line"><a name="l00778"></a><span class="lineno"> 778</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00779"></a><span class="lineno"> 779</span> <span class="comment">/* This test is a bit complicated, since some MS SDKs decide to</span></div>
<div class="line"><a name="l00780"></a><span class="lineno"> 780</span> <span class="comment"> * remove NODATA or redefine it to be the same as NONAME, in a</span></div>
<div class="line"><a name="l00781"></a><span class="lineno"> 781</span> <span class="comment"> * fun interpretation of RFC 2553 and RFC 3493. */</span></div>
<div class="line"><a name="l00782"></a><span class="lineno"> 782</span> <span class="preprocessor">#if defined(EAI_NODATA) && defined(EVENT__HAVE_GETADDRINFO) && (!defined(EAI_NONAME) || EAI_NODATA != EAI_NONAME)</span></div>
<div class="line"><a name="l00783"></a><span class="lineno"> 783</span> <span class="preprocessor">#define EVUTIL_EAI_NODATA EAI_NODATA</span></div>
<div class="line"><a name="l00784"></a><span class="lineno"> 784</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00785"></a><span class="lineno"> 785</span> <span class="preprocessor">#define EVUTIL_EAI_NODATA -907</span></div>
<div class="line"><a name="l00786"></a><span class="lineno"> 786</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00787"></a><span class="lineno"> 787</span> <span class="preprocessor">#if defined(EAI_NONAME) && defined(EVENT__HAVE_GETADDRINFO)</span></div>
<div class="line"><a name="l00788"></a><span class="lineno"> 788</span> <span class="preprocessor">#define EVUTIL_EAI_NONAME EAI_NONAME</span></div>
<div class="line"><a name="l00789"></a><span class="lineno"> 789</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00790"></a><span class="lineno"> 790</span> <span class="preprocessor">#define EVUTIL_EAI_NONAME -908</span></div>
<div class="line"><a name="l00791"></a><span class="lineno"> 791</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00792"></a><span class="lineno"> 792</span> <span class="preprocessor">#if defined(EAI_SERVICE) && defined(EVENT__HAVE_GETADDRINFO)</span></div>
<div class="line"><a name="l00793"></a><span class="lineno"> 793</span> <span class="preprocessor">#define EVUTIL_EAI_SERVICE EAI_SERVICE</span></div>
<div class="line"><a name="l00794"></a><span class="lineno"> 794</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00795"></a><span class="lineno"> 795</span> <span class="preprocessor">#define EVUTIL_EAI_SERVICE -909</span></div>
<div class="line"><a name="l00796"></a><span class="lineno"> 796</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00797"></a><span class="lineno"> 797</span> <span class="preprocessor">#if defined(EAI_SOCKTYPE) && defined(EVENT__HAVE_GETADDRINFO)</span></div>
<div class="line"><a name="l00798"></a><span class="lineno"> 798</span> <span class="preprocessor">#define EVUTIL_EAI_SOCKTYPE EAI_SOCKTYPE</span></div>
<div class="line"><a name="l00799"></a><span class="lineno"> 799</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00800"></a><span class="lineno"> 800</span> <span class="preprocessor">#define EVUTIL_EAI_SOCKTYPE -910</span></div>
<div class="line"><a name="l00801"></a><span class="lineno"> 801</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00802"></a><span class="lineno"> 802</span> <span class="preprocessor">#if defined(EAI_SYSTEM) && defined(EVENT__HAVE_GETADDRINFO)</span></div>
<div class="line"><a name="l00803"></a><span class="lineno"> 803</span> <span class="preprocessor">#define EVUTIL_EAI_SYSTEM EAI_SYSTEM</span></div>
<div class="line"><a name="l00804"></a><span class="lineno"> 804</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00805"></a><span class="lineno"> 805</span> <span class="preprocessor">#define EVUTIL_EAI_SYSTEM -911</span></div>
<div class="line"><a name="l00806"></a><span class="lineno"> 806</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00807"></a><span class="lineno"> 807</span>  </div>
<div class="line"><a name="l00808"></a><span class="lineno"> 808</span> <span class="preprocessor">#define EVUTIL_EAI_CANCEL -90001</span></div>
<div class="line"><a name="l00809"></a><span class="lineno"> 809</span>  </div>
<div class="line"><a name="l00810"></a><span class="lineno"> 810</span> <span class="preprocessor">#if defined(AI_PASSIVE) && defined(EVENT__HAVE_GETADDRINFO)</span></div>
<div class="line"><a name="l00811"></a><span class="lineno"> 811</span> <span class="preprocessor">#define EVUTIL_AI_PASSIVE AI_PASSIVE</span></div>
<div class="line"><a name="l00812"></a><span class="lineno"> 812</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00813"></a><span class="lineno"> 813</span> <span class="preprocessor">#define EVUTIL_AI_PASSIVE 0x1000</span></div>
<div class="line"><a name="l00814"></a><span class="lineno"> 814</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00815"></a><span class="lineno"> 815</span> <span class="preprocessor">#if defined(AI_CANONNAME) && defined(EVENT__HAVE_GETADDRINFO)</span></div>
<div class="line"><a name="l00816"></a><span class="lineno"> 816</span> <span class="preprocessor">#define EVUTIL_AI_CANONNAME AI_CANONNAME</span></div>
<div class="line"><a name="l00817"></a><span class="lineno"> 817</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00818"></a><span class="lineno"> 818</span> <span class="preprocessor">#define EVUTIL_AI_CANONNAME 0x2000</span></div>
<div class="line"><a name="l00819"></a><span class="lineno"> 819</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00820"></a><span class="lineno"> 820</span> <span class="preprocessor">#if defined(AI_NUMERICHOST) && defined(EVENT__HAVE_GETADDRINFO)</span></div>
<div class="line"><a name="l00821"></a><span class="lineno"> 821</span> <span class="preprocessor">#define EVUTIL_AI_NUMERICHOST AI_NUMERICHOST</span></div>
<div class="line"><a name="l00822"></a><span class="lineno"> 822</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00823"></a><span class="lineno"> 823</span> <span class="preprocessor">#define EVUTIL_AI_NUMERICHOST 0x4000</span></div>
<div class="line"><a name="l00824"></a><span class="lineno"> 824</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00825"></a><span class="lineno"> 825</span> <span class="preprocessor">#if defined(AI_NUMERICSERV) && defined(EVENT__HAVE_GETADDRINFO)</span></div>
<div class="line"><a name="l00826"></a><span class="lineno"> 826</span> <span class="preprocessor">#define EVUTIL_AI_NUMERICSERV AI_NUMERICSERV</span></div>
<div class="line"><a name="l00827"></a><span class="lineno"> 827</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00828"></a><span class="lineno"> 828</span> <span class="preprocessor">#define EVUTIL_AI_NUMERICSERV 0x8000</span></div>
<div class="line"><a name="l00829"></a><span class="lineno"> 829</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00830"></a><span class="lineno"> 830</span> <span class="preprocessor">#if defined(AI_V4MAPPED) && defined(EVENT__HAVE_GETADDRINFO)</span></div>
<div class="line"><a name="l00831"></a><span class="lineno"> 831</span> <span class="preprocessor">#define EVUTIL_AI_V4MAPPED AI_V4MAPPED</span></div>
<div class="line"><a name="l00832"></a><span class="lineno"> 832</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00833"></a><span class="lineno"> 833</span> <span class="preprocessor">#define EVUTIL_AI_V4MAPPED 0x10000</span></div>
<div class="line"><a name="l00834"></a><span class="lineno"> 834</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00835"></a><span class="lineno"> 835</span> <span class="preprocessor">#if defined(AI_ALL) && defined(EVENT__HAVE_GETADDRINFO)</span></div>
<div class="line"><a name="l00836"></a><span class="lineno"> 836</span> <span class="preprocessor">#define EVUTIL_AI_ALL AI_ALL</span></div>
<div class="line"><a name="l00837"></a><span class="lineno"> 837</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00838"></a><span class="lineno"> 838</span> <span class="preprocessor">#define EVUTIL_AI_ALL 0x20000</span></div>
<div class="line"><a name="l00839"></a><span class="lineno"> 839</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00840"></a><span class="lineno"> 840</span> <span class="preprocessor">#if defined(AI_ADDRCONFIG) && defined(EVENT__HAVE_GETADDRINFO)</span></div>
<div class="line"><a name="l00841"></a><span class="lineno"> 841</span> <span class="preprocessor">#define EVUTIL_AI_ADDRCONFIG AI_ADDRCONFIG</span></div>
<div class="line"><a name="l00842"></a><span class="lineno"> 842</span> <span class="preprocessor">#else</span></div>
<div class="line"><a name="l00843"></a><span class="lineno"> 843</span> <span class="preprocessor">#define EVUTIL_AI_ADDRCONFIG 0x40000</span></div>
<div class="line"><a name="l00844"></a><span class="lineno"> 844</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00845"></a><span class="lineno"> 845</span>  </div>
<div class="line"><a name="l00847"></a><span class="lineno"> 847</span> <span class="keyword">struct </span><a class="code" href="structevutil__addrinfo.html">evutil_addrinfo</a>;</div>
<div class="line"><a name="l00859"></a><span class="lineno"> 859</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00860"></a><span class="lineno"> 860</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#a0f36c2fc48c644a4f56347a25c585cc9">evutil_getaddrinfo</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *nodename, <span class="keyword">const</span> <span class="keywordtype">char</span> *servname,</div>
<div class="line"><a name="l00861"></a><span class="lineno"> 861</span>  <span class="keyword">const</span> <span class="keyword">struct</span> <a class="code" href="structevutil__addrinfo.html">evutil_addrinfo</a> *hints_in, <span class="keyword">struct</span> <a class="code" href="structevutil__addrinfo.html">evutil_addrinfo</a> **res);</div>
<div class="line"><a name="l00862"></a><span class="lineno"> 862</span>  </div>
<div class="line"><a name="l00864"></a><span class="lineno"> 864</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00865"></a><span class="lineno"> 865</span> <span class="keywordtype">void</span> <a class="code" href="util_8h.html#a58a472b3afc5cef1e6b1c9912604381b">evutil_freeaddrinfo</a>(<span class="keyword">struct</span> <a class="code" href="structevutil__addrinfo.html">evutil_addrinfo</a> *ai);</div>
<div class="line"><a name="l00866"></a><span class="lineno"> 866</span>  </div>
<div class="line"><a name="l00867"></a><span class="lineno"> 867</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00868"></a><span class="lineno"> 868</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *evutil_gai_strerror(<span class="keywordtype">int</span> err);</div>
<div class="line"><a name="l00869"></a><span class="lineno"> 869</span>  </div>
<div class="line"><a name="l00879"></a><span class="lineno"> 879</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00880"></a><span class="lineno"> 880</span> <span class="keywordtype">void</span> <a class="code" href="util_8h.html#a0836ed5d00ccab1957419a07b7acbb56">evutil_secure_rng_get_bytes</a>(<span class="keywordtype">void</span> *buf, <span class="keywordtype">size_t</span> n);</div>
<div class="line"><a name="l00881"></a><span class="lineno"> 881</span>  </div>
<div class="line"><a name="l00898"></a><span class="lineno"> 898</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00899"></a><span class="lineno"> 899</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#a49ffe53dcbe32ad55f1582a0da358ac0">evutil_secure_rng_init</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00900"></a><span class="lineno"> 900</span>  </div>
<div class="line"><a name="l00914"></a><span class="lineno"> 914</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00915"></a><span class="lineno"> 915</span> <span class="keywordtype">int</span> <a class="code" href="util_8h.html#a4544ddceb4e20c8c52985641ca829b7e">evutil_secure_rng_set_urandom_device_file</a>(<span class="keywordtype">char</span> *fname);</div>
<div class="line"><a name="l00916"></a><span class="lineno"> 916</span>  </div>
<div class="line"><a name="l00934"></a><span class="lineno"> 934</span> EVENT2_EXPORT_SYMBOL</div>
<div class="line"><a name="l00935"></a><span class="lineno"> 935</span> <span class="keywordtype">void</span> <a class="code" href="util_8h.html#a3b5b7d22b368ffdd6ed77838bf4fcea6">evutil_secure_rng_add_bytes</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *dat, <span class="keywordtype">size_t</span> datlen);</div>
<div class="line"><a name="l00936"></a><span class="lineno"> 936</span>  </div>
<div class="line"><a name="l00937"></a><span class="lineno"> 937</span> <span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a name="l00938"></a><span class="lineno"> 938</span> }</div>
<div class="line"><a name="l00939"></a><span class="lineno"> 939</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00940"></a><span class="lineno"> 940</span>  </div>
<div class="line"><a name="l00941"></a><span class="lineno"> 941</span> <span class="preprocessor">#endif </span><span class="comment">/* EVENT1_EVUTIL_H_INCLUDED_ */</span><span class="preprocessor"></span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="astructevutil__monotonic__timer_html"><div class="ttname"><a href="structevutil__monotonic__timer.html">evutil_monotonic_timer</a></div><div class="ttdoc">Structure to hold information about a monotonic timer.</div><div class="ttdef"><b>Definition:</b> util.h:340</div></div>
<div class="ttc" id="autil_8h_html_a4065af1c9c995010ef7df66154c313b2"><div class="ttname"><a href="util_8h.html#a4065af1c9c995010ef7df66154c313b2">evutil_inet_pton</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_inet_pton(int af, const char *src, void *dst)</div><div class="ttdoc">Replacement for inet_pton for platforms which lack it.</div></div>
<div class="ttc" id="autil_8h_html_a9d2f7f9996a6ff28db2aeb8ac8a58187"><div class="ttname"><a href="util_8h.html#a9d2f7f9996a6ff28db2aeb8ac8a58187">evutil_date_rfc1123</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_date_rfc1123(char *date, const size_t datelen, const struct tm *tm)</div><div class="ttdoc">Format a date string using RFC 1123 format (used in HTTP).</div></div>
<div class="ttc" id="autil_8h_html_abe94df86960981b69411f20c0c5235dc"><div class="ttname"><a href="util_8h.html#abe94df86960981b69411f20c0c5235dc">evutil_gettime_monotonic</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_gettime_monotonic(struct evutil_monotonic_timer *timer, struct timeval *tp)</div><div class="ttdoc">Query the current monotonic time from a struct evutil_monotonic_timer previously configured with evut...</div></div>
<div class="ttc" id="autil_8h_html_a96f11bb3a6bf772201a0a2010689a250"><div class="ttname"><a href="util_8h.html#a96f11bb3a6bf772201a0a2010689a250">evutil_set_tcp_keepalive</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_set_tcp_keepalive(evutil_socket_t sock, int on, int timeout)</div><div class="ttdoc">Do platform-specific operations to set/unset TCP keep-alive options TCP_KEEPIDLE, TCP_KEEPINTVL and T...</div></div>
<div class="ttc" id="autil_8h_html_aae46d8f8407906b79216f9be88803126"><div class="ttname"><a href="util_8h.html#aae46d8f8407906b79216f9be88803126">evutil_ascii_strcasecmp</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_ascii_strcasecmp(const char *str1, const char *str2)</div><div class="ttdoc">As strcasecmp, but always compares the characters in locale-independent ASCII.</div></div>
<div class="ttc" id="autil_8h_html_ad361aa5727c88f05633a9032ad8c850f"><div class="ttname"><a href="util_8h.html#ad361aa5727c88f05633a9032ad8c850f">evutil_make_listen_socket_ipv6only</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_make_listen_socket_ipv6only(evutil_socket_t sock)</div><div class="ttdoc">Set ipv6 only bind socket option to make listener work only in ipv6 sockets.</div></div>
<div class="ttc" id="autil_8h_html_a0f36c2fc48c644a4f56347a25c585cc9"><div class="ttname"><a href="util_8h.html#a0f36c2fc48c644a4f56347a25c585cc9">evutil_getaddrinfo</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_getaddrinfo(const char *nodename, const char *servname, const struct evutil_addrinfo *hints_in, struct evutil_addrinfo **res)</div><div class="ttdoc">This function clones getaddrinfo for systems that don't have it.</div></div>
<div class="ttc" id="autil_8h_html_a03b44d66883df5bfed32c9ac6df93aac"><div class="ttname"><a href="util_8h.html#a03b44d66883df5bfed32c9ac6df93aac">evutil_ascii_strncasecmp</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_ascii_strncasecmp(const char *str1, const char *str2, size_t n)</div><div class="ttdoc">As strncasecmp, but always compares the characters in locale-independent ASCII.</div></div>
<div class="ttc" id="autil_8h_html_a4f8f2384311baf5d7308c7ab079f9b84"><div class="ttname"><a href="util_8h.html#a4f8f2384311baf5d7308c7ab079f9b84">evutil_make_socket_nonblocking</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_make_socket_nonblocking(evutil_socket_t sock)</div><div class="ttdoc">Do platform-specific operations as needed to make a socket nonblocking.</div></div>
<div class="ttc" id="autil_8h_html_a49ffe53dcbe32ad55f1582a0da358ac0"><div class="ttname"><a href="util_8h.html#a49ffe53dcbe32ad55f1582a0da358ac0">evutil_secure_rng_init</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_secure_rng_init(void)</div><div class="ttdoc">Seed the secure random number generator if needed, and return 0 on success or -1 on failure.</div></div>
<div class="ttc" id="autil_8h_html_a97d4f315d5c40c4f604f6c9ae694a684"><div class="ttname"><a href="util_8h.html#a97d4f315d5c40c4f604f6c9ae694a684">evutil_parse_sockaddr_port</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_parse_sockaddr_port(const char *str, struct sockaddr *out, int *outlen)</div><div class="ttdoc">Parse an IPv4 or IPv6 address, with optional port, from a string.</div></div>
<div class="ttc" id="autil_8h_html_a4544ddceb4e20c8c52985641ca829b7e"><div class="ttname"><a href="util_8h.html#a4544ddceb4e20c8c52985641ca829b7e">evutil_secure_rng_set_urandom_device_file</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_secure_rng_set_urandom_device_file(char *fname)</div><div class="ttdoc">Set a filename to use in place of /dev/urandom for seeding the secure PRNG.</div></div>
<div class="ttc" id="autil_8h_html_ad5ea5ef81ddcfb299e4867d362ad8654"><div class="ttname"><a href="util_8h.html#ad5ea5ef81ddcfb299e4867d362ad8654">evutil_socket_error_to_string</a></div><div class="ttdeci">#define evutil_socket_error_to_string(errcode)</div><div class="ttdoc">Convert a socket error to a string.</div><div class="ttdef"><b>Definition:</b> util.h:558</div></div>
<div class="ttc" id="autil_8h_html_afa98d48bdd6ad06c1fd013a44621d567"><div class="ttname"><a href="util_8h.html#afa98d48bdd6ad06c1fd013a44621d567">evutil_inet_ntop</a></div><div class="ttdeci">const EVENT2_EXPORT_SYMBOL char * evutil_inet_ntop(int af, const void *src, char *dst, size_t len)</div><div class="ttdoc">Replacement for inet_ntop for platforms which lack it.</div></div>
<div class="ttc" id="autil_8h_html_a28f952fb0f16b057d931fd38ee9bdf5e"><div class="ttname"><a href="util_8h.html#a28f952fb0f16b057d931fd38ee9bdf5e">evutil_socket_geterror</a></div><div class="ttdeci">#define evutil_socket_geterror(sock)</div><div class="ttdoc">Return the most recent socket error to occur on sock.</div><div class="ttdef"><b>Definition:</b> util.h:556</div></div>
<div class="ttc" id="autil_8h_html_a198e8db3626746515792e28b1380be67"><div class="ttname"><a href="util_8h.html#a198e8db3626746515792e28b1380be67">evutil_snprintf</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_snprintf(char *buf, size_t buflen, const char *format,...)</div><div class="ttdoc">Replacement for snprintf to get consistent behavior on platforms for which the return value of snprin...</div></div>
<div class="ttc" id="autil_8h_html_a031699658b52069610d660919d0c2b9d"><div class="ttname"><a href="util_8h.html#a031699658b52069610d660919d0c2b9d">evutil_make_listen_socket_not_ipv6only</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_make_listen_socket_not_ipv6only(evutil_socket_t sock)</div><div class="ttdoc">Set ipv6 only bind socket option to make listener work in both ipv4 and ipv6 sockets.</div></div>
<div class="ttc" id="autil_8h_html_a7edc3874139e863f61edf6c705030430"><div class="ttname"><a href="util_8h.html#a7edc3874139e863f61edf6c705030430">evutil_make_socket_closeonexec</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_make_socket_closeonexec(evutil_socket_t sock)</div><div class="ttdoc">Do platform-specific operations as needed to close a socket upon a successful execution of one of the...</div></div>
<div class="ttc" id="autil_8h_html_ab486d1e10fd1e3102b4e53beed8d9baa"><div class="ttname"><a href="util_8h.html#ab486d1e10fd1e3102b4e53beed8d9baa">evutil_configure_monotonic_time</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_configure_monotonic_time(struct evutil_monotonic_timer *timer, int flags)</div><div class="ttdoc">Set up a struct evutil_monotonic_timer; flags can include EV_MONOT_PRECISE and EV_MONOT_FALLBACK.</div></div>
<div class="ttc" id="autil_8h_html_a050a74274e08eb89a53cb8cb1d617939"><div class="ttname"><a href="util_8h.html#a050a74274e08eb89a53cb8cb1d617939">evutil_socketpair</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_socketpair(int domain, int type, int protocol, evutil_socket_t sv[2])</div><div class="ttdoc">Create two new sockets that are connected to each other.</div></div>
<div class="ttc" id="autil_8h_html_a58a472b3afc5cef1e6b1c9912604381b"><div class="ttname"><a href="util_8h.html#a58a472b3afc5cef1e6b1c9912604381b">evutil_freeaddrinfo</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL void evutil_freeaddrinfo(struct evutil_addrinfo *ai)</div><div class="ttdoc">Release storage allocated by evutil_getaddrinfo or evdns_getaddrinfo.</div></div>
<div class="ttc" id="autil_8h_html_a87b00e2754d908ba05c5aa8e9c8e4f28"><div class="ttname"><a href="util_8h.html#a87b00e2754d908ba05c5aa8e9c8e4f28">evutil_monotonic_timer_new</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL struct evutil_monotonic_timer * evutil_monotonic_timer_new(void)</div><div class="ttdoc">Allocate a new struct evutil_monotonic_timer for use with the evutil_configure_monotonic_time() and e...</div></div>
<div class="ttc" id="autil_8h_html_ad586fc57f596616d810a8b5fe4f8c111"><div class="ttname"><a href="util_8h.html#ad586fc57f596616d810a8b5fe4f8c111">evutil_inet_pton_scope</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_inet_pton_scope(int af, const char *src, void *dst, unsigned *indexp)</div><div class="ttdoc">Variation of inet_pton that also parses IPv6 scopes.</div></div>
<div class="ttc" id="autil_8h_html_a9175e63729c256eb2646e11e8211f4f7"><div class="ttname"><a href="util_8h.html#a9175e63729c256eb2646e11e8211f4f7">evutil_strtoll</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL ev_int64_t evutil_strtoll(const char *s, char **endptr, int base)</div><div class="ttdoc">Parse a 64-bit value from a string.</div></div>
<div class="ttc" id="autil_8h_html_a988b1fc98edeac63efc8b13c4f822a0d"><div class="ttname"><a href="util_8h.html#a988b1fc98edeac63efc8b13c4f822a0d">evutil_make_tcp_listen_socket_deferred</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_make_tcp_listen_socket_deferred(evutil_socket_t sock)</div><div class="ttdoc">Do platform-specific operations, if possible, to make a tcp listener socket defer accept()s until the...</div></div>
<div class="ttc" id="autil_8h_html_a3b5b7d22b368ffdd6ed77838bf4fcea6"><div class="ttname"><a href="util_8h.html#a3b5b7d22b368ffdd6ed77838bf4fcea6">evutil_secure_rng_add_bytes</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL void evutil_secure_rng_add_bytes(const char *dat, size_t datlen)</div><div class="ttdoc">Seed the random number generator with extra random bytes.</div></div>
<div class="ttc" id="autil_8h_html_a7b5ad1074f1effe2dbfa18b3f44b589f"><div class="ttname"><a href="util_8h.html#a7b5ad1074f1effe2dbfa18b3f44b589f">evutil_sockaddr_cmp</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_sockaddr_cmp(const struct sockaddr *sa1, const struct sockaddr *sa2, int include_port)</div><div class="ttdoc">Compare two sockaddrs; return 0 if they are equal, or less than 0 if sa1 preceeds sa2,...</div></div>
<div class="ttc" id="autil_8h_html_a5cfa6c13c62d17570a7d5f6d3541ff5b"><div class="ttname"><a href="util_8h.html#a5cfa6c13c62d17570a7d5f6d3541ff5b">evutil_closesocket</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_closesocket(evutil_socket_t sock)</div><div class="ttdoc">Do the platform-specific call needed to close a socket returned from socket() or accept().</div></div>
<div class="ttc" id="autil_8h_html_a2874062ff988293cd4e40b220933e209"><div class="ttname"><a href="util_8h.html#a2874062ff988293cd4e40b220933e209">evutil_monotonic_timer_free</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL void evutil_monotonic_timer_free(struct evutil_monotonic_timer *timer)</div><div class="ttdoc">Free a struct evutil_monotonic_timer that was allocated using evutil_monotonic_timer_new().</div></div>
<div class="ttc" id="astructevutil__addrinfo_html"><div class="ttname"><a href="structevutil__addrinfo.html">evutil_addrinfo</a></div><div class="ttdoc">A definition of struct addrinfo for systems that lack it.</div><div class="ttdef"><b>Definition:</b> util.h:731</div></div>
<div class="ttc" id="autil_8h_html_a9e4e68f77ce876ceecc6fb65f2dbe506"><div class="ttname"><a href="util_8h.html#a9e4e68f77ce876ceecc6fb65f2dbe506">evutil_make_listen_socket_reuseable_port</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_make_listen_socket_reuseable_port(evutil_socket_t sock)</div><div class="ttdoc">Do platform-specific operations to make a listener port reusable.</div></div>
<div class="ttc" id="autil_8h_html_a7a8e18b7861ed856bde592257f6b6e11"><div class="ttname"><a href="util_8h.html#a7a8e18b7861ed856bde592257f6b6e11">evutil_make_listen_socket_reuseable</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_make_listen_socket_reuseable(evutil_socket_t sock)</div><div class="ttdoc">Do platform-specific operations to make a listener socket reusable.</div></div>
<div class="ttc" id="autil_8h_html_a30bbdc509d150e5dfac1f74dd4e4c212"><div class="ttname"><a href="util_8h.html#a30bbdc509d150e5dfac1f74dd4e4c212">evutil_vsnprintf</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL int evutil_vsnprintf(char *buf, size_t buflen, const char *format, va_list ap)</div><div class="ttdoc">Replacement for vsnprintf to get consistent behavior on platforms for which the return value of snpri...</div></div>
<div class="ttc" id="autil_8h_html_a0836ed5d00ccab1957419a07b7acbb56"><div class="ttname"><a href="util_8h.html#a0836ed5d00ccab1957419a07b7acbb56">evutil_secure_rng_get_bytes</a></div><div class="ttdeci">EVENT2_EXPORT_SYMBOL void evutil_secure_rng_get_bytes(void *buf, size_t n)</div><div class="ttdoc">Generate n bytes of secure pseudorandom data, and store them in buf.</div></div>
<div class="ttc" id="autil_8h_html_a7ef0023565082a65020f6e56be59fd0b"><div class="ttname"><a href="util_8h.html#a7ef0023565082a65020f6e56be59fd0b">evutil_socket_t</a></div><div class="ttdeci">#define evutil_socket_t</div><div class="ttdoc">A type wide enough to hold the output of "socket()" or "accept()".</div><div class="ttdef"><b>Definition:</b> util.h:325</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>