forked from boytm/libevhtp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
evhtp_numtoa.h
49 lines (39 loc) · 942 Bytes
/
evhtp_numtoa.h
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
#ifndef __EVHTP_NUMTOA_H__
#define __EVHTP_NUMTOA_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "evhtp-config.h"
/**
* @brief based on the system architecture, convert a size_t
* number to a string.
*
* @param value the input value
* @param str The output buffer, should be 24 chars or more.
*
* @return
*/
EVHTP_EXPORT size_t evhtp_modp_sizetoa(size_t value, char * str);
/**
* @brief converts uint32_t value to string
*
* @param value input value
* @param str output buffer, should be 16 chars or more
*
* @return
*/
EVHTP_EXPORT size_t evhtp_modp_u32toa(uint32_t value, char * str);
/**
* @brief convert uint64_t value to a string
*
* @param value input value
* @param str output buffer, should be 24 chars or more
*
* @return
*/
EVHTP_EXPORT size_t evhtp_modp_u64toa(uint64_t value, char * str);
#define evhtp_modp_uchartoa(_val) (unsigned char)('0' + _val)
#ifdef __cplusplus
}
#endif
#endif