Untangled crtdll/msvcrt header mess.

svn path=/trunk/; revision=2031
This commit is contained in:
Eric Kohl 2001-07-03 13:21:22 +00:00
parent a6f8fd2f79
commit 357a89921a
73 changed files with 428 additions and 458 deletions

View file

@ -1,5 +1,5 @@
#include <windows.h> #include <windows.h>
#include <crtdll/io.h> #include <msvcrt/io.h>
#ifndef F_OK #ifndef F_OK
#define F_OK 0x01 #define F_OK 0x01

View file

@ -1,14 +1,12 @@
#include <crtdll/io.h>
#include <windows.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 ) if (_fd == -1)
return -1; return -1;
if ( CloseHandle(_get_osfhandle(_fd)) == FALSE ) if (CloseHandle(_get_osfhandle(_fd)) == FALSE)
return -1; return -1;
return __fileno_close(_fd); return __fileno_close(_fd);
} }

View file

@ -1,7 +1,7 @@
#include <windows.h> #include <windows.h>
#include <crtdll/io.h> #include <msvcrt/io.h>
#include <msvcrt/errno.h> #include <msvcrt/errno.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
int _commode = _IOCOMMIT; int _commode = _IOCOMMIT;

View file

@ -1,6 +1,6 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/fcntl.h> #include <msvcrt/fcntl.h>
#include <crtdll/io.h> #include <msvcrt/io.h>
#undef _fmode #undef _fmode
unsigned int _fmode = O_TEXT; unsigned int _fmode = O_TEXT;

View file

@ -1,5 +1,5 @@
#include <crtdll/io.h> #include <msvcrt/io.h>
#include <crtdll/sys/stat.h> #include <msvcrt/sys/stat.h>
int _isatty( int fd ) int _isatty( int fd )

View file

@ -1,9 +1,9 @@
#include <windows.h> #include <windows.h>
#include <crtdll/io.h> #include <msvcrt/io.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
long _lseek(int _fildes, long _offset, int _whence) long _lseek(int _fildes, long _offset, int _whence)
{ {
return _llseek((HFILE)filehnd(_fildes),_offset,_whence); return _llseek((HFILE)filehnd(_fildes),_offset,_whence);
} }

View file

@ -13,9 +13,9 @@
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/string.h> #include <msvcrt/string.h>
#include <crtdll/io.h> #include <msvcrt/io.h>
char* _mktemp (char *_template) char* _mktemp (char *_template)

View file

