home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Exec 5 / CD_Magazyn_EXEC_nr_5.iso / Programy / Programowanie / vbcc07e.lzx / vbcc / amigawos / include / stdlib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-03-20  |  1.8 KB  |  94 lines

  1. /* stdlib.h - vbcc PowerOpen/WarpOS */
  2.  
  3. #ifndef __STDLIB_H
  4. #define __STDLIB_H 1
  5.  
  6. #ifndef __SIZE_T
  7. #define __SIZE_T 1
  8. typedef unsigned long size_t;
  9. #endif
  10.  
  11. #ifndef __WCHAR_T
  12. #define __WCHAR_T 1
  13. typedef char wchar_t;
  14. #endif
  15.  
  16. #undef NULL
  17. #define NULL ((void *)0)
  18.  
  19. #ifndef EXIT_FAILURE
  20. #define EXIT_FAILURE 20
  21. #endif
  22. #ifndef EXIT_SUCCESS
  23. #define EXIT_SUCCESS 0
  24. #endif
  25.  
  26. #undef RAND_MAX
  27. #define RAND_MAX 32768
  28.  
  29.  
  30. void exit(int);
  31. void *malloc(size_t);
  32. void *calloc(size_t,size_t);
  33. void *realloc(void *,size_t);
  34. void free(void *);
  35. int system(const char *);
  36. int rand(void);
  37. void srand(unsigned int);
  38. double atof(const char *);
  39. int atoi(const char *);
  40. long atol(const char *);
  41. double strtod(const char *,char **);
  42. long strtol(const char *,char **,int);
  43. unsigned long strtoul(const char *,char **,int);
  44. void abort(void);
  45. int atexit(void (*)(void));
  46. char *getenv(const char *);
  47. void *bsearch(const void *,const void *,size_t,size_t,int (*)(const void *,const void *));
  48. void qsort(void *,size_t,size_t,int (*)(const void *,const void *));
  49.  
  50. /* PowerPC inline functions */
  51. int abs(__reg("r3") int) =
  52.                 "\tcmpwi\tr3,0\n"
  53.                 "\tbge\t$+8\n"
  54.                 "\tneg\tr3,r3\n"
  55.                 "#barrier";
  56. long labs(__reg("r3") long) =
  57.                 "\tcmpwi\tr3,0\n"
  58.                 "\tbge\t$+8\n"
  59.                 "\tneg\tr3,r3\n"
  60.                 "#barrier";
  61.  
  62. typedef struct {
  63.     int quot,rem;
  64. } div_t;
  65.  
  66. typedef struct {
  67.     long quot,rem;
  68. } ldiv_t;
  69.  
  70. div_t div(int,int);
  71. ldiv_t ldiv(long,long);
  72.  
  73. union _mheader {
  74.     struct{
  75.         union _mheader *ptr;
  76.         size_t size;
  77.     } s;
  78.     long align;
  79. };
  80.  
  81. extern size_t _nalloc;
  82.  
  83. #define atof(s) strtod((s),(char **)NULL)
  84. #define atoi(s) (int)strtol((s),(char **)NULL,10)
  85. #define atol(s) strtol((s),(char **)NULL,10)
  86.  
  87. struct __exitfuncs{
  88.     struct __exitfuncs *next;
  89.     void (*func)(void);
  90. };
  91.  
  92. #endif
  93.  
  94.