Added binary and unicode file i/o support to msvcrt.
authorRobert Dickenson <robd@reactos.org>
Sun, 24 Nov 2002 18:42:26 +0000 (18:42 +0000)
committerRobert Dickenson <robd@reactos.org>
Sun, 24 Nov 2002 18:42:26 +0000 (18:42 +0000)
Reduced differences between crtdll and msvcrt sources

svn path=/trunk/; revision=3781

494 files changed:
reactos/lib/crtdll/assert/.cvsignore [deleted file]
reactos/lib/crtdll/assert/assert.c [deleted file]
reactos/lib/crtdll/conio/cgets.c
reactos/lib/crtdll/conio/cprintf.c
reactos/lib/crtdll/conio/cputs.c
reactos/lib/crtdll/conio/cscanf.c
reactos/lib/crtdll/conio/getch.c
reactos/lib/crtdll/conio/getche.c
reactos/lib/crtdll/conio/kbhit.c
reactos/lib/crtdll/conio/putch.c
reactos/lib/crtdll/conio/ungetch.c
reactos/lib/crtdll/ctype/ctype.c [new file with mode: 0644]
reactos/lib/crtdll/ctype/isascii.c
reactos/lib/crtdll/ctype/isctype.c
reactos/lib/crtdll/ctype/isgraph.c
reactos/lib/crtdll/ctype/isprint.c
reactos/lib/crtdll/ctype/isspace.c
reactos/lib/crtdll/ctype/tolower.c
reactos/lib/crtdll/ctype/toupper.c
reactos/lib/crtdll/direct/chdir.c
reactos/lib/crtdll/direct/chdrive.c
reactos/lib/crtdll/direct/getcwd.c
reactos/lib/crtdll/direct/getdcwd.c
reactos/lib/crtdll/direct/getdfree.c
reactos/lib/crtdll/direct/getdrive.c
reactos/lib/crtdll/direct/mkdir.c
reactos/lib/crtdll/direct/rmdir.c
reactos/lib/crtdll/dirent/dirent.c
reactos/lib/crtdll/except/abnorter.c
reactos/lib/crtdll/except/exhand2.c
reactos/lib/crtdll/except/matherr.c
reactos/lib/crtdll/float/clearfp.c
reactos/lib/crtdll/float/cntrlfp.c
reactos/lib/crtdll/float/copysign.c
reactos/lib/crtdll/float/logb.c
reactos/lib/crtdll/float/scalb.c
reactos/lib/crtdll/float/statfp.c
reactos/lib/crtdll/io/access.c
reactos/lib/crtdll/io/chmod.c
reactos/lib/crtdll/io/chsize.c
reactos/lib/crtdll/io/close.c
reactos/lib/crtdll/io/commit.c
reactos/lib/crtdll/io/create.c
reactos/lib/crtdll/io/dup.c
reactos/lib/crtdll/io/dup2.c
reactos/lib/crtdll/io/eof.c
reactos/lib/crtdll/io/filelen.c
reactos/lib/crtdll/io/find.c
reactos/lib/crtdll/io/fmode.c
reactos/lib/crtdll/io/isatty.c
reactos/lib/crtdll/io/lseek.c
reactos/lib/crtdll/io/mktemp.c
reactos/lib/crtdll/io/open.c
reactos/lib/crtdll/io/pipe.c
reactos/lib/crtdll/io/read.c
reactos/lib/crtdll/io/setmode.c
reactos/lib/crtdll/io/sopen.c
reactos/lib/crtdll/io/tell.c
reactos/lib/crtdll/io/umask.c
reactos/lib/crtdll/io/unlink.c
reactos/lib/crtdll/io/utime.c
reactos/lib/crtdll/io/write.c
reactos/lib/crtdll/locale/locale.c
reactos/lib/crtdll/makefile
reactos/lib/crtdll/math/atan.c
reactos/lib/crtdll/math/atan2.c
reactos/lib/crtdll/math/cabs.c
reactos/lib/crtdll/math/ceil.c
reactos/lib/crtdll/math/cos.c
reactos/lib/crtdll/math/exp.c
reactos/lib/crtdll/math/fabs.c
reactos/lib/crtdll/math/floor.c
reactos/lib/crtdll/math/fmod.c
reactos/lib/crtdll/math/frexp.c
reactos/lib/crtdll/math/ftol.c
reactos/lib/crtdll/math/huge_val.c
reactos/lib/crtdll/math/hypot.c
reactos/lib/crtdll/math/ldexp.c
reactos/lib/crtdll/math/log.c
reactos/lib/crtdll/math/log10.c
reactos/lib/crtdll/math/modf.c
reactos/lib/crtdll/math/pow.c
reactos/lib/crtdll/math/sin.c
reactos/lib/crtdll/math/sinh.c
reactos/lib/crtdll/math/sqrt.c
reactos/lib/crtdll/math/tan.c
reactos/lib/crtdll/math/tanh.c
reactos/lib/crtdll/mbstring/hanzen.c
reactos/lib/crtdll/mbstring/iskana.c
reactos/lib/crtdll/mbstring/iskmoji.c
reactos/lib/crtdll/mbstring/iskpun.c
reactos/lib/crtdll/mbstring/islead.c
reactos/lib/crtdll/mbstring/islwr.c
reactos/lib/crtdll/mbstring/ismbal.c
reactos/lib/crtdll/mbstring/ismbaln.c
reactos/lib/crtdll/mbstring/ismbc.c
reactos/lib/crtdll/mbstring/ismbgra.c
reactos/lib/crtdll/mbstring/ismbkaln.c
reactos/lib/crtdll/mbstring/ismblead.c
reactos/lib/crtdll/mbstring/ismbpri.c
reactos/lib/crtdll/mbstring/ismbtrl.c
reactos/lib/crtdll/mbstring/isuppr.c
reactos/lib/crtdll/mbstring/jistojms.c
reactos/lib/crtdll/mbstring/jmstojis.c
reactos/lib/crtdll/mbstring/mbbtype.c
reactos/lib/crtdll/mbstring/mbccpy.c
reactos/lib/crtdll/mbstring/mbclen.c
reactos/lib/crtdll/mbstring/mbscat.c
reactos/lib/crtdll/mbstring/mbschr.c
reactos/lib/crtdll/mbstring/mbscmp.c
reactos/lib/crtdll/mbstring/mbscoll.c
reactos/lib/crtdll/mbstring/mbscpy.c
reactos/lib/crtdll/mbstring/mbscspn.c
reactos/lib/crtdll/mbstring/mbsdec.c
reactos/lib/crtdll/mbstring/mbsdup.c
reactos/lib/crtdll/mbstring/mbsicmp.c
reactos/lib/crtdll/mbstring/mbsicoll.c
reactos/lib/crtdll/mbstring/mbsinc.c
reactos/lib/crtdll/mbstring/mbslen.c
reactos/lib/crtdll/mbstring/mbslwr.c
reactos/lib/crtdll/mbstring/mbsncat.c
reactos/lib/crtdll/mbstring/mbsnccnt.c
reactos/lib/crtdll/mbstring/mbsncmp.c
reactos/lib/crtdll/mbstring/mbsncoll.c
reactos/lib/crtdll/mbstring/mbsncpy.c
reactos/lib/crtdll/mbstring/mbsnextc.c
reactos/lib/crtdll/mbstring/mbsnicoll.c
reactos/lib/crtdll/mbstring/mbsninc.c
reactos/lib/crtdll/mbstring/mbsnset.c
reactos/lib/crtdll/mbstring/mbspbrk.c
reactos/lib/crtdll/mbstring/mbsrchr.c
reactos/lib/crtdll/mbstring/mbsrev.c
reactos/lib/crtdll/mbstring/mbsset.c
reactos/lib/crtdll/mbstring/mbsspn.c
reactos/lib/crtdll/mbstring/mbsspnp.c
reactos/lib/crtdll/mbstring/mbsstr.c
reactos/lib/crtdll/mbstring/mbstok.c
reactos/lib/crtdll/mbstring/mbstrlen.c
reactos/lib/crtdll/mbstring/mbsupr.c
reactos/lib/crtdll/misc/GetArgs.c
reactos/lib/crtdll/misc/amsg.c
reactos/lib/crtdll/misc/assert.c [new file with mode: 0644]
reactos/lib/crtdll/misc/crt1.c
reactos/lib/crtdll/misc/debug.c [new file with mode: 0644]
reactos/lib/crtdll/misc/dllmain.c
reactos/lib/crtdll/misc/init.c
reactos/lib/crtdll/misc/initterm.c
reactos/lib/crtdll/process/_system.c
reactos/lib/crtdll/process/execl.c
reactos/lib/crtdll/process/execle.c
reactos/lib/crtdll/process/execlp.c
reactos/lib/crtdll/process/execlpe.c
reactos/lib/crtdll/process/execv.c
reactos/lib/crtdll/process/execvp.c
reactos/lib/crtdll/process/execvpe.c
reactos/lib/crtdll/process/procid.c
reactos/lib/crtdll/process/spawnlp.c
reactos/lib/crtdll/process/spawnlpe.c
reactos/lib/crtdll/process/spawnv.c
reactos/lib/crtdll/process/spawnve.c
reactos/lib/crtdll/process/spawnvp.c
reactos/lib/crtdll/process/spawnvpe.c
reactos/lib/crtdll/process/thread.c
reactos/lib/crtdll/process/threadid.c
reactos/lib/crtdll/quad/divdi3.c
reactos/lib/crtdll/quad/moddi3.c
reactos/lib/crtdll/quad/qdivrem.c
reactos/lib/crtdll/quad/udivdi3.c
reactos/lib/crtdll/quad/umoddi3.c
reactos/lib/crtdll/search/lfind.c
reactos/lib/crtdll/search/lsearch.c
reactos/lib/crtdll/setjmp/setjmp.c
reactos/lib/crtdll/signal/signal.c
reactos/lib/crtdll/signal/xcptinfo.c
reactos/lib/crtdll/stdio/fdopen.c
reactos/lib/crtdll/stdio/fflush.c
reactos/lib/crtdll/stdio/fgetc.c
reactos/lib/crtdll/stdio/fgetchar.c
reactos/lib/crtdll/stdio/fgetpos.c
reactos/lib/crtdll/stdio/fgets.c
reactos/lib/crtdll/stdio/fgetws.c [new file with mode: 0644]
reactos/lib/crtdll/stdio/fileno.c
reactos/lib/crtdll/stdio/flsbuf.c
reactos/lib/crtdll/stdio/fputc.c
reactos/lib/crtdll/stdio/fputchar.c
reactos/lib/crtdll/stdio/fputws.c [new file with mode: 0644]
reactos/lib/crtdll/stdio/freopen.c
reactos/lib/crtdll/stdio/fseek.c
reactos/lib/crtdll/stdio/fsetpos.c
reactos/lib/crtdll/stdio/fsopen.c
reactos/lib/crtdll/stdio/ftell.c
reactos/lib/crtdll/stdio/fwalk.c
reactos/lib/crtdll/stdio/fwrite.c
reactos/lib/crtdll/stdio/gets.c
reactos/lib/crtdll/stdio/getw.c
reactos/lib/crtdll/stdio/perror.c
reactos/lib/crtdll/stdio/popen.c
reactos/lib/crtdll/stdio/printf.c
reactos/lib/crtdll/stdio/putc.c
reactos/lib/crtdll/stdio/putchar.c
reactos/lib/crtdll/stdio/puts.c
reactos/lib/crtdll/stdio/putw.c
reactos/lib/crtdll/stdio/remove.c
reactos/lib/crtdll/stdio/rename.c
reactos/lib/crtdll/stdio/rewind.c
reactos/lib/crtdll/stdio/rmtmp.c
reactos/lib/crtdll/stdio/scanf.c
reactos/lib/crtdll/stdio/setbuf.c
reactos/lib/crtdll/stdio/sscanf.c
reactos/lib/crtdll/stdio/stdhnd.c
reactos/lib/crtdll/stdio/tempnam.c
reactos/lib/crtdll/stdio/tmpfile.c
reactos/lib/crtdll/stdio/tmpnam.c
reactos/lib/crtdll/stdio/ungetc.c
reactos/lib/crtdll/stdio/vfprintf.c
reactos/lib/crtdll/stdio/vfscanf.c
reactos/lib/crtdll/stdio/vfwprint.c
reactos/lib/crtdll/stdio/vprintf.c
reactos/lib/crtdll/stdio/vscanf.c
reactos/lib/crtdll/stdio/vsprintf.c
reactos/lib/crtdll/stdio/vsscanf.c
reactos/lib/crtdll/stdlib/abs.c
reactos/lib/crtdll/stdlib/alloca.c [new file with mode: 0644]
reactos/lib/crtdll/stdlib/ecvt.c
reactos/lib/crtdll/stdlib/ecvtbuf.c
reactos/lib/crtdll/stdlib/fcvt.c
reactos/lib/crtdll/stdlib/fcvtbuf.c
reactos/lib/crtdll/stdlib/fullpath.c
reactos/lib/crtdll/stdlib/itoa.c
reactos/lib/crtdll/stdlib/itow.c
reactos/lib/crtdll/stdlib/labs.c
reactos/lib/crtdll/stdlib/makepath.c
reactos/lib/crtdll/stdlib/malloc.c
reactos/lib/crtdll/stdlib/mbstow.c [deleted file]
reactos/lib/crtdll/stdlib/mbstowcs.c
reactos/lib/crtdll/stdlib/obsol.c
reactos/lib/crtdll/stdlib/putenv.c
reactos/lib/crtdll/stdlib/rot.c
reactos/lib/crtdll/stdlib/senv.c
reactos/lib/crtdll/stdlib/splitp.c
reactos/lib/crtdll/stdlib/strtod.c
reactos/lib/crtdll/stdlib/strtol.c
reactos/lib/crtdll/stdlib/strtold.c
reactos/lib/crtdll/stdlib/strtoul.c
reactos/lib/crtdll/stdlib/wcstom.c
reactos/lib/crtdll/stdlib/wcstombs.c
reactos/lib/crtdll/string/memccpy.c
reactos/lib/crtdll/string/memchr.c
reactos/lib/crtdll/string/memcmp.c
reactos/lib/crtdll/string/memcpy.c
reactos/lib/crtdll/string/memicmp.c
reactos/lib/crtdll/string/memmove.c
reactos/lib/crtdll/string/memset.c
reactos/lib/crtdll/string/strcat.c
reactos/lib/crtdll/string/strchr.c
reactos/lib/crtdll/string/strcmp.c
reactos/lib/crtdll/string/strcoll.c
reactos/lib/crtdll/string/strcpy.c
reactos/lib/crtdll/string/strcspn.c
reactos/lib/crtdll/string/strdup.c
reactos/lib/crtdll/string/strerror.c
reactos/lib/crtdll/string/strlen.c
reactos/lib/crtdll/string/strlwr.c
reactos/lib/crtdll/string/strncat.c
reactos/lib/crtdll/string/strncmp.c
reactos/lib/crtdll/string/strncpy.c
reactos/lib/crtdll/string/strnicmp.c
reactos/lib/crtdll/string/strnlen.c
reactos/lib/crtdll/string/strpbrk.c
reactos/lib/crtdll/string/strrchr.c
reactos/lib/crtdll/string/strset.c
reactos/lib/crtdll/string/strspn.c
reactos/lib/crtdll/string/strspnp.c
reactos/lib/crtdll/string/strstr.c
reactos/lib/crtdll/string/strtok.c
reactos/lib/crtdll/string/strtoul.c
reactos/lib/crtdll/string/strupr.c
reactos/lib/crtdll/string/strxfrm.c
reactos/lib/crtdll/sys_stat/fstat.c
reactos/lib/crtdll/sys_stat/ftime.c
reactos/lib/crtdll/sys_stat/stat.c
reactos/lib/crtdll/tchar/strdec.c
reactos/lib/crtdll/tchar/strinc.c
reactos/lib/crtdll/tchar/strncnt.c
reactos/lib/crtdll/tchar/strnextc.c
reactos/lib/crtdll/tchar/strninc.c
reactos/lib/crtdll/tchar/strspnp.c
reactos/lib/crtdll/time/clock.c
reactos/lib/crtdll/time/ctime.c
reactos/lib/crtdll/time/difftime.c
reactos/lib/crtdll/time/strdate.c
reactos/lib/crtdll/time/strtime.c
reactos/lib/crtdll/time/time.c
reactos/lib/crtdll/wchar/.cvsignore [deleted file]
reactos/lib/crtdll/wchar/wcscat.c [deleted file]
reactos/lib/crtdll/wchar/wcschr.c [deleted file]
reactos/lib/crtdll/wchar/wcscmp.c [deleted file]
reactos/lib/crtdll/wchar/wcscoll.c
reactos/lib/crtdll/wchar/wcscpy.c [deleted file]
reactos/lib/crtdll/wchar/wcscspn.c [deleted file]
reactos/lib/crtdll/wchar/wcsdup.c [deleted file]
reactos/lib/crtdll/wchar/wcsftime.c [deleted file]
reactos/lib/crtdll/wchar/wcsicmp.c [deleted file]
reactos/lib/crtdll/wchar/wcslen.c
reactos/lib/crtdll/wchar/wcslwr.c [deleted file]
reactos/lib/crtdll/wchar/wcsncat.c [deleted file]
reactos/lib/crtdll/wchar/wcsncmp.c [deleted file]
reactos/lib/crtdll/wchar/wcsncpy.c [deleted file]
reactos/lib/crtdll/wchar/wcsnicmp.c [deleted file]
reactos/lib/crtdll/wchar/wcsnlen.c [deleted file]
reactos/lib/crtdll/wchar/wcspbrk.c [deleted file]
reactos/lib/crtdll/wchar/wcsrchr.c [deleted file]
reactos/lib/crtdll/wchar/wcsrev.c [deleted file]
reactos/lib/crtdll/wchar/wcsset.c [deleted file]
reactos/lib/crtdll/wchar/wcsspn.c [deleted file]
reactos/lib/crtdll/wchar/wcsstr.c [deleted file]
reactos/lib/crtdll/wchar/wcstok.c
reactos/lib/crtdll/wchar/wcsupr.c [deleted file]
reactos/lib/crtdll/wchar/wcsxfrm.c [deleted file]
reactos/lib/fmifs/.cvsignore
reactos/lib/msvcrt/Makefile
reactos/lib/msvcrt/conio/cscanf.c
reactos/lib/msvcrt/conio/getch.c
reactos/lib/msvcrt/conio/kbhit.c
reactos/lib/msvcrt/conio/putch.c
reactos/lib/msvcrt/ctype/ctype.c [new file with mode: 0644]
reactos/lib/msvcrt/ctype/isascii.c
reactos/lib/msvcrt/ctype/isctype.c
reactos/lib/msvcrt/ctype/isspace.c
reactos/lib/msvcrt/direct/chdir.c
reactos/lib/msvcrt/direct/chdrive.c
reactos/lib/msvcrt/direct/getcwd.c
reactos/lib/msvcrt/direct/getdcwd.c
reactos/lib/msvcrt/direct/getdfree.c
reactos/lib/msvcrt/direct/getdrive.c
reactos/lib/msvcrt/direct/mkdir.c
reactos/lib/msvcrt/direct/rmdir.c
reactos/lib/msvcrt/direct/wchdir.c [new file with mode: 0644]
reactos/lib/msvcrt/direct/wgetcwd.c [new file with mode: 0644]
reactos/lib/msvcrt/direct/wgetdcwd.c [new file with mode: 0644]
reactos/lib/msvcrt/direct/wmkdir.c [new file with mode: 0644]
reactos/lib/msvcrt/direct/wrmdir.c [new file with mode: 0644]
reactos/lib/msvcrt/except/abnorter.c
reactos/lib/msvcrt/except/exhand2.c
reactos/lib/msvcrt/except/matherr.c
reactos/lib/msvcrt/except/unwind.c
reactos/lib/msvcrt/float/clearfp.c
reactos/lib/msvcrt/float/cntrlfp.c
reactos/lib/msvcrt/float/logb.c
reactos/lib/msvcrt/float/statfp.c
reactos/lib/msvcrt/io/access.c
reactos/lib/msvcrt/io/chmod.c
reactos/lib/msvcrt/io/commit.c
reactos/lib/msvcrt/io/create.c
reactos/lib/msvcrt/io/filelen.c
reactos/lib/msvcrt/io/fileleni.c [new file with mode: 0644]
reactos/lib/msvcrt/io/find.c
reactos/lib/msvcrt/io/lseek.c
reactos/lib/msvcrt/io/lseeki64.c [new file with mode: 0644]
reactos/lib/msvcrt/io/mktemp.c
reactos/lib/msvcrt/io/open.c
reactos/lib/msvcrt/io/read.c
reactos/lib/msvcrt/io/setmode.c
reactos/lib/msvcrt/io/sopen.c
reactos/lib/msvcrt/io/tell.c
reactos/lib/msvcrt/io/telli64.c [new file with mode: 0644]
reactos/lib/msvcrt/io/umask.c
reactos/lib/msvcrt/io/unlink.c
reactos/lib/msvcrt/io/utime.c
reactos/lib/msvcrt/io/waccess.c [new file with mode: 0644]
reactos/lib/msvcrt/io/wchmod.c [new file with mode: 0644]
reactos/lib/msvcrt/io/wcreate.c [new file with mode: 0644]
reactos/lib/msvcrt/io/wfind.c [new file with mode: 0644]
reactos/lib/msvcrt/io/wmktemp.c [new file with mode: 0644]
reactos/lib/msvcrt/io/wopen.c [new file with mode: 0644]
reactos/lib/msvcrt/io/write.c
reactos/lib/msvcrt/io/wunlink.c [new file with mode: 0644]
reactos/lib/msvcrt/io/wutime.c [new file with mode: 0644]
reactos/lib/msvcrt/math/atan.c
reactos/lib/msvcrt/math/atan2.c
reactos/lib/msvcrt/math/ceil.c
reactos/lib/msvcrt/math/cos.c
reactos/lib/msvcrt/math/exp.c
reactos/lib/msvcrt/math/fabs.c
reactos/lib/msvcrt/math/floor.c
reactos/lib/msvcrt/math/fmod.c
reactos/lib/msvcrt/math/hypot.c
reactos/lib/msvcrt/math/jn_yn.c
reactos/lib/msvcrt/math/ldexp.c
reactos/lib/msvcrt/math/log.c
reactos/lib/msvcrt/math/log10.c
reactos/lib/msvcrt/math/math.c [new file with mode: 0644]
reactos/lib/msvcrt/math/pow.c
reactos/lib/msvcrt/math/sin.c
reactos/lib/msvcrt/math/sqrt.c
reactos/lib/msvcrt/math/tan.c
reactos/lib/msvcrt/mbstring/ismbal.c
reactos/lib/msvcrt/mbstring/mbbtype.c
reactos/lib/msvcrt/mbstring/mbclen.c
reactos/lib/msvcrt/mbstring/mbslwr.c
reactos/lib/msvcrt/misc/amsg.c
reactos/lib/msvcrt/misc/crtmain.c [new file with mode: 0644]
reactos/lib/msvcrt/misc/dllmain.c
reactos/lib/msvcrt/misc/environ.c [new file with mode: 0644]
reactos/lib/msvcrt/misc/getargs.c
reactos/lib/msvcrt/misc/initterm.c
reactos/lib/msvcrt/misc/purecall.c
reactos/lib/msvcrt/misc/tls.c
reactos/lib/msvcrt/msvcrt.def
reactos/lib/msvcrt/process/_cwait.c
reactos/lib/msvcrt/process/_system.c
reactos/lib/msvcrt/search/lfind.c
reactos/lib/msvcrt/search/lsearch.c
reactos/lib/msvcrt/setjmp/setjmp.c
reactos/lib/msvcrt/stdio/fdopen.c
reactos/lib/msvcrt/stdio/ferror.c
reactos/lib/msvcrt/stdio/fgetc.c
reactos/lib/msvcrt/stdio/fgetchar.c
reactos/lib/msvcrt/stdio/fgets.c
reactos/lib/msvcrt/stdio/fgetws.c [new file with mode: 0644]
reactos/lib/msvcrt/stdio/filbuf.c
reactos/lib/msvcrt/stdio/flsbuf.c
reactos/lib/msvcrt/stdio/fopen.c
reactos/lib/msvcrt/stdio/fputchar.c
reactos/lib/msvcrt/stdio/fputs.c
reactos/lib/msvcrt/stdio/fsopen.c
reactos/lib/msvcrt/stdio/fwalk.c
reactos/lib/msvcrt/stdio/getc.c
reactos/lib/msvcrt/stdio/getchar.c
reactos/lib/msvcrt/stdio/gets.c
reactos/lib/msvcrt/stdio/getw.c
reactos/lib/msvcrt/stdio/putc.c
reactos/lib/msvcrt/stdio/putchar.c
reactos/lib/msvcrt/stdio/puts.c
reactos/lib/msvcrt/stdio/rename.c
reactos/lib/msvcrt/stdio/tempnam.c
reactos/lib/msvcrt/stdio/tmpfile.c
reactos/lib/msvcrt/stdio/tmpnam.c
reactos/lib/msvcrt/stdio/ungetc.c
reactos/lib/msvcrt/stdio/vfprintf.c
reactos/lib/msvcrt/stdio/vfscanf.c
reactos/lib/msvcrt/stdio/vfwprint.c
reactos/lib/msvcrt/stdio/wfdopen.c [new file with mode: 0644]
reactos/lib/msvcrt/stdio/wrename.c [new file with mode: 0644]
reactos/lib/msvcrt/stdio/wtempnam.c [new file with mode: 0644]
reactos/lib/msvcrt/stdio/wtmpnam.c [new file with mode: 0644]
reactos/lib/msvcrt/stdlib/abs.c
reactos/lib/msvcrt/stdlib/fullpath.c
reactos/lib/msvcrt/stdlib/itoa.c
reactos/lib/msvcrt/stdlib/itow.c
reactos/lib/msvcrt/stdlib/labs.c
reactos/lib/msvcrt/stdlib/makepath.c
reactos/lib/msvcrt/stdlib/mbstow.c [deleted file]
reactos/lib/msvcrt/stdlib/mbstowcs.c
reactos/lib/msvcrt/stdlib/mbtowc.c [new file with mode: 0644]
reactos/lib/msvcrt/stdlib/obsol.c
reactos/lib/msvcrt/stdlib/rand.c
reactos/lib/msvcrt/stdlib/rot.c
reactos/lib/msvcrt/stdlib/senv.c
reactos/lib/msvcrt/stdlib/splitp.c
reactos/lib/msvcrt/stdlib/strtold.c
reactos/lib/msvcrt/stdlib/wcstomb.c
reactos/lib/msvcrt/stdlib/wcstombs.c
reactos/lib/msvcrt/stdlib/wctomb.c [new file with mode: 0644]
reactos/lib/msvcrt/stdlib/wfulpath.c [new file with mode: 0644]
reactos/lib/msvcrt/stdlib/witoa.c [new file with mode: 0644]
reactos/lib/msvcrt/stdlib/witow.c [new file with mode: 0644]
reactos/lib/msvcrt/stdlib/wmakpath.c [new file with mode: 0644]
reactos/lib/msvcrt/stdlib/wsenv.c [new file with mode: 0644]
reactos/lib/msvcrt/stdlib/wsplitp.c [new file with mode: 0644]
reactos/lib/msvcrt/stdlib/wtoi64.c
reactos/lib/msvcrt/string/memcmp.c
reactos/lib/msvcrt/string/memcpy.c
reactos/lib/msvcrt/string/memset.c
reactos/lib/msvcrt/string/strcat.c
reactos/lib/msvcrt/string/strcmp.c
reactos/lib/msvcrt/string/strcoll.c
reactos/lib/msvcrt/string/strcpy.c
reactos/lib/msvcrt/string/strncoll.c [new file with mode: 0644]
reactos/lib/msvcrt/string/strset.c
reactos/lib/msvcrt/string/strtok.c
reactos/lib/msvcrt/sys_stat/fstat.c
reactos/lib/msvcrt/sys_stat/fstati64.c [new file with mode: 0644]
reactos/lib/msvcrt/sys_stat/futime.c
reactos/lib/msvcrt/sys_stat/stat.c
reactos/lib/msvcrt/sys_stat/wstat.c [new file with mode: 0644]
reactos/lib/msvcrt/time/ctime.c
reactos/lib/msvcrt/time/strdate.c
reactos/lib/msvcrt/time/strtime.c
reactos/lib/msvcrt/time/wctime.c [new file with mode: 0644]
reactos/lib/msvcrt/time/wstrdate.c [new file with mode: 0644]
reactos/lib/msvcrt/time/wstrtime.c [new file with mode: 0644]
reactos/lib/msvcrt/wstring/wcsdup.c
reactos/lib/msvcrt/wstring/wcspbrk.c

