Result of three way diffing with include/crtdll and the winapi2 headers.

reactos/include/crtdll now unused and to be deprecated.

svn path=/trunk/; revision=3775
This commit is contained in:
Robert Dickenson 2002-11-24 18:06:01 +00:00
parent e6d113445e
commit 1b66fde766
37 changed files with 1833 additions and 1653 deletions

View file

@ -22,25 +22,25 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.4 $ * $Revision: 1.5 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 10:22:30 $ * $Date: 2002/11/24 18:06:00 $
* *
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _ALLOC_H_ #ifndef _ALLOC_H_
#define _ALLOC_H_ #define _ALLOC_H_
#include <msvcrt/stdlib.h> #include <msvcrt/stdlib.h>
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -48,38 +48,39 @@ extern "C" {
* The structure used to walk through the heap with _heapwalk. * The structure used to walk through the heap with _heapwalk.
* TODO: This is a guess at the internals of this structure. * TODO: This is a guess at the internals of this structure.
*/ */
typedef struct _heapinfo typedef struct _heapinfo
{ {
void* ptr; void* ptr;
unsigned int size; unsigned int size;
int in_use; int in_use;
} _HEAPINFO; } _HEAPINFO;
int _heapwalk (_HEAPINFO* pHeapinfo); int _heapwalk(_HEAPINFO* pHeapinfo);
#ifdef __GNUC__ #ifdef __GNUC__
#ifdef USE_C_ALLOCA #ifdef USE_C_ALLOCA
void * C_alloca(size_t size); void* C_alloca(size_t size);
#define _alloca(x) C_alloca(x) #define _alloca(x) C_alloca(x)
#else /* USE_C_ALLOCA */ #else /* USE_C_ALLOCA */
#define _alloca(x) __builtin_alloca(x) #define _alloca(x) __builtin_alloca(x)
#endif /* USE_C_ALLOCA */ #endif /* USE_C_ALLOCA */
#else /* __GNUC__ */ #else /* __GNUC__ */
void * _alloca(size_t size); void* _alloca(size_t size);
#endif /* __GNUC__ */ #endif /* __GNUC__ */
#ifndef _NO_OLDNAMES
#define heapwalk(x) _heapwalk(x)
#define alloca(s) _alloca(s)
#endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus #ifndef _NO_OLDNAMES
#define heapwalk(x) _heapwalk(x)
#define alloca(s) _alloca(s)
#endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* Not _ALLOC_H_ */ #endif /* Not _ALLOC_H_ */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */

View file

@ -15,19 +15,20 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 10:22:30 $ * $Date: 2002/11/24 18:06:00 $
* *
*/ */
#ifndef _ASSERT_H_ #ifndef _ASSERT_H_
#define _ASSERT_H_ #define _ASSERT_H_
#ifdef __cplusplus
#ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -36,7 +37,7 @@ extern "C" {
/* /*
* If not debugging, assert does nothing. * If not debugging, assert does nothing.
*/ */
#define assert(x) ((void)0); #define assert(x) ((void)0)
#else /* debugging enabled */ #else /* debugging enabled */
@ -44,26 +45,25 @@ extern "C" {
* CRTDLL nicely supplies a function which does the actual output and * CRTDLL nicely supplies a function which does the actual output and
* call to abort. * call to abort.
*/ */
#ifndef __ATTRIB_NORETURN #ifndef __ATTRIB_NORETURN
#ifdef __GNUC__ #ifdef __GNUC__
#define _ATTRIB_NORETURN __attribute__ ((noreturn)) #define _ATTRIB_NORETURN __attribute__ ((noreturn))
#else /* Not __GNUC__ */ #else /* Not __GNUC__ */
#define _ATTRIB_NORETURN #define _ATTRIB_NORETURN
#endif /* __GNUC__ */ #endif /* __GNUC__ */
#endif #endif
void _assert (const char* szExpression, const char* szFileName, int nLine) void _assert(const char* szExpression, const char* szFileName, int nLine) _ATTRIB_NORETURN;
_ATTRIB_NORETURN
;
/* /*
* Definition of the assert macro. * Definition of the assert macro.
*/ */
#define assert(x) if(!(x)) _assert( #x , __FILE__, __LINE__); #define assert(x) if(!(x)) _assert( #x , __FILE__, __LINE__);
#endif /* NDEBUG */ #endif /* NDEBUG */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif /* Not _ASSERT_H_ */

View file

@ -16,52 +16,48 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 10:22:30 $ * $Date: 2002/11/24 18:06:00 $
* *
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _CONIO_H_ #ifndef _CONIO_H_
#define _CONIO_H_ #define _CONIO_H_
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
char* _cgets (char* szBuffer); char* _cgets(char*);
int _cprintf (const char* szFormat, ...); int _cprintf(const char*, ...);
int _cputs (const char* szString); int _cputs(const char*);
int _cscanf (char* szFormat, ...); int _cscanf(char*, ...);
int _getch(void);
int _getche(void);
int _kbhit(void);
int _putch(int);
int _ungetch(int);
int _getch (void); #ifndef _NO_OLDNAMES
int _getche (void); #define getch _getch
int _kbhit (void); #define getche _getche
int _putch (int cPut); #define kbhit _kbhit
int _ungetch (int cUnget); #define putch(cPut) _putch(cPut)
#define ungetch(cUnget) _ungetch(cUnget)
#endif /* Not _NO_OLDNAMES */
#ifndef _NO_OLDNAMES #ifdef __cplusplus
#define getch _getch
#define getche _getche
#define kbhit _kbhit
#define putch(cPut) _putch(cPut)
#define ungetch(cUnget) _ungetch(cUnget)
#endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus
} }
#endif #endif
#endif /* Not _CONIO_H_ */ #endif /* Not _CONIO_H_ */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */

View file

@ -15,20 +15,20 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.4 $ * $Revision: 1.5 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 10:22:30 $ * $Date: 2002/11/24 18:06:00 $
* *
*/ */
#ifndef _CTYPE_H_ #ifndef _CTYPE_H_
#define _CTYPE_H_ #define _CTYPE_H_
#define __need_wchar_t #define __need_wchar_t
#define __need_wint_t #define __need_wint_t
#include <msvcrt/stddef.h> #include <msvcrt/stddef.h>
@ -36,53 +36,55 @@
* The following flags are used to tell iswctype and _isctype what character * The following flags are used to tell iswctype and _isctype what character
* types you are looking for. * types you are looking for.
*/ */
#define _UPPER 0x0001 #define _UPPER 0x0001
#define _LOWER 0x0002 #define _LOWER 0x0002
#define _DIGIT 0x0004 #define _DIGIT 0x0004
#define _SPACE 0x0008 #define _SPACE 0x0008 /* HT LF VT FF CR SP */
#define _PUNCT 0x0010 #define _PUNCT 0x0010
#define _CONTROL 0x0020 #define _CONTROL 0x0020
#define _BLANK 0x0040 #define _BLANK 0x0040 /* this is SP only, not SP and HT as in C99 */
#define _HEX 0x0080 #define _HEX 0x0080
#define _LEADBYTE 0x8000
#define _ALPHA 0x0103 #define _ALPHA 0x0103
#define _LEADBYTE 0x8000
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
int isalnum(int c); int isalnum(int);
int isalpha(int c); int isalpha(int);
int iscntrl(int c); int iscntrl(int);
int isdigit(int c); int isdigit(int);
int isgraph(int c); int isgraph(int);
int islower(int c); int islower(int);
int isprint(int c); int isprint(int);
int ispunct(int c); int ispunct(int);
int isspace(int c); int isspace(int);
int isupper(int c); int isupper(int);
int isxdigit(int c); int isxdigit(int);
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
int _isctype (unsigned int c, int ctypeFlags); int _isctype (unsigned int, int);
#endif #endif
int tolower(int c); /* These are the ANSI versions, with correct checking of argument */
int toupper(int c); int tolower(int);
int toupper(int);
/* /*
* NOTE: The above are not old name type wrappers, but functions exported * NOTE: The above are not old name type wrappers, but functions exported
* explicitly by MSVCRT. However, underscored versions are also exported. * explicitly by MSVCRT/CRTDLL. However, underscored versions are also
* exported.
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
int _tolower(int c); /*
int _toupper(int c); * These are the cheap non-std versions: The return values are undefined
#endif * if the argument is not ASCII char or is not of appropriate case
*/
#ifndef WEOF int _tolower(int);
#define WEOF (wchar_t)(0xFFFF) int _toupper(int);
#endif #endif
/* /*
@ -94,46 +96,51 @@ int _toupper(int c);
* problems under the current Cygwin compiler distribution. * problems under the current Cygwin compiler distribution.
*/ */
typedef int wctype_t; typedef int wctype_t;
/* Wide character equivalents */ /* Wide character equivalents */
int iswalnum(wint_t wc); #ifndef WEOF
int iswalpha(wint_t wc); #define WEOF (wchar_t)(0xFFFF)
int iswascii(wint_t wc); #endif
int iswcntrl(wint_t wc);
int iswctype(wint_t wc, wctype_t wctypeFlags);
int is_wctype(wint_t wc, wctype_t wctypeFlags); /* Obsolete! */
int iswdigit(wint_t wc);
int iswgraph(wint_t wc);
int iswlower(wint_t wc);
int iswprint(wint_t wc);
int iswpunct(wint_t wc);
int iswspace(wint_t wc);
int iswupper(wint_t wc);
int iswxdigit(wint_t wc);
wchar_t towlower(wchar_t c); int iswalnum(wint_t);
wchar_t towupper(wchar_t c); int iswalpha(wint_t);
int iswascii(wint_t);
int iswcntrl(wint_t);
int iswctype(wint_t, wctype_t);
int is_wctype(wint_t, wctype_t); /* Obsolete! */
int iswdigit(wint_t);
int iswgraph(wint_t);
int iswlower(wint_t);
int iswprint(wint_t);
int iswpunct(wint_t);
int iswspace(wint_t);
int iswupper(wint_t);
int iswxdigit(wint_t);
int isleadbyte (int c); wchar_t towlower(wchar_t);
wchar_t towupper(wchar_t);
#ifndef __STRICT_ANSI__ int isleadbyte(int);
int __isascii (int c);
int __toascii (int c);
int __iscsymf (int c); /* Valid first character in C symbol */
int __iscsym (int c); /* Valid character in C symbol (after first) */
#ifndef _NO_OLDNAMES #ifndef __STRICT_ANSI__
#define isascii(c) __isascii(c) int __isascii(int);
#define toascii(c) _toascii(c) int __toascii(int);
#define iscsymf(c) __iscsymf(c) int __iscsymf(int); /* Valid first character in C symbol */
#define iscsym(c) __iscsym(c) int __iscsym(int); /* Valid character in C symbol (after first) */
#endif /* Not _NO_OLDNAMES */
#endif /* Not __STRICT_ANSI__ */ #ifndef _NO_OLDNAMES
#define isascii(c) __isascii(c)
#define toascii(c) _toascii(c)
#define iscsymf(c) __iscsymf(c)
#define iscsym(c) __iscsym(c)
#endif /* Not _NO_OLDNAMES */
#endif /* Not __STRICT_ANSI__ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not _CTYPE_H_ */ #endif /* Not _CTYPE_H_ */

View file

@ -2,6 +2,8 @@
* dir.h * dir.h
* *
* Functions for working with directories and path names. * Functions for working with directories and path names.
* This file OBSOLESCENT and only provided for backward compatibility.
* Please use io.h instead.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
@ -15,40 +17,40 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.5 $ * $Revision: 1.6 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 10:22:30 $ * $Date: 2002/11/24 18:06:00 $
* *
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _DIR_H_ #ifndef _DIR_H_
#define _DIR_H_ #define _DIR_H_
#include <msvcrt/stdio.h> /* To get FILENAME_MAX... ugly. */ #include <msvcrt/stdio.h> /* To get FILENAME_MAX... ugly. */
#include <msvcrt/sys/types.h> /* To get time_t. */ #include <msvcrt/sys/types.h> /* To get time_t. */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* /*
* Attributes of files as returned by _findfirst et al. * Attributes of files as returned by _findfirst et al.
*/ */
#define _A_NORMAL 0x00000000 #define _A_NORMAL 0x00000000
#define _A_RDONLY 0x00000001 #define _A_RDONLY 0x00000001
#define _A_HIDDEN 0x00000002 #define _A_HIDDEN 0x00000002
#define _A_SYSTEM 0x00000004 #define _A_SYSTEM 0x00000004
#define _A_VOLID 0x00000008 #define _A_VOLID 0x00000008
#define _A_SUBDIR 0x00000010 #define _A_SUBDIR 0x00000010
#define _A_ARCH 0x00000020 #define _A_ARCH 0x00000020
#ifndef _FSIZE_T_DEFINED #ifndef _FSIZE_T_DEFINED
typedef unsigned long _fsize_t; typedef unsigned long _fsize_t;
#define _FSIZE_T_DEFINED #define _FSIZE_T_DEFINED
#endif #endif
@ -58,42 +60,42 @@ typedef unsigned long _fsize_t;
*/ */
struct _finddata_t struct _finddata_t
{ {
unsigned attrib; /* Attributes, see constants above. */ unsigned attrib; /* Attributes, see constants above. */
time_t time_create; time_t time_create;
time_t time_access; /* always midnight local time */ time_t time_access; /* always midnight local time */
time_t time_write; time_t time_write;
_fsize_t size; _fsize_t size;
char name[FILENAME_MAX]; /* may include spaces. */ char name[FILENAME_MAX]; /* may include spaces. */
}; };
struct _finddatai64_t struct _finddatai64_t
{ {
unsigned attrib; /* Attributes, see constants above. */ unsigned attrib; /* Attributes, see constants above. */
time_t time_create; time_t time_create;
time_t time_access; /* always midnight local time */ time_t time_access; /* always midnight local time */
time_t time_write; time_t time_write;
__int64 size; __int64 size;
char name[FILENAME_MAX]; /* may include spaces. */ char name[FILENAME_MAX]; /* may include spaces. */
}; };
struct _wfinddata_t struct _wfinddata_t
{ {
unsigned attrib; /* Attributes, see constants above. */ unsigned attrib; /* Attributes, see constants above. */
time_t time_create; time_t time_create;
time_t time_access; /* always midnight local time */ time_t time_access; /* always midnight local time */
time_t time_write; time_t time_write;
_fsize_t size; _fsize_t size;
wchar_t name[FILENAME_MAX]; /* may include spaces. */ wchar_t name[FILENAME_MAX]; /* may include spaces. */
}; };
struct _wfinddatai64_t struct _wfinddatai64_t
{ {
unsigned attrib; /* Attributes, see constants above. */ unsigned attrib; /* Attributes, see constants above. */
time_t time_create; time_t time_create;
time_t time_access; /* always midnight local time */ time_t time_access; /* always midnight local time */
time_t time_write; time_t time_write;
__int64 size; __int64 size;
wchar_t name[FILENAME_MAX]; /* may include spaces. */ wchar_t name[FILENAME_MAX]; /* may include spaces. */
}; };
/* /*
@ -102,47 +104,46 @@ struct _wfinddatai64_t
* _findclose calls. _findnext also returns -1 if no match could be found, * _findclose calls. _findnext also returns -1 if no match could be found,
* and 0 if a match was found. Call _findclose when you are finished. * and 0 if a match was found. Call _findclose when you are finished.
*/ */
int _findclose (int nHandle); int _findclose(int nHandle);
int _findfirst (const char* szFilespec, struct _finddata_t* find); int _findfirst(const char* szFilespec, struct _finddata_t* find);
int _findfirsti64 (const char* szFilespec, struct _finddatai64_t* find); int _findnext(int nHandle, struct _finddata_t* find);
int _findnext (int nHandle, struct _finddata_t* find); int _findfirsti64(const char* szFilespec, struct _finddatai64_t* find);
int _findnexti64 (int nHandle, struct _finddatai64_t* find); int _findnexti64(int nHandle, struct _finddatai64_t* find);
/* Wide character versions */
int _chdir (const char* szPath); int _wfindfirst(const wchar_t *_name, struct _wfinddata_t *result);
char* _getcwd (char* caBuffer, int nBufferSize); int _wfindfirsti64(const wchar_t *_name, struct _wfinddatai64_t *result);
int _mkdir (const char* szPath); int _wfindnext(int handle, struct _wfinddata_t *result);
char* _mktemp (char* szTemplate); int _wfindnexti64(int handle, struct _wfinddatai64_t *result);
int _rmdir (const char* szPath);
int _chdir(const char* szPath);
char* _getcwd(char* caBuffer, int nBufferSize);
int _mkdir(const char* szPath);
char* _mktemp(char* szTemplate);
int _rmdir(const char* szPath);
/* Wide character versions */ /* Wide character versions */
int _wfindfirst(const wchar_t *_name, struct _wfinddata_t *result); int _wchdir(const wchar_t *szPath);
int _wfindfirsti64(const wchar_t *_name, struct _wfinddatai64_t *result);
int _wfindnext(int handle, struct _wfinddata_t *result);
int _wfindnexti64(int handle, struct _wfinddatai64_t *result);
int _wchdir(const wchar_t *szPath);
wchar_t* _wgetcwd(wchar_t *buffer, int maxlen); wchar_t* _wgetcwd(wchar_t *buffer, int maxlen);
int _wmkdir(const wchar_t *_path); int _wmkdir(const wchar_t *_path);
wchar_t* _wmktemp (wchar_t *_template); wchar_t* _wmktemp(wchar_t *_template);
int _wrmdir(const wchar_t *_path); int _wrmdir(const wchar_t *_path);
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
int chdir (const char* szPath); int chdir(const char* szPath);
char* getcwd (char* caBuffer, int nBufferSize); char* getcwd(char* caBuffer, int nBufferSize);
int mkdir (const char* szPath); int mkdir(const char* szPath);
char* mktemp (char* szTemplate); char* mktemp(char* szTemplate);
int rmdir (const char* szPath); int rmdir(const char* szPath);
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not _DIR_H_ */ #endif /* Not _DIR_H_ */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */

View file

@ -1,3 +1,30 @@
/*
* direct.h
*
* Functions for manipulating paths and directories (included from io.h)
* plus functions for setting the current drive.
*
* This file is part of the Mingw32 package.
*
* Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
*
* THIS SOFTWARE IS NOT COPYRIGHTED
*
* This source code is offered for use in the public domain. You may
* use, modify or distribute it freely.
*
* This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision: 1.4 $
* $Author: robd $
* $Date: 2002/11/24 18:06:00 $
*
*/
#ifndef _DIRECT_H_ #ifndef _DIRECT_H_
#define _DIRECT_H_ #define _DIRECT_H_
@ -11,36 +38,44 @@ typedef unsigned int size_t;
#define _SIZE_T_ #define _SIZE_T_
#endif #endif
#ifdef __cplusplus
extern "C" {
#endif
struct _diskfree_t { struct _diskfree_t {
unsigned short total_clusters; unsigned short total_clusters;
unsigned short avail_clusters; unsigned short avail_clusters;
unsigned short sectors_per_cluster; unsigned short sectors_per_cluster;
unsigned short bytes_per_sector; unsigned short bytes_per_sector;
}; };
unsigned int _getdiskfree(unsigned int _drive, struct _diskfree_t *_diskspace); int _getdrive(void);
int _chdrive(int);
char* _getcwd(char*, int);
int _chdrive( int drive ); unsigned int _getdiskfree(unsigned int, struct _diskfree_t*);
int _getdrive( void );
char *_getcwd( char *buffer, int maxlen ); int _chdir(const char*);
char *_getdcwd (int nDrive, char* caBuffer, int nBufLen); int _mkdir(const char*);
int _rmdir(const char*);
int _chdir(const char *_path); #define chdir _chdir
int _mkdir(const char *_path);
int _rmdir(const char *_path);
#define chdir _chdir
#define getcwd _getcwd #define getcwd _getcwd
#define mkdir _mkdir #define mkdir _mkdir
#define rmdir _rmdir #define rmdir _rmdir
char* _getdcwd(int nDrive, char* caBuffer, int nBufLen);
wchar_t *_wgetcwd( wchar_t *buffer, int maxlen ); wchar_t* _wgetcwd(wchar_t *buffer, int maxlen);
wchar_t *_wgetdcwd (int nDrive, wchar_t* caBuffer, int nBufLen); wchar_t* _wgetdcwd(int nDrive, wchar_t* caBuffer, int nBufLen);
int _wchdir(const wchar_t *_path); int _wchdir(const wchar_t* _path);
int _wmkdir(const wchar_t *_path); int _wmkdir(const wchar_t* _path);
int _wrmdir(const wchar_t *_path); int _wrmdir(const wchar_t* _path);
#ifdef __cplusplus
}
#endif #endif
#endif /* Not _DIRECT_H_ */

View file

