stdlib.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef __STDLIB_H
  2. #define __STDLIB_H
  3. #pragma lib "/$M/lib/ape/libap.a"
  4. #include <stddef.h>
  5. #define EXIT_FAILURE 1
  6. #define EXIT_SUCCESS 0
  7. #define MB_CUR_MAX 3
  8. #define RAND_MAX 32767
  9. typedef struct { int quot, rem; } div_t;
  10. typedef struct { long quot, rem; } ldiv_t;
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. extern double atof(const char *);
  15. extern int atoi(const char *);
  16. extern long int atol(const char *);
  17. extern long long atoll(const char *);
  18. extern double strtod(const char *, char **);
  19. extern long int strtol(const char *, char **, int);
  20. extern unsigned long int strtoul(const char *, char **, int);
  21. extern long long int strtoll(const char *, char **, int);
  22. extern unsigned long long int strtoull(const char *, char **, int);
  23. extern int rand(void);
  24. extern void srand(unsigned int seed);
  25. extern void *calloc(size_t, size_t);
  26. extern void free(void *);
  27. extern void *malloc(size_t);
  28. extern void *realloc(void *, size_t);
  29. extern void abort(void);
  30. extern int atexit(void (*func)(void));
  31. extern void exit(int);
  32. extern char *getenv(const char *);
  33. extern int system(const char *);
  34. extern void *bsearch(const void *, const void *, size_t, size_t, int (*)(const void *, const void *));
  35. extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
  36. extern int abs(int);
  37. extern div_t div(int, int);
  38. extern long int labs(long int);
  39. extern ldiv_t ldiv(long int, long int);
  40. extern int mblen(const char *, size_t);
  41. extern int mbtowc(wchar_t *, const char *, size_t);
  42. extern int wctomb(char *, wchar_t);
  43. extern size_t mbstowcs(wchar_t *, const char *, size_t);
  44. extern size_t wcstombs(char *, const wchar_t *, size_t);
  45. #ifdef __cplusplus
  46. }
  47. #endif
  48. #endif /* __STDLIB_H */