#ifdef __cplusplus
extern "C" {
#endif
#ifndef _POSIX_SOURCE
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)stdlib.h	1.9	AIX)	/* Modified: 2/26/92 10:34:28 */
#endif /* NOT _POSIX_SOURCE */

/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved
 * Licensed Materials - Property of IBM
 */

/*  POSIX needed size_t */
typedef unsigned long size_t;

/* stdlib.h */
	
extern void	abort(void);
extern int	abs(int);
extern double	atof(const char*);
extern int	atoi(const char*);
extern long int	atol(const char*);
extern char	*bsearch(const void *, const void *, size_t, size_t,
			int (*)(const void *, const void *));
extern void	*calloc(size_t, size_t);
extern void	exit(int);
extern void	free(void*);
extern char	*getenv(const char*);
extern long int	labs(long int);
extern void	*malloc(size_t);
extern void	qsort(void*, size_t, size_t, int(*)(const void*, const void*));
extern int	rand(void);
extern void	*realloc(void *, size_t);
extern void	srand(unsigned);
extern double	strtod(const char*, char**);
extern long int	strtol(const char*, char**, int);
extern int	system(const char*);
#ifdef __cplusplus
#include <sys/types.h>
extern  off_t   lseek(int, off_t, int);
extern int 	open(const char*,int, mode_t mode=0666);
extern int 	creat(const char*, mode_t) ;
#endif
extern int 	read(int, char*, int) ;
extern int 	write(int, char*, int) ;
extern int 	close(int) ;

#define RAND_MAX 32767

#define	EXIT_SUCCESS		0
#define	EXIT_FAILURE		1

#ifndef NULL
#define NULL		0
#endif

/*
 * MBCS specific stuff
 */
typedef unsigned long wchar_t;		/* As per ANSI */
typedef unsigned long mbchar_t;
typedef unsigned long size_t;

#ifndef MB_CUR_MAX
#define MB_CUR_MAX	(_mb_in_tbl->th_mb_cur_max)
				/* This is supposed to expand out to the */
				/* max bytes in a multibyte character    */
				/* for the CURRENT character code set.   */
				/* as per ANSI C 			 */
#endif /* MB_CUR_MAX */

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);
#ifdef __cplusplus
}
#endif
