]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - stdlib/stdlib.h
Fix typos.
[thirdparty/glibc.git] / stdlib / stdlib.h
index d3bd49275cf88e883deaefd47597327d48b19cd7..813da19e0df598ddd99043183c700ce71a042415 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2007, 2009-2011, 2012 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2013 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -151,7 +151,7 @@ extern long int atol (const char *__nptr)
      __THROW __attribute_pure__ __nonnull ((1)) __wur;
 __END_NAMESPACE_STD
 
-#if defined __USE_ISOC99 || (defined __GLIBC_HAVE_LONG_LONG && defined __USE_MISC)
+#if defined __USE_ISOC99 || defined __USE_MISC
 __BEGIN_NAMESPACE_C99
 /* Convert a string to a long long integer.  */
 __extension__ extern long long int atoll (const char *__nptr)
@@ -163,18 +163,18 @@ __BEGIN_NAMESPACE_STD
 /* Convert a string to a floating-point number.  */
 extern double strtod (const char *__restrict __nptr,
                      char **__restrict __endptr)
-     __THROW __nonnull ((1)) __wur;
+     __THROW __nonnull ((1));
 __END_NAMESPACE_STD
 
 #ifdef __USE_ISOC99
 __BEGIN_NAMESPACE_C99
 /* Likewise for `float' and `long double' sizes of floating-point numbers.  */
 extern float strtof (const char *__restrict __nptr,
-                    char **__restrict __endptr) __THROW __nonnull ((1)) __wur;
+                    char **__restrict __endptr) __THROW __nonnull ((1));
 
 extern long double strtold (const char *__restrict __nptr,
                            char **__restrict __endptr)
-     __THROW __nonnull ((1)) __wur;
+     __THROW __nonnull ((1));
 __END_NAMESPACE_C99
 #endif
 
@@ -182,40 +182,40 @@ __BEGIN_NAMESPACE_STD
 /* Convert a string to a long integer.  */
 extern long int strtol (const char *__restrict __nptr,
                        char **__restrict __endptr, int __base)
-     __THROW __nonnull ((1)) __wur;
+     __THROW __nonnull ((1));
 /* Convert a string to an unsigned long integer.  */
 extern unsigned long int strtoul (const char *__restrict __nptr,
                                  char **__restrict __endptr, int __base)
-     __THROW __nonnull ((1)) __wur;
+     __THROW __nonnull ((1));
 __END_NAMESPACE_STD
 
-#if defined __GLIBC_HAVE_LONG_LONG && defined __USE_BSD
+#ifdef __USE_BSD
 /* Convert a string to a quadword integer.  */
 __extension__
 extern long long int strtoq (const char *__restrict __nptr,
                             char **__restrict __endptr, int __base)
-     __THROW __nonnull ((1)) __wur;
+     __THROW __nonnull ((1));
 /* Convert a string to an unsigned quadword integer.  */
 __extension__
 extern unsigned long long int strtouq (const char *__restrict __nptr,
                                       char **__restrict __endptr, int __base)
-     __THROW __nonnull ((1)) __wur;
-#endif /* GCC and use BSD.  */
+     __THROW __nonnull ((1));
+#endif /* Use BSD.  */
 
-#if defined __USE_ISOC99 || (defined __GLIBC_HAVE_LONG_LONG && defined __USE_MISC)
+#if defined __USE_ISOC99 || defined __USE_MISC
 __BEGIN_NAMESPACE_C99
 /* Convert a string to a quadword integer.  */
 __extension__
 extern long long int strtoll (const char *__restrict __nptr,
                              char **__restrict __endptr, int __base)
-     __THROW __nonnull ((1)) __wur;
+     __THROW __nonnull ((1));
 /* Convert a string to an unsigned quadword integer.  */
 __extension__
 extern unsigned long long int strtoull (const char *__restrict __nptr,
                                        char **__restrict __endptr, int __base)
-     __THROW __nonnull ((1)) __wur;
+     __THROW __nonnull ((1));
 __END_NAMESPACE_C99
