home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_07 / LATTIC_3.ZIP / HEADERS / STDLIB.H < prev    next >
C/C++ Source or Header  |  1990-08-20  |  4KB  |  176 lines

  1. /*
  2.  * stdlib.h - general utilities and defines
  3.  *
  4.  * Started 30/8/89 Alex G. Kiernan, based on Lattice source
  5.  *
  6.  * Copyright (c) 1989 HiSoft and Lattice, Inc.
  7.  */
  8.  
  9. #ifndef _STDLIB_H
  10. #define    _STDLIB_H
  11.  
  12. #ifndef _SIZE_T
  13. #define _SIZE_T
  14. typedef unsigned long int size_t;
  15. #endif
  16.  
  17. #ifndef _WCHAR_T
  18. #define _WCHAR_T
  19. typedef unsigned int wchar_t;
  20. #endif
  21.  
  22. #define MB_CUR_MAX __mb_cur_max
  23. extern char __mb_cur_max;
  24.  
  25. typedef struct
  26. {
  27.     int quot;
  28.     int rem;
  29. } div_t;
  30.  
  31. typedef struct
  32. {
  33.     long int quot;
  34.     long int rem;
  35. } ldiv_t;
  36.  
  37. void *malloc(size_t);
  38. void *calloc(size_t,size_t);
  39. void *realloc(void *, size_t);
  40. void free(void *);
  41.  
  42. void *getml(size_t);
  43. int rlsml(void *, size_t);
  44. size_t sizmem(void);
  45. size_t chkml(void);
  46. int bldmem(int);
  47.  
  48. void *getmem(unsigned);
  49. int rlsmem(void *, unsigned);
  50.  
  51. void *alloca(size_t);
  52.  
  53. extern size_t _stkdelta;    /* stack/data area separation chicken factor */
  54.  
  55. void *sbrk(unsigned);
  56. void *lsbrk(long);
  57.  
  58. int chdir(const char *);
  59. int chmod(const char *, int);
  60. char *getcwd(const char *, int);
  61. int mkdir(const char *);
  62. int rmdir(const char *);
  63.  
  64. void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
  65. void dqsort(double *,size_t);
  66. void fqsort(float *,size_t);
  67. void lqsort(long *,size_t);
  68. void sqsort(short *,size_t);
  69. void tqsort(char **,size_t);
  70.  
  71. int mblen(const char *,size_t);
  72. size_t mbstowcs(wchar_t *, const char *, size_t);
  73. int mbtowc(wchar_t *, const char *, size_t);
  74. size_t wcstombs(char *, const wchar_t *, size_t);
  75. int wctomb(char *, wchar_t);
  76.  
  77. void exit(int);
  78. void abort(void);
  79. int atoi(const char *);
  80. double atof(const char *);
  81. long int atol(const char *);
  82. char *getenv(const char *);
  83.  
  84. void _exit(int);
  85. void _XCEXIT(int);
  86. char *argopt(int, char *[], char *, int *, char *);
  87.  
  88. void *bsearch(const void *, const void *, size_t, size_t, int (*)(const void *, const void *));
  89.  
  90. void *lsearch(const void *, void *, size_t *, size_t, int (*)(const void *, const void *));
  91. void *lfind(const void *, const void *, const size_t *, size_t, int (*)(const void *, const void *));
  92.  
  93. int getpid(void);
  94. int getopt(int argc, const char *argv[], const char *optstring);
  95.  
  96. extern int optopt,opterr,optind;
  97. extern char *optarg;
  98.  
  99. int system(const char *);
  100. size_t _hash(const char *);
  101.  
  102. void swab(const void *,void *,size_t);
  103.  
  104. #undef abs
  105. int abs(int);
  106. int __builtin_abs(int);
  107. #define abs(i) __builtin_abs(i)
  108.  
  109. #ifndef min
  110. int min(int,int);
  111. int __builtin_min(int,int);
  112. #define min(a,b)    __builtin_min(a,b)
  113. #endif
  114.  
  115. #ifndef max
  116. int max(int,int);
  117. int __builtin_max(int,int);
  118. #define max(a,b)    __builtin_max(a,b)
  119. #endif
  120.  
  121. long atol(char *);
  122. char *ecvt(double, int, int *, int *);
  123. char *fcvt(double, int, int *, int *);
  124. char *gcvt(double, int, char *);
  125. long getfnl(const char *, char *, size_t, int);
  126. extern int iabs(int);
  127. extern long labs(long);
  128. int onexit(int(*)(int));
  129. int putenv(char *);
  130.  
  131. int rand(void);
  132. int rmvenv(const char *);
  133. void srand(unsigned int);
  134. double strtod(const char *,const char **);
  135. long int strtol(const char *, char **, int);
  136. unsigned long int strtoul(const char *,char **,int);
  137. long int utpack(const char *);
  138. void utunpk(long int, char *);
  139.  
  140. int atexit(void (* )(void));
  141. div_t div(int, int);
  142. ldiv_t ldiv(long int, long int);
  143.  
  144. unsigned long _lrotl(unsigned long,int);
  145. #pragma inline d0=_lrotl(D0,D1) {"e3b8";}
  146.  
  147. unsigned short _rotl(unsigned short,int);
  148. #pragma inline d0=_rotl(D0,D1) {"e378";}
  149.  
  150. unsigned long _lrotr(unsigned long,int);
  151. #pragma inline d0=_lrotr(D0,D1) {"e2b8";}
  152.  
  153. unsigned short _rotr(unsigned short,int);
  154. #pragma inline d0=_rotr(D0,D1) {"e278";}
  155.  
  156. int forkl(const char *,...);
  157. int forkle(const char *,...);
  158. int forklp(const char *,...);
  159. int forklpe(const char *,...);
  160. int forkv(const char *,const char **);
  161. int forkve(const char *,const char **,const char **);
  162. int forkvp(const char *,const char **);
  163. int forkvpe(const char *,const char **,const char **);
  164.  
  165. int wait(void);
  166.  
  167. int _fork(const char *,const char **,const char **);
  168.  
  169. #define EXIT_SUCCESS 0
  170. #define EXIT_FAILURE 3
  171.  
  172. #define RAND_MAX 32767
  173.  
  174. #define NULL    ((void *)0)
  175. #endif
  176.