ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
February 2005
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
23 participants
411 discussions
Start a n
N
ew thread
[gdalsnes] 13616: forgot to change those two...
by gdalsnes@svn.reactos.com
forgot to change those two... Modified: trunk/reactos/lib/crtdll/dllmain.c Modified: trunk/reactos/lib/msvcrt/dllmain.c _____ Modified: trunk/reactos/lib/crtdll/dllmain.c --- trunk/reactos/lib/crtdll/dllmain.c 2005-02-17 11:38:16 UTC (rev 13615) +++ trunk/reactos/lib/crtdll/dllmain.c 2005-02-17 12:18:10 UTC (rev 13616) @@ -28,7 +28,7 @@ #include <sys/stat.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> /* EXTERNAL PROTOTYPES ********************************************************/ _____ Modified: trunk/reactos/lib/msvcrt/dllmain.c --- trunk/reactos/lib/msvcrt/dllmain.c 2005-02-17 11:38:16 UTC (rev 13615) +++ trunk/reactos/lib/msvcrt/dllmain.c 2005-02-17 12:18:10 UTC (rev 13616) @@ -27,7 +27,7 @@ #include <internal/wine/msvcrt.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> /* EXTERNAL PROTOTYPES ********************************************************/
19 years, 10 months
1
0
0
0
[gdalsnes] 13615: add workarounds for mingw runtime version differences
by gdalsnes@svn.reactos.com
add workarounds for mingw runtime version differences gave directory routines a good cleanup (based on wine) more tcharizing of routines Modified: trunk/reactos/lib/crt/direct/chdir.c Modified: trunk/reactos/lib/crt/direct/chdrive.c Modified: trunk/reactos/lib/crt/direct/getcwd.c Modified: trunk/reactos/lib/crt/direct/getdcwd.c Modified: trunk/reactos/lib/crt/direct/getdrive.c Modified: trunk/reactos/lib/crt/direct/mkdir.c Modified: trunk/reactos/lib/crt/direct/rmdir.c Modified: trunk/reactos/lib/crt/direct/wchdir.c Modified: trunk/reactos/lib/crt/direct/wgetcwd.c Modified: trunk/reactos/lib/crt/direct/wgetdcwd.c Modified: trunk/reactos/lib/crt/direct/wmkdir.c Modified: trunk/reactos/lib/crt/direct/wrmdir.c Modified: trunk/reactos/lib/crt/float/fpclass.c Added: trunk/reactos/lib/crt/include/internal/debug.h Modified: trunk/reactos/lib/crt/include/internal/file.h Deleted: trunk/reactos/lib/crt/include/internal/msvcrtdbg.h Modified: trunk/reactos/lib/crt/io/access.c Modified: trunk/reactos/lib/crt/io/chmod.c Modified: trunk/reactos/lib/crt/io/chsize.c Modified: trunk/reactos/lib/crt/io/close.c Modified: trunk/reactos/lib/crt/io/create.c Modified: trunk/reactos/lib/crt/io/find.c Modified: trunk/reactos/lib/crt/io/isatty.c Modified: trunk/reactos/lib/crt/io/mktemp.c Modified: trunk/reactos/lib/crt/io/open.c Modified: trunk/reactos/lib/crt/io/pipe.c Modified: trunk/reactos/lib/crt/io/read.c Modified: trunk/reactos/lib/crt/io/setmode.c Modified: trunk/reactos/lib/crt/io/unlink.c Modified: trunk/reactos/lib/crt/io/wcreate.c Modified: trunk/reactos/lib/crt/io/wmktemp.c Modified: trunk/reactos/lib/crt/io/wopen.c Modified: trunk/reactos/lib/crt/io/write.c Modified: trunk/reactos/lib/crt/io/wunlink.c Modified: trunk/reactos/lib/crt/locale/locale.c Modified: trunk/reactos/lib/crt/misc/crtmain.c Modified: trunk/reactos/lib/crt/misc/environ.c Modified: trunk/reactos/lib/crt/misc/lock.c Modified: trunk/reactos/lib/crt/misc/stubs.c Modified: trunk/reactos/lib/crt/process/process.c Modified: trunk/reactos/lib/crt/signal/signal.c Modified: trunk/reactos/lib/crt/stdio/fwrite.c Modified: trunk/reactos/lib/crt/stdio/popen.c Modified: trunk/reactos/lib/crt/stdio/remove.c Modified: trunk/reactos/lib/crt/stdlib/getenv.c Modified: trunk/reactos/lib/crt/stdlib/putenv.c Modified: trunk/reactos/lib/crt/stdlib/senv.c Modified: trunk/reactos/lib/crt/stdlib/wputenv.c Modified: trunk/reactos/lib/crt/wine/scanf.c _____ Modified: trunk/reactos/lib/crt/direct/chdir.c --- trunk/reactos/lib/crt/direct/chdir.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/direct/chdir.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -2,14 +2,15 @@ #include <ctype.h> #include <direct.h> #include <internal/file.h> +#include <tchar.h> /* * @implemented */ -int _chdir(const char* _path) +int _tchdir(const _TCHAR* _path) { - if (!SetCurrentDirectoryA((char*)_path)) { - _dosmaperr(GetLastError()); + if (!SetCurrentDirectory(_path)) { + _dosmaperr(_path?GetLastError():0); return -1; } return 0; _____ Modified: trunk/reactos/lib/crt/direct/chdrive.c --- trunk/reactos/lib/crt/direct/chdrive.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/direct/chdrive.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -6,29 +6,36 @@ #include <internal/file.h> -int cur_drive = 0; - - /* - * @implemented + * @implemented + * + * _chdrive (MSVCRT.@) + * + * Change the current drive. + * + * PARAMS + * newdrive [I] Drive number to change to (1 = 'A', 2 = 'B', ...) + * + * RETURNS + * Success: 0. The current drive is set to newdrive. + * Failure: -1. errno indicates the error. + * + * NOTES + * See SetCurrentDirectoryA. */ -int _chdrive(int drive) +int _chdrive(int newdrive) { - char d[3]; + WCHAR buffer[] = L"A:"; - if (!( drive >= 1 && drive <= 26)) { - __set_errno(EINVAL); - return -1; - } - if (cur_drive != drive) { - cur_drive = drive; - d[0] = toupper(cur_drive + '@'); - d[1] = ':'; - d[2] = 0; - if (!SetCurrentDirectoryA(d)) { - _dosmaperr(GetLastError()); - return -1; - } + buffer[0] += newdrive - 1; + if (!SetCurrentDirectoryW( buffer )) + { + _dosmaperr(GetLastError()); + if (newdrive <= 0) + { + __set_errno(EACCES); } - return 0; + return -1; + } + return 0; } _____ Modified: trunk/reactos/lib/crt/direct/getcwd.c --- trunk/reactos/lib/crt/direct/getcwd.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/direct/getcwd.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -3,29 +3,33 @@ #include <stdlib.h> #include <errno.h> #include <internal/file.h> +#include <tchar.h> - /* * @implemented */ -char *_getcwd(char* buffer, int maxlen) +_TCHAR* _tgetcwd(_TCHAR* buf, int size) { - char *cwd; - int len; + _TCHAR dir[MAX_PATH]; + DWORD dir_len = GetCurrentDirectory(MAX_PATH,dir); - if (buffer == NULL) { - if ( (cwd = malloc(MAX_PATH)) == NULL ) { - __set_errno(ENOMEM); - return NULL; - } - len = MAX_PATH; - } else { - cwd = buffer; - len = maxlen; - } - if (GetCurrentDirectoryA(len, cwd) == 0) { - _dosmaperr(GetLastError()); - return NULL; - } - return cwd; + if (dir_len == 0) + { + _dosmaperr(GetLastError()); + return NULL; /* FIXME: Real return value untested */ + } + + if (!buf) + { + return _tcsdup(dir); + } + + if (dir_len >= size) + { + __set_errno(ERANGE); + return NULL; /* buf too small */ + } + + _tcscpy(buf,dir); + return buf; } _____ Modified: trunk/reactos/lib/crt/direct/getdcwd.c --- trunk/reactos/lib/crt/direct/getdcwd.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/direct/getdcwd.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -1,27 +1,64 @@ #include "precomp.h" #include <direct.h> #include <internal/file.h> +#include <internal/debug.h> +#include <tchar.h> +#include <errno.h> /* * @implemented + * + * _getdcwd (MSVCRT.@) + * + * Get the current working directory on a given disk. + * + * PARAMS + * drive [I] Drive letter to get the current working directory from. + * buf [O] Destination for the current working directory. + * size [I] Length of drive in characters. + * + * RETURNS + * Success: If drive is NULL, returns an allocated string containing the path. + * Otherwise populates drive with the path and returns it. + * Failure: NULL. errno indicates the error. */ -char* _getdcwd(int nDrive, char* caBuffer, int nBufLen) +_TCHAR* _tgetdcwd(int drive, _TCHAR * buf, int size) { - int i =0; - int dr = _getdrive(); + static _TCHAR* dummy; - if (nDrive < 1 || nDrive > 26) - return NULL; - if (dr != nDrive) { - if ( _chdrive(nDrive) != 0 ) - return NULL; - } - i = GetCurrentDirectoryA(nBufLen, caBuffer); - if (i == nBufLen) - return NULL; - if (dr != nDrive) { - if ( _chdrive(dr) != 0 ) - return NULL; - } - return caBuffer; + TRACE(":drive %d(%c), size %d\n",drive, drive + 'A' - 1, size); + + if (!drive || drive == _getdrive()) + return _tgetcwd(buf,size); /* current */ + else + { + _TCHAR dir[MAX_PATH]; + _TCHAR drivespec[] = _T("A:"); + int dir_len; + + drivespec[0] += drive - 1; + if (GetDriveType(drivespec) < DRIVE_REMOVABLE) + { + __set_errno(EACCES); + return NULL; + } + + /* GetFullPathName for X: means "get working directory on drive X", + * just like passing X: to SetCurrentDirectory means "switch to working + * directory on drive X". -Gunnar */ + dir_len = GetFullPathName(drivespec,MAX_PATH,dir,&dummy); + if (dir_len >= size || dir_len < 1) + { + __set_errno(ERANGE); + return NULL; /* buf too small */ + } + + TRACE(":returning '%s'\n", dir); + if (!buf) + return _tcsdup(dir); /* allocate */ + + _tcscpy(buf,dir); + } + return buf; } + _____ Modified: trunk/reactos/lib/crt/direct/getdrive.c --- trunk/reactos/lib/crt/direct/getdrive.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/direct/getdrive.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -3,28 +3,33 @@ #include <direct.h> -extern int cur_drive; - /* * @implemented + * + * _getdrive (MSVCRT.@) + * + * Get the current drive number. + * + * PARAMS + * None. + * + * RETURNS + * Success: The drive letter number from 1 to 26 ("A:" to "Z:"). + * Failure: 0. */ int _getdrive(void) { - char Buffer[MAX_PATH]; - - if (cur_drive == 0) { - GetCurrentDirectoryA(MAX_PATH, Buffer); - cur_drive = toupper(Buffer[0] - '@'); - } - return cur_drive; + WCHAR buffer[MAX_PATH]; + if (GetCurrentDirectoryW( MAX_PATH, buffer ) && + buffer[0] >= 'A' && buffer[0] <= 'z' && buffer[1] == ':') + return towupper(buffer[0]) - 'A' + 1; + return 0; } /* - * @unimplemented + * @implemented */ unsigned long _getdrives(void) { - //fixme get logical drives - //return GetLogicalDrives(); - return 5; // drive A and C + return GetLogicalDrives(); } _____ Modified: trunk/reactos/lib/crt/direct/mkdir.c --- trunk/reactos/lib/crt/direct/mkdir.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/direct/mkdir.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -1,14 +1,14 @@ #include "precomp.h" #include <direct.h> #include <internal/file.h> +#include <tchar.h> - /* * @implemented */ -int _mkdir(const char* _path) +int _tmkdir(const _TCHAR* _path) { - if (!CreateDirectoryA(_path, NULL)) { + if (!CreateDirectory(_path, NULL)) { _dosmaperr(GetLastError()); return -1; } _____ Modified: trunk/reactos/lib/crt/direct/rmdir.c --- trunk/reactos/lib/crt/direct/rmdir.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/direct/rmdir.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -1,14 +1,14 @@ #include "precomp.h" #include <direct.h> #include <internal/file.h> +#include <tchar.h> - /* * @implemented */ -int _rmdir(const char* _path) +int _trmdir(const _TCHAR* _path) { - if (!RemoveDirectoryA(_path)) { + if (!RemoveDirectory(_path)) { _dosmaperr(GetLastError()); return -1; } _____ Modified: trunk/reactos/lib/crt/direct/wchdir.c --- trunk/reactos/lib/crt/direct/wchdir.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/direct/wchdir.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -1,16 +1,5 @@ -#include "precomp.h" -#include <ctype.h> -#include <direct.h> -#include <internal/file.h> +#define UNICODE +#define _UNICODE -/* - * @implemented - */ -int _wchdir (const wchar_t *_path) -{ - if (!SetCurrentDirectoryW((wchar_t *)_path)) { - _dosmaperr(GetLastError()); - return -1; - } - return 0; -} +#include "chdir.c" + _____ Modified: trunk/reactos/lib/crt/direct/wgetcwd.c --- trunk/reactos/lib/crt/direct/wgetcwd.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/direct/wgetcwd.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -1,28 +1,5 @@ -#include "precomp.h" -#include <direct.h> -#include <stdlib.h> -#include <errno.h> -#include <internal/file.h> +#define UNICODE +#define _UNICODE +#include "getcwd.c" -/* - * @implemented - */ -wchar_t* _wgetcwd(wchar_t* buffer, int maxlen) -{ - wchar_t *cwd; - int len; - if (buffer == NULL) { - if ( (cwd = malloc(MAX_PATH * sizeof(wchar_t))) == NULL ) { - __set_errno(ENOMEM); - return NULL; - } - len = MAX_PATH; - } else { - cwd = buffer; - len = maxlen; - } - if (GetCurrentDirectoryW(len, cwd) == 0) - return NULL; - return cwd; -} _____ Modified: trunk/reactos/lib/crt/direct/wgetdcwd.c --- trunk/reactos/lib/crt/direct/wgetdcwd.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/direct/wgetdcwd.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -1,32 +1,5 @@ -#include "precomp.h" -#include <direct.h> -#include <internal/file.h> +#define UNICODE +#define _UNICODE +#include "getdcwd.c" -/* - * @implemented - */ -wchar_t* _wgetdcwd(int nDrive, wchar_t* caBuffer, int nBufLen) -{ - int i =0; - int dr = _getdrive(); - - if (nDrive < 1 || nDrive > 26) - return NULL; - - if (dr != nDrive) { - if ( _chdrive(nDrive) != 0 ) - return NULL; - } - - i = GetCurrentDirectoryW(nBufLen, caBuffer); - if (i == nBufLen) - return NULL; - - if (dr != nDrive) { - if ( _chdrive(dr) != 0 ) - return NULL; - } - - return caBuffer; -} _____ Modified: trunk/reactos/lib/crt/direct/wmkdir.c --- trunk/reactos/lib/crt/direct/wmkdir.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/direct/wmkdir.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -1,16 +1,4 @@ -#include "precomp.h" -#include <direct.h> -#include <internal/file.h> +#define UNICODE +#define _UNICODE - -/* - * @implemented - */ -int _wmkdir(const wchar_t* _path) -{ - if (!CreateDirectoryW(_path, NULL)) { - _dosmaperr(GetLastError()); - return -1; - } - return 0; -} +#include "mkdir.c" _____ Modified: trunk/reactos/lib/crt/direct/wrmdir.c --- trunk/reactos/lib/crt/direct/wrmdir.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/direct/wrmdir.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -1,16 +1,4 @@ -#include "precomp.h" -#include <direct.h> -#include <internal/file.h> +#define UNICODE +#define _UNICODE - -/* - * @implemented - */ -int _wrmdir(const wchar_t* _path) -{ - if (!RemoveDirectoryW(_path)) { - _dosmaperr(GetLastError()); - return -1; - } - return 0; -} +#include "rmdir.c" _____ Modified: trunk/reactos/lib/crt/float/fpclass.c --- trunk/reactos/lib/crt/float/fpclass.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/float/fpclass.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -14,6 +14,9 @@ #define _FPCLASS_PN 0x0100 /* positive normal */ #define _FPCLASS_PINF 0x0200 /* positive infinity */ + +#if __MINGW32_MAJOR_VERSION < 3 || __MINGW32_MINOR_VERSION < 3 + #define FP_SNAN 0x0001 // signaling NaN #define FP_QNAN 0x0002 // quiet NaN #define FP_NINF 0x0004 // negative infinity @@ -25,6 +28,8 @@ #define FP_NNORM 0x0080 // negative normalized non-zero #define FP_PNORM 0x0100 // positive normalized non-zero +#endif + typedef int fpclass_t; /* _____ Copied: trunk/reactos/lib/crt/include/internal/debug.h (from rev 13607, trunk/reactos/lib/crt/include/internal/msvcrtdbg.h) _____ Modified: trunk/reactos/lib/crt/include/internal/file.h --- trunk/reactos/lib/crt/include/internal/file.h 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/include/internal/file.h 2005-02-17 11:38:16 UTC (rev 13615) @@ -185,6 +185,10 @@ wint_t _filwbuf(FILE *f); +#if __MINGW32_MAJOR_VERSION < 3 || __MINGW32_MINOR_VERSION < 2 + int __cdecl _filbuf (FILE*); + int __cdecl _flsbuf (int, FILE*); +#endif #endif /* __dj_include_libc_file_h__ */ _____ Deleted: trunk/reactos/lib/crt/include/internal/msvcrtdbg.h --- trunk/reactos/lib/crt/include/internal/msvcrtdbg.h 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/include/internal/msvcrtdbg.h 2005-02-17 11:38:16 UTC (rev 13615) @@ -1,90 +0,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: include/msvcrt/msvcrtdbg.h - * PURPOSE: Useful debugging macros - * PROGRAMMER: - * UPDATE HISTORY: - * - */ - -/* - * NOTE: Define NDEBUG before including this header to disable debugging - * macros - */ - -#ifndef __MSVCRT_DEBUG -#define __MSVCRT_DEBUG - -#include <roscfg.h> -#include <windows.h> - - -#define MK_STR(s) #s - -#ifdef _UNICODE - #define sT "S" -#else - #define sT "s" -#endif - - - -#define TRACE(...) - - -#ifdef DBG - #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); -#else - #ifdef __GNUC__ - #define DPRINT1(args...) - #else - #define DPRINT DbgPrint - #endif - #define CHECKPOINT1 -#endif - -#if !defined(NDEBUG) && defined(DBG) - #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); -#else - #ifdef __GNUC__ - #define DPRINT(args...) - #else - #define DPRINT DbgPrint - #endif - #define CHECKPOINT -#endif /* NDEBUG */ - - -#if 0 - - #define TRACE_RETURN(format_str, ret_type) \ - ret_type __return_value__; \ - static char* __return_format_str__ = "%s ret: "format_str"\n" - - #define FUNCTION(func) \ - static char* __func_name__ = #func - - #define TRACE(a,b...) DPRINT1(a"\n", b) - - #define RETURN(a) \ - do{ __return_value__ = (a); DPRINT1(__return_format_str__ ,__func_name__,__return_value__); return __return_value__ ; }while(0) - -#endif - - -/* 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 */ _____ Modified: trunk/reactos/lib/crt/io/access.c --- trunk/reactos/lib/crt/io/access.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/io/access.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -5,7 +5,7 @@ #include <internal/file.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> #ifdef _UNICODE #define _TS S _____ Modified: trunk/reactos/lib/crt/io/chmod.c --- trunk/reactos/lib/crt/io/chmod.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/io/chmod.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -6,7 +6,7 @@ #include <internal/file.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> #define mode_t int _____ Modified: trunk/reactos/lib/crt/io/chsize.c --- trunk/reactos/lib/crt/io/chsize.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/io/chsize.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -2,7 +2,7 @@ #include <io.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> /* * @implemented _____ Modified: trunk/reactos/lib/crt/io/close.c --- trunk/reactos/lib/crt/io/close.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/io/close.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -3,7 +3,7 @@ #include <internal/file.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> /* * @implemented _____ Modified: trunk/reactos/lib/crt/io/create.c --- trunk/reactos/lib/crt/io/create.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/io/create.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -2,7 +2,7 @@ #include <fcntl.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> /* _____ Modified: trunk/reactos/lib/crt/io/find.c --- trunk/reactos/lib/crt/io/find.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/io/find.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -8,7 +8,7 @@ /* * @implemented */ -#ifdef _UNICODE +#if defined(_UNICODE) || !(__MINGW32_MAJOR_VERSION < 3 || __MINGW32_MINOR_VERSION < 3) long #else int @@ -60,7 +60,7 @@ * @implemented */ int _tfindnext( -#ifdef _UNICODE +#if defined(_UNICODE) || !(__MINGW32_MAJOR_VERSION < 3 || __MINGW32_MINOR_VERSION < 3) long handle, #else int handle, @@ -176,7 +176,13 @@ /* * @implemented */ -int _findclose(int handle) +int _findclose( +#if __MINGW32_MAJOR_VERSION < 3 || __MINGW32_MINOR_VERSION < 3 + int handle +#else + long handle +#endif + ) { // check no wildcards or invalid handle if (handle == 0 || handle == -1) _____ Modified: trunk/reactos/lib/crt/io/isatty.c --- trunk/reactos/lib/crt/io/isatty.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/io/isatty.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -2,7 +2,7 @@ #include <sys/stat.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> /* * @implemented _____ Modified: trunk/reactos/lib/crt/io/mktemp.c --- trunk/reactos/lib/crt/io/mktemp.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/io/mktemp.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -18,7 +18,7 @@ #include <io.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> /* _____ Modified: trunk/reactos/lib/crt/io/open.c --- trunk/reactos/lib/crt/io/open.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/io/open.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -52,7 +52,7 @@ #include <internal/file.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> _____ Modified: trunk/reactos/lib/crt/io/pipe.c --- trunk/reactos/lib/crt/io/pipe.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/io/pipe.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -15,7 +15,7 @@ #include <internal/file.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> /* _____ Modified: trunk/reactos/lib/crt/io/read.c --- trunk/reactos/lib/crt/io/read.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/io/read.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -17,7 +17,7 @@ #include <internal/file.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> /* * @implemented _____ Modified: trunk/reactos/lib/crt/io/setmode.c --- trunk/reactos/lib/crt/io/setmode.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/io/setmode.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -14,6 +14,6 @@ #include <internal/file.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> _____ Modified: trunk/reactos/lib/crt/io/unlink.c --- trunk/reactos/lib/crt/io/unlink.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/io/unlink.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -13,7 +13,7 @@ #include <internal/file.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> /* _____ Modified: trunk/reactos/lib/crt/io/wcreate.c --- trunk/reactos/lib/crt/io/wcreate.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/io/wcreate.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -2,7 +2,7 @@ #include <fcntl.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> /* _____ Modified: trunk/reactos/lib/crt/io/wmktemp.c --- trunk/reactos/lib/crt/io/wmktemp.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/io/wmktemp.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -18,7 +18,7 @@ #include <io.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> /* _____ Modified: trunk/reactos/lib/crt/io/wopen.c --- trunk/reactos/lib/crt/io/wopen.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/io/wopen.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -26,7 +26,7 @@ #include <internal/file.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> /* _____ Modified: trunk/reactos/lib/crt/io/write.c --- trunk/reactos/lib/crt/io/write.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/io/write.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -16,7 +16,7 @@ #include <internal/file.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> #define BUFSIZE 4096 /* _____ Modified: trunk/reactos/lib/crt/io/wunlink.c --- trunk/reactos/lib/crt/io/wunlink.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/io/wunlink.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -13,7 +13,7 @@ #include <internal/file.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> /* * @implemented _____ Modified: trunk/reactos/lib/crt/locale/locale.c --- trunk/reactos/lib/crt/locale/locale.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/locale/locale.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -13,7 +13,7 @@ #include <stdlib.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> unsigned int __setlc_active; unsigned int __unguarded_readlc_active; _____ Modified: trunk/reactos/lib/crt/misc/crtmain.c --- trunk/reactos/lib/crt/misc/crtmain.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/misc/crtmain.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -6,7 +6,7 @@ #include "precomp.h" #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> #ifndef __GNUC__ _____ Modified: trunk/reactos/lib/crt/misc/environ.c --- trunk/reactos/lib/crt/misc/environ.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/misc/environ.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -12,7 +12,7 @@ #include <internal/file.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> unsigned int _osver = 0; _____ Modified: trunk/reactos/lib/crt/misc/lock.c --- trunk/reactos/lib/crt/misc/lock.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/misc/lock.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -19,7 +19,7 @@ #include "precomp.h" #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> #include <internal/mtdll.h> typedef struct _____ Modified: trunk/reactos/lib/crt/misc/stubs.c --- trunk/reactos/lib/crt/misc/stubs.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/misc/stubs.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -1,7 +1,7 @@ #include "precomp.h" #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> /********************************************************************* * $I10_OUTPUT (MSVCRT.@) _____ Modified: trunk/reactos/lib/crt/process/process.c --- trunk/reactos/lib/crt/process/process.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/process/process.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -7,7 +7,7 @@ #include <tchar.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> #ifdef _UNICODE #define find_execT find_execW _____ Modified: trunk/reactos/lib/crt/signal/signal.c --- trunk/reactos/lib/crt/signal/signal.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/signal/signal.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -89,7 +89,7 @@ int raise(int sig) { - __p_sig_fn_t temp;// = SIG_DFL; + __p_sig_fn_t temp = 0; int i; switch (sig) _____ Modified: trunk/reactos/lib/crt/stdio/fwrite.c --- trunk/reactos/lib/crt/stdio/fwrite.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/stdio/fwrite.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -6,7 +6,7 @@ #include <internal/file.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> /* _____ Modified: trunk/reactos/lib/crt/stdio/popen.c --- trunk/reactos/lib/crt/stdio/popen.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/stdio/popen.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -8,7 +8,7 @@ #include <internal/file.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> /* _____ Modified: trunk/reactos/lib/crt/stdio/remove.c --- trunk/reactos/lib/crt/stdio/remove.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/stdio/remove.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -4,7 +4,7 @@ #include <tchar.h> #define NDEBUG -#include <internal/msvcrtdbg.h> +#include <internal/debug.h> /* * @implemented _____ Modified: trunk/reactos/lib/crt/stdlib/getenv.c --- trunk/reactos/lib/crt/stdlib/getenv.c 2005-02-17 10:44:57 UTC (rev 13614) +++ trunk/reactos/lib/crt/stdlib/getenv.c 2005-02-17 11:38:16 UTC (rev 13615) @@ -2,7 +2,7 @@ #include <stdlib.h> #define NDEBUG [truncated at 1000 lines; 63 more skipped]
19 years, 10 months
1
0
0
0
[gdalsnes] 13614: fix typo
by gdalsnes@svn.reactos.com
fix typo Modified: trunk/reactos/lib/crt/stdio/wtmpnam.c _____ Modified: trunk/reactos/lib/crt/stdio/wtmpnam.c --- trunk/reactos/lib/crt/stdio/wtmpnam.c 2005-02-17 00:01:54 UTC (rev 13613) +++ trunk/reactos/lib/crt/stdio/wtmpnam.c 2005-02-17 10:44:57 UTC (rev 13614) @@ -2,4 +2,4 @@ #define _UNICODE #define UNICODE -#import "tmpnam.c" +#include "tmpnam.c"
19 years, 10 months
1
0
0
0
[gdalsnes] 13613: remove more cruft
by gdalsnes@svn.reactos.com
remove more cruft Deleted: trunk/reactos/lib/crtdll/malloc/ Deleted: trunk/reactos/lib/crtdll/quad/ Deleted: trunk/reactos/lib/crtdll/string/ Deleted: trunk/reactos/lib/crtdll/tchar/ Deleted: trunk/reactos/lib/crtdll/wchar/
19 years, 10 months
1
0
0
0
[chorns] 13612: Interpret numeric values as being hexadecimal values if they contain hex digits a-f
by chorns@svn.reactos.com
Interpret numeric values as being hexadecimal values if they contain hex digits a-f Modified: trunk/irc/TechBot/TechBot.Library/NumberParser.cs _____ Modified: trunk/irc/TechBot/TechBot.Library/NumberParser.cs --- trunk/irc/TechBot/TechBot.Library/NumberParser.cs 2005-02-16 23:08:04 UTC (rev 13611) +++ trunk/irc/TechBot/TechBot.Library/NumberParser.cs 2005-02-16 23:17:17 UTC (rev 13612) @@ -7,13 +7,43 @@ { public bool Error = false; + private const string SpecialHexCharacters = "ABCDEF"; + + private bool IsSpecialHexCharacter(char ch) + { + foreach (char specialChar in SpecialHexCharacters) + { + if (ch.ToString().ToUpper() == specialChar.ToString()) + return true; + } + return false; + } + + private bool HasSpecialHexCharacters(string s) + { + foreach (char ch in s) + { + if (IsSpecialHexCharacter(ch)) + return true; + } + return false; + } + public long Parse(string s) { try { Error = false; + bool useHex = false; if (s.StartsWith("0x")) - return Int64.Parse(s.Substring(2), + { + s = s.Substring(2); + useHex = true; + } + if (HasSpecialHexCharacters(s)) + useHex = true; + if (useHex) + return Int64.Parse(s, NumberStyles.HexNumber); else return Int64.Parse(s);
19 years, 10 months
1
0
0
0
[gdalsnes] 13611: hack into private crt headers
by gdalsnes@svn.reactos.com
hack into private crt headers Modified: trunk/reactos/lib/crtdll/dllmain.c Modified: trunk/reactos/lib/crtdll/makefile Modified: trunk/reactos/lib/msvcrt/Makefile Modified: trunk/reactos/lib/msvcrt/dllmain.c _____ Modified: trunk/reactos/lib/crtdll/dllmain.c --- trunk/reactos/lib/crtdll/dllmain.c 2005-02-16 22:38:49 UTC (rev 13610) +++ trunk/reactos/lib/crtdll/dllmain.c 2005-02-16 23:08:04 UTC (rev 13611) @@ -21,13 +21,14 @@ */ #include "precomp.h" -#include <msvcrt/internal/tls.h> +#include <stdio.h> +#include <internal/tls.h> #include <stdlib.h> -#include <msvcrt/wine/msvcrt.h> +#include <internal/wine/msvcrt.h> #include <sys/stat.h> #define NDEBUG -#include <msvcrt/msvcrtdbg.h> +#include <internal/msvcrtdbg.h> /* EXTERNAL PROTOTYPES ********************************************************/ _____ Modified: trunk/reactos/lib/crtdll/makefile --- trunk/reactos/lib/crtdll/makefile 2005-02-16 22:38:49 UTC (rev 13610) +++ trunk/reactos/lib/crtdll/makefile 2005-02-16 23:08:04 UTC (rev 13611) @@ -21,7 +21,7 @@ TARGET_GCCLIBS = gcc -TARGET_CFLAGS = -D__USE_W32API -Wall -Werror +TARGET_CFLAGS = -D__USE_W32API -Wall -Werror -I../crt/include # require os code to explicitly request A/W version of structs/functions TARGET_CFLAGS += \ _____ Modified: trunk/reactos/lib/msvcrt/Makefile --- trunk/reactos/lib/msvcrt/Makefile 2005-02-16 22:38:49 UTC (rev 13610) +++ trunk/reactos/lib/msvcrt/Makefile 2005-02-16 23:08:04 UTC (rev 13611) @@ -21,7 +21,7 @@ TARGET_GCCLIBS = gcc -TARGET_CFLAGS = -D__USE_W32API -D_MSVCRT_LIB_ -Wall -Werror +TARGET_CFLAGS = -D__USE_W32API -D_MSVCRT_LIB_ -Wall -Werror -I../crt/include # require os code to explicitly request A/W version of structs/functions TARGET_CFLAGS += \ _____ Modified: trunk/reactos/lib/msvcrt/dllmain.c --- trunk/reactos/lib/msvcrt/dllmain.c 2005-02-16 22:38:49 UTC (rev 13610) +++ trunk/reactos/lib/msvcrt/dllmain.c 2005-02-16 23:08:04 UTC (rev 13611) @@ -21,12 +21,13 @@ */ #include "precomp.h" -#include <msvcrt/internal/tls.h> +#include <stdio.h> +#include <internal/tls.h> #include <stdlib.h> -#include <msvcrt/wine/msvcrt.h> +#include <internal/wine/msvcrt.h> #define NDEBUG -#include <msvcrt/msvcrtdbg.h> +#include <internal/msvcrtdbg.h> /* EXTERNAL PROTOTYPES ********************************************************/
19 years, 10 months
1
0
0
0
[chorns] 13610: Support private messages
by chorns@svn.reactos.com
Support private messages Modified: trunk/irc/TechBot/TechBot.IRCLibrary/IrcChannel.cs Modified: trunk/irc/TechBot/TechBot.IRCLibrary/IrcClient.cs Modified: trunk/irc/TechBot/TechBot.IRCLibrary/IrcMessage.cs Modified: trunk/irc/TechBot/TechBot.IRCLibrary/IrcUser.cs Modified: trunk/irc/TechBot/TechBot.Library/IrcService.cs Modified: trunk/irc/TechBot/TechBot.Library/MessageContext.cs _____ Modified: trunk/irc/TechBot/TechBot.IRCLibrary/IrcChannel.cs --- trunk/irc/TechBot/TechBot.IRCLibrary/IrcChannel.cs 2005-02-16 22:30:50 UTC (rev 13609) +++ trunk/irc/TechBot/TechBot.IRCLibrary/IrcChannel.cs 2005-02-16 22:38:49 UTC (rev 13610) @@ -128,7 +128,10 @@ /// <param name="text">Text to send to the channel.</param> public void Talk(string text) { - owner.SendMessage(new IrcMessage(IRC.PRIVMSG, String.Format("#{0} :{1}", name, text))); + owner.SendMessage(new IrcMessage(IRC.PRIVMSG, + String.Format("#{0} :{1}", + name, + text))); } } } _____ Modified: trunk/irc/TechBot/TechBot.IRCLibrary/IrcClient.cs --- trunk/irc/TechBot/TechBot.IRCLibrary/IrcClient.cs 2005-02-16 22:30:50 UTC (rev 13609) +++ trunk/irc/TechBot/TechBot.IRCLibrary/IrcClient.cs 2005-02-16 22:38:49 UTC (rev 13610) @@ -391,7 +391,8 @@ IrcUser user = channel.LocateUser(nickname.Substring(1)); if (user == null) { - user = new IrcUser(nickname.Substring(1)); + user = new IrcUser(this, + nickname.Substring(1)); channel.Users.Add(user); } for (int i = 4; i < parameters.Length; i++) @@ -400,7 +401,8 @@ user = channel.LocateUser(nickname); if (user == null) { - user = new IrcUser(nickname); + user = new IrcUser(this, + nickname); channel.Users.Add(user); } } @@ -509,7 +511,7 @@ { throw new NotConnectedException(); } - + /* Serialize sending messages */ lock (typeof(IrcClient)) { @@ -545,16 +547,6 @@ /// <param name="text">Text to send to the channel.</param> public void TalkTo(string nickname, string text) { - if (nickname == null) - { - throw new ArgumentNullException("nickname", "Nickname cannot be null."); - } - if (text == null) - { - throw new ArgumentNullException("text", "Text cannot be null."); - } - - SendMessage(new IrcMessage(IRC.PRIVMSG, String.Format("{0} :{1}", nickname, text))); } /// <summary> _____ Modified: trunk/irc/TechBot/TechBot.IRCLibrary/IrcMessage.cs --- trunk/irc/TechBot/TechBot.IRCLibrary/IrcMessage.cs 2005-02-16 22:30:50 UTC (rev 13609) +++ trunk/irc/TechBot/TechBot.IRCLibrary/IrcMessage.cs 2005-02-16 22:38:49 UTC (rev 13610) @@ -428,7 +428,7 @@ } private const string IrcSpecial = @"-[]\`^{}"; - private const string IrcSpecialNonSpecs = @"_"; + private const string IrcSpecialNonSpecs = @"_|"; /// <summary> /// Returns wether a character is an IRC special character. _____ Modified: trunk/irc/TechBot/TechBot.IRCLibrary/IrcUser.cs --- trunk/irc/TechBot/TechBot.IRCLibrary/IrcUser.cs 2005-02-16 22:30:50 UTC (rev 13609) +++ trunk/irc/TechBot/TechBot.IRCLibrary/IrcUser.cs 2005-02-16 22:38:49 UTC (rev 13610) @@ -9,6 +9,7 @@ { #region Private fields + private IrcClient owner; private string nickname; private string decoratedNickname; @@ -17,6 +18,17 @@ #region Public properties /// <summary> + /// Owner of this channel. + /// </summary> + public IrcClient Owner + { + get + { + return owner; + } + } + + /// <summary> /// Nickname of user. /// </summary> public string Nickname @@ -65,14 +77,38 @@ /// <summary> /// Constructor. /// </summary> + /// <param name="owner">Owner of this channel.</param> /// <param name="nickname">Nickname (possibly decorated) of user.</param> - public IrcUser(string nickname) + public IrcUser(IrcClient owner, + string nickname) { + if (owner == null) + { + throw new ArgumentNullException("owner", "Owner cannot be null."); + } + this.owner = owner; this.decoratedNickname = nickname.Trim(); this.nickname = StripDecoration(decoratedNickname); } /// <summary> + /// Talk to the user. + /// </summary> + /// <param name="text">Text to send to the user.</param> + public void Talk(string text) + { + if (text == null) + { + throw new ArgumentNullException("text", "Text cannot be null."); + } + + owner.SendMessage(new IrcMessage(IRC.PRIVMSG, + String.Format("{0} :{1}", + nickname, + text))); + } + + /// <summary> /// Strip docoration of nickname. /// </summary> /// <param name="nickname">Possible decorated nickname.</param> _____ Modified: trunk/irc/TechBot/TechBot.Library/IrcService.cs --- trunk/irc/TechBot/TechBot.Library/IrcService.cs 2005-02-16 22:30:50 UTC (rev 13609) +++ trunk/irc/TechBot/TechBot.Library/IrcService.cs 2005-02-16 22:38:49 UTC (rev 13610) @@ -104,13 +104,44 @@ } } + private string GetMessageSource(MessageContext context) + { + if (context is ChannelMessageContext) + { + ChannelMessageContext channelContext = context as ChannelMessageContext; + return String.Format("#{0}", + channelContext.Channel.Name); + } + else if (context is UserMessageContext) + { + UserMessageContext userContext = context as UserMessageContext; + return userContext.User.Nickname; + } + else + { + throw new InvalidOperationException(String.Format("Unhandled message context '{0}'", + context.GetType())); + } + } + public void WriteLine(MessageContext context, string message) { - Console.WriteLine(String.Format("Sending: {0} to #{1}", - message, - context.Channel != null ? context.Channel.Name : "(null)")); - context.Channel.Talk(message); + if (context is ChannelMessageContext) + { + ChannelMessageContext channelContext = context as ChannelMessageContext; + channelContext.Channel.Talk(message); + } + else if (context is UserMessageContext) + { + UserMessageContext userContext = context as UserMessageContext; + userContext.User.Talk(message); + } + else + { + throw new InvalidOperationException(String.Format("Unhandled message context '{0}'", + context.GetType())); + } } private void ExtractMessage(string parameters, @@ -139,16 +170,36 @@ int index = message.Parameters.IndexOf(' '); if (index == -1) index = message.Parameters.Length; - channelName = message.Parameters.Substring(1, index - 1); + else + index = index - 1; + channelName = message.Parameters.Substring(1, index); return true; } + private bool GetTargetNickname(IrcMessage message, + out string nickname) + { + if (message.Parameters == null) + { + nickname = null; + return false; + } + + int index = message.Parameters.IndexOf(' '); + if (index == -1) + index = message.Parameters.Length; + nickname = message.Parameters.Substring(0, index); + Console.WriteLine("nickname: " + nickname); + return true; + } + private bool ShouldAcceptMessage(IrcMessage message, out MessageContext context) { if (message.Command.ToUpper().Equals("PRIVMSG")) { string channelName; + string nickname; if (GetChannelName(message, out channelName)) { @@ -156,11 +207,24 @@ { if (String.Compare(channel.Name, channelName, true) == 0) { - context = new MessageContext(channel); + context = new ChannelMessageContext(channel); return true; } } } + else if (GetTargetNickname(message, + out nickname)) + { + IrcUser targetUser = new IrcUser(client, + nickname); + if (String.Compare(targetUser.Nickname, botname, true) == 0) + { + IrcUser sourceUser = new IrcUser(client, + message.PrefixNickname); + context = new UserMessageContext(sourceUser); + return true; + } + } } context = null; return false; @@ -180,9 +244,9 @@ if (ShouldAcceptMessage(message, out context)) { - Console.WriteLine(String.Format("Injecting: {0} from #{1}", + Console.WriteLine(String.Format("Injecting: {0} from {1}", injectMessage, - context.Channel.Name)); + GetMessageSource(context))); service.InjectMessage(context, injectMessage); } _____ Modified: trunk/irc/TechBot/TechBot.Library/MessageContext.cs --- trunk/irc/TechBot/TechBot.Library/MessageContext.cs 2005-02-16 22:30:50 UTC (rev 13609) +++ trunk/irc/TechBot/TechBot.Library/MessageContext.cs 2005-02-16 22:38:49 UTC (rev 13610) @@ -3,8 +3,14 @@ namespace TechBot.Library { - public class MessageContext + public abstract class MessageContext { + } + + + + public class ChannelMessageContext : MessageContext + { private IrcChannel channel; public IrcChannel Channel @@ -15,9 +21,29 @@ } } - public MessageContext(IrcChannel channel) + public ChannelMessageContext(IrcChannel channel) { this.channel = channel; } } + + + + public class UserMessageContext : MessageContext + { + private IrcUser user; + + public IrcUser User + { + get + { + return user; + } + } + + public UserMessageContext(IrcUser user) + { + this.user = user; + } + } }
19 years, 10 months
1
0
0
0
[gdalsnes] 13609: ntdll:
by gdalsnes@svn.reactos.com
ntdll: -critical.c: catch (more) invalid use -impl. sscanf (stolen from wine) crt: -use native mingw headers and not private copies of them -converted some routines to using tchar == impl. many missing unicode routines -impl. sscanf and friends correctly (stolen from wine) tchar.h: -added lotsa missin stuff Modified: trunk/reactos/lib/crtdll/crtdll.def Modified: trunk/reactos/lib/crtdll/dllmain.c Modified: trunk/reactos/lib/msvcrt/dllmain.c Modified: trunk/reactos/lib/msvcrt/msvcrt.def Modified: trunk/reactos/lib/ntdll/rtl/critical.c Added: trunk/reactos/lib/ntdll/stdio/scanf.h Modified: trunk/reactos/lib/ntdll/stdio/sscanf.c Modified: trunk/reactos/lib/ntdll/stdlib/bsearch.c Modified: trunk/reactos/lib/ntdll/stdlib/lfind.c _____ Modified: trunk/reactos/lib/crtdll/crtdll.def --- trunk/reactos/lib/crtdll/crtdll.def 2005-02-16 22:29:48 UTC (rev 13608) +++ trunk/reactos/lib/crtdll/crtdll.def 2005-02-16 22:30:50 UTC (rev 13609) @@ -145,7 +145,7 @@ _finite _flsbuf _flushall -_fmode_dll=__fmode DATA +_fmode_dll=_fmode DATA _fpclass _fpieee_flt _fpreset _____ Modified: trunk/reactos/lib/crtdll/dllmain.c --- trunk/reactos/lib/crtdll/dllmain.c 2005-02-16 22:29:48 UTC (rev 13608) +++ trunk/reactos/lib/crtdll/dllmain.c 2005-02-16 22:30:50 UTC (rev 13609) @@ -22,7 +22,7 @@ #include "precomp.h" #include <msvcrt/internal/tls.h> -#include <msvcrt/stdlib.h> +#include <stdlib.h> #include <msvcrt/wine/msvcrt.h> #include <sys/stat.h> _____ Modified: trunk/reactos/lib/msvcrt/dllmain.c --- trunk/reactos/lib/msvcrt/dllmain.c 2005-02-16 22:29:48 UTC (rev 13608) +++ trunk/reactos/lib/msvcrt/dllmain.c 2005-02-16 22:30:50 UTC (rev 13609) @@ -22,7 +22,7 @@ #include "precomp.h" #include <msvcrt/internal/tls.h> -#include <msvcrt/stdlib.h> +#include <stdlib.h> #include <msvcrt/wine/msvcrt.h> #define NDEBUG @@ -66,7 +66,8 @@ { case DLL_PROCESS_ATTACH://1 /* initialize version info */ - DPRINT("Attach %d\n", nAttachCount); + //DPRINT1("Process Attach %d\n", nAttachCount); + //DPRINT1("Process Attach\n"); _osver = GetVersion(); _winmajor = (_osver >> 8) & 0xFF; _winminor = _osver & 0xFF; @@ -110,7 +111,8 @@ break; case DLL_PROCESS_DETACH://0 - DPRINT("Detach %d\n", nAttachCount); + //DPRINT1("Detach %d\n", nAttachCount); + //DPRINT("Detach\n"); /* FIXME: more cleanup... */ _fcloseall(); _____ Modified: trunk/reactos/lib/msvcrt/msvcrt.def --- trunk/reactos/lib/msvcrt/msvcrt.def 2005-02-16 22:29:48 UTC (rev 13608) +++ trunk/reactos/lib/msvcrt/msvcrt.def 2005-02-16 22:30:50 UTC (rev 13609) @@ -92,24 +92,24 @@ _HUGE DATA _Strftime _XcptFilter -;__CxxCallUnwindDtor +__CxxCallUnwindDtor=stub __CxxDetectRethrow -;__CxxExceptionFilter +__CxxExceptionFilter=stub __CxxFrameHandler -;__CxxLongjmpUnwind +__CxxLongjmpUnwind=stub __CxxQueryExceptionSize -;__CxxRegisterExceptionObject -;__CxxUnregisterExceptionObject -;__DestructExceptionObject +__CxxRegisterExceptionObject=stub +__CxxUnregisterExceptionObject=stub +__DestructExceptionObject=stub __RTCastToVoid=MSVCRT___RTCastToVoid __RTDynamicCast=MSVCRT___RTDynamicCast __RTtypeid=MSVCRT___RTtypeid -;__STRINGTOLD +__STRINGTOLD=stub __argc DATA __argv DATA __badioinfo DATA -;__crtCompareStringA ;=NTDLL.RtlCompareString -;__crtGetLocaleInfoW +__crtCompareStringA +__crtGetLocaleInfoW __crtLCMapStringA __dllonexit __doserrno @@ -122,37 +122,37 @@ __lc_codepage __lc_collate_cp __lc_handle -;__lconv_init +__lconv_init __mb_cur_max DATA __p___argc __p___argv -;__p___wargv +__p___wargv __p___initenv __p___mb_cur_max __p___winitenv __p__acmdln -;__p__amblksiz +__p__amblksiz __p__commode -;__p__daylight -;__p__dstbias +__p__daylight +__p__dstbias __p__environ -;__p__fileinfo +__p__fileinfo=stub __p__fmode __p__iob -;__p__mbcasemap -;__p__mbctype +__p__mbcasemap=stub +__p__mbctype=stub __p__osver __p__pctype __p__pgmptr __p__pwctype -;__p__timezone -;__p__tzname -;__p__wcmdln +__p__timezone +__p__tzname=stub +__p__wcmdln=stub __p__wenviron __p__winmajor __p__winminor __p__winver -;__p__wpgmptr +__p__wpgmptr=stub __pioinfo __pxcptinfoptrs __set_app_type @@ -161,65 +161,65 @@ __threadhandle __threadid __toascii -;__unDName -;__unDNameEx +__unDName=stub +__unDNameEx=stub __unguarded_readlc_active DATA __wargv __wgetmainargs __winitenv -;___lc_codepage_func -;___lc_handle_func -;___mb_cur_max_func -;___setlc_active_func -;___unguarded_readlc_active_add_func -;__crtCompareStringW -;__crtGetStringTypeW -;__crtLCMapStringW -;__iob_func -;__pctype_func -;__uncaught_exception -;__wcserror +___lc_codepage_func=stub +___lc_handle_func=stub +___mb_cur_max_func=stub +___setlc_active_func=stub +___unguarded_readlc_active_add_func=stub +__crtCompareStringW=stub +__crtGetStringTypeW=stub +__crtLCMapStringW=stub +__iob_func=stub +__pctype_func=stub +__uncaught_exception=stub +__wcserror=stub _abnormal_termination _access _acmdln DATA -;_adj_fdiv_m16i +_adj_fdiv_m16i=stub _adj_fdiv_m32 = _adj_fdiv_m32@4 _adj_fdiv_m32i = _adj_fdiv_m32i@4 _adj_fdiv_m64 = _adj_fdiv_m64@8 _adj_fdiv_r -;_adj_fdivr_m16i +_adj_fdivr_m16i=stub _adj_fdivr_m32 = _adj_fdivr_m32@4 _adj_fdivr_m32i = _adj_fdivr_m32i@4 _adj_fdivr_m64 = _adj_fdivr_m64@8 _adj_fpatan -;_adj_fprem -;_adj_fprem1 -;_adj_fptan +_adj_fprem=stub +_adj_fprem1=stub +_adj_fptan=stub _adjust_fdiv DATA _aexit_rtn -;_aligned_free -;_aligned_malloc -;_aligned_offset_malloc -;_aligned_offset_realloc -;_aligned_realloc +_aligned_free=stub +_aligned_malloc=stub +_aligned_offset_malloc=stub +_aligned_offset_realloc=stub +_aligned_realloc=stub _amsg_exit _assert -;_atodbl +_atodbl=stub _atoi64 -;_atoldbl +_atoldbl=stub _beep _beginthread _beginthreadex _c_exit _cabs -;_callnewh +_callnewh=stub _cexit _cgets -;_cgetws +_cgetws=stub _chdir _chdrive _chgsign -;_chkesp +_chkesp=stub _chmod _chsize _clearfp @@ -231,22 +231,22 @@ _copysign _cprintf _cputs -;_cputws +_cputws=stub _creat _cscanf -;_ctime64 +_ctime64=stub _ctype DATA _cwait -;_cwprintf -;_cwscanf +_cwprintf=stub +_cwscanf=stub _daylight DATA -;_dstbias +_dstbias=stub _dup _dup2 _ecvt _endthread _endthreadex -;_environ +_environ=stub _eof _errno _except_handler2 @@ -267,21 +267,21 @@ _fgetchar _fgetwchar _filbuf -;_fileinfo DATA +_fileinfo=stub DATA _filelength _filelengthi64 _fileno _findclose _findfirst -;_findfirst64 +_findfirst64=stub _findfirsti64 _findnext -;_findnext64 +_findnext64=stub _findnexti64 _finite _flsbuf _flushall -_fmode=__fmode DATA +_fmode DATA _fpclass _fpieee_flt _fpreset @@ -289,17 +289,17 @@ _fputwchar _fsopen _fstat -;_fstat64 +_fstat64=stub _fstati64 _ftime -;_ftime64 +_ftime64=stub _ftol=NTDLL._ftol _fullpath _futime -;_futime64 +_futime64=stub _gcvt _get_osfhandle -;_get_sbh_threshold +_get_sbh_threshold=stub _getch _getche _getcwd @@ -308,29 +308,30 @@ _getdllprocaddr _getdrive _getdrives -;_getmaxstdio -;_getmbcp +_get_heap_handle=stub +_getmaxstdio=stub +_getmbcp=stub _getpid _getsystime _getw -;_getwch -;_getwche -;_getws -;_gmtime64 +_getwch=stub +_getwche=stub +_getws=stub +_gmtime64=stub _global_unwind2 _heapadd _heapchk _heapmin _heapset -;_heapused +_heapused=stub _heapwalk _hypot _i64toa _i64tow _initterm -;_inp -;_inpd -;_inpw +_inp=stub +_inpd=stub +_inpw=stub _iob _isatty _isctype @@ -339,7 +340,7 @@ _ismbbgraph _ismbbkalnum _ismbbkana -;_ismbbkprint +_ismbbkprint=stub _ismbbkpunct _ismbblead _ismbbprint @@ -348,7 +349,7 @@ _ismbcalnum _ismbcalpha _ismbcdigit -;_ismbcgraph +_ismbcgraph=stub _ismbchira _ismbckata _ismbcl0 @@ -357,7 +358,7 @@ _ismbclegal _ismbclower _ismbcprint -;_ismbcpunct +_ismbcpunct=stub _ismbcspace _ismbcsymbol _ismbcupper @@ -370,13 +371,14 @@ _j1 _jn _kbhit +_localtime64=stub _lfind _loaddll _local_unwind2 _lock _locking _logb -;_longjmpex +_longjmpex=stub _lrotl _lrotr _lsearch @@ -387,7 +389,7 @@ _makepath _mbbtombc _mbbtype -;_mbcasemap +_mbcasemap=stub _mbccpy _mbcjistojms _mbcjmstojis @@ -444,17 +446,17 @@ _memicmp _mkdir _mktemp -;_mktime64 +_mktime64=stub _msize _nextafter _onexit _open _open_osfhandle _osver DATA -;_osplatform -;_outp -;_outpd -;_outpw +_osplatform=stub +_outp=stub +_outpd=stub +_outpw=stub _pclose _pctype DATA _pgmptr DATA @@ -464,38 +466,38 @@ _putch _putenv _putw -;_putwch +_putwch=stub _putws _pwctype DATA _read -;_resetstkoflw +_resetstkoflw=stub _rmdir _rmtmp _rotl _rotr -;_safe_fdiv -;_safe_fdivr -;_safe_fprem -;_safe_fprem1 +_safe_fdiv=stub +_safe_fdivr=stub +_safe_fprem=stub +_safe_fprem1=stub _scalb -;_scprintf -;_scwprintf +_scprintf=stub +_scwprintf=stub _searchenv _seh_longjmp_unwind=_seh_longjmp_unwind@4 -;_set_error_mode -;_set_SSE2_enable -;_set_sbh_threshold +_set_error_mode=stub +_set_SSE2_enable=stub +_set_sbh_threshold=stub _seterrormode _setjmp _setjmp3 -;_setmaxstdio +_setmaxstdio=stub _setmbcp _setmode _setsystime _sleep _snprintf -;_snscanf -;_snwscanf +_snscanf=stub +_snwscanf=stub _snwprintf _sopen _spawnl @@ -508,7 +510,7 @@ _spawnvpe _splitpath _stat -;_stat64 +_stat64=stub _stati64 _statusfp _strcmpi @@ -525,8 +527,8 @@ _strrev _strset _strtime -;_strtoi64 -;_strtoui64 +_strtoi64=stub +_strtoui64=stub _strupr _swab _sys_errlist DATA @@ -534,7 +536,7 @@ _tell _telli64 _tempnam -;_time64 +_time64=stub _timezone DATA _tolower _toupper @@ -546,14 +548,13 @@ _ultow _umask _ungetch -;_ungetwch _unlink _unloaddll _unlock _utime -;_utime64 -;_vscprintf -;_vscwprintf +_utime64=stub +_vscprintf=stub +_vscwprintf=stub _vsnprintf _vsnwprintf _waccess @@ -563,7 +564,7 @@ _wcmdln _wcreat _wcsdup -;_wcserror +_wcserror=stub _wcsicmp _wcsicoll _wcslwr @@ -573,26 +574,26 @@ _wcsnset _wcsrev _wcsset -;_wcstoi64 -;_wcstoui64 -;_wctime64 +_wcstoi64=stub +_wcstoui64=stub +_wctime64=stub _wcsupr _wctime -;_wenviron -;_wexecl -;_wexecle -;_wexeclp -;_wexeclpe -;_wexecv -;_wexecve -;_wexecvp -;_wexecvpe +_wenviron=stub +_wexecl +_wexecle +_wexeclp +_wexeclpe +_wexecv +_wexecve +_wexecvp +_wexecvpe _wfdopen _wfindfirst -;_wfindfirst64 +_wfindfirst64=stub _wfindfirsti64 _wfindnext -;_wfindnext64 +_wfindnext64=stub _wfindnexti64 _wfopen _wfreopen @@ -609,7 +610,7 @@ _wmktemp _wopen _wperror -;_wpgmptr DATA +_wpgmptr=stub DATA _wpopen _wputenv _wremove @@ -617,32 +618,32 @@ _write _wrmdir _wsearchenv -;_wsetlocale +_wsetlocale=stub _wsopen -;_wspawnl -;_wspawnle -;_wspawnlp -;_wspawnlpe -;_wspawnv -;_wspawnve -;_wspawnvp -;_wspawnvpe +_wspawnl +_wspawnle +_wspawnlp +_wspawnlpe +_wspawnv +_wspawnve +_wspawnvp +_wspawnvpe _wsplitpath _wstat -;_wstat64 +_wstat64=stub _wstati64 _wstrdate _wstrtime -;_wsystem +_wsystem=stub _wtempnam _wtmpnam -;_wtof +_wtof=stub _wtoi _wtoi64 _wtol _wunlink _wutime -;_wutime64 +_wutime64=stub _y0 _y1 _yn _____ Modified: trunk/reactos/lib/ntdll/rtl/critical.c --- trunk/reactos/lib/ntdll/rtl/critical.c 2005-02-16 22:29:48 UTC (rev 13608) +++ trunk/reactos/lib/ntdll/rtl/critical.c 2005-02-16 22:30:50 UTC (rev 13609) @@ -148,6 +148,13 @@ CriticalSection->RecursionCount++; return STATUS_SUCCESS; } + else if (CriticalSection->OwningThread == (HANDLE)0) + { + /* No one else owns it either! */ + DPRINT1("Critical section not initialized (guess)!\n"); + /* FIXME: raise exception */ + return STATUS_INVALID_PARAMETER; + } /* We don't own it, so we must wait for it */ RtlpWaitForCriticalSection(CriticalSection); @@ -293,7 +300,16 @@ STDCALL RtlLeaveCriticalSection( PRTL_CRITICAL_SECTION CriticalSection) -{ +{ + HANDLE Thread = (HANDLE)NtCurrentTeb()->Cid.UniqueThread; + + if (Thread != CriticalSection->OwningThread) + { + DPRINT1("Releasing critical section not owned!\n"); + /* FIXME: raise exception */ + return STATUS_INVALID_PARAMETER; + } + /* Decrease the Recursion Count */ if (--CriticalSection->RecursionCount) { _____ Added: trunk/reactos/lib/ntdll/stdio/scanf.h --- trunk/reactos/lib/ntdll/stdio/scanf.h 2005-02-16 22:29:48 UTC (rev 13608) +++ trunk/reactos/lib/ntdll/stdio/scanf.h 2005-02-16 22:30:50 UTC (rev 13609) @@ -0,0 +1,537 @@ +/* + * general implementation of scanf used by scanf, sscanf, fscanf, + * _cscanf, wscanf, swscanf and fwscanf + * + * Copyright 1996,1998 Marcus Meissner + * Copyright 1996 Jukka Iivonen + * Copyright 1997,2000, 2003 Uwe Bonnes + * Copyright 2000 Jon Griffiths + * Copyright 2002 Daniel Gudbjartsson + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifdef WIDE_SCANF +#define _CHAR_ wchar_t +#define _EOF_ WEOF +#define _EOF_RET WEOF +#define _ISSPACE_(c) iswspace(c) +#define _ISDIGIT_(c) iswdigit(c) +#define _WIDE2SUPPORTED_(c) c /* No conversion needed (wide to wide) */ +#define _CHAR2SUPPORTED_(c) c /* FIXME: convert char to wide char */ +#define _CHAR2DIGIT_(c, base) wchar2digit((c), (base)) +#define _BITMAPSIZE_ 256*256 +#else /* WIDE_SCANF */ +#define _CHAR_ char +#define _EOF_ EOF +#define _EOF_RET EOF +#define _ISSPACE_(c) isspace(c) +#define _ISDIGIT_(c) isdigit(c) +#define _WIDE2SUPPORTED_(c) c /* FIXME: convert wide char to char */ +#define _CHAR2SUPPORTED_(c) c /* No conversion needed (char to char) */ +#define _CHAR2DIGIT_(c, base) char2digit((c), (base)) +#define _BITMAPSIZE_ 256 +#endif /* WIDE_SCANF */ + +#ifdef CONSOLE +#define _GETC_(file) (consumed++, _getch()) +#define _UNGETC_(nch, file) do { _ungetch(nch); consumed--; } while(0) +#define _FUNCTION_ int vcscanf(const char *format, va_list ap) +#else +#ifdef STRING +#undef _EOF_ +#define _EOF_ 0 +#define _GETC_(file) (consumed++, *file++) +#define _UNGETC_(nch, file) do { file--; consumed--; } while(0) +#ifdef WIDE_SCANF +#define _FUNCTION_ int vswscanf(const wchar_t *file, const wchar_t *format, va_list ap) +#else /* WIDE_SCANF */ +#define _FUNCTION_ int vsscanf(const char *file, const char *format, va_list ap) +#endif /* WIDE_SCANF */ +#else /* STRING */ +#ifdef WIDE_SCANF +#define _GETC_(file) (consumed++, fgetwc(file)) +#define _UNGETC_(nch, file) do { ungetwc(nch, file); consumed--; } while(0) +#define _FUNCTION_ int vfwscanf(FILE* file, const wchar_t *format, va_list ap) +#else /* WIDE_SCANF */ +#define _GETC_(file) (consumed++, fgetc(file)) +#define _UNGETC_(nch, file) do { ungetc(nch, file); consumed--; } while(0) +#define _FUNCTION_ int vfscanf(FILE* file, const char *format, va_list ap) +#endif /* WIDE_SCANF */ +#endif /* STRING */ +#endif /* CONSOLE */ + +/********************************************************************* + * Implemented based on + *
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore9
8/html/_crt_format_specification_fields_.2d_.scanf_and_wscanf_functions. asp + * Extended by C. Scott Ananian <cananian(a)alumni.princeton.edu> to handle + * more types of format spec. + */ +_FUNCTION_ { + int rd = 0, consumed = 0; + int nch; + if (!*format) return 0; +#ifndef WIDE_SCANF +#ifdef CONSOLE + TRACE("(%s): \n", debugstr_a(format)); +#else /* CONSOLE */ +#ifdef STRING + TRACE("%s (%s)\n", file, debugstr_a(format)); +#else /* STRING */ + TRACE("%p (%s)\n", file, debugstr_a(format)); +#endif /* STRING */ +#endif /* CONSOLE */ +#endif /* WIDE_SCANF */ + nch = _GETC_(file); + if (nch == _EOF_) return _EOF_RET; + + while (*format) { + /* a whitespace character in the format string causes scanf to read, + * but not store, all consecutive white-space characters in the input + * up to the next non-white-space character. One white space character + * in the input matches any number (including zero) and combination of + * white-space characters in the input. */ + if (_ISSPACE_(*format)) { + /* skip whitespace */ + while ((nch!=_EOF_) && _ISSPACE_(nch)) + nch = _GETC_(file); + } + /* a format specification causes scanf to read and convert characters + * in the input into values of a specified type. The value is assigned + * to an argument in the argument list. Format specifications have + * the form %[*][width][{h | l | I64 | L}]type */ + else if (*format == '%') { + int st = 0; int suppress = 0; int width = 0; + int base, number_signed; + int h_prefix = 0; + int l_prefix = 0; + int L_prefix = 0; + int w_prefix = 0; + int prefix_finished = 0; + int I64_prefix = 0; + format++; + /* look for leading asterisk, which means 'suppress assignment of + * this field'. */ + if (*format=='*') { + format++; + suppress=1; + } + /* look for width specification */ + while (_ISDIGIT_(*format)) { + width*=10; + width+=*format++ - '0'; + } + if (width==0) width=-1; /* no width spec seen */ + /* read prefix (if any) */ + while (!prefix_finished) { + switch(*format) { + case 'h': h_prefix = 1; break; + case 'l': l_prefix = 1; break; + case 'w': w_prefix = 1; break; + case 'L': L_prefix = 1; break; + case 'I': + if (*(format + 1) == '6' && + *(format + 2) == '4') { + I64_prefix = 1; + format += 2; + } + break; + default: + prefix_finished = 1; + } + if (!prefix_finished) format++; + } + /* read type */ + switch(*format) { + case 'x': + case 'X': /* hexadecimal integer. */ + base = 16; number_signed = 0; + goto number; + case 'o': /* octal integer */ + base = 8; number_signed = 0; + goto number; + case 'u': /* unsigned decimal integer */ + base = 10; number_signed = 0; + goto number; + case 'd': /* signed decimal integer */ + base = 10; number_signed = 1; + goto number; + case 'i': /* generic integer */ + base = 10; number_signed = 1; + number: { + /* read an integer */ + ULONGLONG cur = 0; + int negative = 0; + int seendigit=0; + /* skip initial whitespace */ + while ((nch!=_EOF_) && _ISSPACE_(nch)) + nch = _GETC_(file); + /* get sign */ + if (number_signed && (nch == '-' || + nch == '+')) { + negative = (nch=='-'); + nch = _GETC_(file); + if (width>0) width--; + } + /* look for leading indication of base */ + if (width!=0 && nch == '0') { + nch = _GETC_(file); + if (width>0) width--; + seendigit=1; + if (width!=0 && (nch=='x' || nch=='X')) { + if (base==0) + base=16; + if (base==16) { + nch = _GETC_(file); + if (width>0) width--; + seendigit=0; + } + } else if (base==0) + base = 8; + } + /* throw away leading zeros */ + while (width!=0 && nch=='0') { + nch = _GETC_(file); + if (width>0) width--; + seendigit=1; + } + if (width!=0 && _CHAR2DIGIT_(nch, base)!=-1) { + cur = _CHAR2DIGIT_(nch, base); + nch = _GETC_(file); + if (width>0) width--; + seendigit=1; + } + /* read until no more digits */ + while (width!=0 && (nch!=_EOF_) && _CHAR2DIGIT_(nch, base)!=-1) { + cur = cur*base + _CHAR2DIGIT_(nch, base); + nch = _GETC_(file); + if (width>0) width--; + seendigit=1; + } + /* okay, done! */ + if (!seendigit) break; /* not a valid number */ + st = 1; + if (!suppress) { +#define _SET_NUMBER_(type) *va_arg(ap, type*) = negative ? -cur : cur + if (number_signed) { + if (I64_prefix) _SET_NUMBER_(LONGLONG); + else if (l_prefix) _SET_NUMBER_(long int); + else if (h_prefix) _SET_NUMBER_(short int); + else _SET_NUMBER_(int); + } else { + if (negative) { + WARN("Dropping sign in reading a negative number into an unsigned value"); + negative = 0; + } + if (I64_prefix) _SET_NUMBER_(ULONGLONG); + else if (l_prefix) _SET_NUMBER_(unsigned long int); + else if (h_prefix) + _SET_NUMBER_(unsigned short int); + else _SET_NUMBER_(unsigned int); + } + } + } + break; + case 'e': + case 'E': + case 'f': + case 'g': + case 'G': { /* read a float */ + long double cur = 0; + int negative = 0; + /* skip initial whitespace */ + while ((nch!=_EOF_) && _ISSPACE_(nch)) + nch = _GETC_(file); + /* get sign. */ + if (nch == '-' || nch == '+') { + negative = (nch=='-'); + if (width>0) width--; + if (width==0) break; + nch = _GETC_(file); + } + /* get first digit. */ + if ('.' != nch) { + if (!_ISDIGIT_(nch)) break; + cur = (nch - '0'); + nch = _GETC_(file); + if (width>0) width--; + /* read until no more digits */ + while (width!=0 && (nch!=_EOF_) && _ISDIGIT_(nch)) { + cur = cur*10 + (nch - '0'); + nch = _GETC_(file); + if (width>0) width--; + } + } else { + cur = 0; /* MaxPayneDemo Fix: .8 -> 0.8 */ + } + /* handle decimals */ + if (width!=0 && nch == '.') { + float dec = 1; + nch = _GETC_(file); + if (width>0) width--; + while (width!=0 && (nch!=_EOF_) && _ISDIGIT_(nch)) { + dec /= 10; + cur += dec * (nch - '0'); + nch = _GETC_(file); + if (width>0) width--; + } + } + /* handle exponent */ + if (width!=0 && (nch == 'e' || nch == 'E')) { + int exponent = 0, negexp = 0; + float expcnt; + nch = _GETC_(file); + if (width>0) width--; + /* possible sign on the exponent */ + if (width!=0 && (nch=='+' || nch=='-')) { + negexp = (nch=='-'); + nch = _GETC_(file); + if (width>0) width--; + } + /* exponent digits */ + while (width!=0 && (nch!=_EOF_) && _ISDIGIT_(nch)) { + exponent *= 10; + exponent += (nch - '0'); + nch = _GETC_(file); + if (width>0) width--; + } + /* update 'cur' with this exponent. */ + expcnt = negexp ? .1 : 10; + while (exponent!=0) { + if (exponent&1) + cur*=expcnt; + exponent/=2; + expcnt=expcnt*expcnt; + } + } + st = 1; [truncated at 1000 lines; 292 more skipped]
19 years, 10 months
1
0
0
0
[gdalsnes] 13608: ntdll:
by gdalsnes@svn.reactos.com
ntdll: -critical.c: catch (more) invalid use -impl. sscanf (stolen from wine) crt: -use native mingw headers and not private copies of them -converted some routines to using tchar == impl. many missing unicode routines -impl. sscanf and friends correctly (stolen from wine) tchar.h: -added lotsa missin stuff Modified: trunk/reactos/lib/crt/conio/cgets.c Modified: trunk/reactos/lib/crt/conio/cprintf.c Modified: trunk/reactos/lib/crt/conio/cputs.c Deleted: trunk/reactos/lib/crt/conio/cscanf.c Modified: trunk/reactos/lib/crt/conio/getch.c Modified: trunk/reactos/lib/crt/conio/getche.c Modified: trunk/reactos/lib/crt/conio/kbhit.c Modified: trunk/reactos/lib/crt/conio/putch.c Modified: trunk/reactos/lib/crt/conio/ungetch.c Modified: trunk/reactos/lib/crt/ctype/ctype.c Modified: trunk/reactos/lib/crt/ctype/isalnum.c Modified: trunk/reactos/lib/crt/ctype/isalpha.c Modified: trunk/reactos/lib/crt/ctype/isascii.c Modified: trunk/reactos/lib/crt/ctype/iscntrl.c Modified: trunk/reactos/lib/crt/ctype/iscsym.c Modified: trunk/reactos/lib/crt/ctype/isctype.c Modified: trunk/reactos/lib/crt/ctype/isdigit.c Modified: trunk/reactos/lib/crt/ctype/isgraph.c Modified: trunk/reactos/lib/crt/ctype/islower.c Modified: trunk/reactos/lib/crt/ctype/isprint.c Modified: trunk/reactos/lib/crt/ctype/ispunct.c Modified: trunk/reactos/lib/crt/ctype/isspace.c Modified: trunk/reactos/lib/crt/ctype/isupper.c Modified: trunk/reactos/lib/crt/ctype/isxdigit.c Modified: trunk/reactos/lib/crt/ctype/toascii.c Modified: trunk/reactos/lib/crt/ctype/tolower.c Modified: trunk/reactos/lib/crt/ctype/toupper.c Modified: trunk/reactos/lib/crt/direct/chdir.c Modified: trunk/reactos/lib/crt/direct/chdrive.c Modified: trunk/reactos/lib/crt/direct/getcwd.c Modified: trunk/reactos/lib/crt/direct/getdcwd.c Modified: trunk/reactos/lib/crt/direct/getdfree.c Modified: trunk/reactos/lib/crt/direct/getdrive.c Modified: trunk/reactos/lib/crt/direct/mkdir.c Modified: trunk/reactos/lib/crt/direct/rmdir.c Modified: trunk/reactos/lib/crt/direct/wchdir.c Modified: trunk/reactos/lib/crt/direct/wgetcwd.c Modified: trunk/reactos/lib/crt/direct/wgetdcwd.c Modified: trunk/reactos/lib/crt/direct/wmkdir.c Modified: trunk/reactos/lib/crt/direct/wrmdir.c Modified: trunk/reactos/lib/crt/float/chgsign.c Modified: trunk/reactos/lib/crt/float/clearfp.c Modified: trunk/reactos/lib/crt/float/cntrlfp.c Modified: trunk/reactos/lib/crt/float/copysign.c Modified: trunk/reactos/lib/crt/float/fpclass.c Modified: trunk/reactos/lib/crt/float/fpecode.c Modified: trunk/reactos/lib/crt/float/fpreset.c Modified: trunk/reactos/lib/crt/float/isnan.c Modified: trunk/reactos/lib/crt/float/logb.c Modified: trunk/reactos/lib/crt/float/nafter.c Modified: trunk/reactos/lib/crt/float/scalb.c Modified: trunk/reactos/lib/crt/float/statfp.c Modified: trunk/reactos/lib/crt/io/access.c Modified: trunk/reactos/lib/crt/io/chmod.c Modified: trunk/reactos/lib/crt/io/chsize.c Modified: trunk/reactos/lib/crt/io/close.c Modified: trunk/reactos/lib/crt/io/commit.c Modified: trunk/reactos/lib/crt/io/create.c Modified: trunk/reactos/lib/crt/io/dup.c Modified: trunk/reactos/lib/crt/io/dup2.c Modified: trunk/reactos/lib/crt/io/eof.c Modified: trunk/reactos/lib/crt/io/filelen.c Modified: trunk/reactos/lib/crt/io/fileleni.c Modified: trunk/reactos/lib/crt/io/find.c Modified: trunk/reactos/lib/crt/io/fmode.c Modified: trunk/reactos/lib/crt/io/isatty.c Modified: trunk/reactos/lib/crt/io/locking.c Modified: trunk/reactos/lib/crt/io/lseek.c Modified: trunk/reactos/lib/crt/io/lseeki64.c Modified: trunk/reactos/lib/crt/io/mktemp.c Modified: trunk/reactos/lib/crt/io/open.c Modified: trunk/reactos/lib/crt/io/pipe.c Modified: trunk/reactos/lib/crt/io/read.c Modified: trunk/reactos/lib/crt/io/setmode.c Modified: trunk/reactos/lib/crt/io/sopen.c Modified: trunk/reactos/lib/crt/io/tell.c Modified: trunk/reactos/lib/crt/io/telli64.c Modified: trunk/reactos/lib/crt/io/umask.c Modified: trunk/reactos/lib/crt/io/unlink.c Modified: trunk/reactos/lib/crt/io/utime.c Modified: trunk/reactos/lib/crt/io/waccess.c Modified: trunk/reactos/lib/crt/io/wchmod.c Modified: trunk/reactos/lib/crt/io/wcreate.c Modified: trunk/reactos/lib/crt/io/wfind.c Modified: trunk/reactos/lib/crt/io/wmktemp.c Modified: trunk/reactos/lib/crt/io/wopen.c Modified: trunk/reactos/lib/crt/io/write.c Modified: trunk/reactos/lib/crt/io/wunlink.c Modified: trunk/reactos/lib/crt/io/wutime.c Modified: trunk/reactos/lib/crt/locale/locale.c Modified: trunk/reactos/lib/crt/makefile Modified: trunk/reactos/lib/crt/math/acos.c Modified: trunk/reactos/lib/crt/math/asin.c Modified: trunk/reactos/lib/crt/math/atan.c Modified: trunk/reactos/lib/crt/math/atan2.c Modified: trunk/reactos/lib/crt/math/cabs.c Modified: trunk/reactos/lib/crt/math/ceil.c Modified: trunk/reactos/lib/crt/math/cos.c Modified: trunk/reactos/lib/crt/math/cosh.c Modified: trunk/reactos/lib/crt/math/exp.c [truncated at 100 lines; 288 more skipped] _____ Modified: trunk/reactos/lib/crt/conio/cgets.c --- trunk/reactos/lib/crt/conio/cgets.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/conio/cgets.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -6,8 +6,8 @@ * PROGRAMMER: Eric Kohl (Imported from DJGPP) */ -#include <msvcrt/conio.h> -#include <msvcrt/stdlib.h> +#include <conio.h> +#include <stdlib.h> /* * @implemented _____ Modified: trunk/reactos/lib/crt/conio/cprintf.c --- trunk/reactos/lib/crt/conio/cprintf.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/conio/cprintf.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -6,8 +6,9 @@ * PROGRAMMER: Eric Kohl (Imported from DJGPP) */ -#include <msvcrt/stdio.h> -#include <msvcrt/conio.h> +#include <stdio.h> +#include <stdarg.h> +#include <conio.h> /* * @unimplemented _____ Modified: trunk/reactos/lib/crt/conio/cputs.c --- trunk/reactos/lib/crt/conio/cputs.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/conio/cputs.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -9,10 +9,10 @@ */ #include "precomp.h" -#include <msvcrt/conio.h> -#include <msvcrt/string.h> -#include <msvcrt/stdio.h> -#include <msvcrt/internal/file.h> +#include <conio.h> +#include <string.h> +#include <stdio.h> +#include <internal/file.h> /* @@ -22,7 +22,7 @@ { int len = strlen(_str); DWORD written = 0; - if (!WriteFile(filehnd(stdout->_file),_str,len,&written,NULL)) + if (!WriteFile( fdinfo(stdout->_file)->hFile ,_str,len,&written,NULL)) return -1; return 0; } _____ Deleted: trunk/reactos/lib/crt/conio/cscanf.c --- trunk/reactos/lib/crt/conio/cscanf.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/conio/cscanf.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,29 +0,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: msvcrt/conio/cscanf.c - * PURPOSE: C Runtime - * PROGRAMMER: Eric Kohl (Imported from DJGPP) - */ - -#include <msvcrt/conio.h> -#include <msvcrt/stdarg.h> -#include <msvcrt/stdio.h> -#include <msvcrt/internal/stdio.h> - -/* - * @unimplemented - */ -int _cscanf(char *fmt, ...) -{ - int cnt; - - va_list ap; - - //fixme cscanf should scan the console's keyboard - va_start(ap, fmt); - cnt = __vscanf(fmt, ap); - va_end(ap); - - return cnt; -} _____ Modified: trunk/reactos/lib/crt/conio/getch.c --- trunk/reactos/lib/crt/conio/getch.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/conio/getch.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -9,10 +9,10 @@ */ #include "precomp.h" -#include <msvcrt/conio.h> -#include <msvcrt/stdio.h> -#include <msvcrt/io.h> -#include <msvcrt/internal/console.h> +#include <conio.h> +#include <stdio.h> +#include <io.h> +#include <internal/console.h> /* @@ -26,7 +26,7 @@ c = ungot_char; char_avail = 0; } else { - ReadConsoleA(_get_osfhandle(stdin->_file), + ReadConsoleA((HANDLE)_get_osfhandle(stdin->_file), &c, 1, &NumberOfCharsRead, _____ Modified: trunk/reactos/lib/crt/conio/getche.c --- trunk/reactos/lib/crt/conio/getche.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/conio/getche.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -10,11 +10,11 @@ * 28/12/98: Created */ -#include <msvcrt/conio.h> -#include <msvcrt/internal/console.h> +#include <conio.h> +#include <internal/console.h> -int getche(void) +int _getche(void) { if (char_avail) /* @@ -26,6 +26,6 @@ * hasn't been got by a conio function. * We don't echo again. */ - return(getch()); - return (_putch(getch())); + return(_getch()); + return (_putch(_getch())); } _____ Modified: trunk/reactos/lib/crt/conio/kbhit.c --- trunk/reactos/lib/crt/conio/kbhit.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/conio/kbhit.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -9,8 +9,8 @@ */ #include "precomp.h" -#include <msvcrt/conio.h> -#include <msvcrt/internal/console.h> +#include <conio.h> +#include <internal/console.h> /* _____ Modified: trunk/reactos/lib/crt/conio/putch.c --- trunk/reactos/lib/crt/conio/putch.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/conio/putch.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -9,7 +9,7 @@ */ #include "precomp.h" -#include <msvcrt/conio.h> +#include <conio.h> /* * @implemented _____ Modified: trunk/reactos/lib/crt/conio/ungetch.c --- trunk/reactos/lib/crt/conio/ungetch.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/conio/ungetch.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -10,8 +10,8 @@ * 28/12/98: Created */ -#include <msvcrt/conio.h> -#include <msvcrt/internal/console.h> +#include <conio.h> +#include <internal/console.h> #define EOF -1 _____ Modified: trunk/reactos/lib/crt/ctype/ctype.c --- trunk/reactos/lib/crt/ctype/ctype.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/ctype/ctype.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -6,7 +6,7 @@ * PROGRAMMER: Copyright (C) 1995 DJ Delorie */ -#include <msvcrt/ctype.h> +#include <ctype.h> unsigned short _ctype[] = { 0, /* <EOF>, 0xFFFF */ _____ Modified: trunk/reactos/lib/crt/ctype/isalnum.c --- trunk/reactos/lib/crt/ctype/isalnum.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/ctype/isalnum.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -7,7 +7,7 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include <msvcrt/ctype.h> +#include <ctype.h> #undef isalnum _____ Modified: trunk/reactos/lib/crt/ctype/isalpha.c --- trunk/reactos/lib/crt/ctype/isalpha.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/ctype/isalpha.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -8,7 +8,7 @@ * 28/12/98: Created */ -#include <msvcrt/ctype.h> +#include <ctype.h> #undef isalpha _____ Modified: trunk/reactos/lib/crt/ctype/isascii.c --- trunk/reactos/lib/crt/ctype/isascii.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/ctype/isascii.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -8,7 +8,7 @@ * 28/12/98: Created */ -#include <msvcrt/ctype.h> +#include <ctype.h> /* * @implemented _____ Modified: trunk/reactos/lib/crt/ctype/iscntrl.c --- trunk/reactos/lib/crt/ctype/iscntrl.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/ctype/iscntrl.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -6,7 +6,7 @@ * PROGRAMMER: Copyright (C) 1995 DJ Delorie */ -#include <msvcrt/ctype.h> +#include <ctype.h> #undef iscntrl /* _____ Modified: trunk/reactos/lib/crt/ctype/iscsym.c --- trunk/reactos/lib/crt/ctype/iscsym.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/ctype/iscsym.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -7,7 +7,7 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include <msvcrt/ctype.h> +#include <ctype.h> /* _____ Modified: trunk/reactos/lib/crt/ctype/isctype.c --- trunk/reactos/lib/crt/ctype/isctype.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/ctype/isctype.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -6,7 +6,7 @@ * PROGRAMMER: Copyright (C) 1995 DJ Delorie */ -#include <msvcrt/ctype.h> +#include <ctype.h> extern unsigned short _ctype[]; @@ -34,7 +34,7 @@ /* * @implemented */ -int _isctype(unsigned int c, int ctypeFlags) +int _isctype(int c, int ctypeFlags) { return (_pctype[(unsigned char)(c & 0xFF)] & ctypeFlags); } _____ Modified: trunk/reactos/lib/crt/ctype/isdigit.c --- trunk/reactos/lib/crt/ctype/isdigit.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/ctype/isdigit.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -6,7 +6,7 @@ * PROGRAMMER: Copyright (C) 1995 DJ Delorie */ -#include <msvcrt/ctype.h> +#include <ctype.h> #undef isdigit _____ Modified: trunk/reactos/lib/crt/ctype/isgraph.c --- trunk/reactos/lib/crt/ctype/isgraph.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/ctype/isgraph.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -6,7 +6,7 @@ * PROGRAMMER: Copyright (C) 1995 DJ Delorie */ -#include <msvcrt/ctype.h> +#include <ctype.h> #undef isgraph /* _____ Modified: trunk/reactos/lib/crt/ctype/islower.c --- trunk/reactos/lib/crt/ctype/islower.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/ctype/islower.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -6,7 +6,7 @@ * PROGRAMMER: Copyright (C) 1995 DJ Delorie */ -#include <msvcrt/ctype.h> +#include <ctype.h> #undef islower _____ Modified: trunk/reactos/lib/crt/ctype/isprint.c --- trunk/reactos/lib/crt/ctype/isprint.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/ctype/isprint.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -6,7 +6,7 @@ * PROGRAMMER: Copyright (C) 1995 DJ Delorie */ -#include <msvcrt/ctype.h> +#include <ctype.h> #undef isprint /* _____ Modified: trunk/reactos/lib/crt/ctype/ispunct.c --- trunk/reactos/lib/crt/ctype/ispunct.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/ctype/ispunct.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -6,7 +6,7 @@ * PROGRAMMER: Copyright (C) 1995 DJ Delorie */ -#include <msvcrt/ctype.h> +#include <ctype.h> #undef ispunct /* _____ Modified: trunk/reactos/lib/crt/ctype/isspace.c --- trunk/reactos/lib/crt/ctype/isspace.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/ctype/isspace.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -8,7 +8,7 @@ * 28/12/98: Created */ -#include <msvcrt/ctype.h> +#include <ctype.h> #undef isspace _____ Modified: trunk/reactos/lib/crt/ctype/isupper.c --- trunk/reactos/lib/crt/ctype/isupper.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/ctype/isupper.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -6,7 +6,7 @@ * PROGRAMMER: Copyright (C) 1995 DJ Delorie */ -#include <msvcrt/ctype.h> +#include <ctype.h> #undef isupper /* _____ Modified: trunk/reactos/lib/crt/ctype/isxdigit.c --- trunk/reactos/lib/crt/ctype/isxdigit.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/ctype/isxdigit.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -6,7 +6,7 @@ * PROGRAMMER: Copyright (C) 1995 DJ Delorie */ -#include <msvcrt/ctype.h> +#include <ctype.h> #undef isxdigit /* _____ Modified: trunk/reactos/lib/crt/ctype/toascii.c --- trunk/reactos/lib/crt/ctype/toascii.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/ctype/toascii.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -6,7 +6,7 @@ * PROGRAMMER: Copyright (C) 1995 DJ Delorie */ -#include <msvcrt/ctype.h> +#include <ctype.h> /* * @implemented _____ Modified: trunk/reactos/lib/crt/ctype/tolower.c --- trunk/reactos/lib/crt/ctype/tolower.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/ctype/tolower.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -6,7 +6,7 @@ * PROGRAMMER: Copyright (C) 1995 DJ Delorie */ -#include <msvcrt/ctype.h> +#include <ctype.h> #undef tolower /* _____ Modified: trunk/reactos/lib/crt/ctype/toupper.c --- trunk/reactos/lib/crt/ctype/toupper.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/ctype/toupper.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -6,7 +6,7 @@ * PROGRAMMER: Copyright (C) 1995 DJ Delorie */ -#include <msvcrt/ctype.h> +#include <ctype.h> #undef toupper /* _____ Modified: trunk/reactos/lib/crt/direct/chdir.c --- trunk/reactos/lib/crt/direct/chdir.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/direct/chdir.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,7 +1,7 @@ #include "precomp.h" -#include <msvcrt/ctype.h> -#include <msvcrt/direct.h> -#include <msvcrt/internal/file.h> +#include <ctype.h> +#include <direct.h> +#include <internal/file.h> /* * @implemented _____ Modified: trunk/reactos/lib/crt/direct/chdrive.c --- trunk/reactos/lib/crt/direct/chdrive.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/direct/chdrive.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,9 +1,9 @@ #include "precomp.h" -#include <msvcrt/ctype.h> -#include <msvcrt/direct.h> -#include <msvcrt/stdlib.h> -#include <msvcrt/errno.h> -#include <msvcrt/internal/file.h> +#include <ctype.h> +#include <direct.h> +#include <stdlib.h> +#include <errno.h> +#include <internal/file.h> int cur_drive = 0; _____ Modified: trunk/reactos/lib/crt/direct/getcwd.c --- trunk/reactos/lib/crt/direct/getcwd.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/direct/getcwd.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,8 +1,8 @@ #include "precomp.h" -#include <msvcrt/direct.h> -#include <msvcrt/stdlib.h> -#include <msvcrt/errno.h> -#include <msvcrt/internal/file.h> +#include <direct.h> +#include <stdlib.h> +#include <errno.h> +#include <internal/file.h> /* _____ Modified: trunk/reactos/lib/crt/direct/getdcwd.c --- trunk/reactos/lib/crt/direct/getdcwd.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/direct/getdcwd.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,6 +1,6 @@ #include "precomp.h" -#include <msvcrt/direct.h> -#include <msvcrt/internal/file.h> +#include <direct.h> +#include <internal/file.h> /* * @implemented _____ Modified: trunk/reactos/lib/crt/direct/getdfree.c --- trunk/reactos/lib/crt/direct/getdfree.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/direct/getdfree.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,6 +1,6 @@ #include "precomp.h" -#include <msvcrt/ctype.h> -#include <msvcrt/direct.h> +#include <ctype.h> +#include <direct.h> /* _____ Modified: trunk/reactos/lib/crt/direct/getdrive.c --- trunk/reactos/lib/crt/direct/getdrive.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/direct/getdrive.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,6 +1,6 @@ #include "precomp.h" -#include <msvcrt/ctype.h> -#include <msvcrt/direct.h> +#include <ctype.h> +#include <direct.h> extern int cur_drive; _____ Modified: trunk/reactos/lib/crt/direct/mkdir.c --- trunk/reactos/lib/crt/direct/mkdir.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/direct/mkdir.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,6 +1,6 @@ #include "precomp.h" -#include <msvcrt/direct.h> -#include <msvcrt/internal/file.h> +#include <direct.h> +#include <internal/file.h> /* _____ Modified: trunk/reactos/lib/crt/direct/rmdir.c --- trunk/reactos/lib/crt/direct/rmdir.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/direct/rmdir.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,6 +1,6 @@ #include "precomp.h" -#include <msvcrt/direct.h> -#include <msvcrt/internal/file.h> +#include <direct.h> +#include <internal/file.h> /* _____ Modified: trunk/reactos/lib/crt/direct/wchdir.c --- trunk/reactos/lib/crt/direct/wchdir.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/direct/wchdir.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,8 +1,7 @@ #include "precomp.h" -#include <msvcrt/ctype.h> -#include <msvcrt/direct.h> -#include <msvcrt/internal/file.h> -#include <msvcrt/internal/file.h> +#include <ctype.h> +#include <direct.h> +#include <internal/file.h> /* * @implemented _____ Modified: trunk/reactos/lib/crt/direct/wgetcwd.c --- trunk/reactos/lib/crt/direct/wgetcwd.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/direct/wgetcwd.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,8 +1,8 @@ #include "precomp.h" -#include <msvcrt/direct.h> -#include <msvcrt/stdlib.h> -#include <msvcrt/errno.h> -#include <msvcrt/internal/file.h> +#include <direct.h> +#include <stdlib.h> +#include <errno.h> +#include <internal/file.h> /* _____ Modified: trunk/reactos/lib/crt/direct/wgetdcwd.c --- trunk/reactos/lib/crt/direct/wgetdcwd.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/direct/wgetdcwd.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,6 +1,6 @@ #include "precomp.h" -#include <msvcrt/direct.h> -#include <msvcrt/internal/file.h> +#include <direct.h> +#include <internal/file.h> /* _____ Modified: trunk/reactos/lib/crt/direct/wmkdir.c --- trunk/reactos/lib/crt/direct/wmkdir.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/direct/wmkdir.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,6 +1,6 @@ #include "precomp.h" -#include <msvcrt/direct.h> -#include <msvcrt/internal/file.h> +#include <direct.h> +#include <internal/file.h> /* _____ Modified: trunk/reactos/lib/crt/direct/wrmdir.c --- trunk/reactos/lib/crt/direct/wrmdir.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/direct/wrmdir.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,6 +1,6 @@ #include "precomp.h" -#include <msvcrt/direct.h> -#include <msvcrt/internal/file.h> +#include <direct.h> +#include <internal/file.h> /* _____ Modified: trunk/reactos/lib/crt/float/chgsign.c --- trunk/reactos/lib/crt/float/chgsign.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/float/chgsign.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,5 +1,5 @@ -#include <msvcrt/float.h> -#include <msvcrt/internal/ieee.h> +#include <float.h> +#include <internal/ieee.h> /* _____ Modified: trunk/reactos/lib/crt/float/clearfp.c --- trunk/reactos/lib/crt/float/clearfp.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/float/clearfp.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,4 +1,4 @@ -#include <msvcrt/float.h> +#include <float.h> /* * @implemented _____ Modified: trunk/reactos/lib/crt/float/cntrlfp.c --- trunk/reactos/lib/crt/float/cntrlfp.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/float/cntrlfp.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,6 +1,6 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include <msvcrt/float.h> +#include <float.h> #define X87_CW_IM (1<<0) /* Invalid operation mask */ #define X87_CW_DM (1<<1) /* Denormal operand mask */ _____ Modified: trunk/reactos/lib/crt/float/copysign.c --- trunk/reactos/lib/crt/float/copysign.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/float/copysign.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,5 +1,5 @@ -#include <msvcrt/float.h> -#include <msvcrt/internal/ieee.h> +#include <float.h> +#include <internal/ieee.h> /* * @implemented _____ Modified: trunk/reactos/lib/crt/float/fpclass.c --- trunk/reactos/lib/crt/float/fpclass.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/float/fpclass.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,6 +1,6 @@ -#include <msvcrt/float.h> -#include <msvcrt/math.h> -#include <msvcrt/internal/ieee.h> +#include <float.h> +#include <math.h> +#include <internal/ieee.h> #define _FPCLASS_SNAN 0x0001 /* signaling NaN */ _____ Modified: trunk/reactos/lib/crt/float/fpecode.c --- trunk/reactos/lib/crt/float/fpecode.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/float/fpecode.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -2,8 +2,8 @@ #undef __USE_W32API #endif -#include <msvcrt/float.h> -#include <msvcrt/internal/tls.h> +#include <float.h> +#include <internal/tls.h> /* * @implemented _____ Modified: trunk/reactos/lib/crt/float/fpreset.c --- trunk/reactos/lib/crt/float/fpreset.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/float/fpreset.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,4 +1,4 @@ -#include <msvcrt/float.h> +#include <float.h> /* _____ Modified: trunk/reactos/lib/crt/float/isnan.c --- trunk/reactos/lib/crt/float/isnan.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/float/isnan.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -16,9 +16,9 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <msvcrt/math.h> -#include <msvcrt/float.h> -#include <msvcrt/internal/ieee.h> +#include <math.h> +#include <float.h> +#include <internal/ieee.h> /* _____ Modified: trunk/reactos/lib/crt/float/logb.c --- trunk/reactos/lib/crt/float/logb.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/float/logb.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -18,7 +18,7 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <msvcrt/float.h> +#include <float.h> double _logb (double __x) { _____ Modified: trunk/reactos/lib/crt/float/nafter.c --- trunk/reactos/lib/crt/float/nafter.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/float/nafter.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,4 +1,4 @@ -#include <msvcrt/float.h> +#include <float.h> /* @@ -9,7 +9,7 @@ if ( x == y) return x; - if ( isnan(x) || isnan(y) ) + if ( _isnan(x) || _isnan(y) ) return x; return x; _____ Modified: trunk/reactos/lib/crt/float/scalb.c --- trunk/reactos/lib/crt/float/scalb.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/float/scalb.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,5 +1,5 @@ -#include <msvcrt/float.h> -#include <msvcrt/internal/ieee.h> +#include <float.h> +#include <internal/ieee.h> /* * @implemented _____ Modified: trunk/reactos/lib/crt/float/statfp.c --- trunk/reactos/lib/crt/float/statfp.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/float/statfp.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,4 +1,4 @@ -#include <msvcrt/float.h> +#include <float.h> /* * @implemented _____ Modified: trunk/reactos/lib/crt/io/access.c --- trunk/reactos/lib/crt/io/access.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/io/access.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,17 +1,26 @@ #include "precomp.h" -#include <msvcrt/io.h> -#include <msvcrt/errno.h> +#include <io.h> +#include <errno.h> +#include <tchar.h> +#include <internal/file.h> + #define NDEBUG -#include <msvcrt/msvcrtdbg.h> +#include <internal/msvcrtdbg.h> +#ifdef _UNICODE + #define _TS S +#else + #define _TS s +#endif + /* * @implemented */ -int _access( const char *_path, int _amode ) +int _taccess( const _TCHAR *_path, int _amode ) { - DWORD Attributes = GetFileAttributesA(_path); - DPRINT("_access('%s', %x)\n", _path, _amode); + DWORD Attributes = GetFileAttributes(_path); + DPRINT(MK_STR(_taccess)"('%"_TS"', %x)\n", _path, _amode); if (Attributes == -1) { _dosmaperr(GetLastError()); @@ -23,11 +32,31 @@ return -1; } } - if ((_amode & D_OK) == D_OK) { - if ((Attributes & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY) { - __set_errno(EACCES); - return -1; - } - } + return 0; } + + + +/* + * INTERNAL + */ +int access_dirT(const _TCHAR *_path) +{ + DWORD Attributes = GetFileAttributes(_path); + DPRINT(MK_STR(is_dirT)"('%"_TS"')\n", _path); + + if (Attributes == -1) { + _dosmaperr(GetLastError()); + return -1; + } + + if ((Attributes & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY) + { + __set_errno(EACCES); + return -1; + } + + return 0; +} + _____ Modified: trunk/reactos/lib/crt/io/chmod.c --- trunk/reactos/lib/crt/io/chmod.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/io/chmod.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,24 +1,28 @@ + #include "precomp.h" -#include <msvcrt/io.h> -#include <msvcrt/internal/file.h> +#include <io.h> +#include <sys/stat.h> +#include <tchar.h> +#include <internal/file.h> #define NDEBUG -#include <msvcrt/msvcrtdbg.h> +#include <internal/msvcrtdbg.h> + #define mode_t int /* * @implemented */ -int _chmod(const char* filename, mode_t mode) +int _tchmod(const _TCHAR* filename, mode_t mode) { DWORD FileAttributes = 0; BOOLEAN Set = FALSE; - DPRINT("_chmod('%s', %x)\n", filename, mode); + DPRINT(#_tchmod"('%"sT"', %x)\n", filename, mode); - FileAttributes = GetFileAttributesA(filename); + FileAttributes = GetFileAttributes(filename); if ( FileAttributes == -1 ) { _dosmaperr(GetLastError()); return -1; @@ -38,7 +42,7 @@ Set = TRUE; } } - if (Set && SetFileAttributesA(filename, FileAttributes) == FALSE) { + if (Set && SetFileAttributes(filename, FileAttributes) == FALSE) { _dosmaperr(GetLastError()); return -1; } _____ Modified: trunk/reactos/lib/crt/io/chsize.c --- trunk/reactos/lib/crt/io/chsize.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/io/chsize.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,8 +1,8 @@ /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ -#include <msvcrt/io.h> +#include <io.h> #define NDEBUG -#include <msvcrt/msvcrtdbg.h> +#include <internal/msvcrtdbg.h> /* * @implemented @@ -10,7 +10,7 @@ int _chsize(int _fd, long size) { DPRINT("_chsize(fd %d, size %d)\n", _fd, size); - if (lseek(_fd, size, 0) == -1) + if (_lseek(_fd, size, 0) == -1) return -1; if (_write(_fd, 0, 0) < 0) return -1; _____ Modified: trunk/reactos/lib/crt/io/close.c --- trunk/reactos/lib/crt/io/close.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/io/close.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,19 +1,22 @@ #include "precomp.h" -#include <msvcrt/io.h> -#include <msvcrt/internal/file.h> +#include <io.h> +#include <internal/file.h> #define NDEBUG -#include <msvcrt/msvcrtdbg.h> +#include <internal/msvcrtdbg.h> /* * @implemented */ int _close(int _fd) { - DPRINT("_close(fd %d)\n", _fd); - if (_fd == -1) - return -1; - if (CloseHandle(_get_osfhandle(_fd)) == FALSE) - return -1; - return __fileno_close(_fd); + TRACE("_close(%i)", _fd); + + if (_fd == -1) + return(-1); + if (CloseHandle((HANDLE)_get_osfhandle(_fd)) == FALSE) + return(-1); + //return + free_fd(_fd); + return(0); } _____ Modified: trunk/reactos/lib/crt/io/commit.c --- trunk/reactos/lib/crt/io/commit.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/io/commit.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,7 +1,7 @@ #include "precomp.h" -#include <msvcrt/io.h> -#include <msvcrt/errno.h> -#include <msvcrt/internal/file.h> +#include <io.h> +#include <errno.h> +#include <internal/file.h> /* @@ -9,7 +9,7 @@ */ int _commit(int _fd) { - if (! FlushFileBuffers(_get_osfhandle(_fd)) ) { + if (! FlushFileBuffers((HANDLE)_get_osfhandle(_fd)) ) { __set_errno(EBADF); return -1; } _____ Modified: trunk/reactos/lib/crt/io/create.c --- trunk/reactos/lib/crt/io/create.c 2005-02-16 22:29:16 UTC (rev 13607) +++ trunk/reactos/lib/crt/io/create.c 2005-02-16 22:29:48 UTC (rev 13608) @@ -1,8 +1,8 @@ -#include <msvcrt/io.h> -#include <msvcrt/fcntl.h> +#include <io.h> +#include <fcntl.h> #define NDEBUG -#include <msvcrt/msvcrtdbg.h> +#include <internal/msvcrtdbg.h> [truncated at 1000 lines; 12226 more skipped]
19 years, 10 months
1
0
0
0
[gdalsnes] 13607: ntdll:
by gdalsnes@svn.reactos.com
ntdll: -critical.c: catch (more) invalid use -impl. sscanf (stolen from wine) crt: -use native mingw headers and not private copies of them -converted some routines to using tchar == impl. many missing unicode routines -impl. sscanf and friends correctly (stolen from wine) tchar.h: -added lotsa missin stuff Added: trunk/reactos/lib/crt/include/ Added: trunk/reactos/lib/crt/include/internal/ Added: trunk/reactos/lib/crt/include/internal/atexit.h Added: trunk/reactos/lib/crt/include/internal/console.h Added: trunk/reactos/lib/crt/include/internal/file.h Added: trunk/reactos/lib/crt/include/internal/ieee.h Added: trunk/reactos/lib/crt/include/internal/math.h Added: trunk/reactos/lib/crt/include/internal/mbstring.h Added: trunk/reactos/lib/crt/include/internal/msvcrtdbg.h Added: trunk/reactos/lib/crt/include/internal/mtdll.h Added: trunk/reactos/lib/crt/include/internal/rterror.h Added: trunk/reactos/lib/crt/include/internal/tls.h Added: trunk/reactos/lib/crt/include/internal/wine/ Modified: trunk/reactos/lib/crt/include/internal/wine/msvcrt.h _____ Copied: trunk/reactos/lib/crt/include/internal/atexit.h (from rev 13517, trunk/reactos/include/msvcrt/internal/atexit.h) --- trunk/reactos/include/msvcrt/internal/atexit.h 2005-02-12 21:46:45 UTC (rev 13517) +++ trunk/reactos/lib/crt/include/internal/atexit.h 2005-02-16 22:29:16 UTC (rev 13607) @@ -0,0 +1,14 @@ +/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ +#ifndef __CRT_INTERNAL_ATEXIT_H +#define __CRT_INTERNAL_ATEXIT_H + + +struct __atexit { + struct __atexit* __next; + void (*__function)(void); +}; + +extern struct __atexit* __atexit_ptr; + + +#endif _____ Copied: trunk/reactos/lib/crt/include/internal/console.h (from rev 13517, trunk/reactos/include/msvcrt/internal/console.h) --- trunk/reactos/include/msvcrt/internal/console.h 2005-02-12 21:46:45 UTC (rev 13517) +++ trunk/reactos/lib/crt/include/internal/console.h 2005-02-16 22:29:16 UTC (rev 13607) @@ -0,0 +1,12 @@ +/* console.h */ + +#ifndef __CRT_INTERNAL_CONSOLE_H +#define __CRT_INTERNAL_CONSOLE_H + +extern int char_avail; +extern int ungot_char; + +#endif + +/* EOF */ + _____ Copied: trunk/reactos/lib/crt/include/internal/file.h (from rev 13517, trunk/reactos/include/msvcrt/internal/file.h) --- trunk/reactos/include/msvcrt/internal/file.h 2005-02-12 21:46:45 UTC (rev 13517) +++ trunk/reactos/lib/crt/include/internal/file.h 2005-02-16 22:29:16 UTC (rev 13607) @@ -0,0 +1,190 @@ +/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ +/* + * Some stuff taken from active perl: perl\win32.c (ioinfo stuff) + * + * (c) 1995 Microsoft Corporation. All rights reserved. + * Developed by hip communications inc.,
http://info.hip.com/info/
+ * Portions (c) 1993 Intergraph Corporation. All rights reserved. + * + * You may distribute under the terms of either the GNU General Public + * License or the Artistic License, as specified in the README file. + */ + +#ifndef __CRT_INTERNAL_FILE_H +#define __CRT_INTERNAL_FILE_H + +#include <stdio.h> +#include <fcntl.h> +#include <stdarg.h> + + +#ifndef _IORMONCL +#define _IORMONCL 004000 /* remove on close, for temp files */ +#endif +/* if _flag & _IORMONCL, ._name_to_remove needs freeing */ + +#ifndef _IOUNGETC +#define _IOUNGETC 010000 /* there is an ungetc'ed character in the buffer */ +#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 */ +#define WRITE_STREAM(f) ((((f)->_flag & _IOWRT) == _IOWRT)) +#define READ_STREAM(f) ((((f)->_flag & _IOREAD) == _IOREAD)) + +char __validfp(FILE*); +int __set_errno(int err); +int __set_doserrno(int error); +void* filehnd(int fn); +char __is_text_file(FILE*); +int alloc_fd(void* hFile, char mode); +int _doprnt(const char* fmt, va_list args, FILE *); +int _doscan(FILE* iop, const char* fmt, va_list argp); +int __fileno_dup2(int handle1, int handle2); +char __fileno_getmode(int _fd); +int __fileno_setmode(int _fd, int _newmode); +void free_fd(int _fd); +void sigabort_handler(int sig); +char split_oflags(int oflags); + + +#include <windows.h> + +unsigned create_io_inherit_block(STARTUPINFOA* si); +void UnixTimeToFileTime(time_t unix_time, FILETIME* filetime, DWORD remainder); +time_t FileTimeToUnixTime(const FILETIME* filetime, DWORD *remainder); + + +#define __FILE_REC_MAX 20 +typedef struct __file_rec +{ + struct __file_rec* next; + int count; + FILE* files[__FILE_REC_MAX]; +} __file_rec; + +extern __file_rec* __file_rec_list; + + +typedef struct _FDINFO +{ + HANDLE hFile; + char fdflags; + char pipechar; /* one char buffer for handles opened on pipes */ + int lockinitflag; + CRITICAL_SECTION lock; +} FDINFO; + +#define FDINFO_ENTRIES_PER_BUCKET_SHIFT 5 /* log2(32) = 5 */ +#define FDINFO_BUCKETS 64 +#define FDINFO_ENTRIES_PER_BUCKET 32 +#define FDINFO_ENTRIES (FDINFO_BUCKETS * FDINFO_ENTRIES_PER_BUCKET) + +/* pipech */ +#define LF 10 /* line feed */ +#define CR 13 /* carriage return */ +#define CTRLZ 26 /* ctrl-z means eof for text */ + +/* mode */ +#define FOPEN 0x01 /* file handle open */ +#define FEOFLAG 0x02 /* end of file has been encountered */ +#define FCRLF 0x04 /* CR-LF across read buffer (in text mode) */ +#define FPIPE 0x08 /* file refers to a pipe */ +#define FNOINHERIT 0x10 /* file handle opened _O_NOINHERIT */ +#define FAPPEND 0x20 /* file opened O_APPEND */ +#define FDEV 0x40 /* file refers to device */ +#define FTEXT 0x80 /* file is in text mode (absence = binary) */ + +/* get bucket index (0-63) from an fd */ +#define fdinfo_bucket_idx(i) ((i) >> FDINFO_ENTRIES_PER_BUCKET_SHIFT) +/* get position inside a bucket (0-31) from an fd */ +#define fdinfo_bucket_entry_idx(i) ((i) & (FDINFO_ENTRIES_PER_BUCKET - 1)) +/* get bucket ptr. (ptr. to fist fdinfo inside a bucket) from an fd */ +#define fdinfo_bucket(i) ( __pioinfo[fdinfo_bucket_idx(i)]) +/* get fdinfo ptr. from an fd */ +#define fdinfo(i) (fdinfo_bucket(i) + fdinfo_bucket_entry_idx(i)) + +extern FDINFO* __pioinfo[]; + + +void _dosmaperr(unsigned long oserrcode); + + + +FILE* __alloc_file(void); + + + +int access_dirA(const char *_path); +int access_dirW(const wchar_t *_path); + +#ifdef _UNICODE + #define access_dirT access_dirW +#else + #define access_dirT access_dirA +#endif + + + +void _fwalk(void (*func)(FILE*)); // not exported + + + +#undef MB_CUR_MAX +#define MB_CUR_MAX __mb_cur_max + + +int _isnanl(double x); +int _isinfl(double x); +int _isnan(double x); +int _isinf(double x); + + + +/* Flags for the iobuf structure (for reference) */ +#if 0 +#define _IOREAD 1 /* currently reading */ +#define _IOWRT 2 /* currently writing */ +#define _IORW 0x0080 /* opened as "r+w" */ +#endif + +/* internal FILE->_flag flags */ + +#define _IOMYBUF 0x0008 /* stdio malloc()'d buffer */ +#define _IOEOF 0x0010 /* EOF reached on read */ +#define _IOERR 0x0020 /* I/O error from system */ +#define _IOSTRG 0x0040 /* Strange or no file descriptor */ + +#define _IOBINARY 0x040000 +#define _IOTEXT 0x000000 + +#define _IOCOMMIT 0x100000 + +#define _IODIRTY 0x010000 +#define _IOAHEAD 0x020000 + + + + +/* + * The three possible buffering mode (nMode) values for setvbuf. + * NOTE: _IOFBF works, but _IOLBF seems to work like unbuffered... + * maybe I'm testing it wrong? + */ +#define _IOFBF 0x0000 /* full buffered */ +#define _IOLBF 0x0040 /* line buffered */ +#define _IONBF 0x0004 /* not buffered */ + +#define _IO_LBF 0x80000 /* this value is used insteat of _IOLBF within the + structure FILE as value for _flags, + because _IOLBF has the same value as _IOSTRG */ + + +wint_t _filwbuf(FILE *f); + + + +#endif /* __dj_include_libc_file_h__ */ _____ Copied: trunk/reactos/lib/crt/include/internal/ieee.h (from rev 13517, trunk/reactos/include/msvcrt/internal/ieee.h) --- trunk/reactos/include/msvcrt/internal/ieee.h 2005-02-12 21:46:45 UTC (rev 13517) +++ trunk/reactos/lib/crt/include/internal/ieee.h 2005-02-16 22:29:16 UTC (rev 13607) @@ -0,0 +1,25 @@ +#ifndef __CRT_INTERNAL_IEEE_H +#define __CRT_INTERNAL_IEEE_H + +typedef struct { + unsigned int mantissa:23; + unsigned int exponent:8; + unsigned int sign:1; +} float_t; + +typedef struct { + unsigned int mantissal:32; + unsigned int mantissah:20; + unsigned int exponent:11; + unsigned int sign:1; +} double_t; + +typedef struct { + unsigned int mantissal:32; + unsigned int mantissah:32; + unsigned int exponent:15; + unsigned int sign:1; + unsigned int empty:16; +} long_double_t; + +#endif _____ Added: trunk/reactos/lib/crt/include/internal/math.h --- trunk/reactos/lib/crt/include/internal/math.h 2005-02-16 22:22:42 UTC (rev 13606) +++ trunk/reactos/lib/crt/include/internal/math.h 2005-02-16 22:29:16 UTC (rev 13607) @@ -0,0 +1,10 @@ + +#ifndef __CRT_INTERNAL_MATH_H +#define __CRT_INTERNAL_MATH_H + + +int _isinf (double); /* not exported */ +int _isnanl (long double); /* not exported */ +int _isinfl (long double); /* not exported */ + +#endif _____ Added: trunk/reactos/lib/crt/include/internal/mbstring.h --- trunk/reactos/lib/crt/include/internal/mbstring.h 2005-02-16 22:22:42 UTC (rev 13606) +++ trunk/reactos/lib/crt/include/internal/mbstring.h 2005-02-16 22:29:16 UTC (rev 13607) @@ -0,0 +1,20 @@ +#ifndef __CRT_INTERNAL_MBSTRING_H +#define __CRT_INTERNAL_MBSTRING_H + +#define _KNJ_M ((char)0x01) /* Non-punctuation of Kana-set */ +#define _KNJ_P ((char)0x02) /* Punctuation of Kana-set */ +#define _KNJ_1 ((char)0x04) /* Legal 1st byte of double byte stream */ +#define _KNJ_2 ((char)0x08) /* Legal 2nd btye of double byte stream */ + + +#define ___ 0 +#define _1_ _KNJ_1 /* Legal 1st byte of double byte code */ +#define __2 _KNJ_2 /* Legal 2nd byte of double byte code */ +#define _M_ _KNJ_M /* Non-puntuation in Kana-set */ +#define _P_ _KNJ_P /* Punctuation of Kana-set */ +#define _12 (_1_|__2) +#define _M2 (_M_|__2) +#define _P2 (_P_|__2) + + +#endif _____ Copied: trunk/reactos/lib/crt/include/internal/msvcrtdbg.h (from rev 13517, trunk/reactos/include/msvcrt/msvcrtdbg.h) --- trunk/reactos/include/msvcrt/msvcrtdbg.h 2005-02-12 21:46:45 UTC (rev 13517) +++ trunk/reactos/lib/crt/include/internal/msvcrtdbg.h 2005-02-16 22:29:16 UTC (rev 13607) @@ -0,0 +1,90 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/msvcrt/msvcrtdbg.h + * PURPOSE: Useful debugging macros + * PROGRAMMER: + * UPDATE HISTORY: + * + */ + +/* + * NOTE: Define NDEBUG before including this header to disable debugging + * macros + */ + +#ifndef __MSVCRT_DEBUG +#define __MSVCRT_DEBUG + +#include <roscfg.h> +#include <windows.h> + + +#define MK_STR(s) #s + +#ifdef _UNICODE + #define sT "S" +#else + #define sT "s" +#endif + + + +#define TRACE(...) + + +#ifdef DBG + #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); +#else + #ifdef __GNUC__ + #define DPRINT1(args...) + #else + #define DPRINT DbgPrint + #endif + #define CHECKPOINT1 +#endif + +#if !defined(NDEBUG) && defined(DBG) + #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); +#else + #ifdef __GNUC__ + #define DPRINT(args...) + #else + #define DPRINT DbgPrint + #endif + #define CHECKPOINT +#endif /* NDEBUG */ + + +#if 0 + + #define TRACE_RETURN(format_str, ret_type) \ + ret_type __return_value__; \ + static char* __return_format_str__ = "%s ret: "format_str"\n" + + #define FUNCTION(func) \ + static char* __func_name__ = #func + + #define TRACE(a,b...) DPRINT1(a"\n", b) + + #define RETURN(a) \ + do{ __return_value__ = (a); DPRINT1(__return_format_str__ ,__func_name__,__return_value__); return __return_value__ ; }while(0) + +#endif + + +/* 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 */ _____ Copied: trunk/reactos/lib/crt/include/internal/mtdll.h (from rev 13517, trunk/reactos/include/msvcrt/internal/mtdll.h) --- trunk/reactos/include/msvcrt/internal/mtdll.h 2005-02-12 21:46:45 UTC (rev 13517) +++ trunk/reactos/lib/crt/include/internal/mtdll.h 2005-02-16 22:29:16 UTC (rev 13607) @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2002, TransGaming Technologies Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __CRT_INTERNAL_WINE_MTDLL_H +#define __CRT_INTERNAL_WINE_MTDLL_H + +#if defined(_MT) + +#define _mlock(locknum) _lock(locknum) +#define _munlock(locknum) _unlock(locknum) + +void _unlock( int locknum ); +void _lock( int locknum ); + +#else + +#define _mlock(locknum) do {} while(0) +#define _munlock(locknum) do {} while(0) + +#endif + + +#define _SIGNAL_LOCK 1 +#define _IOB_SCAN_LOCK 2 +#define _TMPNAM_LOCK 3 +#define _INPUT_LOCK 4 +#define _OUTPUT_LOCK 5 +#define _CSCANF_LOCK 6 +#define _CPRINTF_LOCK 7 +#define _CONIO_LOCK 8 +#define _HEAP_LOCK 9 +#define _BHEAP_LOCK 10 /* No longer used? */ +#define _TIME_LOCK 11 +#define _ENV_LOCK 12 +#define _EXIT_LOCK1 13 +#define _EXIT_LOCK2 14 +#define _THREADDATA_LOCK 15 /* No longer used? */ +#define _POPEN_LOCK 16 +#define _LOCKTAB_LOCK 17 +#define _OSFHND_LOCK 18 +#define _SETLOCALE_LOCK 19 +#define _LC_COLLATE_LOCK 20 /* No longer used? */ +#define _LC_CTYPE_LOCK 21 /* No longer used? */ +#define _LC_MONETARY_LOCK 22 /* No longer used? */ +#define _LC_NUMERIC_LOCK 23 /* No longer used? */ +#define _LC_TIME_LOCK 24 /* No longer used? */ +#define _MB_CP_LOCK 25 +#define _NLG_LOCK 26 +#define _TYPEINFO_LOCK 27 +#define _STREAM_LOCKS 28 + +/* Must match definition in msvcrt/stdio.h */ +#define _IOB_ENTRIES 20 +#define _LAST_STREAM_LOCK (_STREAM_LOCKS+_IOB_ENTRIES-1) +#define _TOTAL_LOCKS (_LAST_STREAM_LOCK+1) + +#endif /* WINE_MTDLL_H */ _____ Copied: trunk/reactos/lib/crt/include/internal/rterror.h (from rev 13517, trunk/reactos/include/msvcrt/internal/rterror.h) --- trunk/reactos/include/msvcrt/internal/rterror.h 2005-02-12 21:46:45 UTC (rev 13517) +++ trunk/reactos/lib/crt/include/internal/rterror.h 2005-02-16 22:29:16 UTC (rev 13607) @@ -0,0 +1,31 @@ +/* rterror.h */ + +#ifndef __CRT_INTERNAL_RTERROR_H +#define __CRT_INTERNAL_RTERROR_H + + +#define _RT_STACK 0 /* stack overflow */ +#define _RT_NULLPTR 1 /* null pointer assignment */ +#define _RT_FLOAT 2 /* floating point not loaded */ +#define _RT_INTDIV 3 /* integer divide by 0 */ +#define _RT_SPACEARG 4 /* not enough space for arguments */ +#define _RT_SPACEENV 5 /* not enough space for environment */ +#define _RT_ABORT 6 /* abnormal program termination */ +#define _RT_THREAD 7 /* not enough space for thread data */ +#define _RT_LOCK 8 /* unexpected multi-thread lock error */ +#define _RT_HEAP 9 /* unexpected heap error */ +#define _RT_OPENCON 10 /* unable to open console device */ +#define _RT_NONCONT 11 /* non-continuable exception */ +#define _RT_INVALDISP 12 /* invalid disposition of exception */ +#define _RT_ONEXIT 13 /* insufficient heap to allocate + * initial table of function pointers + * used by _onexit()/atexit(). */ +#define _RT_PUREVIRT 14 /* pure virtual function call attempted + * (C++ error) */ +#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); + + +#endif /* __MSVCRT_INTERNAL_RTERROR_H */ _____ Copied: trunk/reactos/lib/crt/include/internal/tls.h (from rev 13517, trunk/reactos/include/msvcrt/internal/tls.h) --- trunk/reactos/include/msvcrt/internal/tls.h 2005-02-12 21:46:45 UTC (rev 13517) +++ trunk/reactos/lib/crt/include/internal/tls.h 2005-02-16 22:29:16 UTC (rev 13607) @@ -0,0 +1,42 @@ +/* tls.h */ + +#ifndef __CRT_INTERNAL_TLS_H +#define __CRT_INTERNAL_TLS_H + +#include <windows.h> +#include <msvcrt/crttypes.h> +#include <stddef.h> + +typedef struct _ThreadData +{ + int terrno; /* *nix error code */ + unsigned long tdoserrno; /* Win32 error code (for I/O only) */ + unsigned LONGLONG tnext; /* used by rand/srand */ + + char *lasttoken; /* used by strtok */ + wchar_t *wlasttoken; /* used by wcstok */ + + + int fpecode; /* fp exception code */ + + /* qsort variables */ + int (*qcmp)(const void *, const void *); /* the comparison routine */ + int qsz; /* size of each record */ + int thresh; /* THRESHold in chars */ + int mthresh; /* MTHRESHold in chars */ + + EXCEPTION_RECORD *exc_record; /* Head of exception record list */ + +} THREADDATA, *PTHREADDATA; + + +int CreateThreadData(void); +void DestroyThreadData(void); + +void FreeThreadData(PTHREADDATA ptd); +PTHREADDATA GetThreadData(void); + +#endif /* __MSVCRT_INTERNAL_TLS_H */ + +/* EOF */ + _____ Copied: trunk/reactos/lib/crt/include/internal/wine (from rev 13517, trunk/reactos/include/msvcrt/wine) _____ Modified: trunk/reactos/lib/crt/include/internal/wine/msvcrt.h --- trunk/reactos/include/msvcrt/wine/msvcrt.h 2005-02-12 21:46:45 UTC (rev 13517) +++ trunk/reactos/lib/crt/include/internal/wine/msvcrt.h 2005-02-16 22:29:16 UTC (rev 13607) @@ -28,7 +28,7 @@ #include "winerror.h" #include "winnls.h" -#include "msvcrt/string.h" +//#include "msvcrt/string.h" #include "eh.h" /* TLS data */
19 years, 10 months
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
42
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Results per page:
10
25
50
100
200