/* $Copyright:	$
 * Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
 * Sequent Computer Systems, Inc.   All rights reserved.
 *  
 * This software is furnished under a license and may be used
 * only in accordance with the terms of that license and with the
 * inclusion of the above copyright notice.   This software may not
 * be provided or otherwise made available to, or used by, any
 * other person.  No title to or ownership of the software is
 * hereby transferred.
*/

#ident	"$Header: stdlib.h 1.13 90/06/24 $"

#ifndef	_STDLIB_H_

/* ____________________________________________________________________*
 * This file forms part of the POSIX requirement described in sections *
 * 8.2 of 1003.1-1988 which should be refered to before making any     *
 * changes.                                                	       *
 *_____________________________________________________________________*/

#define MULTI_BYTE_MAX	5
#define multi_byte_max	_ctype[520]
#define mblen(s, n)	mbtowc((wchar_t *)0, s, n)

#ifndef _WCHAR_T
typedef long wchar_t;
#define _WCHAR_T
#endif /* _WCHAR_T */

extern unsigned char _ctype[];

#ifndef _DIV_T
#define _DIV_T
typedef int	div_t;
#endif

#ifndef _LDIV_T
#define _LDIV_T
typedef long int	ldiv_t;
#endif

#ifndef _SIZE_T
#define _SIZE_T
typedef unsigned int    size_t;
#endif

#ifndef NULL
#define NULL            0
#endif

#define ERANGE          34      /* Math result not representable        */

#ifndef _POSIX_SOURCE

#ifndef HUGE_VAL
#define MAXFLOAT        3.40282346638528860e+38 /*max decimal value of a "float" */
#ifndef NO_XPG3_HDR
#define HUGE_VAL	(1.79769313486231570e+308)	/* DBL_MAX	*/
#else
#define HUGE_VAL	MAXFLOAT
#endif	/* NO_XPG3_HDR */
#endif	/* HUGE_VAL */

#endif /* _POSIX_SOURCE */

#define EXIT_FAILURE	1
#define EXIT_SUCCESS    0
#define RAND_MAX	32767

extern char *getcwd();
extern char *getenv();
extern char *getlogin();
extern char *ttyname();
extern div_t div();
extern double atof();
extern double frexp();
extern double ldexp();
extern double modf();
extern double strtod();
extern int abs();
extern int atexit();
extern int atoi();
extern int dup2();
extern int isatty();
extern int mbtowc();
extern int rand();
extern int system();
extern int wctomb();
extern ldiv_t ldiv();
extern long int atol();
extern long int labs();
extern long int strtol();
extern unsigned long int strtoul();
#ifndef NO_XPG3_HDR
extern void *bsearch();
extern void *calloc();
extern void *malloc();
extern void *realloc();
#else
extern char *bsearch();
extern char *calloc();
extern char *malloc();
extern char *realloc();
#endif	/* NO_XPG3_HDR */
extern void abort();
extern void exit();
extern void free();
extern void srand();

#ifndef _POSIX_SOURCE
extern char *ecvt();
extern char *fcvt();
extern char *gcvt();
extern char *getpass();
extern char *l64a();
extern char *mktemp();
extern double drand48();
extern double erand48();
extern int getopt();
extern int getpw();
extern int putenv();
extern int ttyslot();
extern long a64l();
extern long jrand48();
extern long lrand48();
extern long mrand48();
extern long nrand48();
extern unsigned short *seed48();
extern void l3tol();
extern void lcong48();
extern void ltol3();
extern void qsort();
extern void srand48();
extern void swab();
#endif /* _POSIX_SOURCE */

#define	_STDLIB_H_
#endif 	/* _STDLIB_H_ */
