MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
util.h
1 #ifndef UTIL_H
2 #define UTIL_H
3 /*
4  * Wrappers around strtoull/strtoll that are safer and easier to
5  * use. For tests and assumptions, see internal_tests.c.
6  *
7  * str a NULL-terminated base decimal 10 unsigned integer
8  * out out parameter, if conversion succeeded
9  *
10  * returns true if conversion succeeded.
11  */
12 #include <memcached/visibility.h>
13 #include <memcached/types.h>
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 MEMCACHED_PUBLIC_API bool safe_strtoull(const char *str, uint64_t *out);
20 MEMCACHED_PUBLIC_API bool safe_strtoll(const char *str, int64_t *out);
21 MEMCACHED_PUBLIC_API bool safe_strtoul(const char *str, uint32_t *out);
22 MEMCACHED_PUBLIC_API bool safe_strtol(const char *str, int32_t *out);
23 MEMCACHED_PUBLIC_API bool safe_strtof(const char *str, float *out);
24 
25 #ifndef HAVE_HTONLL
26 MEMCACHED_PUBLIC_API extern uint64_t htonll(uint64_t);
27 MEMCACHED_PUBLIC_API extern uint64_t ntohll(uint64_t);
28 #endif
29 
30 #ifdef __GCC
31 # define __gcc_attribute__ __attribute__
32 #else
33 # define __gcc_attribute__(x)
34 #endif
35 
42 MEMCACHED_PUBLIC_API void vperror(const char *fmt, ...)
43  __gcc_attribute__ ((format (printf, 1, 2)));
44 
45 #ifdef __cplusplus
46 }
47 #endif /* __cplusplus */
48 #endif