diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/abrtlib.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/inc/abrtlib.h b/inc/abrtlib.h index 17bd5429..c5ca60f7 100644 --- a/inc/abrtlib.h +++ b/inc/abrtlib.h @@ -102,6 +102,15 @@ char* xstrndup(const char *s, int n); char* skip_whitespace(const char *s); char* skip_non_whitespace(const char *s); +unsigned xatou(const char *numstr); +int xatoi(const char *numstr); +/* Using xatoi() instead of naive atoi() is not always convenient - + * in many places people want *non-negative* values, but store them + * in signed int. Therefore we need this one: + * dies if input is not in [0, INT_MAX] range. Also will reject '-0' etc */ +int xatoi_u(const char *numstr); + + extern ssize_t safe_read(int fd, void *buf, size_t count); // NB: will return short read on error, not -1, // if some data was read before error occurred |