2 * Wrappers around strtoull/strtoll that are safer and easier to
3 * use. For tests and assumptions, see internal_tests.c.
5 * str a NULL-terminated base decimal 10 unsigned integer
6 * out out parameter, if conversion succeeded
8 * returns true if conversion succeeded.
10 bool safe_strtoull(const char *str
, uint64_t *out
);
11 bool safe_strtoll(const char *str
, int64_t *out
);
12 bool safe_strtoul(const char *str
, uint32_t *out
);
13 bool safe_strtol(const char *str
, int32_t *out
);
16 extern uint64_t htonll(uint64_t);
17 extern uint64_t ntohll(uint64_t);
21 # define __gcc_attribute__ __attribute__
23 # define __gcc_attribute__(x)
27 * Vararg variant of perror that makes for more useful error messages
28 * when reporting with parameters.
30 * @param fmt a printf format
32 void vperror(const char *fmt
, ...)
33 __gcc_attribute__ ((format (printf
, 1, 2)));