@ -13,13 +13,13 @@
// possibly store extra information at the handle // possibly store extra information at the handle
#include <windows.h> #include <windows.h>
#include <crtdll/io.h> #include <msvcrt/io.h>
#include <crtdll/fcntl.h> #include <msvcrt/fcntl.h>
#include <crtdll/sys/stat.h> #include <msvcrt/sys/stat.h>
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
#include <crtdll/string.h> #include <msvcrt/string.h>
#include <crtdll/share.h> #include <msvcrt/share.h>
typedef struct _fileno_modes_type typedef struct _fileno_modes_type
{ {

View file

@ -7,8 +7,8 @@
* UPDATE HISTORY: * UPDATE HISTORY:
* 28/12/98: Created * 28/12/98: Created
*/ */
#include <crtdll/io.h>
#include <windows.h> #include <windows.h>
#include <msvcrt/io.h>
size_t _read(int _fd, void *_buf, size_t _nbyte) size_t _read(int _fd, void *_buf, size_t _nbyte)
{ {

View file

@ -8,12 +8,12 @@
* 28/12/98: Created * 28/12/98: Created
*/ */
#include <crtdll/io.h> #include <msvcrt/io.h>
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
int _setmode(int _fd, int _newmode) int _setmode(int _fd, int _newmode)
{ {
return __fileno_setmode(_fd, _newmode); return __fileno_setmode(_fd, _newmode);
} }

View file

@ -8,13 +8,12 @@
* 28/12/98: Created * 28/12/98: Created
*/ */
#include <windows.h> #include <windows.h>
#include <crtdll/io.h> #include <msvcrt/io.h>
int _unlink(const char *filename)
int _unlink( const char *filename )
{ {
if ( !DeleteFileA(filename) ) if (!DeleteFileA(filename))
return -1; return -1;
return 0; return 0;
} }

View file

@ -7,9 +7,8 @@
* UPDATE HISTORY: * UPDATE HISTORY:
* 28/12/98: Created * 28/12/98: Created
*/ */
#include <crtdll/io.h>
#include <windows.h> #include <windows.h>
#include <msvcrt/io.h>
size_t _write(int _fd, const void *_buf, size_t _nbyte) size_t _write(int _fd, const void *_buf, size_t _nbyte)

View file

@ -8,7 +8,7 @@
* 28/12/98: Created * 28/12/98: Created
*/ */
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
static char *__rt_err_msg[] = static char *__rt_err_msg[] =

View file

@ -1,8 +1,8 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/assert.h> #include <msvcrt/assert.h>
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
#include <crtdll/signal.h> #include <msvcrt/signal.h>
void _assert(const char *msg, const char *file, int line) void _assert(const char *msg, const char *file, int line)
{ {

View 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 ; ReactOS MSVCRT Compatibility Library
; ;
@ -416,7 +416,7 @@ _purecall
; _putch ; _putch
_putenv _putenv
; _putw ; _putw
; _putws _putws
_pwctype DATA _pwctype DATA
_read _read
_rmdir _rmdir
@ -613,7 +613,7 @@ fopen
fprintf fprintf
fputc fputc
fputs fputs
; fputwc fputwc
; fputws ; fputws
fread fread
free free
@ -685,7 +685,7 @@ putc
putchar putchar
puts puts
putwc putwc
; putwchar putwchar
qsort qsort
raise raise
; rand ; rand

View file

@ -9,7 +9,7 @@
*/ */
#include <windows.h> #include <windows.h>
#include <crtdll/process.h> #include <msvcrt/process.h>
void *_loaddll (char *name) void *_loaddll (char *name)
{ {

View file

@ -1,5 +1,5 @@
#include <windows.h> #include <windows.h>
#include <crtdll/process.h> #include <msvcrt/process.h>
int _getpid (void) int _getpid (void)
{ {

View 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 <windows.h>
#include <errno.h> #include <msvcrt/errno.h>
#include <msvcrt/process.h>
unsigned long unsigned long
_beginthread ( _beginthread (

View file

@ -1,5 +1,5 @@
#include <windows.h> #include <windows.h>
#include <crtdll/process.h> #include <msvcrt/process.h>
unsigned long __threadid (void) unsigned long __threadid (void)
{ {

View file

@ -1,8 +1,8 @@
#include <crtdll/signal.h> #include <msvcrt/signal.h>
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
#include <crtdll/errno.h> #include <msvcrt/errno.h>
#include <crtdll/string.h> #include <msvcrt/string.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
void _default_handler(int signal); void _default_handler(int signal);

View file

@ -1,8 +1,8 @@
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/string.h> #include <msvcrt/string.h>
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
FILE * __alloc_file(void); FILE * __alloc_file(void);

View file

@ -1,12 +1,12 @@
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/io.h> #include <msvcrt/io.h>
#include <crtdll/sys/types.h> #include <msvcrt/sys/types.h>
#include <crtdll/sys/stat.h> #include <msvcrt/sys/stat.h>
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
#include <crtdll/errno.h> #include <msvcrt/errno.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
// changed check for writable stream // changed check for writable stream

View file

@ -1,7 +1,7 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/errno.h> #include <msvcrt/errno.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
#ifdef feof #ifdef feof
#undef feof #undef feof

View file

@ -1,6 +1,6 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
#ifdef ferror #ifdef ferror
#undef ferror #undef ferror

View file

@ -11,13 +11,13 @@
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/errno.h> #include <msvcrt/errno.h>
#include <crtdll/sys/types.h> #include <msvcrt/sys/types.h>
#include <crtdll/sys/stat.h> #include <msvcrt/sys/stat.h>
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
#include <crtdll/io.h> #include <msvcrt/io.h>
int fflush(FILE *f) int fflush(FILE *f)

View file

@ -1,6 +1,6 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
char * char *
fgets(char *s, int n, FILE *f) fgets(char *s, int n, FILE *f)

View file

@ -2,14 +2,14 @@
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/sys/types.h> #include <msvcrt/sys/types.h>
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
#include <crtdll/string.h> #include <msvcrt/string.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
#include <crtdll/io.h> #include <msvcrt/io.h>
#include <crtdll/wchar.h> #include <msvcrt/wchar.h>
#include <crtdll/errno.h> #include <msvcrt/errno.h>
int _readcnv(int fn, void *buf, size_t siz ); int _readcnv(int fn, void *buf, size_t siz );

View file

@ -1,14 +1,14 @@
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#if 0 #if 0
#undef fileno #undef fileno
int fileno(FILE *f) int fileno(FILE *f)
{ {
return f->_file; return f->_file;
} }
#endif #endif
int _fileno(FILE *f) int _fileno(FILE *f)
{ {
return f->_file; return f->_file;
} }

View file

@ -1,13 +1,13 @@
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/wchar.h> #include <msvcrt/wchar.h>
#include <crtdll/sys/types.h> #include <msvcrt/sys/types.h>
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
#include <crtdll/io.h> #include <msvcrt/io.h>
#include <crtdll/errno.h> #include <msvcrt/errno.h>
int cntcr(char *bufp, int bufsiz); int cntcr(char *bufp, int bufsiz);
int convert(char *endp, int bufsiz,int n); int convert(char *endp, int bufsiz,int n);

View file

@ -1,10 +1,10 @@
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/sys/types.h> #include <msvcrt/sys/types.h>
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/io.h> #include <msvcrt/io.h>
#include <crtdll/fcntl.h> #include <msvcrt/fcntl.h>
//#include <crtdll/internal/file.h> //#include <msvcrt/internal/file.h>
//might change fopen(file,mode) -> fsopen(file,mode,_SH_DENYNO); //might change fopen(file,mode) -> fsopen(file,mode,_SH_DENYNO);

View file

@ -1,7 +1,7 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/wchar.h> #include <msvcrt/wchar.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
int int
fprintf(register FILE *iop, const char *fmt, ...) fprintf(register FILE *iop, const char *fmt, ...)

View file

@ -1,7 +1,7 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/wchar.h> #include <msvcrt/wchar.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
int int
fputc(int c, FILE *fp) fputc(int c, FILE *fp)
@ -12,6 +12,6 @@ fputc(int c, FILE *fp)
wint_t wint_t
fputwc(wchar_t c, FILE *fp) fputwc(wchar_t c, FILE *fp)
{ {
return fputwc(c,fp); return putwc(c,fp);
} }

View file

@ -1,13 +1,12 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ /* 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 <windows.h>
#include <msvcrt/stdio.h>
#include <msvcrt/internal/file.h>
#include <msvcrt/string.h>
int int
fputs(const char *s, FILE *f) fputs(const char *s, FILE *f)
{ {
int r = 0; int r = 0;
int c; int c;
int unbuffered; int unbuffered;
@ -34,5 +33,4 @@ fputs(const char *s, FILE *f)
} }
return(r); return(r);
} }

View file

@ -1,83 +1,53 @@
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
#include <crtdll/string.h> #include <msvcrt/string.h>
#include <crtdll/errno.h> #include <msvcrt/errno.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
// carriage return line feed conversion is done in filbuf and flsbuf size_t fread(void *vptr, size_t size, size_t count, FILE *iop)
#if 0
size_t
fread(void *p, size_t size, size_t count, FILE *iop)
{ {
char *ptr = (char *)p; char *ptr = (char *)vptr;
int to_read; size_t to_read ,n_read;
to_read = size * count; 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;
while ( to_read > 0 ) { if (vptr == NULL || to_read == 0)
*ptr = getc(iop) ; return 0;
if ( *ptr == EOF )
break;
to_read--;
ptr++;
}
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.
return count- (to_read/size); 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;
// the file buffer is empty and there is no read ahead information anymore.
iop->_flag &= ~_IOAHEAD;
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;
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 (vptr == NULL || to_read == 0)
return 0;
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.
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;
// the file buffer is empty and there is no read ahead information anymore.
iop->_flag &= ~_IOAHEAD;
return count- (to_read/size);
}
#endif

View file

@ -1,6 +1,6 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
// not exported by crtdll // not exported by crtdll
__file_rec *__file_rec_list; __file_rec *__file_rec_list;

View file

@ -1,84 +1,51 @@
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
#include <crtdll/string.h> #include <msvcrt/string.h>
#include <crtdll/errno.h> #include <msvcrt/errno.h>
#include <crtdll/internal/file.h> #include <msvcrt/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;
}
#else
size_t fwrite(const void *vptr, size_t size, size_t count, FILE *iop) size_t fwrite(const void *vptr, size_t size, size_t count, FILE *iop)
{ {
size_t to_write, n_written; size_t to_write, n_written;
char *ptr = (char *)vptr; char *ptr = (char *)vptr;
to_write = size*count; to_write = size*count;
if (!OPEN4WRITING(iop) ) if (!OPEN4WRITING(iop))
{ {
__set_errno (EINVAL); __set_errno (EINVAL);
return 0; return 0;
} }
if (iop == NULL)
{
__set_errno (EINVAL);
return 0;
}
if (iop == NULL ) if (ferror (iop))
{ return 0;
__set_errno (EINVAL); if (vptr == NULL || to_write == 0)
return 0; return 0;
}
if (ferror (iop)) while(iop->_cnt > 0 && to_write > 0)
return 0; {
if (vptr == NULL || to_write == 0) to_write--;
return 0; 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);
while(iop->_cnt > 0 && to_write > 0 ) { n_written = _write(fileno(iop), ptr,to_write);
to_write--; if (n_written != -1)
putc(*ptr++,iop); to_write -= n_written;
}
// if the buffer is dirty it will have to be written now // check to see if this will work with in combination with ungetc
// otherwise the file pointer won't match anymore.
fflush(iop); // the file buffer is empty and there is no read ahead information anymore.
iop->_flag &= ~_IOAHEAD;
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);
return count - (to_write/size);
} }
#endif

View file

@ -1,8 +1,8 @@
#include <windows.h> #include <windows.h>
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/wchar.h> #include <msvcrt/wchar.h>
#include <crtdll/errno.h> #include <msvcrt/errno.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
//getc can be a macro //getc can be a macro
#undef getc #undef getc
@ -33,23 +33,36 @@ int getc(FILE *fp)
return c; return c;
} }
// not exported wint_t getwc(FILE *fp)
wint_t getwc(FILE *fp)
{ {
int c = -1;
// might check on multi bytes if text mode // check for invalid stream
if (!__validfp(fp))
{
__set_errno(EINVAL);
return EOF;
}
if(fp->_cnt > 0) { // check for read access on stream
fp->_cnt -= sizeof(wchar_t); if (!OPEN4READING(fp))
return (wint_t )*((wchar_t *)(fp->_ptr))++; {
} __set_errno(EINVAL);
else { return -1;
return _filwbuf(fp); }
}
// never reached // might check on multi bytes if text mode
return -1;
if (fp->_cnt > 0)
{
fp->_cnt -= sizeof(wchar_t);
c = (wint_t )*((wchar_t *)(fp->_ptr))++;
}
else
{
c = _filwbuf(fp);
}
return c;
} }

View file

@ -16,9 +16,9 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#include <stdarg.h> #include <msvcrt/stdarg.h>
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/wchar.h> #include <msvcrt/wchar.h>
/* Write formatted output to stdout from the format string FORMAT. */ /* Write formatted output to stdout from the format string FORMAT. */
/* VARARGS1 */ /* VARARGS1 */

View file

@ -1,9 +1,9 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <windows.h> #include <windows.h>
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/wchar.h> #include <msvcrt/wchar.h>
#include <crtdll/errno.h> #include <msvcrt/errno.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
// putc can be a macro // putc can be a macro
#undef putc #undef putc
@ -36,10 +36,24 @@ int putc(int c, FILE *fp)
return EOF; 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 // might check on multi bytes if text mode
fp->_flag |= _IODIRTY;
if (fp->_cnt > 0 ) { if (fp->_cnt > 0 ) {
fp->_cnt-= sizeof(wchar_t); fp->_cnt-= sizeof(wchar_t);
*((wchar_t *)(fp->_ptr))++ = c; *((wchar_t *)(fp->_ptr))++ = c;

View file

@ -8,7 +8,7 @@
* UPDATE HISTORY: * UPDATE HISTORY:
* 28/12/98: Created * 28/12/98: Created
*/ */
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#undef putc #undef putc
#undef putchar #undef putchar
@ -20,3 +20,11 @@ int putchar(int c)
fflush(stdout); fflush(stdout);
return r; return r;
} }
wint_t putwchar(wint_t c)
{
wint_t r = putwc(c, stdout);
if (stdout->_flag & _IOLBF)
fflush(stdout);
return r;
}

View file

@ -1,8 +1,8 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdio.h>
#include <crtdll/io.h>
#include <windows.h> #include <windows.h>
#include <crtdll/string.h> #include <msvcrt/stdio.h>
#include <msvcrt/io.h>
#include <msvcrt/string.h>
#undef putchar #undef putchar
int int
@ -15,3 +15,14 @@ puts(const char *s)
return putchar('\n'); return putchar('\n');
} }
int
_putws(const wchar_t *s)
{
wint_t c;
while ((c = *s++))
putwchar(c);
return putwchar(L'\n');
}

View file

@ -1,16 +1,17 @@
#include <windows.h> #include <windows.h>
#include <msvcrt/stddef.h> #include <msvcrt/stddef.h>
#include <msvcrt/stdio.h>
int remove(const char *fn) int remove(const char *fn)
{ {
if (!DeleteFileA(fn)) if (!DeleteFileA(fn))
return -1; return -1;
return 0; return 0;
} }
int _wremove(const wchar_t *fn) int _wremove(const wchar_t *fn)
{ {
if (!DeleteFileW(fn)) if (!DeleteFileW(fn))
return -1; return -1;
return 0; return 0;
} }

View file

@ -1,11 +1,11 @@
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1996 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 */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
#include <crtdll/io.h> #include <msvcrt/io.h>
#include <crtdll/errno.h> #include <msvcrt/errno.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
int setvbuf(FILE *f, char *buf, int type, size_t len) int setvbuf(FILE *f, char *buf, int type, size_t len)

View 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, not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */ Cambridge, MA 02139, USA. */
#include <stdarg.h> #include <msvcrt/stdarg.h>
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/wchar.h> #include <msvcrt/wchar.h>
#include <limits.h> #include <limits.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
#undef sprintf #undef sprintf
#undef wsprintf #undef wsprintf

View file

@ -1,9 +1,6 @@
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
//#include <crtdll/stdiohk.h>
FILE _iob[5] = FILE _iob[5] =
{ {

View file

@ -1,6 +1,6 @@
#include <windows.h> #include <windows.h>
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
char *_tempnam(const char *dir,const char *prefix ) char *_tempnam(const char *dir,const char *prefix )

View file

@ -1,8 +1,8 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <stdarg.h> #include <msvcrt/stdarg.h>
#include <crtdll/malloc.h> #include <msvcrt/malloc.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
int _isnanl(double x); int _isnanl(double x);
int _isinfl(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 * Appropiated for the reactos kernel, March 1998 -- David Welch
*/ */
#include <stdarg.h> #include <msvcrt/stdarg.h>
#include <crtdll/ctype.h> #include <msvcrt/ctype.h>
#include <crtdll/string.h> #include <msvcrt/string.h>
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/string.h> #include <msvcrt/string.h>
#include <crtdll/math.h> #include <msvcrt/math.h>
#include <crtdll/internal/ieee.h> #include <msvcrt/internal/ieee.h>
#define ZEROPAD 1 /* pad with zero */ #define ZEROPAD 1 /* pad with zero */

View file

@ -1,15 +1,14 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <stdarg.h> #include <msvcrt/stdarg.h>
#include <crtdll/malloc.h> #include <msvcrt/malloc.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
int _isnanl(double x); int _isnanl(double x);
int _isinfl(double x); int _isinfl(double x);
int _isnan(double x); int _isnan(double x);
int _isinf(double x); int _isinf(double x);
extern int putwc (wchar_t wc, FILE* fileWrite);
int int
__vfwprintf(FILE *fp, const wchar_t *fmt0, va_list argp); __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); len = __vfwprintf(f,fmt,ap);
return (ferror(f) ? EOF : len); 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 * Appropiated for the reactos kernel, March 1998 -- David Welch
*/ */
#include <stdarg.h> #include <msvcrt/stdarg.h>
#include <crtdll/ctype.h> #include <msvcrt/ctype.h>
#include <crtdll/string.h> #include <msvcrt/string.h>
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/string.h> #include <msvcrt/string.h>
#include <crtdll/math.h> #include <msvcrt/math.h>
#include <crtdll/internal/ieee.h> #include <msvcrt/internal/ieee.h>
#define ZEROPAD 1 /* pad with zero */ #define ZEROPAD 1 /* pad with zero */

View 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, not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */ Cambridge, MA 02139, USA. */
#include <stdarg.h> #include <msvcrt/stdarg.h>
#undef __OPTIMIZE__ /* Avoid inline `vprintf' function. */ #undef __OPTIMIZE__ /* Avoid inline `vprintf' function. */
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/wchar.h> #include <msvcrt/wchar.h>
#undef vprintf #undef vprintf
#undef vwprintf #undef vwprintf

View file

@ -1,8 +1,8 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <stdarg.h> #include <msvcrt/stdarg.h>
#include <limits.h> #include <limits.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
int int
vsprintf(char *str, const char *fmt, va_list ap) vsprintf(char *str, const char *fmt, va_list ap)

View file

@ -1,8 +1,8 @@
#include <windows.h> #include <windows.h>
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
#include <crtdll/io.h> #include <msvcrt/io.h>
#include <crtdll/fcntl.h> #include <msvcrt/fcntl.h>
#include <crtdll/internal/atexit.h> #include <msvcrt/internal/atexit.h>
struct __atexit *__atexit_ptr = 0; struct __atexit *__atexit_ptr = 0;

View file

@ -1,7 +1,7 @@
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/io.h> #include <msvcrt/io.h>
#include <crtdll/signal.h> #include <msvcrt/signal.h>
char *msg ="Abort\n\r"; char *msg ="Abort\n\r";

View file

@ -1,6 +1,6 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
#include <crtdll/internal/atexit.h> #include <msvcrt/internal/atexit.h>
int int
atexit(void (*a)(void)) atexit(void (*a)(void))

View file

@ -1,5 +1,5 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
long double long double
_atold(const char *ascii) _atold(const char *ascii)

View file

@ -1,10 +1,10 @@
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/string.h> #include <msvcrt/string.h>
#include <crtdll/float.h> #include <msvcrt/float.h>
#include <crtdll/alloc.h> #include <msvcrt/alloc.h>
// #include <crtdll/locale.h> // #include <msvcrt/locale.h>
void __ecvround (char *, char *, const char *, int *); void __ecvround (char *, char *, const char *, int *);
char *ecvtbuf (double, int, int *, int *, char *); char *ecvtbuf (double, int, int *, int *, char *);

View file

@ -1,7 +1,7 @@
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/string.h> #include <msvcrt/string.h>
char * char *
_gcvt (double value, int ndigits, char *buf) _gcvt (double value, int ndigits, char *buf)

View file

@ -1,7 +1,7 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
#include <crtdll/ctype.h> #include <msvcrt/ctype.h>
//#include <crtdll/unconst.h> //#include <msvcrt/unconst.h>
static double powten[] = static double powten[] =
{ {

View file

@ -1,10 +1,10 @@
/* Copyright (C) 1996 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 */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <limits.h> #include <limits.h>
#include <crtdll/ctype.h> #include <msvcrt/ctype.h>
#include <crtdll/errno.h> #include <msvcrt/errno.h>
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
//#include <crtdll/unconst.h> //#include <msvcrt/unconst.h>
/* constants used in Solaris */ /* constants used in Solaris */
#define LLONG_MIN -9223372036854775807L-1L #define LLONG_MIN -9223372036854775807L-1L

View file

@ -1,10 +1,10 @@
/* Copyright (C) 1996 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 */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <limits.h> #include <limits.h>
#include <crtdll/ctype.h> #include <msvcrt/ctype.h>
#include <crtdll/errno.h> #include <msvcrt/errno.h>
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
//#include <crtdll/unconst.h> //#include <msvcrt/unconst.h>
/* /*
* Convert a string to an unsigned long integer. * Convert a string to an unsigned long integer.

View file

@ -1,5 +1,5 @@
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ /* 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) void _swab (const char* caFrom, char* caTo, size_t sizeToCopy)
{ {

View 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;
} }

View file

@ -16,12 +16,12 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
#include <crtdll/wchar.h> #include <msvcrt/wchar.h>
#include <crtdll/errno.h> #include <msvcrt/errno.h>
#include <crtdll/wchar.h> #include <msvcrt/wchar.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
#ifndef EILSEQ #ifndef EILSEQ
#define EILSEQ EINVAL #define EILSEQ EINVAL

View file

@ -16,11 +16,11 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
#include <crtdll/wchar.h> #include <msvcrt/wchar.h>
#include <crtdll/errno.h> #include <msvcrt/errno.h>
#include <crtdll/wchar.h> #include <msvcrt/wchar.h>
#ifndef EILSEQ #ifndef EILSEQ
#define EILSEQ EINVAL #define EILSEQ EINVAL

View file

@ -7,19 +7,18 @@
* UPDATE HISTORY: * UPDATE HISTORY:
* 28/12/98: Created * 28/12/98: Created
*/ */
#include <windows.h> #include <windows.h>
#include <crtdll/sys/types.h> #include <msvcrt/sys/types.h>
#include <crtdll/sys/stat.h> #include <msvcrt/sys/stat.h>
#include <crtdll/fcntl.h> #include <msvcrt/fcntl.h>
#include <crtdll/string.h> #include <msvcrt/string.h>
#include <crtdll/errno.h> #include <msvcrt/errno.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
int int
_fstat(int fd, struct stat *statbuf) _fstat(int fd, struct stat *statbuf)
{ {
BY_HANDLE_FILE_INFORMATION FileInformation; BY_HANDLE_FILE_INFORMATION FileInformation;
if (!statbuf) if (!statbuf)
@ -28,13 +27,14 @@ _fstat(int fd, struct stat *statbuf)
return -1; return -1;
} }
if ( !GetFileInformationByHandle(_get_osfhandle(fd),&FileInformation) ) { if (!GetFileInformationByHandle(_get_osfhandle(fd),&FileInformation))
__set_errno (EBADF); {
return -1; __set_errno(EBADF);
} return -1;
statbuf->st_ctime = FileTimeToUnixTime( &FileInformation.ftCreationTime,NULL); }
statbuf->st_atime = FileTimeToUnixTime( &FileInformation.ftLastAccessTime,NULL); statbuf->st_ctime = FileTimeToUnixTime(&FileInformation.ftCreationTime,NULL);
statbuf->st_mtime = FileTimeToUnixTime( &FileInformation.ftLastWriteTime,NULL); statbuf->st_atime = FileTimeToUnixTime(&FileInformation.ftLastAccessTime,NULL);
statbuf->st_mtime = FileTimeToUnixTime(&FileInformation.ftLastWriteTime,NULL);
statbuf->st_dev = fd; statbuf->st_dev = fd;
statbuf->st_size = FileInformation.nFileSizeLow; statbuf->st_size = FileInformation.nFileSizeLow;

View file

@ -1,17 +1,16 @@
#include <crtdll/sys/types.h> #include <msvcrt/sys/types.h>
#include <crtdll/sys/stat.h> #include <msvcrt/sys/stat.h>
#include <crtdll/fcntl.h> #include <msvcrt/fcntl.h>
#include <crtdll/io.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 fd = _open(path,_O_RDONLY);
int ret; int ret;
ret = fstat(fd,buffer); ret = fstat(fd,buffer);
_close(fd); _close(fd);
return ret;
return ret;
} }

View file

@ -42,17 +42,17 @@ static char sccsid[] = "@(#)ctime.c 5.23 (Berkeley) 6/22/90";
#include <crtdll/fcntl.h> #include <msvcrt/fcntl.h>
#include <crtdll/time.h> #include <msvcrt/time.h>
#include <crtdll/string.h> #include <msvcrt/string.h>
#include <crtdll/ctype.h> #include <msvcrt/ctype.h>
#include <crtdll/stdio.h> #include <msvcrt/stdio.h>
#include <crtdll/stdlib.h> #include <msvcrt/stdlib.h>
#include <windows.h> #include <windows.h>
#include "tzfile.h" #include "tzfile.h"
#include <crtdll/io.h> #include <msvcrt/io.h>
#include "posixrul.h" #include "posixrul.h"

View file

@ -16,8 +16,8 @@
*/ */
#include <windows.h> #include <windows.h>
#include <crtdll/time.h> #include <msvcrt/time.h>
#include <crtdll/internal/file.h> #include <msvcrt/internal/file.h>
VOID STDCALL GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime ); VOID STDCALL GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime );

View file

@ -8,7 +8,7 @@
* Copyright 1997 Uwe Bonnes * Copyright 1997 Uwe Bonnes
*/ */
#include <crtdll/wchar.h> #include <msvcrt/wchar.h>
wchar_t * _wcslwr(wchar_t *x) wchar_t * _wcslwr(wchar_t *x)
{ {

View file

@ -1,5 +1,5 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ /* 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) wchar_t *wcsncat(wchar_t *dst, const wchar_t *src, size_t n)
{ {

View 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) int wcsncmp(const wchar_t * cs,const wchar_t * ct,size_t count)
{ {

View 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) wchar_t * wcsncpy(wchar_t * dest,const wchar_t *src,size_t count)
{ {

View 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) int _wcsnicmp (const wchar_t *cs, const wchar_t *ct, size_t count)
{ {

View file

@ -1,12 +1,10 @@
#include <crtdll/wchar.h> #include <msvcrt/wchar.h>
size_t _wcsnlen(const wchar_t * s, size_t count) 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++;
while(s[len]!=0 && len < count) { return len;
len++;
};
return len;
} }