stdlib.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef __STDLIB
  2. #define __STDLIB
  3. #define EXIT_FAILURE 1
  4. #define EXIT_SUCCESS 0
  5. #define MB_CUR_MAX 1
  6. #define NULL 0
  7. #define RAND_MAX 32767
  8. typedef struct { int quot, rem; } div_t;
  9. typedef struct { long quot, rem; } ldiv_t;
  10. #if !defined(_SIZE_T) && !defined(_SIZE_T_)
  11. #define _SIZE_T
  12. #define _SIZE_T_
  13. typedef unsigned long size_t;
  14. #endif
  15. #if !defined(_WCHAR_T) && !defined(_WCHAR_T_)
  16. #define _WCHAR_T
  17. #define _WCHAR_T_
  18. typedef unsigned char wchar_t;
  19. #endif
  20. extern double atof(const char *);
  21. extern int atoi(const char *);
  22. extern long int atol(const char *);
  23. extern double strtod(const char *, char **);
  24. extern long int strtol(const char *, char **, int);
  25. extern unsigned long int strtoul(const char *, char **, int);
  26. extern int rand(void);
  27. extern void srand(unsigned int);
  28. extern void *calloc(size_t, size_t);
  29. extern void free(void *);
  30. extern void *malloc(size_t);
  31. extern void *realloc(void *, size_t);
  32. extern void abort(void);
  33. extern int atexit(void (*)(void));
  34. extern void exit(int);
  35. extern char *getenv(const char *);
  36. extern int system(const char *);
  37. extern void *bsearch(const void *, const void *, size_t, size_t, int (*)(const void *, const void *));
  38. extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
  39. extern int abs(int);
  40. extern div_t div(int, int);
  41. extern long int labs(long int);
  42. extern ldiv_t ldiv(long int, long int);
  43. extern int mblen(const char *, size_t);
  44. extern int mbtowc(wchar_t *, const char *, size_t);
  45. extern int wctomb(char *, wchar_t);
  46. extern size_t mbstowcs(wchar_t *, const char *, size_t);
  47. extern size_t wcstombs(char *, const wchar_t *, size_t);
  48. #endif /* __STDLIB */