home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 15 / AACD15.ISO / AACD / System / MorphOS / Developer / emulinclude / includestd / stdlib.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-11-02  |  6.2 KB  |  201 lines

  1. /*    $NetBSD: stdlib.h,v 1.24 1995/03/22 01:08:31 jtc Exp $    */
  2.  
  3. /*-
  4.  * Copyright (c) 1990 The Regents of the University of California.
  5.  * All rights reserved.
  6.  *
  7.  * Redistribution and use in source and binary forms, with or without
  8.  * modification, are permitted provided that the following conditions
  9.  * are met:
  10.  * 1. Redistributions of source code must retain the above copyright
  11.  *    notice, this list of conditions and the following disclaimer.
  12.  * 2. Redistributions in binary form must reproduce the above copyright
  13.  *    notice, this list of conditions and the following disclaimer in the
  14.  *    documentation and/or other materials provided with the distribution.
  15.  * 3. All advertising materials mentioning features or use of this software
  16.  *    must display the following acknowledgement:
  17.  *    This product includes software developed by the University of
  18.  *    California, Berkeley and its contributors.
  19.  * 4. Neither the name of the University nor the names of its contributors
  20.  *    may be used to endorse or promote products derived from this software
  21.  *    without specific prior written permission.
  22.  *
  23.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  24.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  25.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  26.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  27.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  28.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  29.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  30.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  31.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  32.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  33.  * SUCH DAMAGE.
  34.  *
  35.  *    @(#)stdlib.h    5.13 (Berkeley) 6/4/91
  36.  */
  37.  
  38. #ifndef _STDLIB_H_
  39. #define _STDLIB_H_
  40. #include <machine/ansi.h>
  41.  
  42. #if !defined(_ANSI_SOURCE)    /* for quad_t, etc. */
  43. #include <sys/types.h>
  44. #endif
  45.  
  46. #ifndef    _SIZE_T
  47. #ifdef    _BSD_SIZE_T_
  48. typedef    _BSD_SIZE_T_    size_t;
  49. #define    _SIZE_T
  50. #undef    _BSD_SIZE_T_
  51. #endif
  52. #endif
  53.  
  54. #ifdef    _BSD_WCHAR_T_
  55. typedef    _BSD_WCHAR_T_    wchar_t;
  56. #undef    _BSD_WCHAR_T_
  57. #endif
  58.  
  59. typedef struct {
  60.     int quot;        /* quotient */
  61.     int rem;        /* remainder */
  62. } div_t;
  63.  
  64. typedef struct {
  65.     long quot;        /* quotient */
  66.     long rem;        /* remainder */
  67. } ldiv_t;
  68.  
  69. #if !defined(_ANSI_SOURCE)
  70. typedef struct {
  71.     quad_t quot;        /* quotient */
  72.     quad_t rem;        /* remainder */
  73. } qdiv_t;
  74. #endif
  75.  
  76.  
  77. #ifndef    NULL
  78. #define    NULL    0
  79. #endif
  80.  
  81. #define    EXIT_FAILURE    1
  82. #define    EXIT_SUCCESS    0
  83.  
  84. #define    RAND_MAX    0x7fffffff
  85.  
  86. #define    MB_CUR_MAX    1    /* XXX */
  87.  
  88. #include <sys/cdefs.h>
  89.  
  90. __BEGIN_DECLS
  91. void     abort __P((void));
  92. int     abs __P((int));
  93. int     atexit __P((void (*)(void)));
  94. double     atof __P((const char *));
  95. int     atoi __P((const char *));
  96. long     atol __P((const char *));
  97. void    *bsearch __P((const void *, const void *, size_t,
  98.         size_t, int (*)(const void *, const void *)));
  99. void    *calloc __P((size_t, size_t));
  100. div_t     div __P((int, int));
  101. void     exit __P((int));
  102. void     free __P((void *));
  103. char    *getenv __P((const char *));
  104. long     labs __P((long));
  105. ldiv_t     ldiv __P((long, long));
  106. void    *malloc __P((size_t));
  107. void     qsort __P((void *, size_t, size_t,
  108.         int (*)(const void *, const void *)));
  109. int     rand __P((void));
  110. void    *realloc __P((void *, size_t));
  111. void     srand __P((unsigned));
  112. double     strtod __P((const char *, char **));
  113. long     strtol __P((const char *, char **, int));
  114. unsigned long
  115.      strtoul __P((const char *, char **, int));
  116. int     system __P((const char *));
  117.  
  118. /* these are currently just stubs */
  119. int     mblen __P((const char *, size_t));
  120. size_t     mbstowcs __P((wchar_t *, const char *, size_t));
  121. int     wctomb __P((char *, wchar_t));
  122. int     mbtowc __P((wchar_t *, const char *, size_t));
  123. size_t     wcstombs __P((char *, const wchar_t *, size_t));
  124.  
  125. #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
  126. #if defined(alloca) && (alloca == __builtin_alloca) && (__GNUC__ < 2)
  127. void  *alloca __P((int));     /* built-in for gcc */ 
  128. #else 
  129. void  *alloca __P((size_t)); 
  130. #endif /* __GNUC__ */ 
  131.  
  132. char    *getbsize __P((int *, long *));
  133. char    *cgetcap __P((char *, char *, int));
  134. int     cgetclose __P((void));
  135. int     cgetent __P((char **, char **, char *));
  136. int     cgetfirst __P((char **, char **));
  137. int     cgetmatch __P((char *, char *));
  138. int     cgetnext __P((char **, char **));
  139. int     cgetnum __P((char *, char *, long *));
  140. int     cgetset __P((char *));
  141. int     cgetstr __P((char *, char *, char **));
  142. int     cgetustr __P((char *, char *, char **));
  143.  
  144. int     daemon __P((int, int));
  145. char    *devname __P((int, int));
  146. int     getloadavg __P((double [], int));
  147.  
  148. long     a64l __P((const char *));
  149. char    *l64a __P((long));
  150.  
  151. void     cfree __P((void *));
  152.  
  153. int     getopt __P((int, char * const *, const char *));
  154. extern     char *optarg;            /* getopt(3) external variables */
  155. extern     int opterr;
  156. extern     int optind;
  157. extern     int optopt;
  158. extern     int optreset;
  159. int     getsubopt __P((char **, char * const *, char **));
  160. extern     char *suboptarg;        /* getsubopt(3) external variable */
  161.  
  162. int     heapsort __P((void *, size_t, size_t,
  163.         int (*)(const void *, const void *)));
  164. int     mergesort __P((void *, size_t, size_t,
  165.         int (*)(const void *, const void *)));
  166. int     radixsort __P((const unsigned char **, int, const unsigned char *,
  167.         unsigned));
  168. int     sradixsort __P((const unsigned char **, int, const unsigned char *,
  169.         unsigned));
  170.  
  171. char    *initstate __P((unsigned, char *, int));
  172. long     random __P((void));
  173. char    *realpath __P((const char *, char *));
  174. char    *setstate __P((char *));
  175. void     srandom __P((unsigned));
  176.  
  177. int     putenv __P((const char *));
  178. int     setenv __P((const char *, const char *, int));
  179. void     unsetenv __P((const char *));
  180. void     setproctitle __P((const char *, ...));
  181.  
  182. quad_t     qabs __P((quad_t));
  183. qdiv_t     qdiv __P((quad_t, quad_t));
  184. quad_t     strtoq __P((const char *, char **, int));
  185. u_quad_t strtouq __P((const char *, char **, int));
  186.  
  187. double     drand48 __P((void));
  188. double     erand48 __P((unsigned short[3]));
  189. long     jrand48 __P((unsigned short[3]));
  190. void     lcong48 __P((unsigned short[7]));
  191. long     lrand48 __P((void));
  192. long     mrand48 __P((void));
  193. long     nrand48 __P((unsigned short[3]));
  194. unsigned short *seed48 __P((unsigned short[3]));
  195. void     srand48 __P((long));
  196. #endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
  197.  
  198. __END_DECLS
  199.  
  200. #endif /* _STDLIB_H_ */
  201.