1 /* The <stdlib.h> header defines certain common macros, types, and functions.*/
10 /* The macros are NULL, EXIT_FAILURE, EXIT_SUCCESS, RAND_MAX, and MB_CUR_MAX.*/
11 #define NULL ((void *)0)
13 #define EXIT_FAILURE 1 /* standard error return using exit() */
14 #define EXIT_SUCCESS 0 /* successful return using exit() */
15 #define RAND_MAX 32767 /* largest value generated by rand() */
16 #define MB_CUR_MAX 1 /* max value of multibyte character in MINIX */
18 typedef struct { int quot
, rem
; } div_t;
19 typedef struct { long quot
, rem
; } ldiv_t;
21 /* The types are size_t, wchar_t, div_t, and ldiv_t. */
24 typedef unsigned int size_t; /* type returned by sizeof */
29 typedef char wchar_t; /* type expanded character set */
32 /* Function Prototypes. */
33 _PROTOTYPE( void abort
, (void) );
34 _PROTOTYPE( int abs
, (int _j
) );
35 _PROTOTYPE( int atexit
, (void (*_func
)(void)) );
36 _PROTOTYPE( double atof
, (const char *_nptr
) );
37 _PROTOTYPE( int atoi
, (const char *_nptr
) );
38 _PROTOTYPE( long atol
, (const char *_nptr
) );
39 _PROTOTYPE( void *calloc
, (size_t _nmemb
, size_t _size
) );
40 _PROTOTYPE( div_t div
, (int _numer
, int _denom
) );
41 _PROTOTYPE( void exit
, (int _status
) );
42 _PROTOTYPE( void free
, (void *_ptr
) );
43 _PROTOTYPE( char *getenv
, (const char *_name
) );
44 _PROTOTYPE( long labs
, (long _j
) );
45 _PROTOTYPE( ldiv_t ldiv
, (long _numer
, long _denom
) );
46 _PROTOTYPE( void *malloc
, (size_t _size
) );
47 _PROTOTYPE( int mblen
, (const char *_s
, size_t _n
) );
48 _PROTOTYPE( size_t mbstowcs
, (wchar_t *_pwcs
, const char *_s
, size_t _n
));
49 _PROTOTYPE( int mbtowc
, (wchar_t *_pwc
, const char *_s
, size_t _n
) );
50 _PROTOTYPE( int rand
, (void) );
51 _PROTOTYPE( void *realloc
, (void *_ptr
, size_t _size
) );
52 _PROTOTYPE( void srand
, (unsigned int _seed
) );
53 _PROTOTYPE( double strtod
, (const char *_nptr
, char **_endptr
) );
54 _PROTOTYPE( long strtol
, (const char *_nptr
, char **_endptr
, int _base
) );
55 _PROTOTYPE( int system
, (const char *_string
) );
56 _PROTOTYPE( size_t wcstombs
, (char *_s
, const wchar_t *_pwcs
, size_t _n
));
57 _PROTOTYPE( int wctomb
, (char *_s
, wchar_t _wchar
) );
58 _PROTOTYPE( void *bsearch
, (const void *_key
, const void *_base
,
59 size_t _nmemb
, size_t _size
,
60 int (*compar
) (const void *, const void *)) );
61 _PROTOTYPE( void qsort
, (void *_base
, size_t _nmemb
, size_t _size
,
62 int (*compar
) (const void *, const void *)) );
63 _PROTOTYPE( unsigned long int strtoul
,
64 (const char *_nptr
, char **_endptr
, int _base
) );
67 /* Open Group Base Specifications Issue 6 */
68 _PROTOTYPE( int mkstemp
, (char *_fmt
) );
69 _PROTOTYPE( char *initstate
, (unsigned _seed
, char *_state
,
71 _PROTOTYPE( long random
, (void) );
72 _PROTOTYPE( char *setstate
, (const char *state
) );
73 _PROTOTYPE( void srandom
, (unsigned seed
) );
74 _PROTOTYPE( int putenv
, (char *string
) );
75 _PROTOTYPE( int setenv
, (const char *envname
, const char *envval
,
77 _PROTOTYPE( int unsetenv
, (const char *name
) );
81 _PROTOTYPE( int getloadavg
, (double *, int) );
83 /* According to POSIX, getopt should be in unistd.h. What do we do with
86 _PROTOTYPE(int getopt
, (int _argc
, char * const _argv
[], const char *_opts
));
88 extern int optind
, opterr
, optopt
;