#include <windows.h>
-#include <crtdll/io.h>
+#include <msvcrt/io.h>
#ifndef F_OK
#define F_OK 0x01
-#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);
}
#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;
/* 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;
-#include <crtdll/io.h>
-#include <crtdll/sys/stat.h>
+#include <msvcrt/io.h>
+#include <msvcrt/sys/stat.h>
int _isatty( int fd )
#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);
}
/* 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)
// 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
{
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;
* 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)
{
* 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);
}
* 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;
}
* 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)
* 28/12/98: Created
*/
-#include <crtdll/stdio.h>
+#include <msvcrt/stdio.h>
static char *__rt_err_msg[] =
/* 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)
{
-; $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
;
; _putch
_putenv
; _putw
-; _putws
+_putws
_pwctype DATA
_read
_rmdir
fprintf
fputc
fputs
-; fputwc
+fputwc
; fputws
fread
free
putchar
puts
putwc
-; putwchar
+putwchar
qsort
raise
; rand
*/
#include <windows.h>
-#include <crtdll/process.h>
+#include <msvcrt/process.h>
void *_loaddll (char *name)
{
#include <windows.h>
-#include <crtdll/process.h>
+#include <msvcrt/process.h>
int _getpid (void)
{
-/* $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 (
#include <windows.h>
-#include <crtdll/process.h>
+#include <msvcrt/process.h>
unsigned long __threadid (void)
{
-#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);
/* 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);
/* it isn't full, we can add to it */
break;
}
- return total_closed;
+ return total_closed;
}
/* 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
/* 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
/* 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
/* 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)
/* 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)
/* 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 );
-#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;
}
/* 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);
/* 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);
/* 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, ...)
/* 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)
return putc(c, fp);
}
-wint_t
+wint_t
fputwc(wchar_t c, FILE *fp)
-{
- return fputwc(c,fp);
+{
+ return putwc(c,fp);
}
/* 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;
}
return(r);
-
}
-#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);
+}
/* 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;
-#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
#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
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;
}
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 */
/* 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
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;
* UPDATE HISTORY:
* 28/12/98: Created
*/
-#include <crtdll/stdio.h>
+#include <msvcrt/stdio.h>
#undef putc
#undef putchar
fflush(stdout);
return r;
}
+
+wint_t putwchar(wint_t c)
+{
+ wint_t r = putwc(c, stdout);
+ if (stdout->_flag & _IOLBF)
+ fflush(stdout);
+ return r;
+}
/* 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
return putchar('\n');
}
+
+int
+_putws(const wchar_t *s)
+{
+
+ wint_t c;
+ while ((c = *s++))
+ putwchar(c);
+ return putwchar(L'\n');
+
+}
#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;
}
/* 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)
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
/* 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] =
{
#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 )
/* 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);
* 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 */
/* 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);
len = __vfwprintf(f,fmt,ap);
return (ferror(f) ? EOF : len);
-
-// return 0;
}
* 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 */
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
/* 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)
#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;
-#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";
/* 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))
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/stdlib.h>
+#include <msvcrt/stdlib.h>
long double
_atold(const char *ascii)
/* 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 *);
/* 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)
/* 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[] =
{
long double
_strtold(const char *s, char **sret)
-{
+{
double r; /* result */
int e, ne; /* exponent */
int sign; /* +- 1.0 */
/* 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
/* 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.
/* 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)
{
-#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;
}
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
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
* 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;
}
-#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;
}
-#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"
*/
#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 );
* Copyright 1997 Uwe Bonnes
*/
-#include <crtdll/wchar.h>
+#include <msvcrt/wchar.h>
wchar_t * _wcslwr(wchar_t *x)
{
/* 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)
{
-#include <crtdll/wchar.h>
+#include <msvcrt/wchar.h>
int wcsncmp(const wchar_t * cs,const wchar_t * ct,size_t count)
{
-#include <crtdll/wchar.h>
+#include <msvcrt/wchar.h>
wchar_t * wcsncpy(wchar_t * dest,const wchar_t *src,size_t count)
{
-#include <crtdll/wchar.h>
+#include <msvcrt/wchar.h>
int _wcsnicmp (const wchar_t *cs, const wchar_t *ct, size_t count)
{
-#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;
}