diff --git a/reactos/lib/crtdll/assert/.cvsignore b/reactos/lib/crtdll/assert/.cvsignore
deleted file mode 100644 (file)
index bd0e3df..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-*.d
-*.o
-*.sym
diff --git a/reactos/lib/crtdll/assert/assert.c b/reactos/lib/crtdll/assert/assert.c
deleted file mode 100644 (file)
index 2191a42..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/* 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>
-
-void _assert(const char *msg, const char *file, int line) 
-{
-  /* Assertion failed at foo.c line 45: x<y */
-  fprintf(stderr, "Assertion failed at %s line %d: %s\n", file, line, msg);
-  raise(SIGABRT);
-}
index 6005216..1e3d9e7 100644 (file)
@@ -1,8 +1,8 @@
-#include <crtdll/conio.h>
-#include <crtdll/stdlib.h>
+#include <msvcrt/conio.h>
+#include <msvcrt/stdlib.h>
 
-char *
-_cgets(char *string)
+
+char *_cgets(char *string)
 {
   unsigned len = 0;
   unsigned int maxlen_wanted;
index 21c33a9..da3ca0c 100644 (file)
@@ -1,5 +1,5 @@
-#include <crtdll/stdio.h>
-#include <crtdll/conio.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/conio.h>
 
 int
 _cprintf(const char *fmt, ...)
index 37cd12a..396c71e 100644 (file)
@@ -8,10 +8,10 @@
  *              28/12/98: Created
  */
 #include <windows.h>
-#include <crtdll/conio.h>
-#include <crtdll/string.h>
-#include <crtdll/stdio.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/conio.h>
+#include <msvcrt/string.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/internal/file.h>
 
 int _cputs(const char *_str)
 {
index 42a8779..eb3743a 100644 (file)
@@ -1,19 +1,18 @@
-#include <crtdll/conio.h>
-#include <stdarg.h>
-#include <stdio.h>
+#include <msvcrt/conio.h>
+#include <msvcrt/stdarg.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/internal/stdio.h>
 
-int
-_cscanf(char *fmt, ...)
+int _cscanf(char *fmt, ...)
 {
-       int cnt;
+    int cnt;
 
-       va_list ap;
-
-       //fixme cscanf should scan the console's keyboard
-       va_start(ap, fmt);
-       cnt = __vscanf(fmt, ap);
-       va_end(ap);
-       return cnt;
-}
+    va_list ap;
 
+    //fixme cscanf should scan the console's keyboard
+    va_start(ap, fmt);
+    cnt = __vscanf(fmt, ap);
+    va_end(ap);
 
+    return cnt;
+}
index 6830ac5..070a867 100644 (file)
@@ -8,32 +8,40 @@
  *              28/12/98: Created
  */
 #include <windows.h>
-#include <crtdll/conio.h>
-#include <crtdll/stdio.h>
-#include <crtdll/io.h>
+#include <msvcrt/conio.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/io.h>
+#include <msvcrt/internal/console.h>
 
-extern int char_avail;
-extern int ungot_char;
 
+int _getch(void)
+{
+    DWORD  NumberOfCharsRead = 0;
+    char c;
+    if (char_avail) {
+        c = ungot_char;
+        char_avail = 0;
+    } else {
+        ReadConsoleA(_get_osfhandle(stdin->_file),
+                            &c,
+                            1,
+                            &NumberOfCharsRead,
+                            NULL);
+    }
+    if (c == 10)
+        c = 13;
+    putchar(c);
+    return c;
+}
 
-int
-_getch(void)
+#if 0
+int _getche(void)
 {
-  
-  DWORD  NumberOfCharsRead = 0;
-  char c;
-  if (char_avail)
-  {
-    c = ungot_char;
-    char_avail = 0;
-  }
-  else
-  {    
-       ReadConsoleA(_get_osfhandle(stdin->_file), &c,1,&NumberOfCharsRead ,NULL);
-       
-  }
-  if ( c == 10 )
-       c = 13;
-  putchar(c);
-  return c;
+    int c;
+
+    c = _getch();
+    _putch(c);
+
+    return c;
 }
+#endif
index 247634b..f994649 100644 (file)
  *              28/12/98: Created
  */
 
-#include <crtdll/process.h>
-#include <crtdll/conio.h>
+#include <msvcrt/conio.h>
+#include <msvcrt/internal/console.h>
 
 
-extern int char_avail;
-int
-getche(void)
+int getche(void)
 {
   if (char_avail)
     /*
index 1232d72..292d709 100644 (file)
@@ -9,17 +9,15 @@
  */
 
 #include <windows.h>
-#include <crtdll/conio.h>
-#include <crtdll/stdio.h>
+#include <msvcrt/conio.h>
+#include <msvcrt/internal/console.h>
 
 
 // FIXME PeekCosoleInput returns more than keyboard hits
-extern int char_avail;
 
-int
-_kbhit(void)
+int _kbhit(void)
 {
-  INPUT_RECORD InputRecord;
+  //INPUT_RECORD InputRecord;
   DWORD NumberRead=0;
   if (char_avail)
        return(1);
index b207680..84397b8 100644 (file)
@@ -7,15 +7,15 @@
  * UPDATE HISTORY:
  *              28/12/98: Created
  */
-#include <crtdll/conio.h>
 #include <windows.h>
+#include <msvcrt/conio.h>
 
 int _putch( int c )
 {
        DWORD NumberOfCharsWritten;
+
        if ( WriteFile(GetStdHandle(STD_OUTPUT_HANDLE),&c,1,&NumberOfCharsWritten,NULL) ) {
                return -1;
        }
-
        return NumberOfCharsWritten;
 }
index 730ac39..8b974bb 100644 (file)
  *              28/12/98: Created
  */
 
-#include <crtdll/process.h>
+#include <msvcrt/conio.h>
+#include <msvcrt/internal/console.h>
+
 #define EOF -1
 
 int char_avail = 0;
-char ungot_char = 0;
+int ungot_char = 0;
 
 
-int
-_ungetch(int c)
+int _ungetch(int c)
 {
   if (char_avail)
     return(EOF);
diff --git a/reactos/lib/crtdll/ctype/ctype.c b/reactos/lib/crtdll/ctype/ctype.c
new file mode 100644 (file)
index 0000000..5861d6d
--- /dev/null
@@ -0,0 +1,264 @@
+/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
+#include <msvcrt/ctype.h>
+
+unsigned short _ctype[] = {
+       0,                      /* <EOF>, 0xFFFF */
+       _CONTROL,               /* CTRL+@, 0x00 */
+       _CONTROL,               /* CTRL+A, 0x01 */
+       _CONTROL,               /* CTRL+B, 0x02 */
+       _CONTROL,               /* CTRL+C, 0x03 */
+       _CONTROL,               /* CTRL+D, 0x04 */
+       _CONTROL,               /* CTRL+E, 0x05 */
+       _CONTROL,               /* CTRL+F, 0x06 */
+       _CONTROL,               /* CTRL+G, 0x07 */
+       _CONTROL,               /* CTRL+H, 0x08 */
+       _CONTROL | _SPACE,      /* CTRL+I, 0x09 */
+       _CONTROL | _SPACE,      /* CTRL+J, 0x0a */
+       _CONTROL | _SPACE,      /* CTRL+K, 0x0b */
+       _CONTROL | _SPACE,      /* CTRL+L, 0x0c */
+       _CONTROL | _SPACE,      /* CTRL+M, 0x0d */
+       _CONTROL,               /* CTRL+N, 0x0e */
+       _CONTROL,               /* CTRL+O, 0x0f */
+       _CONTROL,               /* CTRL+P, 0x10 */
+       _CONTROL,               /* CTRL+Q, 0x11 */
+       _CONTROL,               /* CTRL+R, 0x12 */
+       _CONTROL,               /* CTRL+S, 0x13 */
+       _CONTROL,               /* CTRL+T, 0x14 */
+       _CONTROL,               /* CTRL+U, 0x15 */
+       _CONTROL,               /* CTRL+V, 0x16 */
+       _CONTROL,               /* CTRL+W, 0x17 */
+       _CONTROL,               /* CTRL+X, 0x18 */
+       _CONTROL,               /* CTRL+Y, 0x19 */
+       _CONTROL,               /* CTRL+Z, 0x1a */
+       _CONTROL,               /* CTRL+[, 0x1b */
+       _CONTROL,               /* CTRL+\, 0x1c */
+       _CONTROL,               /* CTRL+], 0x1d */
+       _CONTROL,               /* CTRL+^, 0x1e */
+       _CONTROL,               /* CTRL+_, 0x1f */
+       _SPACE | _BLANK,        /* ` ', 0x20 */
+       _PUNCT,                 /* `!', 0x21 */
+       _PUNCT,                 /* 0x22 */
+       _PUNCT,                 /* `#', 0x23 */
+       _PUNCT,                 /* `$', 0x24 */
+       _PUNCT,                 /* `%', 0x25 */
+       _PUNCT,                 /* `&', 0x26 */
+       _PUNCT,                 /* 0x27 */
+       _PUNCT,                 /* `(', 0x28 */
+       _PUNCT,                 /* `)', 0x29 */
+       _PUNCT,                 /* `*', 0x2a */
+       _PUNCT,                 /* `+', 0x2b */
+       _PUNCT,                 /* `,', 0x2c */
+       _PUNCT,                 /* `-', 0x2d */
+       _PUNCT,                 /* `.', 0x2e */
+       _PUNCT,                 /* `/', 0x2f */
+       _DIGIT | _HEX,          /* `0', 0x30 */
+       _DIGIT | _HEX,          /* `1', 0x31 */
+       _DIGIT | _HEX,          /* `2', 0x32 */
+       _DIGIT | _HEX,          /* `3', 0x33 */
+       _DIGIT | _HEX,          /* `4', 0x34 */
+       _DIGIT | _HEX,          /* `5', 0x35 */
+       _DIGIT | _HEX,          /* `6', 0x36 */
+       _DIGIT | _HEX,          /* `7', 0x37 */
+       _DIGIT | _HEX,          /* `8', 0x38 */
+       _DIGIT | _HEX,          /* `9', 0x39 */
+       _PUNCT,                 /* `:', 0x3a */
+       _PUNCT,                 /* `;', 0x3b */
+       _PUNCT,                 /* `<', 0x3c */
+       _PUNCT,                 /* `=', 0x3d */
+       _PUNCT,                 /* `>', 0x3e */
+       _PUNCT,                 /* `?', 0x3f */
+       _PUNCT,                 /* `@', 0x40 */
+       _UPPER | _HEX,          /* `A', 0x41 */
+       _UPPER | _HEX,          /* `B', 0x42 */
+       _UPPER | _HEX,          /* `C', 0x43 */
+       _UPPER | _HEX,          /* `D', 0x44 */
+       _UPPER | _HEX,          /* `E', 0x45 */
+       _UPPER | _HEX,          /* `F', 0x46 */
+       _UPPER,                 /* `G', 0x47 */
+       _UPPER,                 /* `H', 0x48 */
+       _UPPER,                 /* `I', 0x49 */
+       _UPPER,                 /* `J', 0x4a */
+       _UPPER,                 /* `K', 0x4b */
+       _UPPER,                 /* `L', 0x4c */
+       _UPPER,                 /* `M', 0x4d */
+       _UPPER,                 /* `N', 0x4e */
+       _UPPER,                 /* `O', 0x4f */
+       _UPPER,                 /* `P', 0x50 */
+       _UPPER,                 /* `Q', 0x51 */
+       _UPPER,                 /* `R', 0x52 */
+       _UPPER,                 /* `S', 0x53 */
+       _UPPER,                 /* `T', 0x54 */
+       _UPPER,                 /* `U', 0x55 */
+       _UPPER,                 /* `V', 0x56 */
+       _UPPER,                 /* `W', 0x57 */
+       _UPPER,                 /* `X', 0x58 */
+       _UPPER,                 /* `Y', 0x59 */
+       _UPPER,                 /* `Z', 0x5a */
+       _PUNCT,                 /* `[', 0x5b */
+       _PUNCT,                 /* 0x5c */
+       _PUNCT,                 /* `]', 0x5d */
+       _PUNCT,                 /* `^', 0x5e */
+       _PUNCT,                 /* `_', 0x5f */
+       _PUNCT,                 /* 0x60 */
+       _LOWER | _HEX,          /* `a', 0x61 */
+       _LOWER | _HEX,          /* `b', 0x62 */
+       _LOWER | _HEX,          /* `c', 0x63 */
+       _LOWER | _HEX,          /* `d', 0x64 */
+       _LOWER | _HEX,          /* `e', 0x65 */
+       _LOWER | _HEX,          /* `f', 0x66 */
+       _LOWER,                 /* `g', 0x67 */
+       _LOWER,                 /* `h', 0x68 */
+       _LOWER,                 /* `i', 0x69 */
+       _LOWER,                 /* `j', 0x6a */
+       _LOWER,                 /* `k', 0x6b */
+       _LOWER,                 /* `l', 0x6c */
+       _LOWER,                 /* `m', 0x6d */
+       _LOWER,                 /* `n', 0x6e */
+       _LOWER,                 /* `o', 0x6f */
+       _LOWER,                 /* `p', 0x70 */
+       _LOWER,                 /* `q', 0x71 */
+       _LOWER,                 /* `r', 0x72 */
+       _LOWER,                 /* `s', 0x73 */
+       _LOWER,                 /* `t', 0x74 */
+       _LOWER,                 /* `u', 0x75 */
+       _LOWER,                 /* `v', 0x76 */
+       _LOWER,                 /* `w', 0x77 */
+       _LOWER,                 /* `x', 0x78 */
+       _LOWER,                 /* `y', 0x79 */
+       _LOWER,                 /* `z', 0x7a */
+       _PUNCT,                 /* `{', 0x7b */
+       _PUNCT,                 /* `|', 0x7c */
+       _PUNCT,                 /* `}', 0x7d */
+       _PUNCT,                 /* `~', 0x7e */
+       _CONTROL,               /* 0x7f */
+       0,                      /* 0x80 */
+       0,                      /* 0x81 */
+       0,                      /* 0x82 */
+       0,                      /* 0x83 */
+       0,                      /* 0x84 */
+       0,                      /* 0x85 */
+       0,                      /* 0x86 */
+       0,                      /* 0x87 */
+       0,                      /* 0x88 */
+       0,                      /* 0x89 */
+       0,                      /* 0x8a */
+       0,                      /* 0x8b */
+       0,                      /* 0x8c */
+       0,                      /* 0x8d */
+       0,                      /* 0x8e */
+       0,                      /* 0x8f */
+       0,                      /* 0x90 */
+       0,                      /* 0x91 */
+       0,                      /* 0x92 */
+       0,                      /* 0x93 */
+       0,                      /* 0x94 */
+       0,                      /* 0x95 */
+       0,                      /* 0x96 */
+       0,                      /* 0x97 */
+       0,                      /* 0x98 */
+       0,                      /* 0x99 */
+       0,                      /* 0x9a */
+       0,                      /* 0x9b */
+       0,                      /* 0x9c */
+       0,                      /* 0x9d */
+       0,                      /* 0x9e */
+       0,                      /* 0x9f */
+       0,                      /* 0xa0 */
+       0,                      /* 0xa1 */
+       0,                      /* 0xa2 */
+       0,                      /* 0xa3 */
+       0,                      /* 0xa4 */
+       0,                      /* 0xa5 */
+       0,                      /* 0xa6 */
+       0,                      /* 0xa7 */
+       0,                      /* 0xa8 */
+       0,                      /* 0xa9 */
+       0,                      /* 0xaa */
+       0,                      /* 0xab */
+       0,                      /* 0xac */
+       0,                      /* 0xad */
+       0,                      /* 0xae */
+       0,                      /* 0xaf */
+       0,                      /* 0xb0 */
+       0,                      /* 0xb1 */
+       0,                      /* 0xb2 */
+       0,                      /* 0xb3 */
+       0,                      /* 0xb4 */
+       0,                      /* 0xb5 */
+       0,                      /* 0xb6 */
+       0,                      /* 0xb7 */
+       0,                      /* 0xb8 */
+       0,                      /* 0xb9 */
+       0,                      /* 0xba */
+       0,                      /* 0xbb */
+       0,                      /* 0xbc */
+       0,                      /* 0xbd */
+       0,                      /* 0xbe */
+       0,                      /* 0xbf */
+       0,                      /* 0xc0 */
+       0,                      /* 0xc1 */
+       0,                      /* 0xc2 */
+       0,                      /* 0xc3 */
+       0,                      /* 0xc4 */
+       0,                      /* 0xc5 */
+       0,                      /* 0xc6 */
+       0,                      /* 0xc7 */
+       0,                      /* 0xc8 */
+       0,                      /* 0xc9 */
+       0,                      /* 0xca */
+       0,                      /* 0xcb */
+       0,                      /* 0xcc */
+       0,                      /* 0xcd */
+       0,                      /* 0xce */
+       0,                      /* 0xcf */
+       0,                      /* 0xd0 */
+       0,                      /* 0xd1 */
+       0,                      /* 0xd2 */
+       0,                      /* 0xd3 */
+       0,                      /* 0xd4 */
+       0,                      /* 0xd5 */
+       0,                      /* 0xd6 */
+       0,                      /* 0xd7 */
+       0,                      /* 0xd8 */
+       0,                      /* 0xd9 */
+       0,                      /* 0xda */
+       0,                      /* 0xdb */
+       0,                      /* 0xdc */
+       0,                      /* 0xdd */
+       0,                      /* 0xde */
+       0,                      /* 0xdf */
+       0,                      /* 0xe0 */
+       0,                      /* 0xe1 */
+       0,                      /* 0xe2 */
+       0,                      /* 0xe3 */
+       0,                      /* 0xe4 */
+       0,                      /* 0xe5 */
+       0,                      /* 0xe6 */
+       0,                      /* 0xe7 */
+       0,                      /* 0xe8 */
+       0,                      /* 0xe9 */
+       0,                      /* 0xea */
+       0,                      /* 0xeb */
+       0,                      /* 0xec */
+       0,                      /* 0xed */
+       0,                      /* 0xee */
+       0,                      /* 0xef */
+       0,                      /* 0xf0 */
+       0,                      /* 0xf1 */
+       0,                      /* 0xf2 */
+       0,                      /* 0xf3 */
+       0,                      /* 0xf4 */
+       0,                      /* 0xf5 */
+       0,                      /* 0xf6 */
+       0,                      /* 0xf7 */
+       0,                      /* 0xf8 */
+       0,                      /* 0xf9 */
+       0,                      /* 0xfa */
+       0,                      /* 0xfb */
+       0,                      /* 0xfc */
+       0,                      /* 0xfd */
+       0,                      /* 0xfe */
+       0                       /* 0xff */
+};
+
+/* EOF */
index 4ef4daf..822ee3c 100644 (file)
@@ -1,14 +1,14 @@
 /*
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS system libraries
- * FILE:        lib/crtdll/conio/getch.c
- * PURPOSE:     Writes a character to stdout
+ * FILE:        lib/crtdll/ctype/isascii.c
+ * PURPOSE:     Checks if a character is ascii
  * PROGRAMER:   Boudewijn Dekker
  * UPDATE HISTORY:
  *              28/12/98: Created
  */
 
-#include <crtdll/ctype.h>
+#include <msvcrt/ctype.h>
 
 int __isascii(int c)
 {
@@ -19,11 +19,3 @@ int iswascii(wint_t c)
 {
        return __isascii(c);
 }
-
-
-
-
-
-
-
-
index 19db72a..dfe8229 100644 (file)
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/ctype.h>
+#include <msvcrt/ctype.h>
 
-unsigned short _ctype[] = {
-       0,                      /* <EOF>, 0xFFFF */
-       _CONTROL,               /* CTRL+@, 0x00 */
-       _CONTROL,               /* CTRL+A, 0x01 */
-       _CONTROL,               /* CTRL+B, 0x02 */
-       _CONTROL,               /* CTRL+C, 0x03 */
-       _CONTROL,               /* CTRL+D, 0x04 */
-       _CONTROL,               /* CTRL+E, 0x05 */
-       _CONTROL,               /* CTRL+F, 0x06 */
-       _CONTROL,               /* CTRL+G, 0x07 */
-       _CONTROL,               /* CTRL+H, 0x08 */
-       _CONTROL | _SPACE,      /* CTRL+I, 0x09 */
-       _CONTROL | _SPACE,      /* CTRL+J, 0x0a */
-       _CONTROL | _SPACE,      /* CTRL+K, 0x0b */
-       _CONTROL | _SPACE,      /* CTRL+L, 0x0c */
-       _CONTROL | _SPACE,      /* CTRL+M, 0x0d */
-       _CONTROL,               /* CTRL+N, 0x0e */
-       _CONTROL,               /* CTRL+O, 0x0f */
-       _CONTROL,               /* CTRL+P, 0x10 */
-       _CONTROL,               /* CTRL+Q, 0x11 */
-       _CONTROL,               /* CTRL+R, 0x12 */
-       _CONTROL,               /* CTRL+S, 0x13 */
-       _CONTROL,               /* CTRL+T, 0x14 */
-       _CONTROL,               /* CTRL+U, 0x15 */
-       _CONTROL,               /* CTRL+V, 0x16 */
-       _CONTROL,               /* CTRL+W, 0x17 */
-       _CONTROL,               /* CTRL+X, 0x18 */
-       _CONTROL,               /* CTRL+Y, 0x19 */
-       _CONTROL,               /* CTRL+Z, 0x1a */
-       _CONTROL,               /* CTRL+[, 0x1b */
-       _CONTROL,               /* CTRL+\, 0x1c */
-       _CONTROL,               /* CTRL+], 0x1d */
-       _CONTROL,               /* CTRL+^, 0x1e */
-       _CONTROL,               /* CTRL+_, 0x1f */
-       _SPACE | _BLANK,        /* ` ', 0x20 */
-       _PUNCT,                 /* `!', 0x21 */
-       _PUNCT,                 /* 0x22 */
-       _PUNCT,                 /* `#', 0x23 */
-       _PUNCT,                 /* `$', 0x24 */
-       _PUNCT,                 /* `%', 0x25 */
-       _PUNCT,                 /* `&', 0x26 */
-       _PUNCT,                 /* 0x27 */
-       _PUNCT,                 /* `(', 0x28 */
-       _PUNCT,                 /* `)', 0x29 */
-       _PUNCT,                 /* `*', 0x2a */
-       _PUNCT,                 /* `+', 0x2b */
-       _PUNCT,                 /* `,', 0x2c */
-       _PUNCT,                 /* `-', 0x2d */
-       _PUNCT,                 /* `.', 0x2e */
-       _PUNCT,                 /* `/', 0x2f */
-       _DIGIT | _HEX,          /* `0', 0x30 */
-       _DIGIT | _HEX,          /* `1', 0x31 */
-       _DIGIT | _HEX,          /* `2', 0x32 */
-       _DIGIT | _HEX,          /* `3', 0x33 */
-       _DIGIT | _HEX,          /* `4', 0x34 */
-       _DIGIT | _HEX,          /* `5', 0x35 */
-       _DIGIT | _HEX,          /* `6', 0x36 */
-       _DIGIT | _HEX,          /* `7', 0x37 */
-       _DIGIT | _HEX,          /* `8', 0x38 */
-       _DIGIT | _HEX,          /* `9', 0x39 */
-       _PUNCT,                 /* `:', 0x3a */
-       _PUNCT,                 /* `;', 0x3b */
-       _PUNCT,                 /* `<', 0x3c */
-       _PUNCT,                 /* `=', 0x3d */
-       _PUNCT,                 /* `>', 0x3e */
-       _PUNCT,                 /* `?', 0x3f */
-       _PUNCT,                 /* `@', 0x40 */
-       _UPPER | _HEX,          /* `A', 0x41 */
-       _UPPER | _HEX,          /* `B', 0x42 */
-       _UPPER | _HEX,          /* `C', 0x43 */
-       _UPPER | _HEX,          /* `D', 0x44 */
-       _UPPER | _HEX,          /* `E', 0x45 */
-       _UPPER | _HEX,          /* `F', 0x46 */
-       _UPPER,                 /* `G', 0x47 */
-       _UPPER,                 /* `H', 0x48 */
-       _UPPER,                 /* `I', 0x49 */
-       _UPPER,                 /* `J', 0x4a */
-       _UPPER,                 /* `K', 0x4b */
-       _UPPER,                 /* `L', 0x4c */
-       _UPPER,                 /* `M', 0x4d */
-       _UPPER,                 /* `N', 0x4e */
-       _UPPER,                 /* `O', 0x4f */
-       _UPPER,                 /* `P', 0x50 */
-       _UPPER,                 /* `Q', 0x51 */
-       _UPPER,                 /* `R', 0x52 */
-       _UPPER,                 /* `S', 0x53 */
-       _UPPER,                 /* `T', 0x54 */
-       _UPPER,                 /* `U', 0x55 */
-       _UPPER,                 /* `V', 0x56 */
-       _UPPER,                 /* `W', 0x57 */
-       _UPPER,                 /* `X', 0x58 */
-       _UPPER,                 /* `Y', 0x59 */
-       _UPPER,                 /* `Z', 0x5a */
-       _PUNCT,                 /* `[', 0x5b */
-       _PUNCT,                 /* 0x5c */
-       _PUNCT,                 /* `]', 0x5d */
-       _PUNCT,                 /* `^', 0x5e */
-       _PUNCT,                 /* `_', 0x5f */
-       _PUNCT,                 /* 0x60 */
-       _LOWER | _HEX,          /* `a', 0x61 */
-       _LOWER | _HEX,          /* `b', 0x62 */
-       _LOWER | _HEX,          /* `c', 0x63 */
-       _LOWER | _HEX,          /* `d', 0x64 */
-       _LOWER | _HEX,          /* `e', 0x65 */
-       _LOWER | _HEX,          /* `f', 0x66 */
-       _LOWER,                 /* `g', 0x67 */
-       _LOWER,                 /* `h', 0x68 */
-       _LOWER,                 /* `i', 0x69 */
-       _LOWER,                 /* `j', 0x6a */
-       _LOWER,                 /* `k', 0x6b */
-       _LOWER,                 /* `l', 0x6c */
-       _LOWER,                 /* `m', 0x6d */
-       _LOWER,                 /* `n', 0x6e */
-       _LOWER,                 /* `o', 0x6f */
-       _LOWER,                 /* `p', 0x70 */
-       _LOWER,                 /* `q', 0x71 */
-       _LOWER,                 /* `r', 0x72 */
-       _LOWER,                 /* `s', 0x73 */
-       _LOWER,                 /* `t', 0x74 */
-       _LOWER,                 /* `u', 0x75 */
-       _LOWER,                 /* `v', 0x76 */
-       _LOWER,                 /* `w', 0x77 */
-       _LOWER,                 /* `x', 0x78 */
-       _LOWER,                 /* `y', 0x79 */
-       _LOWER,                 /* `z', 0x7a */
-       _PUNCT,                 /* `{', 0x7b */
-       _PUNCT,                 /* `|', 0x7c */
-       _PUNCT,                 /* `}', 0x7d */
-       _PUNCT,                 /* `~', 0x7e */
-       _CONTROL,               /* 0x7f */
-       0,                      /* 0x80 */
-       0,                      /* 0x81 */
-       0,                      /* 0x82 */
-       0,                      /* 0x83 */
-       0,                      /* 0x84 */
-       0,                      /* 0x85 */
-       0,                      /* 0x86 */
-       0,                      /* 0x87 */
-       0,                      /* 0x88 */
-       0,                      /* 0x89 */
-       0,                      /* 0x8a */
-       0,                      /* 0x8b */
-       0,                      /* 0x8c */
-       0,                      /* 0x8d */
-       0,                      /* 0x8e */
-       0,                      /* 0x8f */
-       0,                      /* 0x90 */
-       0,                      /* 0x91 */
-       0,                      /* 0x92 */
-       0,                      /* 0x93 */
-       0,                      /* 0x94 */
-       0,                      /* 0x95 */
-       0,                      /* 0x96 */
-       0,                      /* 0x97 */
-       0,                      /* 0x98 */
-       0,                      /* 0x99 */
-       0,                      /* 0x9a */
-       0,                      /* 0x9b */
-       0,                      /* 0x9c */
-       0,                      /* 0x9d */
-       0,                      /* 0x9e */
-       0,                      /* 0x9f */
-       0,                      /* 0xa0 */
-       0,                      /* 0xa1 */
-       0,                      /* 0xa2 */
-       0,                      /* 0xa3 */
-       0,                      /* 0xa4 */
-       0,                      /* 0xa5 */
-       0,                      /* 0xa6 */
-       0,                      /* 0xa7 */
-       0,                      /* 0xa8 */
-       0,                      /* 0xa9 */
-       0,                      /* 0xaa */
-       0,                      /* 0xab */
-       0,                      /* 0xac */
-       0,                      /* 0xad */
-       0,                      /* 0xae */
-       0,                      /* 0xaf */
-       0,                      /* 0xb0 */
-       0,                      /* 0xb1 */
-       0,                      /* 0xb2 */
-       0,                      /* 0xb3 */
-       0,                      /* 0xb4 */
-       0,                      /* 0xb5 */
-       0,                      /* 0xb6 */
-       0,                      /* 0xb7 */
-       0,                      /* 0xb8 */
-       0,                      /* 0xb9 */
-       0,                      /* 0xba */
-       0,                      /* 0xbb */
-       0,                      /* 0xbc */
-       0,                      /* 0xbd */
-       0,                      /* 0xbe */
-       0,                      /* 0xbf */
-       0,                      /* 0xc0 */
-       0,                      /* 0xc1 */
-       0,                      /* 0xc2 */
-       0,                      /* 0xc3 */
-       0,                      /* 0xc4 */
-       0,                      /* 0xc5 */
-       0,                      /* 0xc6 */
-       0,                      /* 0xc7 */
-       0,                      /* 0xc8 */
-       0,                      /* 0xc9 */
-       0,                      /* 0xca */
-       0,                      /* 0xcb */
-       0,                      /* 0xcc */
-       0,                      /* 0xcd */
-       0,                      /* 0xce */
-       0,                      /* 0xcf */
-       0,                      /* 0xd0 */
-       0,                      /* 0xd1 */
-       0,                      /* 0xd2 */
-       0,                      /* 0xd3 */
-       0,                      /* 0xd4 */
-       0,                      /* 0xd5 */
-       0,                      /* 0xd6 */
-       0,                      /* 0xd7 */
-       0,                      /* 0xd8 */
-       0,                      /* 0xd9 */
-       0,                      /* 0xda */
-       0,                      /* 0xdb */
-       0,                      /* 0xdc */
-       0,                      /* 0xdd */
-       0,                      /* 0xde */
-       0,                      /* 0xdf */
-       0,                      /* 0xe0 */
-       0,                      /* 0xe1 */
-       0,                      /* 0xe2 */
-       0,                      /* 0xe3 */
-       0,                      /* 0xe4 */
-       0,                      /* 0xe5 */
-       0,                      /* 0xe6 */
-       0,                      /* 0xe7 */
-       0,                      /* 0xe8 */
-       0,                      /* 0xe9 */
-       0,                      /* 0xea */
-       0,                      /* 0xeb */
-       0,                      /* 0xec */
-       0,                      /* 0xed */
-       0,                      /* 0xee */
-       0,                      /* 0xef */
-       0,                      /* 0xf0 */
-       0,                      /* 0xf1 */
-       0,                      /* 0xf2 */
-       0,                      /* 0xf3 */
-       0,                      /* 0xf4 */
-       0,                      /* 0xf5 */
-       0,                      /* 0xf6 */
-       0,                      /* 0xf7 */
-       0,                      /* 0xf8 */
-       0,                      /* 0xf9 */
-       0,                      /* 0xfa */
-       0,                      /* 0xfb */
-       0,                      /* 0xfc */
-       0,                      /* 0xfd */
-       0,                      /* 0xfe */
-       0                       /* 0xff */
-};
+
+extern unsigned short _ctype[];
 
 unsigned short *_pctype_dll = _ctype + 1;
 unsigned short *_pwctype_dll = _ctype + 1;
 
-int _isctype (unsigned int c, int ctypeFlags)
+
+int _isctype(unsigned int c, int ctypeFlags)
 {
        return (_pctype_dll[(unsigned char)(c & 0xFF)] & ctypeFlags);
 }
index ead804c..39c500c 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/ctype.h>
+#include <msvcrt/ctype.h>
 
 #undef isgraph
 int isgraph(int c)
index a75435d..8c6dbf5 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/ctype.h>
+#include <msvcrt/ctype.h>
 
 #undef isprint
 int isprint(int c)
index 0e90ae7..9eae142 100644 (file)
@@ -7,7 +7,7 @@
  * UPDATE HISTORY:
  *              28/12/98: Created
  */
-#include <crtdll/ctype.h>
+#include <msvcrt/ctype.h>
 
 #undef isspace
 int isspace(int c)
index e3152d1..e2c188c 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/ctype.h>
+#include <msvcrt/ctype.h>
 
 #undef tolower
 int tolower(int c)
@@ -24,12 +24,13 @@ int _tolower(int c)
    return(c);
 }
 
+/*
 wchar_t _towlower(wchar_t c)
 {
    if (iswctype (c, _UPPER))
        return (c - (L'A' - L'a'));
    return(c);
 }
-
+*/
 
 
index e0c8aa0..666cee2 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/ctype.h>
-#include <crtdll/wchar.h>
+#include <msvcrt/ctype.h>
+
 
 #undef toupper
 int toupper(int c)
@@ -25,9 +25,12 @@ int _toupper(int c)
    return(c);
 }
 
+/*
 wchar_t _towupper(wchar_t c)
 {
    if (iswctype (c, _LOWER))
       return (c + (L'A' - L'a'));
    return(c);
 }
+*/
+
index 19a4a9f..212b7dc 100644 (file)
@@ -1,7 +1,6 @@
 #include <windows.h>
-#include <crtdll/direct.h>
-#include <crtdll/ctype.h>
-
+#include <msvcrt/ctype.h>
+#include <msvcrt/direct.h>
 
 
 int _chdir( const char *_path )
@@ -10,9 +9,5 @@ int _chdir( const char *_path )
                _chdrive(tolower(_path[0] - 'a')+1);
        if ( !SetCurrentDirectoryA((char *)_path) )
                return -1;
-
        return 0;
 }
-
-
-
index 84d04c6..d31ed46 100644 (file)
@@ -1,10 +1,10 @@
-#include <crtdll/direct.h>
-#include <crtdll/stdlib.h>
-#include <crtdll/ctype.h>
 #include <windows.h>
+#include <msvcrt/ctype.h>
+#include <msvcrt/direct.h>
+#include <msvcrt/stdlib.h>
 
-int cur_drive = 0;
 
+int cur_drive = 0;
 
 
 int _chdrive( int drive )
@@ -20,7 +20,5 @@ int _chdrive( int drive )
                d[2] = 0;
                SetCurrentDirectoryA(d);
        }
-
-
        return 0;
 }
