-
Notifications
You must be signed in to change notification settings - Fork 0
/
group__sg__utils.html
891 lines (839 loc) · 46.3 KB
/
group__sg__utils.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
<!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" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.7"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Sagui library: Utilities</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>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="sagui.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 id="projectrow">
<td id="projectalign">
<div id="projectname">Sagui library<span id="projectnumber"> v3.5.0</span>
</div>
<div id="projectbrief">Cross-platform library which helps to develop web servers or frameworks.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.7 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li class="current"><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()"> </span>
<input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
</div><!-- top -->
<!-- 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">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#typedef-members">Typedefs</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">Utilities<div class="ingroups"><a class="el" href="group__sg__api.html">API reference</a></div></div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga7650eb746a05d774d3a5119e9e031060"><td class="memItemLeft" align="right" valign="top">typedef void *(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#ga7650eb746a05d774d3a5119e9e031060">sg_malloc_func</a>) (size_t size)</td></tr>
<tr class="separator:ga7650eb746a05d774d3a5119e9e031060"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga1c84f355702034ef35c29cad0724b37b"><td class="memItemLeft" align="right" valign="top">typedef void *(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#ga1c84f355702034ef35c29cad0724b37b">sg_realloc_func</a>) (void *ptr, size_t size)</td></tr>
<tr class="separator:ga1c84f355702034ef35c29cad0724b37b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga1c891524e260e3c54d891e43374a3126"><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#ga1c891524e260e3c54d891e43374a3126">sg_free_func</a>) (void *ptr)</td></tr>
<tr class="separator:ga1c891524e260e3c54d891e43374a3126"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gae67a015e080ffb3a9bdd0387f04a4e0f"><td class="memItemLeft" align="right" valign="top">typedef double(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#gae67a015e080ffb3a9bdd0387f04a4e0f">sg_pow_func</a>) (double x, double y)</td></tr>
<tr class="separator:gae67a015e080ffb3a9bdd0387f04a4e0f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga2b559e247963fc51dc4a64403966f581"><td class="memItemLeft" align="right" valign="top">typedef double(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#ga2b559e247963fc51dc4a64403966f581">sg_fmod_func</a>) (double x, double y)</td></tr>
<tr class="separator:ga2b559e247963fc51dc4a64403966f581"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gacf4b1e969cdaedde53d5fe5b7341d902"><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#gacf4b1e969cdaedde53d5fe5b7341d902">sg_err_cb</a>) (void *cls, const char *err)</td></tr>
<tr class="separator:gacf4b1e969cdaedde53d5fe5b7341d902"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gad3fa3639d86e65c76f0172749d928a9c"><td class="memItemLeft" align="right" valign="top">typedef ssize_t(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#gad3fa3639d86e65c76f0172749d928a9c">sg_write_cb</a>) (void *handle, uint64_t offset, const char *buf, size_t size)</td></tr>
<tr class="separator:gad3fa3639d86e65c76f0172749d928a9c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga38b5fcdae52a6ae333bdda7b24dabd79"><td class="memItemLeft" align="right" valign="top">typedef ssize_t(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#ga38b5fcdae52a6ae333bdda7b24dabd79">sg_read_cb</a>) (void *handle, uint64_t offset, char *buf, size_t size)</td></tr>
<tr class="separator:ga38b5fcdae52a6ae333bdda7b24dabd79"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga9dcbe0dd618af35cc57ea89ba1bf6ae7"><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#ga9dcbe0dd618af35cc57ea89ba1bf6ae7">sg_free_cb</a>) (void *handle)</td></tr>
<tr class="separator:ga9dcbe0dd618af35cc57ea89ba1bf6ae7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga742b3f7c158b7403cfc6e6480cf61c41"><td class="memItemLeft" align="right" valign="top">typedef int(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#ga742b3f7c158b7403cfc6e6480cf61c41">sg_save_cb</a>) (void *handle, bool overwritten)</td></tr>
<tr class="separator:ga742b3f7c158b7403cfc6e6480cf61c41"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga4f32fa1cdc5d1731d5fbbff1c9a17b80"><td class="memItemLeft" align="right" valign="top">typedef int(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#ga4f32fa1cdc5d1731d5fbbff1c9a17b80">sg_save_as_cb</a>) (void *handle, const char *path, bool overwritten)</td></tr>
<tr class="separator:ga4f32fa1cdc5d1731d5fbbff1c9a17b80"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga455f7e7b901e0c7201d037eb4f115327"><td class="memItemLeft" align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#ga455f7e7b901e0c7201d037eb4f115327">sg_version</a> (void)</td></tr>
<tr class="separator:ga455f7e7b901e0c7201d037eb4f115327"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaaa2db0569c92b1961c34e2f9a4dbba8c"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#gaaa2db0569c92b1961c34e2f9a4dbba8c">sg_version_str</a> (void)</td></tr>
<tr class="separator:gaaa2db0569c92b1961c34e2f9a4dbba8c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaa783cb7305cb80fc9b97dd68e69d03db"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#gaa783cb7305cb80fc9b97dd68e69d03db">sg_mm_set</a> (<a class="el" href="group__sg__utils.html#ga7650eb746a05d774d3a5119e9e031060">sg_malloc_func</a> malloc_func, <a class="el" href="group__sg__utils.html#ga1c84f355702034ef35c29cad0724b37b">sg_realloc_func</a> realloc_func, <a class="el" href="group__sg__utils.html#ga1c891524e260e3c54d891e43374a3126">sg_free_func</a> free_func)</td></tr>
<tr class="separator:gaa783cb7305cb80fc9b97dd68e69d03db"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gac3ce7d489be962c085fc3f70a05fad29"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#gac3ce7d489be962c085fc3f70a05fad29">sg_malloc</a> (size_t size) __attribute__((malloc))</td></tr>
<tr class="separator:gac3ce7d489be962c085fc3f70a05fad29"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga7354f1a6cfaea0a128810cac509a3d80"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#ga7354f1a6cfaea0a128810cac509a3d80">sg_alloc</a> (size_t size) __attribute__((malloc))</td></tr>
<tr class="separator:ga7354f1a6cfaea0a128810cac509a3d80"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gab50b44bf618ef99100fcb71457fd79c9"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#gab50b44bf618ef99100fcb71457fd79c9">sg_realloc</a> (void *ptr, size_t size) __attribute__((malloc))</td></tr>
<tr class="separator:gab50b44bf618ef99100fcb71457fd79c9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gae01910b94d1aa7d1a6fe44feaa3f111a"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#gae01910b94d1aa7d1a6fe44feaa3f111a">sg_free</a> (void *ptr)</td></tr>
<tr class="separator:gae01910b94d1aa7d1a6fe44feaa3f111a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gab831c4faa71627171cab4cbfbe807923"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#gab831c4faa71627171cab4cbfbe807923">sg_math_set</a> (<a class="el" href="group__sg__utils.html#gae67a015e080ffb3a9bdd0387f04a4e0f">sg_pow_func</a> pow_func, <a class="el" href="group__sg__utils.html#ga2b559e247963fc51dc4a64403966f581">sg_fmod_func</a> fmod_func)</td></tr>
<tr class="separator:gab831c4faa71627171cab4cbfbe807923"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga8f77f6063b04e3a24b3efc3703be72a1"><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#ga8f77f6063b04e3a24b3efc3703be72a1">sg_strerror</a> (int errnum, char *errmsg, size_t errlen)</td></tr>
<tr class="separator:ga8f77f6063b04e3a24b3efc3703be72a1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga4e4b1adf77a316ebae033459f7bdb286"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#ga4e4b1adf77a316ebae033459f7bdb286">sg_is_post</a> (const char *method)</td></tr>
<tr class="separator:ga4e4b1adf77a316ebae033459f7bdb286"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gad1fcaf48b69620c3cd98a2516511f06b"><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#gad1fcaf48b69620c3cd98a2516511f06b">sg_extract_entrypoint</a> (const char *path) __attribute__((malloc))</td></tr>
<tr class="separator:gad1fcaf48b69620c3cd98a2516511f06b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga7c2f7a192d11da45f4beda1c8d0d1825"><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#ga7c2f7a192d11da45f4beda1c8d0d1825">sg_tmpdir</a> (void) __attribute__((malloc))</td></tr>
<tr class="separator:ga7c2f7a192d11da45f4beda1c8d0d1825"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga0ba94e47ecb156d243aac0025a501025"><td class="memItemLeft" align="right" valign="top">ssize_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#ga0ba94e47ecb156d243aac0025a501025">sg_eor</a> (bool err)</td></tr>
<tr class="separator:ga0ba94e47ecb156d243aac0025a501025"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga576d2d764d59c25344f7612323af12fd"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__sg__utils.html#ga576d2d764d59c25344f7612323af12fd">sg_ip</a> (const void *socket, char *buf, size_t size)</td></tr>
<tr class="separator:ga576d2d764d59c25344f7612323af12fd"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>All utility functions of the library. </p>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga7650eb746a05d774d3a5119e9e031060" name="ga7650eb746a05d774d3a5119e9e031060"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7650eb746a05d774d3a5119e9e031060">◆ </a></span>sg_malloc_func</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void *(* sg_malloc_func) (size_t size)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Callback signature used to override the function which allocates a new memory space. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Memory size to be allocated. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Pointer of the allocated memory. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">NULL</td><td>If size is <code>0</code> or no memory space. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga1c84f355702034ef35c29cad0724b37b" name="ga1c84f355702034ef35c29cad0724b37b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1c84f355702034ef35c29cad0724b37b">◆ </a></span>sg_realloc_func</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void *(* sg_realloc_func) (void *ptr, size_t size)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Callback signature used to override the function which reallocates an existing memory block. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">ptr</td><td>Pointer of the memory to be reallocated. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Memory size to be reallocated. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Pointer of the reallocated memory. </dd></dl>
</div>
</div>
<a id="ga1c891524e260e3c54d891e43374a3126" name="ga1c891524e260e3c54d891e43374a3126"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1c891524e260e3c54d891e43374a3126">◆ </a></span>sg_free_func</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* sg_free_func) (void *ptr)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Callback signature used to override the function which frees a memory space previously allocated by <a class="el" href="group__sg__utils.html#gac3ce7d489be962c085fc3f70a05fad29">sg_malloc()</a>, <a class="el" href="group__sg__utils.html#ga7354f1a6cfaea0a128810cac509a3d80">sg_alloc()</a> or <a class="el" href="group__sg__utils.html#gab50b44bf618ef99100fcb71457fd79c9">sg_realloc()</a>. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">ptr</td><td>Pointer of the memory to be freed. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gae67a015e080ffb3a9bdd0387f04a4e0f" name="gae67a015e080ffb3a9bdd0387f04a4e0f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae67a015e080ffb3a9bdd0387f04a4e0f">◆ </a></span>sg_pow_func</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef double(* sg_pow_func) (double x, double y)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Callback signature used to override the function which returns the value of <code>x</code> raised to the power of <code>y</code>. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">x</td><td>Floating point base value. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">y</td><td>Floating point power value. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Value of <code>x</code> raised to the power of <code>y</code>. </dd></dl>
</div>
</div>
<a id="ga2b559e247963fc51dc4a64403966f581" name="ga2b559e247963fc51dc4a64403966f581"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2b559e247963fc51dc4a64403966f581">◆ </a></span>sg_fmod_func</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef double(* sg_fmod_func) (double x, double y)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Callback signature used to override the function which returns the remainder of <code>x</code> divided by <code>y</code>. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">x</td><td>Floating point value with the division numerator. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">y</td><td>Floating point value with the division denominator. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Remainder of <code>x</code> divided by <code>y</code>. </dd></dl>
</div>
</div>
<a id="gacf4b1e969cdaedde53d5fe5b7341d902" name="gacf4b1e969cdaedde53d5fe5b7341d902"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacf4b1e969cdaedde53d5fe5b7341d902">◆ </a></span>sg_err_cb</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* sg_err_cb) (void *cls, const char *err)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Callback signature used by functions that handle errors. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">cls</td><td>User-defined closure. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">err</td><td>Error message. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gad3fa3639d86e65c76f0172749d928a9c" name="gad3fa3639d86e65c76f0172749d928a9c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad3fa3639d86e65c76f0172749d928a9c">◆ </a></span>sg_write_cb</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef ssize_t(* sg_write_cb) (void *handle, uint64_t offset, const char *buf, size_t size)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Callback signature used by functions that write streams. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">handle</td><td>Stream handle. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">offset</td><td>Current stream offset. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">buf</td><td>Current buffer to be written. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">size</td><td>Size of the current buffer to be written. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Total written buffer. </dd></dl>
</div>
</div>
<a id="ga38b5fcdae52a6ae333bdda7b24dabd79" name="ga38b5fcdae52a6ae333bdda7b24dabd79"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga38b5fcdae52a6ae333bdda7b24dabd79">◆ </a></span>sg_read_cb</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef ssize_t(* sg_read_cb) (void *handle, uint64_t offset, char *buf, size_t size)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Callback signature used by functions that read streams. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">handle</td><td>Stream handle. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">offset</td><td>Current stream offset. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">buf</td><td>Current read buffer. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">size</td><td>Size of the current read buffer. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Total read buffer. </dd></dl>
</div>
</div>
<a id="ga9dcbe0dd618af35cc57ea89ba1bf6ae7" name="ga9dcbe0dd618af35cc57ea89ba1bf6ae7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9dcbe0dd618af35cc57ea89ba1bf6ae7">◆ </a></span>sg_free_cb</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* sg_free_cb) (void *handle)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Callback signature used by functions that free streams. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">handle</td><td>Stream handle. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga742b3f7c158b7403cfc6e6480cf61c41" name="ga742b3f7c158b7403cfc6e6480cf61c41"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga742b3f7c158b7403cfc6e6480cf61c41">◆ </a></span>sg_save_cb</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef int(* sg_save_cb) (void *handle, bool overwritten)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Callback signature used by functions that save streams. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">handle</td><td>Stream handle. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">overwritten</td><td>Overwrite an already existed stream. </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">0</td><td>Success. </td></tr>
<tr><td class="paramname">E<ERROR></td><td>User-defined error to abort the saving. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga4f32fa1cdc5d1731d5fbbff1c9a17b80" name="ga4f32fa1cdc5d1731d5fbbff1c9a17b80"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4f32fa1cdc5d1731d5fbbff1c9a17b80">◆ </a></span>sg_save_as_cb</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef int(* sg_save_as_cb) (void *handle, const char *path, bool overwritten)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Callback signature used by functions that save streams. It allows to specify the destination file path. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">handle</td><td>Stream handle. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">path</td><td>Absolute path to store the stream. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">overwritten</td><td>Overwrite an already existed stream. </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">0</td><td>Success. </td></tr>
<tr><td class="paramname">E<ERROR></td><td>User-defined error to abort the saving. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga455f7e7b901e0c7201d037eb4f115327" name="ga455f7e7b901e0c7201d037eb4f115327"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga455f7e7b901e0c7201d037eb4f115327">◆ </a></span>sg_version()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int sg_version </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the library version number. </p><dl class="section return"><dt>Returns</dt><dd>Library version packed into a single integer. </dd></dl>
</div>
</div>
<a id="gaaa2db0569c92b1961c34e2f9a4dbba8c" name="gaaa2db0569c92b1961c34e2f9a4dbba8c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaaa2db0569c92b1961c34e2f9a4dbba8c">◆ </a></span>sg_version_str()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char * sg_version_str </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the library version number as string in the format <code><MAJOR>.<MINOR>.<PATCH></code>. </p><dl class="section return"><dt>Returns</dt><dd>Library version packed into a null-terminated string. </dd></dl>
</div>
</div>
<a id="gaa783cb7305cb80fc9b97dd68e69d03db" name="gaa783cb7305cb80fc9b97dd68e69d03db"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa783cb7305cb80fc9b97dd68e69d03db">◆ </a></span>sg_mm_set()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int sg_mm_set </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__sg__utils.html#ga7650eb746a05d774d3a5119e9e031060">sg_malloc_func</a> </td>
<td class="paramname"><em>malloc_func</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__sg__utils.html#ga1c84f355702034ef35c29cad0724b37b">sg_realloc_func</a> </td>
<td class="paramname"><em>realloc_func</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__sg__utils.html#ga1c891524e260e3c54d891e43374a3126">sg_free_func</a> </td>
<td class="paramname"><em>free_func</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Overrides the standard functions <a href="https://linux.die.net/man/3/malloc">malloc(3)</a>, <a href="https://linux.die.net/man/3/realloc">realloc(3)</a> and <a href="https://linux.die.net/man/3/free">free(3)</a> set by default in the memory manager. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">malloc_func</td><td>Reference to override the function <code>malloc()</code>. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">realloc_func</td><td>Reference to override the function <code>realloc()</code>. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">free_func</td><td>Reference to override the function <code>free()</code>. </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">0</td><td>Success. </td></tr>
<tr><td class="paramname">EINVAL</td><td>Invalid argument. </td></tr>
</table>
</dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>It must be called before any other Sagui function or after all resources have been freed. </dd></dl>
</div>
</div>
<a id="gac3ce7d489be962c085fc3f70a05fad29" name="gac3ce7d489be962c085fc3f70a05fad29"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac3ce7d489be962c085fc3f70a05fad29">◆ </a></span>sg_malloc()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void * sg_malloc </td>
<td>(</td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>size</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Allocates a new memory space. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Memory size to be allocated. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Pointer of the allocated memory. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">NULL</td><td>If size is <code>0</code> or no memory space. </td></tr>
</table>
</dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Equivalent to <a href="https://linux.die.net/man/3/malloc">malloc(3)</a>. </dd></dl>
</div>
</div>
<a id="ga7354f1a6cfaea0a128810cac509a3d80" name="ga7354f1a6cfaea0a128810cac509a3d80"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7354f1a6cfaea0a128810cac509a3d80">◆ </a></span>sg_alloc()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void * sg_alloc </td>
<td>(</td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>size</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Allocates a new zero-initialized memory space. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Memory size to be allocated. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Pointer of the zero-initialized allocated memory. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">NULL</td><td>If size is <code>0</code> or no memory space. </td></tr>
</table>
</dd>
</dl>
<dl class="section examples"><dt>Examples</dt><dd><a class="el" href="example_httpsrv_tls_cert_auth_8c-example.html#a4">example_httpsrv_tls_cert_auth.c</a>.</dd>
</dl>
</div>
</div>
<a id="gab50b44bf618ef99100fcb71457fd79c9" name="gab50b44bf618ef99100fcb71457fd79c9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab50b44bf618ef99100fcb71457fd79c9">◆ </a></span>sg_realloc()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void * sg_realloc </td>
<td>(</td>
<td class="paramtype">void * </td>
<td class="paramname"><em>ptr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>size</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Reallocates an existing memory block. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">ptr</td><td>Pointer of the memory to be reallocated. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Memory size to be reallocated. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Pointer of the reallocated memory. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>Equivalent to <a href="https://linux.die.net/man/3/realloc">realloc(3)</a>. </dd></dl>
</div>
</div>
<a id="gae01910b94d1aa7d1a6fe44feaa3f111a" name="gae01910b94d1aa7d1a6fe44feaa3f111a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae01910b94d1aa7d1a6fe44feaa3f111a">◆ </a></span>sg_free()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sg_free </td>
<td>(</td>
<td class="paramtype">void * </td>
<td class="paramname"><em>ptr</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Frees a memory space previously allocated by <a class="el" href="group__sg__utils.html#gac3ce7d489be962c085fc3f70a05fad29">sg_malloc()</a>, <a class="el" href="group__sg__utils.html#ga7354f1a6cfaea0a128810cac509a3d80">sg_alloc()</a> or <a class="el" href="group__sg__utils.html#gab50b44bf618ef99100fcb71457fd79c9">sg_realloc()</a>. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">ptr</td><td>Pointer of the memory to be freed. </td></tr>
</table>
</dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Equivalent to <a href="https://linux.die.net/man/3/free">free(3)</a>. </dd></dl>
<dl class="section examples"><dt>Examples</dt><dd><a class="el" href="example_httpsrv_tls_cert_auth_8c-example.html#a6">example_httpsrv_tls_cert_auth.c</a>.</dd>
</dl>
</div>
</div>
<a id="gab831c4faa71627171cab4cbfbe807923" name="gab831c4faa71627171cab4cbfbe807923"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab831c4faa71627171cab4cbfbe807923">◆ </a></span>sg_math_set()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int sg_math_set </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__sg__utils.html#gae67a015e080ffb3a9bdd0387f04a4e0f">sg_pow_func</a> </td>
<td class="paramname"><em>pow_func</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__sg__utils.html#ga2b559e247963fc51dc4a64403966f581">sg_fmod_func</a> </td>
<td class="paramname"><em>fmod_func</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Overrides the standard functions <a href="https://linux.die.net/man/3/pow">pow(3)</a> and <a href="https://linux.die.net/man/3/fmod">fmod(3)</a> set by default in the math manager. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">pow_func</td><td>Reference to override the function <code>pow()</code>. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">fmod_func</td><td>Reference to override the function <code>fmod()</code>. </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">0</td><td>Success. </td></tr>
<tr><td class="paramname">EINVAL</td><td>Invalid argument. </td></tr>
</table>
</dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>It must be called before any other Sagui function or after all resources have been freed. </dd></dl>
</div>
</div>
<a id="ga8f77f6063b04e3a24b3efc3703be72a1" name="ga8f77f6063b04e3a24b3efc3703be72a1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8f77f6063b04e3a24b3efc3703be72a1">◆ </a></span>sg_strerror()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char * sg_strerror </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>errnum</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char * </td>
<td class="paramname"><em>errmsg</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>errlen</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns string describing an error number. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">errnum</td><td>Error number. </td></tr>
<tr><td class="paramdir">[in,out]</td><td class="paramname">errmsg</td><td>Pointer of a string to store the error message. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">errlen</td><td>Length of the error message. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Pointer to <b><code class="paramname">errmsg</code></b>. </dd></dl>
<dl class="section examples"><dt>Examples</dt><dd><a class="el" href="example_httpsrv_tls_cert_auth_8c-example.html#a0">example_httpsrv_tls_cert_auth.c</a>, and <a class="el" href="example_httpuplds_8c-example.html#a9">example_httpuplds.c</a>.</dd>
</dl>
</div>
</div>
<a id="ga4e4b1adf77a316ebae033459f7bdb286" name="ga4e4b1adf77a316ebae033459f7bdb286"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4e4b1adf77a316ebae033459f7bdb286">◆ </a></span>sg_is_post()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool sg_is_post </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>method</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Checks if a string is a HTTP post method. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">method</td><td>Null-terminated string. </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">true</td><td>If <b><code class="paramname">method</code></b> is <code>POST</code>, <code>PUT</code>, <code>DELETE</code> or <code>OPTIONS</code>. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="gad1fcaf48b69620c3cd98a2516511f06b" name="gad1fcaf48b69620c3cd98a2516511f06b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad1fcaf48b69620c3cd98a2516511f06b">◆ </a></span>sg_extract_entrypoint()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char * sg_extract_entrypoint </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>path</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Extracts the entry-point of a path or resource. For example, given a path <code>/api1/customer</code>, the part considered as entry-point is <code>/api1</code>. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">path</td><td>Path as a null-terminated string. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Entry-point as a null-terminated string. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">NULL</td><td>If no memory space is available. </td></tr>
</table>
</dd>
</dl>
<dl class="section warning"><dt>Warning</dt><dd>The caller must free the returned value. </dd></dl>
</div>
</div>
<a id="ga7c2f7a192d11da45f4beda1c8d0d1825" name="ga7c2f7a192d11da45f4beda1c8d0d1825"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7c2f7a192d11da45f4beda1c8d0d1825">◆ </a></span>sg_tmpdir()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char * sg_tmpdir </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the system temporary directory. </p><dl class="section return"><dt>Returns</dt><dd>Temporary directory as a null-terminated string. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">NULL</td><td>If no memory space is available. </td></tr>
</table>
</dd>
</dl>
<dl class="section warning"><dt>Warning</dt><dd>The caller must free the returned value. </dd></dl>
</div>
</div>
<a id="ga0ba94e47ecb156d243aac0025a501025" name="ga0ba94e47ecb156d243aac0025a501025"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0ba94e47ecb156d243aac0025a501025">◆ </a></span>sg_eor()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ssize_t sg_eor </td>
<td>(</td>
<td class="paramtype">bool </td>
<td class="paramname"><em>err</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Indicates the end-of-read processed in <a class="el" href="group__sg__httpsrv.html#gae38e335aa49865396adbd3146b064731">sg_httpres_sendstream()</a>. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">err</td><td><code>true</code> to return a value indicating a stream reading error. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Value to end a stream reading. </dd></dl>
</div>
</div>
<a id="ga576d2d764d59c25344f7612323af12fd" name="ga576d2d764d59c25344f7612323af12fd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga576d2d764d59c25344f7612323af12fd">◆ </a></span>sg_ip()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int sg_ip </td>
<td>(</td>
<td class="paramtype">const void * </td>
<td class="paramname"><em>socket</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char * </td>
<td class="paramname"><em>buf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>size</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Obtains the IP of a socket handle (e.g. the one returned by <a class="el" href="group__sg__httpsrv.html#gaaf1b69fa8e058cb6525c504b188fc299">sg_httpreq_client()</a>) into a null-terminated string. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">socket</td><td>Socket handle. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">buf</td><td>Pointer of the string to store the IP. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Size of the string to store the IP. </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">0</td><td>Success. </td></tr>
<tr><td class="paramname">EINVAL</td><td>Invalid argument. </td></tr>
<tr><td class="paramname">EAFNOSUPPORT</td><td>Address family not supported by protocol. </td></tr>
<tr><td class="paramname">ENOSPC</td><td>No space left on device. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Feb 14 2024 15:11:38 for Sagui library by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.7
</small></address>
</body>
</html>