stdlib.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * stdlib.h - standard library
  3. *
  4. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  5. * See the copyright notice in the ACK home directory, in the file "Copyright".
  6. */
  7. /* $Id$ */
  8. #if !defined(_STDLIB_H)
  9. #define _STDLIB_H
  10. #define NULL ((void *)0)
  11. #define EXIT_FAILURE 1
  12. #define EXIT_SUCCESS 0
  13. #define RAND_MAX 32767
  14. #define MB_CUR_MAX 1
  15. typedef struct { int quot, rem; } div_t;
  16. typedef struct { long quot, rem; } ldiv_t;
  17. #if !defined(_SIZE_T)
  18. #define _SIZE_T
  19. typedef unsigned int size_t; /* type returned by sizeof */
  20. #endif /* _SIZE_T */
  21. #if !defined(_WCHAR_T)
  22. #define _WCHAR_T
  23. typedef char wchar_t;
  24. #endif /* _WCHAR_T */
  25. double atof(const char *_nptr);
  26. int atoi(const char *_nptr);
  27. long atol(const char *_nptr);
  28. double strtod(const char *_nptr, char **_endptr);
  29. long strtol(const char *_nptr, char **_endptr, int _base);
  30. unsigned long int strtoul(const char *_nptr, char **_endptr, int _base);
  31. int rand(void);
  32. void srand(unsigned int _seed);
  33. void *calloc(size_t _nmemb, size_t _size);
  34. void free(void *_ptr);
  35. void *malloc(size_t _size);
  36. void *realloc(void *_ptr, size_t _size);
  37. void abort(void);
  38. int atexit(void (*_func)(void));
  39. void exit(int _status);
  40. char *getenv(const char *_name);
  41. int system(const char *_string);
  42. void *bsearch(const void *_key, const void *_base,
  43. size_t _nmemb, size_t _size,
  44. int (*_compar)(const void *, const void *));
  45. void qsort(void *_base, size_t _nmemb, size_t _size,
  46. int (*_compar)(const void *, const void *));
  47. int abs(int _j);
  48. div_t div(int _numer, int _denom);
  49. long labs(long _j);
  50. ldiv_t ldiv(long _numer, long _denom);
  51. int mblen(const char *_s, size_t _n);
  52. int mbtowc(wchar_t *_pwc, const char *_s, size_t _n);
  53. int wctomb(char *_s, wchar_t _wchar);
  54. size_t mbstowcs(wchar_t *_pwcs, const char *_s, size_t _n);
  55. size_t wcstombs(char *_s, const wchar_t *_pwcs, size_t _n);
  56. #endif /* _STDLIB_H */