GCS  0.2.3
gu_utils.h
1 // Copyright (C) 2010 Codership Oy <info@codership.com>
2 
9 #ifndef _gu_utils_h_
10 #define _gu_utils_h_
11 
12 #include <stdbool.h>
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 /*
19  * The string conversion functions below are slighly customized
20  * versions of standard libc functions designed to understand 'on'/'off' and
21  * K/M/G size modifiers and the like.
22  *
23  * They return pointer to the next character after conversion:
24  * - if (ret == str) no conversion was made
25  * - if (ret[0] == '\0') whole string was converted */
26 
27 extern const char*
28 gu_str2ll (const char* str, long long* ll);
29 
30 extern const char*
31 gu_str2dbl (const char* str, double* dbl);
32 
33 extern const char*
34 gu_str2bool (const char* str, bool* b);
35 
36 extern const char*
37 gu_str2ptr (const char* str, void** ptr);
38 
39 #ifdef __cplusplus
40 }
41 #endif
42 
43 #endif /* _gu_utils_h_ */