/*  DO NOT EDIT THIS FILE.

    It has been auto-edited by fixincludes from:

	"/usr/include/stdlib.h"

    This had to be done to correct non-standard usages in the
    original, manufacturer supplied header file.  */

#ifndef _STDLIB_INCLUDED
#define _STDLIB_INCLUDED

#ifndef _SYS_STDSYMS_INCLUDED
#  include <sys/stdsyms.h>
#endif /* _SYS_STDSYMS_INCLUDED */

#ifndef _FAST_SHLIB_CALLS
#  if defined(_HP_SHLIB_CALLS) && !defined(__LP64__)
#    define _FAST_SHLIB_CALLS
#  endif
#endif /* _FAST_SHLIB_CALLS */

#ifdef _INCLUDE__STDC__
#  ifdef _NO_LIBCRES
#    ifdef _HP_SHLIB_CALLS
#      pragma HP_DEFINED_EXTERNAL abs
#    endif /* _HP_SHLIB_CALLS */
#    ifdef _FAST_SHLIB_CALLS
#      pragma HP_NO_RELOCATION abs
#      pragma HP_LONG_RETURN abs
#    endif /* _FAST_SHLIB_CALLS */
#  endif /* _NO_LIBCRES */
#  ifdef _PROTOTYPES
#    ifndef __cplusplus 
       extern int abs(int);
#    else /* __cplusplus */
#      ifndef _MATH_INCLUDED
_NAMESPACE_STD_START
         inline int abs(int d) { return (d>0)?d:-d; }
_NAMESPACE_STD_END
#      endif /* _MATH_INCLUDED */
#    endif /* __cplusplus */
#  else /* _PROTOTYPES */
     extern int abs();
#  endif /* _PROTOTYPES */
#endif /* _INCLUDE__STDC__ */

