Untangled crtdll/msvcrt header mess.
authorEric Kohl <eric.kohl@reactos.org>
Tue, 3 Jul 2001 13:21:22 +0000 (13:21 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Tue, 3 Jul 2001 13:21:22 +0000 (13:21 +0000)
svn path=/trunk/; revision=2031

73 files changed:
reactos/lib/msvcrt/io/access.c
reactos/lib/msvcrt/io/close.c
reactos/lib/msvcrt/io/commit.c
reactos/lib/msvcrt/io/fmode.c
reactos/lib/msvcrt/io/isatty.c
reactos/lib/msvcrt/io/lseek.c
reactos/lib/msvcrt/io/mktemp.c
reactos/lib/msvcrt/io/open.c
reactos/lib/msvcrt/io/read.c
reactos/lib/msvcrt/io/setmode.c
reactos/lib/msvcrt/io/unlink.c
reactos/lib/msvcrt/io/write.c
reactos/lib/msvcrt/misc/amsg.c
reactos/lib/msvcrt/misc/assert.c
reactos/lib/msvcrt/msvcrt.def
reactos/lib/msvcrt/process/dll.c
reactos/lib/msvcrt/process/procid.c
reactos/lib/msvcrt/process/thread.c
reactos/lib/msvcrt/process/threadid.c
reactos/lib/msvcrt/signal/signal.c
reactos/lib/msvcrt/stdio/allocfil.c
reactos/lib/msvcrt/stdio/fclose.c
reactos/lib/msvcrt/stdio/feof.c
reactos/lib/msvcrt/stdio/ferror.c
reactos/lib/msvcrt/stdio/fflush.c
reactos/lib/msvcrt/stdio/fgets.c
reactos/lib/msvcrt/stdio/filbuf.c
reactos/lib/msvcrt/stdio/fileno.c
reactos/lib/msvcrt/stdio/flsbuf.c
reactos/lib/msvcrt/stdio/fopen.c
reactos/lib/msvcrt/stdio/fprintf.c
reactos/lib/msvcrt/stdio/fputc.c
reactos/lib/msvcrt/stdio/fputs.c
reactos/lib/msvcrt/stdio/fread.c
reactos/lib/msvcrt/stdio/fwalk.c
reactos/lib/msvcrt/stdio/fwrite.c
reactos/lib/msvcrt/stdio/getc.c
reactos/lib/msvcrt/stdio/printf.c
reactos/lib/msvcrt/stdio/putc.c
reactos/lib/msvcrt/stdio/putchar.c
reactos/lib/msvcrt/stdio/puts.c
reactos/lib/msvcrt/stdio/remove.c
reactos/lib/msvcrt/stdio/setvbuf.c
reactos/lib/msvcrt/stdio/sprintf.c
reactos/lib/msvcrt/stdio/stdhnd.c
reactos/lib/msvcrt/stdio/tempnam.c
reactos/lib/msvcrt/stdio/vfprintf.c
reactos/lib/msvcrt/stdio/vfwprint.c
reactos/lib/msvcrt/stdio/vprintf.c
reactos/lib/msvcrt/stdio/vsprintf.c
reactos/lib/msvcrt/stdlib/_exit.c
reactos/lib/msvcrt/stdlib/abort.c
reactos/lib/msvcrt/stdlib/atexit.c
reactos/lib/msvcrt/stdlib/atold.c
reactos/lib/msvcrt/stdlib/fcvtbuf.c
reactos/lib/msvcrt/stdlib/gcvt.c
reactos/lib/msvcrt/stdlib/strtold.c
reactos/lib/msvcrt/stdlib/strtoll.c
reactos/lib/msvcrt/stdlib/strtoull.c
reactos/lib/msvcrt/stdlib/swab.c
reactos/lib/msvcrt/stdlib/wcstom.c
reactos/lib/msvcrt/stdlib/wcstomb.c
reactos/lib/msvcrt/stdlib/wcstombs.c
reactos/lib/msvcrt/sys_stat/fstat.c
reactos/lib/msvcrt/sys_stat/stat.c
reactos/lib/msvcrt/time/ctime.c
reactos/lib/msvcrt/time/time.c
reactos/lib/msvcrt/wstring/wcslwr.c
reactos/lib/msvcrt/wstring/wcsncat.c
reactos/lib/msvcrt/wstring/wcsncmp.c
reactos/lib/msvcrt/wstring/wcsncpy.c
reactos/lib/msvcrt/wstring/wcsnicmp.c
reactos/lib/msvcrt/wstring/wcsnlen.c

index 8a78ec4..36f0e18 100644 (file)
@@ -1,5 +1,5 @@
 #include <windows.h>
-#include <crtdll/io.h>
+#include <msvcrt/io.h>
 
 #ifndef F_OK
  #define F_OK  0x01
index 2ca7aa8..db9bd4e 100644 (file)
@@ -1,14 +1,12 @@
-#include <crtdll/io.h>
 #include <windows.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/io.h>
+#include <msvcrt/internal/file.h>
 
-
-int     _close(int _fd)
+int _close(int _fd)
 {
-       if ( _fd == -1 )
-               return -1;
-        if ( CloseHandle(_get_osfhandle(_fd)) == FALSE )
-               return -1;
-        return __fileno_close(_fd);
-                
+  if (_fd == -1)
+    return -1;
+  if (CloseHandle(_get_osfhandle(_fd)) == FALSE)
+    return -1;
+  return __fileno_close(_fd);
 }
index 37c4c90..406b03f 100644 (file)
@@ -1,7 +1,7 @@
 #include <windows.h>
-#include <crtdll/io.h>
+#include <msvcrt/io.h>
 #include <msvcrt/errno.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/internal/file.h>
 
 int _commode = _IOCOMMIT;
 
index 2a19714..7d1909d 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/fcntl.h>
-#include <crtdll/io.h>
+#include <msvcrt/fcntl.h>
+#include <msvcrt/io.h>
 
 #undef _fmode
 unsigned int _fmode = O_TEXT;
index a452414..0291bfb 100644 (file)
@@ -1,5 +1,5 @@
-#include <crtdll/io.h>
-#include <crtdll/sys/stat.h>
+#include <msvcrt/io.h>
+#include <msvcrt/sys/stat.h>
 
 
 int _isatty( int fd )
index c585445..2556d3d 100644 (file)
@@ -1,9 +1,9 @@
 #include <windows.h>
-#include <crtdll/io.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/io.h>
+#include <msvcrt/internal/file.h>
 
 long _lseek(int _fildes, long _offset, int _whence)
 {
-       return _llseek((HFILE)filehnd(_fildes),_offset,_whence);
+  return _llseek((HFILE)filehnd(_fildes),_offset,_whence);
 }
 
index 6bfa0c2..c512dd0 100644 (file)
@@ -13,9 +13,9 @@
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <crtdll/stdio.h>
-#include <crtdll/string.h>
-#include <crtdll/io.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/string.h>
+#include <msvcrt/io.h>
 
 
 char* _mktemp (char *_template)
index a979750..b82257f 100644 (file)
 // possibly store extra information at the handle
 
 #include <windows.h>
-#include <crtdll/io.h>
-#include <crtdll/fcntl.h>
-#include <crtdll/sys/stat.h>
-#include <crtdll/stdlib.h>
-#include <crtdll/internal/file.h>
-#include <crtdll/string.h>
-#include <crtdll/share.h>
+#include <msvcrt/io.h>
+#include <msvcrt/fcntl.h>
+#include <msvcrt/sys/stat.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/internal/file.h>
+#include <msvcrt/string.h>
+#include <msvcrt/share.h>
 
 typedef struct _fileno_modes_type
 {
@@ -33,7 +33,7 @@ fileno_modes_type *fileno_modes = NULL;
 int maxfno = 5;
 int minfno = 5;
 
-char __is_text_file(FILE *p) 
+char __is_text_file(FILE *p)
 {
    if ( p == NULL || fileno_modes == NULL )
      return FALSE;
index b95e698..77e5605 100644 (file)
@@ -7,8 +7,8 @@
  * UPDATE HISTORY:
  *              28/12/98: Created
  */
-#include <crtdll/io.h>
 #include <windows.h>
+#include <msvcrt/io.h>
 
 size_t _read(int _fd, void *_buf, size_t _nbyte)
 {
index ea6f7e8..80476a0 100644 (file)
@@ -8,12 +8,12 @@
  *              28/12/98: Created
  */
 
-#include <crtdll/io.h>
-#include <crtdll/stdio.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/io.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/internal/file.h>
 
 
 int _setmode(int _fd, int _newmode)
 {
-       return __fileno_setmode(_fd, _newmode);
+  return __fileno_setmode(_fd, _newmode);
 }
index 9e11757..e4cbe4c 100644 (file)
@@ -8,13 +8,12 @@
  *              28/12/98: Created
  */
 #include <windows.h>
-#include <crtdll/io.h>
+#include <msvcrt/io.h>
 
 
-
-int _unlink( const char *filename )
+int _unlink(const char *filename)
 {
-       if ( !DeleteFileA(filename) )
-               return -1;
-       return 0;
+  if (!DeleteFileA(filename))
+    return -1;
+  return 0;
 }
index c64dc18..b7a3d8e 100644 (file)
@@ -7,9 +7,8 @@
  * UPDATE HISTORY:
  *              28/12/98: Created
  */
-#include <crtdll/io.h>
 #include <windows.h>
-
+#include <msvcrt/io.h>
 
 
 size_t _write(int _fd, const void *_buf, size_t _nbyte)
index 37b72ec..dafdcd1 100644 (file)
@@ -8,7 +8,7 @@
  *              28/12/98: Created
  */
 
-#include <crtdll/stdio.h>
+#include <msvcrt/stdio.h>
 
 
 static char *__rt_err_msg[] =
index 1fe8cd0..59b3bbd 100644 (file)
@@ -1,8 +1,8 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/assert.h>
-#include <crtdll/stdio.h>
-#include <crtdll/stdlib.h>
-#include <crtdll/signal.h>
+#include <msvcrt/assert.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/signal.h>
 
 void _assert(const char *msg, const char *file, int line)
 {
index 0b5306e..175b485 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: msvcrt.def,v 1.7 2001/07/02 21:51:18 ekohl Exp $
+; $Id: msvcrt.def,v 1.8 2001/07/03 13:21:22 ekohl Exp $
 ;
 ; ReactOS MSVCRT Compatibility Library
 ;
@@ -416,7 +416,7 @@ _purecall
 ; _putch
 _putenv
 ; _putw
-_putws
+_putws
 _pwctype DATA
 _read
 _rmdir
@@ -613,7 +613,7 @@ fopen
 fprintf
 fputc
 fputs
-fputwc
+fputwc
 ; fputws
 fread
 free
@@ -685,7 +685,7 @@ putc
 putchar
 puts
 putwc
-putwchar
+putwchar
 qsort
 raise
 ; rand
index 2e8bc20..ccb3c2a 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #include <windows.h>
-#include <crtdll/process.h>
+#include <msvcrt/process.h>
 
 void *_loaddll (char *name)
 {
index 5213b0d..a8616fb 100644 (file)
@@ -1,5 +1,5 @@
 #include <windows.h>
-#include <crtdll/process.h>
+#include <msvcrt/process.h>
 
 int _getpid (void)
 {
index 84beefa..25436c5 100644 (file)
@@ -1,8 +1,9 @@
-/* $Id: thread.c,v 1.1 2000/06/18 10:57:42 ea Exp $
+/* $Id: thread.c,v 1.2 2001/07/03 13:15:55 ekohl Exp $
  *
  */
 #include <windows.h>
-#include <errno.h>
+#include <msvcrt/errno.h>
+#include <msvcrt/process.h>
 
 unsigned long
 _beginthread (
index 858c169..cf4b6c6 100644 (file)
@@ -1,5 +1,5 @@
 #include <windows.h>
-#include <crtdll/process.h>
+#include <msvcrt/process.h>
 
 unsigned long __threadid (void)
 {
index 2e221f4..69d90a6 100644 (file)
@@ -1,8 +1,8 @@
-#include <crtdll/signal.h>
-#include <crtdll/stdlib.h>
-#include <crtdll/errno.h>
-#include <crtdll/string.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/signal.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/errno.h>
+#include <msvcrt/string.h>
+#include <msvcrt/internal/file.h>
 
 void _default_handler(int signal);
 
index b0f9e64..631d298 100644 (file)
@@ -1,8 +1,8 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/stdio.h>
-#include <crtdll/string.h>
-#include <crtdll/stdlib.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/string.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/internal/file.h>
 
 
 FILE * __alloc_file(void);
@@ -94,5 +94,5 @@ int _fcloseall( void )
          /* it isn't full, we can add to it */
          break;
      }
-   return total_closed; 
+   return total_closed;
 }
index 1b141c5..74b3b0c 100644 (file)
@@ -1,12 +1,12 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <crtdll/stdio.h>
-#include <crtdll/io.h>
-#include <crtdll/sys/types.h>
-#include <crtdll/sys/stat.h>
-#include <crtdll/stdlib.h>
-#include <crtdll/errno.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/io.h>
+#include <msvcrt/sys/types.h>
+#include <msvcrt/sys/stat.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/errno.h>
+#include <msvcrt/internal/file.h>
 
 // changed check for writable stream
 
index 8f6f01f..a2487d8 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/stdio.h>
-#include <crtdll/errno.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/errno.h>
+#include <msvcrt/internal/file.h>
 
 #ifdef feof
 #undef feof
index 06d77c1..05110cd 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/stdio.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/internal/file.h>
 
 #ifdef ferror
 #undef ferror
index 6d7197d..fc09c8c 100644 (file)
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <crtdll/stdio.h>
-#include <crtdll/errno.h>
-#include <crtdll/sys/types.h>
-#include <crtdll/sys/stat.h>
-#include <crtdll/stdlib.h>
-#include <crtdll/internal/file.h>
-#include <crtdll/io.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/errno.h>
+#include <msvcrt/sys/types.h>
+#include <msvcrt/sys/stat.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/internal/file.h>
+#include <msvcrt/io.h>
 
 
 int fflush(FILE *f)
index df78963..3230fc5 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/stdio.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/internal/file.h>
 
 char *
 fgets(char *s, int n, FILE *f)
index 2bab004..955df62 100644 (file)
@@ -2,14 +2,14 @@
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <crtdll/stdio.h>
-#include <crtdll/sys/types.h>
-#include <crtdll/stdlib.h>
-#include <crtdll/string.h>
-#include <crtdll/internal/file.h>
-#include <crtdll/io.h>
-#include <crtdll/wchar.h>
-#include <crtdll/errno.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/sys/types.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/string.h>
+#include <msvcrt/internal/file.h>
+#include <msvcrt/io.h>
+#include <msvcrt/wchar.h>
+#include <msvcrt/errno.h>
 
 int _readcnv(int fn, void *buf, size_t siz  );
 
index 40d4616..50019c0 100644 (file)
@@ -1,14 +1,14 @@
-#include <crtdll/stdio.h>
+#include <msvcrt/stdio.h>
 
 #if 0
 #undef fileno
-int fileno(FILE *f) 
+int fileno(FILE *f)
 {
-       return f->_file;
+  return f->_file;
 }
 #endif
 
-int _fileno(FILE *f) 
+int _fileno(FILE *f)
 {
-       return f->_file;
+  return f->_file;
 }
index 574525a..2e8c1d6 100644 (file)
@@ -1,13 +1,13 @@
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <crtdll/stdio.h>
-#include <crtdll/wchar.h>
-#include <crtdll/sys/types.h>
-#include <crtdll/stdlib.h>
-#include <crtdll/internal/file.h>
-#include <crtdll/io.h>
-#include <crtdll/errno.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/wchar.h>
+#include <msvcrt/sys/types.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/internal/file.h>
+#include <msvcrt/io.h>
+#include <msvcrt/errno.h>
 
 int cntcr(char *bufp, int bufsiz);
 int convert(char *endp, int bufsiz,int n);
index 55db74c..7b584f3 100644 (file)
@@ -1,10 +1,10 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <crtdll/sys/types.h>
-#include <crtdll/stdio.h>
-#include <crtdll/io.h>
-#include <crtdll/fcntl.h>
-//#include <crtdll/internal/file.h>
+#include <msvcrt/sys/types.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/io.h>
+#include <msvcrt/fcntl.h>
+//#include <msvcrt/internal/file.h>
 
 //might change fopen(file,mode) -> fsopen(file,mode,_SH_DENYNO);
 
index 9ac7b6b..6c503de 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/stdio.h>
-#include <crtdll/wchar.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/wchar.h>
+#include <msvcrt/internal/file.h>
 
 int
 fprintf(register FILE *iop, const char *fmt, ...)
index c63635a..a5c6761 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/stdio.h>
-#include <crtdll/wchar.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/wchar.h>
+#include <msvcrt/internal/file.h>
 
 int
 fputc(int c, FILE *fp)
@@ -9,9 +9,9 @@ fputc(int c, FILE *fp)
   return putc(c, fp);
 }
 
-wint_t 
+wint_t
 fputwc(wchar_t c, FILE *fp)
-{      
-       return fputwc(c,fp);
+{
+  return putwc(c,fp);
 }
 
index d8fbfff..d39672b 100644 (file)
@@ -1,13 +1,12 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/stdio.h>
-#include <crtdll/internal/file.h>
-#include <crtdll/string.h>
 #include <windows.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/internal/file.h>
+#include <msvcrt/string.h>
 
 int
 fputs(const char *s, FILE *f)
 {
-       
   int r = 0;
   int c;
   int unbuffered;
@@ -34,5 +33,4 @@ fputs(const char *s, FILE *f)
   }
 
   return(r);
 }
index c9f7238..96a3968 100644 (file)
@@ -1,83 +1,53 @@
-#include <crtdll/stdio.h>
-#include <crtdll/stdlib.h>
-#include <crtdll/string.h>
-#include <crtdll/errno.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/string.h>
+#include <msvcrt/errno.h>
+#include <msvcrt/internal/file.h>
 
 
-// carriage return line feed conversion is done in filbuf and  flsbuf
-#if 0
-size_t
-fread(void *p, size_t size, size_t count, FILE *iop)
-{
-  char *ptr = (char *)p;
-  int to_read;
-  
-  to_read = size * count;
-
-       
-  while ( to_read > 0 ) {
-       *ptr = getc(iop) ;
-       if ( *ptr == EOF )
-               break;
-       to_read--;
-       ptr++;
-  }
-
-       
-
-  return count- (to_read/size);
-}
-
-
-#else
 size_t fread(void *vptr, size_t size, size_t count, FILE *iop)
 {
-       char *ptr = (char *)vptr;
-       size_t  to_read ,n_read;
+  char *ptr = (char *)vptr;
+  size_t  to_read ,n_read;
 
-       to_read = size * count;
-       
-       if (!OPEN4READING(iop))
-       {
-               __set_errno (EINVAL);
-               return 0;
-       }
+  to_read = size * count;
+  
+  if (!OPEN4READING(iop))
+    {
+      __set_errno (EINVAL);
+      return 0;
+    }
 
-       if (!__validfp (iop) )
-       {
-               __set_errno (EINVAL);
-               return 0;
-       }
-       if (feof (iop) || ferror (iop))
-               return 0;
+  if (!__validfp (iop) )
+    {
+      __set_errno (EINVAL);
+      return 0;
+    }
+  if (feof (iop) || ferror (iop))
+    return 0;
 
-       if (vptr == NULL || to_read == 0)
-               return 0;
+  if (vptr == NULL || to_read == 0)
+    return 0;
 
+  while(iop->_cnt > 0 && to_read > 0 )
+    {
+      to_read--;
+      *ptr++ = getc(iop);
+    }
 
-       while(iop->_cnt > 0 && to_read > 0 ) {
-                to_read--;
-                *ptr++ = getc(iop);
-        } 
+  // if the buffer is dirty it will have to be written now
+  // otherwise the file pointer won't match anymore.
 
-       // if the buffer is dirty it will have to be written now
-       // otherwise the file pointer won't match anymore.
-  
-       fflush(iop);
+  fflush(iop);
 
-        // check to see if this will work with in combination with ungetc
-        
-       n_read =  _read(fileno(iop), ptr, to_read);
-       if ( n_read != -1 )
-               to_read -= n_read;
+  // check to see if this will work with in combination with ungetc
 
-       // the file buffer is empty and there is no read ahead information anymore.
+  n_read = _read(fileno(iop), ptr, to_read);
+  if ( n_read != -1 )
+    to_read -= n_read;
 
-       iop->_flag &= ~_IOAHEAD;
-       
-        return count- (to_read/size);
-} 
-#endif
+  // the file buffer is empty and there is no read ahead information anymore.
+  iop->_flag &= ~_IOAHEAD;
 
+  return count - (to_read/size);
+}
index 11be7eb..f7d261b 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/stdio.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/internal/file.h>
 
 // not exported by crtdll
 __file_rec *__file_rec_list;
index 4dcc8d7..87d01d1 100644 (file)
@@ -1,84 +1,51 @@
-#include <crtdll/stdio.h>
-#include <crtdll/stdlib.h>
-#include <crtdll/string.h>
-#include <crtdll/errno.h>
-#include <crtdll/internal/file.h>
-
-#if 0
-size_t
-fwrite(const void *p, size_t size, size_t count, FILE *iop)
-{
-  char *ptr = (char *)p;
-  size_t to_write;
-
-
-  to_write = size * count;
-
-
-  while ( to_write > 0 ) {
-       if ( putc(*ptr,iop) == EOF )
-               break;
-       to_write--;
-       ptr++;
-  }
-       
-
-
-  return count -to_write/size;
-}
+#include <msvcrt/stdio.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/string.h>
+#include <msvcrt/errno.h>
+#include <msvcrt/internal/file.h>
 
 
-#else
 size_t fwrite(const void *vptr, size_t size, size_t count, FILE *iop)
- {
-       size_t to_write, n_written;
-       char *ptr = (char *)vptr;
-       
-       to_write = size*count;
-       if (!OPEN4WRITING(iop) )
-       {
-               __set_errno (EINVAL);
-               return 0;
-       }
-
-
-       if (iop == NULL  )
-       {
-               __set_errno (EINVAL);
-               return 0;
-       }
-
-       if (ferror (iop))
-               return 0;
-       if (vptr == NULL || to_write == 0)
-               return 0;
-
-       
-       while(iop->_cnt > 0 && to_write > 0 ) {     
-                to_write--;
-                putc(*ptr++,iop);
-        }
-
-       // if the buffer is dirty it will have to be written now
-       // otherwise the file pointer won't match anymore.
-  
-       fflush(iop);       
-      
-        n_written = _write(fileno(iop), ptr,to_write);
-        if ( n_written != -1 )
-               to_write -= n_written;
-        
-        // check to see if this will work with in combination with ungetc
-
-
-       // the file buffer is empty and there is no read ahead information anymore.
-       
-       iop->_flag &= ~_IOAHEAD;
-        
-        return count - (to_write/size);      
-  
+{
+  size_t to_write, n_written;
+  char *ptr = (char *)vptr;
+
+  to_write = size*count;
+  if (!OPEN4WRITING(iop))
+    {
+      __set_errno (EINVAL);
+      return 0;
+    }
+
+  if (iop == NULL)
+    {
+      __set_errno (EINVAL);
+      return 0;
+    }
+
+  if (ferror (iop))
+    return 0;
+  if (vptr == NULL || to_write == 0)
+    return 0;
+
+  while(iop->_cnt > 0 && to_write > 0)
+    {
+      to_write--;
+      putc(*ptr++,iop);
+    }
+
+  // if the buffer is dirty it will have to be written now
+  // otherwise the file pointer won't match anymore.
+  fflush(iop);
+
+  n_written = _write(fileno(iop), ptr,to_write);
+  if (n_written != -1)
+    to_write -= n_written;
+
+  // check to see if this will work with in combination with ungetc
+
+  // the file buffer is empty and there is no read ahead information anymore.
+  iop->_flag &= ~_IOAHEAD;
+
+  return count - (to_write/size);
 }
-
-#endif
\ No newline at end of file
index fe87af3..3bdb61c 100644 (file)
@@ -1,8 +1,8 @@
 #include <windows.h>
-#include <crtdll/stdio.h>
-#include <crtdll/wchar.h>
-#include <crtdll/errno.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/wchar.h>
+#include <msvcrt/errno.h>
+#include <msvcrt/internal/file.h>
 
 //getc can be a macro
 #undef getc
@@ -33,23 +33,36 @@ int getc(FILE *fp)
        return c;
 }
 
-// not exported
-
-wint_t  getwc(FILE *fp)
+wint_t getwc(FILE *fp)
 {
-       
- // might check on multi bytes if text mode
-  if(fp->_cnt > 0) {
-        fp->_cnt -= sizeof(wchar_t);
-        return (wint_t )*((wchar_t *)(fp->_ptr))++;
-  } 
-  else {
-       return _filwbuf(fp);
-  }
-  
-  // never reached
-  return -1;
+  int c = -1;
+
+  // check for invalid stream
+  if (!__validfp(fp))
+    {
+      __set_errno(EINVAL);
+      return EOF;
+    }
+
+  // check for read access on stream
+  if (!OPEN4READING(fp))
+    {
+      __set_errno(EINVAL);
+      return -1;
+    }
+
+  // might check on multi bytes if text mode
+
+  if (fp->_cnt > 0)
+    {
+      fp->_cnt -= sizeof(wchar_t);
+      c = (wint_t )*((wchar_t *)(fp->_ptr))++;
+    }
+  else
+    {
+      c = _filwbuf(fp);
+    }
+  return c;
 }
 
 
index 2e8a45b..36cd1ae 100644 (file)
@@ -16,9 +16,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#include <stdarg.h>
-#include <crtdll/stdio.h>
-#include <crtdll/wchar.h>
+#include <msvcrt/stdarg.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/wchar.h>
 
 /* Write formatted output to stdout from the format string FORMAT.  */
 /* VARARGS1 */
index 0764d07..62f31ce 100644 (file)
@@ -1,9 +1,9 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
 #include <windows.h>
-#include <crtdll/stdio.h>
-#include <crtdll/wchar.h>
-#include <crtdll/errno.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/wchar.h>
+#include <msvcrt/errno.h>
+#include <msvcrt/internal/file.h>
 
 // putc can be a macro
 #undef putc
@@ -36,10 +36,24 @@ int putc(int c, FILE *fp)
        return EOF;
 }
 
-wint_t putwc(wchar_t c, FILE *fp)
+wint_t putwc(wint_t c, FILE *fp)
 {
+// valid stream macro should check that fp 
+// is dword aligned
+       if (!__validfp (fp)) {
+               __set_errno(EINVAL);
+               return -1;
+       }
+// check for write access on fp
+
+       if ( !OPEN4WRITING(fp)  ) {
+               __set_errno(EINVAL);
+               return -1;
+       }
        // might check on multi bytes if text mode
+
+       fp->_flag |= _IODIRTY;
+
         if (fp->_cnt > 0 ) {
                 fp->_cnt-= sizeof(wchar_t);
                *((wchar_t *)(fp->_ptr))++  = c;
index ce2b083..cc85051 100644 (file)
@@ -8,7 +8,7 @@
  * UPDATE HISTORY:
  *              28/12/98: Created
  */
-#include <crtdll/stdio.h>
+#include <msvcrt/stdio.h>
 
 #undef putc
 #undef putchar
@@ -20,3 +20,11 @@ int putchar(int c)
      fflush(stdout);
   return r;
 }
+
+wint_t putwchar(wint_t c)
+{
+  wint_t r = putwc(c, stdout);
+  if (stdout->_flag & _IOLBF)
+     fflush(stdout);
+  return r;
+}
index 11d6eb6..443a36b 100644 (file)
@@ -1,8 +1,8 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/stdio.h>
-#include <crtdll/io.h>
 #include <windows.h>
-#include <crtdll/string.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/io.h>
+#include <msvcrt/string.h>
 
 #undef putchar
 int
@@ -15,3 +15,14 @@ puts(const char *s)
   return putchar('\n');
 
 }
+
+int
+_putws(const wchar_t *s)
+{
+       
+  wint_t c;
+  while ((c = *s++))
+    putwchar(c);
+  return putwchar(L'\n');
+
+}
index 8f31313..52b04f8 100644 (file)
@@ -1,16 +1,17 @@
 #include <windows.h>
 #include <msvcrt/stddef.h>
+#include <msvcrt/stdio.h>
 
 int remove(const char *fn)
 {
-       if (!DeleteFileA(fn))
-               return -1;
-       return 0;
+  if (!DeleteFileA(fn))
+    return -1;
+  return 0;
 }
 
 int _wremove(const wchar_t *fn)
 {
-       if (!DeleteFileW(fn))
-               return -1;
-       return 0;
+  if (!DeleteFileW(fn))
+    return -1;
+  return 0;
 }
index 2f095e3..2b1d074 100644 (file)
@@ -1,11 +1,11 @@
 /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/stdio.h>
-#include <crtdll/stdlib.h>
-#include <crtdll/io.h>
-#include <crtdll/errno.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/io.h>
+#include <msvcrt/errno.h>
+#include <msvcrt/internal/file.h>
 
 
 int setvbuf(FILE *f, char *buf, int type, size_t len)
index 855bc55..8a27c85 100644 (file)
@@ -18,11 +18,11 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <stdarg.h>
-#include <crtdll/stdio.h>
-#include <crtdll/wchar.h>
+#include <msvcrt/stdarg.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/wchar.h>
 #include <limits.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/internal/file.h>
 
 #undef sprintf
 #undef wsprintf
index c37e1e3..c4fc04d 100644 (file)
@@ -1,9 +1,6 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/stdio.h>
-#include <crtdll/internal/file.h>
-//#include <crtdll/stdiohk.h>
-
-
+#include <msvcrt/stdio.h>
+#include <msvcrt/internal/file.h>
 
 FILE _iob[5] =
 {
index 9aca2ca..2cee3f2 100644 (file)
@@ -1,6 +1,6 @@
 #include <windows.h>
-#include <crtdll/stdio.h>
-#include <crtdll/stdlib.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/stdlib.h>
 
 
 char *_tempnam(const char *dir,const char *prefix )
index fb19270..ab45c80 100644 (file)
@@ -1,8 +1,8 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/stdio.h>
-#include <stdarg.h>
-#include <crtdll/malloc.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/stdarg.h>
+#include <msvcrt/malloc.h>
+#include <msvcrt/internal/file.h>
 
 int _isnanl(double x);
 int _isinfl(double x);
@@ -53,14 +53,14 @@ vfprintf(FILE *f, const char *fmt, va_list ap)
  * Appropiated for the reactos kernel, March 1998 -- David Welch
  */
 
-#include <stdarg.h>
+#include <msvcrt/stdarg.h>
 
-#include <crtdll/ctype.h>
-#include <crtdll/string.h>
-#include <crtdll/stdio.h>
-#include <crtdll/string.h>
-#include <crtdll/math.h>
-#include <crtdll/internal/ieee.h>
+#include <msvcrt/ctype.h>
+#include <msvcrt/string.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/string.h>
+#include <msvcrt/math.h>
+#include <msvcrt/internal/ieee.h>
 
 
 #define ZEROPAD                1       /* pad with zero */
index b4d5ae1..b77fb19 100644 (file)
@@ -1,15 +1,14 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/stdio.h>
-#include <stdarg.h>
-#include <crtdll/malloc.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/stdarg.h>
+#include <msvcrt/malloc.h>
+#include <msvcrt/internal/file.h>
 
 int _isnanl(double x);
 int _isinfl(double x);
 int _isnan(double x);
 int _isinf(double x);
 
-extern int putwc (wchar_t wc, FILE* fileWrite);
 
 int
 __vfwprintf(FILE *fp, const wchar_t *fmt0, va_list argp);
@@ -35,8 +34,6 @@ vfwprintf(FILE *f, const wchar_t *fmt, va_list ap)
                len = __vfwprintf(f,fmt,ap);
 
        return (ferror(f) ? EOF : len);
-
-//     return 0;
 }
 
 
@@ -56,14 +53,14 @@ vfwprintf(FILE *f, const wchar_t *fmt, va_list ap)
  * Appropiated for the reactos kernel, March 1998 -- David Welch
  */
 
-#include <stdarg.h>
+#include <msvcrt/stdarg.h>
 
-#include <crtdll/ctype.h>
-#include <crtdll/string.h>
-#include <crtdll/stdio.h>
-#include <crtdll/string.h>
-#include <crtdll/math.h>
-#include <crtdll/internal/ieee.h>
+#include <msvcrt/ctype.h>
+#include <msvcrt/string.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/string.h>
+#include <msvcrt/math.h>
+#include <msvcrt/internal/ieee.h>
 
 
 #define ZEROPAD                1       /* pad with zero */
index 780d960..f724749 100644 (file)
@@ -16,10 +16,10 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <stdarg.h>
+#include <msvcrt/stdarg.h>
 #undef __OPTIMIZE__    /* Avoid inline `vprintf' function.  */
-#include <crtdll/stdio.h>
-#include <crtdll/wchar.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/wchar.h>
 
 #undef vprintf
 #undef vwprintf
index 52e899e..75bfb1d 100644 (file)
@@ -1,8 +1,8 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/stdio.h>
-#include <stdarg.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/stdarg.h>
 #include <limits.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/internal/file.h>
 
 int
 vsprintf(char *str, const char *fmt, va_list ap)
index 2f6cef3..c67e0cf 100644 (file)
@@ -1,8 +1,8 @@
 #include <windows.h>
-#include <crtdll/stdlib.h>
-#include <crtdll/io.h>
-#include <crtdll/fcntl.h>
-#include <crtdll/internal/atexit.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/io.h>
+#include <msvcrt/fcntl.h>
+#include <msvcrt/internal/atexit.h>
 
 struct __atexit *__atexit_ptr = 0;
 
index 3c33587..b76a227 100644 (file)
@@ -1,7 +1,7 @@
-#include <crtdll/stdlib.h>
-#include <crtdll/stdio.h>
-#include <crtdll/io.h>
-#include <crtdll/signal.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/io.h>
+#include <msvcrt/signal.h>
 
 char *msg ="Abort\n\r";
 
index 462fa07..fd80fde 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/stdlib.h>
-#include <crtdll/internal/atexit.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/internal/atexit.h>
 
 int
 atexit(void (*a)(void))
index 1bcaeeb..c9b5116 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/stdlib.h>
+#include <msvcrt/stdlib.h>
 
 long double
 _atold(const char *ascii)
index 4f9d137..2bf85aa 100644 (file)
@@ -1,10 +1,10 @@
 /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/stdlib.h>
-#include <crtdll/stdio.h>
-#include <crtdll/string.h>
-#include <crtdll/float.h>
-#include <crtdll/alloc.h>
-// #include <crtdll/locale.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/string.h>
+#include <msvcrt/float.h>
+#include <msvcrt/alloc.h>
+// #include <msvcrt/locale.h>
 
 void __ecvround (char *, char *, const char *, int *);
 char *ecvtbuf (double, int, int *, int *, char *);
index f32157a..3a0b621 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/stdlib.h>
-#include <crtdll/stdio.h>
-#include <crtdll/string.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/string.h>
 
 char *
 _gcvt (double value, int ndigits, char *buf)
index d38d025..90e847b 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/stdlib.h>
-#include <crtdll/ctype.h>
-//#include <crtdll/unconst.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/ctype.h>
+//#include <msvcrt/unconst.h>
 
 static double powten[] =
 {
@@ -11,7 +11,7 @@ static double powten[] =
 
 long double
 _strtold(const char *s, char **sret)
-{      
+{
   double r;            /* result */
   int e, ne;                   /* exponent */
   int sign;                    /* +- 1.0 */
index 237aeac..b609e79 100644 (file)
@@ -1,10 +1,10 @@
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
 #include <limits.h>
-#include <crtdll/ctype.h>
-#include <crtdll/errno.h>
-#include <crtdll/stdlib.h>
-//#include <crtdll/unconst.h>
+#include <msvcrt/ctype.h>
+#include <msvcrt/errno.h>
+#include <msvcrt/stdlib.h>
+//#include <msvcrt/unconst.h>
 
 /* constants used in Solaris */
 #define LLONG_MIN       -9223372036854775807L-1L
index d94845e..ec9f852 100644 (file)
@@ -1,10 +1,10 @@
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
 #include <limits.h>
-#include <crtdll/ctype.h>
-#include <crtdll/errno.h>
-#include <crtdll/stdlib.h>
-//#include <crtdll/unconst.h>
+#include <msvcrt/ctype.h>
+#include <msvcrt/errno.h>
+#include <msvcrt/stdlib.h>
+//#include <msvcrt/unconst.h>
 
 /*
  * Convert a string to an unsigned long integer.
index 1ea9011..bdc39de 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/stdlib.h>
+#include <msvcrt/stdlib.h>
 
 void _swab (const char* caFrom, char* caTo, size_t sizeToCopy)
 {
index 9533eb2..ce3921d 100644 (file)
@@ -1,13 +1,13 @@
-#include <crtdll/stdlib.h>
+#include <msvcrt/stdlib.h>
 
-size_t wcstombs        (char* mbsDest, const wchar_t* wsConvert, size_t size)
+size_t wcstombs (char* mbsDest, const wchar_t* wsConvert, size_t size)
 {
-       return 0;
+  return 0;
 }
 
-int    wctomb          (char* mbDest, wchar_t wc)
+int wctomb (char* mbDest, wchar_t wc)
 {
-       return 0;
+  return 0;
 }
 
 
index 4742dd3..978bd2a 100644 (file)
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#include <crtdll/stdlib.h>
-#include <crtdll/wchar.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/wchar.h>
 
-#include <crtdll/errno.h>
-#include <crtdll/wchar.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/errno.h>
+#include <msvcrt/wchar.h>
+#include <msvcrt/internal/file.h>
 
 #ifndef EILSEQ
 #define EILSEQ EINVAL
index 32fb7a0..4fc85df 100644 (file)
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#include <crtdll/stdlib.h>
-#include <crtdll/wchar.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/wchar.h>
 
-#include <crtdll/errno.h>
-#include <crtdll/wchar.h>
+#include <msvcrt/errno.h>
+#include <msvcrt/wchar.h>
 
 #ifndef EILSEQ
 #define EILSEQ EINVAL
index 458e31b..fd0fd21 100644 (file)
@@ -7,36 +7,36 @@
  * UPDATE HISTORY:
  *              28/12/98: Created
  */
-#include       <windows.h>
-#include       <crtdll/sys/types.h>
-#include       <crtdll/sys/stat.h>
-#include       <crtdll/fcntl.h>
-#include       <crtdll/string.h>
-#include       <crtdll/errno.h>
-#include       <crtdll/internal/file.h>
+#include <windows.h>
+#include <msvcrt/sys/types.h>
+#include <msvcrt/sys/stat.h>
+#include <msvcrt/fcntl.h>
+#include <msvcrt/string.h>
+#include <msvcrt/errno.h>
+#include <msvcrt/internal/file.h>
 
 
 int
 _fstat(int fd, struct stat *statbuf)
 {
   BY_HANDLE_FILE_INFORMATION  FileInformation;
 
   if (!statbuf)
     {
-      __set_errno(EINVAL);     
+      __set_errno(EINVAL);
       return -1;
     }
 
-  if ( !GetFileInformationByHandle(_get_osfhandle(fd),&FileInformation) ) {
-       __set_errno (EBADF);
-       return -1;
-  }
-  statbuf->st_ctime = FileTimeToUnixTime( &FileInformation.ftCreationTime,NULL);
-  statbuf->st_atime = FileTimeToUnixTime( &FileInformation.ftLastAccessTime,NULL);
-  statbuf->st_mtime = FileTimeToUnixTime( &FileInformation.ftLastWriteTime,NULL);
+  if (!GetFileInformationByHandle(_get_osfhandle(fd),&FileInformation))
+    {
+      __set_errno(EBADF);
+      return -1;
+    }
+  statbuf->st_ctime = FileTimeToUnixTime(&FileInformation.ftCreationTime,NULL);
+  statbuf->st_atime = FileTimeToUnixTime(&FileInformation.ftLastAccessTime,NULL);
+  statbuf->st_mtime = FileTimeToUnixTime(&FileInformation.ftLastWriteTime,NULL);
 
   statbuf->st_dev = fd;
-  statbuf->st_size = FileInformation.nFileSizeLow; 
+  statbuf->st_size = FileInformation.nFileSizeLow;
   return 0;
 }
index bb78ae9..0865195 100644 (file)
@@ -1,17 +1,16 @@
-#include <crtdll/sys/types.h>
-#include <crtdll/sys/stat.h>
-#include <crtdll/fcntl.h>
-#include <crtdll/io.h>
+#include <msvcrt/sys/types.h>
+#include <msvcrt/sys/stat.h>
+#include <msvcrt/fcntl.h>
+#include <msvcrt/io.h>
 
 
-int _stat( const char *path, struct stat *buffer )
+int _stat(const char *path, struct stat *buffer)
 {
-       int fd = _open(path,_O_RDONLY);
-       int ret;
-       
-       ret = fstat(fd,buffer);
-       _close(fd);
+  int fd = _open(path,_O_RDONLY);
+  int ret;
 
-       return ret;
+  ret = fstat(fd,buffer);
+  _close(fd);
 
+  return ret;
 }
index 9f33c97..597b867 100644 (file)
@@ -42,17 +42,17 @@ static char sccsid[] = "@(#)ctime.c 5.23 (Berkeley) 6/22/90";
 
 
 
-#include <crtdll/fcntl.h>
-#include <crtdll/time.h>
-#include <crtdll/string.h>
-#include <crtdll/ctype.h>
-#include <crtdll/stdio.h>
-#include <crtdll/stdlib.h>
+#include <msvcrt/fcntl.h>
+#include <msvcrt/time.h>
+#include <msvcrt/string.h>
+#include <msvcrt/ctype.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/stdlib.h>
 
 #include <windows.h>
 #include "tzfile.h"
 
-#include <crtdll/io.h>
+#include <msvcrt/io.h>
 
 #include "posixrul.h"
 
index 3a49372..917ee9a 100644 (file)
@@ -16,8 +16,8 @@
  */
 
 #include <windows.h>
-#include <crtdll/time.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/time.h>
+#include <msvcrt/internal/file.h>
 
 VOID STDCALL GetSystemTimeAsFileTime(LPFILETIME  lpSystemTimeAsFileTime );
 
index 0dcf2da..8980b83 100644 (file)
@@ -8,7 +8,7 @@
  * Copyright 1997 Uwe Bonnes
  */
 
-#include <crtdll/wchar.h>
+#include <msvcrt/wchar.h>
 
 wchar_t * _wcslwr(wchar_t *x)
 {
index 85d0d81..bca5052 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/wchar.h>
+#include <msvcrt/wchar.h>
 
 wchar_t *wcsncat(wchar_t *dst, const wchar_t *src, size_t n)
 {
index 6341f46..e661043 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/wchar.h>
+#include <msvcrt/wchar.h>
 
 int wcsncmp(const wchar_t * cs,const wchar_t * ct,size_t count)
 {
index 9cad913..07d0000 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/wchar.h>
+#include <msvcrt/wchar.h>
 
 wchar_t * wcsncpy(wchar_t * dest,const wchar_t *src,size_t count)
 {
index f06aa3e..ef917c3 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/wchar.h>
+#include <msvcrt/wchar.h>
 
 int _wcsnicmp (const wchar_t *cs, const wchar_t *ct, size_t count)
 {
index dc5796c..aa3e330 100644 (file)
@@ -1,12 +1,10 @@
-#include <crtdll/wchar.h>
+#include <msvcrt/wchar.h>
 
 size_t _wcsnlen(const wchar_t * s, size_t count)
 {
-      
-        unsigned int len=0;
+  unsigned int len=0;
 
-        while(s[len]!=0 && len < count) {
-                len++;
-        };
-        return len;
+  while(s[len]!=0 && len < count)
+    len++;
+  return len;
 }