00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __wcecompat__STDLIB_H__
00023 #define __wcecompat__STDLIB_H__
00024
00025 #include "stddef.h"
00026 #include "malloc.h"
00027 #include "memory.h"
00028
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032
00033 extern int _fmode;
00034
00035 void abort(void);
00036
00037 char * __cdecl getenv(const char *name);
00038 int __cdecl _putenv(const char *);
00039 int __cdecl _wputenv(const wchar_t *);
00040 extern char** _environ;
00041 extern wchar_t** _wenviron;
00042 #define putenv _putenv
00043 #define environ _environ
00044 #ifdef UNICODE
00045 #define _tputenv _wputenv
00046 #define _tenviron _wenviron
00047 #else
00048 #define _tputenv _putenv
00049 #define _tenviron _environ
00050 #endif
00051
00052 void * __cdecl bsearch(const void *key, const void *base, size_t nmemb, size_t size,
00053 int (__cdecl * compar)(const void *, const void *));
00054
00055 extern int __argc;
00056 extern char ** __argv;
00057 extern wchar_t ** __wargv;
00058
00059
00060 #define __max(a,b) (((a) > (b)) ? (a) : (b))
00061 #define __min(a,b) (((a) < (b)) ? (a) : (b))
00062
00063
00064 _CRTIMP double __cdecl strtod(const char *, char **);
00065 _CRTIMP long __cdecl strtol(const char *, char **, int);
00066 _CRTIMP unsigned long __cdecl strtoul(const char *, char **, int);
00067 _CRTIMP __int64 __cdecl _atoi64(const char *);
00068 _CRTIMP int __cdecl atoi(const char *);
00069 _CRTIMP double __cdecl atof(const char *);
00070 _CRTIMP long __cdecl atol(const char *);
00071 char * __cdecl _itoa(int, char *, int);
00072 char * __cdecl _ltoa(long, char *, int);
00073 char * __cdecl _ultoa(unsigned long, char *, int);
00074 char * __cdecl _ecvt(double, int, int *, int *);
00075 char * __cdecl _fcvt(double, int, int *, int *);
00076 char * __cdecl _gcvt(double, int, char *);
00077 _CRTIMP int __cdecl tolower(int);
00078 _CRTIMP int __cdecl toupper(int);
00079 _CRTIMP double __cdecl wcstod(const wchar_t *, wchar_t **);
00080 _CRTIMP long __cdecl wcstol(const wchar_t *, wchar_t **, int);
00081 wchar_t * __cdecl _ultow (unsigned long, wchar_t *, int);
00082 wchar_t * __cdecl _itow (int, wchar_t *, int);
00083 wchar_t * __cdecl _ltow (long, wchar_t *, int);
00084 _CRTIMP long __cdecl _wtol(const wchar_t *);
00085 _CRTIMP __int64 __cdecl _wtoll(const wchar_t *);
00086 unsigned long __cdecl wcstoul(const wchar_t *, wchar_t **, int);
00087 #define _wtoi _wtol
00088 #define _wtoi64 _wtoll
00089
00090
00091 unsigned long __cdecl _lrotl(unsigned long, int);
00092 unsigned long __cdecl _lrotr(unsigned long, int);
00093 unsigned int __cdecl _rotl(unsigned int, int);
00094 unsigned int __cdecl _rotr(unsigned int, int);
00095
00096
00097 _CRTIMP void __cdecl _swab(char *, char *, int);
00098 _CRTIMP int __cdecl rand(void);
00099 _CRTIMP void __cdecl srand(unsigned int);
00100 void __cdecl qsort(void *, size_t, size_t, int (__cdecl *)(const void *, const void *));
00101 double __cdecl difftime(time_t, time_t);
00102 int __cdecl atexit(void (__cdecl *)(void));
00103
00104
00105 #define RAND_MAX 0x7fff
00106
00107
00108 #define EXIT_SUCCESS 0
00109 #define EXIT_FAILURE 1
00110 typedef int (__cdecl * _onexit_t)(void);
00111 #define onexit_t _onexit_t
00112
00113
00114 typedef struct _div_t {
00115 int quot;
00116 int rem;
00117 } div_t;
00118
00119 typedef struct _ldiv_t {
00120 long quot;
00121 long rem;
00122 } ldiv_t;
00123
00124 div_t __cdecl div(int, int);
00125 ldiv_t __cdecl ldiv(long, long);
00126
00127 #ifdef __cplusplus
00128 }
00129 #endif
00130
00131 #endif