@ -15,21 +15,17 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.6 $ * $Revision: 1.7 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 10:22:30 $ * $Date: 2002/11/24 18:06:00 $
* *
*/ */
#ifndef _ERRNO_H_ #ifndef _ERRNO_H_
#define _ERRNO_H_ #define _ERRNO_H_
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* Error numbers. * Error numbers.
@ -39,50 +35,50 @@ extern "C" {
* of the descriptions returned by strerror do not obviously match * of the descriptions returned by strerror do not obviously match
* their error naming. * their error naming.
*/ */
#define EPERM 1 /* Operation not permitted */ #define EPERM 1 /* Operation not permitted */
#define ENOFILE 2 /* No such file or directory */ #define ENOFILE 2 /* No such file or directory */
#define ENOENT 2 #define ENOENT 2
#define ESRCH 3 /* No such process */ #define ESRCH 3 /* No such process */
#define EINTR 4 /* Interrupted function call */ #define EINTR 4 /* Interrupted function call */
#define EIO 5 /* Input/output error */ #define EIO 5 /* Input/output error */
#define ENXIO 6 /* No such device or address */ #define ENXIO 6 /* No such device or address */
#define E2BIG 7 /* Arg list too long */ #define E2BIG 7 /* Arg list too long */
#define ENOEXEC 8 /* Exec format error */ #define ENOEXEC 8 /* Exec format error */
#define EBADF 9 /* Bad file descriptor */ #define EBADF 9 /* Bad file descriptor */
#define ECHILD 10 /* No child processes */ #define ECHILD 10 /* No child processes */
#define EAGAIN 11 /* Resource temporarily unavailable */ #define EAGAIN 11 /* Resource temporarily unavailable */
#define ENOMEM 12 /* Not enough space */ #define ENOMEM 12 /* Not enough space */
#define EACCES 13 /* Permission denied */ #define EACCES 13 /* Permission denied */
#define EFAULT 14 /* Bad address */ #define EFAULT 14 /* Bad address */
/* 15 - Unknown Error */ /* 15 - Unknown Error */
#define EBUSY 16 /* strerror reports "Resource device" */ #define EBUSY 16 /* strerror reports "Resource device" */
#define EEXIST 17 /* File exists */ #define EEXIST 17 /* File exists */
#define EXDEV 18 /* Improper link (cross-device link?) */ #define EXDEV 18 /* Improper link (cross-device link?) */
#define ENODEV 19 /* No such device */ #define ENODEV 19 /* No such device */
#define ENOTDIR 20 /* Not a directory */ #define ENOTDIR 20 /* Not a directory */
#define EISDIR 21 /* Is a directory */ #define EISDIR 21 /* Is a directory */
#define EINVAL 22 /* Invalid argument */ #define EINVAL 22 /* Invalid argument */
#define ENFILE 23 /* Too many open files in system */ #define ENFILE 23 /* Too many open files in system */
#define EMFILE 24 /* Too many open files */ #define EMFILE 24 /* Too many open files */
#define ENOTTY 25 /* Inappropriate I/O control operation */ #define ENOTTY 25 /* Inappropriate I/O control operation */
/* 26 - Unknown Error */ /* 26 - Unknown Error */
#define EFBIG 27 /* File too large */ #define EFBIG 27 /* File too large */
#define ENOSPC 28 /* No space left on device */ #define ENOSPC 28 /* No space left on device */
#define ESPIPE 29 /* Invalid seek (seek on a pipe?) */ #define ESPIPE 29 /* Invalid seek (seek on a pipe?) */
#define EROFS 30 /* Read-only file system */ #define EROFS 30 /* Read-only file system */
#define EMLINK 31 /* Too many links */ #define EMLINK 31 /* Too many links */
#define EPIPE 32 /* Broken pipe */ #define EPIPE 32 /* Broken pipe */
#define EDOM 33 /* Domain error (math functions) */ #define EDOM 33 /* Domain error (math functions) */
#define ERANGE 34 /* Result too large (possibly too small) */ #define ERANGE 34 /* Result too large (possibly too small) */
/* 35 - Unknown Error */ /* 35 - Unknown Error */
#define EDEADLOCK 36 /* Resource deadlock avoided (non-Cyg) */ #define EDEADLOCK 36 /* Resource deadlock avoided (non-Cyg) */
#define EDEADLK 36 #define EDEADLK 36
/* 37 - Unknown Error */ /* 37 - Unknown Error */
#define ENAMETOOLONG 38 /* Filename too long (91 in Cyg?) */ #define ENAMETOOLONG 38 /* Filename too long (91 in Cyg?) */
#define ENOLCK 39 /* No locks available (46 in Cyg?) */ #define ENOLCK 39 /* No locks available (46 in Cyg?) */
#define ENOSYS 40 /* Function not implemented (88 in Cyg?) */ #define ENOSYS 40 /* Function not implemented (88 in Cyg?) */
#define ENOTEMPTY 41 /* Directory not empty (90 in Cyg?) */ #define ENOTEMPTY 41 /* Directory not empty (90 in Cyg?) */
#define EILSEQ 42 /* Illegal byte sequence */ #define EILSEQ 42 /* Illegal byte sequence */
/* /*
* NOTE: ENAMETOOLONG and ENOTEMPTY conflict with definitions in the * NOTE: ENAMETOOLONG and ENOTEMPTY conflict with definitions in the
@ -91,30 +87,34 @@ extern "C" {
* of errors (look at the comment above them). * of errors (look at the comment above them).
*/ */
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* Definitions of macros for the 'variables' errno, _doserrno, sys_nerr and * Definitions of macros for the 'variables' errno, _doserrno, sys_nerr and
* sys_errlist. * sys_errlist.
*/ */
int* _errno(void); int* _errno(void);
#define errno (*_errno()) #define errno (*_errno())
int* __doserrno(void); int* __doserrno(void);
#define _doserrno (*__doserrno()) #define _doserrno (*__doserrno())
/* One of the MSVCRTxx libraries */ /* One of the MSVCRTxx libraries */
extern int* __imp__sys_nerr; extern int* __imp__sys_nerr;
#ifndef sys_nerr #ifndef sys_nerr
#define sys_nerr (*__imp__sys_nerr) #define sys_nerr (*__imp__sys_nerr)
#endif #endif
extern char** __imp__sys_errlist; extern char** __imp__sys_errlist;
#ifndef sys_errlist #ifndef sys_errlist
#define sys_errlist (__imp__sys_errlist) #define sys_errlist (__imp__sys_errlist)
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif /* Not _ERRNO_H_ */

View file

@ -16,16 +16,16 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.4 $ * $Revision: 1.5 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 10:22:30 $ * $Date: 2002/11/24 18:06:00 $
* *
*/ */
/* Appropriated for Reactos Crtdll by Ariadne */ /* Appropriated for Reactos Crtdll by Ariadne */
/* added _O_RANDOM_O_SEQUENTIAL _O_SHORT_LIVED*/ /* added _O_RANDOM_O_SEQUENTIAL _O_SHORT_LIVED*/
/* changed fmode_dll */ /* changed fmode_dll */
#ifndef _FCNTL_H_ #ifndef _FCNTL_H_
@ -41,13 +41,13 @@
* TODO: Which flags work? * TODO: Which flags work?
*/ */
#if 0 #if 0
#if __MSVCRT__ #ifdef __MSVCRT__ // || _MSVCRT_LIB_
extern unsigned int* __imp__fmode; extern unsigned int* __imp__fmode;
#define _fmode (*__imp__fmode) #define _fmode (*__imp__fmode)
#else #else
/* CRTDLL */ /* CRTDLL */
extern unsigned int* _fmode_dll; extern unsigned int* _fmode_dll;
#define _fmode (*_fmode_dll) #define _fmode (*_fmode_dll)
#endif #endif
#endif /* 0 */ #endif /* 0 */
@ -60,68 +60,70 @@ extern unsigned int _fmode;
/* Specifiy one of these flags to define the access mode. */ /* Specifiy one of these flags to define the access mode. */
#define _O_RDONLY 0 #define _O_RDONLY 0
#define _O_WRONLY 1 #define _O_WRONLY 1
#define _O_RDWR 2 #define _O_RDWR 2
/* Mask for access mode bits in the _open flags. */ /* Mask for access mode bits in the _open flags. */
#define _O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) #define _O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
#define _O_APPEND 0x0008 /* Writes will add to the end of the file. */ #define _O_APPEND 0x0008 /* Writes will add to the end of the file. */
#define _O_CREAT 0x0100 /* Create the file if it does not exist. */ #define _O_RANDOM 0x0010
#define _O_TRUNC 0x0200 /* Truncate the file if it does exist. */ #define _O_SEQUENTIAL _O_RANDOM
#define _O_EXCL 0x0400 /* Open only if the file does not exist. */ #define _O_TEMPORARY 0x0040 /* Make the file dissappear after closing.
* WARNING: Even if not created by _open! */
#define _O_NOINHERIT 0x0080
#define _O_CREAT 0x0100 /* Create the file if it does not exist. */
#define _O_TRUNC 0x0200 /* Truncate the file if it does exist. */
#define _O_EXCL 0x0400 /* Open only if the file does not exist. */
#define _O_SHORT_LIVED 0x1000
/* NOTE: Text is the default even if the given _O_TEXT bit is not on. */ /* NOTE: Text is the default even if the given _O_TEXT bit is not on. */
#define _O_TEXT 0x4000 /* CR-LF in file becomes LF in memory. */ #define _O_TEXT 0x4000 /* CR-LF in file becomes LF in memory. */
#define _O_BINARY 0x8000 /* Input and output is not translated. */ #define _O_BINARY 0x8000 /* Input and output is not translated. */
#define _O_RAW _O_BINARY #define _O_RAW _O_BINARY
#define _O_TEMPORARY 0x0040 /* Make the file dissappear after closing.
* WARNING: Even if not created by _open! */
#define _O_NOINHERIT 0x0080
#define _O_RANDOM 0x0010
#define _O_SEQUENTIAL _O_RANDOM
#define _O_SHORT_LIVED 0x1000
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
/* POSIX/Non-ANSI names for increased portability */ /* POSIX/Non-ANSI names for increased portability */
#define O_RDONLY _O_RDONLY #define O_RDONLY _O_RDONLY
#define O_WRONLY _O_WRONLY #define O_WRONLY _O_WRONLY
#define O_RDWR _O_RDWR #define O_RDWR _O_RDWR
#define O_ACCMODE _O_ACCMODE #define O_ACCMODE _O_ACCMODE
#define O_APPEND _O_APPEND #define O_APPEND _O_APPEND
#define O_CREAT _O_CREAT #define O_CREAT _O_CREAT
#define O_TRUNC _O_TRUNC #define O_TRUNC _O_TRUNC
#define O_EXCL _O_EXCL #define O_EXCL _O_EXCL
#define O_TEXT _O_TEXT #define O_TEXT _O_TEXT
#define O_BINARY _O_BINARY #define O_BINARY _O_BINARY
#define O_TEMPORARY _O_TEMPORARY #define O_TEMPORARY _O_TEMPORARY
#define O_NOINHERIT _O_NOINHERIT #define O_NOINHERIT _O_NOINHERIT
#define O_RANDOM _O_RANDOM #define O_RANDOM _O_RANDOM
#define O_SEQUENTIAL _O_RANDOM #define O_SEQUENTIAL _O_RANDOM
#define O_SHORT_LIVED _O_SHORT_LIVED #define O_SHORT_LIVED _O_SHORT_LIVED
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
int _setmode (int nHandle, int nAccessMode); int _setmode (int, int);
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
int setmode (int nHandle, int nAccessMode); int setmode (int, int);
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */
#endif /* Not _FCNTL_H_ */
#endif /* Not _FCNTL_H_ */

View file

@ -24,176 +24,191 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 10:22:31 $ * $Date: 2002/11/24 18:06:00 $
* *
*/ */
#ifndef _FLOAT_H_ #ifndef _FLOAT_H_
#define _FLOAT_H_ #define _FLOAT_H_
#ifdef __cplusplus
extern "C" {
#endif
#define FLT_ROUNDS 1 #define FLT_ROUNDS 1
#define FLT_GUARD 1 #define FLT_GUARD 1
#define FLT_NORMALIZE 1 #define FLT_NORMALIZE 1
/* /*
* The characteristics of float. * The characteristics of float.
*/ */
/* The radix for floating point representation. */ /* The radix for floating point representation. */
#define FLT_RADIX 2 #define FLT_RADIX 2
/* Decimal digits of precision. */ /* Decimal digits of precision. */
#define FLT_DIG 6 #define FLT_DIG 6
/* Smallest number such that 1+x != 1 */ /* Smallest number such that 1+x != 1 */
#define FLT_EPSILON 1.19209290e-07F #define FLT_EPSILON 1.19209290e-07F
/* The number of base FLT_RADIX digits in the mantissa. */ /* The number of base FLT_RADIX digits in the mantissa. */
#define FLT_MANT_DIG 24 #define FLT_MANT_DIG 24
/* The maximum floating point number. */ /* The maximum floating point number. */
#define FLT_MAX 3.40282347e+38F #define FLT_MAX 3.40282347e+38F
/* Maximum n such that FLT_RADIX^n - 1 is representable. */ /* Maximum n such that FLT_RADIX^n - 1 is representable. */
#define FLT_MAX_EXP 128 #define FLT_MAX_EXP 128
/* Maximum n such that 10^n is representable. */ /* Maximum n such that 10^n is representable. */
#define FLT_MAX_10_EXP 38 #define FLT_MAX_10_EXP 38
/* Minimum normalized floating-point number. */ /* Minimum normalized floating-point number. */
#define FLT_MIN 1.17549435e-38F #define FLT_MIN 1.17549435e-38F
/* Minimum n such that FLT_RADIX^n is a normalized number. */ /* Minimum n such that FLT_RADIX^n is a normalized number. */
#define FLT_MIN_EXP (-125) #define FLT_MIN_EXP (-125)
/* Minimum n such that 10^n is a normalized number. */ /* Minimum n such that 10^n is a normalized number. */
#define FLT_MIN_10_EXP (-37) #define FLT_MIN_10_EXP (-37)
/* /*
* The characteristics of double. * The characteristics of double.
*/ */
#define DBL_DIG 15 #define DBL_DIG 15
#define DBL_EPSILON 1.1102230246251568e-16 #define DBL_EPSILON 1.1102230246251568e-16
#define DBL_MANT_DIG 53 #define DBL_MANT_DIG 53
#define DBL_MAX 1.7976931348623157e+308 #define DBL_MAX 1.7976931348623157e+308
#define DBL_MAX_EXP 1024 #define DBL_MAX_EXP 1024
#define DBL_MAX_10_EXP 308 #define DBL_MAX_10_EXP 308
#define DBL_MIN 2.2250738585072014e-308 #define DBL_MIN 2.2250738585072014e-308
#define DBL_MIN_EXP (-1021) #define DBL_MIN_EXP (-1021)
#define DBL_MIN_10_EXP (-307) #define DBL_MIN_10_EXP (-307)
/* /*
* The characteristics of long double. * The characteristics of long double.
* NOTE: long double is the same as double. * NOTE: long double is the same as double.
*/ */
#define LDBL_DIG 15 #define LDBL_DIG 15
#define LDBL_EPSILON 1.1102230246251568e-16L #define LDBL_EPSILON 1.1102230246251568e-16L
#define LDBL_MANT_DIG 53 #define LDBL_MANT_DIG 53
#define LDBL_MAX 1.7976931348623157e+308L #define LDBL_MAX 1.7976931348623157e+308L
#define LDBL_MAX_EXP 1024 #define LDBL_MAX_EXP 1024
#define LDBL_MAX_10_EXP 308 #define LDBL_MAX_10_EXP 308
#define LDBL_MIN 2.2250738585072014e-308L #define LDBL_MIN 2.2250738585072014e-308L
#define LDBL_MIN_EXP (-1021) #define LDBL_MIN_EXP (-1021)
#define LDBL_MIN_10_EXP (-307) #define LDBL_MIN_10_EXP (-307)
/* /*
* Functions and definitions for controlling the FPU. * Functions and definitions for controlling the FPU.
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
/* TODO: These constants are only valid for x86 machines */ /* TODO: These constants are only valid for x86 machines */
/* Control word masks for unMask */ /* Control word masks for unMask */
#define _MCW_EM 0x0008001F /* Error masks */ #define _MCW_EM 0x0008001F /* Error masks */
#define _MCW_IC 0x00040000 /* Infinity */ #define _MCW_IC 0x00040000 /* Infinity */
#define _MCW_RC 0x00000300 /* Rounding */ #define _MCW_RC 0x00000300 /* Rounding */
#define _MCW_PC 0x00030000 /* Precision */ #define _MCW_PC 0x00030000 /* Precision */
/* Control word values for unNew (use with related unMask above) */ /* Control word values for unNew (use with related unMask above) */
#define _EM_INVALID 0x00000010 #define _EM_INVALID 0x00000010
#define _EM_DENORMAL 0x00080000 #define _EM_DENORMAL 0x00080000
#define _EM_ZERODIVIDE 0x00000008 #define _EM_ZERODIVIDE 0x00000008
#define _EM_OVERFLOW 0x00000004 #define _EM_OVERFLOW 0x00000004
#define _EM_UNDERFLOW 0x00000002 #define _EM_UNDERFLOW 0x00000002
#define _EM_INEXACT 0x00000001 #define _EM_INEXACT 0x00000001
#define _IC_AFFINE 0x00040000 #define _IC_AFFINE 0x00040000
#define _IC_PROJECTIVE 0x00000000 #define _IC_PROJECTIVE 0x00000000
#define _RC_CHOP 0x00000300 #define _RC_CHOP 0x00000300
#define _RC_UP 0x00000200 #define _RC_UP 0x00000200
#define _RC_DOWN 0x00000100 #define _RC_DOWN 0x00000100
#define _RC_NEAR 0x00000000 #define _RC_NEAR 0x00000000
#define _PC_24 0x00020000 #define _PC_24 0x00020000
#define _PC_53 0x00010000 #define _PC_53 0x00010000
#define _PC_64 0x00000000 #define _PC_64 0x00000000
/* Return values for fpclass. */
#define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */
#define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */
#define _FPCLASS_NINF 0x0004 /* Negative Infinity */
#define _FPCLASS_NN 0x0008 /* Negative Normal */
#define _FPCLASS_ND 0x0010 /* Negative Denormal */
#define _FPCLASS_NZ 0x0020 /* Negative Zero */
#define _FPCLASS_PZ 0x0040 /* Positive Zero */
#define _FPCLASS_PD 0x0080 /* Positive Denormal */
#define _FPCLASS_PN 0x0100 /* Positive Normal */
#define _FPCLASS_PINF 0x0200 /* Positive Infinity */
#ifdef __cplusplus
extern "C" {
#endif
/* Set the FPU control word as cw = (cw & ~unMask) | (unNew & unMask), /* Set the FPU control word as cw = (cw & ~unMask) | (unNew & unMask),
* i.e. change the bits in unMask to have the values they have in unNew, * i.e. change the bits in unMask to have the values they have in unNew,
* leaving other bits unchanged. */ * leaving other bits unchanged. */
unsigned int _controlfp (unsigned int unNew, unsigned int unMask); unsigned int _controlfp(unsigned int unNew, unsigned int unMask);
unsigned int _control87 (unsigned int unNew, unsigned int unMask); unsigned int _control87(unsigned int unNew, unsigned int unMask);
unsigned int _clearfp (void); /* Clear the FPU status word */ unsigned int _clearfp(void); /* Clear the FPU status word */
unsigned int _statusfp (void); /* Report the FPU status word */ unsigned int _statusfp(void); /* Report the FPU status word */
#define _clear87 _clearfp #define _clear87 _clearfp
#define _status87 _statusfp #define _status87 _statusfp
void _fpreset (void); /* Reset the FPU */
/* Global 'variable' for the current floating point error code. */
extern int * __fpecode(void);
#define _fpecode (*(__fpecode()))
/* /*
* IEEE recommended functions MSVCRT.dll _fpreset initializes the control register to 0x27f,
the status register to zero and the tag word to 0FFFFh.
This differs from asm instruction finit/fninit which set control
word to 0x37f (64 bit mantissa precison rather than 53 bit).
By default, the mingw version of _fpreset sets fp control as
per fninit. To use the MSVCRT.dll _fpreset, include CRT_fp8.o when
building your application.
*/
void _fpreset(void); /* Reset the FPU */
/* Global 'variable' for the current floating point error code. */
int* __fpecode(void);
#define _fpecode (*(__fpecode()))
/*
* IEEE recommended functions. MS puts them in float.h
* but they really belong in math.h.
*/ */
double _chgsign (double x); double _chgsign (double);
double _copysign (double dTo, double dFrom); double _copysign (double, double);
double _logb (double x); double _logb (double);
double _nextafter (double x, double y); double _nextafter (double, double);
double _scalb (double x, long n); double _scalb (double, long);
/* Return values for fpclass. */ int _finite (double);
#define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */ int _fpclass (double);
#define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */ int _isnan (double);
#define _FPCLASS_NINF 0x0004 /* Negative Infinity */
#define _FPCLASS_NN 0x0008 /* Negative Normal */
#define _FPCLASS_ND 0x0010 /* Negative Denormal */
#define _FPCLASS_NZ 0x0020 /* Negative Zero */
#define _FPCLASS_PZ 0x0040 /* Positive Zero */
#define _FPCLASS_PD 0x0080 /* Positive Denormal */
#define _FPCLASS_PN 0x0100 /* Positive Normal */
#define _FPCLASS_PINF 0x0200 /* Positive Infinity */
int _finite (double x); int _isinf (double); // not exported
int _fpclass (double x); int _isnanl (long double); // not exported
int _isnan (double x); int _isinfl (long double); // not exported
int _isinf (double x); // not exported
int _isnanl (long double x); // not exported #define isnan(x) _isnan(x)
int _isinfl (long double x); // not exported #define isinf(x) _isinf(x)
#define isnan(x) _isnan(x)
#define isinf(x) _isinf(x)
#endif /* Not __STRICT_ANSI__ */ #ifdef __cplusplus
#ifdef __cplusplus
} }
#endif #endif
#endif /* Not __STRICT_ANSI__ */
#endif /* _FLOAT_H_ */ #endif /* _FLOAT_H_ */

View file

@ -13,11 +13,11 @@ extern "C" {
#ifndef _POSIX_SOURCE #ifndef _POSIX_SOURCE
struct __atexit { struct __atexit {
struct __atexit *__next; struct __atexit* __next;
void (*__function)(void); void (*__function)(void);
}; };
extern struct __atexit *__atexit_ptr; extern struct __atexit* __atexit_ptr;
#endif /* !_POSIX_SOURCE */ #endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */ #endif /* !__STRICT_ANSI__ */

View file

@ -12,9 +12,7 @@ extern "C" {
#endif #endif
#ifndef __dj_ENFORCE_ANSI_FREESTANDING #ifndef __dj_ENFORCE_ANSI_FREESTANDING
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _POSIX_SOURCE #ifndef _POSIX_SOURCE
#ifndef _IORMONCL #ifndef _IORMONCL
@ -26,45 +24,32 @@ extern "C" {
#define _IOUNGETC 010000 /* there is an ungetc'ed character in the buffer */ #define _IOUNGETC 010000 /* there is an ungetc'ed character in the buffer */
#endif #endif
// might need check for IO_APPEND aswell
#define OPEN4WRITING(f) ((((f)->_flag & _IOWRT) == _IOWRT))
#define OPEN4READING(f) ((((f)->_flag & _IOREAD) == _IOREAD))
// might need check for IO_APPEND aswell // might need check for IO_APPEND aswell
#define OPEN4WRITING(f) ((((f)->_flag & _IOWRT) == _IOWRT ) ) #define WRITE_STREAM(f) ((((f)->_flag & _IOWRT) == _IOWRT))
#define READ_STREAM(f) ((((f)->_flag & _IOREAD) == _IOREAD))
#define OPEN4READING(f) ((((f)->_flag & _IOREAD) == _IOREAD ) )
// might need check for IO_APPEND aswell
#define WRITE_STREAM(f) ((((f)->_flag & _IOWRT) == _IOWRT ) )
#define READ_STREAM(f) ((((f)->_flag & _IOREAD) == _IOREAD ) )
char __validfp (FILE *f);
char __validfp(FILE*);
int __set_errno(int err); int __set_errno(int err);
int __set_doserrno (int error); int __set_doserrno(int error);
void* filehnd(int fn);
void *filehnd(int fn); char __is_text_file(FILE*);
int __fileno_alloc(void* hFile, int mode);
char __is_text_file(FILE *p); int _doprnt(const char* fmt, va_list args, FILE *);
int _doscan(FILE* iop, const char* fmt, va_list argp);
int __fileno_alloc(void *hFile, int mode); int __fileno_dup2(int handle1, int handle2);
int _doprnt(const char *fmt, va_list args, FILE *f);
int _doscan(FILE *iop, const char *fmt, va_list argp);
int __fileno_dup2( int handle1, int handle2 );
int __fileno_getmode(int _fd); int __fileno_getmode(int _fd);
int __fileno_setmode(int _fd, int _newmode); int __fileno_setmode(int _fd, int _newmode);
int __fileno_close(int _fd); int __fileno_close(int _fd);
void sigabort_handler(int sig); void sigabort_handler(int sig);
#include <windows.h> #include <windows.h>
void UnixTimeToFileTime( time_t unix_time, FILETIME *filetime, DWORD remainder ); void UnixTimeToFileTime(time_t unix_time, FILETIME* filetime, DWORD remainder);
time_t FileTimeToUnixTime( const FILETIME *filetime, DWORD *remainder ); time_t FileTimeToUnixTime(const FILETIME* filetime, DWORD *remainder);
#endif /* !_POSIX_SOURCE */ #endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */ #endif /* !__STRICT_ANSI__ */
@ -73,24 +58,19 @@ time_t FileTimeToUnixTime( const FILETIME *filetime, DWORD *remainder );
#ifndef __dj_ENFORCE_FUNCTION_CALLS #ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */ #endif /* !__dj_ENFORCE_FUNCTION_CALLS */
#define __FILE_REC_MAX 20 #define __FILE_REC_MAX 20
typedef struct __file_rec typedef struct __file_rec
{ {
struct __file_rec *next; struct __file_rec* next;
int count; int count;
FILE *files[__FILE_REC_MAX]; FILE* files[__FILE_REC_MAX];
} __file_rec; } __file_rec;
extern __file_rec *__file_rec_list; extern __file_rec* __file_rec_list;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __dj_include_libc_file_h__ */ #endif /* __dj_include_libc_file_h__ */

View file

@ -2,24 +2,24 @@
#define _IEEE_H #define _IEEE_H
typedef struct { typedef struct {
unsigned int mantissa:23; unsigned int mantissa:23;
unsigned int exponent:8; unsigned int exponent:8;
unsigned int sign:1; unsigned int sign:1;
} float_t; } float_t;
typedef struct { typedef struct {
unsigned int mantissal:32; unsigned int mantissal:32;
unsigned int mantissah:20; unsigned int mantissah:20;
unsigned int exponent:11; unsigned int exponent:11;
unsigned int sign:1; unsigned int sign:1;
} double_t; } double_t;
typedef struct { typedef struct {
unsigned int mantissal:32; unsigned int mantissal:32;
unsigned int mantissah:32; unsigned int mantissah:32;
unsigned int exponent:15; unsigned int exponent:15;
unsigned int sign:1; unsigned int sign:1;
unsigned int empty:16; unsigned int empty:16;
} long_double_t; } long_double_t;
#endif #endif

View file

@ -3,27 +3,29 @@
#ifndef __MSVCRT_INTERNAL_RTERROR_H #ifndef __MSVCRT_INTERNAL_RTERROR_H
#define __MSVCRT_INTERNAL_RTERROR_H #define __MSVCRT_INTERNAL_RTERROR_H
#define _RT_STACK 0 /* stack overflow */
#define _RT_NULLPTR 1 /* null pointer assignment */ #define _RT_STACK 0 /* stack overflow */
#define _RT_FLOAT 2 /* floating point not loaded */ #define _RT_NULLPTR 1 /* null pointer assignment */
#define _RT_INTDIV 3 /* integer divide by 0 */ #define _RT_FLOAT 2 /* floating point not loaded */
#define _RT_SPACEARG 4 /* not enough space for arguments */ #define _RT_INTDIV 3 /* integer divide by 0 */
#define _RT_SPACEENV 5 /* not enough space for environment */ #define _RT_SPACEARG 4 /* not enough space for arguments */
#define _RT_ABORT 6 /* abnormal program termination */ #define _RT_SPACEENV 5 /* not enough space for environment */
#define _RT_THREAD 7 /* not enough space for thread data */ #define _RT_ABORT 6 /* abnormal program termination */
#define _RT_LOCK 8 /* unexpected multi-thread lock error */ #define _RT_THREAD 7 /* not enough space for thread data */
#define _RT_HEAP 9 /* unexpected heap error */ #define _RT_LOCK 8 /* unexpected multi-thread lock error */
#define _RT_OPENCON 10 /* unable to open console device */ #define _RT_HEAP 9 /* unexpected heap error */
#define _RT_NONCONT 11 /* non-continuable exception */ #define _RT_OPENCON 10 /* unable to open console device */
#define _RT_INVALDISP 12 /* invalid disposition of exception */ #define _RT_NONCONT 11 /* non-continuable exception */
#define _RT_ONEXIT 13 /* insufficient heap to allocate #define _RT_INVALDISP 12 /* invalid disposition of exception */
* initial table of function pointers #define _RT_ONEXIT 13 /* insufficient heap to allocate
* used by _onexit()/atexit(). */ * initial table of function pointers
#define _RT_PUREVIRT 14 /* pure virtual function call attempted * used by _onexit()/atexit(). */
* (C++ error) */ #define _RT_PUREVIRT 14 /* pure virtual function call attempted
#define _RT_STDIOINIT 15 /* not enough space for stdio initialization */ * (C++ error) */
#define _RT_LOWIOINIT 16 /* not enough space for lowio initialization */ #define _RT_STDIOINIT 15 /* not enough space for stdio initialization */
#define _RT_LOWIOINIT 16 /* not enough space for lowio initialization */
void _amsg_exit (int errnum); void _amsg_exit (int errnum);
#endif /* __MSVCRT_INTERNAL_RTERROR_H */ #endif /* __MSVCRT_INTERNAL_RTERROR_H */

View file

@ -3,9 +3,9 @@
#ifndef __MSVCRT_INTERNAL_STDIO_H #ifndef __MSVCRT_INTERNAL_STDIO_H
#define __MSVCRT_INTERNAL_STDIO_H #define __MSVCRT_INTERNAL_STDIO_H
int __vfscanf (FILE *s, const char *format, va_list argptr); int __vfscanf(FILE* s, const char* format, va_list argptr);
int __vscanf (const char *format, va_list arg); int __vscanf(const char* format, va_list arg);
int __vsscanf (const char *s,const char *format,va_list arg); int __vsscanf(const char* s,const char* format, va_list arg);
#endif /* __MSVCRT_INTERNAL_STDIO_H */ #endif /* __MSVCRT_INTERNAL_STDIO_H */

View file

@ -3,25 +3,26 @@
#ifndef __MSVCRT_INTERNAL_TLS_H #ifndef __MSVCRT_INTERNAL_TLS_H
#define __MSVCRT_INTERNAL_TLS_H #define __MSVCRT_INTERNAL_TLS_H
#include <msvcrt/crttypes.h>
#include <msvcrt/stddef.h> #include <msvcrt/stddef.h>
typedef struct _ThreadData typedef struct _ThreadData
{ {
int terrno; /* *nix error code */ int terrno; /* *nix error code */
unsigned long tdoserrno; /* Win32 error code (for I/O only) */ unsigned long tdoserrno; /* Win32 error code (for I/O only) */
unsigned long long tnext; /* used by rand/srand */ unsigned LONGLONG tnext; /* used by rand/srand */
char *lasttoken; /* used by strtok */ char *lasttoken; /* used by strtok */
wchar_t *wlasttoken; /* used by wcstok */ wchar_t *wlasttoken; /* used by wcstok */
int fpecode; /* fp exception code */ int fpecode; /* fp exception code */
/* qsort variables */ /* qsort variables */
int (*qcmp)(const void *, const void *); /* the comparison routine */ int (*qcmp)(const void *, const void *); /* the comparison routine */
int qsz; /* size of each record */ int qsz; /* size of each record */
int thresh; /* THRESHold in chars */ int thresh; /* THRESHold in chars */
int mthresh; /* MTHRESHold in chars */ int mthresh; /* MTHRESHold in chars */
} THREADDATA, *PTHREADDATA; } THREADDATA, *PTHREADDATA;

View file

@ -15,22 +15,23 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.4 $ * $Revision: 1.5 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 10:22:31 $ * $Date: 2002/11/24 18:06:00 $
* *
*/ */
/* Appropriated for Reactos Crtdll by Ariadne */ /* Appropriated for Reactos Crtdll by Ariadne */
/* added D_OK */ /* added D_OK */
/* changed get_osfhandle and open_osfhandle */ /* changed get_osfhandle and open_osfhandle */
/* added fileno as macro */ /* added fileno as macro */
#ifndef _IO_H_
#define _IO_H_
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _IO_H_
#define _IO_H_
#include <msvcrt/sys/types.h> #include <msvcrt/sys/types.h>
@ -47,109 +48,121 @@
/* TODO: Maximum number of open handles has not been tested, I just set /* TODO: Maximum number of open handles has not been tested, I just set
* it the same as FOPEN_MAX. */ * it the same as FOPEN_MAX. */
#define HANDLE_MAX FOPEN_MAX #define HANDLE_MAX FOPEN_MAX
/* Some defines for _access nAccessMode (MS doesn't define them, but /* Some defines for _access nAccessMode (MS doesn't define them, but
* it doesn't seem to hurt to add them). */ * it doesn't seem to hurt to add them). */
#define F_OK 0 /* Check for file existence */ #define F_OK 0 /* Check for file existence */
#define W_OK 2 /* Check for write permission */ #define W_OK 2 /* Check for write permission */
#define R_OK 4 /* Check for read permission */ #define R_OK 4 /* Check for read permission */
/* TODO: Is this safe? X_OK not supported directly... */ /* TODO: Is this safe? X_OK not supported directly... */
#define X_OK R_OK /* Check for execute permission */ #define X_OK R_OK /* Check for execute permission */
#define D_OK 0x10 #define D_OK 0x10
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
int _access (const char* szFileName, int nAccessMode); int _access (const char*, int);
int _chmod (const char* szPath, int nMode); int _chsize (int, long);
int _chsize (int nHandle, long lnNewSize); int _close (int);
int _close (int nHandle); int _commit(int);
int _commit(int _fd);
int _creat (const char* szFileName, int nAccessMode); /* NOTE: The only significant bit in unPermissions appears to be bit 7 (0x80),
int _dup (int nHandle); * the "owner write permission" bit (on FAT). */
int _dup2 (int nOldHandle, int nNewHandle); int _creat (const char*, int);
long _filelength (int nHandle); int _dup (int);
__int64 _filelengthi64(int nHandle); int _dup2 (int, int);
int _fileno (FILE* fileGetHandle); long _filelength (int);
void* _get_osfhandle (int nHandle); int _fileno (FILE*);
int _isatty (int nHandle); void* _get_osfhandle (int);
int _isatty (int);
int _chmod (const char* szPath, int nMode);
__int64 _filelengthi64(int nHandle);
/* In a very odd turn of events this function is excluded from those /* In a very odd turn of events this function is excluded from those
* files which define _STREAM_COMPAT. This is required in order to * files which define _STREAM_COMPAT. This is required in order to
* build GNU libio because of a conflict with _eof in streambuf.h * build GNU libio because of a conflict with _eof in streambuf.h
* line 107. Actually I might just be able to change the name of * line 107. Actually I might just be able to change the name of
* the enum member in streambuf.h... we'll see. TODO */ * the enum member in streambuf.h... we'll see. TODO */
#ifndef _STREAM_COMPAT #ifndef _STREAM_COMPAT
int _eof (int nHandle); int _eof (int);
#endif #endif
/* LK_... locking commands defined in sys/locking.h. */ /* LK_... locking commands defined in sys/locking.h. */
int _locking (int nHandle, int nCmd, long lnLockRegionLength); int _locking (int, int, long);
off_t _lseek(int _fd, off_t _offset, int _whence); off_t _lseek(int, off_t, int);
__int64 _lseeki64(int _fildes, __int64 _offset, int _whence);
int _open (const char* szFileName, int nFlags, ...);
int _open_osfhandle (void *lnOSHandle, int nFlags);
int _pipe (int *naHandles, unsigned int unSize, int nMode);
size_t _read(int _fd, void *_buf, size_t _nbyte);
/* SH_... flags for nFlag defined in share.h */ /* Optional third argument is unsigned unPermissions. */
int _sopen (char* szFileName, int nAccess, int nFlag, int nMode); int _open (const char*, int, ...);
long _tell(int nHandle); int _open_osfhandle (void*, int);
__int64 _telli64(int nHandle); int _pipe (int*, unsigned int, int);
unsigned _umask(unsigned unMode); size_t _read(int, void*, size_t);
int _unlink(const char* szFileName);
size_t _write(int _fd, const void *_buf, size_t _nbyte); /* SH_... flags for nShFlags defined in share.h
* Optional fourth argument is unsigned unPermissions */
int _sopen (char*, int, int, int);
long _tell(int);
/* Should umask be in sys/stat.h and/or sys/types.h instead? */
unsigned _umask(unsigned);
int _unlink(const char*);
size_t _write(int, const void*, size_t);
__int64 _lseeki64(int _fildes, __int64 _offset, int _whence);
__int64 _telli64(int nHandle);
/* Wide character versions. Also declared in wchar.h. */
/* Not in crtdll.dll */
int _waccess(const wchar_t*, int);
int _wchmod(const wchar_t*, int);
int _wcreat(const wchar_t*, int);
int _wunlink(const wchar_t*);
int _wopen(const wchar_t*, int, ...);
int _wsopen(wchar_t*, int, int, int);
/* wide character functions */ #ifndef _NO_OLDNAMES
int _waccess(const wchar_t *_path, int _amode);
int _wchmod(const wchar_t *filename, int mode);
int _wcreat(const wchar_t *filename, int mode);
int _wopen(const wchar_t *_path, int _oflag,...);
int _wsopen(wchar_t *path, int access, int shflag, int mode);
int _wunlink(const wchar_t *filename);
#ifndef _NO_OLDNAMES
/* /*
* Non-underscored versions of non-ANSI functions to improve portability. * Non-underscored versions of non-ANSI functions to improve portability.
* These functions live in libmoldname.a. * These functions live in libmoldname.a.
*/ */
#define access _access #define access _access
#define chmod _chmod #define chmod _chmod
#define chsize _chsize #define chsize _chsize
#define close _close #define close _close
#define creat _creat #define creat _creat
#define dup _dup #define dup _dup
#define dup2 _dup2 #define dup2 _dup2
#define eof _eof #define eof _eof
#define filelength _filelength #define filelength _filelength
#define fileno(f) ((f)->_file) #define fileno(f) ((f)->_file)
#define isatty _isatty #define isatty _isatty
#define lseek _lseek #define lseek _lseek
#define open _open #define open _open
#define read _read #define read _read
#define sopen(path,access,shflag,mode) _open((path), (access)|(shflag), (mode)) #define sopen(path,access,shflag,mode) _open((path), (access)|(shflag), (mode))
#define tell(file) _lseek(_file, 0, SEEK_CUR) #define tell(file) _lseek(_file, 0, SEEK_CUR)
#define umask _umask #define umask _umask
#define unlink _unlink #define unlink _unlink
#define write _write #define write _write
#endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus #endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus
} }
#endif #endif
#endif /* Not strict ANSI */ #endif /* _IO_H_ not defined */
#endif /* Not strict ANSI */
#endif /* _IO_H_ not defined */

View file

@ -16,21 +16,18 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 10:22:31 $ * $Date: 2002/11/24 18:06:00 $
* *
*/ */
#ifndef _LOCALE_H_ #ifndef _LOCALE_H_
#define _LOCALE_H_ #define _LOCALE_H_
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* NOTE: I have tried to test this, but I am limited by my knowledge of * NOTE: I have tried to test this, but I am limited by my knowledge of
@ -41,44 +38,50 @@ extern "C" {
* of the system). * of the system).
*/ */
#define LC_ALL 0 #define LC_ALL 0
#define LC_COLLATE 1 #define LC_COLLATE 1
#define LC_CTYPE 2 #define LC_CTYPE 2
#define LC_MONETARY 3 #define LC_MONETARY 3
#define LC_NUMERIC 4 #define LC_NUMERIC 4
#define LC_TIME 5 #define LC_TIME 5
#define LC_MIN LC_ALL
#define LC_MAX LC_TIME
/* /*
* The structure returned by 'localeconv'. * The structure returned by 'localeconv'.
*/ */
struct lconv struct lconv
{ {
char* decimal_point; char* decimal_point;
char* thousands_sep; char* thousands_sep;
char* grouping; char* grouping;
char* int_curr_symbol; char* int_curr_symbol;
char* currency_symbol; char* currency_symbol;
char* mon_decimal_point; char* mon_decimal_point;
char* mon_thousands_sep; char* mon_thousands_sep;
char* mon_grouping; char* mon_grouping;
char* positive_sign; char* positive_sign;
char* negative_sign; char* negative_sign;
char int_frac_digits; char int_frac_digits;
char frac_digits; char frac_digits;
char p_cs_precedes; char p_cs_precedes;
char p_sep_by_space; char p_sep_by_space;
char n_cs_precedes; char n_cs_precedes;
char n_sep_by_space; char n_sep_by_space;
char p_sign_posn; char p_sign_posn;
char n_sign_posn; char n_sign_posn;
}; };
char* setlocale (int nCategory, const char* locale); #ifdef __cplusplus
struct lconv* localeconv (void); extern "C" {
#endif
#ifdef __cplusplus char* setlocale(int, const char*);
struct lconv* localeconv(void);
#ifdef __cplusplus
} }
#endif #endif
#endif #endif /* Not _LOCALE_H_ */