-#endif /* ISO C99 or GCC and use MISC.  */
+#endif /* ISO C99 or use MISC.  */
 
 
 #ifdef __USE_GNU
@@ -238,47 +238,42 @@ __END_NAMESPACE_C99
    use as an additional parameter.  */
 extern long int strtol_l (const char *__restrict __nptr,
                          char **__restrict __endptr, int __base,
-                         __locale_t __loc) __THROW __nonnull ((1, 4)) __wur;
+                         __locale_t __loc) __THROW __nonnull ((1, 4));
 
 extern unsigned long int strtoul_l (const char *__restrict __nptr,
                                    char **__restrict __endptr,
                                    int __base, __locale_t __loc)
-     __THROW __nonnull ((1, 4)) __wur;
+     __THROW __nonnull ((1, 4));
 
 __extension__
 extern long long int strtoll_l (const char *__restrict __nptr,
                                char **__restrict __endptr, int __base,
                                __locale_t __loc)
-     __THROW __nonnull ((1, 4)) __wur;
+     __THROW __nonnull ((1, 4));
 
 __extension__
 extern unsigned long long int strtoull_l (const char *__restrict __nptr,
                                          char **__restrict __endptr,
                                          int __base, __locale_t __loc)
-     __THROW __nonnull ((1, 4)) __wur;
+     __THROW __nonnull ((1, 4));
 
 extern double strtod_l (const char *__restrict __nptr,
                        char **__restrict __endptr, __locale_t __loc)
-     __THROW __nonnull ((1, 3)) __wur;
+     __THROW __nonnull ((1, 3));
 
 extern float strtof_l (const char *__restrict __nptr,
                       char **__restrict __endptr, __locale_t __loc)
-     __THROW __nonnull ((1, 3)) __wur;
+     __THROW __nonnull ((1, 3));
 
 extern long double strtold_l (const char *__restrict __nptr,
                              char **__restrict __endptr,
                              __locale_t __loc)
-     __THROW __nonnull ((1, 3)) __wur;
+     __THROW __nonnull ((1, 3));
 #endif /* GNU */
 
 
 #ifdef __USE_EXTERN_INLINES
 __BEGIN_NAMESPACE_STD
-__extern_inline double
-__NTH (atof (const char *__nptr))
-{
-  return strtod (__nptr, (char **) NULL);
-}
 __extern_inline int
 __NTH (atoi (const char *__nptr))
 {
@@ -420,7 +415,8 @@ struct drand48_data
     unsigned short int __old_x[3]; /* Old state.  */
     unsigned short int __c;    /* Additive const. in congruential formula.  */
     unsigned short int __init; /* Flag for initializing.  */
-    unsigned long long int __a;        /* Factor in congruential formula.  */
+    __extension__ unsigned long long int __a;  /* Factor in congruential
+                                                  formula.  */
   };
 
 /* Return non-negative, double-precision floating-point value in [0.0,1.0).  */
@@ -511,7 +507,7 @@ extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
 #ifdef __USE_ISOC11
 /* ISO C variant of aligned allocation.  */
 extern void *aligned_alloc (size_t __alignment, size_t __size)
-     __THROW __wur __attribute__ ((__malloc__, __alloc_size__ (2)));
+     __THROW __attribute_malloc__ __attribute_alloc_size__ ((2)) __wur;
 #endif
 
 __BEGIN_NAMESPACE_STD
@@ -568,10 +564,12 @@ __BEGIN_NAMESPACE_STD
 extern char *getenv (const char *__name) __THROW __nonnull ((1)) __wur;
 __END_NAMESPACE_STD
 
+#ifdef __USE_GNU
 /* This function is similar to the above but returns NULL if the
    programs is running with SUID or SGID enabled.  */
-extern char *__secure_getenv (const char *__name)
+extern char *secure_getenv (const char *__name)
      __THROW __nonnull ((1)) __wur;
+#endif
 
 #if defined __USE_SVID || defined __USE_XOPEN
 /* The SVID says this is in <stdio.h>, but this seems a better place.  */
