2005-04-21 16:53:53 +02:00
|
|
|
/* The <stdlib.h> header defines certain common macros, types, and functions.*/
|
|
|
|
|
|
|
|
#ifndef _STDLIB_H
|
|
|
|
#define _STDLIB_H
|
|
|
|
|
|
|
|
#ifndef _ANSI_H
|
|
|
|
#include <ansi.h>
|
|
|
|
#endif
|
|
|
|
|
2010-08-23 19:00:04 +02:00
|
|
|
#include <stddef.h>
|
2010-07-22 12:03:31 +02:00
|
|
|
#include <sys/null.h>
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
#define EXIT_FAILURE 1 /* standard error return using exit() */
|
|
|
|
#define EXIT_SUCCESS 0 /* successful return using exit() */
|
|
|
|
#define RAND_MAX 32767 /* largest value generated by rand() */
|
|
|
|
#define MB_CUR_MAX 1 /* max value of multibyte character in MINIX */
|
|
|
|
|
|
|
|
typedef struct { int quot, rem; } div_t;
|
|
|
|
typedef struct { long quot, rem; } ldiv_t;
|
|
|
|
|
2010-08-23 19:00:04 +02:00
|
|
|
/* The types are div_t, and ldiv_t. */
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
/* Function Prototypes. */
|
|
|
|
_PROTOTYPE( void abort, (void) );
|
|
|
|
_PROTOTYPE( int abs, (int _j) );
|
|
|
|
_PROTOTYPE( int atexit, (void (*_func)(void)) );
|
|
|
|
_PROTOTYPE( double atof, (const char *_nptr) );
|
|
|
|
_PROTOTYPE( int atoi, (const char *_nptr) );
|
|
|
|
_PROTOTYPE( long atol, (const char *_nptr) );
|
|
|
|
_PROTOTYPE( void *calloc, (size_t _nmemb, size_t _size) );
|
|
|
|
_PROTOTYPE( div_t div, (int _numer, int _denom) );
|
|
|
|
_PROTOTYPE( void exit, (int _status) );
|
|
|
|
_PROTOTYPE( void free, (void *_ptr) );
|
|
|
|
_PROTOTYPE( char *getenv, (const char *_name) );
|
|
|
|
_PROTOTYPE( long labs, (long _j) );
|
|
|
|
_PROTOTYPE( ldiv_t ldiv, (long _numer, long _denom) );
|
|
|
|
_PROTOTYPE( void *malloc, (size_t _size) );
|
|
|
|
_PROTOTYPE( int mblen, (const char *_s, size_t _n) );
|
|
|
|
_PROTOTYPE( size_t mbstowcs, (wchar_t *_pwcs, const char *_s, size_t _n));
|
|
|
|
_PROTOTYPE( int mbtowc, (wchar_t *_pwc, const char *_s, size_t _n) );
|
|
|
|
_PROTOTYPE( int rand, (void) );
|
|
|
|
_PROTOTYPE( void *realloc, (void *_ptr, size_t _size) );
|
|
|
|
_PROTOTYPE( void srand, (unsigned int _seed) );
|
|
|
|
_PROTOTYPE( double strtod, (const char *_nptr, char **_endptr) );
|
|
|
|
_PROTOTYPE( long strtol, (const char *_nptr, char **_endptr, int _base) );
|
|
|
|
_PROTOTYPE( int system, (const char *_string) );
|
|
|
|
_PROTOTYPE( size_t wcstombs, (char *_s, const wchar_t *_pwcs, size_t _n));
|
|
|
|
_PROTOTYPE( int wctomb, (char *_s, wchar_t _wchar) );
|
|
|
|
_PROTOTYPE( void *bsearch, (const void *_key, const void *_base,
|
|
|
|
size_t _nmemb, size_t _size,
|
|
|
|
int (*compar) (const void *, const void *)) );
|
|
|
|
_PROTOTYPE( void qsort, (void *_base, size_t _nmemb, size_t _size,
|
|
|
|
int (*compar) (const void *, const void *)) );
|
|
|
|
_PROTOTYPE( unsigned long int strtoul,
|
|
|
|
(const char *_nptr, char **_endptr, int _base) );
|
2010-06-18 16:03:13 +02:00
|
|
|
_PROTOTYPE( const char *getprogname, (void) );
|
|
|
|
_PROTOTYPE( void setprogname, (const char *) );
|
2005-04-21 16:53:53 +02:00
|
|
|
|
2005-06-29 17:29:08 +02:00
|
|
|
#ifdef _POSIX_SOURCE
|
2005-07-11 15:00:43 +02:00
|
|
|
/* Open Group Base Specifications Issue 6 */
|
2005-06-29 17:29:08 +02:00
|
|
|
_PROTOTYPE( int mkstemp, (char *_fmt) );
|
2005-07-11 15:00:43 +02:00
|
|
|
_PROTOTYPE( char *initstate, (unsigned _seed, char *_state,
|
|
|
|
size_t _size) );
|
|
|
|
_PROTOTYPE( long random, (void) );
|
2009-12-04 08:52:22 +01:00
|
|
|
_PROTOTYPE( char *realpath, (const char *file_name,
|
|
|
|
char *resolved_name) );
|
2005-07-11 15:00:43 +02:00
|
|
|
_PROTOTYPE( char *setstate, (const char *state) );
|
|
|
|
_PROTOTYPE( void srandom, (unsigned seed) );
|
2006-06-07 16:36:35 +02:00
|
|
|
_PROTOTYPE( int putenv, (char *string) );
|
|
|
|
_PROTOTYPE( int setenv, (const char *envname, const char *envval,
|
|
|
|
int overwrite) );
|
|
|
|
_PROTOTYPE( int unsetenv, (const char *name) );
|
2010-06-26 02:44:24 +02:00
|
|
|
_PROTOTYPE( int getsubopt, (char **optionp, char * const *keylistp, char **valuep));
|
2009-12-09 20:01:38 +01:00
|
|
|
|
|
|
|
#ifdef __LONG_LONG_SUPPORTED
|
|
|
|
_PROTOTYPE( long long strtoll, (const char *_nptr, char **_endptr,
|
|
|
|
int _base) );
|
|
|
|
_PROTOTYPE( unsigned long long strtoull, (const char *_nptr,
|
|
|
|
char **_endptr, int _base) );
|
|
|
|
#endif
|
|
|
|
|
2005-06-29 17:29:08 +02:00
|
|
|
#endif
|
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
#ifdef _MINIX
|
2006-06-07 16:36:35 +02:00
|
|
|
_PROTOTYPE( int getloadavg, (double *, int) );
|
2005-07-11 15:00:43 +02:00
|
|
|
|
|
|
|
/* According to POSIX, getopt should be in unistd.h. What do we do with
|
|
|
|
* this?
|
|
|
|
*/
|
2006-03-24 15:03:25 +01:00
|
|
|
_PROTOTYPE(int getopt, (int _argc, char * const _argv[], const char *_opts));
|
2005-04-21 16:53:53 +02:00
|
|
|
extern char *optarg;
|
|
|
|
extern int optind, opterr, optopt;
|
2010-07-12 19:32:57 +02:00
|
|
|
|
|
|
|
_PROTOTYPE(size_t shquote, (const char *arg, char *buf, size_t bufsize));
|
2010-07-15 00:45:28 +02:00
|
|
|
_PROTOTYPE(char *mkdtemp, (char *path));
|
2010-07-12 19:32:57 +02:00
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
#endif /* _MINIX */
|
|
|
|
|
|
|
|
#endif /* STDLIB_H */
|