index 65f8985..1a27d4b 100644 (file)
@@ -1,25 +1,22 @@
 #include <windows.h>
-#include <crtdll/direct.h>
-#include <crtdll/stdlib.h>
-
+#include <msvcrt/direct.h>
+#include <msvcrt/stdlib.h>
 
 
 char *_getcwd( char *buffer, int maxlen )
 {
        char *cwd;
        int len;
+
        if ( buffer == NULL ) {
                cwd = malloc(MAX_PATH);
                len = MAX_PATH;
-       }
-       else {
+       } else {
                cwd = buffer;
                len = maxlen;
        }
-
-       if ( GetCurrentDirectoryA(len,cwd) == 0 )
+    if (GetCurrentDirectoryA(len, cwd) == 0) {
                return NULL;
-
+    }
        return cwd;
 }
-
index 0b2a8b5..2c6c888 100644 (file)
@@ -1,5 +1,5 @@
 #include <windows.h>
-#include <crtdll/direct.h>
+#include <msvcrt/direct.h>
 
 char* _getdcwd (int nDrive, char* caBuffer, int nBufLen)
 {
@@ -8,16 +8,12 @@ char* _getdcwd (int nDrive, char* caBuffer, int nBufLen)
        
        if ( nDrive < 1 || nDrive > 26 )
                return NULL;
-       
        if ( dr != nDrive )
                _chdrive(nDrive);
-       
        i = GetCurrentDirectoryA(nBufLen,caBuffer);
        if ( i  == nBufLen )
                return NULL;
-       
        if ( dr != nDrive )
                _chdrive(dr);
-       
        return caBuffer;
 }