@@ -599,12 +597,13 @@ extern int clearenv (void) __THROW;
 
 
 #if defined __USE_MISC \
-    || (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K)
+    || (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8)
 /* Generate a unique temporary file name from TEMPLATE.
    The last six characters of TEMPLATE must be "XXXXXX";
    they are replaced with a string that makes the file name unique.
-   Returns TEMPLATE, or a null pointer if it cannot get a unique file name.  */
-extern char *mktemp (char *__template) __THROW __nonnull ((1)) __wur;
+   Always returns TEMPLATE, it's either a temporary file name or a null
+   string if it cannot get a unique file name.  */
+extern char *mktemp (char *__template) __THROW __nonnull ((1));
 #endif
 
 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED \
@@ -757,6 +756,10 @@ extern void *bsearch (const void *__key, const void *__base,
                      size_t __nmemb, size_t __size, __compar_fn_t __compar)
      __nonnull ((1, 2, 5)) __wur;
 
+#ifdef __USE_EXTERN_INLINES
+# include <bits/stdlib-bsearch.h>
+#endif
+
 /* Sort NMEMB elements of BASE, of SIZE bytes each,
    using COMPAR to perform the comparisons.  */
 extern void qsort (void *__base, size_t __nmemb, size_t __size,
@@ -798,7 +801,7 @@ __END_NAMESPACE_C99
 #endif
 
 
-#if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) \
+#if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \
     || defined __USE_SVID
 /* Convert floating point numbers to strings.  The returned values are
    valid only until another call to the same function.  */
@@ -820,9 +823,9 @@ extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
    be written to BUF.  */
 extern char *gcvt (double __value, int __ndigit, char *__buf)
      __THROW __nonnull ((3)) __wur;
+#endif
 
-
-# ifdef __USE_MISC
+#ifdef __USE_MISC
 /* Long double versions of above functions.  */
 extern char *qecvt (long double __value, int __ndigit,
                    int *__restrict __decpt, int *__restrict __sign)
@@ -851,21 +854,20 @@ extern int qfcvt_r (long double __value, int __ndigit,
                    int *__restrict __decpt, int *__restrict __sign,
                    char *__restrict __buf, size_t __len)
      __THROW __nonnull ((3, 4, 5));
-# endif        /* misc */
-#endif /* use MISC || use X/Open Unix */
+#endif /* misc */
 
 
 __BEGIN_NAMESPACE_STD
 /* Return the length of the multibyte character
    in S, which is no longer than N.  */
-extern int mblen (const char *__s, size_t __n) __THROW __wur;
+extern int mblen (const char *__s, size_t __n) __THROW;
 /* Return the length of the given multibyte character,
    putting its `wchar_t' representation in *PWC.  */
 extern int mbtowc (wchar_t *__restrict __pwc,
-                  const char *__restrict __s, size_t __n) __THROW __wur;
+                  const char *__restrict __s, size_t __n) __THROW;
 /* Put the multibyte character represented
    by WCHAR in S, returning its length.  */
-extern int wctomb (char *__s, wchar_t __wchar) __THROW __wur;
+extern int wctomb (char *__s, wchar_t __wchar) __THROW;
 
 
 /* Convert a multibyte string to a wide char string.  */
@@ -925,7 +927,7 @@ extern int grantpt (int __fd) __THROW;
    Call after grantpt().  */
 extern int unlockpt (int __fd) __THROW;
 
-/* Return the pathname of the pseudo terminal slave assoicated with
+/* Return the pathname of the pseudo terminal slave associated with
    the master FD is open on, or NULL on errors.
    The returned storage is good until the next call to this function.  */
 extern char *ptsname (int __fd) __THROW __wur;
@@ -950,9 +952,10 @@ extern int getloadavg (double __loadavg[], int __nelem)
      __THROW __nonnull ((1));
 #endif
 
+#include <bits/stdlib-float.h>
 
 /* Define some macros helping to catch buffer overflows.  */
-#if __USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline
+#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
 # include <bits/stdlib.h>
 #endif
 #ifdef __LDBL_COMPAT