/* Copyright 07/20/98 Sun Microsystems, Inc. All Rights Reserved */ #if !defined(__STD_CSTDLIB) && !defined(__STD_STDLIB_H) #define __STD_CSTDLIB #include #ifndef NULL #define NULL 0 #endif #define EXIT_FAILURE 1 #define EXIT_SUCCESS 0 #define RAND_MAX 32767 extern "C" unsigned char __ctype[]; #define MB_CUR_MAX __ctype[520] extern "C" void _exithandle(void); namespace std { // C++ Standard functions and types struct __div_t { int quot; int rem; }; typedef __div_t div_t; struct __ldiv_t { long quot; long rem; }; typedef __ldiv_t ldiv_t; #if !defined(_NO_LONGLONG) struct __lldiv_t { long long quot; long long rem; }; typedef __lldiv_t lldiv_t; #endif /* !defined(_NO_LONGLONG) */ #if defined(_LP64) || defined(_I32LPx) typedef unsigned long size_t; /* size of something in bytes */ #else typedef unsigned int size_t; /* (historical version) */ #endif extern "C" { double atof(const char *); int atoi(const char *); long int atol(const char *); double strtod(const char *, char **); long int strtol(const char *, char **, int); unsigned long int strtoul(const char *, char **, int); int rand(void); void srand(unsigned int); void *calloc(size_t, size_t); void free(void *); void *malloc(size_t); void *realloc(void *, size_t); void abort(void); int atexit(void (*)(void)); void exit(int); char *getenv(const char *); int system(const char *); void *bsearch(const void *, const void *, size_t, size_t, int (*)(const void *, const void *)); void qsort(void *, size_t, size_t, int (*)(const void *, const void *)); int abs(int); div_t div(int, int); long int labs(long); ldiv_t ldiv(long, long); int mbtowc(wchar_t *, const char *, size_t); int mblen(const char *, size_t); int wctomb(char *, wchar_t); size_t mbstowcs(wchar_t *, const char *, size_t); size_t wcstombs(char *, const wchar_t *, size_t); } /* extern C */ // required by the standard extern long abs(long); // labs() extern ldiv_t div(long, long); // ldiv() } /* namespace std */ #endif /* __STD_stdlib */