index 766362b..a240503 100644 (file)
@@ -1,6 +1,6 @@
-#include <crtdll/direct.h>
 #include <windows.h>
-#include <crtdll/ctype.h>
+#include <msvcrt/ctype.h>
+#include <msvcrt/direct.h>
 
 
 unsigned int _getdiskfree(unsigned int _drive, struct _diskfree_t *_diskspace)
index a57e9ba..e2b6e66 100644 (file)
@@ -1,10 +1,9 @@
-#include <crtdll/direct.h>
-#include <crtdll/ctype.h>
 #include <windows.h>
-
-extern int cur_drive;
+#include <msvcrt/ctype.h>
+#include <msvcrt/direct.h>
 
 
+extern int cur_drive;
 
 int _getdrive( void )
 {
index 19191f8..9b5bb0f 100644 (file)
@@ -1,5 +1,5 @@
-#include <crtdll/direct.h>
 #include <windows.h>
+#include <msvcrt/direct.h>
 
 
 int _mkdir( const char *_path )
index c6736de..3619d04 100644 (file)
@@ -1,6 +1,5 @@
-#include <crtdll/direct.h>
 #include <windows.h>
-
+#include <msvcrt/direct.h>
 
 
 int _rmdir( const char *_path )
index 9a346ab..4754eaa 100644 (file)
@@ -9,21 +9,21 @@
  * Significantly revised and rewinddir, seekdir and telldir added by Colin
  * Peters <colin@fu.is.saga-u.ac.jp>
  *
- * $Revision: 1.2 $
- * $Author: ariadne $
- * $Date: 1999/04/02 21:43:47 $
+ * $Revision: 1.3 $
+ * $Author: robd $
+ * $Date: 2002/11/24 18:42:13 $
  *
  */
 
-#include <crtdll/stdlib.h>
-/* #include <crtdll/ctype.h> */
-#include <crtdll/errno.h>
-#include <crtdll/string.h>
-#include <crtdll/dir.h>
-#include <crtdll/direct.h>
-#include <crtdll/sys/stat.h>
+#include <msvcrt/stdlib.h>
+/* #include <msvcrt/ctype.h> */
+#include <msvcrt/errno.h>
+#include <msvcrt/string.h>
+#include <msvcrt/dir.h>
+#include <msvcrt/direct.h>
+#include <msvcrt/sys/stat.h>
 
-#include <crtdll/dirent.h>
+#include <msvcrt/dirent.h>
 
 #define SUFFIX "*"
 #define        SLASH   "\\"
index 2efd11a..bced295 100644 (file)
@@ -1,7 +1,13 @@
 #include <windows.h>
 
+
+#ifdef __GNUC__
+
 int _abnormal_termination(void)
 {
        printf("Abnormal Termination\n");
 //     return AbnormalTermination();
 }
+
+#else
+#endif
index be66fb4..875b5da 100644 (file)
@@ -1,11 +1,28 @@
 #include <windows.h>
+#include <ntos/except.h>
+
+
+#ifdef __GNUC__
+#else
+#endif
+
+ULONG DbgPrint(PCH Format, ...)
+{
+    return 0;
+}
+
+VOID STDCALL
+MsvcrtDebug(ULONG Value)
+{
+    //DbgPrint("MsvcrtDebug 0x%.08x\n", Value);
+}
+
 
 EXCEPTION_DISPOSITION
 _except_handler2(
-struct _EXCEPTION_RECORD *ExceptionRecord,
-void *Frame,
-struct _CONTEXT *ContextRecord,
-void *DispatcherContext)
+    struct _EXCEPTION_RECORD* ExceptionRecord, void* Frame,
+    struct _CONTEXT *ContextRecord,            void* DispatcherContext)
 {
-       printf("exception handler\n");
+    //printf("_except_handler2()\n");
+    return 0;
 }
index e921e84..01de05c 100644 (file)
@@ -1,22 +1,36 @@
+#include <windows.h>
+#include <ntos/except.h>
+
+
 struct _exception {
-        int type;       
-        char *name;     
-        double arg1;    
-        double arg2;    
-        double retval;  
-        } ;
-
-int _matherr(struct _exception *e)
+    int type;
+    char* name;
+    double arg1;
+    double arg2;
+    double retval;
+} ;
+
+
+int _matherr(struct _exception* e)
 {
     return 0;
 }
+
+
+// not exported by NTDLL
+void __setusermatherr(int (*handler)(struct _exception*))
+{
+
+}
+
+
 #define _FPIEEE_RECORD void
 
 int _fpieee_flt(
-       unsigned long exception_code,
-        struct _EXCEPTION_POINTERS *ExceptionPointer,
-        int (* handler)(_FPIEEE_RECORD *)
+        unsigned long exception_code,
+        struct _EXCEPTION_POINTERSExceptionPointer,
+        int (*handler)(_FPIEEE_RECORD*)
         )
 {
-       return 0;
+    return 0;
 }
index e824752..38dfd6e 100644 (file)
@@ -1,13 +1,14 @@
-#include <crtdll/float.h>
+#include <msvcrt/float.h>
 
 unsigned int   _clearfp (void)
 {      
-
 unsigned short __res = _statusfp();
-
+#ifdef __GNUC__
 __asm__ __volatile__ (
        "fclex \n\t"
        );
+#else
+#endif /*__GNUC__*/
        return __res;
 }
 
