home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #4 / amigaacscoverdisc1998-041998.iso / utilities / shareware / dev / vbcc / machines / amiga68k / include / stdlib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-12-30  |  1.9 KB  |  99 lines

  1. #ifndef __STDLIB_H
  2. #define __STDLIB_H 1
  3.  
  4. #include <stddef.h>
  5. #include <limits.h>
  6.  
  7. #ifndef EXIT_FAILURE
  8. #define EXIT_FAILURE 20
  9. #endif
  10. #ifndef EXIT_SUCCESS
  11. #define EXIT_SUCCESS 0
  12. #endif
  13.  
  14. #define RAND_MAX 32768
  15.  
  16. void exit(int);
  17. void *malloc(size_t);
  18. void *calloc(size_t,size_t);
  19. void *realloc(void *,size_t);
  20. void free(void *);
  21. int system(const char *);
  22. int rand(void);
  23. void srand(unsigned int);
  24. double atof(const char *);
  25. int atoi(const char *);
  26. long atol(const char *);
  27. double strtod(const char *,char **);
  28. long strtol(const char *,char **,int);
  29. unsigned long strtoul(const char *,char **,int);
  30. void abort(void);
  31. int atexit(void (*)(void));
  32. char *getenv(const char *);
  33. void *bsearch(const void *,const void *,size_t,size_t,int (*)(const void *,const void *));
  34. void qsort(void *,size_t,size_t,int (*)(const void *,const void *));
  35. int abs(int);
  36. long labs(long);
  37.  
  38. typedef struct {
  39.     int quot,rem;
  40. } div_t;
  41.  
  42. typedef struct {
  43.     long quot,rem;
  44. } ldiv_t;
  45.  
  46. div_t div(int,int);
  47. ldiv_t ldiv(long,long);
  48.  
  49. union _mheader {
  50.     struct{
  51.         union _mheader *ptr;
  52.         size_t size;
  53.     } s;
  54.     long align;
  55. };
  56.  
  57. extern size_t _nalloc;
  58.  
  59. #define atof(s) strtod((s),(char **)NULL)
  60. #define atoi(s) (int)strtol((s),(char **)NULL,10)
  61. #define atol(s) strtol((s),(char **)NULL,10)
  62.  
  63. struct __exitfuncs{
  64.     struct __exitfuncs *next;
  65.     void (*func)(void);
  66. };
  67.  
  68. #ifdef __INLINE_ALL
  69. #define __INLINE_ABS
  70. #define __INLINE_LABS
  71. #define __INLINE_DIV
  72. #define __INLINE_LDIV
  73. #endif
  74.  
  75. #ifdef __INLINE_ABS
  76. #pragma only-inline on
  77. #include "vbcc:libsrc/stdlib/abs.c"
  78. #pragma only-inline off
  79. #endif
  80. #ifdef __INLINE_LABS
  81. #pragma only-inline on
  82. #include "vbcc:libsrc/stdlib/labs.c"
  83. #pragma only-inline off
  84. #endif
  85. #ifdef __INLINE_DIV
  86. #pragma only-inline on
  87. #include "vbcc:libsrc/stdlib/div.c"
  88. #pragma only-inline off
  89. #endif
  90. #ifdef __INLINE_LDIV
  91. #pragma only-inline on
  92. #include "vbcc:libsrc/stdlib/ldiv.c"
  93. #pragma only-inline off
  94. #endif
  95.  
  96.  
  97. #endif
  98.  
  99.