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 <crtdll/io.h>
#include <msvcrt/io.h>
#ifndef F_OK
#define F_OK 0x01

View file

@ -1,7 +1,6 @@
#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)
{
@ -10,5 +9,4 @@ int _close(int _fd)
if (CloseHandle(_get_osfhandle(_fd)) == FALSE)
return -1;
return __fileno_close(_fd);
}

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

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

View 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 )

View file

@ -1,6 +1,6 @@
#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)
{

View 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)

View file

@ -13,13 +13,13 @@
// 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
{

View 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)
{

View file

@ -8,9 +8,9 @@
* 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)

View file

@ -8,8 +8,7 @@
* 28/12/98: Created
*/
#include <windows.h>
#include <crtdll/io.h>
#include <msvcrt/io.h>
int _unlink(const char *filename)

View 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)

View file

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

View 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)
{

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
;
@ -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

View file

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

View file

@ -1,5 +1,5 @@
#include <windows.h>
#include <crtdll/process.h>
#include <msvcrt/process.h>
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 <errno.h>
#include <msvcrt/errno.h>
#include <msvcrt/process.h>
unsigned long
_beginthread (

View file

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

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

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

View 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

View 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

View 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

View file

@ -11,13 +11,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/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)

View 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)

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

View file

@ -1,4 +1,4 @@
#include <crtdll/stdio.h>
#include <msvcrt/stdio.h>
#if 0
#undef fileno

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

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

View 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, ...)

View 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)
@ -12,6 +12,6 @@ fputc(int c, FILE *fp)
wint_t
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 */
#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);
}

View file

@ -1,37 +1,10 @@
#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;
@ -56,8 +29,8 @@ size_t fread(void *vptr, size_t size, size_t count, FILE *iop)
if (vptr == NULL || to_read == 0)
return 0;
while(iop->_cnt > 0 && to_read > 0 ) {
while(iop->_cnt > 0 && to_read > 0 )
{
to_read--;
*ptr++ = getc(iop);
}
@ -74,10 +47,7 @@ size_t fread(void *vptr, size_t size, size_t count, FILE *iop)
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 */
#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;

View file

@ -1,36 +1,10 @@
#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;
#include <msvcrt/stdio.h>
#include <msvcrt/stdlib.h>
#include <msvcrt/string.h>
#include <msvcrt/errno.h>
#include <msvcrt/internal/file.h>
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 to_write, n_written;
@ -43,7 +17,6 @@ size_t fwrite(const void *vptr, size_t size, size_t count, FILE *iop)
return 0;
}
if (iop == NULL)
{
__set_errno (EINVAL);
@ -55,15 +28,14 @@ size_t fwrite(const void *vptr, size_t size, size_t count, FILE *iop)
if (vptr == NULL || to_write == 0)
return 0;
while(iop->_cnt > 0 && to_write > 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);
@ -72,13 +44,8 @@ size_t fwrite(const void *vptr, size_t size, size_t count, FILE *iop)
// 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

View 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,25 +33,38 @@ int getc(FILE *fp)
return c;
}
// not exported
wint_t getwc(FILE *fp)
{
int c = -1;
// 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);
// check for invalid stream
if (!__validfp(fp))
{
__set_errno(EINVAL);
return EOF;
}
// never reached
// 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;
}

View 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 */

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

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

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

View file

@ -1,5 +1,6 @@
#include <windows.h>
#include <msvcrt/stddef.h>
#include <msvcrt/stdio.h>
int remove(const char *fn)
{

View 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)

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,
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

View 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] =
{

View 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 )

View 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 */

View 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 */

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,
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

View 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)

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

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

View 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))

View 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)

View 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 *);

View 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)

View 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[] =
{

View 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

View 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.

View 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)
{

View file

@ -1,4 +1,4 @@
#include <crtdll/stdlib.h>
#include <msvcrt/stdlib.h>
size_t wcstombs (char* mbsDest, const wchar_t* wsConvert, size_t size)
{

View file

@ -16,12 +16,12 @@
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

View file

@ -16,11 +16,11 @@
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

View file

@ -8,18 +8,17 @@
* 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 <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)
@ -28,7 +27,8 @@ _fstat(int fd, struct stat *statbuf)
return -1;
}
if ( !GetFileInformationByHandle(_get_osfhandle(fd),&FileInformation) ) {
if (!GetFileInformationByHandle(_get_osfhandle(fd),&FileInformation))
{
__set_errno(EBADF);
return -1;
}

View file

@ -1,7 +1,7 @@
#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)
@ -13,5 +13,4 @@ int _stat( const char *path, struct stat *buffer )
_close(fd);
return ret;
}

View 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"

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

View file

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

View 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)
{

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)
{

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)
{

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)
{

View 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;
while(s[len]!=0 && len < count) {
while(s[len]!=0 && len < count)
len++;
};
return len;
}