index 2ebdb0a..0019f84 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <crtdll/float.h>
+#include <msvcrt/float.h>
 
 unsigned int   _controlfp (unsigned int unNew, unsigned int unMask)
 {      
@@ -9,8 +9,8 @@ unsigned int    _controlfp (unsigned int unNew, unsigned int unMask)
 
 unsigned int   _control87 (unsigned int unNew, unsigned int unMask)
 {      
-
 register unsigned int __res;
+#ifdef __GNUC__
 __asm__ __volatile__ (
        "pushl  %%eax \n\t"             /* make room on stack */
        "fstcw  (%%esp) \n\t"
@@ -30,9 +30,8 @@ __asm__ __volatile__ (
        "fldcw  (%%esp) \n\t"
        "popl   %%edx \n\t"
 
-
        :"=r" (__res):"r" (unNew),"r" (unMask): "ax", "dx", "cx");
-/*     :"=a" (__res):"c" (unNew),"d" (unMask):"ax", "dx", "cx"); */
-
+#else
+#endif /*__GNUC__*/
        return __res;
 }
index a59c08a..444eed6 100644 (file)
@@ -1,5 +1,5 @@
-#include <crtdll/float.h>
-#include <crtdll/internal/ieee.h>
+#include <msvcrt/float.h>
+#include <msvcrt/internal/ieee.h>
 
 double _copysign (double __d, double __s)
 {
index 8b89627..d71c654 100644 (file)
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-double _logb (double __x);
+#include <msvcrt/float.h>
 
 double _logb (double __x)
 {
-  register double __value, __junk;
+  register double __value;
+#ifdef __GNUC__
+  register double __junk;
   __asm __volatile__
     ("fxtract\n\t"
      : "=t" (__junk), "=u" (__value) : "0" (__x));
-
+#else
+#endif /*__GNUC__*/
   return __value;
 }
index e035584..a2d1eac 100644 (file)
@@ -1,5 +1,5 @@
-#include <crtdll/float.h>
-#include <crtdll/internal/ieee.h>
+#include <msvcrt/float.h>
+#include <msvcrt/internal/ieee.h>
 
 double _scalb( double __x, long e )
 {
@@ -8,5 +8,4 @@ double _scalb( double __x, long e )
        x->exponent += e;
 
        return __x;
-
 }
index 5cfeabf..6792fd9 100644 (file)
@@ -1,14 +1,16 @@
-#include <crtdll/float.h>
+#include <msvcrt/float.h>
 
 unsigned int   _statusfp (void)
 {      
 
 register unsigned short __res;
-
+#ifdef __GNUC__
 __asm__ __volatile__ (
        "fstsw  %0 \n\t"
 //     "movzwl %ax, %eax"
        :"=a" (__res)
        );
+#else
+#endif /*__GNUC__*/
        return __res;
 }
index 47f66cd..4babf62 100644 (file)
@@ -1,38 +1,30 @@
-#include <crtdll/io.h>
 #include <windows.h>
+#include <msvcrt/io.h>
+#include <msvcrt/errno.h>
+#define NDEBUG
+#include <msvcrt/msvcrtdbg.h>
 
-#ifndef F_OK
- #define F_OK  0x01
-#endif
-#ifndef R_OK
- #define R_OK  0x02
-#endif
-#ifndef W_OK
- #define W_OK  0x04
-#endif
-#ifndef X_OK
- #define X_OK  0x08
-#endif
-#ifndef D_OK
- #define D_OK  0x10
-#endif
 
 int _access( const char *_path, int _amode )
 {
-       DWORD Attributes = GetFileAttributesA(_path);
+    DWORD Attributes = GetFileAttributesA(_path);
+    DPRINT("_access('%s', %x)\n", _path, _amode);
 
-       if ( Attributes == -1 )
-               return -1;
-
-       if ( (_amode & W_OK) == W_OK ) {
-               if ( (Attributes & FILE_ATTRIBUTE_READONLY) == FILE_ATTRIBUTE_READONLY )
-                       return -1;
-       }
-       if ( (_amode & D_OK) == D_OK ) {
-               if ( (Attributes & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY )
-                       return -1;
-       }
-
-       return 0;
-               
+    if (Attributes == -1)   {
+        __set_errno(ENOENT);
+        return -1;
+    }
+    if ((_amode & W_OK) == W_OK) {
+        if ((Attributes & FILE_ATTRIBUTE_READONLY) == FILE_ATTRIBUTE_READONLY) {
+            __set_errno(EACCES);
+            return -1;
+        }
+    }
+    if ((_amode & D_OK) == D_OK) {
+        if ((Attributes & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY) {
+            __set_errno(EACCES);
+            return -1;
+        }
+    }
+    return 0;
 }
index be48dbf..0f54898 100644 (file)
@@ -1,31 +1,33 @@
 #include <windows.h>
-#include <crtdll/io.h>
+#include <msvcrt/io.h>
+
+#define NDEBUG
+#include <msvcrt/msvcrtdbg.h>
+
 #define mode_t int
 
-int
-_chmod(const char *filename, mode_t mode)
+
+int _chmod(const char* filename, mode_t mode)
 {
-        DWORD FileAttributes = 0;
-        
-        FileAttributes = GetFileAttributes(filename);
-        if ( FileAttributes == -1 )
-               return -1;
-               
-        if ( mode == 0 )
-               return -1;
-        
-        
-        if ( (mode & _S_IREAD) == _S_IREAD && (mode & _S_IWRITE) != _S_IWRITE)
-                FileAttributes &= FILE_ATTRIBUTE_READONLY;       
-        else if ( ((mode & _S_IREAD) != _S_IREAD) && ((mode & _S_IWRITE) == _S_IWRITE) )
-                FileAttributes &= FILE_ATTRIBUTE_NORMAL;
-        else
-               FileAttributes &= FILE_ATTRIBUTE_NORMAL;
-                
-
-
-        if ( SetFileAttributes(filename,FileAttributes) == FALSE )
-                return -1;
-
-        return 1;
+    DWORD FileAttributes = 0;
+    DPRINT("_chmod('%s', %x)\n", filename, mode);
+
+    FileAttributes = GetFileAttributesA(filename);
+    if ( FileAttributes == -1 )
+        return -1;
+
+    if ( mode == 0 )
+        return -1;
+
+    if ((mode & _S_IREAD) == _S_IREAD && (mode & _S_IWRITE) != _S_IWRITE)
+        FileAttributes &= FILE_ATTRIBUTE_READONLY;
+    else if (((mode & _S_IREAD) != _S_IREAD) && ((mode & _S_IWRITE) == _S_IWRITE))
+        FileAttributes &= FILE_ATTRIBUTE_NORMAL;
+    else
+        FileAttributes &= FILE_ATTRIBUTE_NORMAL;
+
+    if (SetFileAttributesA(filename, FileAttributes) == FALSE)
+        return -1;
+
+    return 1;
 }
index 9fd2ce2..865bec2 100644 (file)
@@ -1,8 +1,12 @@
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/io.h>
+#include <msvcrt/io.h>
+
+#define NDEBUG
+#include <msvcrt/msvcrtdbg.h>
 
 int _chsize(int _fd, long size)
 {
+  DPRINT("_chsize(fd %d, size %d)\n", _fd, size);
   if (lseek(_fd, size, 0) == -1)
     return -1;
   if (_write(_fd, 0, 0) < 0)
index 2ca7aa8..65d6230 100644 (file)
@@ -1,14 +1,16 @@
-#include <crtdll/io.h>
 #include <windows.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/io.h>
+#include <msvcrt/internal/file.h>
 
+#define NDEBUG
+#include <msvcrt/msvcrtdbg.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);
-                
+  DPRINT("_close(fd %d)\n", _fd);
+  if (_fd == -1)
+    return -1;
+  if (CloseHandle(_get_osfhandle(_fd)) == FALSE)
+    return -1;
+  return __fileno_close(_fd);
 }
index 8c9d787..90b243b 100644 (file)
@@ -1,9 +1,8 @@
 #include <windows.h>
-#include <crtdll/io.h>
-#include <crtdll/errno.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/io.h>
+#include <msvcrt/errno.h>
+#include <msvcrt/internal/file.h>
 
-int _commode_dll = _IOCOMMIT;
 
 int _commit(int _fd)
 {
index 4456a82..2a617b3 100644 (file)
@@ -1,5 +1,5 @@
-#include <crtdll/io.h>
-#include <crtdll/fcntl.h>
+#include <msvcrt/io.h>
+#include <msvcrt/fcntl.h>
 
 int _creat(const char *filename, int mode)
 {
index f2a22ce..c706e9f 100644 (file)
@@ -1,12 +1,18 @@
+/* $Id: dup.c,v 1.7 2002/11/24 18:42:13 robd Exp $ */
 #include <windows.h>
-#include <crtdll/io.h>
+#include <msvcrt/io.h>
+#include <msvcrt/internal/file.h>
 
 // fixme change type of mode argument to mode_t
 
 int __fileno_alloc(HANDLE hFile, int mode);
 int __fileno_getmode(int _fd);
 
-int _dup( int handle )
+int _dup(int handle)
 {
-       return  __fileno_alloc(_get_osfhandle(handle), __fileno_getmode(handle));
+    HANDLE hFile;
+    int fd;
+    hFile = _get_osfhandle(handle);
+       fd = __fileno_alloc(hFile, __fileno_getmode(handle));
+    return fd;
 }
index 98ea368..ff43f3f 100644 (file)
@@ -1,6 +1,5 @@
-#include <windows.h>
-#include <crtdll/io.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/io.h>
+#include <msvcrt/internal/file.h>
 
 int _dup2( int handle1, int handle2 )
 {
index baf3952..344e7eb 100644 (file)
@@ -1,5 +1,5 @@
 #include <windows.h>
-#include <crtdll/io.h>
+#include <msvcrt/io.h>
 
 int _eof( int _fd )
 {
@@ -12,8 +12,4 @@ int _eof( int _fd )
                return 1;
 
        return 0;
-
-
-               
-       
 }
index b234bf4..231a3c9 100644 (file)
@@ -1,8 +1,8 @@
 #include <windows.h>
-#include <crtdll/io.h>
+#include <msvcrt/io.h>
 
-long
-_filelength(int _fd)
+
+long _filelength(int _fd)
 {
        return GetFileSize(_get_osfhandle(_fd),NULL);
 }
index 25ff5f7..a2dfe8b 100644 (file)
@@ -1,81 +1,77 @@
 #include <windows.h>
-#include <crtdll/io.h>
-#include <crtdll/string.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/io.h>
+#include <msvcrt/string.h>
+#include <msvcrt/internal/file.h>
 
 
+int _findclose(int handle)
+{
+    // check no wildcards or invalid handle
+    if (handle == 0 || handle == -1)
+       return 0;
+    return FindClose((void*)handle);
+}
 
-int _findfirst(const char *_name, struct _finddata_t *result)
+int _findfirst(const char* _name, struct _finddata_t* result)
 {
+    WIN32_FIND_DATA FindFileData;
+    char dir[MAX_PATH];
+    long hFindFile;
+    int len = 0;
 
-        WIN32_FIND_DATA FindFileData;
-        char dir[MAX_PATH];
-        long hFindFile;
-        int len = 0;
-        
-        if ( _name == NULL || _name[0] == 0 ) {
-                len = GetCurrentDirectory(MAX_PATH-4,dir);
-                if (dir[len-1] != '\\') {
-                        dir[len] = '\\';
-                        dir[len+1] = 0;
-                }
-                strcat(dir,"*.*");
-        }
-        else 
-                strcpy(dir,_name);
-        hFindFile = (long)FindFirstFileA( dir, &FindFileData ); 
-        if ( hFindFile == -1 ) {
-               memset(result,0,sizeof(struct _finddata_t));
-               return -1;
+    if (_name == NULL || _name[0] == 0) {
+        len = GetCurrentDirectory(MAX_PATH-4,dir);
+        if (dir[len-1] != '\\') {
+            dir[len] = '\\';
+            dir[len+1] = 0;
         }
-        result->attrib = FindFileData.dwFileAttributes; 
+        strcat(dir,"*.*");
+    } else {
+        strcpy(dir,_name);
+    }
 
+    hFindFile = (long)FindFirstFileA(dir, &FindFileData);
+    if (hFindFile == -1) {
+        memset(result,0,sizeof(struct _finddata_t));
+        return -1;
+    }
 
-        result->time_create = FileTimeToUnixTime( &FindFileData.ftCreationTime,NULL);
-        result->time_access = FileTimeToUnixTime( &FindFileData.ftLastAccessTime,NULL);
-        result->time_write = FileTimeToUnixTime( &FindFileData.ftLastWriteTime,NULL);
-        result->size = FindFileData.nFileSizeLow;
-        strncpy(result->name,FindFileData.cFileName,260);
-        
-        // if no wildcard the find file handle can be closed right away
-        // a return value of 0 can flag this.
-        
-        if(!strchr(dir,'*') && !strchr(dir,'?')) {
-               _findclose(hFindFile);
-               return 0;
-        }
-        
-        
-        return hFindFile;
+    result->attrib = FindFileData.dwFileAttributes;
+    result->time_create = FileTimeToUnixTime(&FindFileData.ftCreationTime,NULL);
+    result->time_access = FileTimeToUnixTime(&FindFileData.ftLastAccessTime,NULL);
+    result->time_write = FileTimeToUnixTime(&FindFileData.ftLastWriteTime,NULL);
+    result->size = FindFileData.nFileSizeLow;
+    strncpy(result->name,FindFileData.cFileName,260);
+
+    // if no wildcard the find file handle can be closed right away
+    // a return value of 0 can flag this.
+
+    if (!strchr(dir,'*') && !strchr(dir,'?')) {
+        _findclose(hFindFile);
+        return 0;
+    }
 
+    return hFindFile;
 }
 
-int  _findnext(int handle, struct _finddata_t  *result)
+int _findnext(int handle, struct _finddata_t* result)
 {
-        WIN32_FIND_DATA FindFileData;
-        
-        // check no wildcards or invalid handle
-        if ( handle == 0 || handle == -1)
-               return 0;
-                
-          
+    WIN32_FIND_DATA FindFileData;
 
-        if ( !FindNextFile((void *)handle, &FindFileData ) )
-                return -1;
-        
-        result->attrib = FindFileData.dwFileAttributes; 
-        result->time_create = FileTimeToUnixTime( &FindFileData.ftCreationTime,NULL);
-        result->time_access = FileTimeToUnixTime( &FindFileData.ftLastAccessTime,NULL);
-        result->time_write = FileTimeToUnixTime( &FindFileData.ftLastWriteTime,NULL);
-        result->size = FindFileData.nFileSizeLow;
-        strncpy(result->name,FindFileData.cFileName,260);
+    // check no wildcards or invalid handle
+    if (handle == 0 || handle == -1)
         return 0;
-}
 
-int  _findclose(int handle)
-{
-       // check no wildcards or invalid handle
-       if ( handle == 0 || handle == -1)
-               return 0;
-        return FindClose((void *)handle);
+    if (!FindNextFileA((void*)handle, &FindFileData))
+        return -1;
+
+    result->attrib = FindFileData.dwFileAttributes;
+    result->time_create = FileTimeToUnixTime(&FindFileData.ftCreationTime,NULL);
+    result->time_access = FileTimeToUnixTime(&FindFileData.ftLastAccessTime,NULL);
+    result->time_write = FileTimeToUnixTime(&FindFileData.ftLastWriteTime,NULL);
+    result->size = FindFileData.nFileSizeLow;
+    strncpy(result->name,FindFileData.cFileName, MAX_PATH);
+
+    return 0;
 }
+
index 79347bd..870ac3a 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/fcntl.h>
-#include <crtdll/io.h>
+#include <msvcrt/fcntl.h>
+#include <msvcrt/io.h>
 
 #undef _fmode
 unsigned int _fmode = O_TEXT;
index a452414..3ed7a80 100644 (file)
@@ -1,11 +1,13 @@
-#include <crtdll/io.h>
-#include <crtdll/sys/stat.h>
+#include <msvcrt/io.h>
+#include <msvcrt/sys/stat.h>
 
+#define NDEBUG
+#include <msvcrt/msvcrtdbg.h>
 
 int _isatty( int fd )
 {
   struct stat buf;
-
+  DPRINT("_isatty(fd %d)\n", fd);
   if (_fstat (fd, &buf) < 0)
     return 0;
   if (S_ISCHR (buf.st_mode))
index c585445..36b2126 100644 (file)
@@ -1,9 +1,9 @@
 #include <windows.h>
-#include <crtdll/io.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/io.h>
+#include <msvcrt/internal/file.h>
+
 
 long _lseek(int _fildes, long _offset, int _whence)
 {
        return _llseek((HFILE)filehnd(_fildes),_offset,_whence);
 }
-
index a5499ec..9029be1 100644 (file)
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <crtdll/stdio.h>
-#include <crtdll/string.h>
-#include <crtdll/io.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/string.h>
+#include <msvcrt/io.h>
+
+#define NDEBUG
+#include <msvcrt/msvcrtdbg.h>
 
 
 char* _mktemp (char *_template)
@@ -24,8 +27,7 @@ char* _mktemp (char *_template)
   char *cp, *dp;
   int i, len, xcount, loopcnt;
 
-
+  DPRINT("_mktemp('%s')\n", _template);
   len = strlen (_template);
   cp = _template + len;
 
index 4cc7e33..cd5159c 100644 (file)
@@ -1,4 +1,5 @@
-/*
+/* $Id: open.c,v 1.13 2002/11/24 18:42:13 robd Exp $
+ *
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS system libraries
  * FILE:        lib/crtdll/io/open.c
 
 #include <windows.h>
 #include <stdarg.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>
+
+#define STD_AUX_HANDLE 3
+#define STD_PRINTER_HANDLE 4
 
 typedef struct _fileno_modes_type
 {
-       HANDLE hFile;
-       int mode;
-       int fd;
+    HANDLE hFile;
+    int mode;
+    int fd;
 } fileno_modes_type;
 
+int __fileno_alloc(HANDLE hFile, int mode);
+
 fileno_modes_type *fileno_modes = NULL;
 
 int maxfno = 5;
 int minfno = 5;
 
-char __is_text_file(FILE *p) 
+char __is_text_file(FILE* p)
 {
-   if ( p == NULL || fileno_modes == NULL )
+   if (p == NULL || fileno_modes == NULL)
      return FALSE;
    return (!((p)->_flag&_IOSTRG) && (fileno_modes[(p)->_file].mode&O_TEXT));
 }
 
-
-
-
-int __fileno_alloc(HANDLE hFile, int mode);
-
-
-int _open(const char *_path, int _oflag,...)
+int _open(const char* _path, int _oflag,...)
 {
-   HANDLE hFile;
-   DWORD dwDesiredAccess = 0;
-   DWORD dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
-   DWORD dwCreationDistribution = 0;
-   DWORD dwFlagsAndAttributes = 0;
-  int mode;
-  va_list arg;
-       
-  va_start (arg, _oflag);
-  mode = va_arg(arg,int);
-  va_end (arg);
-  if ( (mode == S_IWRITE) || (mode == 0) )
-    dwFlagsAndAttributes = FILE_ATTRIBUTE_READONLY;
-
-   /*
-    *
-    * _O_BINARY   Opens file in binary (untranslated) mode. (See fopen for a description of binary mode.)
-    * _O_TEXT   Opens file in text (translated) mode. (For more information, see Text and Binary Mode File I/O and fopen.)
-    * 
-    */
-   if (( _oflag & _O_RDWR ) == _O_RDWR ) 
-     dwDesiredAccess |= GENERIC_WRITE|GENERIC_READ ;
-   else if (( _oflag & _O_WRONLY ) == _O_WRONLY )
-     dwDesiredAccess |= GENERIC_WRITE ;
-   else 
-     dwDesiredAccess |= GENERIC_READ ;
-
-   if (( _oflag & (_O_CREAT | _O_EXCL ) ) == (_O_CREAT | _O_EXCL) )
-     dwCreationDistribution |= CREATE_NEW;
-
-   else if (( _oflag &  O_TRUNC ) == O_TRUNC  ) {
-      if (( _oflag &  O_CREAT ) ==  O_CREAT ) 
-       dwCreationDistribution |= CREATE_ALWAYS;
-      else if (( _oflag & O_RDONLY ) != O_RDONLY ) 
-       dwCreationDistribution |= TRUNCATE_EXISTING;
-   }
-   else if (( _oflag & _O_APPEND ) == _O_APPEND )
-     dwCreationDistribution |= OPEN_EXISTING;
-   else if (( _oflag &  _O_CREAT ) == _O_CREAT )
-     dwCreationDistribution |= OPEN_ALWAYS;
-   else
-     dwCreationDistribution |= OPEN_EXISTING;
-   
-   if (( _oflag &  _O_RANDOM ) == _O_RANDOM )
-     dwFlagsAndAttributes |= FILE_FLAG_RANDOM_ACCESS;  
-   if (( _oflag &  _O_SEQUENTIAL ) == _O_SEQUENTIAL )
-     dwFlagsAndAttributes |= FILE_FLAG_SEQUENTIAL_SCAN;
-   
-   if (( _oflag &  _O_TEMPORARY ) == _O_TEMPORARY )
-     dwFlagsAndAttributes |= FILE_FLAG_DELETE_ON_CLOSE;
-   
-   if (( _oflag &  _O_SHORT_LIVED ) == _O_SHORT_LIVED )
-     dwFlagsAndAttributes |= FILE_FLAG_DELETE_ON_CLOSE;
-   
-   hFile = CreateFileA(_path,
-                      dwDesiredAccess,
-                      dwShareMode,     
-                      NULL, 
-                      dwCreationDistribution,  
-                      dwFlagsAndAttributes,
-                      NULL);
-   if (hFile == (HANDLE)-1)
-     return -1;
-   return  __fileno_alloc(hFile,_oflag);
-
-//     _O_APPEND   Moves file pointer to end of file before every write operation.
+    HANDLE hFile;
+    DWORD dwDesiredAccess = 0;
+    DWORD dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
+    DWORD dwCreationDistribution = 0;
+    DWORD dwFlagsAndAttributes = 0;
+    int mode;
+    va_list arg;
+
+    va_start(arg, _oflag);
+    mode = va_arg(arg,int);
+    va_end (arg);
+    if ((mode == S_IWRITE) || (mode == 0))
+        dwFlagsAndAttributes = FILE_ATTRIBUTE_READONLY;
+    /*
+     *
+     * _O_BINARY   Opens file in binary (untranslated) mode. (See fopen for a description of binary mode.)
+     * _O_TEXT   Opens file in text (translated) mode. (For more information, see Text and Binary Mode File I/O and fopen.)
+     * 
+     */
+    if (( _oflag & _O_RDWR ) == _O_RDWR ) 
+        dwDesiredAccess |= GENERIC_WRITE|GENERIC_READ ;
+    else if (( _oflag & _O_WRONLY ) == _O_WRONLY )
+        dwDesiredAccess |= GENERIC_WRITE ;
+    else 
+        dwDesiredAccess |= GENERIC_READ ;
+
+    if ((_oflag & (_O_CREAT | _O_EXCL ) ) == (_O_CREAT | _O_EXCL))
+        dwCreationDistribution |= CREATE_NEW;
+
+    else if ((_oflag &  O_TRUNC) == O_TRUNC) {
+        if ((_oflag &  O_CREAT) ==  O_CREAT)
+            dwCreationDistribution |= CREATE_ALWAYS;
+        else if ((_oflag & O_RDONLY ) != O_RDONLY)
+            dwCreationDistribution |= TRUNCATE_EXISTING;
+    }
+    else if ((_oflag & _O_APPEND) == _O_APPEND)
+        dwCreationDistribution |= OPEN_EXISTING;
+    else if ((_oflag &  _O_CREAT) == _O_CREAT)
+        dwCreationDistribution |= OPEN_ALWAYS;
+    else
+        dwCreationDistribution |= OPEN_EXISTING;
+
+    if ((_oflag &  _O_RANDOM) == _O_RANDOM)
+        dwFlagsAndAttributes |= FILE_FLAG_RANDOM_ACCESS;
+    if ((_oflag &  _O_SEQUENTIAL) == _O_SEQUENTIAL)
+        dwFlagsAndAttributes |= FILE_FLAG_SEQUENTIAL_SCAN;
+
+    if ((_oflag &  _O_TEMPORARY) == _O_TEMPORARY)
+        dwFlagsAndAttributes |= FILE_FLAG_DELETE_ON_CLOSE;
+
+    if ((_oflag &  _O_SHORT_LIVED) == _O_SHORT_LIVED)
+        dwFlagsAndAttributes |= FILE_FLAG_DELETE_ON_CLOSE;
+
+    hFile = CreateFileA(_path,
+               dwDesiredAccess,
+               dwShareMode, 
+               NULL, 
+               dwCreationDistribution,  
+               dwFlagsAndAttributes,
+               NULL);
+    if (hFile == (HANDLE)-1)
+        return -1;
+    return  __fileno_alloc(hFile,_oflag);
+
+//  _O_APPEND   Moves file pointer to end of file before every write operation.
 
 }
 
 
-
-
 int
 __fileno_alloc(HANDLE hFile, int mode)
 {
-  
   int i;
   /* Check for bogus values */
   if (hFile < 0)
-       return -1;
+    return -1;
 
   for(i=minfno;i<maxfno;i++) {
-       if (fileno_modes[i].fd == -1 ) {
-               fileno_modes[i].fd = i;
-               fileno_modes[i].mode = mode;
-               fileno_modes[i].hFile = hFile;
-               return i;
-       }
+    if (fileno_modes[i].fd == -1 ) {
+        fileno_modes[i].fd = i;
+        fileno_modes[i].mode = mode;
+        fileno_modes[i].hFile = hFile;
+        return i;
+    }
   }
 
-               
   /* See if we need to expand the tables.  Check this BEFORE it might fail,
      so that when we hit the count'th request, we've already up'd it. */
   if ( i == maxfno)
   {
     int oldcount = maxfno;
     fileno_modes_type *old_fileno_modes = fileno_modes;
-       maxfno  += 255;
+    maxfno += 255;
     fileno_modes = (fileno_modes_type *)malloc(maxfno * sizeof(fileno_modes_type));
     if ( old_fileno_modes != NULL )
     {
-       memcpy(fileno_modes, old_fileno_modes, oldcount * sizeof(fileno_modes_type));
+        memcpy(fileno_modes, old_fileno_modes, oldcount * sizeof(fileno_modes_type));
         free ( old_fileno_modes );
     }
     memset(fileno_modes + oldcount, 0, (maxfno-oldcount)*sizeof(fileno_modes));
-   
   }
 
   /* Fill in the value */
@@ -166,103 +160,86 @@ __fileno_alloc(HANDLE hFile, int mode)
 
 void *filehnd(int fileno)
 {
-       
-       
-
-       if ( fileno < 0 )
-               return (void *)-1;
-#define STD_AUX_HANDLE 3
-#define STD_PRINTER_HANDLE 4
-
-       switch(fileno)
-       {
-       case 0:
-               return GetStdHandle(STD_INPUT_HANDLE);
-       case 1:
-               return GetStdHandle(STD_OUTPUT_HANDLE);
-       case 2:
-               return GetStdHandle(STD_ERROR_HANDLE);
-       case 3:
-               return GetStdHandle(STD_AUX_HANDLE);
-       case 4:
-               return GetStdHandle(STD_PRINTER_HANDLE);
-       default:
-               break;
-       }
-               
-       if ( fileno >= maxfno )
-               return (void *)-1;
-
-       if ( fileno_modes[fileno].fd == -1 )
-               return (void *)-1;
-       return fileno_modes[fileno].hFile;
-}
-
-int __fileno_dup2( int handle1, int handle2 )
-{
-       if ( handle1 >= maxfno )
-               return -1;
-
-       if ( handle1 < 0 )
-               return -1;
-       if ( handle2 >= maxfno )
-               return -1;
-
-       if ( handle2 < 0 )
-               return -1;
-
-       memcpy(&fileno_modes[handle1],&fileno_modes[handle2],sizeof(fileno_modes));
-       
-       
-       return handle1;
+    if (fileno < 0)
+        return (void*)-1;
+    switch (fileno) {
+    case 0:
+        return GetStdHandle(STD_INPUT_HANDLE);
+    case 1:
+        return GetStdHandle(STD_OUTPUT_HANDLE);
+    case 2:
+        return GetStdHandle(STD_ERROR_HANDLE);
+    case 3:
+        return GetStdHandle(STD_AUX_HANDLE);
+    case 4:
+        return GetStdHandle(STD_PRINTER_HANDLE);
+    default:
+        break;
+    }
+    if (fileno >= maxfno)
+        return (void*)-1;
+    if (fileno_modes[fileno].fd == -1)
+        return (void*)-1;
+    return fileno_modes[fileno].hFile;
 }
 
 int __fileno_setmode(int _fd, int _newmode)
 {
-       int m;
-       if ( _fd < minfno )
-               return -1;
-
-       if ( _fd >= maxfno )
-               return -1;
+    int m;
 
-       m = fileno_modes[_fd].mode;
-       fileno_modes[_fd].mode = _newmode;
-       return m;
+    if (_fd < minfno) {
+        return -1;
+    }
+    if (_fd >= maxfno)
+        return -1;
+    m = fileno_modes[_fd].mode;
+    fileno_modes[_fd].mode = _newmode;
+    return m;
 }
 
 int __fileno_getmode(int _fd)
 {
-       if ( _fd < minfno )
-               return -1;
-
-       if ( _fd >= maxfno )
-               return -1;
-
-       return fileno_modes[_fd].mode;
-
+    if (_fd < minfno) {
+        return -1;
+    }
+    if (_fd >= maxfno)
+        return -1;
+    return fileno_modes[_fd].mode;
 }
 
-
-int    __fileno_close(int _fd)
+int __fileno_close(int _fd)
 {
-       if ( _fd < 0 )
-               return -1;
-
-       if ( _fd >= maxfno )
-               return -1;
+    if (_fd < 0) {
+        return -1;
+    }
+    if (_fd >= maxfno)
+        return -1;
+    fileno_modes[_fd].fd = -1;
+    fileno_modes[_fd].hFile = (HANDLE)-1;
+    return 0;
+}
 
-       fileno_modes[_fd].fd = -1;
-       fileno_modes[_fd].hFile = (HANDLE)-1;
-       return 0;       
+int _open_osfhandle(void *osfhandle, int flags)
+{
+    return __fileno_alloc((HANDLE)osfhandle, flags);
 }
 
-int _open_osfhandle (void *osfhandle, int flags )
+void *_get_osfhandle(int fileno)
 {
-       return __fileno_alloc((HANDLE)osfhandle, flags);
-}      
+    return filehnd(fileno);
+}
 
-void *_get_osfhandle( int fileno )
+int __fileno_dup2(int handle1, int handle2)
 {
-       return  filehnd(fileno);
+    if (handle1 >= maxfno) {
+        return -1;
+    }
+    if (handle1 < 0)
+        return -1;
+    if (handle2 >= maxfno)
+        return -1;
+    if (handle2 < 0)
+        return -1;
+    memcpy(&fileno_modes[handle1],&fileno_modes[handle2],sizeof(fileno_modes));
+    return handle1;
 }
index 8c67f7a..977a832 100644 (file)
@@ -1,4 +1,5 @@
-/*
+/* $Id: pipe.c,v 1.4 2002/11/24 18:42:13 robd Exp $
+ *
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS system libraries
  * FILE:        lib/crtdll/io/pipe.c
@@ -8,8 +9,8 @@
  *              28/12/98: Appropriated for Reactos
  */
 #include <windows.h>
-#include <crtdll/io.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/io.h>
+#include <msvcrt/internal/file.h>
 
 
 int _pipe(int _fildes[2], unsigned int size, int mode )
index e5dc4ad..0c7227e 100644 (file)
@@ -1,14 +1,19 @@
-/*
+/* $Id: read.c,v 1.9 2002/11/24 18:42:13 robd Exp $
+ *
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS system libraries
  * FILE:        lib/crtdll/io/read.c
  * PURPOSE:     Reads a file
  * PROGRAMER:   Boudewijn Dekker
  * UPDATE HISTORY:
- *              28/12/98: Created
+ *              28/12/1998: Created
  */
-#include <crtdll/io.h>
 #include <windows.h>
+#include <msvcrt/io.h>
+#include <msvcrt/internal/file.h>
+
+#define NDEBUG
+#include <msvcrt/msvcrtdbg.h>
 
 size_t _read(int _fd, void *_buf, size_t _nbyte)
 {
index ea6f7e8..a127902 100644 (file)
@@ -1,4 +1,5 @@
-/*
+/* $Id: setmode.c,v 1.5 2002/11/24 18:42:13 robd Exp $
+ *
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS system libraries
  * FILE:        lib/crtdll/io/setmode.c
@@ -8,12 +9,16 @@
  *              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>
+
+#define NDEBUG
+#include <msvcrt/msvcrtdbg.h>
 
 
 int _setmode(int _fd, int _newmode)
 {
+    DPRINT("_setmod(fd %d, newmode %x)\n", _fd, _newmode);
        return __fileno_setmode(_fd, _newmode);
 }
index 5d42157..b7c06d1 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/io.h>
+#include <msvcrt/io.h>
 
 
 int _sopen(char *path,int access,int shflag,int mode)
index ce53df0..990a477 100644 (file)
@@ -1,10 +1,9 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/errno.h>
-#include <crtdll/io.h>
+#include <msvcrt/errno.h>
+#include <msvcrt/io.h>
 
 
-off_t
-_tell(int _file)
+off_t _tell(int _file)
 {
   return _lseek(_file, 0, SEEK_CUR);
 }
index 7a8323b..fd4af98 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/sys/stat.h>
+#include <msvcrt/sys/stat.h>
 
 unsigned _unMode_dll = 022;
 
index 65ef9d4..b29415d 100644 (file)
@@ -8,7 +8,7 @@
  *              28/12/98: Created
  */
 #include <windows.h>
-#include <crtdll/io.h>
+#include <msvcrt/io.h>
 
 
 
index 90b9921..27da039 100644 (file)
@@ -1,8 +1,9 @@
-#include <crtdll/stdio.h>
-#include <crtdll/io.h>
-#include <crtdll/errno.h>
-#include <crtdll/sys/utime.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/io.h>
+#include <msvcrt/errno.h>
+#include <msvcrt/sys/utime.h>
+#include <msvcrt/internal/file.h>
+
 
 int _utime(const char* filename, struct _utimbuf* buf)
 {
@@ -18,5 +19,4 @@ int _utime(const char* filename, struct _utimbuf* buf)
   if ( _close(fn) < 0 )
        return -1;
   return ret;
-  
 }
index 30f0f26..6d9dd84 100644 (file)
@@ -7,8 +7,8 @@
  * UPDATE HISTORY:
  *              28/12/98: Created
  */
-#include <crtdll/io.h>
 #include <windows.h>
+#include <msvcrt/io.h>
 
 
 
index d72fcb0..f7e3cd8 100644 (file)
@@ -1,12 +1,11 @@
-#include <crtdll/stdio.h>
-#include <crtdll/locale.h>
-#include <crtdll/string.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/locale.h>
+#include <msvcrt/string.h>
 #include <limits.h>
 
 
 int _current_category; /* used by setlocale */
 const char *_current_locale;
-int __mb_cur_max_dll = 1;
 
 int parse_locale(char *locale, char *lang, char *country, char *code_page);
 
@@ -140,4 +139,3 @@ struct lconv *localeconv(void)
 {
   return (struct lconv *) &_lconv;
 }
-
index f4d4acb..a23db83 100644 (file)
@@ -1,7 +1,9 @@
-# $Id: makefile,v 1.49 2002/11/19 17:16:14 robd Exp $
+# $Id: makefile,v 1.50 2002/11/24 18:42:12 robd Exp $
 
 PATH_TO_TOP = ../..
 
+PATH_TO_MSVCRT = ../msvcrt
+
 TARGET_DEFONLY = yes
 
 TARGET_TYPE = dynlink
@@ -17,7 +19,6 @@ TARGET_SDKLIBS = kernel32.a
 TARGET_OBJECTS = $(TARGET_NAME).o
 
 TARGET_CLEAN = \
-       assert/*.o \
        conio/*.o \
        ctype/*.o \
        direct/*.o \
@@ -50,9 +51,6 @@ include $(PATH_TO_TOP)/rules.mak
 include $(TOOLS_PATH)/helper.mk
 
 
-ASSERT_OBJECTS = \
-       assert/assert.o
-
 CONIO_OBJECTS = \
        conio/cgets.o \
        conio/cprintf.o \
@@ -65,6 +63,7 @@ CONIO_OBJECTS = \
        conio/ungetch.o
 
 CTYPE_OBJECTS = \
+       ctype/ctype.o \
        ctype/isalnum.o \
        ctype/isalpha.o \
        ctype/isascii.o \
@@ -241,6 +240,8 @@ MBSTRING_OBJECTS = \
 
 MISC_OBJECTS = \
        misc/amsg.o \
+       misc/assert.o \
+       misc/debug.o \
        misc/dllmain.o \
        misc/GetArgs.o \
        misc/initterm.o \
@@ -452,38 +453,38 @@ TIME_OBJECTS = \
        time/strtime.o \
        time/time.o
 
-WCHAR_OBJECTS = \
-       wchar/wcscat.o \
-       wchar/wcschr.o \
-       wchar/wcscmp.o \
+WSTRING_OBJECTS = \
+       $(PATH_TO_MSVCRT)/wstring/wcscat.o \
+       $(PATH_TO_MSVCRT)/wstring/wcschr.o \
+       $(PATH_TO_MSVCRT)/wstring/wcscmp.o \
        wchar/wcscoll.o \
-       wchar/wcscpy.o \
-       wchar/wcscspn.o \
-       wchar/wcsdup.o \
-       wchar/wcsicmp.o \
+       $(PATH_TO_MSVCRT)/wstring/wcscpy.o \
+       $(PATH_TO_MSVCRT)/wstring/wcscspn.o \
+       $(PATH_TO_MSVCRT)/wstring/wcsdup.o \
+       $(PATH_TO_MSVCRT)/wstring/wcsicmp.o \
        wchar/wcslen.o \
-       wchar/wcslwr.o \
-       wchar/wcsncat.o \
-       wchar/wcsncmp.o \
-       wchar/wcsncpy.o \
-       wchar/wcsnlen.o \
-       wchar/wcspbrk.o \
-       wchar/wcsrchr.o \
-       wchar/wcsrev.o \
-       wchar/wcsset.o \
-       wchar/wcsspn.o \
-       wchar/wcsstr.o \
+       $(PATH_TO_MSVCRT)/wstring/wcslwr.o \
+       $(PATH_TO_MSVCRT)/wstring/wcsncat.o \
+       $(PATH_TO_MSVCRT)/wstring/wcsncmp.o \
+       $(PATH_TO_MSVCRT)/wstring/wcsncpy.o \
+       $(PATH_TO_MSVCRT)/wstring/wcsnlen.o \
+       $(PATH_TO_MSVCRT)/wstring/wcspbrk.o \
+       $(PATH_TO_MSVCRT)/wstring/wcsrchr.o \
+       $(PATH_TO_MSVCRT)/wstring/wcsrev.o \
+       $(PATH_TO_MSVCRT)/wstring/wcsset.o \
+       $(PATH_TO_MSVCRT)/wstring/wcsspn.o \
+       $(PATH_TO_MSVCRT)/wstring/wcsstr.o \
        wchar/wcstod.o \
        wchar/wcstok.o \
        wchar/wcstol.o \
-       wchar/wcsupr.o \
-       wchar/wcsxfrm.o \
+       $(PATH_TO_MSVCRT)/wstring/wcsupr.o \
+       $(PATH_TO_MSVCRT)/wstring/wcsxfrm.o \
        wchar/wtoi.o \
        wchar/wcstombs.o \
-       wchar/wcsnicmp.o 
+       $(PATH_TO_MSVCRT)/wstring/wcsnicmp.o 
+
 
 OBJECTS = \
-       $(ASSERT_OBJECTS) \
        $(CONIO_OBJECTS) \
        $(CTYPE_OBJECTS) \
        $(DIRECT_OBJECTS) \
@@ -505,7 +506,7 @@ OBJECTS = \
        $(SYS_STAT_OBJECTS) \
        $(TCHAR_OBJECTS) \
        $(TIME_OBJECTS) \
-       $(WCHAR_OBJECTS)
+       $(WSTRING_OBJECTS)
 
 $(TARGET_NAME).o: $(OBJECTS)
        $(LD) -r $(OBJECTS) -o $(TARGET_NAME).o
index 853385b..af0e219 100644 (file)
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <msvcrt/math.h>
+
 double atan (double __x);
 
 double atan (double __x)
 {
   register double __value;
+#ifdef __GNUC__
   __asm __volatile__
     ("fld1\n\t"
      "fpatan"
      : "=t" (__value) : "0" (__x));
-
+#else
+  __value = linkme_atan(__x);
+#endif /*__GNUC__*/
   return __value;
 }
index f23be33..28079d0 100644 (file)
@@ -1,12 +1,18 @@
+
+#include <msvcrt/math.h>
+
 double atan2 (double __y, double __x);
 
 double atan2 (double __y, double __x)
 {
   register double __value;
+#ifdef __GNUC__
   __asm __volatile__
     ("fpatan\n\t"
      "fld %%st(0)"
      : "=t" (__value) : "0" (__x), "u" (__y));
-
+#else
+  __value = linkme_atan2(__x, __y);
+#endif /*__GNUC__*/
   return __value;
 }
index 2c3ada9..73d4643 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/math.h>
+#include <msvcrt/math.h>
 
 double _cabs( struct _complex z )
 {
index eedff4f..7434cf4 100644 (file)
@@ -1,10 +1,9 @@
-#include <crtdll/math.h>
-
-double ceil (double __x);
+#include <msvcrt/math.h>
 
 double ceil (double __x)
 {
   register double __value;
+#ifdef __GNUC__
   __volatile unsigned short int __cw, __cwtmp;
 
   __asm __volatile ("fnstcw %0" : "=m" (__cw));
@@ -12,7 +11,9 @@ double ceil (double __x)
   __asm __volatile ("fldcw %0" : : "m" (__cwtmp));
   __asm __volatile ("frndint" : "=t" (__value) : "0" (__x));
   __asm __volatile ("fldcw %0" : : "m" (__cw));
-
+#else
+  __value = linkme_ceil(__x);
+#endif /*__GNUC__*/
   return __value;
 }
 
index 07edd8b..981380e 100644 (file)
@@ -1,11 +1,16 @@
+#include <msvcrt/math.h>
+
 double cos (double __x);
 
 double cos (double __x)
 {
   register double __value;
+#ifdef __GNUC__
   __asm __volatile__
     ("fcos"
      : "=t" (__value): "0" (__x));
-
+#else
+  __value = linkme_cos(__x);
+#endif /*__GNUC__*/
   return __value;
 }
index 71df0e0..2707cf8 100644 (file)
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <msvcrt/math.h>
 
 double exp (double __x);
 
 double exp (double __x)
 {
+#ifdef __GNUC__
   register double __value, __exponent;
   __asm __volatile__
     ("fldl2e                    # e^x = 2^(x * log2(e))\n\t"
@@ -39,4 +41,7 @@ double exp (double __x)
      : "=t" (__value) : "0" (__value), "u" (__exponent));
 
   return __value;
+#else
+  return linkme_exp(__x);
+#endif /*__GNUC__*/
 }
index a2a8bdc..5db505a 100644 (file)
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <msvcrt/math.h>
 
 double fabs (double __x);
 
 double fabs (double __x)
 {
   register double __value;
+#ifdef __GNUC__
   __asm __volatile__
     ("fabs"
      : "=t" (__value) : "0" (__x));
-
+#else
+  __value = linkme_fabs(__x);
+#endif /*__GNUC__*/
   return __value;
 }
index 7403a52..b799387 100644 (file)
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <msvcrt/math.h>
 
 double floor (double __x);
 
 double floor (double __x)
 {
   register double __value;
+#ifdef __GNUC__
   __volatile unsigned short int __cw, __cwtmp;
 
   __asm __volatile ("fnstcw %0" : "=m" (__cw));
@@ -31,7 +33,9 @@ double floor (double __x)
   __asm __volatile ("fldcw %0" : : "m" (__cwtmp));
   __asm __volatile ("frndint" : "=t" (__value) : "0" (__x));
   __asm __volatile ("fldcw %0" : : "m" (__cw));
-
+#else
+  __value = linkme_floor(__x);
+#endif /*__GNUC__*/
   return __value;
 }
 
index 5618cf3..263d687 100644 (file)
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <msvcrt/math.h>
 
 double fmod (double __x, double __y);
 
 double fmod (double __x, double __y)
 {
   register double __value;
+#ifdef __GNUC__
   __asm __volatile__
     ("1:        fprem\n\t"
      "fstsw     %%ax\n\t"
      "sahf\n\t"
      "jp        1b"
      : "=t" (__value) : "0" (__x), "u" (__y) : "ax", "cc");
-
+#else
+  __value = linkme_fmod(__x, __y);
+#endif /*__GNUC__*/
   return __value;
 }
index 8b3390d..b85cd98 100644 (file)
@@ -1,6 +1,6 @@
-#include <crtdll/math.h>
-#include <crtdll/stdlib.h>
-#include <crtdll/internal/ieee.h>
+#include <msvcrt/math.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/internal/ieee.h>
 
 double
 frexp(double __x, int *exptr)
index b20aef4..1753090 100644 (file)
@@ -1,5 +1,6 @@
-#include <crtdll/float.h>
+#include <msvcrt/float.h>
 
-long _ftol(double fl) {
+long _ftol(double fl)
+{
        return (long)fl;
 }
index 91eefa0..6b92fcb 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
 
-#include <crtdll/internal/ieee.h>
+#include <msvcrt/internal/ieee.h>
 
 #undef _HUGE
 double_t _HUGE = { 0x00000, 0x00000, 0x7ff, 0x0 };
index 08e3492..aded378 100644 (file)
@@ -16,9 +16,9 @@
  *
  */
  
-#include <crtdll/float.h>
-#include <crtdll/math.h>
-#include <crtdll/errno.h>
+#include <msvcrt/float.h>
+#include <msvcrt/math.h>
+#include <msvcrt/errno.h>
  
 /* Approximate square roots of DBL_MAX and DBL_MIN.  Numbers
    between these two shouldn't neither overflow nor underflow
@@ -78,7 +78,7 @@ _hypot(double x, double y)
  
 #ifdef  TEST
  
-#include <crtdll/stdio.h>
+#include <msvcrt/stdio.h>
  
 int
 main(void)
index 4599fd5..9c60344 100644 (file)
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <msvcrt/math.h>
+
 double ldexp (double __x, int __y);
 
 double ldexp (double __x, int __y)
 {
   register double __value;
+#ifdef __GNUC__
   __asm __volatile__
     ("fscale"
      : "=t" (__value) : "0" (__x), "u" ((double) __y));
-
+#else
+  __value = linkme_ldexp(__x, __y);
+#endif /*__GNUC__*/
   return __value;
 }
index c19c30f..014c78a 100644 (file)
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <msvcrt/math.h>
+
 double log (double __x);
 
 double log (double __x)
 {
   register double __value;
+#ifdef __GNUC__
   __asm __volatile__
     ("fldln2\n\t"
      "fxch\n\t"
      "fyl2x"
      : "=t" (__value) : "0" (__x));
-
+#else
+  __value = linkme_log(__x);
+#endif /*__GNUC__*/
   return __value;
 }
index b57b1a5..58e8cd6 100644 (file)
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <msvcrt/math.h>
 
 double log10 (double __x);
 
 double log10 (double __x)
 {
   register double __value;
+#ifdef __GNUC__
   __asm __volatile__
     ("fldlg2\n\t"
      "fxch\n\t"
      "fyl2x"
      : "=t" (__value) : "0" (__x));
-
+#else
+  __value = linkme_log10(__x);
+#endif /*__GNUC__*/
   return __value;
 }
index 6864e52..71b6151 100644 (file)
@@ -10,9 +10,9 @@
  * ====================================================
  */
 
-#include <crtdll/float.h>
-#include <crtdll/math.h>
-#include <crtdll/internal/ieee.h>
+#include <msvcrt/float.h>
+#include <msvcrt/math.h>
+#include <msvcrt/internal/ieee.h>
 
 
 
index 37810ac..641fda1 100644 (file)
@@ -18,6 +18,8 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <msvcrt/math.h>
+
 double pow (double __x, double __y);
 
 double __log2 (double __x);
@@ -25,18 +27,24 @@ double __log2 (double __x);
 double __log2 (double __x)
 {
   register double __value;
+#ifdef __GNUC__
   __asm __volatile__
     ("fld1\n\t"
      "fxch\n\t"
      "fyl2x"
      : "=t" (__value) : "0" (__x));
-
+#else
+  //__value = linkme_log2(__x);
+  __value = 0;
+#endif /*__GNUC__*/
   return __value;
 }
 
 double pow (double __x, double __y)
 {
-  register double __value, __exponent;
+  register double __value;
+#ifdef __GNUC__
+  register double __exponent;
   long __p = (long) __y;
 
   if (__x == 0.0 && __y > 0.0)
@@ -74,7 +82,9 @@ double pow (double __x, double __y)
   __asm __volatile__
     ("fscale"
      : "=t" (__value) : "0" (__value), "u" (__exponent));
-
+#else
+  __value = linkme_pow(__x, __y);
+#endif /*__GNUC__*/
   return __value;
 }
 
@@ -82,4 +92,3 @@ long double powl (long double __x,long double __y)
 {
        return pow(__x,__y/2)*pow(__x,__y/2);
 }
-
index 80d7630..db070a3 100644 (file)
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <msvcrt/math.h>
 
 double sin (double __x);
 
 double sin (double __x)
 {
   register double __value;
+#ifdef __GNUC__
   __asm __volatile__
     ("fsin"
      : "=t" (__value) : "0" (__x));
-
+#else
+  __value = linkme_sin(__x);
+#endif /*__GNUC__*/
   return __value;
 }
index 7acb21f..5a0b2be 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/math.h>
+#include <msvcrt/math.h>
 
 double sinh(double x)
 {
index a17cec1..d414fcd 100644 (file)
    License along with the GNU C Library; see the file COPYING.LIB.  If not,
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
-
+#include <msvcrt/math.h>
 
 double sqrt (double __x);
 
 double sqrt (double __x)
 {
   register double __value;
+#ifdef __GNUC__
   __asm __volatile__
     ("fsqrt"
      : "=t" (__value) : "0" (__x));
-
+#else
+  __value = linkme_sqrt(__x);
+#endif /*__GNUC__*/
   return __value;
 }
index 2a460a9..1acc036 100644 (file)
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <msvcrt/math.h>
 
 double tan (double __x);
 
 double tan (double __x)
 {
   register double __value;
+#ifdef __GNUC__
   register double __value2 __attribute__ ((unused));
   __asm __volatile__
     ("fptan"
      : "=t" (__value2), "=u" (__value) : "0" (__x));
-
+#else
+  __value = linkme_tan(__x);
+#endif /*__GNUC__*/
   return __value;
 }
index 12b0012..a87337e 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <crtdll/math.h>
+#include <msvcrt/math.h>
 
 double tanh(double x)
 {
index 23df35a..f640d4e 100644 (file)
@@ -9,7 +9,7 @@
  *              12/04/99: Created
  */
 
-#include <crtdll/mbctype.h>
+#include <msvcrt/mbctype.h>
 
 static unsigned short han_to_zen_ascii_table[0x5f] = {
   0x8140, 0x8149, 0x8168, 0x8194, 0x8190, 0x8193, 0x8195, 0x8166,
index b61ff8b..5793a1f 100644 (file)
@@ -8,8 +8,8 @@
                Modified from Taiji Yamada japanese code system utilities
  *              12/04/99: Created
  */
-#include <crtdll/mbstring.h>
-#include <crtdll/mbctype.h>
+#include <msvcrt/mbstring.h>
+#include <msvcrt/mbctype.h>
 
 int _ismbbkana(unsigned char c)      
 {
index 3884552..b9bceac 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/mbctype.h>
+#include <msvcrt/mbctype.h>
 
 int _ismbbkalpha(unsigned char c)
 {
index e515354..a690c17 100644 (file)
@@ -7,7 +7,7 @@
  * UPDATE HISTORY:
  *              12/04/99: Created
  */
-#include <crtdll/mbctype.h>
+#include <msvcrt/mbctype.h>
 
 int _ismbbkpunct( unsigned int c )
 {
index 6026c34..08ff0a6 100644 (file)
@@ -1,5 +1,5 @@
 #include <windows.h>
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 
 int isleadbyte(char *mbstr)
 {
index f64eade..01c9cf4 100644 (file)
@@ -8,8 +8,8 @@
  *              12/04/99: Created
  */
 
-#include <crtdll/mbctype.h>
-#include <crtdll/ctype.h>
+#include <msvcrt/mbctype.h>
+#include <msvcrt/ctype.h>
 
 // code page 952 only
 int _ismbclower( unsigned int c )
index d62d5d1..ee14c43 100644 (file)
@@ -7,10 +7,8 @@
  * UPDATE HISTORY:
  *              12/04/99: Created
  */
-#include <crtdll/mbctype.h>
-#include <crtdll/ctype.h>
-
-int _ismbbkalnum( unsigned int c );
+#include <msvcrt/mbctype.h>
+#include <msvcrt/ctype.h>
 
 int _ismbbalpha(unsigned char c)
 {
index 2c85873..622a87b 100644 (file)
@@ -1,7 +1,6 @@
-#include <crtdll/mbctype.h>
-#include <crtdll/ctype.h>
+#include <msvcrt/mbctype.h>
+#include <msvcrt/ctype.h>
 
-int _ismbbkalnum( unsigned int c );
 
 int _ismbbalnum(unsigned char c)
 {
index ad8c8c6..deed653 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 
 int _ismbbalpha(unsigned char c);
 int _ismbbalnum(unsigned char c);
index 6b3469f..f0ec05b 100644 (file)
@@ -1,6 +1,6 @@
-#include <crtdll/mbstring.h>
-#include <crtdll/mbctype.h>
-#include <crtdll/ctype.h>
+#include <msvcrt/mbstring.h>
+#include <msvcrt/mbctype.h>
+#include <msvcrt/ctype.h>
 
 int _ismbbgraph(unsigned char c)
 {
index 64340ab..f4e5bc8 100644 (file)
@@ -7,8 +7,8 @@
  * UPDATE HISTORY:
  *              12/04/99: Created
  */
-#include <crtdll/mbctype.h>
-#include <crtdll/ctype.h>
+#include <msvcrt/mbctype.h>
+#include <msvcrt/ctype.h>
 
 int _ismbbkalnum( unsigned int c )
 {
index 9282210..f15f3ec 100644 (file)
@@ -9,9 +9,9 @@
  *              12/04/99: Created
  */
 
-#include <crtdll/mbstring.h>
-#include <crtdll/stdlib.h>
-#include <crtdll/mbctype.h>
+#include <msvcrt/mbstring.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/mbctype.h>
 
 size_t _mbclen2(const unsigned int s);
 
index 76d4075..dcd997d 100644 (file)
@@ -1,6 +1,6 @@
-#include <crtdll/mbstring.h>
-#include <crtdll/mbctype.h>
-#include <crtdll/ctype.h>
+#include <msvcrt/mbstring.h>
+#include <msvcrt/mbctype.h>
+#include <msvcrt/ctype.h>
 
 int _ismbbprint(unsigned char c)
 {
index f6d7b40..aeeff7e 100644 (file)
@@ -8,8 +8,8 @@
  *              12/04/99: Created
  */
 
-#include <crtdll/mbstring.h>
-#include <crtdll/mbctype.h>
+#include <msvcrt/mbstring.h>
+#include <msvcrt/mbctype.h>
 
 size_t _mbclen2(const unsigned int s);
 
index 05afc64..110b9a8 100644 (file)
@@ -8,8 +8,8 @@
  *              12/04/99: Created
  */
 
-#include <crtdll/mbctype.h>
-#include <crtdll/ctype.h>
+#include <msvcrt/mbctype.h>
+#include <msvcrt/ctype.h>
 
 // code page 952 only
 int _ismbcupper( unsigned int c )
index a34e311..c05d80e 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 
 unsigned short _mbcjistojms(unsigned short c)
 {
index f3496aa..62c948d 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 
 unsigned short _mbcjmstojis(unsigned short c)
 {
index 06d6de8..6ecb193 100644 (file)
@@ -8,8 +8,8 @@
  *              12/04/99: Created
  */
 
-#include <crtdll/mbstring.h>
-#include <crtdll/mbctype.h>
+#include <msvcrt/mbstring.h>
+#include <msvcrt/mbctype.h>
 
 int _mbbtype(unsigned char c , int type)
 {
index d78af8d..fe05428 100644 (file)
@@ -1,5 +1,5 @@
-#include <crtdll/mbstring.h>
-#include <crtdll/string.h>
+#include <msvcrt/mbstring.h>
+#include <msvcrt/string.h>
 
 size_t _mbclen2(const unsigned int s);
 
index c579932..c4286e2 100644 (file)
@@ -1,6 +1,5 @@
-#include <crtdll/mbstring.h>
-
-#include <crtdll/stdlib.h>
+#include <msvcrt/mbstring.h>
+#include <msvcrt/stdlib.h>
 
 
 size_t _mbclen(const unsigned char *s)
index 62b3d05..4212308 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/string.h>
+#include <msvcrt/string.h>
 
 unsigned char * _mbscat(unsigned char *dst, const unsigned char *src)
 {
index f9be9c8..9e73aee 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/string.h>
+#include <msvcrt/string.h>
 
 unsigned char * _mbschr(const unsigned char *str, unsigned int c)
 {
index ad48d16..ad2a133 100644 (file)
@@ -1,5 +1,5 @@
-#include <crtdll/mbstring.h>
-#include <crtdll/string.h>
+#include <msvcrt/mbstring.h>
+#include <msvcrt/string.h>
 
 int _mbscmp(const unsigned char *str1, const unsigned char *str2)
 {
index d3236cd..062413f 100644 (file)
@@ -8,7 +8,7 @@
  *              12/04/99: Created
  */
 
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 
 int colldif(unsigned short c1, unsigned short c2);
 
index 1c66e61..c904566 100644 (file)
@@ -1,5 +1,5 @@
-#include <crtdll/mbstring.h>
-#include <crtdll/string.h>
+#include <msvcrt/mbstring.h>
+#include <msvcrt/string.h>
 
 unsigned char * _mbscpy(unsigned char *dst, const unsigned char *str)
 {
index 055adce..63f3f35 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 // not correct
 size_t _mbscspn(const unsigned char *s1, const unsigned char *s2)
 {
index 00b58f3..0836f15 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 
 unsigned char * _mbsdec(const unsigned char *str, const unsigned char *cur)
 {
index ac50252..00dc9d0 100644 (file)
@@ -9,8 +9,8 @@
  *              12/04/99: Created
  */
 
-#include <crtdll/mbstring.h>
-#include <crtdll/stdlib.h>
+#include <msvcrt/mbstring.h>
+#include <msvcrt/stdlib.h>
 
 unsigned char * _mbsdup(const unsigned char *_s)
 {
index f8103c5..db88fed 100644 (file)
@@ -7,9 +7,9 @@
  * UPDATE HISTORY:
  *              12/04/99: Created
  */
-#include <crtdll/mbstring.h>
-#include <crtdll/mbctype.h>
-#include <crtdll/ctype.h>
+#include <msvcrt/mbstring.h>
+#include <msvcrt/mbctype.h>
+#include <msvcrt/ctype.h>
 
 int _mbsicmp(const unsigned char *str1, const unsigned char *str2)
 {
index 6b2da15..426880e 100644 (file)
@@ -7,9 +7,9 @@
  * UPDATE HISTORY:
  *              12/04/99: Created
  */
-#include <crtdll/mbstring.h>
-#include <crtdll/mbctype.h>
-#include <crtdll/ctype.h>
+#include <msvcrt/mbstring.h>
+#include <msvcrt/mbctype.h>
+#include <msvcrt/ctype.h>
 int colldif(unsigned short c1, unsigned short c2);
 int _mbsicoll(const unsigned char *str1, const unsigned char *str2)
 {
index d062006..30e42e9 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 
 unsigned char * _mbsinc(const unsigned char *s)
 {
index 3eca134..06386b2 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 
 size_t _mbclen2(const unsigned int s);
 
index cdbdf5f..67663ea 100644 (file)
@@ -1,5 +1,5 @@
-#include <crtdll/mbstring.h>
-#include <crtdll/ctype.h>
+#include <msvcrt/mbstring.h>
+#include <msvcrt/ctype.h>
 
 unsigned int _mbbtolower(unsigned int c)
 {
@@ -7,34 +7,33 @@ unsigned int _mbbtolower(unsigned int c)
                return tolower(c);
        return c;
 }
+
 // code page 952
 #define CASE_DIFF (0x8281 - 0x8260)
 
 unsigned int _mbctolower(unsigned int c)
 {
-
-        if ((c & 0xFF00) != 0) {
-// true multibyte case conversion needed
-               if ( _ismbclower(c) )
-                       return c + CASE_DIFF;
-
-        } else
-               return _mbbtolower(c);
-
-       return 0;
+    if ((c & 0xFF00) != 0) {
+        // true multibyte case conversion needed
+        if (_ismbclower(c))
+            return c + CASE_DIFF;
+    } else {
+     return _mbbtolower(c);
+    }
+    return 0;
 }
 
 unsigned char * _mbslwr(unsigned char *x)
 {
-        unsigned char  *y=x;
+    unsigned char  *y=x;
 
-         while (*y) {
-               if (!_ismbblead(*y) )
-                       *y = tolower(*y);
-               else {
-                       *y=_mbctolower(*(unsigned short *)y);
-                       y++;
-               }
+    while (*y) {
+        if (!_ismbblead(*y)) {
+            *y = tolower(*y);
+           } else {
+               *y=_mbctolower(*(unsigned short *)y);
+               y++;
         }
-        return x;
+    }
+    return x;
 }
index 9cc580f..22bee36 100644 (file)
@@ -8,8 +8,8 @@
  *              12/04/99: Created
  */
 
-#include <crtdll/mbstring.h>
-#include <crtdll/string.h>
+#include <msvcrt/mbstring.h>
+#include <msvcrt/string.h>
 
 size_t _mbclen2(const unsigned int s);
 
index 1e30c9b..daa4484 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 
 size_t _mbsnccnt(const unsigned char *str, size_t n)
 {
index 00bd789..8e1011b 100644 (file)
@@ -8,7 +8,7 @@
  *              12/04/99: Created
  */
 
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 
 int _mbsncmp(const unsigned char *str1, const unsigned char *str2, size_t n)
 {
index 157f4ef..1a35922 100644 (file)
@@ -7,7 +7,7 @@
  * UPDATE HISTORY:
  *              12/04/99: Created
  */
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 
 int colldif(unsigned short c1, unsigned short c2);
 
index 41fe445..a2e21c0 100644 (file)
@@ -8,7 +8,7 @@
  *              12/04/99: Created
  */
 
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 
 unsigned char *_mbsncpy(unsigned char *str1, const unsigned char *str2, size_t n)
 {
index 5d3bb0a..3c3a254 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 
 unsigned int _mbsnextc (const unsigned char *src)
 {
index 4b066e8..8697c75 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 
 int _mbsnicoll(const unsigned char *s1, const unsigned char *s2, size_t n)
 {
index 3fb1235..6ce0f7c 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 
 unsigned char * _mbsninc(const unsigned char *str, size_t n)
 {
index 6c78d31..75befef 100644 (file)
@@ -7,7 +7,7 @@
  * UPDATE HISTORY:
  *              12/04/99: Created
  */
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 
 size_t _mbclen2(const unsigned int s);
 
index 7b6e327..0e36d10 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 // not correct
 unsigned char * _mbspbrk(const unsigned char *s1, const unsigned char *s2)
 {
index 824e639..3a2a8d6 100644 (file)
@@ -8,7 +8,7 @@
  *              12/04/99: Created
  */
 
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 
 size_t _mbclen2(const unsigned int s);
 
index 57cc335..5509c9d 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 
 unsigned char * _mbsrev(unsigned char *s)
 {
index e840ed4..4c6f14c 100644 (file)
@@ -8,7 +8,7 @@
  *              12/04/99: Created
  */
 
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 
 size_t _mbclen2(const unsigned int s);
 
index 6ad7fef..4a1bbd7 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 // not correct
 size_t _mbsspn(const unsigned char *s1, const unsigned char *s2)
 {
index d8ec9e1..4e0e6e3 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 // not correct
 unsigned char * _mbsspnp(const unsigned char *s1, const unsigned char *s2)
 {
index 321b36b..089eb13 100644 (file)
@@ -1,5 +1,5 @@
-#include <crtdll/mbstring.h>
-#include <crtdll/stdlib.h>
+#include <msvcrt/mbstring.h>
+#include <msvcrt/stdlib.h>
 
 unsigned char *_mbsstr(const unsigned char *src1,const unsigned char *src2)
 {
index 538b856..3c68097 100644 (file)
@@ -1,4 +1,4 @@
-#include <crtdll/mbstring.h>
+#include <msvcrt/mbstring.h>
 
 unsigned char * _mbstok(unsigned char *s, unsigned char *delim)
 {
index 7cfd19f..aa35677 100644 (file)
@@ -1,5 +1,5 @@
-#include <crtdll/mbstring.h>
-#include <crtdll/stdlib.h>
+#include <msvcrt/mbstring.h>
+#include <msvcrt/stdlib.h>
 
 size_t _mbstrlen( const char *string )
 {
index 90e5b0f..46d0b4a 100644 (file)
@@ -7,8 +7,8 @@
  * UPDATE HISTORY:
  *              12/04/99: Created
  */
-#include <crtdll/mbstring.h>
-#include <crtdll/ctype.h>
+#include <msvcrt/mbstring.h>
+#include <msvcrt/ctype.h>
 
 unsigned int _mbbtoupper(unsigned int c)
 {
index 1b9a9d9..c20e700 100644 (file)
@@ -1,6 +1,6 @@
 #include <windows.h>
-#include <crtdll/stdlib.h>
-#include <crtdll/string.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/string.h>
 
 
 char *_pgmptr_dll;
index 3ea80ee..02d53fc 100644 (file)
@@ -1,24 +1,24 @@
 /*
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS system libraries
- * FILE:        lib/crtdll/conio/kbhit.c
- * PURPOSE:     Checks for keyboard hits
+ * FILE:        lib/crtdll/misc/amsg.c
+ * PURPOSE:     Print runtime error messages
  * PROGRAMER:   Boudewijn Dekker
  * UPDATE HISTORY:
  *              28/12/98: Created
  */
-#include <crtdll/stdlib.h>
-#include <crtdll/stdio.h>
-#include <crtdll/string.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/string.h>
 
-int  _aexit_rtn_dll(int exitcode)
+int _aexit_rtn_dll(int exitcode)
 {
        _exit(exitcode);
 }
 
-void _amsg_exit (int errnum)
+void _amsg_exit(int errnum)
 {
        fprintf(stderr,strerror(errnum));
-        _aexit_rtn_dll(-1);      
+    _aexit_rtn_dll(-1);      
 }
 
diff --git a/reactos/lib/crtdll/misc/assert.c b/reactos/lib/crtdll/misc/assert.c
new file mode 100644 (file)
index 0000000..0469371
--- /dev/null
@@ -0,0 +1,13 @@
+/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
+#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)
+{
+    /* Assertion failed at foo.c line 45: x<y */
+    fprintf(stderr, "Assertion failed at %s line %d: %s\n", file, line, msg);
+    raise(SIGABRT);
+}
index 0f6f902..88b3199 100644 (file)
  *  DISCLAMED. This includes but is not limited to warrenties of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Revision: 1.3 $
- * $Author: ariadne $
- * $Date: 1999/04/23 18:42:21 $
+ * $Revision: 1.4 $
+ * $Author: robd $
+ * $Date: 2002/11/24 18:42:15 $
  *
  */
 
-#include <crtdll/stdlib.h>
-#include <crtdll/stdio.h>
-#include <crtdll/io.h>
-#include <crtdll/fcntl.h>
-#include <crtdll/process.h>
-#include <crtdll/float.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/io.h>
+#include <msvcrt/fcntl.h>
+#include <msvcrt/process.h>
+#include <msvcrt/float.h>
 #include <windows.h>
 
 /* NOTE: The code for initializing the _argv, _argc, and environ variables
diff --git a/reactos/lib/crtdll/misc/debug.c b/reactos/lib/crtdll/misc/debug.c
new file mode 100644 (file)
index 0000000..16b94a5
--- /dev/null
@@ -0,0 +1,19 @@
+#include <windows.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+
+
+void debug_printf(char* fmt, ...)
+{
+   va_list args;
+   char buffer[255];
+   HANDLE OutputHandle;
+   
+   AllocConsole();
+   OutputHandle = GetStdHandle(STD_OUTPUT_HANDLE);
+   va_start(args,fmt);
+   vsprintf(buffer,fmt,args);
+   WriteConsoleA(OutputHandle, buffer, strlen(buffer), NULL, NULL);
+   va_end(args);
+}
index afadcf5..9812d49 100644 (file)
@@ -1,4 +1,5 @@
-/*
+/* $Id: dllmain.c,v 1.5 2002/11/24 18:42:15 robd Exp $
+ *
  * dllmain.c
  *
  * A stub DllMain function which will be called by DLLs which do not
  *  DISCLAMED. This includes but is not limited to warrenties of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Revision: 1.4 $
- * $Author: ekohl $
- * $Date: 1999/04/29 23:34:23 $
+ * $Revision: 1.5 $
+ * $Author: robd $
+ * $Date: 2002/11/24 18:42:15 $
  *
  */
 
 #include <windows.h>
 #include <stdarg.h>
-#include <stdio.h>
+#include <msvcrt/stdio.h>
 #include <string.h>
 
-void debug_printf(char* fmt, ...)
-{
-   va_list args;
-   char buffer[255];
-   HANDLE OutputHandle;
-   
-   AllocConsole();
-   OutputHandle = GetStdHandle(STD_OUTPUT_HANDLE);
-   va_start(args,fmt);
-   vsprintf(buffer,fmt,args);
-   WriteConsoleA(OutputHandle, buffer, strlen(buffer), NULL, NULL);
-   va_end(args);
-}
 
-BOOL WINAPI DllMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
+/* EXTERNAL PROTOTYPES ********************************************************/
+
+void debug_printf(char* fmt, ...);
+
+
+/* LIBRARY GLOBAL VARIABLES ***************************************************/
+
+int __mb_cur_max_dll = 1;
+int _commode_dll = _IOCOMMIT;
+
+
+/* LIBRARY ENTRY POINT ********************************************************/
+
+BOOL
+WINAPI
+DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
 {
        return TRUE;
 }
 
+/* EOF */
index 62e8b90..7bfd0df 100644 (file)
@@ -19,9 +19,9 @@
  *  DISCLAMED. This includes but is not limited to warrenties of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Revision: 1.3 $
- * $Author: ariadne $
- * $Date: 1999/04/23 18:42:21 $
+ * $Revision: 1.4 $
+ * $Author: robd $
+ * $Date: 2002/11/24 18:42:15 $
  *
  */
 
@@ -29,8 +29,8 @@
  * Access to a standard 'main'-like argument count and list. Also included
  * is a table of environment variables.
  */
-int    _argc = 0;
-char** _argv = 0;
+int _argc = 0;
+char**  _argv = 0;
 
 /* NOTE: Thanks to Pedro A. Aranda Gutiirrez <paag@tid.es> for pointing
  * this out to me. GetMainArgs (used below) takes a fourth argument
@@ -44,13 +44,9 @@ char**       _argv = 0;
  * defining _CRT_glob and setting it to zero, like this:
  *  int _CRT_glob = 0;
  */
-extern int     _CRT_glob;
+extern int  _CRT_glob;
 
-#ifdef __MSVCRT__
-extern void __getmainargs(int *, char***, char***, int);
-#else
 extern void __GetMainArgs(int *, char***, char***, int);
-#endif
 
 /*
  * Initialize the _argc, _argv and environ variables.
@@ -58,18 +54,18 @@ extern void __GetMainArgs(int *, char***, char***, int);
 static void
 _mingw32_init_mainargs (void)
 {
-       /* The environ variable is provided directly in stdlib.h through
-        * a dll function call. */
-       char**  dummy_environ;
+    /* The environ variable is provided directly in stdlib.h through
+     * a dll function call. */
+    char**  dummy_environ;
 
-       /*
-        * Microsoft's runtime provides a function for doing just that.
-        */
-#ifdef __MSVCRT__
-       (void) __getmainargs(&_argc, &_argv, &dummy_environ, _CRT_glob);
+    /*
+     * Microsoft's runtime provides a function for doing just that.
+     */
+#ifdef _MSVCRT_LIB_
+    (void) __getmainargs(&_argc, &_argv, &dummy_environ, _CRT_glob);
 #else
-       /* CRTDLL version */
-       (void) __GetMainArgs(&_argc, &_argv, &dummy_environ, _CRT_glob);
+    /* CRTDLL version */
+    (void) __GetMainArgs(&_argc, &_argv, &dummy_environ, _CRT_glob);
 #endif
 }
 
index c834b61..c71da89 100644 (file)
@@ -1,14 +1,10 @@
-#include <crtdll/stdlib.h>
+#include <msvcrt/stdlib.h>
 
 
-void  _initterm (
-        void (* fStart[])(void),
-        void (* fEnd[])(void)
-        )
+void _initterm(void (*fStart[])(void), void (*fEnd[])(void))
 {
        int i = 0;
 
-
        if ( fStart == NULL || fEnd == NULL )
                return;
 
@@ -19,13 +15,11 @@ void  _initterm (
                i++;
        }
 }
+
+
 typedef int (* _onexit_t)(void);
 
-_onexit_t __dllonexit (
-        _onexit_t func,
-       void (** fStart[])(void),
-        void (** fEnd[])(void)
-        )
+_onexit_t __dllonexit(_onexit_t func, void (** fStart[])(void),        void (** fEnd[])(void))
 {
 }
 
index f6d5b67..4a4fbbc 100644 (file)
@@ -1,4 +1,5 @@
-/*
+/* $Id: _system.c,v 1.6 2002/11/24 18:42:15 robd Exp $
+ *
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS system libraries
  * FILE:        lib/crtdll/process/system.c
@@ -8,9 +9,9 @@
  *              04/03/99: Created
  */
 #include <windows.h>
-#include <crtdll/stdlib.h>
-#include <crtdll/string.h>
-#include <crtdll/process.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/string.h>
+#include <msvcrt/process.h>
 
 int system(const char *command)
 {
index 1d05476..132869e 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <crtdll/process.h>
-#include <crtdll/stdlib.h>
+#include <msvcrt/process.h>
+#include <msvcrt/stdlib.h>
 #include <stdarg.h>
 
 int _execl(const char* szPath, const char* szArgv0, ...)
index f907798..5ccacf6 100644 (file)
@@ -1,6 +1,6 @@
-#include <crtdll/process.h>
-#include <crtdll/stdlib.h>
-#include <crtdll/stdarg.h>
+#include <msvcrt/process.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/stdarg.h>
 
 
 // fixme rewrite to pass the array variants to va_list variant
index 1b97589..00384c6 100644 (file)
@@ -1,6 +1,6 @@
-#include <crtdll/process.h>
-#include <crtdll/stdlib.h>
-#include <crtdll/stdarg.h>
+#include <msvcrt/process.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/stdarg.h>
 
 int _execlp(const char *szPath, const char *szArgv0, ...)
 {
index 785dff0..e6e6f21 100644 (file)
@@ -1,6 +1,6 @@
-#include <crtdll/process.h>
-#include <crtdll/stdlib.h>
-#include <crtdll/stdarg.h>
+#include <msvcrt/process.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/stdarg.h>
 
 
 int execlpe(const char *path, const char *szArgv0, ... /*, const char **envp */)
index d1d2bb8..01cc594 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <crtdll/process.h>
-#include <crtdll/stdlib.h>
+#include <msvcrt/process.h>
+#include <msvcrt/stdlib.h>
 
 int _execv(const char* szPath, char* const* szaArgv)
 {
index 7dd5a22..72ce3bd 100644 (file)
@@ -1,7 +1,7 @@
-/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details *///#include <crtdll/stubs.h>
-//#include <crtdll/unistd.h>
-#include <crtdll/process.h>
-#include <crtdll/stdlib.h>
+/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details *///#include <msvcrt/stubs.h>
+//#include <msvcrt/unistd.h>
+#include <msvcrt/process.h>
+#include <msvcrt/stdlib.h>
 
 int _execvp(const char* szPath, char* const* szaArgv)
 {
index b7393eb..c894f5f 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
 
 
-#include <crtdll/process.h>
+#include <msvcrt/process.h>
 
 int _execvpe(const char* szPath, char* const* szaArgv, char* const* szaEnv)
 {
index 26e92cb..6d8f8a6 100644 (file)
@@ -1,5 +1,5 @@
 #include <windows.h>
-#include <crtdll/process.h>
+#include <msvcrt/process.h>
 
 int _getpid (void)
 {
index 58ed2ed..4e95080 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <crtdll/process.h>
-#include <crtdll/stdlib.h>
+#include <msvcrt/process.h>
+#include <msvcrt/stdlib.h>
 #include <stdarg.h>
 
 int _spawnlp(int nMode, const char* szPath, const char* szArgv0, ...)
index cfd73f9..81abee8 100644 (file)
@@ -1,6 +1,6 @@
-#include <crtdll/process.h>
-#include <crtdll/stdlib.h>
-#include <crtdll/stdarg.h>
+#include <msvcrt/process.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/stdarg.h>
 
 
 int _spawnlpe(int mode, const char *path, const char *szArgv0, ... /*, const char **envp */)
index cf25274..e497112 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <crtdll/process.h>
-#include <crtdll/stdlib.h>
+#include <msvcrt/process.h>
+#include <msvcrt/stdlib.h>
 
 int _spawnv(int nMode, const char* szPath, char* const* szaArgv)
 {
index 1b698b9..5e2c193 100644 (file)
@@ -3,15 +3,13 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
 #include <windows.h>
-
-#include <crtdll/stdio.h>
-#include <crtdll/stdlib.h>
-#include <crtdll/string.h>
-#include <crtdll/errno.h>
-//#include <crtdll/limits.h>
-#include <crtdll/process.h>
-#include <crtdll/ctype.h>
-#include <crtdll/io.h>
+#include <msvcrt/stdio.h>
+#include <msvcrt/stdlib.h>
+#include <msvcrt/string.h>
+#include <msvcrt/errno.h>
+#include <msvcrt/process.h>
+#include <msvcrt/ctype.h>
+#include <msvcrt/io.h>
 
 
 #ifndef F_OK
 int _fileinfo_dll = 0;
 
 static int
-direct_exec_tail(const char *program, const char *args,
-                char * const envp[],
-               PROCESS_INFORMATION *ProcessInformation)
+direct_exec_tail(const char* program, const char* args,
+                 char* const envp[],
+                 PROCESS_INFORMATION* ProcessInformation)
 {
-
-       static STARTUPINFO StartupInfo;
-
-       StartupInfo.cb = sizeof(STARTUPINFO);
-       StartupInfo.lpReserved= NULL;
-       StartupInfo.dwFlags = 0;
-       StartupInfo.wShowWindow = SW_SHOWDEFAULT; 
-       StartupInfo.lpReserved2 = NULL;
-       StartupInfo.cbReserved2 = 0; 
-
-
-       if (! CreateProcessA((char *)program,(char *)args,NULL,NULL,FALSE,0,(char **)envp,NULL,&StartupInfo,ProcessInformation) ) 
-       {
-         __set_errno( GetLastError() );
-          return -1;
-       }
-
-       return (int)ProcessInformation->hProcess;
+    static STARTUPINFO StartupInfo;
+
+    StartupInfo.cb = sizeof(STARTUPINFO);
+    StartupInfo.lpReserved= NULL;
+    StartupInfo.dwFlags = 0;
+    StartupInfo.wShowWindow = SW_SHOWDEFAULT; 
+    StartupInfo.lpReserved2 = NULL;
+    StartupInfo.cbReserved2 = 0; 
+    if (!CreateProcessA((char*)program,(char*)args,NULL,NULL,FALSE,0,(char**)envp,NULL,&StartupInfo,ProcessInformation)) {
+        __set_errno( GetLastError() );
+        return -1;
+    }
+    return (int)ProcessInformation->hProcess;
 }
 
-static int vdm_exec(const char *program, char **argv, char **envp,
-       PROCESS_INFORMATION *ProcessInformation)
+static int vdm_exec(const char* program, char** argv, char** envp,
+                    PROCESS_INFORMATION* ProcessInformation)
 {
-       static char args[1024];
-       int i = 0;
-       args[0] = 0;
-
-       strcpy(args,"vdm.exe ");
-       while(argv[i] != NULL ) {
-        strcat(args,argv[i]);
-        strcat(args," ");
+    static char args[1024];
+    int i = 0;
+    args[0] = 0;
+
+    strcpy(args, "vdm.exe ");
+    while (argv[i] != NULL) {
+        strcat(args, argv[i]);
+        strcat(args, " ");
         i++; 
-       }
-  
-       return direct_exec_tail(program,args,envp,ProcessInformation);
+    }
+    return direct_exec_tail(program,args,envp,ProcessInformation);
 }
 
-static int go32_exec(const char *program, char **argv, char **envp,
-       PROCESS_INFORMATION *ProcessInformation)
+static int go32_exec(const char* program, char** argv, char** envp,
+                     PROCESS_INFORMATION* ProcessInformation)
 {
-
-
-       static char args[1024];
-       static char envblock[2048];
-       char * penvblock;
-       int i = 0;
-
-
-       envblock[0] = 0;
-       penvblock=envblock;
-
-       while(envp[i] != NULL ) {
+    static char args[1024];
+    static char envblock[2048];
+    char* penvblock;
+    int i = 0;
+
+    envblock[0] = 0;
+    penvblock=envblock;
+    while(envp[i] != NULL ) {
           strcat(penvblock,envp[i]);
-         penvblock+=strlen(envp[i])+1;
+          penvblock+=strlen(envp[i])+1;
           i++; 
-       }
-       penvblock[0]=0;
-
-       args[0] = 0;
-        i = 0;
-       while(argv[i] != NULL ) {
+    }
+    penvblock[0]=0;
+    args[0] = 0;
+    i = 0;
+    while(argv[i] != NULL ) {
           strcat(args,argv[i]);
           strcat(args," ");
           i++; 
-       }
-  
-       return direct_exec_tail(program,args,envp,ProcessInformation);
+    }
+    return direct_exec_tail(program,args,envp,ProcessInformation);
 }
 
-int
-command_exec(const char *program, char **argv, char **envp,
-       PROCESS_INFORMATION *ProcessInformation)
+int command_exec(const char* program, char** argv, char** envp,
+                 PROCESS_INFORMATION* ProcessInformation)
 {
-       static char args[1024];
-       int i = 0;
-
-
+    static char args[1024];
+    int i = 0;
 
-       args[0] = 0;
-
-       strcpy(args,"cmd.exe  /c ");
-       while(argv[i] != NULL ) {
+    args[0] = 0;
+    strcpy(args,"cmd.exe  /c ");
+    while(argv[i] != NULL ) {
         strcat(args,argv[i]);
         strcat(args," ");
         i++; 
-       }
-  
-       return direct_exec_tail(program,args,envp,ProcessInformation);
-
+    }
+    return direct_exec_tail(program,args,envp,ProcessInformation);
 }
 
-static int script_exec(const char *program, char **argv, char **envp,
-       PROCESS_INFORMATION *ProcessInformation)
+static int script_exec(const char* program, char** argv, char** envp,
+                       PROCESS_INFORMATION* ProcessInformation)
 {
-       return 0;
+    return 0;
 }
 
 
@@ -141,23 +121,22 @@ static int script_exec(const char *program, char **argv, char **envp,
    those extensions that can be *omitted* when you invoke the
    executable from one of the shells used on MSDOS.  */
 static struct {
-  const char *extension;
-  int (*interp)(const char *, char **, char **,
-       PROCESS_INFORMATION *);
+    const char* extension;
+    int (*interp)(const char*, char**, char**, PROCESS_INFORMATION*);
 } interpreters[] = {
-       { ".com", vdm_exec },
-       { ".exe", go32_exec },
-       { ".dll", go32_exec },
-       { ".cmd", command_exec },
-       { ".bat", command_exec },
-       { ".btm", command_exec },
-       { ".sh",  script_exec },  /* for compatibility with ms_sh */
-       { ".ksh", script_exec },
-       { ".pl", script_exec },   /* Perl */
-       { ".sed", script_exec },
-       { "",     go32_exec },
-       { 0,      script_exec },  /* every extension not mentioned above calls it */
-       { 0,      0 },
+    { ".com", vdm_exec },
+    { ".exe", go32_exec },
+    { ".dll", go32_exec },
+    { ".cmd", command_exec },
+    { ".bat", command_exec },
+    { ".btm", command_exec },
+    { ".sh",  script_exec },   /* for compatibility with ms_sh */
+    { ".ksh", script_exec },
+    { ".pl",  script_exec },   /* Perl */
+    { ".sed", script_exec },
+    { "",     go32_exec },
+    { 0,      script_exec },   /* every extension not mentioned above calls it */
+    { 0,      0 },
 };
 
 /* This is the index into the above array of the interpreter
@@ -166,173 +145,143 @@ static struct {
 
 /*-------------------------------------------------*/
 
-
-
-
-int _spawnve(int mode, const char *path, char *const argv[], char *const envp[])
+int _spawnve(int mode, const char* path, char* const argv[], char* const envp[])
 {
-  /* This is the one that does the work! */
-  PROCESS_INFORMATION ProcessInformation;
-  union { char *const *x; char **p; } u;
-  int i = -1;
-  char **argvp;
-  char **envpp;
-  char rpath[FILENAME_MAX], *rp, *rd=0;
-  int e = errno;
-  int is_dir = 0;
-  int found = 0;
-  DWORD ExitCode;
-
-  if (path == 0 || argv[0] == 0)
-  {
-    errno = EINVAL;
-    return -1;
-  }
-  if (strlen(path) > FILENAME_MAX - 1)
-  {
-    errno = ENAMETOOLONG;
-    return -1;
-  }
-
-  u.x = argv; argvp = u.p;
-  u.x = envp; envpp = u.p;
-
-  fflush(stdout); /* just in case */
-  for (rp=rpath; *path; *rp++ = *path++)
-  {
+    /* This is the one that does the work! */
+    PROCESS_INFORMATION ProcessInformation;
+    union { char* const* x; char** p; } u;
+    int i = -1;
+    char** argvp;
+    char** envpp;
+    char rpath[FILENAME_MAX], *rp, *rd = 0;
+    int e = errno;
+    int is_dir = 0;
+    int found = 0;
+    DWORD ExitCode;
+
+    if (path == 0 || argv[0] == 0) {
+        errno = EINVAL;
+        return -1;
+    }
+    if (strlen(path) > FILENAME_MAX - 1) {
+        errno = ENAMETOOLONG;
+        return -1;
+    }
+    u.x = argv; argvp = u.p;
+    u.x = envp; envpp = u.p;
+    fflush(stdout); /* just in case */
+    for (rp=rpath; *path; *rp++ = *path++) {
     if (*path == '.')
-      rd = rp;
-    if (*path == '\\' || *path == '/')
-      rd = 0;
-  }
-  *rp = 0;
-
-  /* If LFN is supported on the volume where rpath resides, we
-     might have something like foo.bar.exe or even foo.exe.com.
-     If so, look for RPATH.ext before even trying RPATH itself. */
-  if (!rd)
-  {
-    for (i=0; interpreters[i].extension; i++)
-    {
-      strcpy(rp, interpreters[i].extension);
-      if (_access(rpath, F_OK) == 0 && !(is_dir = (_access(rpath, D_OK) == 0)))
-      {
-       found = 1;
-       break;
-      }
+        rd = rp;
+        if (*path == '\\' || *path == '/')
+            rd = 0;
+    }
+    *rp = 0;
+
+    /* If LFN is supported on the volume where rpath resides, we
+       might have something like foo.bar.exe or even foo.exe.com.
+       If so, look for RPATH.ext before even trying RPATH itself. */
+    if (!rd) {
+        for (i=0; interpreters[i].extension; i++) {
+            strcpy(rp, interpreters[i].extension);
+            if (_access(rpath, F_OK) == 0 && !(is_dir = (_access(rpath, D_OK) == 0))) {
+                found = 1;
+                break;
+            }
+        }
     }
-  }
 
-  if (!found)
-  {
-    const char *rpath_ext;
+    if (!found) {
+        const char *rpath_ext;
 
-    if (rd)
-    {
-      i = 0;
-      rpath_ext = rd;
+        if (rd) {
+            i = 0;
+            rpath_ext = rd;
+        } else {
+            i = INTERP_NO_EXT;
+            rpath_ext = "";
+        }
+        for ( ; interpreters[i].extension; i++)
+            if (_stricmp(rpath_ext, interpreters[i].extension) == 0
+                && _access(rpath, F_OK) == 0
+                && !(is_dir = (_access(rpath, D_OK) == 0)))
+            {
+                found = 1;
+                break;
+            }
+    }
+    if (!found) {
+        errno = is_dir ? EISDIR : ENOENT;
+        return -1;
     }
-    else
-    {
-      i = INTERP_NO_EXT;
-      rpath_ext = "";
+    errno = e;
+    i = interpreters[i].interp(rpath, argvp, envpp, &ProcessInformation);
+    if (mode == P_OVERLAY)
+        exit(i);
+    if (mode == P_WAIT) {
+        WaitForSingleObject(ProcessInformation.hProcess,INFINITE);
+        GetExitCodeProcess(ProcessInformation.hProcess,&ExitCode);
+        i = (int)ExitCode;
     }
-    for ( ; interpreters[i].extension; i++)
-      if (_stricmp(rpath_ext, interpreters[i].extension) == 0
-         && _access(rpath, F_OK) == 0
-         && !(is_dir = (_access(rpath, D_OK) == 0)))
-      {
-       found = 1;
-        break;
-      }
-  }
-  if (!found)
-  {
-    errno = is_dir ? EISDIR : ENOENT;
-    return -1;
-  }
-  errno = e;
-  i = interpreters[i].interp(rpath, argvp, envpp, &ProcessInformation);
-  if (mode == P_OVERLAY)
-    exit(i);
-  if (mode == P_WAIT)
-  {
-    WaitForSingleObject(ProcessInformation.hProcess,INFINITE);
-    GetExitCodeProcess(ProcessInformation.hProcess,&ExitCode);
-    i = (int)ExitCode;
-  }
-  return i;
+    return i;
 }
 
-
-
-
-const char * find_exec(char * path,char *rpath)
+const char* find_exec(char* path, char* rpath)
 {
- char *rp, *rd=0;
- int i;
- int is_dir = 0;
- int found = 0;
-  if (path == 0 )
-    return 0;
-  if (strlen(path) > FILENAME_MAX - 1)
-    return path;
-
-  /* copy path in rpath */
-  for (rd=path,rp=rpath; *rd; *rp++ = *rd++)
+    char *rp, *rd=0;
+    int i;
+    int is_dir = 0;
+    int found = 0;
+
+    if (path == 0 )
+        return 0;
+    if (strlen(path) > FILENAME_MAX - 1)
+        return path;
+
+    /* copy path in rpath */
+    for (rd=path,rp=rpath; *rd; *rp++ = *rd++)
     ;
-  *rp = 0;
-  /* try first with the name as is */
-  for (i=0; interpreters[i].extension; i++)
-  {
-    strcpy(rp, interpreters[i].extension);
-    if (_access(rpath, F_OK) == 0 && !(is_dir = (_access(rpath, D_OK) == 0)))
-    {
-       found = 1;
-       break;
+    *rp = 0;
+    /* try first with the name as is */
+    for (i=0; interpreters[i].extension; i++) {
+        strcpy(rp, interpreters[i].extension);
+        if (_access(rpath, F_OK) == 0 && !(is_dir = (_access(rpath, D_OK) == 0))) {
+            found = 1;
+            break;
+        }
     }
-  }
-
-  if (!found)
-  {
-    /* search in the PATH */
-    char winpath[MAX_PATH];
-    if( GetEnvironmentVariableA("PATH",winpath,MAX_PATH))
-    {
-     char *ep=winpath;
-      while( *ep)
-      {
-        if(*ep == ';') ep++;
-        rp=rpath;
-        for ( ; *ep && (*ep != ';') ; *rp++ = *ep++)
-         ;
-        *rp++='/';
-        for (rd=path ; *rd ; *rp++ = *rd++)
-         ;
-
-        for (i=0; interpreters[i].extension; i++)
-        {
-          strcpy(rp, interpreters[i].extension);
-          if (_access(rpath, F_OK) == 0 && !(is_dir = (_access(rpath, D_OK) == 0)))
-          {
-           found = 1;
-           break;
-          }
+    if (!found) {
+        /* search in the PATH */
+        char winpath[MAX_PATH];
+        if (GetEnvironmentVariableA("PATH", winpath, MAX_PATH)) {
+            char* ep = winpath;
+            while (*ep) {
+                if (*ep == ';') ep++;
+                rp = rpath;
+                for ( ; *ep && (*ep != ';') ; *rp++ = *ep++)
+                ;
+                *rp++ = '/';
+                for (rd = path ; *rd ; *rp++ = *rd++)
+                ;
+                for (i = 0; interpreters[i].extension; i++) {
+                    strcpy(rp, interpreters[i].extension);
+                    if (_access(rpath, F_OK) == 0 && !(is_dir = (_access(rpath, D_OK) == 0))) {
+                        found = 1;
+                        break;
+                    }
+                }
+                if (found) break;
+            }
         }
-       if (found) break;
-      }
     }
-  }
-  if (!found)
-    return path;
-
-  return rpath;
+    if (!found)
+        return path;
+    return rpath;
 }
 
 int _spawnvpe(int nMode, const char* szPath, char* const* szaArgv, char* const* szaEnv)
 {
- char rpath[FILENAME_MAX];
-
-  return _spawnve(nMode, find_exec((char*)szPath,rpath), szaArgv, szaEnv);
+    char rpath[FILENAME_MAX];
 
+    return _spawnve(nMode, find_exec((char*)szPath,rpath), szaArgv, szaEnv);
 }
index aecd80e..8a6862b 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <crtdll/process.h>
-#include <crtdll/stdlib.h>
+#include <msvcrt/process.h>
+#include <msvcrt/stdlib.h>
 
 int _spawnvp(int nMode, const char* szPath, char* const* szaArgv)
 {
index bdad981..fdafde3 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <crtdll/process.h>
-#include <crtdll/errno.h>
+#include <msvcrt/process.h>
+#include <msvcrt/errno.h>
 
 
 int _spawnvpe(int nMode, const char* szPath, char* const* szaArgv, char* const* szaEnv)
index c2a12d3..b6c0f95 100644 (file)
@@ -1,7 +1,7 @@
 #include <windows.h>
-#include <crtdll/process.h>
-#include <crtdll/errno.h>
-#include <crtdll/internal/file.h>
+#include <msvcrt/process.h>
+#include <msvcrt/errno.h>
+#include <msvcrt/internal/file.h>
 
 
 unsigned long
index 3b5c9aa..14bb978 100644 (file)
@@ -1,5 +1,5 @@
 #include <windows.h>
-#include <crtdll/process.h>
+#include <msvcrt/process.h>
 
 unsigned long __threadid (void)
 {
index 899042e..f726093 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: divdi3.c,v 1.1 1999/04/17 09:10:23 ariadne Exp $
+ * $Id: divdi3.c,v 1.2 2002/11/24 18:42:16 robd Exp $
  */
 
-#include <crtdll/internal/quad.h>
+#include <msvcrt/internal/quad.h>
 
 /*
  * Divide two signed quads.