#ifdef __cplusplus
extern "C" {
#endif

#ifdef _INCLUDE__STDC__
#  define EXIT_FAILURE 1
#  define EXIT_SUCCESS 0
#  define MB_CUR_MAX __nl_char_size
   extern int __nl_char_size;

#  ifndef NULL
#    include <sys/_null.h>
#  endif

#  define _LDBL_MAX { 0x7ffeffff, 0xffffffff, 0xffffffff, 0xffffffff }
#  define _LDBL_NMAX { 0xfffeffff, 0xffffffff, 0xffffffff, 0xffffffff }
#  define _ZERO { 0, 0, 0, 0 }
#  define __LDBL_MAX(__a) ((__a == 0) ? 0x7ffeffff : 0xffffffff)
#  define __LDBL_NMAX(__a) ((__a == 0) ? 0xfffeffff : 0xffffffff)

#  define RAND_MAX 32767
_NAMESPACE_STD_START
   typedef struct {
	int quot;	/* quotient */
	int rem;	/* remainder */
   } div_t;
   typedef struct {
	long int quot;	/* quotient */
	long int rem;	/* remainder */
   } ldiv_t;
_NAMESPACE_STD_END

#  ifndef _SIZE_T
#    include <sys/_size_t.h>
#  endif

#   ifndef _WCHAR_T_INCLUDED
#       include <sys/_wchar_t.h>
#   endif /** _WCHAR_T_INCLUDED **/

#   ifdef _HP_SHLIB_CALLS
#     pragma HP_DEFINED_EXTERNAL atoi,atol,strtol,strtoul,rand,srand,atexit
#     pragma HP_DEFINED_EXTERNAL getenv,system,mblen,mbtowc,wctomb,mbstowcs
#     pragma HP_DEFINED_EXTERNAL wcstombs,abort,qsort
#   endif /* _HP_SHLIB_CALLS */
#   ifdef _FAST_SHLIB_CALLS
#     pragma HP_NO_RELOCATION atoi,atol,strtol,strtoul,rand,srand,atexit
#     pragma HP_NO_RELOCATION getenv,system,mblen,mbtowc,wctomb,mbstowcs
#     pragma HP_NO_RELOCATION wcstombs,abort,qsort
#     pragma HP_LONG_RETURN atoi,atol,strtol,strtoul,rand,srand,atexit
#     pragma HP_LONG_RETURN getenv,system,mblen,mbtowc,wctomb,mbstowcs
#     pragma HP_LONG_RETURN wcstombs,abort,qsort
#   endif /* _FAST_SHLIB_CALLS */
#   ifdef _NO_LIBCRES
#     ifdef _HP_SHLIB_CALLS
#       pragma HP_DEFINED_EXTERNAL div,ldiv,labs,bsearch
#     endif /* _HP_SHLIB_CALLS */
#     ifdef _FAST_SHLIB_CALLS
#       pragma HP_NO_RELOCATION div,ldiv,labs,bsearch
#       pragma HP_LONG_RETURN div,ldiv,labs,bsearch
#     endif /* _FAST_SHLIB_CALLS */
#   endif /* _NO_LIBCRES */ 
#  
#  ifdef _PROTOTYPES 
_NAMESPACE_STD_START
#    ifndef _ATOF_DEFINED
#      define _ATOF_DEFINED
       extern double atof(const char *);
#    endif /* _ATOF_DEFINED */
     extern int atoi(const char *);
     extern long int atol(const char *);
     extern double strtod(const char *, char **);
     extern long int strtol(const char *, char **, int);
     extern unsigned long int strtoul(const char *, char **, int);
     extern int rand(void);
     extern void srand(unsigned int);
     extern int atexit(void (*) (void));
     extern void exit(int);
     extern char *getenv(const char *);
     extern int system(const char *);
     extern div_t div(int, int);
     extern ldiv_t ldiv(long int, long int);
     extern long int labs(long int);
     extern int mblen(const char *, size_t);
     extern int mbtowc(wchar_t *, const char *, size_t);
     extern int wctomb(char *, wchar_t);
     extern size_t mbstowcs(wchar_t *, const char *, size_t);
     extern size_t wcstombs(char *, const wchar_t *, size_t);
     extern void free(void *);
     extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
_NAMESPACE_STD_END
#  else /* _PROTOTYPES */
#    ifndef _ATOF_DEFINED
#      define _ATOF_DEFINED
       extern double atof();
#    endif /* _ATOF_DEFINED */
     extern int atoi();
     extern long int atol();
     extern double strtod();
     extern long int strtol();
     extern void free();
     extern unsigned long int strtoul();
     extern int rand();
     extern void srand();
     extern int atexit();
     extern void exit();
     extern char *getenv();
     extern int system();
     extern int abs();
     extern div_t div();
     extern ldiv_t ldiv();
     extern long int labs();
     extern void qsort();
     extern int mblen();
     extern int mbtowc();
     extern int wctomb();
     extern size_t mbstowcs();
     extern size_t wcstombs();
#  endif /* _PROTOTYPES */

#  ifdef _CLASSIC_ANSI_TYPES

     extern void	abort();
     extern void *	bsearch();
     extern void *	calloc();
     extern void *	malloc();
     extern void *	realloc();
#  else /* _CLASSIC_ANSI_TYPES */
#    ifdef _PROTOTYPES 
_NAMESPACE_STD_START
       extern void abort(void);
       extern void *bsearch(const void *, const void *, size_t, size_t, int (*) (const void *, const void *));
       extern void *calloc(size_t, size_t);
       extern void *malloc(size_t);
       extern void *realloc(void *, size_t);
_NAMESPACE_STD_END
#    else /* _PROTOTYPES  */
       extern void abort();
       extern void *bsearch();
       extern void *calloc();
       extern void *malloc();
       extern void *realloc();
#    endif /* _PROTOTYPES */
#  endif /* _CLASSIC_ANSI_TYPES */

#endif /* _INCLUDE__STDC__ */

#if defined (_REENTRANT) && defined(_PTHREADS_DRAFT4)

struct drand48_data {
	unsigned short x[3];           /* 48 bit integer */
	unsigned short a[3];           /* mutiplier */
	unsigned short c;              /* addend */
	unsigned short lastx[3];       /* previous value of x */
	int init;           	       /* initialize ? */
};

#  ifdef _PROTOTYPES
     extern int drand48_r (struct drand48_data *, double *);
     extern int erand48_r (unsigned short [],struct drand48_data *,double*);
     extern int lrand48_r (struct drand48_data *, long *);
     extern int mrand48_r (struct drand48_data *, long *);
     extern int srand48_r (long, struct drand48_data *);
     extern int seed48_r (unsigned short [], struct drand48_data *);
     extern int lcong48_r (unsigned short [], struct drand48_data *);
     extern int nrand48_r (unsigned short [], struct drand48_data *, long*);
     extern int jrand48_r (unsigned short [], struct drand48_data *, long*);
#  else
     extern int drand48_r ();
     extern int erand48_r ();
     extern int lrand48_r ();
     extern int mrand48_r ();
     extern int srand48_r ();
     extern int seed48_r ();
     extern int lcong48_r ();
     extern int nrand48_r ();
     extern int jrand48_r ();
#  endif /* _PROTOTYPES */

#endif /* defined (_REENTRANT)&& defined(_PTHREADS_DRAFT4) */

#ifdef _XPG4
#  ifdef _HP_SHLIB_CALLS
#    pragma HP_DEFINED_EXTERNAL setkey,lcong48
#  endif /* _HP_SHLIB_CALLS */
#  ifdef _FAST_SHLIB_CALLS
#    pragma HP_NO_RELOCATION setkey,lcong48
#    pragma HP_LONG_RETURN setkey,lcong48
#  endif /* _FAST_SHLIB_CALLS */
#  ifdef _PROTOTYPES
     extern void setkey(const char *);
     extern void lcong48( unsigned short [] );
#  else /* _PROTOTYPES */
     extern void setkey();
     extern void lcong48();
#  endif /* _PROTOTYPES */
#endif /* _XPG4 */


#if defined( _XPG4 ) || defined ( _INCLUDE_AES_SOURCE )
#  ifdef _HP_SHLIB_CALLS
#    pragma HP_DEFINED_EXTERNAL jrand48,lrand48,mrand48,nrand48,srand48
#    pragma HP_DEFINED_EXTERNAL seed48,putenv
#  endif /* _HP_SHLIB_CALLS */
#  ifdef _FAST_SHLIB_CALLS
#    pragma HP_NO_RELOCATION jrand48,lrand48,mrand48,nrand48,srand48
#    pragma HP_NO_RELOCATION seed48,putenv
#    pragma HP_LONG_RETURN jrand48,lrand48,mrand48,nrand48,srand48
#    pragma HP_LONG_RETURN seed48,putenv
#  endif /* _FAST_SHLIB_CALLS */
#  ifdef _PROTOTYPES
     extern double drand48(void);
     extern double erand48(unsigned short []);
     extern long jrand48(unsigned short []);
     extern long lrand48(void);
     extern long mrand48(void);
     extern long nrand48(unsigned short []);
     extern void srand48(long);
     extern unsigned short *seed48(unsigned short []);
     extern int putenv(const char *);
#  else  /* _PROTOTYPES */
     extern double drand48();
     extern double erand48();
     extern long jrand48();
     extern long lrand48();
     extern long mrand48();
     extern long nrand48();
     extern void srand48();
     extern unsigned short *seed48();
     extern int putenv();
#  endif /* _PROTOTYPES */
#endif /* _XPG4 || _INCLUDE_AES_SOURCE */

#ifdef _INCLUDE_HPUX_SOURCE
#    ifdef _HP_SHLIB_CALLS
#      pragma HP_DEFINED_EXTERNAL clearenv,getopt,getpass
#    endif /* _HP_SHLIB_CALLS */
#    ifdef _FAST_SHLIB_CALLS
#      pragma HP_NO_RELOCATION clearenv,getopt,getpass
#      pragma HP_LONG_RETURN clearenv,getopt,getpass
#    endif /* _FAST_SHLIB_CALLS */
#    ifdef _PROTOTYPES
       extern int clearenv(void);
       extern int getopt(int, char * const [], const char *);
       extern char *getpass(const char *);
       extern void *memalign(_hpux_size_t, _hpux_size_t);
#    else   /* no _PROTOTYPES */
       extern int clearenv();
       extern int getopt();
       extern char *getpass();
       extern void *memalign();
#    endif      /* _PROTOTYPES */

     extern char *optarg;
     extern int optind;
     extern int opterr;
#endif /* _INCLUDE_HPUX_SOURCE */

#ifdef _INCLUDE_XOPEN_SOURCE_EXTENDED 
# include <sys/wait.h>     /* For required W* macros */

#      ifdef _HP_SHLIB_CALLS
#        pragma HP_DEFINED_EXTERNAL mkstemp,mktemp,ttyslot
#      endif /* _HP_SHLIB_CALLS */
#      ifdef _FAST_SHLIB_CALLS
#        pragma HP_NO_RELOCATION mkstemp,mktemp,ttyslot
#        pragma HP_LONG_RETURN mkstemp,mktemp,ttyslot
#      endif /* _FAST_SHLIB_CALLS */

#    ifndef _MKTEMP_DEFINED
#      define _MKTEMP_DEFINED
#      ifdef _PROTOTYPES
	 extern int mkstemp(char *);
	 extern char *mktemp(char *);
	 extern int ttyslot(void);
#      else  /* !_PROTOTYPES */
	 extern int mkstemp();
	 extern char *mktemp();
	 extern int ttyslot();
#      endif /* _PROTOTYPES */
#    endif /* _MKTEMP_DEFINED */

#  ifdef _PROTOTYPES
#    ifdef _HP_SHLIB_CALLS
#      pragma HP_DEFINED_EXTERNAL a64l,l64a,getsubopt,grantpt,ptsname
#      pragma HP_DEFINED_EXTERNAL realpath,unlockpt,initstate
#      pragma HP_DEFINED_EXTERNAL setstate,srandom,random
#    endif /* _HP_SHLIB_CALLS */
#    ifdef _FAST_SHLIB_CALLS
#      pragma HP_NO_RELOCATION a64l,l64a,getsubopt,grantpt,ptsname
#      pragma HP_NO_RELOCATION realpath,unlockpt,initstate
#      pragma HP_NO_RELOCATION setstate,srandom,random
#      pragma HP_LONG_RETURN a64l,l64a,getsubopt,grantpt,ptsname
#      pragma HP_LONG_RETURN realpath,unlockpt,initstate
#      pragma HP_LONG_RETURN setstate,srandom,random
#    endif /* _FAST_SHLIB_CALLS */
     extern long a64l(const char *);
     extern char *l64a(long);

#   ifndef _ECVT_PROTOTYPE
      extern char *fcvt(double, int, int *, int *);
      extern char *ecvt(double, int, int *, int *);
#   endif /* _ECVT_PROTOTYPE */

    extern char *gcvt(double, int, char *);
    extern int getsubopt(char **, char * const *, char **);
    extern int grantpt(int);
    extern char *ptsname(int);
    extern char *realpath(const char *, char *);
    extern int unlockpt(int);
    extern void *valloc(_hpux_size_t);
    extern char *initstate(unsigned int, char *, _hpux_size_t);
    extern char *setstate(const char *);		   	  
    extern void srandom(unsigned int);                
	extern long random(void);
#  else /* ! _PROTOTYPES */
     extern long a64l();
     extern char *l64a();
     extern char *ecvt();
     extern char *fcvt();
     extern char *gcvt();
     extern int getsubopt();
     extern int grantpt();
     extern char *ptsname();
     extern char *realpath();
     extern int unlockpt();
     extern void *valloc();
     extern char *initstate();
     extern char *setstate();		   	  
     extern void srandom();                
     extern long random();				  
#  endif /* _PROTOTYPES */
#endif /* _INCLUDE_XOPEN_SOURCE_EXTENDED */

#ifdef _INCLUDE_HPUX_SOURCE
/* Constants defining mallopt operations */
#define M_MXFAST	1	/* set size of blocks to be fast */
#define M_NLBLKS	2	/* set number of block in a holding block */
#define M_GRAIN		3	/* set number of sizes mapped to one, for
				   small blocks */
#define M_KEEP		4	/* retain contents of block after a free until
				   another allocation */
#define M_BLOCK		5	/* enable signal blocking in all malloc
				   related routines */
#define M_UBLOCK	6	/* disable signal blocking set by M_BLOCK */
#ifndef __LP64__
#define M_ENABLE_MMAP	7
#endif /* !__LP64__ */

/* Linux mallopt options that do nothing on HP-UX. */
/* These should perhaps be under an ifdef. */
#define M_TRIM_THRESHOLD    -1
#define M_TOP_PAD           -2
#define M_MMAP_THRESHOLD    -3
#define M_MMAP_MAX          -4
#define M_CHECK_ACTION      -5

#ifndef _STRUCT_MALLINFO
#  define _STRUCT_MALLINFO

  /* structure filled by mallinfo */
  struct mallinfo  {
	int32_t arena;		/* total number of bytes in arena */
	int32_t ordblks;	/* number of ordinary blocks */
	int32_t smblks;		/* number of small blocks */
	int32_t hblks;		/* number of holding blocks */
	int32_t hblkhd;		/* number of bytes in holding block headers */
	int32_t usmblks;	/* number of bytes in small blocks in use */
	int32_t fsmblks;	/* number of bytes in free small blocks */
	int32_t uordblks;	/* number of bytes in ordinary blocks in use */
	int32_t fordblks;	/* number of bytes in free ordinary blocks */
	int32_t keepcost;	/* cost of enabling keep option */
  };	
#endif /* _STRUCT_MALLINFO */


#  ifdef _HP_SHLIB_CALLS
#    pragma HP_DEFINED_EXTERNAL getpw,l3tol,ltol3,ltostr,ultostr,ltoa,ultoa
#  endif /* _HP_SHLIB_CALLS */
#  ifdef _FAST_SHLIB_CALLS
#    pragma HP_NO_RELOCATION getpw,l3tol,ltol3,ltostr,ultostr,ltoa,ultoa
#    pragma HP_LONG_RETURN getpw,l3tol,ltol3,ltostr,ultostr,ltoa,ultoa
#  endif /* _FAST_SHLIB_CALLS */
#  ifdef _PROTOTYPES
#    ifndef _PWD_INCLUDED
#      include <pwd.h>
#    endif /* _PWD_INCLUDED */

#    ifndef _ERRNO_INCLUDED
#      include <errno.h>
#    endif  /* _ERRNO_INCLUDED */

     extern char *_ldecvt(long double, int, int *, int *);
     extern char *_ldfcvt(long double, int, int *, int *);
     extern char *_ldgcvt(long double, int, char *);
     extern int getpw(int, char *);
     extern void l3tol(long *, const char *, int);
     extern void ltol3(char *, const long *, int);
     extern char *ltostr(long, int);
     extern char *ultostr(unsigned long, int);
     extern char *ltoa(long);
     extern char *ultoa(unsigned long);
     extern void memorymap(int);
     extern struct mallinfo mallinfo(void);
     extern int mallopt(int, int);
     extern long double strtold(const char *, char **);
#   ifdef _REENTRANT
#     ifndef _PTHREADS_DRAFT4
#        ifdef _HP_SHLIB_CALLS
#          pragma HP_DEFINED_EXTERNAL rand_r
#        endif /* _HP_SHLIB_CALLS */
#        ifdef _FAST_SHLIB_CALLS
#          pragma HP_NO_RELOCATION rand_r
#          pragma HP_LONG_RETURN rand_r
#        endif /* _FAST_SHLIB_CALLS */
         extern int rand_r(unsigned int *);
#     else
         extern int rand_r(long *, int *);
#     endif  /* _PTHREADS_DRAFT4 */
#endif /* _REENTRANT */

#   if defined(_REENTRANT) && defined(_PTHREADS_DRAFT4)
     extern int _ldecvt_r(long double, int, int *, int *, char *, int);
     extern int _ldfcvt_r(long double, int, int *, int *, char *, int);
#    ifndef _ECVT_PROTOTYPE
       extern int fcvt_r(double, int, int *, int *, char *, int);
       extern int ecvt_r(double, int, int *, int *, char *, int);
#    endif /* _ECVT_PROTOTYPE */
     extern int l64a_r(long, char *, int);
     extern int ltostr_r(long, int, char *, int);
     extern int ultostr_r(unsigned long, int, char *, int);
     extern int ltoa_r(long, char *, int);
     extern int ultoa_r(unsigned long, char *, int);
#   endif /* defined(_REENTRANT) && defined(_PTHREADS_DRAFT4) */
#  else /* _PROTOTYPES */
     extern char *_ldecvt();
     extern char *_ldfcvt();
     extern char *_ldgcvt();
     extern char *ltostr();
     extern char *ultostr();
     extern char *ltoa();
     extern char *ultoa();
     extern void memorymap();
     extern struct mallinfo mallinfo();
     extern int mallopt();
     extern long double strtold();
#   ifdef _REENTRANT
     extern int rand_r();
#   endif /* _REENTRANT */
#if   defined(_REENTRANT) && defined(_PTHREADS_DRAFT4)
     extern int _ldecvt_r();
     extern int _ldfcvt_r();
     extern int fcvt_r();
     extern int ecvt_r();
     extern int l64a_r();
     extern int ltostr_r();
     extern int ultostr_r();
     extern int ltoa_r();
     extern int ultoa_r();
#   endif /* defined(_REENTRANT) && defined(_PTHREADS_DRAFT4) */
#  endif /* _PROTOTYPES */

#endif /* _INCLUDE_HPUX_SOURCE */

#ifdef __cplusplus
}
#endif

#endif /* _STDLIB_INCLUDED */