View file

@ -18,31 +18,31 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 10:22:31 $ * $Date: 2002/11/24 18:06:00 $
* *
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _MALLOC_H_ #ifndef _MALLOC_H_
#define _MALLOC_H_ #define _MALLOC_H_
#include <msvcrt/alloc.h> #include <msvcrt/alloc.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
void * _expand( void *memblock, size_t size ); int _heapchk(void); /* Verify heap integrety. */
int _heapchk (void); /* Verify heap integrety. */ int _heapmin(void); /* Return unused heap to the OS. */
int _heapmin (void); /* Return unused heap to the OS. */ int _heapset(unsigned int);
int _heapset (unsigned int unFill); size_t _msize(void*);
size_t _msize (void* pBlock); void* _expand(void*, size_t);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -15,12 +15,12 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 10:22:31 $ * $Date: 2002/11/24 18:06:00 $
* *
*/ */
// added modfl // added modfl
@ -28,6 +28,8 @@
#ifndef _MATH_H_ #ifndef _MATH_H_
#define _MATH_H_ #define _MATH_H_
#include <msvcrt/crttypes.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -42,99 +44,99 @@ extern "C" {
* *
* NOTE: The CRTDLL version uses _HUGE_dll instead. * NOTE: The CRTDLL version uses _HUGE_dll instead.
*/ */
#if __MSVCRT__ #ifdef _MSVCRT_LIB_
extern double* __imp__HUGE; extern double* __imp__HUGE;
#define HUGE_VAL (*__imp__HUGE) #define HUGE_VAL (*__imp__HUGE)
#else #else
/* CRTDLL */ /* CRTDLL */
extern double* _HUGE_dll; extern double* _HUGE_dll;
#define HUGE_VAL (*_HUGE_dll) #define HUGE_VAL (*_HUGE_dll)
#endif #endif
struct _exception struct _exception
{ {
int type; int type;
char *name; char *name;
double arg1; double arg1;
double arg2; double arg2;
double retval; double retval;
}; };
/* /*
* Types for the above _exception structure. * Types for the above _exception structure.
*/ */
#define _DOMAIN 1 /* domain error in argument */ #define _DOMAIN 1 /* domain error in argument */
#define _SING 2 /* singularity */ #define _SING 2 /* singularity */
#define _OVERFLOW 3 /* range overflow */ #define _OVERFLOW 3 /* range overflow */
#define _UNDERFLOW 4 /* range underflow */ #define _UNDERFLOW 4 /* range underflow */
#define _TLOSS 5 /* total loss of precision */ #define _TLOSS 5 /* total loss of precision */
#define _PLOSS 6 /* partial loss of precision */ #define _PLOSS 6 /* partial loss of precision */
/* /*
* Exception types with non-ANSI names for compatibility. * Exception types with non-ANSI names for compatibility.
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
#define DOMAIN _DOMAIN #define DOMAIN _DOMAIN
#define SING _SING #define SING _SING
#define OVERFLOW _OVERFLOW #define OVERFLOW _OVERFLOW
#define UNDERFLOW _UNDERFLOW #define UNDERFLOW _UNDERFLOW
#define TLOSS _TLOSS #define TLOSS _TLOSS
#define PLOSS _PLOSS #define PLOSS _PLOSS
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */
double sin (double x); double sin (double x);
double cos (double x); double cos (double x);
double tan (double x); double tan (double x);
double sinh (double x); double sinh (double x);
double cosh (double x); double cosh (double x);
double tanh (double x); double tanh (double x);
double asin (double x); double asin (double x);
double acos (double x); double acos (double x);
double atan (double x); double atan (double x);
double atan2 (double y, double x); double atan2 (double y, double x);
double exp (double x); double exp (double x);
double log (double x); double log (double x);
double log10 (double x); double log10 (double x);
double pow (double x, double y); double pow (double x, double y);
long double powl (long double x,long double y); long double powl (long double x,long double y);
double sqrt (double x); double sqrt (double x);
double ceil (double x); double ceil (double x);
double floor (double x); double floor (double x);
double fabs (double x); double fabs (double x);
double ldexp (double x, int n); double ldexp (double x, int n);
double frexp (double x, int* exp); double frexp (double x, int* exp);
double modf (double x, double* ip); double modf (double x, double* ip);
long double modfl (long double x,long double* ip); long double modfl (long double x,long double* ip);
double fmod (double x, double y); double fmod (double x, double y);
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
/* Complex number (for cabs) */ /* Complex number (for cabs) */
struct _complex struct _complex
{ {
double x; /* Real part */ double x; /* Real part */
double y; /* Imaginary part */ double y; /* Imaginary part */
}; };
double _cabs (struct _complex x); double _cabs (struct _complex x);
double _hypot (double x, double y); double _hypot (double x, double y);
double _j0 (double x); double _j0 (double x);
double _j1 (double x); double _j1 (double x);
double _jn (int n, double x); double _jn (int n, double x);
double _y0 (double x); double _y0 (double x);
double _y1 (double x); double _y1 (double x);
double _yn (int n, double x); double _yn (int n, double x);
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
/* /*
* Non-underscored versions of non-ANSI functions. These reside in * Non-underscored versions of non-ANSI functions. These reside in
@ -149,13 +151,48 @@ double y0 (double x);
double y1 (double x); double y1 (double x);
double yn (int n, double x); double yn (int n, double x);
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#ifdef __MSVCRT__
double linkme_sin(double x);
double linkme_cos(double x);
double linkme_tan(double x);
double linkme_sinh(double x);
double linkme_cosh(double x);
double linkme_tanh(double x);
double linkme_asin(double x);
double linkme_acos(double x);
double linkme_atan(double x);
double linkme_atan2(double y, double x);
double linkme_exp(double x);
double linkme_log(double x);
double linkme_log10(double x);
double linkme_pow(double x, double y);
long double linkme_powl(long double x,long double y);
double linkme_sqrt(double x);
double linkme_ceil(double x);
double linkme_floor(double x);
double linkme_fabs(double x);
double linkme_ldexp(double x, int n);
double linkme_frexp(double x, int* exp);
double linkme_modf(double x, double* ip);
long double linkme_modfl(long double x,long double* ip);
double linkme_fmod(double x, double y);
//linkme_log2
//linkme_floor
//linkme_ldexp
//linkme_pow
#endif
#endif /* Not _MATH_H_ */ #endif /* Not _MATH_H_ */

