stdlib.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. #ifndef _STDLIB_H
  2. #define _STDLIB_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #undef NULL
  7. #ifdef __cplusplus
  8. #define NULL 0
  9. #else
  10. #define NULL ((void*)0)
  11. #endif
  12. #define __NEED_size_t
  13. #define __NEED_wchar_t
  14. #include <bits/alltypes.h>
  15. int atoi (const char *);
  16. long atol (const char *);
  17. long long atoll (const char *);
  18. double atof (const char *);
  19. float strtof (const char *, char **);
  20. double strtod (const char *, char **);
  21. long double strtold (const char *, char **);
  22. long strtol (const char *, char **, int);
  23. unsigned long strtoul (const char *, char **, int);
  24. long long strtoll (const char *, char **, int);
  25. unsigned long long strtoull (const char *, char **, int);
  26. int rand (void);
  27. void srand (unsigned);
  28. void *malloc (size_t);
  29. void *calloc (size_t, size_t);
  30. void *realloc (void *, size_t);
  31. void free (void *);
  32. void abort (void);
  33. int atexit (void (*) (void));
  34. void exit (int);
  35. void _Exit (int);
  36. char *getenv (const char *);
  37. int system (const char *);
  38. void *bsearch (const void *, const void *, size_t, size_t, int (*)(const void *, const void *));
  39. void qsort (void *, size_t, size_t, int (*)(const void *, const void *));
  40. int abs (int);
  41. long labs (long);
  42. long long llabs (long long);
  43. typedef struct { int quot, rem; } div_t;
  44. typedef struct { long quot, rem; } ldiv_t;
  45. typedef struct { long long quot, rem; } lldiv_t;
  46. div_t div (int, int);
  47. ldiv_t ldiv (long, long);
  48. lldiv_t lldiv (long long, long long);
  49. int mblen (const char *, size_t);
  50. int mbtowc (wchar_t *, const char *, size_t);
  51. int wctomb (char *, wchar_t);
  52. size_t mbstowcs (wchar_t *, const char *, size_t);
  53. size_t wcstombs (char *, const wchar_t *, size_t);
  54. #define EXIT_FAILURE 1
  55. #define EXIT_SUCCESS 0
  56. #define MB_CUR_MAX ((size_t)+4)
  57. #define RAND_MAX (0x7fffffff)
  58. #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  59. || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
  60. #ifndef WEXITSTATUS
  61. #include <bits/wexitstatus.h>
  62. #endif
  63. int posix_memalign (void **, size_t, size_t);
  64. int setenv (const char *, const char *, int);
  65. int unsetenv (const char *);
  66. int mkstemp (char *);
  67. char *mkdtemp (char *);
  68. int getsubopt (char **, char *const *, char **);
  69. int rand_r (unsigned *);
  70. #endif
  71. #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
  72. int putenv (char *);
  73. int posix_openpt (int);
  74. int grantpt (int);
  75. int unlockpt (int);
  76. char *ptsname (int);
  77. char *realpath (const char *, char *);
  78. char *l64a (long);
  79. long a64l (const char *);
  80. void setkey (const char *);
  81. long int random (void);
  82. void srandom (unsigned int);
  83. char *initstate (unsigned int, char *, size_t);
  84. char *setstate (char *);
  85. double drand48 (void);
  86. double erand48 (unsigned short [3]);
  87. long int lrand48 (void);
  88. long int nrand48 (unsigned short [3]);
  89. long mrand48 (void);
  90. long jrand48 (unsigned short [3]);
  91. void srand48 (long);
  92. unsigned short *seed48 (unsigned short [3]);
  93. void lcong48 (unsigned short [7]);
  94. #endif
  95. #if defined(_GNU_SOURCE)
  96. char *mktemp (char *);
  97. void *valloc (size_t);
  98. void *memalign(size_t, size_t);
  99. #endif
  100. #ifdef __cplusplus
  101. }
  102. #endif
  103. #endif