strnum.h revision fa2e547a3298fb7855d096db5825b3624ebb5560
#ifndef STRNUM_H
#define STRNUM_H
/* str_to_*() functions return 0 if string is nothing more than a valid number
in valid range. Otherwise -1 is returned and num_r is left untouched
str_parse_*() helpers do not require the number to be the entire string
and pass back the pointer just past a valid parsed integer in endp_r if
it is non-NULL. What is written to endp_r in error cases is undefined.
*/
/*
* Unsigned decimal
*/
/* Returns TRUE if str is a valid unsigned number that equals to num. */
/*
* Unsigned hexadecimal
*/
/*
* Unsigned octal
*/
/*
* Signed
*/
/*
* Special numeric types
*/
/*
* Utility
*/
/* Return TRUE if all characters in string are numbers.
Stop when `end_char' is found from string. */
/* Returns human readable string about what is wrong with the string.
This function assumes that str_to_*() had already returned -1 for the
string. */
const char *str_num_error(const char *str);
#endif