View file

@ -1,24 +1,48 @@
#ifndef _MBCTYPE_H /*
#define _MBCTYPE_H * mbctype.h
*
* Functions for testing multibyte character types and converting characters.
*
* This file is part of the Mingw32 package.
*
*
* THIS SOFTWARE IS NOT COPYRIGHTED
*
* This source code is offered for use in the public domain. You may
* use, modify or distribute it freely.
*
* This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
#ifdef __cplusplus #ifndef _MBCTYPE_H_
extern "C" { #define _MBCTYPE_H_
#endif
//#define _MS 0x01
//#define _MP 0x02
//#define _M1 0x04
//#define _M2 0x08
#define _MBC_SINGLE 0 /* return values for _mbsbtype and _mbbtype in mbstring.h */
#define _MBC_LEAD 1 #define _MBC_SINGLE 0
#define _MBC_TRAIL 2 #define _MBC_LEAD 1
#define _MBC_ILLEGAL -1 #define _MBC_TRAIL 2
#define _MBC_ILLEGAL (-1)
/* args for setmbcp (in lieu of actual codepage) */
#define _MB_CP_SBCS 0 #define _MB_CP_SBCS 0
#define _MB_CP_OEM -2 #define _MB_CP_OEM (-2)
#define _MB_CP_ANSI -3 #define _MB_CP_ANSI (-3)
#define _MB_CP_LOCALE -4 #define _MB_CP_LOCALE (-4)
/* TODO: bit masks */
/*
//#define _MS 0x01
//#define _MP 0x02
//#define _M1 0x04
//#define _M2 0x08
#define _SBUP
#define _SBLOW
*/
#define _KNJ_M ((char)0x01) /* Non-punctuation of Kana-set */ #define _KNJ_M ((char)0x01) /* Non-punctuation of Kana-set */
#define _KNJ_P ((char)0x02) /* Punctuation of Kana-set */ #define _KNJ_P ((char)0x02) /* Punctuation of Kana-set */
@ -35,15 +59,20 @@ extern "C" {
#define _M2 (_M_|__2) #define _M2 (_M_|__2)
#define _P2 (_P_|__2) #define _P2 (_P_|__2)
#ifdef __cplusplus
extern "C" {
#endif
extern char _jctype[257]; extern char _jctype[257];
int _ismbbkalnum( unsigned int c ); int _ismbbkana(unsigned char);
int _ismbbkana( unsigned char c ); int _ismbbkalnum(unsigned int);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif /* Not _MCTYPE_H_ */

View file

@ -1,108 +1,114 @@
/*
* mbstring.h
*
* Protototypes for string functions supporting multibyte characters.
*
* This file is part of the Mingw32 package.
*
*
* THIS SOFTWARE IS NOT COPYRIGHTED
*
* This source code is offered for use in the public domain. You may
* use, modify or distribute it freely.
*
* This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
#ifndef _MBSTRING_H_ #ifndef _MBSTRING_H_
#define _MBSTRING_H_ #define _MBSTRING_H_
#include <msvcrt/stddef.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <msvcrt/stddef.h>
size_t _mbstrlen(const char *str);
int _mbbtype(unsigned char c, int type);
int _mbsbtype( const unsigned char *str, size_t n );
unsigned int _mbbtombc(unsigned int c);
unsigned int _mbctombb(unsigned int c);
unsigned char * _mbscat(unsigned char *dst, const unsigned char *src);
unsigned char * _mbschr(unsigned char *str, unsigned char* c);
int _mbscmp(const unsigned char *, const unsigned char *);
int _mbscoll(const unsigned char *, const unsigned char *);
unsigned char * _mbscpy(unsigned char *, const unsigned char *);
size_t _mbscspn(const unsigned char *, const unsigned char *);
unsigned char * _mbsdup(const unsigned char *str);
int _mbsicmp(const unsigned char *, const unsigned char *);
int _mbsicoll(const unsigned char *, const unsigned char *);
size_t _mbslen(const unsigned char *str);
unsigned char * _mbsncat(unsigned char *, const unsigned char *, size_t);
unsigned char * _mbsnbcat(unsigned char *, const unsigned char *, size_t);
int _mbsncmp(const unsigned char *, const unsigned char *, size_t);
int _mbsnbcmp(const unsigned char *, const unsigned char *, size_t);
int _mbsncoll(const unsigned char *, const unsigned char *, size_t);
int _mbsnbcoll(const unsigned char *, const unsigned char *, size_t);
unsigned char * _mbsncpy(unsigned char *, const unsigned char *, size_t);
unsigned char * _mbsnbcpy(unsigned char *, const unsigned char *, size_t);
int _mbsnicmp(const unsigned char *, const unsigned char *, size_t);
int _mbsnbicmp(const unsigned char *, const unsigned char *, size_t);
int _mbsnicoll(const unsigned char *, const unsigned char *, size_t);
int _mbsnbicoll(const unsigned char *, const unsigned char *, size_t);
unsigned char * _mbsnset(unsigned char *, unsigned int, size_t);
unsigned char * _mbsnbset(unsigned char *, unsigned int, size_t);
size_t _mbsnccnt(const unsigned char *, size_t);
unsigned char * _mbspbrk(const unsigned char *, const unsigned char *);
unsigned char * _mbsrchr(const unsigned char *, unsigned int);
unsigned char * _mbsrev(unsigned char *);
unsigned char * _mbsset(unsigned char *, unsigned int);
size_t _mbsspn(const unsigned char *, const unsigned char *);
unsigned char * _mbsstr(const unsigned char *, const unsigned char *);
unsigned char * _mbstok(unsigned char *, unsigned char *);
unsigned char * _mbslwr(unsigned char *str);
unsigned char * _mbsupr(unsigned char *str);
size_t _mbclen(const unsigned char *);
void _mbccpy(unsigned char *, const unsigned char *);
/* tchar routines */
unsigned char * _mbsdec(const unsigned char *, const unsigned char *);
unsigned char * _mbsinc(const unsigned char *);
size_t _mbsnbcnt(const unsigned char *, size_t);
unsigned int _mbsnextc (const unsigned char *);
unsigned char * _mbsninc(const unsigned char *, size_t);
unsigned char * _mbsspnp(const unsigned char *, const unsigned char *);
/* character routines */ /* character routines */
int _ismbcalnum(unsigned int);
int _ismbcalpha(unsigned int);
int _ismbcdigit(unsigned int);
int _ismbcgraph(unsigned int);
int _ismbcprint(unsigned int);
int _ismbcpunct(unsigned int);
int _ismbcspace(unsigned int);
int _ismbclower(unsigned int);
int _ismbcupper(unsigned int);
int _ismbclegal(unsigned int);
int _ismbcalnum(unsigned int c); int _ismbblead(unsigned int);
int _ismbcalpha(unsigned int c); int _ismbbtrail(unsigned int);
int _ismbcdigit(unsigned int c); int _ismbslead(const unsigned char*, const unsigned char*);
int _ismbcgraph(unsigned int c); int _ismbstrail(const unsigned char*, const unsigned char*);
int _ismbclegal(unsigned int c);
int _ismbclower(unsigned int c);
int _ismbcprint(unsigned int c);
int _ismbcpunct(unsigned int c);
int _ismbcspace(unsigned int c);
int _ismbcupper(unsigned int c);
unsigned int _mbctolower(unsigned int); unsigned int _mbctolower(unsigned int);
unsigned int _mbctoupper(unsigned int); unsigned int _mbctoupper(unsigned int);
void _mbccpy(unsigned char*, const unsigned char*);
size_t _mbclen(const unsigned char*);
unsigned int _mbbtombc(unsigned int);
unsigned int _mbctombb(unsigned int);
/* Return value constants for these are defined in mbctype.h. */
int _mbbtype(unsigned char, int);
int _mbsbtype(const unsigned char*, size_t);
unsigned char* _mbscpy(unsigned char*, const unsigned char*);
unsigned char* _mbsncpy(unsigned char*, const unsigned char*, size_t);
unsigned char* _mbsnbcpy(unsigned char*, const unsigned char*, size_t);
unsigned char* _mbsset(unsigned char*, unsigned int);
unsigned char* _mbsnset(unsigned char*, unsigned int, size_t);
unsigned char* _mbsnbset(unsigned char*, unsigned int, size_t);
unsigned char* _mbsdup(const unsigned char*);
unsigned char* _mbsrev(unsigned char*);
unsigned char* _mbscat(unsigned char*, const unsigned char*);
unsigned char* _mbsncat(unsigned char*, const unsigned char*, size_t);
unsigned char* _mbsnbcat(unsigned char*, const unsigned char*, size_t);
size_t _mbslen(const unsigned char*);
size_t _mbsnbcnt(const unsigned char*, size_t);
size_t _mbsnccnt(const unsigned char*, size_t);
unsigned char* _mbschr(unsigned char*, unsigned char*);
unsigned char* _mbsrchr(const unsigned char*, unsigned int);
size_t _mbsspn(const unsigned char*, const unsigned char*);
size_t _mbscspn(const unsigned char*, const unsigned char*);
unsigned char* _mbsspnp(const unsigned char*, const unsigned char*);
unsigned char* _mbspbrk(const unsigned char*, const unsigned char*);
int _mbscmp(const unsigned char*, const unsigned char*);
int _mbsicmp(const unsigned char*, const unsigned char*);
int _mbsncmp(const unsigned char*, const unsigned char*, size_t);
int _mbsnicmp(const unsigned char*, const unsigned char*, size_t);
int _mbsnbcmp(const unsigned char*, const unsigned char*, size_t);
int _mbsnbicmp(const unsigned char*, const unsigned char*, size_t);
int _mbscoll(const unsigned char*, const unsigned char*);
int _mbsicoll(const unsigned char*, const unsigned char*);
int _mbsncoll(const unsigned char*, const unsigned char*, size_t);
int _mbsnicoll(const unsigned char*, const unsigned char*, size_t);
int _mbsnbcoll(const unsigned char*, const unsigned char*, size_t);
int _mbsnbicoll(const unsigned char*, const unsigned char*, size_t);
unsigned char* _mbsinc(const unsigned char*);
unsigned char* _mbsninc(const unsigned char*, size_t);
unsigned char* _mbsdec(const unsigned char*, const unsigned char*);
unsigned int _mbsnextc (const unsigned char*);
unsigned char* _mbslwr(unsigned char*);
unsigned char* _mbsupr(unsigned char*);
unsigned char* _mbstok(unsigned char*, unsigned char*);
unsigned char* _mbsstr(const unsigned char*, const unsigned char*);
size_t _mbstrlen(const char*str);
int _ismbblead( unsigned int c);
int _ismbbtrail( unsigned int c);
int _ismbslead( const unsigned char *s, const unsigned char *c);
int _ismbstrail( const unsigned char *s, const unsigned char *c);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif /* Not _MBSTRING_H_ */

View file

@ -17,6 +17,7 @@
#define __MSVCRT_DEBUG #define __MSVCRT_DEBUG
#include <roscfg.h> #include <roscfg.h>
#include <msvcrt/internal/file.h>
#if 0 #if 0
#ifdef NDEBUG #ifdef NDEBUG
@ -28,7 +29,11 @@
#define DPRINT1(args...) do { DbgPrint("(MSVCRT:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0); #define DPRINT1(args...) do { DbgPrint("(MSVCRT:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0);
#define CHECKPOINT1 do { DbgPrint("MSVCRT:%s:%d\n",__FILE__,__LINE__); } while(0); #define CHECKPOINT1 do { DbgPrint("MSVCRT:%s:%d\n",__FILE__,__LINE__); } while(0);
#else #else
#ifdef __GNUC__
#define DPRINT1(args...) #define DPRINT1(args...)
#else
#define DPRINT DbgPrint
#endif
#define CHECKPOINT1 #define CHECKPOINT1
#endif #endif
@ -36,8 +41,24 @@
#define DPRINT(args...) do { DbgPrint("(MSVCRT:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0); #define DPRINT(args...) do { DbgPrint("(MSVCRT:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0);
#define CHECKPOINT do { DbgPrint("MSVCRT:%s:%d\n",__FILE__,__LINE__); } while(0); #define CHECKPOINT do { DbgPrint("MSVCRT:%s:%d\n",__FILE__,__LINE__); } while(0);
#else #else
#ifdef __GNUC__
#define DPRINT(args...) #define DPRINT(args...)
#else
#define DPRINT DbgPrint
#endif
#define CHECKPOINT #define CHECKPOINT
#endif /* NDEBUG */ #endif /* NDEBUG */
//ULONG CDECL DbgPrint(PCH Format, ...);
//ULONG DbgPrint(PCH Format,...);
//unsigned long DbgPrint(const char* Format, ...);
//#define TRACE 0 ? (void)0 : Trace
//void Trace(TCHAR* lpszFormat, ...);
#endif /* __MSVCRT_DEBUG */ #endif /* __MSVCRT_DEBUG */

View file

@ -15,82 +15,82 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 10:22:31 $ * $Date: 2002/11/24 18:06:00 $
* *
*/ */
/* Appropriated for Reactos Crtdll by Ariadne */ /* Appropriated for Reactos Crtdll by Ariadne */
/* changed second argument of cwait from nPID to hProc */ /* changed second argument of cwait from nPID to hProc */
#ifndef _PROCESS_H_ #ifndef __STRICT_ANSI__
#define _PROCESS_H_
#ifndef __STRICT_ANSI__ #ifndef _PROCESS_H_
#define _PROCESS_H_
#ifdef __cplusplus
extern "C" {
#endif
void _cexit(void);
void _c_exit(void);
/* /*
* Constants for cwait actions. * Constants for cwait actions.
* Obsolete for Win32. * Obsolete for Win32.
*/ */
#define _WAIT_CHILD 0 #define _WAIT_CHILD 0
#define _WAIT_GRANDCHILD 1 #define _WAIT_GRANDCHILD 1
#ifndef _NO_OLDNAMES
#define WAIT_CHILD _WAIT_CHILD
#define WAIT_GRANDCHILD _WAIT_GRANDCHILD
#endif /* Not _NO_OLDNAMES */
int _cwait (int* pnStatus, int hProc, int nAction);
int _getpid(void);
int _execl (const char* szPath, const char* szArgv0, ...);
int _execle (const char* szPath, const char* szArgv0, ...);
int _execlp (const char* szPath, const char* szArgv0, ...);
int _execlpe (const char* szPath, const char* szArgv0, ...);
int _execv (const char* szPath, char* const* szaArgv);
int _execve (const char* szPath, char* const* szaArgv, char* const* szaEnv);
int _execvp (const char* szPath, char* const* szaArgv);
int _execvpe (const char* szPath, char* const* szaArgv, char* const* szaEnv);
#ifndef _NO_OLDNAMES
#define WAIT_CHILD _WAIT_CHILD
#define WAIT_GRANDCHILD _WAIT_GRANDCHILD
#endif /* Not _NO_OLDNAMES */
/* /*
* Mode constants for spawn functions. * Mode constants for spawn functions.
*/ */
#define _P_WAIT 0 #define _P_WAIT 0
#define _P_NOWAIT 1 #define _P_NOWAIT 1
#define _P_OVERLAY 2 #define _P_OVERLAY 2
#define _OLD_P_OVERLAY _P_OVERLAY #define _OLD_P_OVERLAY _P_OVERLAY
#define _P_NOWAITO 3 #define _P_NOWAITO 3
#define _P_DETACH 4 #define _P_DETACH 4
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
#define P_WAIT _P_WAIT #define P_WAIT _P_WAIT
#define P_NOWAIT _P_NOWAIT #define P_NOWAIT _P_NOWAIT
#define P_OVERLAY _P_OVERLAY #define P_OVERLAY _P_OVERLAY
#define OLD_P_OVERLAY _OLD_P_OVERLAY #define OLD_P_OVERLAY _OLD_P_OVERLAY
#define P_NOWAITO _P_NOWAITO #define P_NOWAITO _P_NOWAITO
#define P_DETACH _P_DETACH #define P_DETACH _P_DETACH
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
int _spawnl (int nMode, const char* szPath, const char* szArgv0, ...);
int _spawnle (int nMode, const char* szPath, const char* szArgv0,...); #ifdef __cplusplus
int _spawnlp (int nMode, const char* szPath, const char* szArgv0,...); extern "C" {
int _spawnlpe (int nMode, const char* szPath, const char* szArgv0,...); #endif
int _spawnv (int nMode, const char* szPath, char* const* szaArgv);
int _spawnve (int nMode, const char* szPath, char* const* szaArgv, char* const* szaEnv); void _cexit(void);
int _spawnvp (int nMode, const char* szPath, char* const* szaArgv); void _c_exit(void);
int _spawnvpe (int nMode, const char* szPath, char* const* szaArgv, char* const* szaEnv);
int _cwait (int* pnStatus, int hProc, int nAction);
int _getpid(void);
int _execl (const char* szPath, const char* szArgv0, ...);
int _execle (const char* szPath, const char* szArgv0, ...);
int _execlp (const char* szPath, const char* szArgv0, ...);
int _execlpe (const char* szPath, const char* szArgv0, ...);
int _execv (const char* szPath, char* const* szaArgv);
int _execve (const char* szPath, char* const* szaArgv, char* const* szaEnv);
int _execvp (const char* szPath, char* const* szaArgv);
int _execvpe (const char* szPath, char* const* szaArgv, char* const* szaEnv);
int _spawnl (int nMode, const char* szPath, const char* szArgv0, ...);
int _spawnle (int nMode, const char* szPath, const char* szArgv0,...);
int _spawnlp (int nMode, const char* szPath, const char* szArgv0,...);
int _spawnlpe (int nMode, const char* szPath, const char* szArgv0,...);
int _spawnv (int nMode, const char* szPath, char* const* szaArgv);
int _spawnve (int nMode, const char* szPath, char* const* szaArgv, char* const* szaEnv);
int _spawnvp (int nMode, const char* szPath, char* const* szaArgv);
int _spawnvpe (int nMode, const char* szPath, char* const* szaArgv, char* const* szaEnv);
/* /*
* The functions _beginthreadex and _endthreadex are not provided by CRTDLL. * The functions _beginthreadex and _endthreadex are not provided by CRTDLL.
* They are provided by MSVCRT. * They are provided by MSVCRT.
@ -103,58 +103,58 @@ int _spawnvpe (int nMode, const char* szPath, char* const* szaArgv, char* const*
* NOTE: No old names for these functions. Use the underscore. * NOTE: No old names for these functions. Use the underscore.
*/ */
unsigned long unsigned long
_beginthread (void (__cdecl *pfuncStart)(void *), _beginthread(void (__cdecl *pfuncStart)(void*),
unsigned unStackSize, void* pArgList); unsigned unStackSize, void* pArgList);
void _endthread (void); void _endthread (void);
#if __MSVCRT__ #ifdef __MSVCRT__
unsigned long unsigned long
_beginthreadex (void *pSecurity, unsigned unStackSize, _beginthreadex(void* pSecurity, unsigned unStackSize,
unsigned (__stdcall *pfuncStart)(void*), void* pArgList, unsigned (__stdcall *pfuncStart)(void*), void* pArgList,
unsigned unInitFlags, unsigned* pThreadAddr); unsigned unInitFlags, unsigned* pThreadAddr);
void _endthreadex (unsigned unExitCode); void _endthreadex(unsigned unExitCode);
#endif #endif
void *_loaddll (char *name); void* _loaddll(char* name);
int _unloaddll(void *handle); int _unloaddll(void* handle);
unsigned long __threadid(void); unsigned long __threadid(void);
#define _threadid __threadid() #define _threadid __threadid()
void * __threadhandle(void); void* __threadhandle(void);
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
#define cwait _cwait #define cwait _cwait
#define getpid _getpid #define getpid _getpid
#define execl _execl #define execl _execl
#define execle _execle #define execle _execle
#define execlp _execlp #define execlp _execlp
#define execlpe _execlpe #define execlpe _execlpe
#define execv _execv #define execv _execv
#define execve _execve #define execve _execve
#define execvp _execvp #define execvp _execvp
#define execvpe _execvpe #define execvpe _execvpe
#define spawnl _spawnl #define spawnl _spawnl
#define spawnle _spawnle #define spawnle _spawnle
#define spawnlp _spawnlp #define spawnlp _spawnlp
#define spawnlpe _spawnlpe #define spawnlpe _spawnlpe
#define spawnv _spawnv #define spawnv _spawnv
#define spawnve _spawnve #define spawnve _spawnve
#define spawnvp _spawnvp #define spawnvp _spawnvp
#define spawnvpe _spawnvpe #define spawnvpe _spawnvpe
#endif /* Not _NO_OLDNAMES */
#endif /* Not _NO_OLDNAMES */ #ifdef __cplusplus
#ifdef __cplusplus
} }
#endif #endif
#endif /* Not __STRICT_ANSI__ */ #endif /* _PROCESS_H_ not defined */
#endif /* Not __STRICT_ANSI__ */
#endif /* _PROCESS_H_ not defined */

View file

@ -1,17 +1,44 @@
#ifndef _include_share_h_ /*
#define _include_share_h_ * share.h
*
* Constants for file sharing functions.
*
* This file is part of the Mingw32 package.
*
* Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
*
* THIS SOFTWARE IS NOT COPYRIGHTED
*
* This source code is offered for use in the public domain. You may
* use, modify or distribute it freely.
*
* This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision: 1.4 $
* $Author: robd $
* $Date: 2002/11/24 18:06:00 $
*
*/
#ifndef _SHARE_H_
#define _SHARE_H_
#define SH_COMPAT 0x0000 #define SH_COMPAT 0x0000
#define SH_DENYRW 0x0010 #define SH_DENYRW 0x0010
#define SH_DENYWR 0x0020 #define SH_DENYWR 0x0020
#define SH_DENYRD 0x0030 #define SH_DENYRD 0x0030
#define SH_DENYNO 0x0040 #define SH_DENYNO 0x0040
#define _SH_COMPAT SH_COMPAT #define _SH_COMPAT SH_COMPAT
#define _SH_DENYRW SH_DENYRW #define _SH_DENYRW SH_DENYRW
#define _SH_DENYWR SH_DENYWR #define _SH_DENYWR SH_DENYWR
#define _SH_DENYRD SH_DENYRD #define _SH_DENYRD SH_DENYRD
#define _SH_DENYNO SH_DENYNO #define _SH_DENYNO SH_DENYNO
#endif
#endif /* Not _SHARE_H_ */

View file

@ -15,42 +15,18 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 10:22:31 $ * $Date: 2002/11/24 18:06:00 $
* *
*/ */
/* added some extra signal constants */ /* added some extra signal constants */
#ifndef _SIGNAL_H_ #ifndef _SIGNAL_H_
#define _SIGNAL_H_ #define _SIGNAL_H_
#ifdef __cplusplus
extern "C" {
#endif
/*
* The prototypes (below) are the easy part. The hard part is figuring
* out what signals are available and what numbers they are assigned
* along with appropriate values of SIG_DFL and SIG_IGN.
*/
/*
* A pointer to a signal handler function. A signal handler takes a
* single int, which is the signal it handles.
*/
typedef void (*_p_sig_fn_t)(int nSig);
/*
* These are special values of signal handler pointers which are
* used to send a signal to the default handler (SIG_DFL), ignore
* the signal (SIG_IGN), or indicate an error return (SIG_ERR).
*/
#define SIG_DFL ((_p_sig_fn_t) 0)
#define SIG_IGN ((_p_sig_fn_t) 1)
#define SIG_ERR ((_p_sig_fn_t) -1)
/* /*
* The actual signal values. Using other values with signal * The actual signal values. Using other values with signal
@ -68,44 +44,70 @@ typedef void (*_p_sig_fn_t)(int nSig);
* structured exception handling frame. Results may be better if I ever * structured exception handling frame. Results may be better if I ever
* manage to get the SEH stuff down. * manage to get the SEH stuff down.
*/ */
#define SIGINT 2 /* Interactive attention */ #define SIGINT 2 /* Interactive attention */
#define SIGILL 4 /* Illegal instruction */ #define SIGILL 4 /* Illegal instruction */
#define SIGFPE 8 /* Floating point error */ #define SIGFPE 8 /* Floating point error */
#define SIGSEGV 11 /* Segmentation violation */ #define SIGSEGV 11 /* Segmentation violation */
#define SIGTERM 15 /* Termination request */ #define SIGTERM 15 /* Termination request */
#define SIGBREAK 21 /* Control-break */ #define SIGBREAK 21 /* Control-break */
#define SIGABRT 22 /* Abnormal termination (abort) */ #define SIGABRT 22 /* Abnormal termination (abort) */
#define SIGALRM 293 #define SIGALRM 293
#define SIGHUP 294 #define SIGHUP 294
/* SIGINT is ansi */ /* SIGINT is ansi */
#define SIGKILL 296 #define SIGKILL 296
#define SIGPIPE 297 #define SIGPIPE 297
#define SIGQUIT 298 #define SIGQUIT 298
#define SIGUSR1 299 #define SIGUSR1 299
#define SIGUSR2 300 #define SIGUSR2 300
#define SIGNOFP 301 #define SIGNOFP 301
#define SIGTRAP 302 #define SIGTRAP 302
#define SIGTIMR 303 /* Internal for setitimer (SIGALRM, SIGPROF) */ #define SIGTIMR 303 /* Internal for setitimer (SIGALRM, SIGPROF) */
#define SIGPROF 304 #define SIGPROF 304
#define SIGMAX 320 #define SIGMAX 320
/*
* The prototypes (below) are the easy part. The hard part is figuring
* out what signals are available and what numbers they are assigned
* along with appropriate values of SIG_DFL and SIG_IGN.
*/
/*
* A pointer to a signal handler function. A signal handler takes a
* single int, which is the signal it handles.
*/
typedef void (*_p_sig_fn_t)(int);
/*
* These are special values of signal handler pointers which are
* used to send a signal to the default handler (SIG_DFL), ignore
* the signal (SIG_IGN), or indicate an error return (SIG_ERR).
*/
#define SIG_DFL ((_p_sig_fn_t) 0)
#define SIG_IGN ((_p_sig_fn_t) 1)
#define SIG_ERR ((_p_sig_fn_t) -1)
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* Call signal to set the signal handler for signal sig to the * Call signal to set the signal handler for signal sig to the
* function pointed to by handler. Returns a pointer to the * function pointed to by handler. Returns a pointer to the
* previous handler, or SIG_ERR if an error occurs. Initially * previous handler, or SIG_ERR if an error occurs. Initially
* unhandled signals defined above will return SIG_DFL. * unhandled signals defined above will return SIG_DFL.
*/ */
_p_sig_fn_t signal(int sig, _p_sig_fn_t func); _p_sig_fn_t signal(int sig, _p_sig_fn_t func);
/* /*
* Raise the signal indicated by sig. Returns non-zero on success. * Raise the signal indicated by sig. Returns non-zero on success.
*/ */
int raise (int sig); int raise(int);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif /* Not _SIGNAL_H_ */

View file

@ -23,12 +23,12 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.4 $ * $Revision: 1.5 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 10:22:31 $ * $Date: 2002/11/24 18:06:00 $
* *
*/ */
/* Appropriated for Reactos Crtdll by Ariadne */ /* Appropriated for Reactos Crtdll by Ariadne */
@ -48,7 +48,7 @@
#define _VA_LIST_DEFINED #define _VA_LIST_DEFINED
#endif #endif
#ifndef _VA_LIST #ifndef _VA_LIST
#define _VA_LIST #define _VA_LIST
typedef char* va_list; typedef char* va_list;
#endif #endif
@ -58,31 +58,33 @@ typedef char* va_list;
* Amount of space required in an argument list (ie. the stack) for an * Amount of space required in an argument list (ie. the stack) for an
* argument of type t. * argument of type t.
*/ */
#define __va_argsiz(t) \ #define __va_argsiz(t) \
(((sizeof(t) + sizeof(int) - 1) / sizeof(int)) * sizeof(int)) (((sizeof(t) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
/* /*
* Start variable argument list processing by setting AP to point to the * Start variable argument list processing by setting AP to point to the
* argument after pN. * argument after pN.
*/ */
#ifdef __GNUC__ #ifdef __GNUC__
/* /*
* In GNU the stack is not necessarily arranged very neatly in order to * In GNU the stack is not necessarily arranged very neatly in order to
* pack shorts and such into a smaller argument list. Fortunately a * pack shorts and such into a smaller argument list. Fortunately a
* neatly arranged version is available through the use of __builtin_next_arg. * neatly arranged version is available through the use of __builtin_next_arg.
*/ */
#ifndef va_start #ifndef va_start
#define va_start(ap, pN) \ #define va_start(ap, pN) \
((ap) = ((va_list) __builtin_next_arg(pN))) ((ap) = ((va_list) __builtin_next_arg(pN)))
#endif #endif
#else #else
/* /*
* For a simple minded compiler this should work (it works in GNU too for * For a simple minded compiler this should work (it works in GNU too for
* vararg lists that don't follow shorts and such). * vararg lists that don't follow shorts and such).
*/ */
#define va_start(ap, pN) \ #ifndef va_start
((ap) = ((va_list) (&pN) + __va_argsiz(pN))) #define va_start(ap, pN) \
((ap) = ((va_list) (&pN) + __va_argsiz(pN)))
#endif
#endif #endif
@ -90,9 +92,9 @@ typedef char* va_list;
* End processing of variable argument list. In this case we do nothing. * End processing of variable argument list. In this case we do nothing.
*/ */
#ifndef va_end #ifndef va_end
#define va_end(ap) ((void)0) #define va_end(ap) ((void)0)
#endif #endif
/* /*
* Increment ap to the next argument in the list while returing a * Increment ap to the next argument in the list while returing a
@ -103,12 +105,11 @@ typedef char* va_list;
*/ */
#ifndef va_arg #ifndef va_arg
#define va_arg(ap, t) \ #define va_arg(ap, t) \
(((ap) = (ap) + __va_argsiz(t)), \ (((ap) = (ap) + __va_argsiz(t)), \
*((t*) (void*) ((ap) - __va_argsiz(t)))) *((t*) (void*) ((ap) - __va_argsiz(t))))
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* not _STDARG_H_ */ #endif /* not _STDARG_H_ */

View file

@ -25,12 +25,12 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.5 $ * $Revision: 1.6 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 10:22:31 $ * $Date: 2002/11/24 18:06:00 $
* *
*/ */
@ -42,8 +42,8 @@
* wants us just to define one data type. So don't define * wants us just to define one data type. So don't define
* the symbols that indicate this file's entire job has been done. * the symbols that indicate this file's entire job has been done.
*/ */
#if (!defined(__need_wchar_t) && !defined(__need_wint_t) \ #if (!defined(__need_wchar_t) && !defined(__need_wint_t) \
&& !defined(__need_size_t) && !defined(__need_ptrdiff_t) \ && !defined(__need_size_t) && !defined(__need_ptrdiff_t) \
&& !defined(__need_NULL)) && !defined(__need_NULL))
#define __MSVCRT_STDDEF_H_ #define __MSVCRT_STDDEF_H_
#endif #endif
@ -69,13 +69,13 @@
#ifndef _PTRDIFF_T_ #ifndef _PTRDIFF_T_
#define _PTRDIFF_T_ #define _PTRDIFF_T_
#ifndef __PTRDIFF_TYPE__ #ifndef __PTRDIFF_TYPE__
#define __PTRDIFF_TYPE__ int #define __PTRDIFF_TYPE__ int
#endif #endif
typedef __PTRDIFF_TYPE__ ptrdiff_t; typedef __PTRDIFF_TYPE__ ptrdiff_t;
#endif #endif
/* If this symbol has done its job, get rid of it. */ /* If this symbol has done its job, get rid of it. */
#undef __need_ptrdiff_t #undef __need_ptrdiff_t
#endif /* __MSVCRT_STDDEF_H_ or __need_ptrdiff_t. */ #endif /* __MSVCRT_STDDEF_H_ or __need_ptrdiff_t. */
@ -93,12 +93,12 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
#define SIZE_T_DEFINED #define SIZE_T_DEFINED
#define _SIZE_T #define _SIZE_T
#ifndef __SIZE_TYPE__ #ifndef __SIZE_TYPE__
#define __SIZE_TYPE__ unsigned int #define __SIZE_TYPE__ unsigned int
#endif #endif
typedef __SIZE_TYPE__ size_t; typedef __SIZE_TYPE__ size_t;
#endif #endif
#undef __need_size_t #undef __need_size_t
#endif /* __MSVCRT_STDDEF_H_ or __need_size_t. */ #endif /* __MSVCRT_STDDEF_H_ or __need_size_t. */
@ -116,16 +116,16 @@ typedef __SIZE_TYPE__ size_t;
#define _WCHAR_T #define _WCHAR_T
#define _WCHAR_T_DEFINED #define _WCHAR_T_DEFINED
#ifndef __WCHAR_TYPE__ #ifndef __WCHAR_TYPE__
#define __WCHAR_TYPE__ short unsigned int #define __WCHAR_TYPE__ short unsigned int
#endif #endif
#ifndef __cplusplus #ifndef __cplusplus
typedef __WCHAR_TYPE__ wchar_t; typedef __WCHAR_TYPE__ wchar_t;
#endif /* C++ */ #endif /* C++ */
#endif /* wchar_t not already defined */ #endif /* wchar_t not already defined */
#undef __need_wchar_t #undef __need_wchar_t
#endif /* __MSVCRT_STDDEF_H_ or __need_wchar_t. */ #endif /* __MSVCRT_STDDEF_H_ or __need_wchar_t. */
/* /*
* wint_t, the equivalent of int in wchar ctype functions. * wint_t, the equivalent of int in wchar ctype functions.
@ -134,17 +134,17 @@ typedef __WCHAR_TYPE__ wchar_t;
#ifndef _WINT_T_ #ifndef _WINT_T_
#define _WINT_T_ #define _WINT_T_
#define _WINT_T /* To satisfy libstdc++ */ #define _WINT_T /* To satisfy libstdc++ */
#ifndef __WINT_TYPE__ #ifndef __WINT_TYPE__
#define __WINT_TYPE__ short int #define __WINT_TYPE__ short int
#endif /* Not defined __WINT_TYPE__ */ #endif /* Not defined __WINT_TYPE__ */
typedef __WINT_TYPE__ wint_t; typedef __WINT_TYPE__ wint_t;
#endif /* Not defined _WINT_T_ */ #endif /* Not defined _WINT_T_ */
#undef __need_wint_t #undef __need_wint_t
#endif /* __MSVCRT_STDDEF_H_ or __need_wint_t. */ #endif /* __MSVCRT_STDDEF_H_ or __need_wint_t. */
/* /*
@ -157,7 +157,7 @@ typedef __WINT_TYPE__ wint_t;
#define NULL (0) #define NULL (0)
#endif /* __MSVCRT_STDDEF_H_ or __need_NULL */ #endif /* __MSVCRT_STDDEF_H_ or __need_NULL */
#undef __need_NULL #undef __need_NULL
/* /*
@ -167,8 +167,8 @@ typedef __WINT_TYPE__ wint_t;
*/ */
#if defined (__MSVCRT_STDDEF_H_) #if defined (__MSVCRT_STDDEF_H_)
#define offsetof(TYPE, MEMBER) ((size_t) &( ((TYPE *) 0)->MEMBER )) #define offsetof(TYPE, MEMBER) ((size_t) &( ((TYPE *) 0)->MEMBER ))
#endif /* __MSVCRT_STDDEF_H_ */ #endif /* __MSVCRT_STDDEF_H_ */
#endif /* not __MSVCRT_STDDEF_H_ */ #endif /* not __MSVCRT_STDDEF_H_ */

View file

@ -19,12 +19,12 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.4 $ * $Revision: 1.5 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 10:22:31 $ * $Date: 2002/11/24 18:06:00 $
* *
*/ */
/* Appropriated for Reactos Crtdll by Ariadne */ /* Appropriated for Reactos Crtdll by Ariadne */
@ -33,7 +33,7 @@
/* added filbuf and flsbuf and fwalk */ /* added filbuf and flsbuf and fwalk */
#ifndef _STDIO_H_ #ifndef _STDIO_H_
#define _STDIO_H_ #define _STDIO_H_
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -54,6 +54,9 @@ extern "C" {
#define _IOERR 0x000200 #define _IOERR 0x000200
#define _IOSTRG 0x000400 #define _IOSTRG 0x000400
#define _IOBINARY 0x000800
#define _IOTEXT 0x000000
#define _IOAPPEND 0x002000 #define _IOAPPEND 0x002000
#define _IORMONCL 0x004000 /* remove on close, for temp files */ #define _IORMONCL 0x004000 /* remove on close, for temp files */
/* if _flag & _IORMONCL, ._name_to_remove needs freeing */ /* if _flag & _IORMONCL, ._name_to_remove needs freeing */
@ -72,7 +75,7 @@ extern "C" {
*/ */
//#ifndef _VA_LIST //#ifndef _VA_LIST
//#define _VA_LIST //#define _VA_LIST
//typedef char* va_list; //typedef char* va_list;
//#endif //#endif
#include <msvcrt/stdarg.h> #include <msvcrt/stdarg.h>
@ -82,14 +85,14 @@ extern "C" {
*/ */
#ifndef _FILE_DEFINED #ifndef _FILE_DEFINED
typedef struct { typedef struct {
char *_ptr; char* _ptr;
int _cnt; int _cnt;
char *_base; char* _base;
int _flag; int _flag;
int _file; int _file;
int _ungotchar; int _ungotchar;
int _bufsiz; int _bufsiz;
char *_name_to_remove; char* _name_to_remove;
} FILE; } FILE;
#define _FILE_DEFINED #define _FILE_DEFINED
#endif #endif
@ -100,16 +103,15 @@ typedef struct {
* The three standard file pointers provided by the run time library. * The three standard file pointers provided by the run time library.
* NOTE: These will go to the bit-bucket silently in GUI applications! * NOTE: These will go to the bit-bucket silently in GUI applications!
*/ */
extern FILE _iob[]; /* an array of FILE */ extern FILE _iob[]; /* an array of FILE */
#define stdin (&_iob[0]) #define stdin (&_iob[0])
#define stdout (&_iob[1]) #define stdout (&_iob[1])
#define stderr (&_iob[2]) #define stderr (&_iob[2])
#define stdaux (&_iob[3]) #define stdaux (&_iob[3])
#define stdprn (&_iob[4]) #define stdprn (&_iob[4])
/* Returned by various functions on end of file condition or error. */ /* Returned by various functions on end of file condition or error. */
#define EOF (-1) #define EOF (-1)
/* /*
* The maximum length of a file name. You should use GetVolumeInformation * The maximum length of a file name. You should use GetVolumeInformation
@ -118,45 +120,39 @@ extern FILE _iob[]; /* an array of FILE */
* NOTE: This is used in the structure _finddata_t (see dir.h) so changing it * NOTE: This is used in the structure _finddata_t (see dir.h) so changing it
* is probably not a good idea. * is probably not a good idea.
*/ */
#define FILENAME_MAX (260) #define FILENAME_MAX (260)
/* /*
* The maximum number of files that may be open at once. I have set this to * The maximum number of files that may be open at once. I have set this to
* a conservative number. The actual value may be higher. * a conservative number. The actual value may be higher.
*/ */
#define FOPEN_MAX (20) #define FOPEN_MAX (20)
/* /*
* File Operations * File Operations
*/ */
FILE* _fdopen(int handle, char *mode); FILE* fopen(const char* szFileName, const char* szMode);
FILE* _wfdopen(int handle, wchar_t *mode); FILE* freopen(const char* szNewFileName, const char* szNewMode, FILE* fileChangeAssociation);
int fflush(FILE* fileFlush);
int fclose(FILE* fileClose);
#define fcloseall _fcloseall
int remove(const char* szFileName);
int rename(const char* szOldFileName, const char* szNewFileName);
FILE* tmpfile(void);
FILE* fopen (const char* szFileName, const char* szMode); FILE* _fdopen(int handle, char *mode);
FILE* _wfopen(const wchar_t *file, const wchar_t *mode); FILE* _wfdopen(int handle, wchar_t *mode);
FILE* _wfopen(const wchar_t *file, const wchar_t *mode);
FILE* freopen(const char* szNewFileName, const char* szNewMode, FILE* _wfreopen(const wchar_t *file, const wchar_t *mode, FILE *f);
FILE* fileChangeAssociation); FILE* _fsopen(const char *file, const char *mode, int shflag);
FILE* _wfreopen(const wchar_t *file, const wchar_t *mode, FILE *f); FILE* _wfsopen(const wchar_t *file, const wchar_t *mode, int shflag);
int _wremove(const wchar_t* szFileName);
FILE* _fsopen(const char *file, const char *mode, int shflag); int _wrename(const wchar_t *oldName, const wchar_t *newName);
FILE* _wfsopen(const wchar_t *file, const wchar_t *mode, int shflag);
int fflush(FILE* fileFlush);
int fclose(FILE* fileClose);
#define fcloseall _fcloseall
int remove(const char* szFileName);
int _wremove(const wchar_t* szFileName);
int rename(const char* szOldFileName, const char* szNewFileName);
int _wrename(const wchar_t *oldName, const wchar_t *newName);
FILE* tmpfile(void);
int _filbuf(FILE *f);
int _flsbuf(int c, FILE *f);
void _fwalk(void (*func)(FILE *)); // not exported
int _fcloseall(void);
int _filbuf(FILE* f);
int _flsbuf(int c, FILE* f);
void _fwalk(void (*func)(FILE*)); // not exported
int _fcloseall(void);
/* /*
* The maximum size of name (including NUL) that will be put in the user * The maximum size of name (including NUL) that will be put in the user
@ -165,16 +161,16 @@ int _fcloseall(void);
* maximum file name length above it is probably reasonable. I could be * maximum file name length above it is probably reasonable. I could be
* wrong... * wrong...
*/ */
#define L_tmpnam (260) #define L_tmpnam (260)
char* tmpnam(char caName[]);
char* _tempnam(const char *szDir, const char *szPfx);
char* tmpnam (char caName[]);
wchar_t* _wtmpnam(wchar_t *s); wchar_t* _wtmpnam(wchar_t *s);
char* _tempnam (const char *szDir, const char *szPfx);
wchar_t *_wtempnam(const wchar_t *dir,const wchar_t *prefix); wchar_t *_wtempnam(const wchar_t *dir,const wchar_t *prefix);
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
#define tempnam _tempnam #define tempnam _tempnam
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
/* /*
@ -182,120 +178,118 @@ wchar_t *_wtempnam(const wchar_t *dir,const wchar_t *prefix);
* NOTE: _IOFBF works, but _IOLBF seems to work like unbuffered... * NOTE: _IOFBF works, but _IOLBF seems to work like unbuffered...
* maybe I'm testing it wrong? * maybe I'm testing it wrong?
*/ */
#define _IOFBF 0 /* fully buffered */ #define _IOFBF 0 /* fully buffered */
#define _IOLBF 1 /* line buffered */ #define _IOLBF 1 /* line buffered */
#define _IONBF 2 /* unbuffered */ #define _IONBF 2 /* unbuffered */
int setvbuf (FILE* fileSetBuffer, char* caBuffer, int nMode,
size_t sizeBuffer);
int setvbuf(FILE* fileSetBuffer, char* caBuffer, int nMode, size_t sizeBuffer);
/* /*
* The buffer size as used by setbuf such that it is equivalent to * The buffer size as used by setbuf such that it is equivalent to
* (void) setvbuf(fileSetBuffer, caBuffer, _IOFBF, BUFSIZ). * (void) setvbuf(fileSetBuffer, caBuffer, _IOFBF, BUFSIZ).
*/ */
#define BUFSIZ 512 #define BUFSIZ 512
void setbuf (FILE* fileSetBuffer, char* caBuffer); void setbuf(FILE* fileSetBuffer, char* caBuffer);
/* /*
* Pipe Operations * Pipe Operations
*/ */
int _pclose (FILE* pipeClose); int _pclose(FILE* pipeClose);
FILE* _popen (const char* szPipeName, const char* szMode); FILE* _popen(const char* szPipeName, const char* szMode);
FILE* _wpopen (const wchar_t *cm, const wchar_t *md); FILE* _wpopen(const wchar_t *cm, const wchar_t *md);
#define popen _popen #define popen _popen
#define pclose _pclose #define pclose _pclose
/* Wide character version */ /* Wide character version */
FILE* _wpopen (const wchar_t* szPipeName, const wchar_t* szMode); FILE* _wpopen(const wchar_t* szPipeName, const wchar_t* szMode);
/* /*
* Formatted Output * Formatted Output
*/ */
int fprintf (FILE* filePrintTo, const char* szFormat, ...); int fprintf(FILE* filePrintTo, const char* szFormat, ...);
int printf (const char* szFormat, ...); int printf(const char* szFormat, ...);
int sprintf (char* caBuffer, const char* szFormat, ...); int sprintf(char* caBuffer, const char* szFormat, ...);
int vfprintf (FILE* filePrintTo, const char* szFormat, va_list varg); int vfprintf(FILE* filePrintTo, const char* szFormat, va_list varg);
int vprintf (const char* szFormat, va_list varg); int vprintf(const char* szFormat, va_list varg);
int vsprintf (char* caBuffer, const char* szFormat, va_list varg); int vsprintf(char* caBuffer, const char* szFormat, va_list varg);
/* Wide character versions */ /* Wide character versions */
int fwprintf (FILE* filePrintTo, const wchar_t* wsFormat, ...); int fwprintf(FILE* filePrintTo, const wchar_t* wsFormat, ...);
int wprintf (const wchar_t* wsFormat, ...); int wprintf(const wchar_t* wsFormat, ...);
int swprintf (wchar_t* wcaBuffer, const wchar_t* wsFormat, ...); int swprintf(wchar_t* wcaBuffer, const wchar_t* wsFormat, ...);
int vfwprintf (FILE* filePrintTo, const wchar_t* wsFormat, va_list varg); int vfwprintf(FILE* filePrintTo, const wchar_t* wsFormat, va_list varg);
int vwprintf (const wchar_t* wsFormat, va_list varg); int vwprintf(const wchar_t* wsFormat, va_list varg);
int vswprintf (wchar_t* wcaBuffer, const wchar_t* wsFormat, va_list varg); int vswprintf(wchar_t* wcaBuffer, const wchar_t* wsFormat, va_list varg);
/* /*
* Formatted Input * Formatted Input
*/ */
int fscanf (FILE* fileReadFrom, const char* szFormat, ...); int fscanf(FILE* fileReadFrom, const char* szFormat, ...);
int scanf (const char* szFormat, ...); int scanf(const char* szFormat, ...);
int sscanf (const char* szReadFrom, const char* szFormat, ...); int sscanf(const char* szReadFrom, const char* szFormat, ...);
/* Wide character versions */ /* Wide character versions */
int fwscanf (FILE* fileReadFrom, const wchar_t* wsFormat, ...); int fwscanf(FILE* fileReadFrom, const wchar_t* wsFormat, ...);
int wscanf (const wchar_t* wsFormat, ...); int wscanf(const wchar_t* wsFormat, ...);
int swscanf (const wchar_t* wsReadFrom, const wchar_t* wsFormat, ...); int swscanf(const wchar_t* wsReadFrom, const wchar_t* wsFormat, ...);
/* /*
* Character Input and Output Functions * Character Input and Output Functions
*/ */
int fgetc (FILE* fileRead); int fgetc(FILE* fileRead);
char* fgets (char* caBuffer, int nBufferSize, FILE* fileRead); char* fgets(char* caBuffer, int nBufferSize, FILE* fileRead);
int fputc (int c, FILE* fileWrite); int fputc(int c, FILE* fileWrite);
int fputs (const char* szOutput, FILE* fileWrite); int fputs(const char* szOutput, FILE* fileWrite);
int getc (FILE* fileRead); int getc(FILE* fileRead);
int getchar (void); int getchar(void);
char* gets (char* caBuffer); /* Unsafe: how does gets know how long the char* gets(char* caBuffer); /* Unsafe: how does gets know how long the buffer is? */
* buffer is? */ int putc(int c, FILE* fileWrite);
int putc (int c, FILE* fileWrite); int putchar(int c);
int putchar (int c); int puts(const char* szOutput);
int puts (const char* szOutput); int ungetc(int c, FILE* fileWasRead);
int ungetc (int c, FILE* fileWasRead);
/* Wide character versions */ /* Wide character versions */
wint_t fgetwc (FILE* fileRead); wint_t fgetwc(FILE* fileRead);
wint_t fputwc (wchar_t wc, FILE* fileWrite); wint_t fputwc(wchar_t wc, FILE* fileWrite);
wint_t getwc (FILE *fileRead); wint_t getwc(FILE *fileRead); // not exported from crtdll
wint_t putwc (wint_t wc, FILE* fileWrite);
wint_t putwchar (wint_t c);
int _putws (const wchar_t* ws);
wint_t ungetwc (wchar_t wc, FILE* fileWasRead);
wint_t _filwbuf(FILE *f); // TODO: check type wint_t, why doesn't compare to WEOF correctly ???
wint_t _flswbuf(wchar_t c, FILE *f); //wint_t putwc(wint_t wc, FILE* fileWrite);
int putwc(wint_t wc, FILE* fileWrite);
wint_t putwchar(wint_t c);
int _putws(const wchar_t* ws);
wint_t ungetwc(wchar_t wc, FILE* fileWasRead);
wint_t _filwbuf(FILE *f);
wint_t _flswbuf(wchar_t c, FILE *f);
/* /*
* Not exported by CRTDLL.DLL included for reference purposes. * Not exported by CRTDLL.DLL included for reference purposes.
*/ */
#if 0 #if 0
wchar_t* fgetws (wchar_t* wcaBuffer, int nBufferSize, FILE* fileRead); wchar_t* fgetws(wchar_t* wcaBuffer, int nBufferSize, FILE* fileRead);
int fputws (const wchar_t* wsOutput, FILE* fileWrite); int fputws(const wchar_t* wsOutput, FILE* fileWrite);
int getwc (FILE* fileRead); int getwc(FILE* fileRead);
int getwchar (); int getwchar();
wchar_t* getws (wchar_t* wcaBuffer); wchar_t* getws(wchar_t* wcaBuffer);
#endif /* 0 */ #endif /* 0 */
/* NOTE: putchar has no wide char equivalent even in tchar.h */ /* NOTE: putchar has no wide char equivalent even in tchar.h */
/* /*
* Direct Input and Output Functions * Direct Input and Output Functions
*/ */
size_t fread (void* pBuffer, size_t sizeObject, size_t sizeObjCount, size_t fread(void* pBuffer, size_t sizeObject, size_t sizeObjCount, FILE* fileRead);
FILE* fileRead); size_t fwrite(const void* pObjArray, size_t sizeObject, size_t sizeObjCount, FILE* fileWrite);
size_t fwrite (const void* pObjArray, size_t sizeObject, size_t sizeObjCount,
FILE* fileWrite);
/* /*
* File Positioning Functions * File Positioning Functions
@ -304,21 +298,21 @@ size_t fwrite (const void* pObjArray, size_t sizeObject, size_t sizeObjCount,
/* Constants for nOrigin indicating the position relative to which fseek /* Constants for nOrigin indicating the position relative to which fseek
* sets the file position. Enclosed in ifdefs because io.h could also * sets the file position. Enclosed in ifdefs because io.h could also
* define them. (Though not anymore since io.h includes this file now.) */ * define them. (Though not anymore since io.h includes this file now.) */
#ifndef SEEK_SET #ifndef SEEK_SET
#define SEEK_SET (0) #define SEEK_SET (0)
#endif #endif
#ifndef SEEK_CUR #ifndef SEEK_CUR
#define SEEK_CUR (1) #define SEEK_CUR (1)
#endif #endif
#ifndef SEEK_END #ifndef SEEK_END
#define SEEK_END (2) #define SEEK_END (2)
#endif #endif
int fseek (FILE* fileSetPosition, long lnOffset, int nOrigin); int fseek(FILE* fileSetPosition, long lnOffset, int nOrigin);
long ftell (FILE* fileGetPosition); long ftell(FILE* fileGetPosition);
void rewind (FILE* fileRewind); void rewind(FILE* fileRewind);
/* /*
* An opaque data type used for storing file positions... The contents of * An opaque data type used for storing file positions... The contents of
@ -328,45 +322,45 @@ void rewind (FILE* fileRewind);
* it is fairly evident that the fpos_t type is a long (in CRTDLL.DLL). * it is fairly evident that the fpos_t type is a long (in CRTDLL.DLL).
* Perhaps an unsigned long? TODO? * Perhaps an unsigned long? TODO?
*/ */
typedef long fpos_t; typedef long fpos_t;
int fgetpos (FILE* fileGetPosition, fpos_t* pfpos);
int fsetpos (FILE* fileSetPosition, const fpos_t* pfpos);
int fgetpos(FILE* fileGetPosition, fpos_t* pfpos);
int fsetpos(FILE* fileSetPosition, const fpos_t* pfpos);
/* /*
* Error Functions * Error Functions
*/ */
#if 0 #if 0
void clearerr (FILE* fileClearErrors); void clearerr(FILE* fileClearErrors);
int feof (FILE* fileIsAtEnd); int feof(FILE* fileIsAtEnd);
int ferror (FILE* fileIsError); int ferror(FILE* fileIsError);
void perror (const char* szErrorMessage); void perror(const char* szErrorMessage);
#endif #endif
void _wperror(const wchar_t *s); void _wperror(const wchar_t *s);
#define clearerr(f) (((f)->_flag) &= ~(_IOERR|_IOEOF))
#define feof(f) (((f)->_flag&_IOEOF)!=0)
//#define ferror(f) (((f)->_flag&_IOERR)!=0)
int ferror(FILE* fileIsError);
#define perror(s) (fprintf(stderr, "%s: %s\n", (s), _strerror(NULL)))
#define clearerr(f) (((f)->_flag) &= ~(_IOERR|_IOEOF))
#define feof(f) (((f)->_flag&_IOEOF)!=0)
#define ferror(f) (((f)->_flag&_IOERR)!=0)
#define perror(s) (fprintf(stderr, "%s: %s\n", (s), _strerror(NULL)))
/* /*
* Non ANSI functions * Non ANSI functions
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
int _fgetchar (void); int _fgetchar(void);
int _fputchar (int c); int _fputchar(int c);
FILE* _fdopen (int nHandle, char* szMode); FILE* _fdopen(int nHandle, char* szMode);
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
#define fgetchar _fgetchar #define fgetchar _fgetchar
#define fputchar _fputchar #define fputchar _fputchar
#define fdopen _fdopen #define fdopen _fdopen
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -15,12 +15,12 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.4 $ * $Revision: 1.5 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 10:22:31 $ * $Date: 2002/11/24 18:06:00 $
* *
*/ */
/* Appropriated for Reactos Crtdll by Ariadne */ /* Appropriated for Reactos Crtdll by Ariadne */
@ -30,6 +30,23 @@
#ifndef _STDLIB_H_ #ifndef _STDLIB_H_
#define _STDLIB_H_ #define _STDLIB_H_
#define __need_size_t
#define __need_wchar_t
#define __need_NULL
#include <msvcrt/stddef.h>
/*
* RAND_MAX is the maximum value that may be returned by rand.
* The minimum is zero.
*/
#define RAND_MAX 0x7FFF
/*
* These values may be used as exit status codes.
*/
#define EXIT_SUCCESS 0
#define EXIT_FAILURE -1
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -40,92 +57,69 @@ extern "C" {
* argc and argv. environ is a pointer to a table of environment variables. * argc and argv. environ is a pointer to a table of environment variables.
* NOTE: Strings in _argv and environ are ANSI strings. * NOTE: Strings in _argv and environ are ANSI strings.
*/ */
extern int* __argc_dll; extern int* __argc_dll;
extern char*** __argv_dll; extern char*** __argv_dll;
extern char*** _environ_dll; extern char*** _environ_dll;
#define __argc (*__argc_dll)
#define __argv (*__argv_dll)
#define _environ (*_environ_dll)
#define __argc (*__argc_dll)
#define __argv (*__argv_dll)
#define _environ (*_environ_dll)
#define __need_size_t
#define __need_wchar_t
#define __need_NULL
#include <msvcrt/stddef.h>
#include <msvcrt/mbstring.h> #include <msvcrt/mbstring.h>
#ifndef __ATTRIB_NORETURN #ifndef __ATTRIB_NORETURN
#ifdef __GNUC__ #ifdef __GNUC__
#define _ATTRIB_NORETURN __attribute__ ((noreturn)) #define _ATTRIB_NORETURN __attribute__ ((noreturn))
#ifndef __int64 #ifndef __int64
#define __int64 long long #define __int64 long long
#endif /* Not __int64 */ #endif /* Not __int64 */
#else /* Not __GNUC__ */ #else /* Not __GNUC__ */
#define _ATTRIB_NORETURN #define _ATTRIB_NORETURN
#endif /* __GNUC__ */ #endif /* __GNUC__ */
#endif #endif
double atof (const char* szNumber); double atof(const char* szNumber);
int atoi (const char* szNumber); int atoi(const char* szNumber);
long atol (const char* szNumber); long atol(const char* szNumber);
double strtod(const char* szNumber, char** pszAfterNumber);
double wcstod(const wchar_t* wsNumber, wchar_t** pwsAfterNumber);
long strtol(const char* szNumber, char** pszAfterNumber, int nBase);
long wcstol(const wchar_t* wsNumber, wchar_t** pwsAfterNumber, int nBase);
double strtod (const char* szNumber, char** pszAfterNumber); unsigned long strtoul(const char* szNumber, char** pszAfterNumber, int nBase);
double wcstod (const wchar_t* wsNumber, wchar_t** pwsAfterNumber); unsigned long wcstoul(const wchar_t* wsNumber, wchar_t** pwsAfterNumber, int nBase);
long strtol (const char* szNumber, char** pszAfterNumber, int nBase);
long wcstol (const wchar_t* wsNumber, wchar_t** pwsAfterNumber, int nBase);
unsigned long strtoul (const char* szNumber, char** pszAfterNumber, size_t wcstombs(char* mbsDest, const wchar_t* wsConvert, size_t size);
int nBase); int wctomb(char* mbDest, wchar_t wc);
unsigned long wcstoul (const wchar_t* wsNumber, wchar_t** pwsAfterNumber, int mblen(const char* mbs, size_t sizeString);
int nBase); size_t mbstowcs(wchar_t* wcaDest, const char* mbsConvert, size_t size);
int mbtowc(wchar_t* wcDest, const char* mbConvert, size_t size);
size_t wcstombs (char* mbsDest, const wchar_t* wsConvert, size_t size); int rand(void);
int wctomb (char* mbDest, wchar_t wc); void srand(unsigned int nSeed);
int mblen (const char* mbs, size_t sizeString); void* calloc(size_t sizeObjCnt, size_t sizeObject);
size_t mbstowcs (wchar_t* wcaDest, const char* mbsConvert, void* malloc(size_t sizeObject);
size_t size); void* realloc(void* pObject, size_t sizeNew);
int mbtowc (wchar_t* wcDest, const char* mbConvert, size_t size); void free(void* pObject);
void abort(void) _ATTRIB_NORETURN;
void exit(int nStatus) _ATTRIB_NORETURN;
int atexit(void (*pfuncExitProcessing)(void));
/* int system(const char* szCommand); // impl in process
* RAND_MAX is the maximum value that may be returned by rand. char* getenv(const char* szVarName); // impl in stdio ???
* The minimum is zero. wchar_t* _wgetenv(const wchar_t* szVarName);
*/
#define RAND_MAX 0x7FFF
int rand (void); typedef int (*_pfunccmp_t)(const void*, const void*);
void srand (unsigned int nSeed);
void* bsearch(const void* pKey, const void* pBase, size_t cntObjects, size_t sizeObject, _pfunccmp_t pfuncCmp);
void qsort(const void* pBase, size_t cntObjects, size_t sizeObject, _pfunccmp_t pfuncCmp);
void* calloc (size_t sizeObjCnt, size_t sizeObject); int abs(int n);
void* malloc (size_t sizeObject); long labs(long n);
void* realloc (void* pObject, size_t sizeNew);
void free (void* pObject);
/* These values may be used as exit status codes. */
#define EXIT_SUCCESS 0
#define EXIT_FAILURE -1
void abort (void) _ATTRIB_NORETURN;
void exit (int nStatus) _ATTRIB_NORETURN;
int atexit (void (*pfuncExitProcessing)(void));
int system (const char* szCommand); // impl in process
char* getenv (const char* szVarName);
wchar_t* _wgetenv (const wchar_t* szVarName);
typedef int (*_pfunccmp_t)(const void*, const void*);
void* bsearch (const void* pKey, const void* pBase, size_t cntObjects,
size_t sizeObject, _pfunccmp_t pfuncCmp);
void qsort (const void* pBase, size_t cntObjects, size_t sizeObject,
_pfunccmp_t pfuncCmp);
int abs (int n);
long labs (long n);
/* /*
* div_t and ldiv_t are structures used to return the results of div and * div_t and ldiv_t are structures used to return the results of div and
@ -137,96 +131,99 @@ long labs (long n);
*/ */
typedef struct { int quot, rem; } div_t; typedef struct { int quot, rem; } div_t;
typedef struct { long quot, rem; } ldiv_t; typedef struct { long quot, rem; } ldiv_t;
#ifdef __GNUC__ // robd
typedef struct { long long quot, rem; } lldiv_t; typedef struct { long long quot, rem; } lldiv_t;
#else
typedef struct { double quot, rem; } lldiv_t;
#endif
div_t div (int nNumerator, int nDenominator); div_t div(int nNumerator, int nDenominator);
ldiv_t ldiv (long lNumerator, long lDenominator); ldiv_t ldiv(long lNumerator, long lDenominator);
lldiv_t lldiv (long long lNumerator, long long lDenominator);
#ifdef __GNUC__ // robd
lldiv_t lldiv(long long lNumerator, long long lDenominator);
#else
lldiv_t lldiv(double lNumerator, double lDenominator);
#endif
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
/* /*
* NOTE: Officially the three following functions are obsolete. The Win32 API * NOTE: Officially the three following functions are obsolete. The Win32 API
* functions SetErrorMode, Beep and Sleep are their replacements. * functions SetErrorMode, Beep and Sleep are their replacements.
*/ */
void _beep (unsigned int, unsigned int); void _beep(unsigned int, unsigned int);
void _seterrormode (int nMode); void _seterrormode(int nMode);
void _sleep (unsigned long ulTime); void _sleep(unsigned long ulTime);
void _exit (int nStatus) _ATTRIB_NORETURN; void _exit(int nStatus) _ATTRIB_NORETURN;
int _putenv (const char *val); int _putenv(const char *val);
int _wputenv(const wchar_t *val); void _searchenv(const char *file, const char *var, char *path);
void _searchenv (const char *file, const char *var, char *path); void _splitpath(const char *path, char *drive, char *dir, char *fname, char *ext);
void _wsearchenv (const wchar_t *file, const wchar_t *var, wchar_t *path);
void _makepath( char *path, const char *drive, const char *dir, char* _itoa(int nValue, char* sz, int nRadix);
const char *fname, const char *ext ); char* _ltoa(long lnValue, char* sz, int nRadix);
void _wmakepath( wchar_t *path, const wchar_t *drive, const wchar_t *dir,
const wchar_t *fname, const wchar_t *ext );
void _splitpath( const char *path, char *drive, char *dir,
char *fname, char *ext );
char* _fullpath( char* caBuf, const char* szPath, size_t sizeMax );
wchar_t *_wfullpath( wchar_t *absPath, const wchar_t *relPath, size_t maxLength );
char* _itoa (int nValue, char* sz, int nRadix); int _wputenv(const wchar_t *val);
char* _i64toa(__int64 value, char *string, int radix); void _wsearchenv(const wchar_t *file, const wchar_t *var, wchar_t *path);
char* _ltoa (long lnValue, char* sz, int nRadix); void _makepath(char *path, const char *drive, const char *dir, const char *fname, const char *ext);
char* _ultoa(unsigned long value, char *string, int radix); void _wmakepath(wchar_t *path, const wchar_t *drive, const wchar_t *dir, const wchar_t *fname, const wchar_t *ext);
char* _ui64toa(unsigned __int64 value, char *string, int radix); wchar_t* _wfullpath(wchar_t *absPath, const wchar_t *relPath, size_t maxLength);
char* _i64toa(__int64 value, char *string, int radix);
char* _ultoa(unsigned long value, char *string, int radix);
char* _ui64toa(unsigned __int64 value, char *string, int radix);
wchar_t* _itow (int nValue, wchar_t* sz, int nRadix); wchar_t* _itow(int nValue, wchar_t* sz, int nRadix);
wchar_t* _i64tow(__int64 value, wchar_t *string, int radix); wchar_t* _i64tow(__int64 value, wchar_t *string, int radix);
wchar_t* _ltow (long lnValue, wchar_t* sz, int nRadix); wchar_t* _ltow(long lnValue, wchar_t* sz, int nRadix);
wchar_t* _ultow(unsigned long value, wchar_t *string, int radix); wchar_t* _ultow(unsigned long value, wchar_t *string, int radix);
wchar_t* _ui64tow(unsigned __int64 value, wchar_t *string, int radix); wchar_t* _ui64tow(unsigned __int64 value, wchar_t *string, int radix);
__int64 _atoi64(const char *szNumber);
int _wtoi(const wchar_t *str);
__int64 _wtoi64(const wchar_t *str);
long _wtol(const wchar_t *str);
char* _ecvt (double dValue, int nDig, int* pnDec, int* pnSign); char* _ecvt(double dValue, int nDig, int* pnDec, int* pnSign);
char* _fcvt (double dValue, int nDig, int* pnDec, int* pnSign); char* _fcvt(double dValue, int nDig, int* pnDec, int* pnSign);
char* _gcvt (double dValue, int nDec, char* caBuf); char* _gcvt(double dValue, int nDec, char* caBuf);
char* _fullpath(char* caBuf, const char* szPath, size_t sizeMax);
void _swab(const char* caFrom, char* caTo, size_t sizeToCopy);
void _swab (const char* caFrom, char* caTo, size_t sizeToCopy); unsigned int _rotl(unsigned int value, int shift);
unsigned int _rotr(unsigned int value, int shift);
unsigned int _rotl( unsigned int value, int shift ); unsigned long _lrotl(unsigned long value, int shift);
unsigned int _rotr( unsigned int value, int shift ); unsigned long _lrotr(unsigned long value, int shift);
unsigned long _lrotl( unsigned long value, int shift );
unsigned long _lrotr( unsigned long value, int shift );
__int64 _atoi64(const char *szNumber);
int _wtoi( const wchar_t *str );
__int64 _wtoi64(const wchar_t *str);
long _wtol( const wchar_t *str );
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
#define beep _beep #define beep _beep
#define seterrormode _seterrormode #define seterrormode _seterrormode
#define sleep _sleep #define sleep _sleep
#define putenv _putenv #define putenv _putenv
#define searchenv _searchenv #define searchenv _searchenv
#define splitpath _splitpath #define splitpath _splitpath
#define itoa _itoa
#define ltoa _ltoa
#define ecvt _ecvt
#define fcvt _fcvt
#define gcvt _gcvt
#define swab _swab
#endif /* Not _NO_OLDNAMES */
#define itoa _itoa
#define ltoa _ltoa
#define ecvt _ecvt #endif /* Not __STRICT_ANSI__ */
#define fcvt _fcvt
#define gcvt _gcvt
#define swab _swab
#endif /* Not _NO_OLDNAMES */
#endif /* Not __STRICT_ANSI__ */
/* /*
* Undefine the no return attribute used in some function definitions * Undefine the no return attribute used in some function definitions
*/ */
#undef _ATTRIB_NORETURN #undef _ATTRIB_NORETURN
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _STDLIB_H_ */ #endif /* Not _STDLIB_H_ */

View file

@ -15,12 +15,12 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.4 $ * $Revision: 1.5 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 10:22:31 $ * $Date: 2002/11/24 18:06:00 $
* *
*/ */
/* Appropriated for Reactos Crtdll by Ariadne */ /* Appropriated for Reactos Crtdll by Ariadne */
@ -29,124 +29,118 @@
#ifndef _STRING_H_ #ifndef _STRING_H_
#define _STRING_H_ #define _STRING_H_
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* Define size_t, wchar_t and NULL * Define size_t, wchar_t and NULL
*/ */
#define __need_size_t #define __need_size_t
#define __need_wchar_t #define __need_wchar_t
#define __need_NULL #define __need_NULL
#include <msvcrt/stddef.h> #include <msvcrt/stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
char * ___strtok; // removed extern specifier 02-06-98, BD char * ___strtok; // removed extern specifier 02-06-98, BD
/* /*
* Prototypes of the ANSI Standard C library string functions. * Prototypes of the ANSI Standard C library string functions.
*/ */
void* memchr (const void* p, int cSearchFor, size_t sizeSearch); void* memchr(const void* p, int cSearchFor, size_t sizeSearch);
int memcmp (const void* p1, const void* p2, size_t sizeSearch); int memcmp(const void* p1, const void* p2, size_t sizeSearch);
void* memcpy (void* pCopyTo, const void* pSource, size_t sizeSource); void* memcpy(void* pCopyTo, const void* pSource, size_t sizeSource);
void* memmove (void* pMoveTo, const void* pSource, size_t sizeSource); void* memmove(void* pMoveTo, const void* pSource, size_t sizeSource);
void* memset (void* p, int cFill, size_t sizeRepeatCount); void* memset(void* p, int cFill, size_t sizeRepeatCount);
char* strcat (char* szAddTo, const char* szAdd); char* strcat(char* szAddTo, const char* szAdd);
char* strchr (const char* szSearch, int cFor); char* strchr(const char* szSearch, int cFor);
int strcmp (const char* sz1, const char* sz2); int strcmp(const char* sz1, const char* sz2);
int strcoll (const char* sz1, const char* sz2); /* Compare using locale */ int strcoll(const char* sz1, const char* sz2); /* Compare using locale */
char* strcpy (char* szCopyTo, const char* szSource); char* strcpy(char* szCopyTo, const char* szSource);
size_t strcspn (const char* szGetPrefix, const char* szNotIncluding); size_t strcspn(const char* szGetPrefix, const char* szNotIncluding);
char* strerror (int nError); /* NOTE: NOT an old name wrapper. */ char* strerror(int nError); /* NOTE: NOT an old name wrapper. */
char * _strerror(const char *s); char * _strerror(const char *s);
size_t strlen (const char* sz); size_t strlen(const char* sz);
size_t strnlen (const char* sz, size_t count); // not exported size_t strnlen(const char* sz, size_t count); // not exported
char* strncat (char* szAddTo, const char* szAdd, size_t sizeMaxAdd); char* strncat(char* szAddTo, const char* szAdd, size_t sizeMaxAdd);
int strncmp (const char* sz1, const char* sz2, size_t sizeMaxCompare); int strncmp(const char* sz1, const char* sz2, size_t sizeMaxCompare);
char* strncpy (char* szCopyTo, const char* szSource, size_t sizeMaxCopy); char* strncpy(char* szCopyTo, const char* szSource, size_t sizeMaxCopy);
char* strpbrk (const char* szSearch, const char* szAnyOf); char* strpbrk(const char* szSearch, const char* szAnyOf);
char* strrchr (const char* szSearch, int cFor); char* strrchr(const char* szSearch, int cFor);
size_t strspn (const char* szGetPrefix, const char *szIncluding); size_t strspn(const char* szGetPrefix, const char *szIncluding);
char* strstr (const char* szSearch, const char *szFor); char* strstr(const char* szSearch, const char *szFor);
char* strtok (char* szTokenize, const char* szDelimiters); char* strtok(char* szTokenize, const char* szDelimiters);
size_t strxfrm (char* szTransformed, const char *szSource, size_t strxfrm(char* szTransformed, const char *szSource, size_t sizeTransform);
size_t sizeTransform);
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
/* /*
* Extra non-ANSI functions provided by the CRTDLL library * Extra non-ANSI functions provided by the CRTDLL library
*/ */
void* _memccpy (void* pCopyTo, const void* pSource, int cTerminator, void* _memccpy(void* pCopyTo, const void* pSource, int cTerminator, size_t sizeMaxCopy);
size_t sizeMaxCopy); int _memicmp(const void* p1, const void* p2, size_t sizeSearch);
int _memicmp (const void* p1, const void* p2, size_t sizeSearch); char* _strdup(const char *szDuplicate);
char* _strdup (const char *szDuplicate); int _strcmpi(const char* sz1, const char* sz2);
int _strcmpi (const char* sz1, const char* sz2); int _stricmp(const char* sz1, const char* sz2);
int _stricmp (const char* sz1, const char* sz2); int _stricoll(const char* sz1, const char* sz2);
int _stricoll (const char* sz1, const char* sz2); char* _strlwr(char* szToConvert);
char* _strlwr (char* szToConvert); int _strnicmp(const char* sz1, const char* sz2, size_t sizeMaxCompare);
int _strnicmp (const char* sz1, const char* sz2, char* _strnset(char* szToFill, int cFill, size_t sizeMaxFill);
size_t sizeMaxCompare); char* _strrev(char* szToReverse);
char* _strnset (char* szToFill, int cFill, size_t sizeMaxFill); char* _strset(char* szToFill, int cFill);
char* _strrev (char* szToReverse); char* _strupr(char* szToConvert);
char* _strset (char* szToFill, int cFill);
char* _strupr (char* szToConvert);
#endif /* Not __STRICT_ANSI__ */
#endif /* Not __STRICT_ANSI__ */
/* /*
* Unicode versions of the standard calls. * Unicode versions of the standard calls.
*/ */
wchar_t* wcscat (wchar_t* wsAddTo, const wchar_t* wsAdd); wchar_t* wcscat(wchar_t* wsAddTo, const wchar_t* wsAdd);
wchar_t* wcschr (const wchar_t* wsSearch, wchar_t wcFor); wchar_t* wcschr(const wchar_t* wsSearch, wchar_t wcFor);
int wcscmp (const wchar_t* ws1, const wchar_t* ws2); int wcscmp(const wchar_t* ws1, const wchar_t* ws2);
int wcscoll (const wchar_t* ws1, const wchar_t* ws2); int wcscoll(const wchar_t* ws1, const wchar_t* ws2);
wchar_t* wcscpy (wchar_t* wsCopyTo, const wchar_t* wsSource); wchar_t* wcscpy(wchar_t* wsCopyTo, const wchar_t* wsSource);
size_t wcscspn (const wchar_t* wsGetPrefix, const wchar_t* wsNotIncluding); size_t wcscspn(const wchar_t* wsGetPrefix, const wchar_t* wsNotIncluding);
/* Note: No wcserror in CRTDLL. */ /* Note: No wcserror in CRTDLL. */
size_t wcslen (const wchar_t* ws); size_t wcslen(const wchar_t* ws);
wchar_t* wcsncat (wchar_t* wsAddTo, const wchar_t* wsAdd, size_t sizeMaxAdd); wchar_t* wcsncat(wchar_t* wsAddTo, const wchar_t* wsAdd, size_t sizeMaxAdd);
int wcsncmp(const wchar_t* ws1, const wchar_t* ws2, size_t sizeMaxCompare); int wcsncmp(const wchar_t* ws1, const wchar_t* ws2, size_t sizeMaxCompare);
wchar_t* wcsncpy(wchar_t* wsCopyTo, const wchar_t* wsSource, wchar_t* wcsncpy(wchar_t* wsCopyTo, const wchar_t* wsSource, size_t sizeMaxCopy);
size_t sizeMaxCopy);
wchar_t* wcspbrk(const wchar_t* wsSearch, const wchar_t* wsAnyOf); wchar_t* wcspbrk(const wchar_t* wsSearch, const wchar_t* wsAnyOf);
wchar_t* wcsrchr(const wchar_t* wsSearch, wchar_t wcFor); wchar_t* wcsrchr(const wchar_t* wsSearch, wchar_t wcFor);
size_t wcsspn(const wchar_t* wsGetPrefix, const wchar_t* wsIncluding); size_t wcsspn(const wchar_t* wsGetPrefix, const wchar_t* wsIncluding);
wchar_t* wcsstr(const wchar_t* wsSearch, const wchar_t* wsFor); wchar_t* wcsstr(const wchar_t* wsSearch, const wchar_t* wsFor);
wchar_t* wcstok(wchar_t* wsTokenize, const wchar_t* wsDelimiters); wchar_t* wcstok(wchar_t* wsTokenize, const wchar_t* wsDelimiters);
size_t wcsxfrm(wchar_t* wsTransformed, const wchar_t *wsSource, size_t wcsxfrm(wchar_t* wsTransformed, const wchar_t *wsSource, size_t sizeTransform);
size_t sizeTransform);
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
/* /*
* Unicode versions of non-ANSI functions provided by CRTDLL. * Unicode versions of non-ANSI functions provided by CRTDLL.
*/ */
/* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */ /* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */
#define _wcscmpi _wcsicmp #define _wcscmpi _wcsicmp
wchar_t* _wcsdup (const wchar_t* wsToDuplicate); wchar_t* _wcsdup(const wchar_t* wsToDuplicate);
int _wcsicmp (const wchar_t* ws1, const wchar_t* ws2); int _wcsicmp(const wchar_t* ws1, const wchar_t* ws2);
int _wcsicoll (const wchar_t* ws1, const wchar_t* ws2); int _wcsicoll(const wchar_t* ws1, const wchar_t* ws2);
int _wcsncoll (const wchar_t *s1, const wchar_t *s2, size_t c); int _wcsncoll(const wchar_t *s1, const wchar_t *s2, size_t c);
int _wcsnicoll (const wchar_t *s1, const wchar_t *s2, size_t c); int _wcsnicoll(const wchar_t *s1, const wchar_t *s2, size_t c);
wchar_t* _wcslwr (wchar_t* wsToConvert); wchar_t* _wcslwr(wchar_t* wsToConvert);
int _wcsnicmp (const wchar_t* ws1, const wchar_t* ws2, int _wcsnicmp(const wchar_t* ws1, const wchar_t* ws2, size_t sizeMaxCompare);
size_t sizeMaxCompare); wchar_t* _wcsnset(wchar_t* wsToFill, wchar_t wcFill, size_t sizeMaxFill);
wchar_t* _wcsnset (wchar_t* wsToFill, wchar_t wcFill, size_t sizeMaxFill); wchar_t* _wcsrev(wchar_t* wsToReverse);
wchar_t* _wcsrev (wchar_t* wsToReverse); wchar_t* _wcsset(wchar_t* wsToFill, wchar_t wcToFill);
wchar_t* _wcsset (wchar_t* wsToFill, wchar_t wcToFill); wchar_t* _wcsupr(wchar_t* wsToConvert);
wchar_t* _wcsupr (wchar_t* wsToConvert);
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
/* /*
* Non-underscored versions of non-ANSI functions. They live in liboldnames.a * Non-underscored versions of non-ANSI functions. They live in liboldnames.a
@ -154,41 +148,41 @@ wchar_t* _wcsupr (wchar_t* wsToConvert);
* strcasecmp. * strcasecmp.
*/ */
void* memccpy (void* pCopyTo, const void* pSource, int cTerminator, void* memccpy(void* pCopyTo, const void* pSource, int cTerminator, size_t sizeMaxCopy);
size_t sizeMaxCopy); int memicmp(const void* p1, const void* p2, size_t sizeSearch);
int memicmp (const void* p1, const void* p2, size_t sizeSearch); #define strdup(szDuplicate) _strdup(szDuplicate)
#define strdup(szDuplicate) _strdup(szDuplicate) int strcmpi(const char* sz1, const char* sz2);
int strcmpi (const char* sz1, const char* sz2); int stricmp(const char* sz1, const char* sz2);
int stricmp (const char* sz1, const char* sz2); int strcasecmp(const char* sz1, const char* sz2);
int strcasecmp (const char* sz1, const char* sz2); int stricoll(const char* sz1, const char* sz2);
int stricoll (const char* sz1, const char* sz2); char* strlwr(char* szToConvert);
char* strlwr (char* szToConvert); int strnicmp(const char* sz1, const char* sz2, size_t sizeMaxCompare);
int strnicmp (const char* sz1, const char* sz2, size_t sizeMaxCompare); int strncasecmp(const char* sz1, const char* sz2, size_t sizeMaxCompare);
int strncasecmp (const char* sz1, const char* sz2, size_t sizeMaxCompare); char* strnset(char* szToFill, int cFill, size_t sizeMaxFill);
char* strnset (char* szToFill, int cFill, size_t sizeMaxFill); char* strrev(char* szToReverse);
char* strrev (char* szToReverse); char* strset(char* szToFill, int cFill);
char* strset (char* szToFill, int cFill); char* strupr(char* szToConvert);
char* strupr (char* szToConvert);
/* NOTE: There is no _wcscmpi, but this is for compatibility. */ /* NOTE: There is no _wcscmpi, but this is for compatibility. */
int wcscmpi (const wchar_t* ws1, const wchar_t* ws2); int wcscmpi(const wchar_t* ws1, const wchar_t* ws2);
wchar_t* wcsdup (const wchar_t* wsToDuplicate); wchar_t* wcsdup(const wchar_t* wsToDuplicate);
int wcsicmp (const wchar_t* ws1, const wchar_t* ws2); int wcsicmp(const wchar_t* ws1, const wchar_t* ws2);
int wcsicoll (const wchar_t* ws1, const wchar_t* ws2); int wcsicoll(const wchar_t* ws1, const wchar_t* ws2);
wchar_t* wcslwr (wchar_t* wsToConvert); wchar_t* wcslwr(wchar_t* wsToConvert);
int wcsnicmp (const wchar_t* ws1, const wchar_t* ws2, int wcsnicmp(const wchar_t* ws1, const wchar_t* ws2, size_t sizeMaxCompare);
size_t sizeMaxCompare); wchar_t* wcsnset(wchar_t* wsToFill, wchar_t wcFill, size_t sizeMaxFill);
wchar_t* wcsnset (wchar_t* wsToFill, wchar_t wcFill, size_t sizeMaxFill); wchar_t* wcsrev(wchar_t* wsToReverse);
wchar_t* wcsrev (wchar_t* wsToReverse); wchar_t* wcsset(wchar_t* wsToFill, wchar_t wcToFill);
wchar_t* wcsset (wchar_t* wsToFill, wchar_t wcToFill); wchar_t* wcsupr(wchar_t* wsToConvert);
wchar_t* wcsupr (wchar_t* wsToConvert);
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#endif /* Not strict ANSI */ #endif /* Not strict ANSI */
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" } }
#endif #endif
#endif /* Not _STRING_H_ */

View file

@ -15,24 +15,35 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 11:16:44 $ * $Date: 2002/11/24 18:06:01 $
* *
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _LOCKING_H_ #ifndef _LOCKING_H_
#define _LOCKING_H_ #define _LOCKING_H_
/*
* TODO: Define LK_... constants.
*/
#endif /* Not _LOCKING_H_ */ #define _LK_UNLCK 0 /* Unlock */
#define _LK_LOCK 1 /* Lock */
#define _LK_NBLCK 2 /* Non-blocking lock */
#define _LK_RLCK 3 /* Lock for read only */
#define _LK_NBRLCK 4 /* Non-blocking lock for read only */
#endif /* Not __STRICT_ANSI__ */ #ifndef NO_OLDNAMES
#define LK_UNLCK _LK_UNLCK
#define LK_LOCK _LK_LOCK
#define LK_NBLCK _LK_NBLCK
#define LK_RLCK _LK_RLCK
#define LK_NBRLCK _LK_NBRLCK
#endif /* Not NO_OLDNAMES */
#endif /* Not _LOCKING_H_ */
#endif /* Not __STRICT_ANSI__ */

View file

@ -16,12 +16,12 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.5 $ * $Revision: 1.6 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 11:16:44 $ * $Date: 2002/11/24 18:06:01 $
* *
*/ */
@ -32,52 +32,49 @@
#include <msvcrt/sys/types.h> #include <msvcrt/sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _WCHAR_T_ #ifndef _WCHAR_T_
#define _WCHAR_T_ #define _WCHAR_T_
#define _WCHAR_T #define _WCHAR_T
#define _WCHAR_T_DEFINED #define _WCHAR_T_DEFINED
#ifndef __WCHAR_TYPE__ #ifndef __WCHAR_TYPE__
#define __WCHAR_TYPE__ short unsigned int #define __WCHAR_TYPE__ short unsigned int
#endif #endif
#ifndef __cplusplus #ifndef __cplusplus
typedef __WCHAR_TYPE__ wchar_t; typedef __WCHAR_TYPE__ wchar_t;
#endif /* C++ */ #endif /* C++ */
#endif /* wchar_t not already defined */ #endif /* wchar_t not already defined */
/* /*
* Constants for the stat st_mode member. * Constants for the stat st_mode member.
*/ */
#define S_IFIFO 0x1000 /* FIFO */ #define S_IFIFO 0x1000 /* FIFO */
#define S_IFCHR 0x2000 /* Character */ #define S_IFCHR 0x2000 /* Character */
#define S_IFBLK 0x3000 /* Block */ #define S_IFBLK 0x3000 /* Block */
#define S_IFDIR 0x4000 /* Directory */ #define S_IFDIR 0x4000 /* Directory */
#define S_IFREG 0x8000 /* Regular */ #define S_IFREG 0x8000 /* Regular */
#define S_IFMT 0xF000 /* File type mask */ #define S_IFMT 0xF000 /* File type mask */
#define S_IEXEC 0x0040 #define S_IEXEC 0x0040
#define S_IWRITE 0x0080 #define S_IWRITE 0x0080
#define S_IREAD 0x0100 #define S_IREAD 0x0100
#define S_ISDIR(m) ((m) & S_IFDIR) #define S_ISDIR(m) ((m) & S_IFDIR)
#define S_ISFIFO(m) ((m) & S_IFIFO) #define S_ISFIFO(m) ((m) & S_IFIFO)
#define S_ISCHR(m) ((m) & S_IFCHR) #define S_ISCHR(m) ((m) & S_IFCHR)
#define S_ISBLK(m) ((m) & S_IFBLK) #define S_ISBLK(m) ((m) & S_IFBLK)
#define S_ISREG(m) ((m) & S_IFREG) #define S_ISREG(m) ((m) & S_IFREG)
#define S_IRWXU (S_IREAD | S_IWRITE | S_IEXEC) #define S_IRWXU (S_IREAD | S_IWRITE | S_IEXEC)
#define S_IXUSR S_IEXEC #define S_IXUSR S_IEXEC
#define S_IWUSR S_IWRITE #define S_IWUSR S_IWRITE
#define S_IRUSR S_IREAD #define S_IRUSR S_IREAD
#define _S_IEXEC S_IEXEC #define _S_IEXEC S_IEXEC
#define _S_IREAD S_IREAD #define _S_IREAD S_IREAD
#define _S_IWRITE S_IWRITE #define _S_IWRITE S_IWRITE
/* /*
* The structure manipulated and returned by stat and fstat. * The structure manipulated and returned by stat and fstat.
@ -88,55 +85,65 @@ typedef __WCHAR_TYPE__ wchar_t;
*/ */
struct stat struct stat
{ {
long st_dev; /* Equivalent to drive number 0=A 1=B ... */ #ifdef _MSVCRT_LIB_
short st_ino; /* Always zero ? */ long st_dev; /* Equivalent to drive number 0=A 1=B ... */
short st_mode; /* See above constants */ #else
short st_nlink; /* Number of links. */ short st_dev; /* Equivalent to drive number 0=A 1=B ... */
int st_uid; /* User: Maybe significant on NT ? */ short st_padding; /* Pad structure to equal msvcrt version req */
short st_gid; /* Group: Ditto */ #endif
short st_rdev; /* Seems useless (not even filled in) */ short st_ino; /* Always zero ? */
long st_size; /* File size in bytes */ short st_mode; /* See above constants */
time_t st_atime; /* Accessed date (always 00:00 hrs local short st_nlink; /* Number of links. */
* on FAT) */ int st_uid; /* User: Maybe significant on NT ? */
time_t st_mtime; /* Modified time */ short st_gid; /* Group: Ditto */
time_t st_ctime; /* Creation time */ short st_rdev; /* Seems useless (not even filled in) */
long st_size; /* File size in bytes */
time_t st_atime; /* Accessed date (always 00:00 hrs local on FAT) */
time_t st_mtime; /* Modified time */
time_t st_ctime; /* Creation time */
}; };
struct _stati64 struct _stati64
{ {
short st_dev; /* Equivalent to drive number 0=A 1=B ... */ short st_dev; /* Equivalent to drive number 0=A 1=B ... */
short st_ino; /* Always zero ? */ short st_ino; /* Always zero ? */
short st_mode; /* See above constants */ short st_mode; /* See above constants */
short st_nlink; /* Number of links. */ short st_nlink; /* Number of links. */
int st_uid; /* User: Maybe significant on NT ? */ int st_uid; /* User: Maybe significant on NT ? */
short st_gid; /* Group: Ditto */ short st_gid; /* Group: Ditto */
short st_rdev; /* Seems useless (not even filled in) */ short st_rdev; /* Seems useless (not even filled in) */
__int64 st_size; /* File size in bytes */ __int64 st_size; /* File size in bytes */
time_t st_atime; /* Accessed date (always 00:00 hrs local time_t st_atime; /* Accessed date (always 00:00 hrs local on FAT) */
* on FAT) */ time_t st_mtime; /* Modified time */
time_t st_mtime; /* Modified time */ time_t st_ctime; /* Creation time */
time_t st_ctime; /* Creation time */
}; };
int _fstat (int nFileNo, struct stat* pstat); #ifdef __cplusplus
__int64 _fstati64 (int nFileNo, struct _stati64* pstat); extern "C" {
int _stat (const char* szPath, struct stat* pstat); #endif
__int64 _stati64 (const char* szPath, struct _stati64* pstat);
int _wstat (const wchar_t* szPath, struct stat* pstat);
__int64 _wstati64 (const wchar_t* szPath, struct _stati64* pstat);
#ifndef _NO_OLDNAMES int _fstat(int, struct stat*);
int _stat(const char*, struct stat*);
#define fstat(nFileNo, pstat) _fstat(nFileNo, pstat) __int64 _fstati64(int nFileNo, struct _stati64* pstat);
#define stat(szPath,pstat) _stat(szPath,pstat) __int64 _stati64(const char* szPath, struct _stati64* pstat);
int _wstat(const wchar_t* szPath, struct stat* pstat);
#endif /* Not _NO_OLDNAMES */ __int64 _wstati64(const wchar_t* szPath, struct _stati64* pstat);
#ifdef __cplusplus #ifndef _NO_OLDNAMES
#define fstat(nFileNo, pstat) _fstat(nFileNo, pstat)
#define stat(szPath,pstat) _stat(szPath,pstat)
#endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus
} }
#endif #endif
#endif /* Not _STAT_H_ */ #endif /* Not _STAT_H_ */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */

View file

@ -15,46 +15,47 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 11:16:44 $ * $Date: 2002/11/24 18:06:01 $
* *
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _TIMEB_H_ #ifndef _TIMEB_H_
#define _TIMEB_H_ #define _TIMEB_H_
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* TODO: Structure not tested. * TODO: Structure not tested.
*/ */
struct timeb struct timeb
{ {
long time; long time;
short millitm; short millitm;
short _timezone; short _timezone;
short dstflag; short dstflag;
}; };
#ifdef __cplusplus
extern "C" {
#endif
/* TODO: Not tested. */ /* TODO: Not tested. */
void _ftime (struct timeb* timebBuffer); void _ftime(struct timeb*);
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
void ftime (struct timeb* timebBuffer); void ftime(struct timeb*);
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not _TIMEB_H_ */ #endif /* Not _TIMEB_H_ */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */

View file

@ -15,68 +15,54 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warrenties of * DISCLAIMED. This includes but is not limited to warrenties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.4 $ * $Revision: 1.5 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 11:16:44 $ * $Date: 2002/11/24 18:06:01 $
* *
*/ */
#ifndef _TYPES_H_ #ifndef _TYPES_H_
#define _TYPES_H_ #define _TYPES_H_
#ifdef __GNUC__ #ifdef __GNUC__
#undef __int64 #undef __int64
#define __int64 long long #define __int64 long long
#endif #endif
#ifndef _TIME_T_ #ifndef _TIME_T_
#define _TIME_T_ #define _TIME_T_
typedef long time_t; typedef long time_t;
#endif #endif
#ifndef __STRICT_ANSI__
#ifndef __STRICT_ANSI__ #ifndef _OFF_T_DEFINED
#ifndef _OFF_T_DEFINED
typedef long _off_t; typedef long _off_t;
#ifndef _NO_OLDNAMES
#ifndef _NO_OLDNAMES #define off_t _off_t
#define off_t _off_t
#endif #endif
#define _OFF_T_DEFINED
#define _OFF_T_DEFINED #endif /* Not _OFF_T_DEFINED */
#endif /* Not _OFF_T_DEFINED */
#ifndef _DEV_T_DEFINED #ifndef _DEV_T_DEFINED
typedef short _dev_t; typedef short _dev_t;
#ifndef _NO_OLDNAMES
#ifndef _NO_OLDNAMES #define dev_t _dev_t
#define dev_t _dev_t
#endif #endif
#define _DEV_T_DEFINED
#define _DEV_T_DEFINED #endif /* Not _DEV_T_DEFINED */
#endif /* Not _DEV_T_DEFINED */
#ifndef _INO_T_DEFINED #ifndef _INO_T_DEFINED
typedef short _ino_t; typedef short _ino_t;
#ifndef _NO_OLDNAMES
#ifndef _NO_OLDNAMES #define ino_t _ino_t
#define ino_t _ino_t
#endif #endif
#define _INO_T_DEFINED
#endif /* Not _INO_T_DEFINED */
#define _INO_T_DEFINED #endif /* Not __STRICT_ANSI__ */
#endif /* Not _INO_T_DEFINED */ #endif /* Not _TYPES_H_ */
#endif /* Not __STRICT_ANSI__ */
#endif /* Not _TYPES_H_ */

View file

@ -15,61 +15,66 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.4 $ * $Revision: 1.5 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 11:16:44 $ * $Date: 2002/11/24 18:06:01 $
* *
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _UTIME_H_ #ifndef _UTIME_H_
#define _UTIME_H_ #define _UTIME_H_
#define __need_wchar_t #define __need_wchar_t
#define __need_size_t #define __need_size_t
#include <msvcrt/stddef.h> #include <msvcrt/stddef.h>
#include <msvcrt/sys/types.h> #include <msvcrt/sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* Structure used by _utime function. * Structure used by _utime function.
*/ */
struct _utimbuf struct _utimbuf
{ {
time_t actime; /* Access time */ time_t actime; /* Access time */
time_t modtime; /* Modification time */ time_t modtime; /* Modification time */
}; };
int _utime (const char* szFileName, struct _utimbuf* pTimes);
int _futime (int nHandle, struct _utimbuf *pTimes);
/* Wide character version */ #ifndef _NO_OLDNAMES
int _wutime (const wchar_t *szFileName, struct _utimbuf *times);
#ifndef _NO_OLDNAMES
/* NOTE: Must be the same as _utimbuf above. */ /* NOTE: Must be the same as _utimbuf above. */
struct utimbuf struct utimbuf
{ {
time_t actime; time_t actime;
time_t modtime; time_t modtime;
}; };
#endif /* Not _NO_OLDNAMES */
int utime (const char* szFileName, struct utimbuf* pTimes);
#endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" {
#endif
int _utime(const char*, struct _utimbuf*);
int _futime(int, struct _utimbuf*);
/* The wide character version, only available for MSVCRT versions of the
* C runtime library. */
int _wutime(const wchar_t*, struct _utimbuf*);
#ifndef _NO_OLDNAMES
int utime(const char*, struct utimbuf*);
#endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus
} }
#endif #endif
#endif /* Not _UTIME_H_ */ #endif /* Not _UTIME_H_ */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */

View file

@ -15,40 +15,30 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.5 $ * $Revision: 1.6 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 10:22:31 $ * $Date: 2002/11/24 18:06:00 $
* *
*/ */
/* Appropriated for Reactos Crtdll by Ariadne */ /* Appropriated for Reactos Crtdll by Ariadne */
#ifndef _TIME_H_ #ifndef _TIME_H_
#define _TIME_H_ #define _TIME_H_
#define __need_wchar_t #define __need_wchar_t
#define __need_size_t #define __need_size_t
#include <msvcrt/stddef.h> #include <msvcrt/stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* Number of clock ticks per second. A clock tick is the unit by which * Number of clock ticks per second. A clock tick is the unit by which
* processor time is measured and is returned by 'clock'. * processor time is measured and is returned by 'clock'.
*/ */
#define CLOCKS_PER_SEC 1000.0 #define CLOCKS_PER_SEC 1000.0
#define CLK_TICK CLOCKS_PER_SEC #define CLK_TICK CLOCKS_PER_SEC
/*
* A type for measuring processor time (in clock ticks).
*/
#ifndef _CLOCK_T_
#define _CLOCK_T_
typedef long clock_t;
#endif
/* /*
* Need a definition of time_t. * Need a definition of time_t.
@ -61,34 +51,46 @@ typedef long clock_t;
* NOTE: Normally this is defined by the above include of sys/types.h * NOTE: Normally this is defined by the above include of sys/types.h
*/ */
#ifndef _TIME_T_ #ifndef _TIME_T_
typedef long time_t;
#define _TIME_T_ #define _TIME_T_
typedef long time_t; #endif
/*
* A type for measuring processor time (in clock ticks).
*/
#ifndef _CLOCK_T_
typedef long clock_t;
#define _CLOCK_T_
#endif #endif
/* /*
* A structure for storing all kinds of useful information about the * A structure for storing all kinds of useful information about the
* current (or another) time. * current (or another) time.
*/ */
struct tm { struct tm
int tm_sec; {
int tm_min; int tm_sec; /* Seconds: 0-59 (K&R says 0-61?) */
int tm_hour; int tm_min; /* Minutes: 0-59 */
int tm_mday; int tm_hour; /* Hours since midnight: 0-23 */
int tm_mon; int tm_mday; /* Day of the month: 1-31 */
int tm_year; int tm_mon; /* Months *since* january: 0-11 */
int tm_wday; int tm_year; /* Years since 1900 */
int tm_yday; int tm_wday; /* Days since Sunday (0-6) */
int tm_isdst; int tm_yday; /* Days since Jan. 1: 0-365 */
char *tm_zone; int tm_isdst; /* +1 Daylight Savings Time, 0 No DST,
int tm_gmtoff; * -1 don't know */
char *tm_zone;
int tm_gmtoff;
}; };
#ifdef __cplusplus
extern "C" {
#endif
clock_t clock(void);
clock_t clock (void); time_t time(time_t*);
time_t time (time_t* tp); double difftime(time_t, time_t);
double difftime (time_t t2, time_t t1); time_t mktime(struct tm*);
time_t mktime (struct tm* tmsp);
/* /*
* These functions write to and return pointers to static buffers that may * These functions write to and return pointers to static buffers that may
@ -100,27 +102,24 @@ time_t mktime (struct tm* tmsp);
* Fault and crap out your program. Guess how I know. Hint: stat called on * Fault and crap out your program. Guess how I know. Hint: stat called on
* a directory gives 'invalid' times in st_atime etc... * a directory gives 'invalid' times in st_atime etc...
*/ */
char* asctime (const struct tm* tmsp); char* asctime(const struct tm*);
wchar_t* _wasctime(const struct tm *timeptr); char* ctime(const time_t*);
char* ctime (const time_t* tp); struct tm* gmtime(const time_t*);
wchar_t* _wctime(const time_t * const timep); struct tm* localtime(const time_t*);
struct tm* gmtime (const time_t* tm);
struct tm* localtime (const time_t* tm);
char* _strdate(const char *datestr); size_t strftime(char*, size_t, const char*, const struct tm*);
wchar_t* _wstrdate(const wchar_t *datestr); size_t wcsftime(wchar_t*, size_t, const wchar_t*, const struct tm*);
size_t strftime (char* caBuffer, size_t sizeMax, const char* szFormat, wchar_t* _wasctime(const struct tm *timeptr);
const struct tm* tpPrint); wchar_t* _wctime(const time_t * const timep);
char* _strdate(const char *datestr);
wchar_t* _wstrdate(const wchar_t *datestr);
char* _strtime(char* buf);
wchar_t* _wstrtime(wchar_t* buf);
size_t wcsftime (wchar_t* wcaBuffer, size_t sizeMax, #ifdef __cplusplus
const wchar_t* wsFormat, const struct tm* tpPrint);
char* _strtime(char* buf);
wchar_t* _wstrtime(wchar_t* buf);
#ifdef __cplusplus
} }
#endif #endif
#endif #endif /* Not _TIME_H_ */

View file

@ -15,18 +15,25 @@
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* $Author: chorns $ * $Author: robd $
* $Date: 2002/09/08 10:22:31 $ * $Date: 2002/11/24 18:06:00 $
* *
*/ */
#ifndef _WCHAR_H_
#define _WCHAR_H_
#include <msvcrt/ctype.h> #include <msvcrt/ctype.h>
#include <msvcrt/stdio.h> #include <msvcrt/stdio.h>
#include <msvcrt/stdlib.h> #include <msvcrt/stdlib.h>
#include <msvcrt/string.h> #include <msvcrt/string.h>
#include <msvcrt/time.h> #include <msvcrt/time.h>
#endif /* not _WCHAR_H_ */