X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fstrtonum.h;h=ae25ff5d9a46c4aeb9ea5f9b01cee51076ddeeaf;hb=9689a6aa2bb0815ab95ea679d0d298acc4c5cd5b;hp=35807de1eae5b08a5dc9a250cee31d4ba888b43f;hpb=0192d9f3a127c82b32131d26ed9b5fb5a90db723;p=libucw.git diff --git a/ucw/strtonum.h b/ucw/strtonum.h index 35807de1..ae25ff5d 100644 --- a/ucw/strtonum.h +++ b/ucw/strtonum.h @@ -11,6 +11,9 @@ #define _STRTONUM_H #ifdef CONFIG_UCW_CLEAN_ABI +#define str_to_u32 ucw_str_to_u32 +#define str_to_u64 ucw_str_to_u64 +#define str_to_uint ucw_str_to_uint #define str_to_uintmax ucw_str_to_uintmax #define str_to_uns ucw_str_to_uns #endif @@ -40,18 +43,27 @@ enum str_to_num_flags { #define STN_USFLAGS (STN_SFLAGS | STN_UNDERSCORE) #define STN_DECLARE_CONVERTOR(type, suffix) \ -const char *str_to_##suffix(type *num, const char *str, const char **next, const uns flags) +const char *str_to_##suffix(type *num, const char *str, const char **next, const uint flags) #define STN_SIGNED_CONVERTOR(type, suffix, usuffix) \ -static inline const char *str_to_##suffix(type *num, const char *str, const char **next, const uns flags) \ +static inline const char *str_to_##suffix(type *num, const char *str, const char **next, const uint flags) \ { \ return str_to_##usuffix((void *) num, str, next, flags | STN_SIGNED | STN_PLUS | STN_MINUS); \ } -STN_DECLARE_CONVERTOR(uns, uns); -STN_SIGNED_CONVERTOR(int, int, uns) +STN_DECLARE_CONVERTOR(uint, uint); +STN_SIGNED_CONVERTOR(int, int, uint) + +STN_DECLARE_CONVERTOR(u32, u32); +STN_SIGNED_CONVERTOR(s32, s32, u32) + +STN_DECLARE_CONVERTOR(u64, u64); +STN_SIGNED_CONVERTOR(s64, s64, u64) STN_DECLARE_CONVERTOR(uintmax_t, uintmax); STN_SIGNED_CONVERTOR(intmax_t, intmax, uintmax) +// FIXME: For backward compatibility, will be removed soon +STN_DECLARE_CONVERTOR(uns, uns); + #endif