install lspci and lsusb to /usr/bin
[oweals/busybox.git] / include / xatonum.h
index 6cf1299b30fc43cfa057709b6a679e85b251c6ce..978c502f6f2cf922cf579f6278e268acc781504d 100644 (file)
@@ -7,27 +7,26 @@
  * Licensed under GPLv2, see file LICENSE in this tarball for details.
  */
 
-#if __GNUC_PREREQ(4,1)
-# pragma GCC visibility push(hidden)
-#endif
+PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
 
 /* Provides extern declarations of functions */
 #define DECLARE_STR_CONV(type, T, UT) \
 \
-unsigned type xstrto##UT##_range_sfx(const char *str, int b, unsigned type l, unsigned type u, const struct suffix_mult *sfx); \
-unsigned type xstrto##UT##_range(const char *str, int b, unsigned type l, unsigned type u); \
-unsigned type xstrto##UT##_sfx(const char *str, int b, const struct suffix_mult *sfx); \
-unsigned type xstrto##UT(const char *str, int b); \
-unsigned type xato##UT##_range_sfx(const char *str, unsigned type l, unsigned type u, const struct suffix_mult *sfx); \
-unsigned type xato##UT##_range(const char *str, unsigned type l, unsigned type u); \
-unsigned type xato##UT##_sfx(const char *str, const struct suffix_mult *sfx); \
-unsigned type xato##UT(const char *str); \
-type xstrto##T##_range_sfx(const char *str, int b, type l, type u, const struct suffix_mult *sfx); \
-type xstrto##T##_range(const char *str, int b, type l, type u); \
-type xato##T##_range_sfx(const char *str, type l, type u, const struct suffix_mult *sfx); \
-type xato##T##_range(const char *str, type l, type u); \
-type xato##T##_sfx(const char *str, const struct suffix_mult *sfx); \
-type xato##T(const char *str); \
+unsigned type xstrto##UT##_range_sfx(const char *str, int b, unsigned type l, unsigned type u, const struct suffix_mult *sfx) FAST_FUNC; \
+unsigned type xstrto##UT##_range(const char *str, int b, unsigned type l, unsigned type u) FAST_FUNC; \
+unsigned type xstrto##UT##_sfx(const char *str, int b, const struct suffix_mult *sfx) FAST_FUNC; \
+unsigned type xstrto##UT(const char *str, int b) FAST_FUNC; \
+unsigned type xato##UT##_range_sfx(const char *str, unsigned type l, unsigned type u, const struct suffix_mult *sfx) FAST_FUNC; \
+unsigned type xato##UT##_range(const char *str, unsigned type l, unsigned type u) FAST_FUNC; \
+unsigned type xato##UT##_sfx(const char *str, const struct suffix_mult *sfx) FAST_FUNC; \
+unsigned type xato##UT(const char *str) FAST_FUNC; \
+type xstrto##T##_range_sfx(const char *str, int b, type l, type u, const struct suffix_mult *sfx) FAST_FUNC; \
+type xstrto##T##_range(const char *str, int b, type l, type u) FAST_FUNC; \
+type xstrto##T(const char *str, int b) FAST_FUNC; \
+type xato##T##_range_sfx(const char *str, type l, type u, const struct suffix_mult *sfx) FAST_FUNC; \
+type xato##T##_range(const char *str, type l, type u) FAST_FUNC; \
+type xato##T##_sfx(const char *str, const struct suffix_mult *sfx) FAST_FUNC; \
+type xato##T(const char *str) FAST_FUNC; \
 
 /* Unsigned long long functions always exist */
 DECLARE_STR_CONV(long long, ll, ull)
@@ -68,6 +67,9 @@ static ALWAYS_INLINE \
 narrow xstrto##N##_range(const char *str, int b, narrow l, narrow u) \
 { return xstrto##W##_range(str, b, l, u); } \
 static ALWAYS_INLINE \
+narrow xstrto##N(const char *str, int b) \
+{ return xstrto##W(str, b); } \
+static ALWAYS_INLINE \
 narrow xato##N##_range_sfx(const char *str, narrow l, narrow u, const struct suffix_mult *sfx) \
 { return xato##W##_range_sfx(str, l, u, sfx); } \
 static ALWAYS_INLINE \
@@ -99,7 +101,7 @@ DECLARE_STR_CONV(int, i, u)
 
 /* Specialized */
 
-int BUG_xatou32_unimplemented(void);
+uint32_t BUG_xatou32_unimplemented(void);
 static ALWAYS_INLINE uint32_t xatou32(const char *numstr)
 {
        if (UINT_MAX == 0xffffffff)
@@ -112,7 +114,7 @@ static ALWAYS_INLINE uint32_t xatou32(const char *numstr)
 /* Non-aborting kind of convertors: bb_strto[u][l]l */
 
 /* On exit: errno = 0 only if there was non-empty, '\0' terminated value
- * errno = EINVAL if value was not '\0' terminated, but othervise ok
+ * errno = EINVAL if value was not '\0' terminated, but otherwise ok
  *    Return value is still valid, caller should just check whether end[0]
  *    is a valid terminating char for particular case. OTOH, if caller
  *    requires '\0' terminated input, [s]he can just check errno == 0.
@@ -122,8 +124,8 @@ static ALWAYS_INLINE uint32_t xatou32(const char *numstr)
  *    return value is all-ones in this case.
  */
 
-unsigned long long bb_strtoull(const char *arg, char **endp, int base);
-long long bb_strtoll(const char *arg, char **endp, int base);
+unsigned long long bb_strtoull(const char *arg, char **endp, int base) FAST_FUNC;
+long long bb_strtoll(const char *arg, char **endp, int base) FAST_FUNC;
 
 #if ULONG_MAX == ULLONG_MAX
 static ALWAYS_INLINE
@@ -133,8 +135,8 @@ static ALWAYS_INLINE
 long bb_strtol(const char *arg, char **endp, int base)
 { return bb_strtoll(arg, endp, base); }
 #else
-unsigned long bb_strtoul(const char *arg, char **endp, int base);
-long bb_strtol(const char *arg, char **endp, int base);
+unsigned long bb_strtoul(const char *arg, char **endp, int base) FAST_FUNC;
+long bb_strtol(const char *arg, char **endp, int base) FAST_FUNC;
 #endif
 
 #if UINT_MAX == ULLONG_MAX
@@ -152,11 +154,11 @@ static ALWAYS_INLINE
 int bb_strtoi(const char *arg, char **endp, int base)
 { return bb_strtol(arg, endp, base); }
 #else
-unsigned bb_strtou(const char *arg, char **endp, int base);
-int bb_strtoi(const char *arg, char **endp, int base);
+unsigned bb_strtou(const char *arg, char **endp, int base) FAST_FUNC;
+int bb_strtoi(const char *arg, char **endp, int base) FAST_FUNC;
 #endif
 
-int BUG_bb_strtou32_unimplemented(void);
+uint32_t BUG_bb_strtou32_unimplemented(void);
 static ALWAYS_INLINE
 uint32_t bb_strtou32(const char *arg, char **endp, int base)
 {
@@ -169,8 +171,6 @@ uint32_t bb_strtou32(const char *arg, char **endp, int base)
 
 /* Floating point */
 
-/* double bb_strtod(const char *arg, char **endp); */
+double bb_strtod(const char *arg, char **endp) FAST_FUNC;
 
-#if __GNUC_PREREQ(4,1)
-# pragma GCC visibility pop
-#endif
+POP_SAVED_FUNCTION_VISIBILITY