stdlib.h

00001 /*  wcecompat: Windows CE C Runtime Library "compatibility" library.
00002  *
00003  *  Copyright (C) 2001-2002 Essemer Pty Ltd.  All rights reserved.
00004  *  http://www.essemer.com.au/
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Lesser General Public
00008  *  License as published by the Free Software Foundation; either
00009  *  version 2.1 of the License, or (at your option) any later version.
00010  *
00011  *  This library is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  *  Lesser General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU Lesser General Public
00017  *  License along with this library; if not, write to the Free Software
00018  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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;          /* default file translation mode */
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;    /* pointer to environment table */
00041 extern wchar_t** _wenviron;    /* pointer to wide environment table */
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;          /* count of cmd line args */
00056 extern char ** __argv;      /* pointer to table of cmd line args */
00057 extern wchar_t ** __wargv;  /* pointer to table of wide cmd line args */
00058 
00059 // min and max macros
00060 #define __max(a,b)    (((a) > (b)) ? (a) : (b))
00061 #define __min(a,b)    (((a) < (b)) ? (a) : (b))
00062 
00063 // Conversion function prototypes
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 // Extended logical Ops functions
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 // Other misc STDLIB functions
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 // Maximum value that can be returned by the rand function.
00105 #define RAND_MAX 0x7fff
00106 
00107 // onexit() defns
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 // Data structure & function definitions for div and ldiv runtimes
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 /* __wcecompat__STDLIB_H__ */

Generated on Mon Jun 5 10:20:45 2006 for Intelligence.kdevelop by  doxygen 1.4.6