moved some header files from top level to crtdll directory
authorBoudewijn Dekker <ariadne@xs4all.nl>
Fri, 2 Apr 1999 21:44:11 +0000 (21:44 +0000)
committerBoudewijn Dekker <ariadne@xs4all.nl>
Fri, 2 Apr 1999 21:44:11 +0000 (21:44 +0000)
svn path=/trunk/; revision=365

319 files changed:
reactos/include/crtdll/alloc.h [new file with mode: 0644]
reactos/include/crtdll/assert.h
reactos/include/crtdll/conio.h
reactos/include/crtdll/ctype.h
reactos/include/crtdll/dir.h
reactos/include/crtdll/dirent.h
reactos/include/crtdll/dos.h
reactos/include/crtdll/errno.h
reactos/include/crtdll/excpt.h [new file with mode: 0644]
reactos/include/crtdll/fcntl.h
reactos/include/crtdll/float.h
reactos/include/crtdll/internal/atexit.h [new file with mode: 0644]
reactos/include/crtdll/internal/file.h [new file with mode: 0644]
reactos/include/crtdll/io.h
reactos/include/crtdll/malloc.h [new file with mode: 0644]
reactos/include/crtdll/math.h
reactos/include/crtdll/process.h
reactos/include/crtdll/search.h [new file with mode: 0644]
reactos/include/crtdll/stddef.h
reactos/include/crtdll/stdio.h
reactos/include/crtdll/stdlib.h
reactos/include/crtdll/string.h [new file with mode: 0644]
reactos/include/crtdll/sys/djtypes.h [deleted file]
reactos/include/crtdll/sys/fcntl.h [new file with mode: 0644]
reactos/include/crtdll/sys/file.h [new file with mode: 0644]
reactos/include/crtdll/sys/locking.h [new file with mode: 0644]
reactos/include/crtdll/sys/stat.h
reactos/include/crtdll/sys/time.h [new file with mode: 0644]
reactos/include/crtdll/sys/timeb.h [new file with mode: 0644]
reactos/include/crtdll/sys/types.h
reactos/include/crtdll/sys/unistd.h [new file with mode: 0644]
reactos/include/crtdll/sys/utime.h [new file with mode: 0644]
reactos/include/crtdll/tchar.h [new file with mode: 0644]
reactos/include/crtdll/time.h
reactos/include/crtdll/wchar.h [new file with mode: 0644]
reactos/lib/crtdll/assert/assert.c
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/putch.c
reactos/lib/crtdll/conio/ungetch.c
reactos/lib/crtdll/crtdll.def
reactos/lib/crtdll/ctype/isalnum.c
reactos/lib/crtdll/ctype/isalpha.c
reactos/lib/crtdll/ctype/isascii.c
reactos/lib/crtdll/ctype/iscntrl.c
reactos/lib/crtdll/ctype/iscsym.c
reactos/lib/crtdll/ctype/isctype.c
reactos/lib/crtdll/ctype/isdigit.c
reactos/lib/crtdll/ctype/isgraph.c
reactos/lib/crtdll/ctype/islower.c
reactos/lib/crtdll/ctype/isprint.c
reactos/lib/crtdll/ctype/ispunct.c
reactos/lib/crtdll/ctype/isspace.c
reactos/lib/crtdll/ctype/isupper.c
reactos/lib/crtdll/ctype/isxdigit.c
reactos/lib/crtdll/ctype/toascii.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/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 [new file with mode: 0644]
reactos/lib/crtdll/float/chgsign.c [new file with mode: 0644]
reactos/lib/crtdll/float/clearfp.c
reactos/lib/crtdll/float/cntrlfp.c
reactos/lib/crtdll/float/fpreset.c
reactos/lib/crtdll/float/isnan.c [new file with mode: 0644]
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/locking.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/write.c
reactos/lib/crtdll/locale/locale.c [new file with mode: 0644]
reactos/lib/crtdll/makefile
reactos/lib/crtdll/malloc/expand.c [new file with mode: 0644]
reactos/lib/crtdll/malloc/heap.c [new file with mode: 0644]
reactos/lib/crtdll/math/acos.c
reactos/lib/crtdll/math/acosh.c
reactos/lib/crtdll/math/asin.c
reactos/lib/crtdll/math/asinh.c
reactos/lib/crtdll/math/atanh.c
reactos/lib/crtdll/math/cabs.c
reactos/lib/crtdll/math/cosh.c
reactos/lib/crtdll/math/frexp.c
reactos/lib/crtdll/math/huge_val.c
reactos/lib/crtdll/math/hypot.c
reactos/lib/crtdll/math/j0_y0.c [new file with mode: 0644]
reactos/lib/crtdll/math/j1_y1.c [new file with mode: 0644]
reactos/lib/crtdll/math/jn_yn.c [new file with mode: 0644]
reactos/lib/crtdll/math/modf.c
reactos/lib/crtdll/math/sinh.c
reactos/lib/crtdll/math/stubs.c [new file with mode: 0644]
reactos/lib/crtdll/math/tanh.c
reactos/lib/crtdll/misc/GetArgs.c
reactos/lib/crtdll/misc/crt1.c
reactos/lib/crtdll/misc/dllcrt1.c
reactos/lib/crtdll/misc/gccmain.c
reactos/lib/crtdll/misc/init.c
reactos/lib/crtdll/misc/main.c
reactos/lib/crtdll/misc/purecall.c [new file with mode: 0644]
reactos/lib/crtdll/misc/setnew.cc [new file with mode: 0644]
reactos/lib/crtdll/process/_cwait.c
reactos/lib/crtdll/process/_system.c
reactos/lib/crtdll/process/dll.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/execve.c
reactos/lib/crtdll/process/execvp.c
reactos/lib/crtdll/process/execvpe.c
reactos/lib/crtdll/process/spawnl.c
reactos/lib/crtdll/process/spawnle.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/threadid.c [new file with mode: 0644]
reactos/lib/crtdll/search/lfind.c [new file with mode: 0644]
reactos/lib/crtdll/search/lsearch.c [new file with mode: 0644]
reactos/lib/crtdll/signal/signal.c
reactos/lib/crtdll/stdio/allocfil.c
reactos/lib/crtdll/stdio/clearerr.c
reactos/lib/crtdll/stdio/doprnt.c
reactos/lib/crtdll/stdio/doscan.c
reactos/lib/crtdll/stdio/fclose.c
reactos/lib/crtdll/stdio/fdopen.c
reactos/lib/crtdll/stdio/feof.c
reactos/lib/crtdll/stdio/ferror.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/filbuf.c
reactos/lib/crtdll/stdio/fileno.c
reactos/lib/crtdll/stdio/flsbuf.c
reactos/lib/crtdll/stdio/fopen.c
reactos/lib/crtdll/stdio/fprintf.c
reactos/lib/crtdll/stdio/fputc.c
reactos/lib/crtdll/stdio/fputchar.c
reactos/lib/crtdll/stdio/fputs.c
reactos/lib/crtdll/stdio/fread.c
reactos/lib/crtdll/stdio/freopen.c
reactos/lib/crtdll/stdio/frlist.c
reactos/lib/crtdll/stdio/fscanf.c
reactos/lib/crtdll/stdio/fseek.c
reactos/lib/crtdll/stdio/fsetpos.c
reactos/lib/crtdll/stdio/ftell.c
reactos/lib/crtdll/stdio/fwalk.c
reactos/lib/crtdll/stdio/fwrite.c
reactos/lib/crtdll/stdio/getc.c
reactos/lib/crtdll/stdio/getchar.c
reactos/lib/crtdll/stdio/getenv.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/rename.c
reactos/lib/crtdll/stdio/rewind.c
reactos/lib/crtdll/stdio/scanf.c
reactos/lib/crtdll/stdio/setbuf.c
reactos/lib/crtdll/stdio/setbuffe.c
reactos/lib/crtdll/stdio/setlineb.c
reactos/lib/crtdll/stdio/setvbuf.c
reactos/lib/crtdll/stdio/sprintf.c
reactos/lib/crtdll/stdio/sscanf.c
reactos/lib/crtdll/stdio/stdhnd.c
reactos/lib/crtdll/stdio/stdiohk.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/vprintf.c
reactos/lib/crtdll/stdio/vsprintf.c
reactos/lib/crtdll/stdlib/_exit.c [moved from reactos/lib/crtdll/stdlib/Exit.c with 76% similarity]
reactos/lib/crtdll/stdlib/abort.c
reactos/lib/crtdll/stdlib/abs.c
reactos/lib/crtdll/stdlib/atexit.c
reactos/lib/crtdll/stdlib/atof.c
reactos/lib/crtdll/stdlib/atoi.c
reactos/lib/crtdll/stdlib/atol.c
reactos/lib/crtdll/stdlib/atold.c
reactos/lib/crtdll/stdlib/bsearch.c
reactos/lib/crtdll/stdlib/calloc.c
reactos/lib/crtdll/stdlib/div.c
reactos/lib/crtdll/stdlib/ecvt.c
reactos/lib/crtdll/stdlib/ecvtbuf.c
reactos/lib/crtdll/stdlib/errno.c
reactos/lib/crtdll/stdlib/fcvt.c
reactos/lib/crtdll/stdlib/fcvtbuf.c
reactos/lib/crtdll/stdlib/fullpath.c
reactos/lib/crtdll/stdlib/gcvt.c
reactos/lib/crtdll/stdlib/itoa.c
reactos/lib/crtdll/stdlib/labs.c
reactos/lib/crtdll/stdlib/ldiv.c
reactos/lib/crtdll/stdlib/llabs.c
reactos/lib/crtdll/stdlib/lldiv.c
reactos/lib/crtdll/stdlib/makepath.c
reactos/lib/crtdll/stdlib/malloc.c
reactos/lib/crtdll/stdlib/mbstow.c
reactos/lib/crtdll/stdlib/obsol.c
reactos/lib/crtdll/stdlib/putenv.c
reactos/lib/crtdll/stdlib/qsort.c
reactos/lib/crtdll/stdlib/rand.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/strtoll.c
reactos/lib/crtdll/stdlib/strtoul.c
reactos/lib/crtdll/stdlib/strtoull.c
reactos/lib/crtdll/stdlib/swab.c [new file with mode: 0644]
reactos/lib/crtdll/stdlib/wcstom.c
reactos/lib/crtdll/string/memchr.c
reactos/lib/crtdll/string/memcmp.c
reactos/lib/crtdll/string/memcpy.c
reactos/lib/crtdll/string/memmove.c
reactos/lib/crtdll/string/memset.c
reactos/lib/crtdll/string/str_old.c
reactos/lib/crtdll/string/strcat.c
reactos/lib/crtdll/string/strcmp.c
reactos/lib/crtdll/string/strcoll.c
reactos/lib/crtdll/string/strcspn.c
reactos/lib/crtdll/string/strdup.c
reactos/lib/crtdll/string/strerror.c
reactos/lib/crtdll/string/stricmp.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/strspn.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/stat.c
reactos/lib/crtdll/tchar/strdec.c [new file with mode: 0644]
reactos/lib/crtdll/tchar/strinc.c [new file with mode: 0644]
reactos/lib/crtdll/tchar/strncnt.c [new file with mode: 0644]
reactos/lib/crtdll/tchar/strnextc.c [new file with mode: 0644]
reactos/lib/crtdll/tchar/strninc.c [new file with mode: 0644]
reactos/lib/crtdll/tchar/strspnp.c [new file with mode: 0644]
reactos/lib/crtdll/time/clock.c
reactos/lib/crtdll/time/ctime.c
reactos/lib/crtdll/time/difftime.c
reactos/lib/crtdll/time/strftime.c
reactos/lib/crtdll/time/time.c
reactos/lib/crtdll/wchar/wcscat.c
reactos/lib/crtdll/wchar/wcschr.c
reactos/lib/crtdll/wchar/wcscmp.c
reactos/lib/crtdll/wchar/wcscoll.c
reactos/lib/crtdll/wchar/wcscpy.c
reactos/lib/crtdll/wchar/wcscspn.c
reactos/lib/crtdll/wchar/wcsdup.c
reactos/lib/crtdll/wchar/wcsftime.c [new file with mode: 0644]
reactos/lib/crtdll/wchar/wcsicmp.c
reactos/lib/crtdll/wchar/wcslen.c
reactos/lib/crtdll/wchar/wcslwr.c
reactos/lib/crtdll/wchar/wcsncat.c
reactos/lib/crtdll/wchar/wcsncmp.c
reactos/lib/crtdll/wchar/wcsncpy.c
reactos/lib/crtdll/wchar/wcsnicmp.c
reactos/lib/crtdll/wchar/wcsnlen.c
reactos/lib/crtdll/wchar/wcsrchr.c
reactos/lib/crtdll/wchar/wcsrev.c
reactos/lib/crtdll/wchar/wcsspn.c
reactos/lib/crtdll/wchar/wcsstr.c
reactos/lib/crtdll/wchar/wcstok.c
reactos/lib/crtdll/wchar/wcstol.c
reactos/lib/crtdll/wchar/wcsupr.c
reactos/lib/crtdll/wchar/wcsxfrm.c [new file with mode: 0644]

diff --git a/reactos/include/crtdll/alloc.h b/reactos/include/crtdll/alloc.h
new file mode 100644 (file)
index 0000000..a4e0f05
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * alloc.h
+ *
+ * Memory management functions. Because most of these functions are
+ * actually declared in stdlib.h I have decided to simply include that
+ * header file. This file is included by malloc.h. My head hurts...
+ *
+ * NOTE: In the version of the Standard C++ Library from Cygnus there
+ * is also an alloc.h which needs to be on your include path. Most of
+ * the time I think the most sensible option would be to get rid of
+ * this file.
+ *
+ * This file is part of the Mingw32 package.
+ *
+ * Contributors:
+ *  Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
+ *
+ *  THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ *  This source code is offered for use in the public domain. You may
+ *  use, modify or distribute it freely.
+ *
+ *  This code is distributed in the hope that it will be useful but
+ *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ *  DISCLAMED. This includes but is not limited to warranties of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $Revision: 1.1 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:06 $
+ *
+ */
+
+#ifndef __STRICT_ANSI__
+
+#ifndef        _ALLOC_H_
+#define        _ALLOC_H_
+
+#include <crtdll/stdlib.h>
+
+#ifndef RC_INVOKED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * The structure used to walk through the heap with _heapwalk.
+ * TODO: This is a guess at the internals of this structure.
+ */
+typedef        struct _heapinfo
+{
+       void*           ptr;
+       unsigned int    size;
+       int             in_use;
+} _HEAPINFO;
+
+int    _heapwalk (_HEAPINFO* pHeapinfo);
+
+
+#ifndef        _NO_OLDNAMES
+int    heapwalk (_HEAPINFO* pHeapinfo);
+#endif /* Not _NO_OLDNAMES */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* Not RC_INVOKED */
+
+#endif /* Not _ALLOC_H_ */
+
+#endif /* Not __STRICT_ANSI__ */
+
index f90a124..2441bd4 100644 (file)
@@ -18,9 +18,9 @@
  *  DISCLAMED. This includes but is not limited to warranties of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Revision: 1.2 $
- * $Author: rex $
- * $Date: 1999/03/19 05:55:07 $
+ * $Revision: 1.3 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:06 $
  *
  */
 
@@ -44,11 +44,17 @@ extern "C" {
  * CRTDLL nicely supplies a function which does the actual output and
  * call to abort.
  */
-void   _assert (const char* szExpression, const char* szFileName, int nLine)
+#ifndef  __ATTRIB_NORETURN
 #ifdef __GNUC__
-       __attribute__ ((noreturn))
+#define        _ATTRIB_NORETURN        __attribute__ ((noreturn))
+#else  /* Not __GNUC__ */
+#define        _ATTRIB_NORETURN
+#endif /* __GNUC__ */
 #endif
-       ;
+
+void   _assert (const char* szExpression, const char* szFileName, int nLine) 
+_ATTRIB_NORETURN
+;
 
 /*
  * Definition of the assert macro.
index 3c0b26b..a082327 100644 (file)
-/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#ifndef __dj_include_conio_h_
-#define __dj_include_conio_h_
-
-#ifdef __cplusplus
+/*
+ * conio.h
+ *
+ * Low level console I/O functions. Pretty please try to use the ANSI
+ * standard ones if you are writing new code.
+ *
+ * This file is part of the Mingw32 package.
+ *
+ * Contributors:
+ *  Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
+ *
+ *  THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ *  This source code is offered for use in the public domain. You may
+ *  use, modify or distribute it freely.
+ *
+ *  This code is distributed in the hope that it will be useful but
+ *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ *  DISCLAMED. This includes but is not limited to warranties of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $Revision: 1.3 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:06 $
+ *
+ */
+
+#ifndef        __STRICT_ANSI__
+
+#ifndef        _CONIO_H_
+#define        _CONIO_H_
+
+#ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef __dj_ENFORCE_ANSI_FREESTANDING
-
-#ifndef __STRICT_ANSI__
-
-#ifndef _POSIX_SOURCE
-
 
-extern int directvideo; /* ignored by gppconio */
-extern int _wscroll;
+char*  _cgets (char* szBuffer);
+int    _cprintf (const char* szFormat, ...);
+int    _cputs (const char* szString);
+int    _cscanf (char* szFormat, ...);
 
-#define _NOCURSOR      0
-#define _SOLIDCURSOR   1
-#define _NORMALCURSOR  2
+int    _getch (void);
+int    _getche (void);
+int    _kbhit (void);
+int    _putch (int cPut);
+int    _ungetch (int cUnget);
 
-struct text_info {
-    unsigned char winleft;
-    unsigned char wintop;
-    unsigned char winright;
-    unsigned char winbottom;
-    unsigned char attribute;
-    unsigned char normattr;
-    unsigned char currmode;
-    unsigned char screenheight;
-    unsigned char screenwidth;
-    unsigned char curx;
-    unsigned char cury;
-};
 
-enum text_modes { LASTMODE=-1, BW40=0, C40, BW80, C80, MONO=7, C4350=64 };
+#ifndef        _NO_OLDNAMES
 
-enum COLORS {
-    /*  dark colors     */
-    BLACK,          
-    BLUE,
-    GREEN,
-    CYAN,
-    RED,
-    MAGENTA,
-    BROWN,
-    LIGHTGRAY,
-    /*  light colors    */
-    DARKGRAY,
-    LIGHTBLUE,
-    LIGHTGREEN,
-    LIGHTCYAN,
-    LIGHTRED,
-    LIGHTMAGENTA,
-    YELLOW,
-    WHITE
-};
+#define        getch                   _getch
+#define        getche                  _getche
+#define        kbhit                   _kbhit
+#define        putch (cPut)            _putch(cPut)
+#define        ungetch (cUnget)        _ungetch(cUnget)
 
-#define BLINK   0x80    /*  blink bit   */
+#endif /* Not _NO_OLDNAMES */
 
-void    blinkvideo(void);
-char *  cgets(char *_str); 
-void    clreol(void);
-void    clrscr(void);
-int     _conio_kbhit(void); /* checks for ungetch char */
-//int     cprintf(const char *_format, ...) __attribute__((format(printf,1,2)));
-int     cputs(const char *_str);
-//int     cscanf(const char *_format, ...) __attribute__((format(scanf,1,2)));
-void    delline(void);
-int     getch(void);
-int     getche(void);
-int     gettext(int _left, int _top, int _right, int _bottom, void *_destin);
-void    gettextinfo(struct text_info *_r);
-void    gotoxy(int _x, int _y);
-void    gppconio_init(void);
-void    highvideo(void);
-void    insline(void);
-void   intensevideo(void);
-void    lowvideo(void);
-int     movetext(int _left, int _top, int _right, int _bottom, int _destleft, int _desttop);
-void    normvideo(void);
-int     putch(int _c);
-int     puttext(int _left, int _top, int _right, int _bottom, void *_source);
-void    _setcursortype(int _type);
-void    _set_screen_lines(int _nlines);
-void    textattr(int _attr);
-void    textbackground(int _color);
-void    textcolor(int _color);
-void    textmode(int _mode);
-int     ungetch(int); 
-unsigned int     wherex(void);
-unsigned int    wherey(void);
-void    window(int _left, int _top, int _right, int _bottom);
 
-#define kbhit _conio_kbhit /* Who ever includes gppconio.h probably
-                              also wants _conio_kbhit and not kbhit
-                              from libc */
-
-#endif /* !_POSIX_SOURCE */
-#endif /* !__STRICT_ANSI__ */
-#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
-
-#ifndef __dj_ENFORCE_FUNCTION_CALLS
-#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
-
-#ifdef __cplusplus
+#ifdef __cplusplus
 }
 #endif
 
-#endif /* !__dj_include_conio_h_ */
+#endif /* Not _CONIO_H_ */
+
+#endif /* Not __STRICT_ANSI__ */
index b09105c..3a98fe2 100644 (file)
@@ -18,9 +18,9 @@
  *  DISCLAMED. This includes but is not limited to warranties of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Revision: 1.2 $
- * $Author: rex $
- * $Date: 1999/03/19 05:55:07 $
+ * $Revision: 1.3 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:06 $
  *
  */
 #ifndef _LINUX_CTYPE_H
@@ -31,7 +31,7 @@
 
 #define        __need_wchar_t
 #define        __need_wint_t
-#include <stddef.h>
+#include <crtdll/stddef.h>
 
 
 /*
 #define        _CONTROL        0x0020
 #define        _BLANK          0x0040
 #define        _HEX            0x0080
-#define        _LEADBYTE       0x8000
-
 #define        _ALPHA          0x0103
+#define _GRAPH         0x0200  // added
+#define _PRINT         0x0400  // added
+#define        _LEADBYTE       0x8000
 
-/* from DJGPP, see appropriate licence */
-#define __dj_ISALNUM   0x0001
-#define __dj_ISALPHA   0x0002
-#define __dj_ISCNTRL   0x0004
-#define __dj_ISDIGIT   0x0008
-#define __dj_ISGRAPH   0x0010
-#define __dj_ISLOWER   0x0020
-#define __dj_ISPRINT   0x0040
-#define __dj_ISPUNCT   0x0080
-#define __dj_ISSPACE   0x0100
-#define __dj_ISUPPER   0x0200
-#define __dj_ISXDIGIT  0x0400
 
 #ifdef __cplusplus
 extern "C" {
index 6e87376..0e0266d 100644 (file)
@@ -18,9 +18,9 @@
  *  DISCLAMED. This includes but is not limited to warranties of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Revision: 1.2 $
- * $Author: rex $
- * $Date: 1999/03/19 05:55:07 $
+ * $Revision: 1.3 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:06 $
  *
  */
 
@@ -29,8 +29,8 @@
 #ifndef _DIR_H_
 #define        _DIR_H_
 
-#include <stdio.h>     /* To get FILENAME_MAX... ugly. */
-#include <sys/types.h> /* To get time_t. */
+#include <crtdll/stdio.h>      /* To get FILENAME_MAX... ugly. */
+#include <crtdll/sys/types.h>  /* To get time_t. */
 
 #ifdef __cplusplus
 extern "C" {
index 93e541d..e5c2948 100644 (file)
@@ -14,9 +14,9 @@
  *  DISCLAMED. This includeds but is not limited to warranties of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Revision: 1.2 $
- * $Author: rex $
- * $Date: 1999/03/19 05:55:07 $
+ * $Revision: 1.3 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:06 $
  *
  */
 
@@ -25,7 +25,7 @@
 #ifndef _DIRENT_H_
 #define _DIRENT_H_
 
-#include <dir.h>
+#include <crtdll/dir.h>
 
 #ifdef __cplusplus
 extern "C" {
index 92670be..f31ecb1 100644 (file)
@@ -139,7 +139,7 @@ void           _setdrive(unsigned int _drive, unsigned int *_p_drives);
 int            exterr(struct _DOSERROR *_p_error);
 #define dosexterr(_ep) exterr(_ep)
 
-#include <direct.h>
+#include <crtdll/direct.h>
 
 #define int386(_i, _ir, _or)         int86(_i, _ir, _or)
 #define int386x(_i, _ir, _or, _sr)   int86x(_i, _ir, _or, _sr)
index b68c1f8..14b10b7 100644 (file)
@@ -18,9 +18,9 @@
  *  DISCLAMED. This includes but is not limited to warranties of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Revision: 1.2 $
- * $Author: rex $
- * $Date: 1999/03/19 05:55:07 $
+ * $Revision: 1.3 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:06 $
  *
  */
 
@@ -103,16 +103,27 @@ int*      __doserrno(void);
 
 #if    __MSVCRT__
 /* One of the MSVCRTxx libraries */
+
 extern int*    __imp__sys_nerr;
 #define        sys_nerr        (*__imp__sys_nerr)
+
+extern char**  __imp__sys_errlist;
+#define        sys_errlist     (__imp__sys_errlist)
+
 #else
 /* CRTDLL run time library */
-extern int*    __imp__sys_nerr_dll;
-#define sys_nerr       (*__imp__sys_nerr_dll)
+
+
+#define _sys_nerr   (*_sys_nerr_dll)
+extern int*    _sys_nerr_dll;
+#define sys_nerr       (*_sys_nerr_dll)
+
+extern const char*     __sys_errlist[];
+#define        sys_errlist     (__sys_errlist)
+
 #endif
 
-extern char**  __imp__sys_errlist;
-#define        sys_errlist     (__imp__sys_errlist)
+
 
 #ifdef __cplusplus
 }
diff --git a/reactos/include/crtdll/excpt.h b/reactos/include/crtdll/excpt.h
new file mode 100644 (file)
index 0000000..582a594
--- /dev/null
@@ -0,0 +1,121 @@
+/* 
+ * excpt.h
+ *
+ * Support for operating system level structured exception handling.
+ *
+ * NOTE: This is very preliminary stuff. I am also pretty sure it is
+ *       completely Intel specific.
+ *
+ * This file is part of the Mingw32 package.
+ *
+ * Contributors:
+ *  Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
+ *  Based on code by Mikey <jeffdb@netzone.com>
+ *
+ *  THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ *  This source code is offered for use in the public domain. You may
+ *  use, modify or distribute it freely.
+ *
+ *  This code is distributed in the hope that it will be useful but
+ *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ *  DISCLAMED. This includes but is not limited to warranties of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $Revision: 1.1 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:06 $
+ *
+ */
+
+#ifndef        _EXCPT_H_
+#define        _EXCPT_H_
+
+#ifndef        __STRICT_ANSI__
+
+#include <windows.h>
+
+/*
+ * NOTE: The constants structs and typedefs below should be defined in the
+ *       Win32 API headers.
+ */
+#define        EH_NONCONTINUABLE       0x01
+#define        EH_UNWINDING            0x02
+#define        EH_EXIT_UNWIND          0x04
+#define        EH_STACK_INVALID        0x08
+#define        EH_NESTED_CALL          0x10
+
+#ifndef        RC_INVOKED
+
+typedef enum {
+       ExceptionContinueExecution,
+       ExceptionContinueSearch,
+       ExceptionNestedException,
+       ExceptionCollidedUnwind
+} EXCEPTION_DISPOSITION;
+
+
+/*
+ * End of stuff that should be in the Win32 API files.
+ */
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * The type of function that is expected as an exception handler to be
+ * installed with _try1.
+ */
+typedef EXCEPTION_DISPOSITION (*PEXCEPTION_HANDLER)
+               (struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*);
+
+/*
+ * This is not entirely necessary, but it is the structure installed by
+ * the _try1 primitive below.
+ */
+typedef struct _EXCEPTION_REGISTRATION
+{
+       struct _EXCEPTION_REGISTRATION* prev;
+       PEXCEPTION_HANDLER              handler;
+} EXCEPTION_REGISTRATION, *PEXCEPTION_REGISTRATION;
+
+typedef EXCEPTION_REGISTRATION EXCEPTION_REGISTRATION_RECORD;
+typedef PEXCEPTION_REGISTRATION PEXCEPTION_REGISTRATION_RECORD;
+
+/*
+ * A macro which installs the supplied exception handler.
+ * Push the pointer to the new handler onto the stack,
+ * then push the pointer to the old registration structure (at fs:0)
+ * onto the stack, then put a pointer to the new registration
+ * structure (i.e. the current stack pointer) at fs:0.
+ */
+#define __try1(pHandler) \
+       __asm__ ("pushl %0;pushl %%fs:0;movl %%esp,%%fs:0;" : : "g" (pHandler));
+
+
+/*
+ * A macro which (dispite its name) *removes* an installed
+ * exception handler. Should be used only in conjunction with the above
+ * install routine __try1.
+ * Move the pointer to the old reg. struct (at the current stack
+ * position) to fs:0, replacing the pointer we installed above,
+ * then add 8 to the stack pointer to get rid of the space we
+ * used when we pushed on our new reg. struct above. Notice that
+ * the stack must be in the exact state at this point that it was
+ * after we did _try1 or this will smash things.
+ */
+#define        __except1       \
+       __asm__ ("movl (%%esp),%%eax;movl %%eax,%%fs:0;addl $8,%%esp;" \
+        : : : "%eax");
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* Not RC_INVOKED */
+
+#endif /* Not strict ANSI */
+
+#endif /* _EXCPT_H_ not defined */
index d6f772a..6428af6 100644 (file)
-/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#ifndef __dj_include_fcntl_h_
-#define __dj_include_fcntl_h_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define _IOREAD   000010
-#define _IOWRT    000020
-#define _IOMYBUF  000040
-#define _IOEOF    000100
-#define _IOERR    000200
-#define _IOSTRG   000400
-#define _IORW     001000
-#define _IOAPPEND 002000
-#define _IORMONCL 004000  /* remove on close, for temp files */
-/* if _flag & _IORMONCL, ._name_to_remove needs freeing */
-#define _IOUNGETC 010000  /* there is an ungetc'ed character in the buffer */
-
-
-#ifndef __dj_ENFORCE_ANSI_FREESTANDING
-
-#ifndef __STRICT_ANSI__
-
-#define FD_CLOEXEC     0x0001
-
-#define F_DUPFD                1
-#define F_GETFD                2
-#define F_GETFL                3
-#define F_GETLK                4
-#define F_SETFD                5
-#define F_SETFL                6
-#define F_SETLK                7
-#define F_SETLKW       8
-
-#define F_UNLCK                0
-#define F_RDLCK                1
-#define F_WRLCK                2
-
-#define O_RDONLY       0x0000
-#define O_WRONLY       0x0001
-#define O_RDWR         0x0002
-#define O_ACCMODE      0x0003
-
-#define O_BINARY       0x0004  /* must fit in char, reserved by dos */
-#define O_TEXT         0x0008  /* must fit in char, reserved by dos */
-
-#define O_RANDOM       0x0010  
-#define O_SEQUENTIAL   0x0020  
-
-
-#define O_TEMPORARY    0x0040  
-
-/* temporary access hint */
-
-
-
-/* sequential/random access hints */
-
-
-
-
-#define O_NOINHERIT    0x0080  /* DOS-specific */
-
-#define O_CREAT                0x0100  /* second byte, away from DOS bits */
-#define O_EXCL         0x0200
-#define O_NOCTTY       0x0400
-#define O_TRUNC                0x0800
-#define O_APPEND       0x1000
-#define O_NONBLOCK     0x2000
-
-#define O_SHORT_LIVED  0x1000  
-
-//#include <sys/types.h>
-#include <sys/stat.h>
-
-//typedef int          dev_t;
-//typedef int          ino_t;
-//typedef int          mode_t;
-//typedef int          nlink_t;
-
-#include <io.h>
-
-
-struct flock {
-  off_t        l_len;
-  pid_t        l_pid;
-  off_t        l_start;
-  short        l_type;
-  short        l_whence;
-};
-
-extern int _fmode; /* O_TEXT or O_BINARY */
-
-//int  open(const char *_path, int _oflag, ...);
-//int  creat(const char *_path, int _mode);
-int    fcntl(int _fildes, int _cmd, ...);
-
-#ifndef _POSIX_SOURCE
-
+/*
+ * fcntl.h
+ *
+ * Access constants for _open. Note that the permissions constants are
+ * in sys/stat.h (ick).
+ *
+ * This code is part of the Mingw32 package.
+ *
+ * Contributors:
+ *  Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
+ *
+ *  THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ *  This source code is offered for use in the public domain. You may
+ *  use, modify or distribute it freely.
+ *
+ *  This code is distributed in the hope that it will be useful but
+ *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ *  DISCLAMED. This includes but is not limited to warranties of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $Revision: 1.3 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:06 $
+ *
+ */
+/* Appropriated for Reactos Crtdll by Ariadne */
+/* added _O_RANDOM_O_SEQUENTIAL        _O_SHORT_LIVED*/        
+/* changed fmode_dll */
 
-#define S_IREAD                S_IRUSR
-#define S_IWRITE       S_IWUSR
-#define S_IEXEC                S_IXUSR
+#ifndef _FCNTL_H_
+#define _FCNTL_H_
 
 /*
- *  For compatibility with other DOS C compilers.
+ * It appears that fcntl.h should include io.h for compatibility...
  */
-
-#define _O_RDONLY       O_RDONLY
-#define _O_WRONLY       O_WRONLY
-#define _O_RDWR         O_RDWR
-#define _O_APPEND       O_APPEND
-#define _O_CREAT        O_CREAT
-#define _O_TRUNC        O_TRUNC
-#define _O_EXCL         O_EXCL
-#define _O_TEXT         O_TEXT
-#define _O_BINARY       O_BINARY
-#define _O_NOINHERIT    O_NOINHERIT
-#define _O_RANDOM      O_RANDOM
-#define _O_SEQUENTIAL  O_RANDOM
-#define _O_SHORT_LIVED  O_SHORT_LIVED
-#define _O_TEMPORARY   O_TEMPORARY 
-
-#define _S_IREAD       S_IRUSR
-#define _S_IWRITE      S_IWUSR
-#define _S_IEXEC       S_IXUSR
+#include <crtdll/io.h>
 
 /*
- * Support for advanced filesystems (Windows 9x VFAT, NTFS, LFN etc.)
+ * This variable determines the default file mode.
+ * TODO: Which flags work?
  */
+#if __MSVCRT__
+extern unsigned int* __imp__fmode;
+#define        _fmode  (*__imp__fmode)
+#else
+/* CRTDLL */
+extern unsigned int* _fmode_dll;
+#define        _fmode  (*_fmode_dll)
+#endif
+
+/* Specifiy one of these flags to define the access mode. */
+#define        _O_RDONLY       0
+#define _O_WRONLY      1
+#define _O_RDWR                2
 
-#define _FILESYS_UNKNOWN       0x80000000U
-#define _FILESYS_CASE_SENSITIVE        0x0001
-#define _FILESYS_CASE_PRESERVED        0x0002
-#define _FILESYS_UNICODE       0x0004
-#define _FILESYS_LFN_SUPPORTED 0x4000
-#define _FILESYS_VOL_COMPRESSED        0x8000
+/* Mask for access mode bits in the _open flags. */
+#define _O_ACCMODE     (O_RDONLY|O_WRONLY|O_RDWR)
 
-unsigned _get_volume_info (const char *_path, int *_max_file_len, int *_max_path_len, char *_filesystype);
-char _use_lfn (const char *_path);
-char *_lfn_gen_short_fname (const char *_long_fname, char *_short_fname);
+#define        _O_APPEND       0x0008  /* Writes will add to the end of the file. */
+#define        _O_CREAT        0x0100  /* Create the file if it does not exist. */
+#define        _O_TRUNC        0x0200  /* Truncate the file if it does exist. */
+#define        _O_EXCL         0x0400  /* Open only if the file does not exist. */
 
-#define _LFN_CTIME     1
-#define _LFN_ATIME     2
+/* NOTE: Text is the default even if the given _O_TEXT bit is not on. */
+#define        _O_TEXT         0x4000  /* CR-LF in file becomes LF in memory. */
+#define        _O_BINARY       0x8000  /* Input and output is not translated. */
+#define        _O_RAW          _O_BINARY
 
-unsigned _lfn_get_ftime (int _handle, int _which);
+#define        _O_TEMPORARY    0x0040  /* Make the file dissappear after closing.
+                                * WARNING: Even if not created by _open! */
 
-char _preserve_fncase (void);
-#define _USE_LFN       _use_lfn(0) /* assume it's the same on ALL drives */
 
-#endif /* !_POSIX_SOURCE */
-#endif /* !__STRICT_ANSI__ */
-#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
+#define _O_RANDOM      0x0010
+#define _O_SEQUENTIAL  _O_RANDOM
+#define _O_SHORT_LIVED 0x1000  
+
+#ifndef __STRICT_ANSI__
+#ifndef        _NO_OLDNAMES
+
+/* POSIX/Non-ANSI names for increased portability */
+#define        O_RDONLY        _O_RDONLY
+#define O_WRONLY       _O_WRONLY
+#define O_RDWR         _O_RDWR
+#define O_ACCMODE      _O_ACCMODE
+#define        O_APPEND        _O_APPEND
+#define        O_CREAT         _O_CREAT
+#define        O_TRUNC         _O_TRUNC
+#define        O_EXCL          _O_EXCL
+#define        O_TEXT          _O_TEXT
+#define        O_BINARY        _O_BINARY
+#define        O_TEMPORARY     _O_TEMPORARY
+
+#define O_RANDOM       _O_RANDOM
+#define O_SEQUENTIAL   _O_RANDOM
+#define O_SHORT_LIVED   _O_SHORT_LIVED
+
+#endif /* Not _NO_OLDNAMES */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int    _setmode (int nHandle, int nAccessMode);
 
-#ifndef __dj_ENFORCE_FUNCTION_CALLS
-#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
+#ifndef        _NO_OLDNAMES
+int    setmode (int nHandle, int nAccessMode);
+#endif /* Not _NO_OLDNAMES */
 
-#ifdef __cplusplus
+#ifdef __cplusplus
 }
 #endif
 
-#endif /* !__dj_include_fcntl_h_ */
+#endif /* Not __STRICT_ANSI__ */
+#endif /* Not _FCNTL_H_ */
index d919986..6f11dc8 100644 (file)
@@ -27,9 +27,9 @@
  *  DISCLAMED. This includes but is not limited to warranties of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Revision: 1.2 $
- * $Author: rex $
- * $Date: 1999/03/19 05:55:07 $
+ * $Revision: 1.3 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:06 $
  *
  */
 
@@ -146,15 +146,15 @@ unsigned int      _controlfp (unsigned int unNew, unsigned int unMask);
 unsigned int   _control87 (unsigned int unNew, unsigned int unMask);
 
 
-unsigned int   _clearfp ();    /* Clear the FPU status word */
-unsigned int   _statusfp ();   /* Report the FPU status word */
+unsigned int   _clearfp (void);        /* Clear the FPU status word */
+unsigned int   _statusfp (void);       /* Report the FPU status word */
 #define                _clear87        _clearfp
 #define                _status87       _statusfp
 
-void           _fpreset ();    /* Reset the FPU */
+void           _fpreset (void);        /* Reset the FPU */
 
 /* Global 'variable' for the current floating point error code. */
-int *  __fpecode();
+int *  __fpecode(void);
 #define        _fpecode        (*(__fpecode()))
 
 /*
diff --git a/reactos/include/crtdll/internal/atexit.h b/reactos/include/crtdll/internal/atexit.h
new file mode 100644 (file)
index 0000000..b3a9f01
--- /dev/null
@@ -0,0 +1,33 @@
+/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
+#ifndef __dj_include_libc_atexit_h__
+#define __dj_include_libc_dosexec_h__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef __dj_ENFORCE_ANSI_FREESTANDING
+
+#ifndef __STRICT_ANSI__
+
+#ifndef _POSIX_SOURCE
+
+struct __atexit {
+  struct __atexit *__next;
+  void (*__function)(void);
+};
+
+extern struct __atexit *__atexit_ptr;
+
+#endif /* !_POSIX_SOURCE */
+#endif /* !__STRICT_ANSI__ */
+#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
+
+#ifndef __dj_ENFORCE_FUNCTION_CALLS
+#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __dj_include_libc_dosexec_h__ */
diff --git a/reactos/include/crtdll/internal/file.h b/reactos/include/crtdll/internal/file.h
new file mode 100644 (file)
index 0000000..7df3a17
--- /dev/null
@@ -0,0 +1,62 @@
+/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
+
+#ifndef __dj_include_libc_file_h__
+#define __dj_include_libc_file_h__
+
+#include <crtdll/stdio.h>
+#include <crtdll/fcntl.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef __dj_ENFORCE_ANSI_FREESTANDING
+
+#ifndef __STRICT_ANSI__
+
+#ifndef _POSIX_SOURCE
+
+#ifndef _IORMONCL
+#define _IORMONCL 004000  /* remove on close, for temp files */
+#endif
+/* if _flag & _IORMONCL, ._name_to_remove needs freeing */
+
+#ifndef _IOUNGETC
+#define _IOUNGETC 010000  /* there is an ungetc'ed character in the buffer */
+#endif
+
+int __set_errno(int err);
+void *filehnd(int fn);
+
+char __is_text_file(FILE *p);
+
+int __fileno_alloc(void *hFile, int mode);
+
+int _doprnt(const char *fmt, va_list args, FILE *f);
+int _doscan(FILE *iop, const char *fmt, va_list argp);
+int _dowscan(FILE *iop, const wchar_t *fmt, va_list argp);
+
+
+int __fileno_dup2( int handle1, int handle2 );
+int __fileno_setmode(int _fd, int _newmode);
+int __fileno_close(int _fd);
+
+#include <windows.h>
+
+void UnixTimeToFileTime( time_t unix_time, FILETIME *filetime, DWORD remainder );
+time_t FileTimeToUnixTime( const FILETIME *filetime, DWORD *remainder );
+
+
+#endif /* !_POSIX_SOURCE */
+#endif /* !__STRICT_ANSI__ */
+#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
+
+#ifndef __dj_ENFORCE_FUNCTION_CALLS
+#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __dj_include_libc_file_h__ */
index 3b35717..b0946bd 100644 (file)
@@ -18,9 +18,9 @@
  *  DISCLAMED. This includes but is not limited to warranties of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Revision: 1.2 $
- * $Author: rex $
- * $Date: 1999/03/19 05:55:07 $
+ * $Revision: 1.3 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:06 $
  *
  */
 /* Appropriated for Reactos Crtdll by Ariadne */
 
 #ifndef        __STRICT_ANSI__
 
-#include <sys/types.h>
+#include <crtdll/sys/types.h>
 
-#include <sys/stat.h>
+#include <crtdll/sys/stat.h>
 
 
 /* We need the definition of FILE anyway... */
-#include <stdio.h>
+#include <crtdll/stdio.h>
 
 /* MSVC's io.h contains the stuff from dir.h, so I will too.
  * NOTE: This also defines off_t, the file offset type, through
  * and inclusion of sys/types.h */
-#include <dir.h>
+#include <crtdll/dir.h>
 
 /* TODO: Maximum number of open handles has not been tested, I just set
  * it the same as FOPEN_MAX. */
diff --git a/reactos/include/crtdll/malloc.h b/reactos/include/crtdll/malloc.h
new file mode 100644 (file)
index 0000000..3a21c18
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * malloc.h
+ *
+ * Support for programs which want to use malloc.h to get memory management
+ * functions. Unless you absolutely need some of these functions and they are
+ * not in the ANSI headers you should use the ANSI standard header files
+ * instead.
+ *
+ * This file is part of the Mingw32 package.
+ *
+ * Contributors:
+ *  Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
+ *
+ *  THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ *  This source code is offered for use in the public domain. You may
+ *  use, modify or distribute it freely.
+ *
+ *  This code is distributed in the hope that it will be useful but
+ *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ *  DISCLAMED. This includes but is not limited to warranties of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $Revision: 1.1 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:06 $
+ *
+ */
+
+#ifndef        __STRICT_ANSI__
+
+#ifndef _MALLOC_H_
+#define _MALLOC_H_
+
+#include <crtdll/alloc.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void * _expand( void *memblock, size_t size );
+int    _heapchk (void);        /* Verify heap integrety. */
+int    _heapmin (void);        /* Return unused heap to the OS. */
+int    _heapset (unsigned int unFill);
+size_t _msize (void* pBlock);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* Not _MALLOC_H_ */
+
+#endif /* Not __STRICT_ANSI__ */
index c028ed8..3740e7f 100644 (file)
@@ -18,9 +18,9 @@
  *  DISCLAMED. This includes but is not limited to warranties of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Revision: 1.2 $
- * $Author: rex $
- * $Date: 1999/03/19 05:55:07 $
+ * $Revision: 1.3 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:06 $
  *
  */
 
@@ -46,8 +46,8 @@ extern double*        __imp__HUGE;
 #define        HUGE_VAL        (*__imp__HUGE)
 #else
 /* CRTDLL */
-extern double* __imp__HUGE_dll;
-#define        HUGE_VAL        (*__imp__HUGE_dll)
+extern double* _HUGE_dll;
+#define        HUGE_VAL        (*_HUGE_dll)
 #endif
 
 
index 60760a1..96da279 100644 (file)
  *  DISCLAMED. This includes but is not limited to warranties of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Revision: 1.2 $
- * $Author: rex $
- * $Date: 1999/03/19 05:55:09 $
+ * $Revision: 1.3 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:06 $
  *
  */
 /* Appropriated for Reactos Crtdll by Ariadne */
+/* changed second argument of cwait from nPID to hProc */
 
 #ifndef        _PROCESS_H_
 #define        _PROCESS_H_
@@ -49,21 +50,18 @@ void        _c_exit(void);
 #define        WAIT_GRANDCHILD         _WAIT_GRANDCHILD
 #endif /* Not _NO_OLDNAMES */
 
-int    _cwait (int* pnStatus, int nPID, int nAction);
+int    _cwait (int* pnStatus, int hProc, int nAction);
 
 int    _getpid(void);
 
-int _execl(const char *_path, const char *_argv0, ...);
-int _execle(const char *_path, const char *_argv0, ... /*, char *const _envp[] */);
-int _execlp(const char *_path, const char *_argv0, ...);
-int _execlpe(const char *_path, const char *_argv0, ... /*, char *const _envp[] */);
-
-int _execv(const char *_path,const char *const _argv[]);
-int _execve(const char *_path,const char *const _argv[],const char *const _envp[]);
-int _execvp(const char *_path,const char *const _argv[]);
-int _execvpe(const char *_path,const char *const _argv[],const char *const _envp[]);
-
-
+int    _execl          (const char* szPath, const char* szArgv0, ...);
+int    _execle         (const char* szPath, const char* szArgv0, ...);
+int    _execlp         (const char* szPath, const char* szArgv0, ...);
+int    _execlpe        (const char* szPath, const char* szArgv0, ...);
+int    _execv          (const char* szPath, char* const* szaArgv);
+int    _execve         (const char* szPath, char* const* szaArgv, char* const* szaEnv);
+int    _execvp         (const char* szPath, char* const* szaArgv);
+int    _execvpe        (const char* szPath, char* const* szaArgv, char* const* szaEnv);
 
 
 /*
@@ -85,16 +83,14 @@ int _execvpe(const char *_path,const char *const _argv[],const char *const _envp
 #define        P_DETACH        _P_DETACH
 #endif /* Not _NO_OLDNAMES */
 
-int _spawnl(int _mode, const char *_path, const char *_argv0, ...);
-int _spawnle(int _mode, const char *_path, const char *_argv0, ... /*, char *const _envp[] */);
-int _spawnlp(int _mode, const char *_path, const char *_argv0, ...);
-int _spawnlpe(int _mode, const char *_path, const char *_argv0, ... /*, char *const _envp[] */);
-
-int _spawnv(int _mode, const char *_path,const char *const _argv[]);
-int _spawnve(int _mode, const char *_path,const char *const _argv[],const char *const _envp[]);
-int _spawnvp(int _mode, const char *_path,const char *const _argv[]);
-int _spawnvpe(int _mode, const char *_path,const char *const _argv[],const char *const _envp[]);
-
+int    _spawnl         (int nMode, const char* szPath, const char* szArgv0, ...);
+int    _spawnle        (int nMode, const char* szPath, const char* szArgv0,...);
+int    _spawnlp        (int nMode, const char* szPath, const char* szArgv0,...);
+int    _spawnlpe       (int nMode, const char* szPath, const char* szArgv0,...);
+int    _spawnv         (int nMode, const char* szPath, char* const* szaArgv);
+int    _spawnve        (int nMode, const char* szPath, char* const* szaArgv, char* const* szaEnv);
+int    _spawnvp        (int nMode, const char* szPath, char* const* szaArgv);
+int    _spawnvpe       (int nMode, const char* szPath, char* const* szaArgv, char* const* szaEnv);
 /*
  * The functions _beginthreadex and _endthreadex are not provided by CRTDLL.
  * They are provided by MSVCRT.
@@ -123,6 +119,11 @@ void       _endthreadex    (unsigned unExitCode);
 void *_loaddll (char *name);
 int _unloaddll(void *handle);
 
+unsigned long __threadid(void);
+#define _threadid     __threadid()
+void * __threadhandle(void);
+
+
 #ifndef        _NO_OLDNAMES
 
 #define cwait          _cwait
diff --git a/reactos/include/crtdll/search.h b/reactos/include/crtdll/search.h
new file mode 100644 (file)
index 0000000..d4268db
--- /dev/null
@@ -0,0 +1,35 @@
+
+#ifndef _SEARCH_H_
+#define _SEARCH_H_
+
+//char    *key
+//void    *data
+
+//enum { FIND, ENTER } ACTION;
+//enum { preorder, postorder, endorder, leaf } VISIT;
+
+#include <crtdll/stddef.h>
+#include <crtdll/sys/types.h> 
+
+
+//The Single UNIX Â® Specification, Version 2 Copyright Â© 1997 The Open Group 
+
+//int    hcreate(size_t);
+//void   hdestroy(void);
+//ENTRY *hsearch(ENTRY, ACTION);
+//void   insque(void *, void *);
+void  *_lfind(const void *, const void *, size_t *,
+               size_t, int (*)(const void *, const void *));
+void  *_lsearch(const void *, void *, size_t *,
+               size_t, int (*)(const void *, const void *));
+//void   remque(void *);
+//void  *tdelete(const void *, void **,
+//               int(*)(const void *, const void *));
+//void  *tfind(const void *, void *const *,
+//               int(*)(const void *, const void *));
+//void  *tsearch(const void *, void **,
+//               int(*)(const void *, const void *));
+//void   twalk(const void *,
+//             void (*)(const void *, VISIT, int ));
+
+#endif
\ No newline at end of file
index 602dde0..d1d41a5 100644 (file)
@@ -28,9 +28,9 @@
  *  DISCLAMED. This includes but is not limited to warranties of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Revision: 1.2 $
- * $Author: rex $
- * $Date: 1999/03/19 05:55:09 $
+ * $Revision: 1.3 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:06 $
  *
  */
 
@@ -169,4 +169,5 @@ typedef     __WINT_TYPE__           wint_t;
 #define        offsetof(TYPE, MEMBER)  ((size_t) &( ((TYPE *) 0)->MEMBER ))
 #endif /* _STDDEF_H_ */
 
+
 #endif /* not _STDDEF_H_ */
index 85f4ef8..1f2bc69 100644 (file)
@@ -1,34 +1,51 @@
-/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
+/*
+ * stdio.h
+ *
+ * Definitions of types and prototypes of functions for standard input and
+ * output.
+ *
+ * NOTE: The file manipulation functions provided by Microsoft seem to
+ * work with either slash (/) or backslash (\) as the path separator.
+ *
+ * This file is part of the Mingw32 package.
+ *
+ * Contributors:
+ *  Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
+ *
+ *  THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ *  This source code is offered for use in the public domain. You may
+ *  use, modify or distribute it freely.
+ *
+ *  This code is distributed in the hope that it will be useful but
+ *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ *  DISCLAMED. This includes but is not limited to warranties of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $Revision: 1.3 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:06 $
+ *
+ */
+/* Appropriated for Reactos Crtdll by Ariadne */
+/* implemented clearerr feof ferror perror as macros */
+/* added _IOCOMMIT */
+/* added filbuf and flsbuf and fwalk   */
 
-#ifndef __dj_include_stdio_h_
-#define __dj_include_stdio_h_
+#ifndef _STDIO_H_
+#define        _STDIO_H_
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef __dj_ENFORCE_ANSI_FREESTANDING
+#define __need_size_t
+#define __need_NULL
+#define __need_wchar_t
+#include <crtdll/stddef.h>
 
-#include <sys/djtypes.h>
-  
-#define _IOFBF         00001
-#define _IONBF         00002
-#define _IOLBF         00004
-
-#define BUFSIZ         16384
-#define EOF            (-1)
-#define FILENAME_MAX   260
-#define FOPEN_MAX      20
-#define L_tmpnam       260
-#ifndef NULL
-#define NULL           0
-#endif
-#define TMP_MAX                999999
-
-#define SEEK_SET       0
-#define SEEK_CUR       1
-#define SEEK_END       2
 
+/* Some flags for the iobuf structure provided by djgpp stdio.h */
 #define _IOREAD   000010
 #define _IOWRT    000020
 #define _IOMYBUF  000040
@@ -40,14 +57,23 @@ extern "C" {
 #define _IORMONCL 004000  /* remove on close, for temp files */
 /* if _flag & _IORMONCL, ._name_to_remove needs freeing */
 #define _IOUNGETC 010000  /* there is an ungetc'ed character in the buffer */
+#define _IOCOMMIT 0x4000
 
 
-#include <internal/types.h>
-
-__DJ_va_list
-#undef __DJ_va_list
-#define __DJ_va_list
+/*
+ * I used to include stdarg.h at this point, in order to allow for the
+ * functions later on in the file which use va_list. That conflicts with
+ * using stdio.h and varargs.h in the same file, so I do the typedef myself.
+ */
+#ifndef _VA_LIST
+#define _VA_LIST
+typedef        char* va_list;
+#endif
 
+/*
+ * FILE should be used as a pointer to an opaque data type. Do not rely on
+ * anything else, especially the size or contents of this structure!
+ */
 #ifndef _FILE_DEFINED
 typedef struct {
   char *_ptr;
@@ -62,96 +88,260 @@ typedef struct {
 #define _FILE_DEFINED
 #endif
 
-typedef unsigned long          fpos_t;
-
-extern FILE _iob[];
 
+/*
+ * The three standard file pointers provided by the run time library.
+ * NOTE: These will go to the bit-bucket silently in GUI applications!
+ */
+extern FILE (*__imp__iob)[];   /* A pointer to an array of FILE */
+#define _iob   (*__imp__iob)   /* An array of FILE */
 #define stdin  (&_iob[0])
 #define stdout (&_iob[1])
 #define stderr (&_iob[2])
 #define stdaux (&_iob[3])
 #define stdprn (&_iob[4])
 
-void   clearerr(FILE *_stream);
-int    fclose(FILE *_stream);
-int    feof(FILE *_stream);
-int    ferror(FILE *_stream);
-int    fflush(FILE *_stream);
-int    fgetc(FILE *_stream);
-int    fgetpos(FILE *_stream, fpos_t *_pos);
-char * fgets(char *_s, int _n, FILE *_stream);
-FILE * fopen(const char *_filename, const char *_mode);
-int    fprintf(FILE *_stream, const char *_format, ...);
-int    fputc(int _c, FILE *_stream);
-int    fputs(const char *_s, FILE *_stream);
-size_t fread(void *_ptr, size_t _size, size_t _nelem, FILE *_stream);
-FILE * freopen(const char *_filename, const char *_mode, FILE *_stream);
-int    fscanf(FILE *_stream, const char *_format, ...);
-int    fseek(FILE *_stream, long _offset, int _mode);
-int    fsetpos(FILE *_stream, const fpos_t *_pos);
-long   ftell(FILE *_stream);
-size_t fwrite(const void *_ptr, size_t _size, size_t _nelem, FILE *_stream);
-int    getc(FILE *_stream);
-int    getchar(void);
-char * gets(char *_s);
-void   perror(const char *_s);
-int    printf(const char *_format, ...);
-int    putc(int _c, FILE *_stream);
-int    putchar(int _c);
-int    puts(const char *_s);
-int    remove(const char *_filename);
-int    rename(const char *_old, const char *_new);
-void   rewind(FILE *_stream);
-int    scanf(const char *_format, ...);
-void   setbuf(FILE *_stream, char *_buf);
-int    setvbuf(FILE *_stream, char *_buf, int _mode, size_t _size);
-int    sprintf(char *_s, const char *_format, ...);
-int    sscanf(const char *_s, const char *_format, ...);
-FILE * tmpfile(void);
-char * tmpnam(char *_s);
-char * _tmpnam(char *_s);
-int    ungetc(int _c, FILE *_stream);
-int    vfprintf(FILE *_stream, const char *_format, va_list _ap);
-int    vprintf(const char *_format, va_list _ap);
-int    vsprintf(char *_s, const char *_format, va_list _ap);
+/* Returned by various functions on end of file condition or error. */
+#define        EOF     (-1)
+
+
+/*
+ * The maximum length of a file name. You should use GetVolumeInformation
+ * instead of this constant. But hey, this works.
+ *
+ * NOTE: This is used in the structure _finddata_t (see dir.h) so changing it
+ *       is probably not a good idea.
+ */
+#define        FILENAME_MAX    (260)
+
+/*
+ * The maximum number of files that may be open at once. I have set this to
+ * a conservative number. The actual value may be higher.
+ */
+#define FOPEN_MAX      (20)
+
+
+/*
+ * File Operations
+ */
+
+FILE*  fopen (const char* szFileName, const char* szMode);
+FILE*  freopen (const char* szNewFileName, const char* szNewMode,
+                FILE* fileChangeAssociation);
+int    fflush (FILE* fileFlush);
+int    fclose (FILE* fileClose);
+#define fcloseall      _fcloseall
+int    remove (const char* szFileName);
+int    rename (const char* szOldFileName, const char* szNewFileName);
+FILE*  tmpfile (void);
+
+int    _filbuf(FILE *f);
+int    _flsbuf(int c, FILE *f); 
+void   _fwalk(void (*func)(FILE *)); // not exported
+int    _fcloseall( void );
+
+
+/*
+ * The maximum size of name (including NUL) that will be put in the user
+ * supplied buffer caName.
+ * NOTE: This has not been determined by experiment, but based on the
+ * maximum file name length above it is probably reasonable. I could be
+ * wrong...
+ */
+#define        L_tmpnam        (260)
+
+char*  tmpnam (char caName[]);
+char*  _tempnam (const char *szDir, const char *szPfx);
+
+#ifndef _NO_OLDNAMES
+#define        tempnam _tempnam
+#endif  /* Not _NO_OLDNAMES */
+
+/*
+ * The three possible buffering mode (nMode) values for setvbuf.
+ * NOTE: _IOFBF works, but _IOLBF seems to work like unbuffered...
+ * maybe I'm testing it wrong?
+ */
+#define        _IOFBF  0       /* fully buffered */
+#define        _IOLBF  1       /* line buffered */
+#define        _IONBF  2       /* unbuffered */
+
+int    setvbuf (FILE* fileSetBuffer, char* caBuffer, int nMode,
+                size_t sizeBuffer);
+
+
+/*
+ * The buffer size as used by setbuf such that it is equivalent to
+ * (void) setvbuf(fileSetBuffer, caBuffer, _IOFBF, BUFSIZ).
+ */
+#define        BUFSIZ  512
+
+void   setbuf (FILE* fileSetBuffer, char* caBuffer);
+
+/*
+ * Pipe Operations
+ */
+  
+int    _pclose (FILE* pipeClose);
+FILE*  _popen (const char* szPipeName, const char* szMode);
+
+#define        popen _popen
+#define        pclose _pclose
+
+/* Wide character version */
+FILE*  _wpopen (const wchar_t* szPipeName, const wchar_t* szMode);
+
+/*
+ * Formatted Output
+ */
+
+int    fprintf (FILE* filePrintTo, const char* szFormat, ...);
+int    printf (const char* szFormat, ...);
+int    sprintf (char* caBuffer, const char* szFormat, ...);
+int    vfprintf (FILE* filePrintTo, const char* szFormat, va_list varg);
+int    vprintf (const char* szFormat, va_list varg);
+int    vsprintf (char* caBuffer, const char* szFormat, va_list varg);
+
+/* Wide character versions */
+int    fwprintf (FILE* filePrintTo, const wchar_t* wsFormat, ...);
+int    wprintf (const wchar_t* wsFormat, ...);
+int    swprintf (wchar_t* wcaBuffer, const wchar_t* wsFormat, ...);
+int    vfwprintf (FILE* filePrintTo, const wchar_t* wsFormat, va_list varg);
+int    vwprintf (const wchar_t* wsFormat, va_list varg);
+int    vswprintf (wchar_t* wcaBuffer, const wchar_t* wsFormat, va_list varg);
+
+/*
+ * Formatted Input
+ */
+
+int    fscanf (FILE* fileReadFrom, const char* szFormat, ...);
+int    scanf (const char* szFormat, ...);
+int    sscanf (const char* szReadFrom, const char* szFormat, ...);
+
+/* Wide character versions */
+int    fwscanf (FILE* fileReadFrom, const wchar_t* wsFormat, ...);
+int    wscanf (const wchar_t* wsFormat, ...);
+int    swscanf (const wchar_t* wsReadFrom, const wchar_t* wsFormat, ...);
+
+/*
+ * Character Input and Output Functions
+ */
+
+int    fgetc (FILE* fileRead);
+char*  fgets (char* caBuffer, int nBufferSize, FILE* fileRead);
+int    fputc (int c, FILE* fileWrite);
+int    fputs (const char* szOutput, FILE* fileWrite);
+int    getc (FILE* fileRead);
+int    getchar (void);
+char*  gets (char* caBuffer);  /* Unsafe: how does gets know how long the
+                                * buffer is? */
+int    putc (int c, FILE* fileWrite);
+int    putchar (int c);
+int    puts (const char* szOutput);
+int    ungetc (int c, FILE* fileWasRead);
+
+/* Wide character versions */
+int    fgetwc (FILE* fileRead);
+int    fputwc (wchar_t wc, FILE* fileWrite);
+int    ungetwc (wchar_t wc, FILE* fileWasRead);
+
+/*
+ * Not exported by CRTDLL.DLL included for reference purposes.
+ */
+#if 0
+wchar_t*       fgetws (wchar_t* wcaBuffer, int nBufferSize, FILE* fileRead);
+int            fputws (const wchar_t* wsOutput, FILE* fileWrite);
+int            getwc (FILE* fileRead);
+int            getwchar ();
+wchar_t*       getws (wchar_t* wcaBuffer);
+int            putwc (wchar_t wc, FILE* fileWrite);
+int            putws (const wchar_t* wsOutput);
+#endif /* 0 */
+
+/* NOTE: putchar has no wide char equivalent even in tchar.h */
+
+
+/*
+ * Direct Input and Output Functions
+ */
+
+size_t fread (void* pBuffer, size_t sizeObject, size_t sizeObjCount,
+               FILE* fileRead);
+size_t fwrite (const void* pObjArray, size_t sizeObject, size_t sizeObjCount,
+               FILE* fileWrite);
+
+
+/*
+ * File Positioning Functions
+ */
+
+/* Constants for nOrigin indicating the position relative to which fseek
+ * sets the file position. Enclosed in ifdefs because io.h could also
+ * define them. (Though not anymore since io.h includes this file now.) */
+#ifndef        SEEK_SET
+#define SEEK_SET       (0)
+#endif
+
+#ifndef        SEEK_CUR
+#define        SEEK_CUR        (1)
+#endif
+
+#ifndef        SEEK_END
+#define SEEK_END       (2)
+#endif
+
+int    fseek   (FILE* fileSetPosition, long lnOffset, int nOrigin);
+long   ftell   (FILE* fileGetPosition);
+void   rewind  (FILE* fileRewind);
+
+/*
+ * An opaque data type used for storing file positions... The contents of
+ * this type are unknown, but we (the compiler) need to know the size
+ * because the programmer using fgetpos and fsetpos will be setting aside
+ * storage for fpos_t structres. Actually I tested using a byte array and
+ * it is fairly evident that the fpos_t type is a long (in CRTDLL.DLL).
+ * Perhaps an unsigned long? TODO?
+ */
+typedef long   fpos_t;
+
+int    fgetpos (FILE* fileGetPosition, fpos_t* pfpos);
+int    fsetpos (FILE* fileSetPosition, const fpos_t* pfpos);
+
+
+/*
+ * Error Functions
+ */
+#if 0
+void   clearerr (FILE* fileClearErrors);
+int    feof (FILE* fileIsAtEnd);
+int    ferror (FILE* fileIsError);
+void   perror (const char* szErrorMessage);
+
+#endif
+
+#define  clearerr(f)     (((f)->_flag) &= ~(_IOERR|_IOEOF))
+#define feof(f)                (((f)->_flag&_IOEOF)!=0)
+#define ferror(f)      (((f)->_flag&_IOERR)!=0)
+#define  perror(s)     (fprintf(stderr, "%s: %s\n", (s), _strerror(NULL)))
+/*
+ * Non ANSI functions
+ */
 
 #ifndef __STRICT_ANSI__
+int    _fgetchar (void);
+int    _fputchar (int c);
+FILE*  _fdopen (int nHandle, char* szMode);
+
+#ifndef _NO_OLDNAMES
+#define        fgetchar        _fgetchar
+#define        fputchar        _fputchar
+#define        fdopen          _fdopen
+#endif /* Not _NO_OLDNAMES */
 
-#define L_ctermid
-#define L_cusrid
-/* #define STREAM_MAX  20 - DOS can change this */
-
-int    fileno(FILE *_stream);
-int    _fileno(FILE *_stream);
-FILE * fdopen(int _fildes, const char *_type);
-int    pclose(FILE *_pf);
-FILE * popen(const char *_command, const char *_mode);
-
-#ifndef _POSIX_SOURCE
-
-void   _djstat_describe_lossage(FILE *_to_where);
-int    _doprnt(const char *_fmt, va_list _args, FILE *_f);
-int    _doscan(FILE *_f, const char *_fmt, void **_argp);
-int    _doscan_low(FILE *, int (*)(FILE *_get), int (*_unget)(int, FILE *), const char *_fmt, void **_argp);
-int    fpurge(FILE *_f);
-int    getw(FILE *_f);
-int    mkstemp(char *_template);
-char * mktemp(char *_template);
-int    putw(int _v, FILE *_f);
-void   setbuffer(FILE *_f, void *_buf, int _size);
-void   setlinebuf(FILE *_f);
-char * tempnam(const char *_dir, const char *_prefix);
-int    _rename(const char *_old, const char *_new);    /* Simple (no directory) */
-
-#endif /* !_POSIX_SOURCE */
-#endif /* !__STRICT_ANSI__ */
-#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
-
-#ifndef __dj_ENFORCE_FUNCTION_CALLS
-#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
+#endif /* Not __STRICT_ANSI__ */
 
 #ifdef __cplusplus
 }
 #endif
 
-#endif /* !__dj_include_stdio_h_ */
+#endif /* _STDIO_H_ */
index 953255a..f46138d 100644 (file)
  *  DISCLAMED. This includes but is not limited to warranties of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Revision: 1.2 $
- * $Author: rex $
- * $Date: 1999/03/19 05:55:09 $
+ * $Revision: 1.3 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:06 $
  *
  */
 /* Appropriated for Reactos Crtdll by Ariadne */
 /* added splitpath */
+/* changed definition of environ and argc */
+/* moved prototype for swab from string.h to stdlib.h */
 #ifndef _STDLIB_H_
 #define _STDLIB_H_
 
@@ -38,21 +40,26 @@ extern "C" {
  * argc and argv. environ is a pointer to a table of environment variables.
  * NOTE: Strings in _argv and environ are ANSI strings.
  */
-extern int     _argc;
-extern char**  _argv;
-extern char**  environ;
+extern int*    __argc_dll;
+extern char*** __argv_dll;
+extern char*** _environ_dll;
+#define __argc      (*__argc_dll)
+#define __argv      (*__argv_dll)
+#define _environ    (*_environ_dll)
 
 
 #define __need_size_t
 #define __need_wchar_t
 #define __need_NULL
-#include <stddef.h>
+#include <crtdll/stddef.h>
 
+#ifndef  __ATTRIB_NORETURN
 #ifdef __GNUC__
 #define        _ATTRIB_NORETURN        __attribute__ ((noreturn))
 #else  /* Not __GNUC__ */
 #define        _ATTRIB_NORETURN
 #endif /* __GNUC__ */
+#endif
 
 double atof    (const char* szNumber);
 int    atoi    (const char* szNumber);
@@ -97,7 +104,7 @@ void free    (void* pObject);
 #define        EXIT_SUCCESS    0
 #define        EXIT_FAILURE    -1
 
-void   abort   (void) _ATTRIB_NORETURN;
+void   abort   (void)  _ATTRIB_NORETURN;
 void   exit    (int nStatus) _ATTRIB_NORETURN;
 int    atexit  (void (*pfuncExitProcessing)(void));
 
@@ -159,6 +166,8 @@ char*       _gcvt (double dValue, int nDec, char* caBuf);
 
 char*  _fullpath (char* caBuf, const char* szPath, size_t sizeMax);
 
+void   _swab (const char* caFrom, char* caTo, size_t sizeToCopy);
+
 #ifndef        _NO_OLDNAMES
 #define         beep           _beep
 #define  seterrormode  _seterrormode 
@@ -173,6 +182,8 @@ char*       _fullpath (char* caBuf, const char* szPath, size_t sizeMax);
 #define  ecvt          _ecvt
 #define  fcvt          _fcvt
 #define  gcvt          _gcvt
+
+#define  swab          _swab
 #endif /* Not _NO_OLDNAMES */
 
 #endif /* Not __STRICT_ANSI__ */
diff --git a/reactos/include/crtdll/string.h b/reactos/include/crtdll/string.h
new file mode 100644 (file)
index 0000000..7244484
--- /dev/null
@@ -0,0 +1,922 @@
+/*
+ * string.h
+ *
+ * Definitions for memory and string functions.
+ *
+ * This file is part of the Mingw32 package.
+ *
+ * Contributors:
+ *  Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
+ *
+ *  THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ *  This source code is offered for use in the public domain. You may
+ *  use, modify or distribute it freely.
+ *
+ *  This code is distributed in the hope that it will be useful but
+ *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ *  DISCLAMED. This includes but is not limited to warranties of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $Revision: 1.1 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:06 $
+ *
+ */
+/* Appropriated for Reactos Crtdll by Ariadne */
+/* changed prototype for _strerror */
+/* moved prototype for swab from string.h to stdlib.h */
+#ifndef _LINUX_WSTRING_H_
+#define _LINUX_WSTRING_H_
+
+#ifndef _LINUX_STRING_H_
+#define _LINUX_STRING_H_
+
+#ifndef _STRING_H_
+#define        _STRING_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Define size_t, wchar_t and NULL
+ */
+#define __need_size_t
+#define __need_wchar_t
+#define        __need_NULL
+#include <crtdll/stddef.h>
+
+char * ___strtok; // removed extern specifier 02-06-98, BD
+
+/*
+ * Prototypes of the ANSI Standard C library string functions.
+ */
+void*  memchr (const void* p, int cSearchFor, size_t sizeSearch);
+int    memcmp (const void* p1, const void* p2, size_t sizeSearch);
+void*  memcpy (void* pCopyTo, const void* pSource, size_t sizeSource);
+void*  memmove (void* pMoveTo, const void* pSource, size_t sizeSource);
+void*  memset (void* p, int cFill, size_t sizeRepeatCount);
+char*  strcat (char* szAddTo, const char* szAdd);
+char*  strchr (const char* szSearch, int cFor);
+int    strcmp (const char* sz1, const char* sz2);
+int    strcoll (const char* sz1, const char* sz2); /* Compare using locale */
+char*  strcpy (char* szCopyTo, const char* szSource);
+size_t strcspn (const char* szGetPrefix, const char* szNotIncluding);
+char*  strerror (int nError); /* NOTE: NOT an old name wrapper. */
+char *  _strerror(const char *s);
+size_t strlen (const char* sz);
+char*  strncat (char* szAddTo, const char* szAdd, size_t sizeMaxAdd);
+int    strncmp (const char* sz1, const char* sz2, size_t sizeMaxCompare);
+char*  strncpy (char* szCopyTo, const char* szSource, size_t sizeMaxCopy);
+char*  strpbrk (const char* szSearch, const char* szAnyOf);
+char*  strrchr (const char* szSearch, int cFor);
+size_t strspn (const char* szGetPrefix, const char *szIncluding);
+char*  strstr (const char* szSearch, const char *szFor);
+char*  strtok (char* szTokenize, const char* szDelimiters);
+size_t strxfrm (char* szTransformed, const char *szSource,
+                size_t sizeTransform);
+
+#ifndef __STRICT_ANSI__
+/*
+ * Extra non-ANSI functions provided by the CRTDLL library
+ */
+void*  _memccpy (void* pCopyTo, const void* pSource, int cTerminator,
+                 size_t sizeMaxCopy);
+int    _memicmp (const void* p1, const void* p2, size_t sizeSearch);
+char*  _strdup (const char *szDuplicate);
+int    _strcmpi (const char* sz1, const char* sz2);
+int    _stricmp (const char* sz1, const char* sz2);
+int    _stricoll (const char* sz1, const char* sz2);
+char*  _strlwr (char* szToConvert);
+int    _strnicmp (const char* sz1, const char* sz2,
+                  size_t sizeMaxCompare);
+char*  _strnset (char* szToFill, int cFill, size_t sizeMaxFill);
+char*  _strrev (char* szToReverse);
+char*  _strset (char* szToFill, int cFill);
+char*  _strupr (char* szToConvert);
+
+
+#endif /* Not __STRICT_ANSI__ */
+
+
+/*
+ * Unicode versions of the standard calls.
+ */
+wchar_t* wcscat (wchar_t* wsAddTo, const wchar_t* wsAdd);
+wchar_t* wcschr (const wchar_t* wsSearch, wchar_t wcFor);
+int    wcscmp (const wchar_t* ws1, const wchar_t* ws2);
+int    wcscoll (const wchar_t* ws1, const wchar_t* ws2);
+wchar_t* wcscpy (wchar_t* wsCopyTo, const wchar_t* wsSource);
+size_t wcscspn (const wchar_t* wsGetPrefix, const wchar_t* wsNotIncluding);
+/* Note: No wcserror in CRTDLL. */
+size_t wcslen (const wchar_t* ws);
+wchar_t* wcsncat (wchar_t* wsAddTo, const wchar_t* wsAdd, size_t sizeMaxAdd);
+int    wcsncmp(const wchar_t* ws1, const wchar_t* ws2, size_t sizeMaxCompare);
+wchar_t* wcsncpy(wchar_t* wsCopyTo, const wchar_t* wsSource,
+                 size_t sizeMaxCopy);
+wchar_t* wcspbrk(const wchar_t* wsSearch, const wchar_t* wsAnyOf);
+wchar_t* wcsrchr(const wchar_t* wsSearch, wchar_t wcFor);
+size_t wcsspn(const wchar_t* wsGetPrefix, const wchar_t* wsIncluding);
+wchar_t* wcsstr(const wchar_t* wsSearch, const wchar_t* wsFor);
+wchar_t* wcstok(wchar_t* wsTokenize, const wchar_t* wsDelimiters);
+size_t wcsxfrm(wchar_t* wsTransformed, const wchar_t *wsSource,
+               size_t sizeTransform);
+
+
+#ifndef        __STRICT_ANSI__
+/*
+ * Unicode versions of non-ANSI functions provided by CRTDLL.
+ */
+
+/* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */
+#define                _wcscmpi        _wcsicmp
+
+wchar_t* _wcsdup (const wchar_t* wsToDuplicate);
+int    _wcsicmp (const wchar_t* ws1, const wchar_t* ws2);
+int    _wcsicoll (const wchar_t* ws1, const wchar_t* ws2);
+wchar_t* _wcslwr (wchar_t* wsToConvert);
+int    _wcsnicmp (const wchar_t* ws1, const wchar_t* ws2,
+                  size_t sizeMaxCompare);
+wchar_t* _wcsnset (wchar_t* wsToFill, wchar_t wcFill, size_t sizeMaxFill);
+wchar_t* _wcsrev (wchar_t* wsToReverse);
+wchar_t* _wcsset (wchar_t* wsToFill, wchar_t wcToFill);
+wchar_t* _wcsupr (wchar_t* wsToConvert);
+
+#endif /* Not __STRICT_ANSI__ */
+
+
+#ifndef        __STRICT_ANSI__
+#ifndef        _NO_OLDNAMES
+
+/*
+ * Non-underscored versions of non-ANSI functions. They live in liboldnames.a
+ * and provide a little extra portability. Also a few extra UNIX-isms like
+ * strcasecmp.
+ */
+
+void*  memccpy (void* pCopyTo, const void* pSource, int cTerminator,
+                size_t sizeMaxCopy);
+int    memicmp (const void* p1, const void* p2, size_t sizeSearch);
+#define        strdup(szDuplicate)     _strdup(szDuplicate)
+int    strcmpi (const char* sz1, const char* sz2);
+int    stricmp (const char* sz1, const char* sz2);
+int    strcasecmp (const char* sz1, const char* sz2);
+int    stricoll (const char* sz1, const char* sz2);
+char*  strlwr (char* szToConvert);
+int    strnicmp (const char* sz1, const char* sz2, size_t sizeMaxCompare);
+int    strncasecmp (const char* sz1, const char* sz2, size_t sizeMaxCompare);
+char*  strnset (char* szToFill, int cFill, size_t sizeMaxFill);
+char*  strrev (char* szToReverse);
+char*  strset (char* szToFill, int cFill);
+char*  strupr (char* szToConvert);
+
+
+/* NOTE: There is no _wcscmpi, but this is for compatibility. */
+int    wcscmpi (const wchar_t* ws1, const wchar_t* ws2);
+wchar_t* wcsdup (const wchar_t* wsToDuplicate);
+int    wcsicmp (const wchar_t* ws1, const wchar_t* ws2);
+int    wcsicoll (const wchar_t* ws1, const wchar_t* ws2);
+wchar_t* wcslwr (wchar_t* wsToConvert);
+int    wcsnicmp (const wchar_t* ws1, const wchar_t* ws2,
+                 size_t sizeMaxCompare);
+wchar_t* wcsnset (wchar_t* wsToFill, wchar_t wcFill, size_t sizeMaxFill);
+wchar_t* wcsrev (wchar_t* wsToReverse);
+wchar_t* wcsset (wchar_t* wsToFill, wchar_t wcToFill);
+wchar_t* wcsupr (wchar_t* wsToConvert);
+
+#endif /* Not _NO_OLDNAMES */
+#endif /* Not strict ANSI */
+
+
+
+/*
+ * Include machine specific inline routines
+ */
+#ifndef _I386_STRING_H_
+#define _I386_STRING_H_
+
+/*
+ * On a 486 or Pentium, we are better off not using the
+ * byte string operations. But on a 386 or a PPro the
+ * byte string ops are faster than doing it by hand
+ * (MUCH faster on a Pentium).
+ *
+ * Also, the byte strings actually work correctly. Forget
+ * the i486 routines for now as they may be broken..
+ */
+#if FIXED_486_STRING && (CPU == 486 || CPU == 586)
+       #include <crtdll/asm/string-486.h>
+#else
+
+/*
+ * This string-include defines all string functions as inline
+ * functions. Use gcc. It also assumes ds=es=data space, this should be
+ * normal. Most of the string-functions are rather heavily hand-optimized,
+ * see especially strtok,strstr,str[c]spn. They should work, but are not
+ * very easy to understand. Everything is done entirely within the register
+ * set, making the functions fast and clean. String instructions have been
+ * used through-out, making for "slightly" unclear code :-)
+ *
+ *             Copyright (C) 1991, 1992 Linus Torvalds
+ */
+
+#define __HAVE_ARCH_STRCPY
+extern inline  char * strcpy(char * dest,const char *src) 
+{
+__asm__ __volatile__(
+       "cld\n"
+       "1:\tlodsb\n\t"
+       "stosb\n\t"
+       "testb %%al,%%al\n\t"
+       "jne 1b"
+       : /* no output */
+       :"S" (src),"D" (dest):"si","di","ax","memory");
+return dest;
+}
+
+#define __HAVE_ARCH_STRNCPY
+extern inline char * strncpy(char * dest,const char *src,size_t count)
+{
+__asm__ __volatile__(
+       "cld\n"
+       "1:\tdecl %2\n\t"
+       "js 2f\n\t"
+       "lodsb\n\t"
+       "stosb\n\t"
+       "testb %%al,%%al\n\t"
+       "jne 1b\n\t"
+       "rep\n\t"
+       "stosb\n"
+       "2:"
+       : /* no output */
+       :"S" (src),"D" (dest),"c" (count):"si","di","ax","cx","memory");
+return dest;
+}
+
+#define __HAVE_ARCH_STRCAT
+extern inline char * strcat(char * dest,const char * src)
+{
+__asm__ __volatile__(
+       "cld\n\t"
+       "repne\n\t"
+       "scasb\n\t"
+       "decl %1\n"
+       "1:\tlodsb\n\t"
+       "stosb\n\t"
+       "testb %%al,%%al\n\t"
+       "jne 1b"
+       : /* no output */
+       :"S" (src),"D" (dest),"a" (0),"c" (0xffffffff):"si","di","ax","cx");
+return dest;
+}
+
+#define __HAVE_ARCH_STRNCAT
+extern inline char * strncat(char * dest,const char * src,size_t count)
+{
+__asm__ __volatile__(
+       "cld\n\t"
+       "repne\n\t"
+       "scasb\n\t"
+       "decl %1\n\t"
+       "movl %4,%3\n"
+       "1:\tdecl %3\n\t"
+       "js 2f\n\t"
+       "lodsb\n\t"
+       "stosb\n\t"
+       "testb %%al,%%al\n\t"
+       "jne 1b\n"
+       "2:\txorl %2,%2\n\t"
+       "stosb"
+       : /* no output */
+       :"S" (src),"D" (dest),"a" (0),"c" (0xffffffff),"g" (count)
+       :"si","di","ax","cx","memory");
+return dest;
+}
+
+#define __HAVE_ARCH_STRCMP
+extern inline int strcmp(const char * cs,const char * ct)
+{
+register int __res;
+__asm__ __volatile__(
+       "cld\n"
+       "1:\tlodsb\n\t"
+       "scasb\n\t"
+       "jne 2f\n\t"
+       "testb %%al,%%al\n\t"
+       "jne 1b\n\t"
+       "xorl %%eax,%%eax\n\t"
+       "jmp 3f\n"
+       "2:\tsbbl %%eax,%%eax\n\t"
+       "orb $1,%%eax\n"
+       "3:"
+       :"=a" (__res):"S" (cs),"D" (ct):"si","di");
+return __res;
+}
+
+#define __HAVE_ARCH_STRNCMP
+extern inline int strncmp(const char * cs,const char * ct,size_t count)
+{
+register int __res;
+__asm__ __volatile__(
+       "cld\n"
+       "1:\tdecl %3\n\t"
+       "js 2f\n\t"
+       "lodsb\n\t"
+       "scasb\n\t"
+       "jne 3f\n\t"
+       "testb %%al,%%al\n\t"
+       "jne 1b\n"
+       "2:\txorl %%eax,%%eax\n\t"
+       "jmp 4f\n"
+       "3:\tsbbl %%eax,%%eax\n\t"
+       "orb $1,%%al\n"
+       "4:"
+       :"=a" (__res):"S" (cs),"D" (ct),"c" (count):"si","di","cx");
+return __res;
+}
+
+#define __HAVE_ARCH_STRCHR
+extern inline char * strchr(const char * s, int c)
+{
+register char * __res;
+__asm__ __volatile__(
+       "cld\n\t"
+       "movb %%al,%%ah\n"
+       "1:\tlodsb\n\t"
+       "cmpb %%ah,%%al\n\t"
+       "je 2f\n\t"
+       "testb %%al,%%al\n\t"
+       "jne 1b\n\t"
+       "movl $1,%1\n"
+       "2:\tmovl %1,%0\n\t"
+       "decl %0"
+       :"=a" (__res):"S" (s),"0" (c):"si");
+return __res;
+}
+
+#define __HAVE_ARCH_STRRCHR
+extern inline char * strrchr(const char * s, int c)
+{
+register char * __res;
+__asm__ __volatile__(
+       "cld\n\t"
+       "movb %%al,%%ah\n"
+       "1:\tlodsb\n\t"
+       "cmpb %%ah,%%al\n\t"
+       "jne 2f\n\t"
+       "leal -1(%%esi),%0\n"
+       "2:\ttestb %%al,%%al\n\t"
+       "jne 1b"
+       :"=d" (__res):"0" (0),"S" (s),"a" (c):"ax","si");
+return __res;
+}
+
+#define __HAVE_ARCH_STRSPN
+extern inline size_t strspn(const char * cs, const char * ct)
+{
+register char * __res;
+__asm__ __volatile__(
+       "cld\n\t"
+       "movl %4,%%edi\n\t"
+       "repne\n\t"
+       "scasb\n\t"
+       "notl %%ecx\n\t"
+       "decl %%ecx\n\t"
+       "movl %%ecx,%%edx\n"
+       "1:\tlodsb\n\t"
+       "testb %%al,%%al\n\t"
+       "je 2f\n\t"
+       "movl %4,%%edi\n\t"
+       "movl %%edx,%%ecx\n\t"
+       "repne\n\t"
+       "scasb\n\t"
+       "je 1b\n"
+       "2:\tdecl %0"
+       :"=S" (__res):"a" (0),"c" (0xffffffff),"0" (cs),"g" (ct)
+       :"ax","cx","dx","di");
+return __res-cs;
+}
+
+#define __HAVE_ARCH_STRCSPN
+extern inline size_t strcspn(const char * cs, const char * ct)
+{
+register char * __res;
+__asm__ __volatile__(
+       "cld\n\t"
+       "movl %4,%%edi\n\t"
+       "repne\n\t"
+       "scasb\n\t"
+       "notl %%ecx\n\t"
+       "decl %%ecx\n\t"
+       "movl %%ecx,%%edx\n"
+       "1:\tlodsb\n\t"
+       "testb %%al,%%al\n\t"
+       "je 2f\n\t"
+       "movl %4,%%edi\n\t"
+       "movl %%edx,%%ecx\n\t"
+       "repne\n\t"
+       "scasb\n\t"
+       "jne 1b\n"
+       "2:\tdecl %0"
+       :"=S" (__res):"a" (0),"c" (0xffffffff),"0" (cs),"g" (ct)
+       :"ax","cx","dx","di");
+return __res-cs;
+}
+
+#define __HAVE_ARCH_STRPBRK
+extern inline char * strpbrk(const char * cs,const char * ct)
+{
+register char * __res;
+__asm__ __volatile__(
+       "cld\n\t"
+       "movl %4,%%edi\n\t"
+       "repne\n\t"
+       "scasb\n\t"
+       "notl %%ecx\n\t"
+       "decl %%ecx\n\t"
+       "movl %%ecx,%%edx\n"
+       "1:\tlodsb\n\t"
+       "testb %%al,%%al\n\t"
+       "je 2f\n\t"
+       "movl %4,%%edi\n\t"
+       "movl %%edx,%%ecx\n\t"
+       "repne\n\t"
+       "scasb\n\t"
+       "jne 1b\n\t"
+       "decl %0\n\t"
+       "jmp 3f\n"
+       "2:\txorl %0,%0\n"
+       "3:"
+       :"=S" (__res):"a" (0),"c" (0xffffffff),"0" (cs),"g" (ct)
+       :"ax","cx","dx","di");
+return __res;
+}
+
+#define __HAVE_ARCH_STRSTR
+extern inline char * strstr(const char * cs,const char * ct)
+{
+register char * __res;
+__asm__ __volatile__(
+       "cld\n\t" \
+       "movl %4,%%edi\n\t"
+       "repne\n\t"
+       "scasb\n\t"
+       "notl %%ecx\n\t"
+       "decl %%ecx\n\t"        /* NOTE! This also sets Z if searchstring='' */
+       "movl %%ecx,%%edx\n"
+       "1:\tmovl %4,%%edi\n\t"
+       "movl %%esi,%%eax\n\t"
+       "movl %%edx,%%ecx\n\t"
+       "repe\n\t"
+       "cmpsb\n\t"
+       "je 2f\n\t"             /* also works for empty string, see above */
+       "xchgl %%eax,%%esi\n\t"
+       "incl %%esi\n\t"
+       "cmpb $0,-1(%%eax)\n\t"
+       "jne 1b\n\t"
+       "xorl %%eax,%%eax\n\t"
+       "2:"
+       :"=a" (__res):"0" (0),"c" (0xffffffff),"S" (cs),"g" (ct)
+       :"cx","dx","di","si");
+return __res;
+}
+
+#define __HAVE_ARCH_STRLEN
+extern inline size_t strlen(const char * s)
+{
+register int __res;
+__asm__ __volatile__(
+       "cld\n\t"
+       "repne\n\t"
+       "scasb\n\t"
+       "notl %0\n\t"
+       "decl %0"
+       :"=c" (__res):"D" (s),"a" (0),"0" (0xffffffff):"di");
+return __res;
+}
+
+#define __HAVE_ARCH_STRTOK
+extern inline char * strtok(char * s,const char * ct)
+{
+register char * __res;
+__asm__ __volatile__(
+       "testl %1,%1\n\t"
+       "jne 1f\n\t"
+       "testl %0,%0\n\t"
+       "je 8f\n\t"
+       "movl %0,%1\n"
+       "1:\txorl %0,%0\n\t"
+       "movl $-1,%%ecx\n\t"
+       "xorl %%eax,%%eax\n\t"
+       "cld\n\t"
+       "movl %4,%%edi\n\t"
+       "repne\n\t"
+       "scasb\n\t"
+       "notl %%ecx\n\t"
+       "decl %%ecx\n\t"
+       "je 7f\n\t"                     /* empty delimiter-string */
+       "movl %%ecx,%%edx\n"
+       "2:\tlodsb\n\t"
+       "testb %%al,%%al\n\t"
+       "je 7f\n\t"
+       "movl %4,%%edi\n\t"
+       "movl %%edx,%%ecx\n\t"
+       "repne\n\t"
+       "scasb\n\t"
+       "je 2b\n\t"
+       "decl %1\n\t"
+       "cmpb $0,(%1)\n\t"
+       "je 7f\n\t"
+       "movl %1,%0\n"
+       "3:\tlodsb\n\t"
+       "testb %%al,%%al\n\t"
+       "je 5f\n\t"
+       "movl %4,%%edi\n\t"
+       "movl %%edx,%%ecx\n\t"
+       "repne\n\t"
+       "scasb\n\t"
+       "jne 3b\n\t"
+       "decl %1\n\t"
+       "cmpb $0,(%1)\n\t"
+       "je 5f\n\t"
+       "movb $0,(%1)\n\t"
+       "incl %1\n\t"
+       "jmp 6f\n"
+       "5:\txorl %1,%1\n"
+       "6:\tcmpb $0,(%0)\n\t"
+       "jne 7f\n\t"
+       "xorl %0,%0\n"
+       "7:\ttestl %0,%0\n\t"
+       "jne 8f\n\t"
+       "movl %0,%1\n"
+       "8:"
+       :"=b" (__res),"=S" (___strtok)
+       :"0" (___strtok),"1" (s),"g" (ct)
+       :"ax","cx","dx","di","memory");
+return __res;
+}
+
+
+#define __HAVE_ARCH_STRICMP
+extern inline int stricmp(const char* cs,const char * ct)
+{
+register int __res;
+
+
+__asm__ __volatile__(
+       "cld\n"
+       "1:\tmovb (%%esi), %%eax\n\t"
+       "movb  (%%edi), %%dl \n\t"
+       "cmpb $0x5A, %%al\n\t"
+       "ja 2f\t\n"
+       "cmpb $0x40, %%al\t\n"
+        "jbe 2f\t\n"
+        "addb $0x20, %%al\t\n"
+       "2:\t cmpb $0x5A, %%dl\t\n"
+       "ja 3f\t\n"
+       "cmpb $0x40, %%dl\t\n"
+        "jbe 3f\t\n"
+        "addb $0x20, %%dl\t\n"
+       "3:\t inc %%esi\t\n"
+       "inc %%edi\t\n"
+       "cmpb %%al, %%dl\t\n"
+       "jne 4f\n\t"  
+       "cmpb $00, %%al\n\t"
+       "jne 1b\n\t"
+       "xorl %%eax,%%eax\n\t"
+       "jmp 5f\n"
+       "4:\tsbbl %%eax,%%eax\n\t"
+       "orb $1,%%eax\n"
+       "5:"
+       :"=a" (__res):"S" (cs),"D" (ct):"si","di");
+       
+return __res;
+}
+
+
+#define __HAVE_ARCH_STRNICMP
+extern inline int strnicmp(const char* cs,const char * ct, size_t count)
+{
+register int __res;
+
+
+__asm__ __volatile__(
+       "cld\n"
+       "1:\t decl %3\n\t"
+       "js 6f\n\t"
+       "movb (%%esi), %%al\n\t"
+       "movb  (%%edi), %%dl \n\t"
+       "cmpb $0x5A, %%al\n\t"
+       "ja 2f\t\n"
+       "cmpb $0x40, %%al\t\n"
+        "jbe 2f\t\n"
+        "addb $0x20, %%al\t\n"
+       "2:\t cmpb $0x5A, %%dl\t\n"
+       "ja 3f\t\n"
+       "cmpb $0x40, %%dl\t\n"
+        "jbe 3f\t\n"
+        "addb $0x20, %%dl\t\n"
+       "3:\t inc %%esi\t\n"
+       "inc %%edi\t\n"
+       "cmpb %%al, %%dl\t\n"
+       "jne 4f\n\t"  
+       "cmpb $00, %%al\n\t"
+       "jne 1b\n\t"
+       "6:xorl %%eax,%%eax\n\t"
+       "jmp 5f\n"
+       "4:\tsbbl %%eax,%%eax\n\t"
+       "orb $1,%%eax\n"
+       "5:"
+       :"=a" (__res):"S" (cs),"D" (ct), "c" (count):"si","di", "cx");
+       
+
+return __res;
+}
+
+
+
+
+
+
+extern inline void * __memcpy(void * to, const void * from, size_t n)
+{
+__asm__ __volatile__(
+       "cld\n\t"
+       "rep ; movsl\n\t"
+       "testb $2,%b1\n\t"
+       "je 1f\n\t"
+       "movsw\n"
+       "1:\ttestb $1,%b1\n\t"
+       "je 2f\n\t"
+       "movsb\n"
+       "2:"
+       : /* no output */
+       :"c" (n/4), "q" (n),"D" ((long) to),"S" ((long) from)
+       : "cx","di","si","memory");
+return (to);
+}
+
+/*
+ * This looks horribly ugly, but the compiler can optimize it totally,
+ * as the count is constant.
+ */
+extern inline void * __constant_memcpy(void * to, const void * from, size_t n)
+{
+       switch (n) {
+               case 0:
+                       return to;
+               case 1:
+                       *(unsigned char *)to = *(const unsigned char *)from;
+                       return to;
+               case 2:
+                       *(unsigned short *)to = *(const unsigned short *)from;
+                       return to;
+               case 3:
+                       *(unsigned short *)to = *(const unsigned short *)from;
+                       *(2+(unsigned char *)to) = *(2+(const unsigned char *)from);
+                       return to;
+               case 4:
+                       *(unsigned long *)to = *(const unsigned long *)from;
+                       return to;
+               case 8:
+                       *(unsigned long *)to = *(const unsigned long *)from;
+                       *(1+(unsigned long *)to) = *(1+(const unsigned long *)from);
+                       return to;
+               case 12:
+                       *(unsigned long *)to = *(const unsigned long *)from;
+                       *(1+(unsigned long *)to) = *(1+(const unsigned long *)from);
+                       *(2+(unsigned long *)to) = *(2+(const unsigned long *)from);
+                       return to;
+               case 16:
+                       *(unsigned long *)to = *(const unsigned long *)from;
+                       *(1+(unsigned long *)to) = *(1+(const unsigned long *)from);
+                       *(2+(unsigned long *)to) = *(2+(const unsigned long *)from);
+                       *(3+(unsigned long *)to) = *(3+(const unsigned long *)from);
+                       return to;
+               case 20:
+                       *(unsigned long *)to = *(const unsigned long *)from;
+                       *(1+(unsigned long *)to) = *(1+(const unsigned long *)from);
+                       *(2+(unsigned long *)to) = *(2+(const unsigned long *)from);
+                       *(3+(unsigned long *)to) = *(3+(const unsigned long *)from);
+                       *(4+(unsigned long *)to) = *(4+(const unsigned long *)from);
+                       return to;
+       }
+#define COMMON(x) \
+__asm__("cld\n\t" \
+       "rep ; movsl" \
+       x \
+       : /* no outputs */ \
+       : "c" (n/4),"D" ((long) to),"S" ((long) from) \
+       : "cx","di","si","memory");
+
+       switch (n % 4) {
+               case 0: COMMON(""); return to;
+               case 1: COMMON("\n\tmovsb"); return to;
+               case 2: COMMON("\n\tmovsw"); return to;
+               case 3: COMMON("\n\tmovsw\n\tmovsb"); return to;
+       }
+#undef COMMON
+}
+
+#define __HAVE_ARCH_MEMCPY
+#define memcpy(t, f, n) \
+(__builtin_constant_p(n) ? \
+ __constant_memcpy((t),(f),(n)) : \
+ __memcpy((t),(f),(n)))
+
+#define __HAVE_ARCH_MEMMOVE
+extern inline void * memmove(void * dest,const void * src, size_t n)
+{
+if (dest<src)
+__asm__ __volatile__(
+       "cld\n\t"
+       "rep\n\t"
+       "movsb"
+       : /* no output */
+       :"c" (n),"S" (src),"D" (dest)
+       :"cx","si","di");
+else
+__asm__ __volatile__(
+       "std\n\t"
+       "rep\n\t"
+       "movsb\n\t"
+       "cld"
+       : /* no output */
+       :"c" (n),
+        "S" (n-1+(const char *)src),
+        "D" (n-1+(char *)dest)
+       :"cx","si","di","memory");
+return dest;
+}
+
+#define memcmp __builtin_memcmp
+
+#define __HAVE_ARCH_MEMCHR
+extern inline void * memchr(const void * cs,int c,size_t count)
+{
+register void * __res;
+if (!count)
+       return NULL;
+__asm__ __volatile__(
+       "cld\n\t"
+       "repne\n\t"
+       "scasb\n\t"
+       "je 1f\n\t"
+       "movl $1,%0\n"
+       "1:\tdecl %0"
+       :"=D" (__res):"a" (c),"D" (cs),"c" (count)
+       :"cx");
+return __res;
+}
+
+extern inline void * __memset_generic(void * s, char c,size_t count)
+{
+__asm__ __volatile__(
+       "cld\n\t"
+       "rep\n\t"
+       "stosb"
+       : /* no output */
+       :"a" (c),"D" (s),"c" (count)
+       :"cx","di","memory");
+return s;
+}
+
+/* we might want to write optimized versions of these later */
+#define __constant_count_memset(s,c,count) __memset_generic((s),(c),(count))
+
+/*
+ * memset(x,0,y) is a reasonably common thing to do, so we want to fill
+ * things 32 bits at a time even when we don't know the size of the
+ * area at compile-time..
+ */
+extern inline void * __constant_c_memset(void * s, unsigned long c, size_t count)
+{
+__asm__ __volatile__(
+       "cld\n\t"
+       "rep ; stosl\n\t"
+       "testb $2,%b1\n\t"
+       "je 1f\n\t"
+       "stosw\n"
+       "1:\ttestb $1,%b1\n\t"
+       "je 2f\n\t"
+       "stosb\n"
+       "2:"
+       : /* no output */
+       :"a" (c), "q" (count), "c" (count/4), "D" ((long) s)
+       :"cx","di","memory");
+return (s);    
+}
+
+/* Added by Gertjan van Wingerde to make minix and sysv module work */
+#define __HAVE_ARCH_STRNLEN
+extern inline size_t strnlen(const char * s, size_t count)
+{
+register int __res;
+__asm__ __volatile__(
+       "movl %1,%0\n\t"
+       "jmp 2f\n"
+       "1:\tcmpb $0,(%0)\n\t"
+       "je 3f\n\t"
+       "incl %0\n"
+       "2:\tdecl %2\n\t"
+       "cmpl $-1,%2\n\t"
+       "jne 1b\n"
+       "3:\tsubl %1,%0"
+       :"=a" (__res)
+       :"c" (s),"d" (count)
+       :"dx");
+return __res;
+}
+/* end of additional stuff */
+
+/*
+ * This looks horribly ugly, but the compiler can optimize it totally,
+ * as we by now know that both pattern and count is constant..
+ */
+extern inline void * __constant_c_and_count_memset(void * s, unsigned long pattern, size_t count)
+{
+       switch (count) {
+               case 0:
+                       return s;
+               case 1:
+                       *(unsigned char *)s = pattern;
+                       return s;
+               case 2:
+                       *(unsigned short *)s = pattern;
+                       return s;
+               case 3:
+                       *(unsigned short *)s = pattern;
+                       *(2+(unsigned char *)s) = pattern;
+                       return s;
+               case 4:
+                       *(unsigned long *)s = pattern;
+                       return s;
+       }
+#define COMMON(x) \
+__asm__("cld\n\t" \
+       "rep ; stosl" \
+       x \
+       : /* no outputs */ \
+       : "a" (pattern),"c" (count/4),"D" ((long) s) \
+       : "cx","di","memory")
+
+       switch (count % 4) {
+               case 0: COMMON(""); return s;
+               case 1: COMMON("\n\tstosb"); return s;
+               case 2: COMMON("\n\tstosw"); return s;
+               case 3: COMMON("\n\tstosw\n\tstosb"); return s;
+       }
+#undef COMMON
+}
+
+#define __constant_c_x_memset(s, c, count) \
+(__builtin_constant_p(count) ? \
+ __constant_c_and_count_memset((s),(c),(count)) : \
+ __constant_c_memset((s),(c),(count)))
+
+#define __memset(s, c, count) \
+(__builtin_constant_p(count) ? \
+ __constant_count_memset((s),(c),(count)) : \
+ __memset_generic((s),(c),(count)))
+
+#define __HAVE_ARCH_MEMSET
+#define memset(s, c, count) \
+(__builtin_constant_p(c) ? \
+ __constant_c_x_memset((s),(0x01010101UL*(unsigned char)c),(count)) : \
+ __memset((s),(c),(count)))
+
+/*
+ * find the first occurrence of byte 'c', or 1 past the area if none
+ */
+#define __HAVE_ARCH_MEMSCAN
+extern inline void * memscan(void * addr, int c, size_t size)
+{
+       if (!size)
+               return addr;
+       __asm__("cld
+               repnz; scasb
+               jnz 1f
+               dec %%edi
+1:             "
+               : "=D" (addr), "=c" (size)
+               : "0" (addr), "1" (size), "a" (c));
+       return addr;
+}
+
+
+
+
+
+#endif
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _STRING_H_ */
+#endif
+
+#endif
diff --git a/reactos/include/crtdll/sys/djtypes.h b/reactos/include/crtdll/sys/djtypes.h
deleted file mode 100644 (file)
index c09bb98..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
-/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#ifndef __DJ_sys_djtypes_h_
-#define __DJ_sys_djtypes_h_
-
-#define __DJ_clock_t   typedef int clock_t;
-#define __DJ_gid_t     typedef int gid_t;
-#define __DJ_off_t     typedef int off_t;
-#define __DJ_pid_t     typedef int pid_t;
-#define __DJ_size_t    typedef long unsigned int size_t;
-#define __DJ_ssize_t   typedef int ssize_t;
-#define __DJ_time_t    typedef unsigned int time_t;
-#define __DJ_uid_t     typedef int uid_t;
-#define __DJ_va_list   typedef void *va_list;
-
-#if defined(__cplusplus) && ( (__GNUC_MINOR__ >= 8 && __GNUC__ == 2 ) || __GNUC__ >= 3 )
-/* wchar_t is now a keyword in C++ */
-#define __DJ_wchar_t
-#else
-/* but remains a typedef in C */
-#define __DJ_wchar_t    typedef int wchar_t;
-#endif
-
-#define __DJ_wint_t     typedef int wint_t;
-
-#endif
diff --git a/reactos/include/crtdll/sys/fcntl.h b/reactos/include/crtdll/sys/fcntl.h
new file mode 100644 (file)
index 0000000..b343f27
--- /dev/null
@@ -0,0 +1,8 @@
+/*
+ * This file is part of the Mingw32 package.
+ *
+ * This fcntl.h maps to the root fcntl.h
+ */
+#ifndef __STRICT_ANSI__
+#include <fcntl.h>
+#endif
diff --git a/reactos/include/crtdll/sys/file.h b/reactos/include/crtdll/sys/file.h
new file mode 100644 (file)
index 0000000..96c49e1
--- /dev/null
@@ -0,0 +1,9 @@
+/*
+ * This file is part of the Mingw32 package.
+ *
+ * This file.h maps to the root fcntl.h
+ * TODO?
+ */
+#ifndef __STRICT_ANSI__
+#include <fcntl.h>
+#endif
diff --git a/reactos/include/crtdll/sys/locking.h b/reactos/include/crtdll/sys/locking.h
new file mode 100644 (file)
index 0000000..89e6bfd
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * locking.h
+ *
+ * Constants for the mode parameter of the locking function.
+ *
+ * This file is part of the Mingw32 package.
+ *
+ * Contributors:
+ *  Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
+ *
+ *  THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ *  This source code is offered for use in the public domain. You may
+ *  use, modify or distribute it freely.
+ *
+ *  This code is distributed in the hope that it will be useful but
+ *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ *  DISCLAMED. This includes but is not limited to warranties of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $Revision: 1.1 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:07 $
+ *
+ */
+
+#ifndef        __STRICT_ANSI__
+
+#ifndef        _LOCKING_H_
+#define        _LOCKING_H_
+
+/*
+ * TODO: Define LK_... constants.
+ */
+
+#endif /* Not _LOCKING_H_ */
+
+#endif /* Not __STRICT_ANSI__ */
index 134fd7c..d27448c 100644 (file)
-/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#ifndef __dj_include_sys_stat_h_
-#define __dj_include_sys_stat_h_
+/*
+ * stat.h
+ *
+ * Symbolic constants for opening and creating files, also stat, fstat and
+ * chmod functions.
+ *
+ * This file is part of the Mingw32 package.
+ *
+ * Contributors:
+ *  Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
+ *
+ *  THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ *  This source code is offered for use in the public domain. You may
+ *  use, modify or distribute it freely.
+ *
+ *  This code is distributed in the hope that it will be useful but
+ *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ *  DISCLAMED. This includes but is not limited to warranties of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $Revision: 1.3 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:07 $
+ *
+ */
 
-#ifdef __cplusplus
+#ifndef __STRICT_ANSI__
+
+#ifndef _STAT_H_
+#define _STAT_H_
+
+#include <crtdll/sys/types.h>
+
+#ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef __dj_ENFORCE_ANSI_FREESTANDING
+/*
+ * Constants for the stat st_mode member.
+ */
+#define        S_IFIFO         0x1000  /* FIFO */
+#define        S_IFCHR         0x2000  /* Character */
+#define        S_IFBLK         0x3000  /* Block */
+#define        S_IFDIR         0x4000  /* Directory */
+#define        S_IFREG         0x8000  /* Regular */
+
+#define        S_IFMT          0xF000  /* File type mask */
+
+#define        S_IEXEC         0x0040
+#define        S_IWRITE        0x0080
+#define        S_IREAD         0x0100
+
+#define        S_ISDIR(m)      ((m) & S_IFDIR)
+#define        S_ISFIFO(m)     ((m) & S_IFIFO)
+#define        S_ISCHR(m)      ((m) & S_IFCHR)
+#define        S_ISBLK(m)      ((m) & S_IFBLK)
+#define        S_ISREG(m)      ((m) & S_IFREG)
+
+#define        S_IRWXU         (S_IREAD | S_IWRITE | S_IEXEC)
+#define        S_IXUSR         S_IEXEC
+#define        S_IWUSR         S_IWRITE
+#define        S_IRUSR         S_IREAD
+
+#define        _S_IEXEC        S_IEXEC
+#define _S_IREAD       S_IREAD
+#define _S_IWRITE      S_IWRITE
+
+/*
+ * The structure manipulated and returned by stat and fstat.
+ *
+ * NOTE: If called on a directory the values in the time fields are not only
+ * invalid, they will cause localtime et. al. to return NULL. And calling
+ * asctime with a NULL pointer causes an Invalid Page Fault. So watch it!
+ */
+struct stat
+{
+       short   st_dev;         /* Equivalent to drive number 0=A 1=B ... */
+       short   st_ino;         /* Always zero ? */
+       short   st_mode;        /* See above constants */
+       short   st_nlink;       /* Number of links. */
+       int     st_uid;         /* User: Maybe significant on NT ? */
+       short   st_gid;         /* Group: Ditto */
+       short   st_rdev;        /* Seems useless (not even filled in) */
+       long    st_size;        /* File size in bytes */
+       time_t  st_atime;       /* Accessed date (always 00:00 hrs local
+                                * on FAT) */
+       time_t  st_mtime;       /* Modified time */
+       time_t  st_ctime;       /* Creation time */
+};
 
-#ifndef __STRICT_ANSI__
 
-#define S_ISBLK(m)     (((m) & 0xf000) == 0x1000)
-#define S_ISCHR(m)     (((m) & 0xf000) == 0x2000)
-#define S_ISDIR(m)     (((m) & 0xf000) == 0x3000)
-#define S_ISFIFO(m)    (((m) & 0xf000) == 0x4000)
-#define S_ISREG(m)     (((m) & 0xf000) == 0x0000)
-
-#define S_ISUID                0x80000000
-#define S_ISGID                0x40000000
-
-#define S_IRUSR                00400
-#define S_IRGRP                00040
-#define S_IROTH                00004
-#define S_IWUSR                00200
-#define S_IWGRP                00020
-#define S_IWOTH                00002
-#define S_IXUSR                00100
-#define S_IXGRP                00010
-#define S_IXOTH                00001
-#define S_IRWXU                00700
-#define S_IRWXG                00070
-#define S_IRWXO                00007
-
-#include <sys/types.h>
-#include <internal/types.h>
-//#include <sys/djtypes.h>
-__DJ_time_t
-#undef __DJ_time_t
-#define __DJ_time_t
-
-struct stat {
-  time_t       st_atime;
-  time_t       st_ctime;
-  dev_t                st_dev;
-  gid_t                st_gid;
-  ino_t                st_ino;
-  mode_t       st_mode;
-  time_t       st_mtime;
-  nlink_t      st_nlink;
-  off_t                st_size;
-  off_t                st_blksize;
-  uid_t                st_uid;
-  dev_t                st_rdev; /* unused */
-};
+int    _fstat (int nHandle, struct stat* pstat);
+int    _chmod (const char* szPath, int nMode);
+int    _stat (const char* szPath, struct stat* pstat);
 
-int    chmod(const char *_path, mode_t _mode);
-int    fstat(int _fildes, struct stat *_buf);
-//int  mkdir(const char *_path, mode_t _mode);
-int    mkfifo(const char *_path, mode_t _mode);
-int    stat(const char *_path, struct stat *_buf);
-mode_t umask(mode_t _cmask);
-
-#ifndef _POSIX_SOURCE
-
-/* POSIX.1 doesn't mention these at all */
-
-#define S_IFMT         0xf000
-
-#define S_IFREG                0x0000
-#define S_IFBLK                0x1000
-#define S_IFCHR                0x2000
-#define S_IFDIR                0x3000
-#define S_IFIFO                0x4000
-#define S_IFFIFO       S_IFIFO
-
-#define S_IFLABEL      0x5000
-#define S_ISLABEL(m)   (((m) & 0xf000) == 0x5000)
-
-void           _fixpath(const char *, char *);
-unsigned short  _get_magic(const char *, int);
-int             _is_executable(const char *, int, const char *);
-int            mknod(const char *_path, mode_t _mode, dev_t _dev);
-char          * _truename(const char *, char *);
-
-/* Bit-mapped variable _djstat_flags describes what expensive
-   f?stat() features our application needs.  If you don't need a
-   feature, set its bit in the variable.  By default, all the
-   bits are cleared (i.e., you get the most expensive code).  */
-#define _STAT_INODE         1   /* should we bother getting inode numbers? */
-#define _STAT_EXEC_EXT      2   /* get execute bits from file extension? */
-#define _STAT_EXEC_MAGIC    4   /* get execute bits from magic signature? */
-#define _STAT_DIRSIZE       8   /* compute directory size? */
-#define _STAT_ROOT_TIME  0x10   /* try to get root dir time stamp? */
-#define _STAT_WRITEBIT   0x20   /* fstat() needs write bit? */
-
-extern unsigned short   _djstat_flags;
-
-/* Bit-mapped variable _djstat_fail_bits describes which individual
-   undocumented features f?stat() failed to use.  To get a human-
-   readable description of the bits, call _djstat_describe_lossage(). */
-#define _STFAIL_SDA         1   /* Get SDA call failed */
-#define _STFAIL_OSVER       2   /* Unsupported DOS version */
-#define _STFAIL_BADSDA      4   /* Bad pointer to SDA */
-#define _STFAIL_TRUENAME    8   /* _truename() failed */
-#define _STFAIL_HASH     0x10   /* inode defaults to hashing */
-#define _STFAIL_LABEL    0x20   /* Root dir, but no volume label */
-#define _STFAIL_DCOUNT   0x40   /* dirent_count ridiculously large */
-#define _STFAIL_WRITEBIT 0x80   /* fstat() failed to get write access bit */
-#define _STFAIL_DEVNO   0x100   /* fstat() failed to get device number */
-#define _STFAIL_BADSFT  0x200   /* SFT entry found, but can't be trusted */
-#define _STFAIL_SFTIDX  0x400   /* bad SFT index in JFT */
-#define _STFAIL_SFTNF   0x800   /* file entry not found in SFT array */
-
-extern unsigned short   _djstat_fail_bits;
-
-#endif /* !_POSIX_SOURCE */
-#endif /* !__STRICT_ANSI__ */
-#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
-
-#ifndef __dj_ENFORCE_FUNCTION_CALLS
-#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
-
-#ifdef __cplusplus
+
+#ifndef        _NO_OLDNAMES
+
+/* These functions live in liboldnames.a. */
+int    fstat (int nHandle, struct stat* pstat);
+int    chmod (const char* szPath, int nMode);
+int    stat (const char* szPath, struct stat* pstat);
+
+#endif /* Not _NO_OLDNAMES */
+
+
+#ifdef __cplusplus
 }
 #endif
 
-#endif /* !__dj_include_sys_stat_h_ */
+#endif /* Not _STAT_H_ */
+
+#endif /* Not __STRICT_ANSI__ */
diff --git a/reactos/include/crtdll/sys/time.h b/reactos/include/crtdll/sys/time.h
new file mode 100644 (file)
index 0000000..39d85f6
--- /dev/null
@@ -0,0 +1,3 @@
+
+#include <time.h>
+
diff --git a/reactos/include/crtdll/sys/timeb.h b/reactos/include/crtdll/sys/timeb.h
new file mode 100644 (file)
index 0000000..5970b07
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * timeb.h
+ *
+ * Support for the UNIX System V ftime system call.
+ *
+ * This file is part of the Mingw32 package.
+ *
+ * Contributors:
+ *  Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
+ *
+ *  THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ *  This source code is offered for use in the public domain. You may
+ *  use, modify or distribute it freely.
+ *
+ *  This code is distributed in the hope that it will be useful but
+ *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ *  DISCLAMED. This includes but is not limited to warranties of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $Revision: 1.1 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:07 $
+ *
+ */
+
+#ifndef        __STRICT_ANSI__
+
+#ifndef        _TIMEB_H_
+#define        _TIMEB_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * TODO: Structure not tested.
+ */
+struct timeb
+{
+       long    time;
+       short   millitm;
+       short   _timezone;
+       short   dstflag;
+};
+
+/* TODO: Not tested. */
+void   _ftime (struct timeb* timebBuffer);
+
+#ifndef        _NO_OLDNAMES
+void   ftime (struct timeb* timebBuffer);
+#endif /* Not _NO_OLDNAMES */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* Not _TIMEB_H_ */
+
+#endif /* Not __STRICT_ANSI__ */
index 5c5df14..ed349b6 100644 (file)
@@ -1,67 +1,77 @@
-/* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
-/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#ifndef __dj_include_sys_types_h_
-#define __dj_include_sys_types_h_
+/*
+ * types.h
+ *
+ * The definition of constants, data types and global variables.
+ *
+ * This file is part of the Mingw32 package.
+ *
+ * Contributors:
+ *  Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
+ *
+ *  THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ *  This source code is offered for use in the public domain. You may
+ *  use, modify or distribute it freely.
+ *
+ *  This code is distributed in the hope that it will be useful but
+ *  WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY
+ *  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/02 21:42:07 $
+ *
+ */
 
-#ifdef __cplusplus
-extern "C" {
+#ifndef        _TYPES_H_
+#define        _TYPES_H_
+
+#ifndef        _TIME_T_
+#define        _TIME_T_
+typedef        long    time_t;
 #endif
 
-#ifndef __dj_ENFORCE_ANSI_FREESTANDING
-
-#ifndef __STRICT_ANSI__
-
-#include <sys/djtypes.h>
-  
-typedef int            dev_t;
-typedef int            ino_t;
-typedef int            mode_t;
-typedef int            nlink_t;
-
-__DJ_gid_t
-#undef __DJ_gid_t
-#define __DJ_gid_t
-__DJ_off_t
-#undef __DJ_off_t
-#define __DJ_off_t
-__DJ_pid_t
-#undef __DJ_pid_t
-#define __DJ_pid_t
-//__DJ_size_t
-#undef __DJ_size_t
-#define __DJ_size_t
-__DJ_ssize_t
-#undef __DJ_ssize_t
-#define __DJ_ssize_t
-__DJ_uid_t
-#undef __DJ_uid_t
-#define __DJ_uid_t
-
-#ifndef _POSIX_SOURCE
-
-/* Allow including program to override.  */
-#ifndef FD_SETSIZE
-#define FD_SETSIZE 256
+
+#ifndef        __STRICT_ANSI__
+
+#ifndef        _OFF_T_DEFINED
+typedef long _off_t;
+
+#ifndef        _NO_OLDNAMES
+#define        off_t   _off_t
 #endif
 
-typedef struct fd_set {
-  unsigned char fd_bits [((FD_SETSIZE) + 7) / 8];
-} fd_set;
+#define        _OFF_T_DEFINED
 
-#define FD_SET(n, p)    ((p)->fd_bits[(n) / 8] |= (1 << ((n) & 7)))
-#define FD_CLR(n, p)   ((p)->fd_bits[(n) / 8] &= ~(1 << ((n) & 7)))
-#define FD_ISSET(n, p) ((p)->fd_bits[(n) / 8] & (1 << ((n) & 7)))
-#define FD_ZERO(p)     memset ((void *)(p), 0, sizeof (*(p)))
+#endif /* Not _OFF_T_DEFINED */
 
-#endif /* !_POSIX_SOURCE */
-#endif /* !__STRICT_ANSI__ */
-#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
-#ifndef __dj_ENFORCE_FUNCTION_CALLS
-#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
+#ifndef _DEV_T_DEFINED
+typedef short _dev_t;
 
-#ifdef __cplusplus
-}
+#ifndef        _NO_OLDNAMES
+#define        dev_t   _dev_t
 #endif
 
-#endif /* !__dj_include_sys_types_h_ */
+#define        _DEV_T_DEFINED
+
+#endif /* Not _DEV_T_DEFINED */
+
+
+#ifndef _INO_T_DEFINED
+typedef short _ino_t;
+
+#ifndef        _NO_OLDNAMES
+#define        ino_t   _ino_t
+#endif
+
+#define        _INO_T_DEFINED
+
+#endif /* Not _INO_T_DEFINED */
+
+
+#endif /* Not __STRICT_ANSI__ */
+
+
+#endif /* Not _TYPES_H_ */
diff --git a/reactos/include/crtdll/sys/unistd.h b/reactos/include/crtdll/sys/unistd.h
new file mode 100644 (file)
index 0000000..ed122d9
--- /dev/null
@@ -0,0 +1,9 @@
+/*
+ * This file is part of the Mingw32 package.
+ *
+ * unistd.h maps (roughly) to io.h
+ */
+#ifndef __STRICT_ANSI__
+#include <io.h>
+#endif
+
diff --git a/reactos/include/crtdll/sys/utime.h b/reactos/include/crtdll/sys/utime.h
new file mode 100644 (file)
index 0000000..6d7f4e9
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * utime.h
+ *
+ * Support for the utime function.
+ *
+ * This file is part of the Mingw32 package.
+ *
+ * Contributors:
+ *  Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
+ *
+ *  THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ *  This source code is offered for use in the public domain. You may
+ *  use, modify or distribute it freely.
+ *
+ *  This code is distributed in the hope that it will be useful but
+ *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ *  DISCLAMED. This includes but is not limited to warranties of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $Revision: 1.1 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:07 $
+ *
+ */
+
+#ifndef        __STRICT_ANSI__
+
+#ifndef        _UTIME_H_
+#define        _UTIME_H_
+
+#define __need_wchar_t
+#define __need_size_t
+#include <stddef.h>
+#include <crtdll/sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Structure used by _utime function.
+ */
+struct _utimbuf
+{
+       time_t  actime;         /* Access time */
+       time_t  modtime;        /* Modification time */
+};
+
+int    _utime (const char* szFileName, struct _utimbuf* pTimes);
+int     _futime (int nHandle, struct _utimbuf *pTimes);
+
+/* Wide character version */
+int     _wutime (const wchar_t *szFileName, struct _utimbuf *times);
+
+#ifndef        _NO_OLDNAMES
+
+/* NOTE: Must be the same as _utimbuf above. */
+struct utimbuf
+{
+       time_t  actime;
+       time_t  modtime;
+};
+
+int    utime (const char* szFileName, struct utimbuf* pTimes);
+
+#endif /* Not _NO_OLDNAMES */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* Not _UTIME_H_ */
+#endif /* Not __STRICT_ANSI__ */
diff --git a/reactos/include/crtdll/tchar.h b/reactos/include/crtdll/tchar.h
new file mode 100644 (file)
index 0000000..450d699
--- /dev/null
@@ -0,0 +1,231 @@
+/* 
+ * tchar.h
+ *
+ * Unicode mapping layer for the standard C library. By including this
+ * file and using the 't' names for string functions
+ * (eg. _tprintf) you can make code which can be easily adapted to both
+ * Unicode and non-unicode environments. In a unicode enabled compile define
+ * _UNICODE before including tchar.h, otherwise the standard non-unicode
+ * library functions will be used.
+ *
+ * Note that you still need to include string.h or stdlib.h etc. to define
+ * the appropriate functions. Also note that there are several defines
+ * included for non-ANSI functions which are commonly available (but using
+ * the convention of prepending an underscore to non-ANSI library function
+ * names).
+ *
+ * This file is part of the Mingw32 package.
+ *
+ * Contributors:
+ *  Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
+ *
+ *  THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ *  This source code is offered for use in the public domain. You may
+ *  use, modify or distribute it freely.
+ *
+ *  This code is distributed in the hope that it will be useful but
+ *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ *  DISCLAMED. This includes but is not limited to warranties of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $Revision: 1.1 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:06 $
+ *
+ */
+
+#ifndef        _TCHAR_H_
+#define _TCHAR_H_
+
+/*
+ * NOTE: This tests _UNICODE, which is different from the UNICODE define
+ *       used to differentiate Win32 API calls.
+ */
+#ifdef _UNICODE
+
+
+/*
+ * Use TCHAR instead of char or wchar_t. It will be appropriately translated
+ * if _UNICODE is correctly defined (or not).
+ */
+#ifndef _TCHAR_DEFINED
+#ifndef RC_INVOKED
+typedef        wchar_t TCHAR;
+#endif /* Not RC_INVOKED */
+#define _TCHAR_DEFINED
+#endif
+
+
+/*
+ * Enclose constant strings and literal characters in the _TEXT and _T macro to make
+ * them unicode constant strings when _UNICODE is defined.
+ */
+#define        _TEXT(x)        L ## x
+#define        _T(x)           L ## x
+
+/*
+ * Unicode functions
+ */
+
+#define        _tprintf                wprintf
+#define        _ftprintf               fwprintf
+#define        _stprintf               swprintf
+#define        _sntprintf      _snwprintf
+#define        _vtprintf               vwprintf
+#define        _vftprintf      vfwprintf
+#define        _vstprintf      vswprintf
+#define        _vsntprintf     _vsnwprintf
+#define        _tscanf         wscanf
+#define        _ftscanf                fwscanf
+#define        _stscanf                swscanf
+#define        _fgettc         fgetwc
+#define        _fgettchar      _fgetwchar
+#define        _fgetts         fgetws
+#define        _fputtc         fputwc
+#define        _fputtchar      _fputwchar
+#define        _fputts         fputws
+#define        _gettc          getwc
+#define        _getts          getws
+#define        _puttc          putwc
+#define        _putts          putws
+#define        _ungettc        ungetwc
+#define        _tcstod         wcstod
+#define        _tcstol         wcstol
+#define        _tcstoul                wcstoul
+#define        _tcscat         wcscat
+#define        _tcschr         wcschr
+#define        _tcscmp         wcscmp
+#define        _tcscpy         wcscpy
+#define        _tcscspn        wcscspn
+#define        _tcslen         wcslen
+#define        _tcsncat                wcsncat
+#define        _tcsncmp        wcsncmp
+#define        _tcsncpy        wcsncpy
+#define        _tcspbrk                wcspbrk
+#define        _tcsrchr                wcsrchr
+#define        _tcsspn         wcsspn
+#define        _tcsstr         wcsstr
+#define        _tcstok         wcstok
+#define        _tcsdup         _wcsdup
+#define        _tcsicmp        _wcsicmp
+#define        _tcsnicmp       _wcsnicmp
+#define        _tcsnset                _wcsnset
+#define        _tcsrev         _wcsrev
+#define        _tcsset         _wcsset
+#define        _tcslwr         _wcslwr
+#define        _tcsupr         _wcsupr
+#define        _tcsxfrm                wcsxfrm
+#define        _tcscoll                wcscoll
+#define        _tcsicoll               _wcsicoll
+#define        _istalpha       iswalpha
+#define        _istupper       iswupper
+#define        _istlower       iswlower
+#define        _istdigit               iswdigit
+#define        _istxdigit      iswxdigit
+#define        _istspace       iswspace
+#define        _istpunct       iswpunct
+#define        _istalnum       iswalnum
+#define        _istprint               iswprint
+#define        _istgraph       iswgraph
+#define        _istcntrl               iswcntrl
+#define        _istascii               iswascii
+#define        _totupper       towupper
+#define        _totlower       towlower
+#define        _ttoi           _wtoi
+#define        _tcsftime       wcsftime
+
+#else  /* Not _UNICODE */
+
+/*
+ * TCHAR, the type you should use instead of char.
+ */
+#ifndef _TCHAR_DEFINED
+#ifndef RC_INVOKED
+typedef char   TCHAR;
+#endif
+#define _TCHAR_DEFINED
+#endif
+
+/*
+ * Enclose constant strings and characters in the _TEXT and _T macro.
+ */
+#define        _TEXT(x)        x
+#define        _T(x)           x
+
+
+/*
+ * Non-unicode (standard) functions
+ */
+
+#define        _tprintf        printf
+#define _ftprintf      fprintf
+#define        _stprintf       sprintf
+#define        _sntprintf      _snprintf
+#define        _vtprintf       vprintf
+#define        _vftprintf      vfprintf
+#define _vstprintf     vsprintf
+#define        _vsntprintf     _vsnprintf
+#define        _tscanf         scanf
+#define        _ftscanf        fscanf
+#define        _stscanf        sscanf
+#define        _fgettc         fgetc
+#define        _fgettchar      _fgetchar
+#define        _fgetts         fgets
+#define        _fputtc         fputc
+#define        _fputtchar      _fputchar
+#define        _fputts         fputs
+#define        _gettc          getc
+#define        _getts          gets
+#define        _puttc          putc
+#define        _putts          puts
+#define        _ungettc        ungetc
+#define        _tcstod         strtod
+#define        _tcstol         strtol
+#define _tcstoul       strtoul
+#define        _tcscat         strcat
+#define _tcschr                strchr
+#define _tcscmp                strcmp
+#define _tcscpy                strcpy
+#define _tcscspn       strcspn
+#define        _tcslen         strlen
+#define        _tcsncat        strncat
+#define        _tcsncmp        strncmp
+#define        _tcsncpy        strncpy
+#define        _tcspbrk        strpbrk
+#define        _tcsrchr        strrchr
+#define _tcsspn                strspn
+#define        _tcsstr         strstr
+#define _tcstok                strtok
+#define        _tcsdup         _strdup
+#define        _tcsicmp        _stricmp
+#define        _tcsnicmp       _strnicmp
+#define        _tcsnset        _strnset
+#define        _tcsrev         _strrev
+#define _tcsset                _strset
+#define        _tcslwr         _strlwr
+#define        _tcsupr         _strupr
+#define        _tcsxfrm        strxfrm
+#define        _tcscoll        strcoll
+#define        _tcsicoll       _stricoll
+#define        _istalpha       isalpha
+#define        _istupper       isupper
+#define        _istlower       islower
+#define        _istdigit       isdigit
+#define        _istxdigit      isxdigit
+#define        _istspace       isspace
+#define        _istpunct       ispunct
+#define        _istalnum       isalnum
+#define        _istprint       isprint
+#define        _istgraph       isgraph
+#define        _istcntrl       iscntrl
+#define        _istascii       isascii
+#define _totupper      toupper
+#define        _totlower       tolower
+#define        _ttoi           atoi
+#define _tcsftime      strftime
+
+#endif /* Not _UNICODE */
+
+#endif /* Not _TCHAR_H_ */
+
index e992db9..6c7b9a3 100644 (file)
@@ -18,9 +18,9 @@
  *  DISCLAMED. This includes but is not limited to warranties of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Revision: 1.2 $
- * $Author: rex $
- * $Date: 1999/03/19 05:55:10 $
+ * $Revision: 1.3 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:06 $
  *
  */
 /* Appropriated for Reactos Crtdll by Ariadne */
@@ -29,7 +29,7 @@
 
 #define __need_wchar_t
 #define __need_size_t
-#include <stddef.h>
+#include <crtdll/stddef.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -53,7 +53,7 @@ typedef       long    clock_t;
 /*
  * Need a definition of time_t.
  */
-#include <sys/types.h>
+#include <crtdll/sys/types.h>
 
 /*
  * A type for storing the current time and date. This is the number of
diff --git a/reactos/include/crtdll/wchar.h b/reactos/include/crtdll/wchar.h
new file mode 100644 (file)
index 0000000..5d0cdeb
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * wchar.h
+ *
+ * Defines of all functions for supporting wide characters. Actually it
+ * just includes all those headers, which is not a good thing to do from a
+ * processing time point of view, but it does mean that everything will be
+ * in sync.
+ *
+ * This file is part of the Mingw32 package.
+ *
+ *  THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ *  This source code is offered for use in the public domain. You may
+ *  use, modify or distribute it freely.
+ *
+ *  This code is distributed in the hope that it will be useful but
+ *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ *  DISCLAMED. This includes but is not limited to warranties of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $Revision: 1.1 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:42:06 $
+ *
+ */
+
+#include <crtdll/ctype.h>
+#include <crtdll/stdio.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/string.h>
+#include <crtdll/time.h>
+
index 5e9f10f..1d70882 100644 (file)
@@ -1,13 +1,13 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <assert.h>
-#include <stdio.h>
-#include <signal.h>
-#include <stdlib.h>
+#include <crtdll/assert.h>
+#include <crtdll/stdio.h>
+#include <crtdll/stdlib.h>
 
-void _assert(const char *msg, const char *file, int line)
+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);
// raise(SIGABRT);
   exit(1);
+  for(;;);
 }
index 3e225df..8787259 100644 (file)
@@ -1,4 +1,4 @@
-#include <conio.h>
+#include <crtdll/conio.h>
 
 
 char *
index 7241116..27c8714 100644 (file)
@@ -1,5 +1,5 @@
-#include <stdio.h>
-#include <conio.h>
+#include <crtdll/stdio.h>
+#include <crtdll/conio.h>
 
 int
 cprintf(const char *fmt, ...)
index 01c6279..91c97b3 100644 (file)
@@ -8,10 +8,10 @@
  *              28/12/98: Created
  */
 #include <windows.h>
-#include <conio.h>
-#include <string.h>
+#include <crtdll/conio.h>
+#include <crtdll/string.h>
 
-int     cputs(const char *_str)
+int     _cputs(const char *_str)
 {
        int len = strlen(_str);
        int written = 0;
index 3fa931c..9950519 100644 (file)
@@ -1,4 +1,4 @@
-#include <conio.h>
+#include <crtdll/conio.h>
 
 
 /*
index 5a1b4cc..6830ac5 100644 (file)
@@ -7,10 +7,10 @@
  * UPDATE HISTORY:
  *              28/12/98: Created
  */
-#include <conio.h>
-#include <stdio.h>
 #include <windows.h>
-#include <io.h>
+#include <crtdll/conio.h>
+#include <crtdll/stdio.h>
+#include <crtdll/io.h>
 
 extern int char_avail;
 extern int ungot_char;
index e350023..247634b 100644 (file)
@@ -10,8 +10,8 @@
  *              28/12/98: Created
  */
 
-#include <process.h>
-#include <conio.h>
+#include <crtdll/process.h>
+#include <crtdll/conio.h>
 
 
 extern int char_avail;
index cbeaa07..b207680 100644 (file)
@@ -7,7 +7,7 @@
  * UPDATE HISTORY:
  *              28/12/98: Created
  */
-#include <conio.h>
+#include <crtdll/conio.h>
 #include <windows.h>
 
 int _putch( int c )
index 17c28fb..adda301 100644 (file)
@@ -10,7 +10,7 @@
  *              28/12/98: Created
  */
 
-#include <process.h>
+#include <crtdll/process.h>
 #define EOF -1
 
 int char_avail = 0;
index c839b50..2aff25c 100644 (file)
@@ -17,9 +17,9 @@
 ;  DISCLAMED. This includes but is not limited to warrenties of
 ;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 ;
-; $Revision: 1.3 $
-; $Author: dwelch $
-; $Date: 1999/01/17 17:27:24 $
+; $Revision: 1.4 $
+; $Author: ariadne $
+; $Date: 1999/04/02 21:43:45 $
 ;
 ; These three functions appear to be name mangled in some way, so GCC is
 ; probably not going to be able to use them in any case.
 ;    ??3@YAXPAX@Z
 ;    ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z
 ;
+;    Added functionallt equivalent placeholders:
+;
+; __builtin_new
+; __builtin_delete
+; _set_new_handler__FPFUi_i
+;
+;
 ; These are functions for which I have not yet written prototypes or
 ; otherwise set up (they are still included below though unlike those
 ; first three).
 ;    _wtol
 ;
 EXPORTS
+__builtin_new
+__builtin_delete
+_set_new_handler__FPFUi_i
 _CIacos
 _CIasin
 _CIatan
index c95795e..66a591b 100644 (file)
@@ -7,7 +7,7 @@
  * UPDATE HISTORY:
  *              28/12/98: Created
  */
-#include <ctype.h>
+#include <crtdll/ctype.h>
 
 
 #undef isalnum
@@ -17,7 +17,7 @@ int isalnum(int c)
 }
 
 #undef iswalnum
-int iswalnum(int c)
+int iswalnum(wint_t c)
 {
    return iswctype(c,_ALPHA | _DIGIT);
 }
index 2e8a298..3e0c496 100644 (file)
@@ -8,7 +8,7 @@
  *              28/12/98: Created
  */
 
-#include <ctype.h>
+#include <crtdll/ctype.h>
 
 #undef isalpha
 int isalpha(int c)
@@ -17,7 +17,7 @@ int isalpha(int c)
 }
 
 #undef iswalpha
-int iswalpha(int c)
+int iswalpha(wint_t c)
 {
        return iswctype(c,_ALPHA);
 }
index 3aefae8..4ef4daf 100644 (file)
@@ -8,14 +8,14 @@
  *              28/12/98: Created
  */
 
-#include <ctype.h>
+#include <crtdll/ctype.h>
 
 int __isascii(int c)
 {
   return  (!((c)&(~0x7f))) ;
 }
 
-int iswascii(int c)
+int iswascii(wint_t c)
 {
        return __isascii(c);
 }
index e44f34c..4eef7f8 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <ctype.h>
+#include <crtdll/ctype.h>
 
 #undef iscntrl
 int iscntrl(int c)
@@ -8,7 +8,7 @@ int iscntrl(int c)
 }
 
 #undef iswcntrl
-int iswcntrl(int c)
+int iswcntrl(wint_t c)
 {
   return iswctype(c,_CONTROL);
 }
index 702b4fa..4f1c1d6 100644 (file)
@@ -8,7 +8,7 @@
  *              28/12/98: Created
  */
 
-#include <ctype.h>
+#include <crtdll/ctype.h>
 
 int __iscsymf(int c)
 {
@@ -18,4 +18,4 @@ int __iscsymf(int c)
 int __iscsym(int c)
 {
        return (isalnum(c) || ( c == '_' )) ;
-}
\ No newline at end of file
+}
index 90de53c..4bc7110 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <ctype.h>
+#include <crtdll/ctype.h>
 
 
 #define __dj_ISUPPER   _UPPER
 #define __dj_ISXDIGIT  _HEX
 #define __dj_ISALPHA   _ALPHA
 #define __dj_ISPRINT   _PRINT
-#define __dj_ISALNUM   ( _ALPHA | _DIGIT )
 #define __dj_ISGRAPH   _GRAPH
 
-int __mb_cur_max = 2;
-
 // removed the first value
 
 unsigned short _pctype_dll[] = {
@@ -68,16 +65,16 @@ unsigned short _pctype_dll[] = {
   __dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT,                                                  /* `-', 0x2d */
   __dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT,                                                  /* `.', 0x2e */
   __dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT,                                                  /* `/', 0x2f */
-  __dj_ISALNUM | __dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT,                   /* `0', 0x30 */
-  __dj_ISALNUM | __dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT,                   /* `1', 0x31 */
-  __dj_ISALNUM | __dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT,                   /* `2', 0x32 */
-  __dj_ISALNUM | __dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT,                   /* `3', 0x33 */
-  __dj_ISALNUM | __dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT,                   /* `4', 0x34 */
-  __dj_ISALNUM | __dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT,                   /* `5', 0x35 */
-  __dj_ISALNUM | __dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT,                   /* `6', 0x36 */
-  __dj_ISALNUM | __dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT,                   /* `7', 0x37 */
-  __dj_ISALNUM | __dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT,                   /* `8', 0x38 */
-  __dj_ISALNUM | __dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT,                   /* `9', 0x39 */
+   __dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT,                 /* `0', 0x30 */
+   __dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT,                 /* `1', 0x31 */
+   __dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT,                 /* `2', 0x32 */
+   __dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT,                 /* `3', 0x33 */
+   __dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT,                 /* `4', 0x34 */
+   __dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT,                 /* `5', 0x35 */
+   __dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT,                 /* `6', 0x36 */
+   __dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT,                 /* `7', 0x37 */
+   __dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT,                 /* `8', 0x38 */
+   __dj_ISDIGIT | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISXDIGIT,                 /* `9', 0x39 */
   __dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT,                                                  /* `:', 0x3a */
   __dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT,                                                  /* `;', 0x3b */
   __dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT,                                                  /* `<', 0x3c */
@@ -85,64 +82,64 @@ unsigned short _pctype_dll[] = {
   __dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT,                                                  /* `>', 0x3e */
   __dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT,                                                  /* `?', 0x3f */
   __dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT,                                                  /* `@', 0x40 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER | __dj_ISXDIGIT,            /* `A', 0x41 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER | __dj_ISXDIGIT,            /* `B', 0x42 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER | __dj_ISXDIGIT,            /* `C', 0x43 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER | __dj_ISXDIGIT,            /* `D', 0x44 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER | __dj_ISXDIGIT,            /* `E', 0x45 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER | __dj_ISXDIGIT,            /* `F', 0x46 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                    /* `G', 0x47 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                    /* `H', 0x48 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                    /* `I', 0x49 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                    /* `J', 0x4a */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                    /* `K', 0x4b */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                    /* `L', 0x4c */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                    /* `M', 0x4d */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                    /* `N', 0x4e */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                    /* `O', 0x4f */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                    /* `P', 0x50 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                    /* `Q', 0x51 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                    /* `R', 0x52 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                    /* `S', 0x53 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                    /* `T', 0x54 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                    /* `U', 0x55 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                    /* `V', 0x56 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                    /* `W', 0x57 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                    /* `X', 0x58 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                    /* `Y', 0x59 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                    /* `Z', 0x5a */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER | __dj_ISXDIGIT,          /* `A', 0x41 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER | __dj_ISXDIGIT,          /* `B', 0x42 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER | __dj_ISXDIGIT,          /* `C', 0x43 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER | __dj_ISXDIGIT,          /* `D', 0x44 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER | __dj_ISXDIGIT,          /* `E', 0x45 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER | __dj_ISXDIGIT,          /* `F', 0x46 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                  /* `G', 0x47 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                  /* `H', 0x48 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                  /* `I', 0x49 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                  /* `J', 0x4a */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                  /* `K', 0x4b */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                  /* `L', 0x4c */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                  /* `M', 0x4d */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                  /* `N', 0x4e */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                  /* `O', 0x4f */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                  /* `P', 0x50 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                  /* `Q', 0x51 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                  /* `R', 0x52 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                  /* `S', 0x53 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                  /* `T', 0x54 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                  /* `U', 0x55 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                  /* `V', 0x56 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                  /* `W', 0x57 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                  /* `X', 0x58 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                  /* `Y', 0x59 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER,                  /* `Z', 0x5a */
   __dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT,                                                  /* `[', 0x5b */
   __dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT,                                                  /* 0x5c */
   __dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT,                                                  /* `]', 0x5d */
   __dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT,                                                  /* `^', 0x5e */
   __dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT,                                                  /* `_', 0x5f */
   __dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT,                                                  /* 0x60 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT | __dj_ISXDIGIT,            /* `a', 0x61 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT | __dj_ISXDIGIT,            /* `b', 0x62 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT | __dj_ISXDIGIT,            /* `c', 0x63 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT | __dj_ISXDIGIT,            /* `d', 0x64 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT | __dj_ISXDIGIT,            /* `e', 0x65 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT | __dj_ISXDIGIT,            /* `f', 0x66 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                    /* `g', 0x67 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                    /* `h', 0x68 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                    /* `i', 0x69 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                    /* `j', 0x6a */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                    /* `k', 0x6b */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                    /* `l', 0x6c */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                    /* `m', 0x6d */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                    /* `n', 0x6e */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                    /* `o', 0x6f */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                    /* `p', 0x70 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                    /* `q', 0x71 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                    /* `r', 0x72 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                    /* `s', 0x73 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                    /* `t', 0x74 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                    /* `u', 0x75 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                    /* `v', 0x76 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                    /* `w', 0x77 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                    /* `x', 0x78 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                    /* `y', 0x79 */
-  __dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                    /* `z', 0x7a */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT | __dj_ISXDIGIT,          /* `a', 0x61 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT | __dj_ISXDIGIT,          /* `b', 0x62 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT | __dj_ISXDIGIT,          /* `c', 0x63 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT | __dj_ISXDIGIT,          /* `d', 0x64 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT | __dj_ISXDIGIT,          /* `e', 0x65 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT | __dj_ISXDIGIT,          /* `f', 0x66 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                  /* `g', 0x67 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                  /* `h', 0x68 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                  /* `i', 0x69 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                  /* `j', 0x6a */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                  /* `k', 0x6b */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                  /* `l', 0x6c */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                  /* `m', 0x6d */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                  /* `n', 0x6e */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                  /* `o', 0x6f */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                  /* `p', 0x70 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                  /* `q', 0x71 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                  /* `r', 0x72 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                  /* `s', 0x73 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                  /* `t', 0x74 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                  /* `u', 0x75 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                  /* `v', 0x76 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                  /* `w', 0x77 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                  /* `x', 0x78 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                  /* `y', 0x79 */
+   __dj_ISALPHA | __dj_ISGRAPH | __dj_ISLOWER | __dj_ISPRINT,                  /* `z', 0x7a */
   __dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT,                                                  /* `{', 0x7b */
   __dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT,                                                  /* `|', 0x7c */
   __dj_ISGRAPH | __dj_ISPRINT | __dj_ISPUNCT,                                                  /* `}', 0x7d */
@@ -281,23 +278,23 @@ unsigned short _pctype_dll[] = {
 unsigned short *_ctype = _pctype_dll -1; // unused
 unsigned short *_pwctype_dll = _pctype_dll;
 
-
-int _isctype(unsigned char c, int t)
+int    _isctype (unsigned int c, int ctypeFlags)
 {              
 
-       return ((_pctype_dll[(c & 0xFF)]&t) == t );
+       return ((_pctype_dll[(unsigned char)(c & 0xFF)]&ctypeFlags) == ctypeFlags );
 }
 
-int iswctype(unsigned short c, int t)
+
+int    iswctype(wint_t wc, wctype_t wctypeFlags)
 {              
 
-       return ((_pwctype_dll[(c & 0xFF)]&t) == t );
+       return ((_pwctype_dll[(unsigned char)(wc & 0xFF)]&wctypeFlags) == wctypeFlags );
 }
 
 // obsolete
-int is_wctype(unsigned short c, int t)
+int    is_wctype(wint_t wc, wctype_t wctypeFlags)
 {              
 
-       return ((_pctype_dll[(c & 0xFF)]&t) == t );
+       return ((_pwctype_dll[(unsigned char)(wc & 0xFF)]&wctypeFlags) == wctypeFlags );
 }
 
index b0ad5a0..93afd37 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <ctype.h>
+#include <crtdll/ctype.h>
 
 #undef isdigit
 int isdigit(int c)
@@ -8,7 +8,7 @@ int isdigit(int c)
 }
 
 #undef iswdigit
-int iswdigit(int c)
+int iswdigit(wint_t c)
 {
    return iswctype(c,_DIGIT);
 }
index ade3e1b..3a4d5da 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <ctype.h>
+#include <crtdll/ctype.h>
 
 #undef isgraph
 int isgraph(int c)
@@ -8,7 +8,7 @@ int isgraph(int c)
 }
 
 #undef iswgraph
-int iswgraph(int c)
+int iswgraph(wint_t c)
 {
        return iswctype(c,_GRAPH);
 }
index 122e7d0..4ce38e1 100644 (file)
@@ -1,13 +1,13 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <ctype.h>
+#include <crtdll/ctype.h>
 
 #undef islower
 int islower(int c)
 {
-  return _isctype((unsigned char)c,_LOWER);
+  return _isctype(c,_LOWER);
 }
 
-int iswlower(int c)
+int iswlower(wint_t c)
 {
-  return iswctype((unsigned short)c,_LOWER);
-}
\ No newline at end of file
+  return iswctype(c,_LOWER);
+}
index 1f7b467..b71b307 100644 (file)
@@ -1,13 +1,13 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <ctype.h>
+#include <crtdll/ctype.h>
 
 #undef isprint
 int isprint(int c)
 {
-  return _isctype((unsigned char)c,_PRINT);
+  return _isctype(c,_PRINT);
 }
 
-int iswprint(int c)
+int iswprint(wint_t c)
 {
   return iswctype((unsigned short)c,_PRINT);
-}
\ No newline at end of file
+}
index 152cb52..57f0ab1 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <ctype.h>
+#include <crtdll/ctype.h>
 
 #undef ispunct
 int ispunct(int c)
@@ -8,7 +8,7 @@ int ispunct(int c)
 }
 
 #undef iswpunct
-int iswpunct(int c)
+int iswpunct(wint_t c)
 {
   return iswctype(c,_PUNCT);
 }
index b884c2c..0e90ae7 100644 (file)
@@ -7,16 +7,16 @@
  * UPDATE HISTORY:
  *              28/12/98: Created
  */
-#include <ctype.h>
+#include <crtdll/ctype.h>
 
 #undef isspace
 int isspace(int c)
 {
-  return _isctype((unsigned char)c,_SPACE);
+  return _isctype(c,_SPACE);
 }
 
 #undef iswspace
-int iswspace(int c)
+int iswspace(wint_t c)
 {
-  return iswctype((unsigned short)c,_SPACE);
+  return iswctype(c,_SPACE);
 }
index a6a5db8..d0d95e0 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <ctype.h>
+#include <crtdll/ctype.h>
 
 #undef isupper
 int isupper(int c)
@@ -7,7 +7,7 @@ int isupper(int c)
   return _isctype(c,_UPPER);
 }
 
-int iswupper(int c)
+int iswupper(wint_t c)
 {
   return iswctype(c,_UPPER);
 }
index 8c4c309..02c8c63 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <ctype.h>
+#include <crtdll/ctype.h>
 
 #undef isxdigit
 int isxdigit(int c)
@@ -8,7 +8,7 @@ int isxdigit(int c)
 }
 
 #undef iswxdigit
-int iswxdigit(int c)
+int iswxdigit(wint_t c)
 {
  return iswctype(c,_HEX);
 }
index b19b799..86d8ff3 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <ctype.h>
+#include <crtdll/ctype.h>
 
 
 int __toascii(int c)
index 80d8cd0..f2cb4dd 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <ctype.h>
+#include <crtdll/ctype.h>
 #undef tolower
 int tolower(int c)
 {
index 096af42..00d6550 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <ctype.h>
-#include <wchar.h>
+#include <crtdll/ctype.h>
+#include <crtdll/wchar.h>
 
 #undef toupper
 int toupper(int c)
index 39e651a..d3898bc 100644 (file)
@@ -1,6 +1,6 @@
-#include <direct.h>
+#include <crtdll/direct.h>
 #include <windows.h>
-#include <ctype.h>
+#include <crtdll/ctype.h>
 
 char _SetCurrentDirectory(char *dir);
 int _GetCurrentDirectory(int count,char *buffer);
index a03eadb..62ba41e 100644 (file)
@@ -1,6 +1,6 @@
-#include <direct.h>
-#include <stdlib.h>
-#include <ctype.h>
+#include <crtdll/direct.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/ctype.h>
 #include <windows.h>
 
 int cur_drive = 0;
index 6012f7a..b81446c 100644 (file)
@@ -1,6 +1,6 @@
 #include <windows.h>
-#include <direct.h>
-#include <stdlib.h>
+#include <crtdll/direct.h>
+#include <crtdll/stdlib.h>
 
 
 
index e86f761..766362b 100644 (file)
@@ -1,6 +1,6 @@
-#include <direct.h>
+#include <crtdll/direct.h>
 #include <windows.h>
-#include <ctype.h>
+#include <crtdll/ctype.h>
 
 
 unsigned int _getdiskfree(unsigned int _drive, struct _diskfree_t *_diskspace)
index da2c25d..6165ef8 100644 (file)
@@ -1,5 +1,5 @@
-#include <direct.h>
-#include <ctype.h>
+#include <crtdll/direct.h>
+#include <crtdll/ctype.h>
 #include <windows.h>
 
 extern int cur_drive;
index 4d359f6..b814ee0 100644 (file)
@@ -1,4 +1,4 @@
-#include <direct.h>
+#include <crtdll/direct.h>
 #include <windows.h>
 
 #undef mkdir
index 2027994..c9979a9 100644 (file)
@@ -1,4 +1,4 @@
-#include <direct.h>
+#include <crtdll/direct.h>
 #include <windows.h>
 
 #undef rmdir
index 54104d4..9a346ab 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.1 $
- * $Author: rex $
- * $Date: 1999/01/16 02:11:43 $
+ * $Revision: 1.2 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:43:47 $
  *
  */
 
-#include <stdlib.h>
-/* #include <ctype.h> */
-#include <errno.h>
-#include <string.h>
-#include <dir.h>
-#include <direct.h>
-#include <sys/stat.h>
+#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 <dirent.h>
+#include <crtdll/dirent.h>
 
 #define SUFFIX "*"
 #define        SLASH   "\\"
diff --git a/reactos/lib/crtdll/except/abnorter.c b/reactos/lib/crtdll/except/abnorter.c
new file mode 100644 (file)
index 0000000..3a97400
--- /dev/null
@@ -0,0 +1,6 @@
+#include <windows.h>
+
+int _abnormal_termination(void)
+{
+       return AbnormalTermination();
+}
\ No newline at end of file
diff --git a/reactos/lib/crtdll/float/chgsign.c b/reactos/lib/crtdll/float/chgsign.c
new file mode 100644 (file)
index 0000000..42132a4
--- /dev/null
@@ -0,0 +1,8 @@
+#include <crtdll/float.h>
+
+//Obvious fixme
+
+double _chgsign( double x )
+{
+       return -1.0*x;
+}
index 5b490f2..e824752 100644 (file)
@@ -1,4 +1,4 @@
-#include <float.h>
+#include <crtdll/float.h>
 
 unsigned int   _clearfp (void)
 {      
index 6167bed..5f2c385 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <float.h>
+#include <crtdll/float.h>
 
 unsigned int   _controlfp (unsigned int unNew, unsigned int unMask)
 {      
index 76acba8..df0ccc9 100644 (file)
@@ -1,7 +1,7 @@
-#include <float.h>
+#include <crtdll/float.h>
 
 void    _fpreset (void)
 {
        __asm__ __volatile__("fninit\n\t");
        return;
-}
\ No newline at end of file
+}
diff --git a/reactos/lib/crtdll/float/isnan.c b/reactos/lib/crtdll/float/isnan.c
new file mode 100644 (file)
index 0000000..30e2e7e
--- /dev/null
@@ -0,0 +1,12 @@
+#include <crtdll/math.h>
+#include <crtdll/float.h>
+
+int isnan(double x)
+{
+       if ( x>= 0.0 && x < HUGE_VAL ) 
+               return FALSE;
+       else if ( x <= 0.0 && x > HUGE_VAL )
+               return FALSE;
+
+       return TRUE;
+}
\ No newline at end of file
index 0786a7e..5cfeabf 100644 (file)
@@ -1,4 +1,4 @@
-#include <float.h>
+#include <crtdll/float.h>
 
 unsigned int   _statusfp (void)
 {      
@@ -11,4 +11,4 @@ __asm__ __volatile__ (
        :"=a" (__res)
        );
        return __res;
-}
\ No newline at end of file
+}
index 8395761..47f66cd 100644 (file)
@@ -1,4 +1,4 @@
-#include <io.h>
+#include <crtdll/io.h>
 #include <windows.h>
 
 #ifndef F_OK
@@ -24,7 +24,7 @@ int _access( const char *_path, int _amode )
        if ( Attributes == -1 )
                return -1;
 
-       if ( _amode & W_OK == W_OK ) {
+       if ( (_amode & W_OK) == W_OK ) {
                if ( (Attributes & FILE_ATTRIBUTE_READONLY) == FILE_ATTRIBUTE_READONLY )
                        return -1;
        }
index ff5d696..264b9b5 100644 (file)
@@ -1,5 +1,5 @@
 #include <windows.h>
-#include <io.h>
+#include <crtdll/io.h>
 
 int
 _chmod(const char *filename, int func)
index 37f4242..f69ad44 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
-#include <io.h>
+#include <crtdll/io.h>
 
 int
 chsize(int _fd, long size)
index 2865179..a5f229c 100644 (file)
@@ -1,6 +1,6 @@
-#include <io.h>
+#include <crtdll/io.h>
 #include <windows.h>
-#include <libc/file.h>
+#include <crtdll/internal/file.h>
 
 
 int    _close(int _fd)
index 3afcc14..8c9d787 100644 (file)
@@ -1,7 +1,9 @@
 #include <windows.h>
-#include <io.h>
-#include <errno.h>
-#include <libc/file.h>
+#include <crtdll/io.h>
+#include <crtdll/errno.h>
+#include <crtdll/internal/file.h>
+
+int _commode_dll = _IOCOMMIT;
 
 int _commit(int _fd)
 {
index bd382e9..46175a3 100644 (file)
@@ -1,5 +1,5 @@
-#include <io.h>
-#include <fcntl.h>
+#include <crtdll/io.h>
+#include <crtdll/fcntl.h>
 
 #undef creat
 int creat(const char *filename, int mode)
index 19c9163..7ddf843 100644 (file)
@@ -1,5 +1,5 @@
 #include <windows.h>
-#include <io.h>
+#include <crtdll/io.h>
 
 
 int _dup( int handle )
index bafe19a..98ea368 100644 (file)
@@ -1,12 +1,6 @@
 #include <windows.h>
-#include <io.h>
-
-#undef dup2
-int dup2( int handle1, int handle2 )
-{
-       return _dup2(handle1,handle2);
-}
-
+#include <crtdll/io.h>
+#include <crtdll/internal/file.h>
 
 int _dup2( int handle1, int handle2 )
 {
index 385f5ed..baf3952 100644 (file)
@@ -1,5 +1,5 @@
 #include <windows.h>
-#include <io.h>
+#include <crtdll/io.h>
 
 int _eof( int _fd )
 {
index 6707313..b234bf4 100644 (file)
@@ -1,5 +1,5 @@
 #include <windows.h>
-#include <io.h>
+#include <crtdll/io.h>
 
 long
 _filelength(int _fd)
index 2015fef..58a2e7e 100644 (file)
@@ -1,24 +1,11 @@
 #include <windows.h>
-#include <io.h>
-#include <string.h>
+#include <crtdll/io.h>
+#include <crtdll/string.h>
+#include <crtdll/internal/file.h>
 
-#if 0
 
-//UnixTimeToFileTime
-//FileTimeToUnixTime
-/*
- * DOS file system functions
- *
- * Copyright 1993 Erik Bos
- * Copyright 1996 Alexandre Julliard
- */
 
-
-void UnixTimeToFileTime( time_t unix_time, FILETIME *filetime, DWORD remainder );
-time_t FileTimeToUnixTime( const FILETIME *filetime, DWORD *remainder ); 
-
-
-long  _findfirst(char *_name, struct _finddata_t *result)
+int _findfirst(const char *_name, struct _finddata_t *result)
 {
        WIN32_FIND_DATA FindFileData;
        char dir[MAX_PATH];
@@ -32,7 +19,7 @@ long  _findfirst(char *_name, struct _finddata_t *result)
        }
        else 
                strcpy(dir,_name);
-       hFindFile = FindFirstFile( dir, &FindFileData );        
+       hFindFile = (long)FindFirstFileA( dir, &FindFileData ); 
        result->attrib = FindFileData.dwFileAttributes; 
 
 
@@ -40,17 +27,17 @@ long  _findfirst(char *_name, struct _finddata_t *result)
        result->time_access = FileTimeToUnixTime( &FindFileData.ftLastAccessTime,NULL);
        result->time_write = FileTimeToUnixTime( &FindFileData.ftLastWriteTime,NULL);
        result->size = FindFileData.nFileSizeLow;
-       strncpy(result->name,&FindFileData.cFileName,260);
+       strncpy(result->name,FindFileData.cFileName,260);
        return hFindFile;
 }
 
-int  _findnext(long handle, struct _finddata_t  *result)
+int  _findnext(int handle, struct _finddata_t  *result)
 {
        WIN32_FIND_DATA FindFileData;
        if (handle == -1 )
                return -1;
 
-       if ( !FindNextFile(handle, &FindFileData ) )
+       if ( !FindNextFile((void *)handle, &FindFileData ) )
                return -1;
        
        result->attrib = FindFileData.dwFileAttributes; 
@@ -58,198 +45,12 @@ int  _findnext(long handle, struct _finddata_t  *result)
        result->time_access = FileTimeToUnixTime( &FindFileData.ftLastAccessTime,NULL);
        result->time_write = FileTimeToUnixTime( &FindFileData.ftLastWriteTime,NULL);
        result->size = FindFileData.nFileSizeLow;
-       strncpy(result->name,&FindFileData.cFileName,260);
+       strncpy(result->name,FindFileData.cFileName,260);
        return 0;
 }
-int  _findclose(long handle)
+int  _findclose(int handle)
 {
-       return FindClose(handle);
+       return FindClose((void *)handle);
 }
 
 
-/***********************************************************************
- *           DOSFS_UnixTimeToFileTime
- *
- * Convert a Unix time to FILETIME format.
- * The FILETIME structure is a 64-bit value representing the number of
- * 100-nanosecond intervals since January 1, 1601, 0:00.
- * 'remainder' is the nonnegative number of 100-ns intervals
- * corresponding to the time fraction smaller than 1 second that
- * couldn't be stored in the time_t value.
- */
-void UnixTimeToFileTime( time_t unix_time, FILETIME *filetime,
-                               DWORD remainder )
-{
-    /* NOTES:
-
-       CONSTANTS: 
-       The time difference between 1 January 1601, 00:00:00 and
-       1 January 1970, 00:00:00 is 369 years, plus the leap years
-       from 1604 to 1968, excluding 1700, 1800, 1900.
-       This makes (1968 - 1600) / 4 - 3 = 89 leap days, and a total
-       of 134774 days.
-
-       Any day in that period had 24 * 60 * 60 = 86400 seconds.
-
-       The time difference is 134774 * 86400 * 10000000, which can be written
-       116444736000000000
-       27111902 * 2^32 + 3577643008
-       413 * 2^48 + 45534 * 2^32 + 54590 * 2^16 + 32768
-
-       If you find that these constants are buggy, please change them in all
-       instances in both conversion functions.
-
-       VERSIONS:
-       There are two versions, one of them uses long long variables and
-       is presumably faster but not ISO C. The other one uses standard C
-       data types and operations but relies on the assumption that negative
-       numbers are stored as 2's complement (-1 is 0xffff....). If this
-       assumption is violated, dates before 1970 will not convert correctly.
-       This should however work on any reasonable architecture where WINE
-       will run.
-
-       DETAILS:
-       
-       Take care not to remove the casts. I have tested these functions
-       (in both versions) for a lot of numbers. I would be interested in
-       results on other compilers than GCC.
-
-       The operations have been designed to account for the possibility
-       of 64-bit time_t in future UNICES. Even the versions without
-       internal long long numbers will work if time_t only is 64 bit.
-       A 32-bit shift, which was necessary for that operation, turned out
-       not to work correctly in GCC, besides giving the warning. So I
-       used a double 16-bit shift instead. Numbers are in the ISO version
-       represented by three limbs, the most significant with 32 bit, the
-       other two with 16 bit each.
-
-       As the modulo-operator % is not well-defined for negative numbers,
-       negative divisors have been avoided in DOSFS_FileTimeToUnixTime.
-
-       There might be quicker ways to do this in C. Certainly so in
-       assembler.
-
-       Claus Fischer, fischer@iue.tuwien.ac.at
-       */
-
-
-
-
-    unsigned long a0;                  /* 16 bit, low    bits */
-    unsigned long a1;                  /* 16 bit, medium bits */
-    unsigned long a2;                  /* 32 bit, high   bits */
-
-    /* Copy the unix time to a2/a1/a0 */
-    a0 =  unix_time & 0xffff;
-    a1 = (unix_time >> 16) & 0xffff;
-    /* This is obsolete if unix_time is only 32 bits, but it does not hurt.
-       Do not replace this by >> 32, it gives a compiler warning and it does
-       not work. */
-    a2 = (unix_time >= 0 ? (unix_time >> 16) >> 16 :
-          ~((~unix_time >> 16) >> 16));
-
-    /* Multiply a by 10000000 (a = a2/a1/a0)
-       Split the factor into 10000 * 1000 which are both less than 0xffff. */
-    a0 *= 10000;
-    a1 = a1 * 10000 + (a0 >> 16);
-    a2 = a2 * 10000 + (a1 >> 16);
-    a0 &= 0xffff;
-    a1 &= 0xffff;
-
-    a0 *= 1000;
-    a1 = a1 * 1000 + (a0 >> 16);
-    a2 = a2 * 1000 + (a1 >> 16);
-    a0 &= 0xffff;
-    a1 &= 0xffff;
-
-    /* Add the time difference and the remainder */
-    a0 += 32768 + (remainder & 0xffff);
-    a1 += 54590 + (remainder >> 16   ) + (a0 >> 16);
-    a2 += 27111902                     + (a1 >> 16);
-    a0 &= 0xffff;
-    a1 &= 0xffff;
-
-    /* Set filetime */
-    filetime->dwLowDateTime  = (a1 << 16) + a0;
-    filetime->dwHighDateTime = a2;
-}
-
-
-/***********************************************************************
- *           DOSFS_FileTimeToUnixTime
- *
- * Convert a FILETIME format to Unix time.
- * If not NULL, 'remainder' contains the fractional part of the filetime,
- * in the range of [0..9999999] (even if time_t is negative).
- */
-time_t FileTimeToUnixTime( const FILETIME *filetime, DWORD *remainder )
-{
-    /* Read the comment in the function DOSFS_UnixTimeToFileTime. */
-
-    unsigned long a0;                  /* 16 bit, low    bits */
-    unsigned long a1;                  /* 16 bit, medium bits */
-    unsigned long a2;                  /* 32 bit, high   bits */
-    unsigned long r;                   /* remainder of division */
-    unsigned int carry;         /* carry bit for subtraction */
-    int negative;               /* whether a represents a negative value */
-
-    /* Copy the time values to a2/a1/a0 */
-    a2 =  (unsigned long)filetime->dwHighDateTime;
-    a1 = ((unsigned long)filetime->dwLowDateTime ) >> 16;
-    a0 = ((unsigned long)filetime->dwLowDateTime ) & 0xffff;
-
-    /* Subtract the time difference */
-    if (a0 >= 32768           ) a0 -=             32768        , carry = 0;
-    else                        a0 += (1 << 16) - 32768        , carry = 1;
-
-    if (a1 >= 54590    + carry) a1 -=             54590 + carry, carry = 0;
-    else                        a1 += (1 << 16) - 54590 - carry, carry = 1;
-
-    a2 -= 27111902 + carry;
-    
-    /* If a is negative, replace a by (-1-a) */
-    negative = (a2 >= ((unsigned long)1) << 31);
-    if (negative)
-    {
-        /* Set a to -a - 1 (a is a2/a1/a0) */
-        a0 = 0xffff - a0;
-        a1 = 0xffff - a1;
-        a2 = ~a2;
-    }
-
-    /* Divide a by 10000000 (a = a2/a1/a0), put the rest into r.
-       Split the divisor into 10000 * 1000 which are both less than 0xffff. */
-    a1 += (a2 % 10000) << 16;
-    a2 /=       10000;
-    a0 += (a1 % 10000) << 16;
-    a1 /=       10000;
-    r   =  a0 % 10000;
-    a0 /=       10000;
-
-    a1 += (a2 % 1000) << 16;
-    a2 /=       1000;
-    a0 += (a1 % 1000) << 16;
-    a1 /=       1000;
-    r  += (a0 % 1000) * 10000;
-    a0 /=       1000;
-
-    /* If a was negative, replace a by (-1-a) and r by (9999999 - r) */
-    if (negative)
-    {
-        /* Set a to -a - 1 (a is a2/a1/a0) */
-        a0 = 0xffff - a0;
-        a1 = 0xffff - a1;
-        a2 = ~a2;
-
-        r  = 9999999 - r;
-    }
-
-    if (remainder) *remainder = r;
-
-    /* Do not replace this by << 32, it gives a compiler warning and it does
-       not work. */
-    return ((((time_t)a2) << 16) << 16) + (a1 << 16) + a0;
-
-}
-
-#endif
index 6fd48c8..fc89be4 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <fcntl.h>
-#include <io.h>
+#include <crtdll/fcntl.h>
+#include <crtdll/io.h>
 
 #undef _fmode
 unsigned int _fmode = O_TEXT;
index a8a74e6..a7eb65b 100644 (file)
@@ -1,8 +1,14 @@
-#include <io.h>
+#include <crtdll/io.h>
+#include <crtdll/sys/stat.h>
 
-#undef isatty
 
-int isatty( int handle )
+int _isatty( int fd )
 {
-       return (handle & 3);
+  struct stat buf;
+
+  if (fstat (fd, &buf) < 0)
+    return 0;
+  if (S_ISCHR (buf.st_mode))
+    return 1;
+  return 0;
 }
index 4847230..b846ef5 100644 (file)
@@ -1,5 +1,5 @@
 #include <windows.h>
-#include <io.h>
+#include <crtdll/io.h>
 
 int _locking( int _fd, int mode, long nbytes )
 {
@@ -8,4 +8,4 @@ int _locking( int _fd, int mode, long nbytes )
                return -1;
  
        return 0;
-}
\ No newline at end of file
+}
index cba29e6..a0e9246 100644 (file)
@@ -1,16 +1,10 @@
 #include <windows.h>
-#include <io.h>
-//#include <libc/file.h>
-
-#undef lseek
-long lseek(int _fildes, long _offset, int _whence)
-{
-       return _lseek(_fildes,_offset,_whence);
-}
+#include <crtdll/io.h>
+#include <crtdll/internal/file.h>
 
 long _lseek(int _fildes, long _offset, int _whence)
 {
-       //return _llseek(filehnd(_fildes),_offset,_whence);
+       return _llseek((HFILE)filehnd(_fildes),_offset,_whence);
 }
 
 
index d0531d9..be394db 100644 (file)
@@ -13,9 +13,9 @@
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <stdio.h>
-#include <string.h>
-#include <io.h>
+#include <crtdll/stdio.h>
+#include <crtdll/string.h>
+#include <crtdll/io.h>
 
 
 char *
index eb68528..08a4470 100644 (file)
@@ -7,14 +7,14 @@
  * UPDATE HISTORY:
  *              28/12/98: Created
  */
-#include <io.h>
+#include <crtdll/io.h>
 #include <windows.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <stdlib.h>
-#include <libc/file.h>
-#include <string.h>
-#include <share.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>
 
 typedef struct _fileno_modes_type
 {
@@ -39,12 +39,6 @@ char __is_text_file(FILE *p) {
 
 int __fileno_alloc(HANDLE hFile, int mode);
 
-// fixme
-#undef open
-int open(const char *_path, int _oflag,...)
-{
-       return _open(_path,_oflag);
-}
 
 int _open(const char *_path, int _oflag,...)
 {
@@ -55,9 +49,9 @@ int _open(const char *_path, int _oflag,...)
        DWORD dwCreationDistribution = 0;
        DWORD dwFlagsAndAttributes = 0;
        
-       if (( _oflag & _S_IREAD ) == _S_IREAD)
+       if (( _oflag & S_IREAD ) == S_IREAD)
                dwShareMode = FILE_SHARE_READ;
-       else if ( ( _oflag & _S_IWRITE) == _S_IWRITE ) {
+       else if ( ( _oflag & S_IWRITE) == S_IWRITE ) {
                dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
        }
 
@@ -74,18 +68,21 @@ _O_TEXT   Opens file in text (translated) mode. (For more information, see Text
        else if (( _oflag & _O_WRONLY ) == _O_WRONLY )
                dwDesiredAccess |= GENERIC_WRITE;
        
-       if (( _oflag & _S_IREAD ) == _S_IREAD )
+       if (( _oflag & S_IREAD ) == S_IREAD )
                dwShareMode |= FILE_SHARE_READ;
        
-       if (( _oflag & _S_IWRITE ) == _S_IWRITE )
+       if (( _oflag & S_IWRITE ) == S_IWRITE )
                dwShareMode |= FILE_SHARE_WRITE;        
 
        if (( _oflag & (_O_CREAT | _O_EXCL ) ) == (_O_CREAT | _O_EXCL) )
                dwCreationDistribution |= CREATE_NEW;
 
-       else if (( _oflag & (O_TRUNC | O_CREAT ) ) == (O_TRUNC | O_CREAT) )
-               dwCreationDistribution |= CREATE_ALWAYS;
-
+       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 )
@@ -93,8 +90,7 @@ _O_TEXT   Opens file in text (translated) mode. (For more information, see Text
        else
                dwCreationDistribution |= OPEN_EXISTING;
 
-//     if (( _oflag &  _O_TRUNC ) == _O_TRUNC )
-//             dwCreationDistribution |= TRUNCATE_EXISTING;
+       
 
        if (( _oflag &  _O_RANDOM ) == _O_RANDOM )
                dwFlagsAndAttributes |= FILE_FLAG_RANDOM_ACCESS;        
@@ -224,7 +220,7 @@ int __fileno_dup2( int handle1, int handle2 )
 int __fileno_setmode(int _fd, int _newmode)
 {
        int m;
-       if ( _fd < 0 )
+       if ( _fd < minfno )
                return -1;
 
        if ( _fd >= maxfno )
@@ -245,10 +241,15 @@ int       __fileno_close(int _fd)
 
        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);
 }      
+
+void *_get_osfhandle( int fileno )
+{
+       return  filehnd(fileno);
+}
\ No newline at end of file
index 959d0e1..8c67f7a 100644 (file)
@@ -8,8 +8,8 @@
  *              28/12/98: Appropriated for Reactos
  */
 #include <windows.h>
-#include <io.h>
-#include <libc/file.h>
+#include <crtdll/io.h>
+#include <crtdll/internal/file.h>
 
 
 int _pipe(int _fildes[2], unsigned int size, int mode )
index 5dc92ed..965f4e1 100644 (file)
@@ -7,7 +7,7 @@
  * UPDATE HISTORY:
  *              28/12/98: Created
  */
-#include <io.h>
+#include <crtdll/io.h>
 #include <windows.h>
 
 size_t _read(int _fd, void *_buf, size_t _nbyte)
index 8510f56..6ccbc2f 100644 (file)
@@ -8,9 +8,9 @@
  *              28/12/98: Created
  */
 
-#include <io.h>
-#include <stdio.h>
-#include <libc/file.h>
+#include <crtdll/io.h>
+#include <crtdll/stdio.h>
+#include <crtdll/internal/file.h>
 
 #undef setmode
 int setmode(int _fd, int _newmode)
index 680227e..5282f14 100644 (file)
@@ -1,4 +1,4 @@
-#include <io.h>
+#include <crtdll/io.h>
 
 
 int _sopen(char *path,int access,int shflag,int mode)
index f96a453..ce53df0 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <errno.h>
-#include <io.h>
+#include <crtdll/errno.h>
+#include <crtdll/io.h>
 
 
 off_t
index e21a33f..7a8323b 100644 (file)
@@ -1,11 +1,11 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <sys/stat.h>
+#include <crtdll/sys/stat.h>
 
-mode_t
-_umask(mode_t newmask)
+unsigned _unMode_dll = 022;
+
+unsigned       _umask (unsigned unMode)
 {
-  static mode_t the_mask = 022;
-  mode_t old_mask = the_mask;
-  the_mask = newmask;
+  unsigned old_mask = _unMode_dll;
+  _unMode_dll = unMode;
   return old_mask;
 }
index de50275..65ef9d4 100644 (file)
@@ -8,7 +8,7 @@
  *              28/12/98: Created
  */
 #include <windows.h>
-#include <io.h>
+#include <crtdll/io.h>
 
 
 
index df9b11e..86822b5 100644 (file)
@@ -7,7 +7,7 @@
  * UPDATE HISTORY:
  *              28/12/98: Created
  */
-#include <io.h>
+#include <crtdll/io.h>
 #include <windows.h>
 
 
diff --git a/reactos/lib/crtdll/locale/locale.c b/reactos/lib/crtdll/locale/locale.c
new file mode 100644 (file)
index 0000000..6db5bf2
--- /dev/null
@@ -0,0 +1,172 @@
+/*
+FUNCTION
+<<setlocale>>, <<localeconv>>---select or query locale
+
+INDEX
+       setlocale
+INDEX
+       localeconv
+INDEX
+       _setlocale_r
+INDEX
+       _localeconv_r
+
+ANSI_SYNOPSIS
+       #include <crtdll/locale.h>
+       char *setlocale(int <[category]>, const char *<[locale]>);
+       lconv *localeconv(void);
+
+       char *_setlocale_r(void *<[reent]>,
+                        int <[category]>, const char *<[locale]>);
+       lconv *_localeconv_r(void *<[reent]>);
+
+TRAD_SYNOPSIS
+       #include <crtdll/locale.h>
+       char *setlocale(<[category]>, <[locale]>)
+       int <[category]>;
+       char *<[locale]>;
+
+       lconv *localeconv();
+
+       char *_setlocale_r(<[reent]>, <[category]>, <[locale]>)
+       char *<[reent]>;
+       int <[category]>;
+       char *<[locale]>;
+
+       lconv *_localeconv_r(<[reent]>);
+       char *<[reent]>;
+
+DESCRIPTION
+<<setlocale>> is the facility defined by ANSI C to condition the
+execution environment for international collating and formatting
+information; <<localeconv>> reports on the settings of the current
+locale.
+
+This is a minimal implementation, supporting only the required <<``C''>>
+value for <[locale]>; strings representing other locales are not
+honored unless MB_CAPABLE is defined in which case three new
+extensions are allowed for LC_CTYPE only: <<''C-JIS''>>, <<''C-EUCJP''>>,
+and <<''C-SJIS''>>.  (<<``''>> is also accepted; it represents the default locale
+for an implementation, here equivalent to <<``C''>>.)
+
+If you use <<NULL>> as the <[locale]> argument, <<setlocale>> returns
+a pointer to the string representing the current locale (always
+<<``C''>> in this implementation).  The acceptable values for
+<[category]> are defined in `<<locale.h>>' as macros beginning with
+<<"LC_">>, but this implementation does not check the values you pass
+in the <[category]> argument.
+
+<<localeconv>> returns a pointer to a structure (also defined in
+`<<locale.h>>') describing the locale-specific conventions currently
+in effect.  
+
+<<_localeconv_r>> and <<_setlocale_r>> are reentrant versions of
+<<localeconv>> and <<setlocale>> respectively.  The extra argument
+<[reent]> is a pointer to a reentrancy structure.
+
+RETURNS
+<<setlocale>> returns either a pointer to a string naming the locale
+currently in effect (always <<``C''>> for this implementation, or, if
+the locale request cannot be honored, <<NULL>>.
+
+<<localeconv>> returns a pointer to a structure of type <<lconv>>,
+which describes the formatting and collating conventions in effect (in
+this implementation, always those of the C locale).
+
+PORTABILITY
+ANSI C requires <<setlocale>>, but the only locale required across all
+implementations is the C locale.
+
+No supporting OS subroutines are required.
+*/
+
+/*
+ * setlocale, localeconv : internationalize your locale.
+ *                         (Only "C" or null supported).
+ */
+
+#include <crtdll/locale.h>
+#include <crtdll/string.h>
+#include <limits.h>
+
+
+int _current_category; /* used by setlocale */
+const char *_current_locale;
+int __mb_cur_max_dll = 1;
+
+static const struct lconv lconv = 
+{
+  ".", "", "", "", "", "", "", "", "", "",
+  CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX,
+  CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX,
+};
+
+
+char * setlocale(int category ,const char *locale)
+{
+  static char lc_ctype[8] = "C";
+  static char last_lc_ctype[8] = "C";
+
+#ifndef MB_CAPABLE
+  if (locale)
+    { 
+      if (strcmp (locale, "C") && strcmp (locale, ""))
+        return 0;
+      _current_category = category;  
+      _current_locale = locale;
+    }
+  return "C";
+#else
+  if (locale)
+    {
+      if (category != LC_CTYPE) 
+        { 
+          if (strcmp (locale, "C") && strcmp (locale, ""))
+            return 0;
+          if (category == LC_ALL)
+            {
+              strcpy (last_lc_ctype, lc_ctype);
+              strcpy (lc_ctype, locale);
+              __mb_cur_max_dll = 1;
+            }
+        }
+      else
+        { 
+          if (strcmp (locale, "C") && strcmp (locale, "") &&
+              strcmp (locale, "C") && strcmp (locale, "C-JIS") && 
+              strcmp (locale, "C-EUCJP") && strcmp (locale, "C-SJIS"))
+            return 0;
+
+          strcpy (last_lc_ctype, lc_ctype);
+          strcpy (lc_ctype, locale);
+
+          if (!strcmp (locale, "C-JIS"))
+            __mb_cur_max_dll = 8;
+          else if (strlen (locale) > 1)
+            __mb_cur_max_dll = 2;
+          else
+            __mb_cur_max_dll = 1; 
+        }
+      _current_category = category;  
+      _current_locale = locale;
+
+      if (category == LC_CTYPE)
+        return last_lc_ctype;
+    }
+  else
+    {
+      if (category == LC_CTYPE)
+        return lc_ctype;
+    }
+  return "C";
+#endif
+  
+}
+
+
+struct lconv *localeconv(void)
+{
+  return (struct lconv *) &lconv;
+}
+
index 653aa27..bf76327 100644 (file)
@@ -25,8 +25,9 @@ CONIO_OBJECTS = conio/cputs.o conio/getch.o conio/getche.o conio/putch.o conio/u
 DIRECT_OBJECTS = direct/chdir.o direct/chdrive.o direct/getcwd.o direct/getdrive.o \
                 direct/rmdir.o direct/mkdir.o direct/getdfree.o
 
+MALLOC_OBJECTS = malloc/expand.o malloc/heap.o
 
-MISC_OBJECTS =  misc/sleep.o misc/GetArgs.o misc/CRTfmode.o misc/CRTglob.o
+MISC_OBJECTS =   misc/GetArgs.o misc/setnew.o misc/purecall.o
 
 STRING_OBJECTS = string/memchr.o string/memcmp.o string/strcat.o \
                  string/strchr.o string/strcmp.o string/strcoll.o \
@@ -36,13 +37,14 @@ STRING_OBJECTS = string/memchr.o string/memcmp.o string/strcat.o \
                 string/strspn.o string/strstr.o string/strtok.o \
                 string/strxfrm.o string/memmove.o string/memset.o \
                 string/strdup.o string/strlwr.o string/strupr.o \
-                string/str_old.o string/strerror.o
+                string/str_old.o string/strerror.o string/stricmp.o\
+                string/strnlen.o
 
 WCHAR_OBJECTS = wchar/wcscat.o wchar/wcschr.o wchar/wcscmp.o \
                 wchar/wcscoll.o wchar/wcscpy.o wchar/wcscspn.o \
                 wchar/wcsdup.o wchar/wcsicmp.o wchar/wcslen.o \
                 wchar/wcslwr.o wchar/wcsncat.o wchar/wcsncmp.o \
-                wchar/wcsncpy.o
+                wchar/wcsncpy.o  
 
 STDIO_OBJECTS = stdio/getenv.o stdio/doprnt.o stdio/doscan.o stdio/filbuf.o  \
                stdio/fclose.o stdio/feof.o stdio/ferror.o stdio/fileno.o\
@@ -53,7 +55,7 @@ STDIO_OBJECTS = stdio/getenv.o stdio/doprnt.o stdio/doscan.o stdio/filbuf.o  \
                stdio/getchar.o stdio/gets.o stdio/getw.o stdio/perror.o stdio/printf.o \
                stdio/putc.o stdio/putchar.o stdio/puts.o stdio/putw.o \
                stdio/remove.o stdio/rename.o stdio/rewind.o stdio/allocfil.o\
-               stdio/scanf.o stdio/setbuf.o stdio/setbuffe.o \
+               stdio/scanf.o stdio/setbuf.o stdio/setbuffe.o stdlib/obsol.o\
                stdio/setlineb.o stdio/setvbuf.o stdio/sprintf.o stdio/sscanf.o \
                stdio/stdiohk.o stdio/stdhnd.o stdio/tempnam.o stdio/tmpfile.o stdio/tmpnam.o \
                stdio/ungetc.o stdio/vfprintf.o stdio/vprintf.o stdio/vsprintf.o
@@ -64,24 +66,30 @@ IO_OBJECTS = io/access.o io/close.o io/create.o io/dup.o io/dup2.o io/find.o io/
                io/chmod.o io/chsize.o io/commit.o io/locking.o io/pipe.o io/sopen.o io/filelen.o\
                io/umask.o io/tell.o io/eof.o
 
+SEARCH_OBJECTS = search/lsearch.o search/lfind.o
+
 STDLIB_OBJECTS = stdlib/abort.o stdlib/abs.o stdlib/atexit.o stdlib/atof.o stdlib/atoi.o \
-                stdlib/bsearch.o stdlib/div.o stdlib/errno.o  stdlib/Exit.o \
-                stdlib/fullpath.o stdlib/labs.o stdlib/ldiv.o stdlib/llabs.o stdlib/lldiv.o \
+                stdlib/bsearch.o stdlib/div.o stdlib/errno.o  stdlib/_exit.o \
+                stdlib/fullpath.o stdlib/labs.o stdlib/ldiv.o \
                 stdlib/makepath.o stdlib/malloc.o stdlib/putenv.o stdlib/qsort.o \
                 stdlib/rand.o stdlib/senv.o stdlib/splitp.o stdlib/strtod.o stdlib/strtol.o \
-                stdlib/strtoul.o 
+                stdlib/strtoul.o stdlib/swab.o stdlib/atol.o 
 
 SIGNAL_OBJECTS = signal/signal.o
 
 PROCESS_OBJECTS = process/_cwait.o process/dll.o process/spawnl.o process/spawnlp.o process/spawnlpe.o  process/spawnvpe.o process/spawnvp.o \
                process/spawnv.o process/spawnve.o process/spawnle.o process/execl.o process/execlp.o process/execlpe.o  \
-               process/execvpe.o process/execvp.o process/execv.o process/execle.o process/_system.o
+               process/execvpe.o process/execvp.o process/execv.o process/execle.o process/_system.o\
+               process/threadid.o process/thread.o
+
+TCHAR_OBJECTS = tchar/strdec.o tchar/strinc.o tchar/strninc.o  tchar/strncnt.o tchar/strnextc.o tchar/strspnp.o
 
 TIME_OBJECTS = time/ctime.o time/difftime.o time/strftime.o time/time.o time/clock.o
 
-FLOAT_OBJECTS = float/fpreset.o float/clearfp.o float/cntrlfp.o float/statfp.o float/logb.o
+FLOAT_OBJECTS = float/fpreset.o float/clearfp.o float/cntrlfp.o float/statfp.o float/logb.o\
+               float/chgsign.o
 
-SYS_STAT_OBJECTS = sys_stat/fstat.o sys_stat/stat.o 
+SYS_STAT_OBJECTS = sys_stat/fstat.o sys_stat/stat.o sys_stat/futime.o
 
 
 MATH_OBJECTS = math/acos.o math/acosh.o math/asin.o math/asinh.o math/atan.o math/atan2.o\
@@ -89,17 +97,18 @@ MATH_OBJECTS = math/acos.o math/acosh.o math/asin.o math/asinh.o math/atan.o mat
                math/floor.o math/fmod.o math/frexp.o math/huge_val.o math/hypot.o\
                math/ldexp.o math/log.o math/log10.o math/modf.o math/pow.o\
                math/sin.o math/sinh.o math/sqrt.o math/tan.o\
-               math/tanh.o
+               math/tanh.o math/stubs.o math/j0_y0.o math/j1_y1.o math/jn_yn.o
 
 
 OBJECTS = $(ASSERT_OBJECTS) $(CTYPE_OBJECTS) $(CONIO_OBJECTS) $(DIRECT_OBJECTS)\
          $(MISC_OBJECTS) $(STRING_OBJECTS)  $(STDIO_OBJECTS) $(STDLIB_OBJECTS) \
-         $(IO_OBJECTS)  $(PROCESS_OBJECTS) $(TIME_OBJECTS)  \
-         $(SYS_STAT_OBJECTS) $(SIGNAL_OBJECTS) $(MATH_OBJECTS) $(FLOAT_OBJECTS)
+         $(IO_OBJECTS)  $(PROCESS_OBJECTS) $(TIME_OBJECTS)  $(MALLOC_OBJECTS)\
+         $(SYS_STAT_OBJECTS) $(SIGNAL_OBJECTS) $(MATH_OBJECTS) $(FLOAT_OBJECTS)\
+         $(SEARCH_OBJECTS)
 
 
 crtdll.a: $(OBJECTS)
-       $(LD) -r $(OBJECTS) -o crtdll.a
+       $(LD)  -r $(OBJECTS) -o crtdll.a
 
 crtdll.dll: $(DLLMAIN) $(OBJECTS) crtdll.def
        $(LD) -r $(OBJECTS) -o crtdll.o
diff --git a/reactos/lib/crtdll/malloc/expand.c b/reactos/lib/crtdll/malloc/expand.c
new file mode 100644 (file)
index 0000000..dec9d93
--- /dev/null
@@ -0,0 +1,28 @@
+#include <windows.h>
+#include <kernel32/heap.h>
+#include <crtdll/malloc.h>
+#include <crtdll/stdlib.h>
+
+void *_expand( void *pold, size_t size )
+{
+   PHEAP_BUCKET        pbucket;
+   PHEAP_SUBALLOC      psub;
+   PHEAP_FRAGMENT      pfrag=(PHEAP_FRAGMENT)((LPVOID)pold-HEAP_FRAG_ADMIN_SIZE);
+   
+   /* sanity checks */
+   if(pfrag->Magic!=HEAP_FRAG_MAGIC)
+      return NULL;
+
+   /* get bucket size */
+   psub=pfrag->Sub;
+   pbucket=psub->Bucket;
+   if(size<=pbucket->Size)
+   {
+      pfrag->Size=size;
+      return pold;
+   }
+   else
+       return NULL;
+
+   return NULL;
+}
diff --git a/reactos/lib/crtdll/malloc/heap.c b/reactos/lib/crtdll/malloc/heap.c
new file mode 100644 (file)
index 0000000..8f9a6ed
--- /dev/null
@@ -0,0 +1,31 @@
+
+#include <windows.h>
+#include <kernel32/proc.h>
+#include <kernel32/heap.h>
+#include <crtdll/malloc.h>
+
+int    _heapchk (void)
+{
+       if (!HeapValidate(GetProcessHeap(), 0, NULL))
+               return -1;
+       return 0;
+}
+int    _heapmin (void)
+{
+       if ( !HeapCompact( GetProcessHeap(), 0 )) 
+               return -1;
+       return 0;
+}
+int    _heapset (unsigned int unFill)
+{
+       if ( _heapchk() == -1 )
+               return -1;
+       return 0;
+               
+}
+
+
+int _heapwalk ( struct _heapinfo *entry)
+{
+       return 0;
+}
\ No newline at end of file
index 5c3a0d1..3470782 100644 (file)
@@ -18,7 +18,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#include <math.h>
+#include <crtdll/math.h>
 
 double acos (double __x)
 {
index 6e13bbe..15f556c 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <math.h>
+#include <crtdll/math.h>
 
 double
 acosh(double x)
index aef4b42..6aeba7d 100644 (file)
@@ -18,7 +18,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#include <math.h>
+#include <crtdll/math.h>
 
 double asin (double __x)
 {
index e27e20d..7089ebc 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <math.h>
+#include <crtdll/math.h>
 
 double
 asinh(double x)
index 8335dc7..fdfb319 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <math.h>
+#include <crtdll/math.h>
 
 double
 atanh(double x)
index efee293..015219c 100644 (file)
@@ -1,4 +1,4 @@
-#include <math.h>
+#include <crtdll/math.h>
 
 double _cabs( struct _complex z )
 {
index c2cca97..85e95f0 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <math.h>
+#include <crtdll/math.h>
 
 double cosh(double x)
 {
index 913f16f..2e951f4 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <math.h>
+#include <crtdll/math.h>
 
 double
 frexp(double x, int *exptr)
index 2fb55f2..b01e719 100644 (file)
@@ -1,4 +1,13 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <libc/ieee.h>
 
-double_t _HUGE_dll = { 0x00000, 0x00000, 0x7ff, 0x0 };
+typedef struct {
+  unsigned mantissal:32;
+  unsigned mantissah:20;
+  unsigned exponent:11;
+  unsigned sign:1;
+} double_t;
+
+
+#undef _HUGE
+double_t _HUGE = { 0x00000, 0x00000, 0x7ff, 0x0 };
+double *_HUGE_dll = (double *)&_HUGE; 
index 9d0de60..08e3492 100644 (file)
@@ -16,9 +16,9 @@
  *
  */
  
-#include <float.h>
-#include <math.h>
-#include <errno.h>
+#include <crtdll/float.h>
+#include <crtdll/math.h>
+#include <crtdll/errno.h>
  
 /* Approximate square roots of DBL_MAX and DBL_MIN.  Numbers
    between these two shouldn't neither overflow nor underflow
@@ -27,7 +27,7 @@
 #define __SQRT_DBL_MIN 2.3e-162
  
 double
-hypot(double x, double y)
+_hypot(double x, double y)
 {
   double abig = fabs(x), asmall = fabs(y);
   double ratio;
@@ -78,21 +78,19 @@ hypot(double x, double y)
  
 #ifdef  TEST
  
-#include <stdio.h>
+#include <crtdll/stdio.h>
  
 int
 main(void)
 {
-  printf("hypot(3, 4) =\t\t\t %25.17e\n", hypot(3., 4.));
-  printf("hypot(3*10^150, 4*10^150) =\t %25.17g\n", hypot(3.e+150, 4.e+150));
-  printf("hypot(3*10^306, 4*10^306) =\t %25.17g\n", hypot(3.e+306, 4.e+306));
-  printf("hypot(3*10^-320, 4*10^-320) =\t %25.17g\n",
-         hypot(3.e-320, 4.e-320));
-  printf("hypot(0.7*DBL_MAX, 0.7*DBL_MAX) =%25.17g\n",
-         hypot(0.7*DBL_MAX, 0.7*DBL_MAX));
-  printf("hypot(DBL_MAX, 1.0) =\t\t %25.17g\n", hypot(DBL_MAX, 1.0));
-  printf("hypot(1.0, DBL_MAX) =\t\t %25.17g\n", hypot(1.0, DBL_MAX));
-  printf("hypot(0.0, DBL_MAX) =\t\t %25.17g\n", hypot(0.0, DBL_MAX));
+  printf("hypot(3, 4) =\t\t\t %25.17e\n", _hypot(3., 4.));
+  printf("hypot(3*10^150, 4*10^150) =\t %25.17g\n", _hypot(3.e+150, 4.e+150));
+  printf("hypot(3*10^306, 4*10^306) =\t %25.17g\n", _hypot(3.e+306, 4.e+306));
+  printf("hypot(3*10^-320, 4*10^-320) =\t %25.17g\n",_hypot(3.e-320, 4.e-320));
+  printf("hypot(0.7*DBL_MAX, 0.7*DBL_MAX) =%25.17g\n",_hypot(0.7*DBL_MAX, 0.7*DBL_MAX));
+  printf("hypot(DBL_MAX, 1.0) =\t\t %25.17g\n", _hypot(DBL_MAX, 1.0));
+  printf("hypot(1.0, DBL_MAX) =\t\t %25.17g\n", _hypot(1.0, DBL_MAX));
+  printf("hypot(0.0, DBL_MAX) =\t\t %25.17g\n", _hypot(0.0, DBL_MAX));
  
   return 0;
 }
diff --git a/reactos/lib/crtdll/math/j0_y0.c b/reactos/lib/crtdll/math/j0_y0.c
new file mode 100644 (file)
index 0000000..fe3c422
--- /dev/null
@@ -0,0 +1,11 @@
+#include <crtdll/math.h>
+
+double _j0(double x) 
+{
+       return x;
+}
+
+double _y0(double x) 
+{
+       return x;
+}
\ No newline at end of file
diff --git a/reactos/lib/crtdll/math/j1_y1.c b/reactos/lib/crtdll/math/j1_y1.c
new file mode 100644 (file)
index 0000000..76432b9
--- /dev/null
@@ -0,0 +1,11 @@
+#include <crtdll/math.h>
+
+double _j1(double x) 
+{
+       return x;
+}
+
+double _y1(double x) 
+{
+       return x;
+}
\ No newline at end of file
diff --git a/reactos/lib/crtdll/math/jn_yn.c b/reactos/lib/crtdll/math/jn_yn.c
new file mode 100644 (file)
index 0000000..b3a7181
--- /dev/null
@@ -0,0 +1,11 @@
+#include <crtdll/math.h>
+
+double _jn(int n, double x)
+{
+       return x;
+}
+
+double _yn(int n, double x) 
+{
+       return x;
+}
\ No newline at end of file
index 40da215..9912564 100644 (file)
@@ -1,6 +1,6 @@
 // from linux libc
 
-#include <math.h>
+#include <crtdll/math.h>
 
 /* Slooow version. */
 
index d00e280..7acb21f 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <math.h>
+#include <crtdll/math.h>
 
 double sinh(double x)
 {
diff --git a/reactos/lib/crtdll/math/stubs.c b/reactos/lib/crtdll/math/stubs.c
new file mode 100644 (file)
index 0000000..5c7686d
--- /dev/null
@@ -0,0 +1,84 @@
+#include <crtdll/math.h>
+
+double _CIsin (double x);
+double _CIcos (double x);
+double _CItan (double x);
+double _CIsinh (double x);
+double _CIcosh (double x);
+double _CItanh (double x);
+double _CIasin (double x);
+double _CIacos (double x);
+double _CIatan (double x);
+double _CIatan2 (double y, double x);
+double _CIexp (double x);
+double _CIlog (double x);
+double _CIlog10 (double x);
+double _CIpow (double x, double y);
+double _CIsqrt (double x);
+double _CIfmod (double x, double y);
+
+
+double _CIsin (double x)
+{
+       return sin(x);
+}
+double _CIcos (double x)
+{
+       return cos(x);
+}
+double _CItan (double x)
+{
+       return tan(x);
+}
+double _CIsinh (double x)
+{
+       return sinh(x);
+}
+double _CIcosh (double x)
+{
+       return cosh(x);
+}
+double _CItanh (double x)
+{
+       return tanh(x);
+}
+double _CIasin (double x)
+{
+       return asin(x);
+}
+double _CIacos (double x)
+{
+       return acos(x);
+}
+double _CIatan (double x)
+{
+       return atan(x);
+}
+double _CIatan2 (double y, double x)
+{
+       return atan2(y,x);
+}
+double _CIexp (double x)
+{
+       return exp(x);
+}
+double _CIlog (double x)
+{
+       return log(x);
+}
+double _CIlog10 (double x)
+{
+       return log10(x);
+}
+double _CIpow (double x, double y)
+{
+       return pow(x,y);
+}
+double _CIsqrt (double x)
+{
+       return sqrt(x);
+}
+double _CIfmod (double x, double y)
+{
+       return fmod(x,y);
+}
\ No newline at end of file
index c2eb966..12b0012 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <math.h>
+#include <crtdll/math.h>
 
 double tanh(double x)
 {
index 6e2ed31..84e7998 100644 (file)
@@ -1,20 +1,21 @@
 #include <windows.h>
-#include <stdlib.h>
-#include <string.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/string.h>
 
-#undef _acmdln_dll
+
+char *_pgmptr_dll;
 char *_acmdln_dll;   
-#undef _commode_dll   
 unsigned  int _commode_dll;     
-    
-#undef _winmajor_dll
 unsigned  int _winmajor_dll;   
-#undef _winminor_dll  
 unsigned  int _winminor_dll;
-#undef _winver_dll     
 unsigned  int _winver_dll;    
-#undef _osver_dll
-unsigned  int _osver_dll;    
+
+
+unsigned  int _osmajor_dll;
+unsigned  int _osminor_dll;
+unsigned  int _osmode_dll;
+unsigned  int _osver_dll;
+unsigned  int _osversion_dll;
 
 #undef __argv
 #undef __argc
@@ -33,8 +34,7 @@ char **_environ;
 char *** _environ_dll = &_environ;    
  
         
-
-int __GetMainArgs(int *argc,char ***argv,char **env,int flag)
+int __GetMainArgs(int *argc,char ***argv,char ***env,int flag)
 {
    int i,afterlastspace;
    DWORD   version;
@@ -80,10 +80,12 @@ int __GetMainArgs(int *argc,char ***argv,char **env,int flag)
    _environ = (char **)GetEnvironmentStringsA();;
    _environ_dll = &_environ;    
     
-   argc = __argc_dll;
-   argv = __argv_dll;
-   env  = _environ_dll;
+   *argc = __argc;
+   *argv = __argv;
+   *env  = _environ;
  
+   _pgmptr_dll = strdup((char *)argv[0]);
+
    return 0;
 }
 
index 222a40b..9d72650 100644 (file)
  *  DISCLAMED. This includes but is not limited to warrenties of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Revision: 1.1 $
- * $Author: rex $
- * $Date: 1999/01/16 02:11:43 $
+ * $Revision: 1.2 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:43:55 $
  *
  */
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <io.h>
-#include <fcntl.h>
-#include <process.h>
-#include <float.h>
+#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 <windows.h>
 
 /* NOTE: The code for initializing the _argv, _argc, and environ variables
@@ -95,11 +95,7 @@ mainCRTStartup ()
         * UnhandledExceptionFilter, which is prototyped just above
         * (see Functions.h).
         */
-       SetUnhandledExceptionFilter (NULL);
-       /*
-        * Initialize errno.
-        */
-       errno = 0;
+       //SetUnhandledExceptionFilter (NULL);
 
        /*
         * Initialize floating point unit.
@@ -111,7 +107,6 @@ mainCRTStartup ()
         */
        _mingw32_init_mainargs();
 
-       
        /*
         * Sets the default file mode for stdin, stdout and stderr, as well
         * as files later opened by the user, to _CRT_fmode.
@@ -125,8 +120,7 @@ mainCRTStartup ()
         * that one calls WinMain. See main.c in the 'lib' dir
         * for more details.
         */
-       nRet = cmdmain(_argc, _argv, environ);
+       nRet = main(_argc, _argv, _environ);
 
        /*
         * Perform exit processing for the C library. This means
@@ -163,4 +157,3 @@ asm (".section .idata$3\n" ".long 0,0,0,0,0,0,0,0");
 #endif
 #endif
 
-
index de7ea37..02c2b91 100644 (file)
  *  DISCLAMED. This includes but is not limited to warrenties of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Revision: 1.1 $
- * $Author: rex $
- * $Date: 1999/01/16 02:11:43 $
+ * $Revision: 1.2 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:43:56 $
  * 
  */
 
-#include <stdio.h>
-#include <io.h>
-#include <process.h>
+#include <crtdll/stdio.h>
+#include <crtdll/io.h>
+#include <crtdll/process.h>
 #include <windows.h>
 
 /* See note in crt0.c */
index 8cc03aa..49bb6db 100644 (file)
  * Contributors:
  *  Code supplied by Stan Cox <scox@cygnus.com>
  *
- * $Revision: 1.1 $
- * $Author: rex $
- * $Date: 1999/01/16 02:11:43 $
+ * $Revision: 1.2 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:43:56 $
  *
  */
 
 /* Needed for the atexit prototype. */
-#include <stdlib.h>
+#include <crtdll/stdlib.h>
 
 typedef void (*func_ptr) (void);
 extern func_ptr __CTOR_LIST__[];
index 1945d25..6bd8a62 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.1 $
- * $Author: rex $
- * $Date: 1999/01/16 02:11:43 $
+ * $Revision: 1.2 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:43:56 $
  *
  */
 
index 989c7fb..a539f7e 100644 (file)
  *  DISCLAMED. This includes but is not limited to warrenties of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Revision: 1.1 $
- * $Author: rex $
- * $Date: 1999/01/16 02:11:43 $
+ * $Revision: 1.2 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:43:56 $
  *
  */
 
-#include <stdlib.h>
-#include <process.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/process.h>
 #include <windows.h>
 
 #define ISSPACE(a)     (a == ' ' || a == '\t')
diff --git a/reactos/lib/crtdll/misc/purecall.c b/reactos/lib/crtdll/misc/purecall.c
new file mode 100644 (file)
index 0000000..f522dee
--- /dev/null
@@ -0,0 +1,5 @@
+
+int _purecall(void)
+{
+         return 0;
+}
\ No newline at end of file
diff --git a/reactos/lib/crtdll/misc/setnew.cc b/reactos/lib/crtdll/misc/setnew.cc
new file mode 100644 (file)
index 0000000..1d37123
--- /dev/null
@@ -0,0 +1,28 @@
+#include <crtdll/stdlib.h>
+
+
+typedef int (* new_handler_t)( size_t );
+
+new_handler_t new_handler;
+
+new_handler_t _set_new_handler(new_handler_t hnd)
+{
+        new_handler_t old = new_handler;
+       
+       new_handler = hnd;
+        
+        return old;
+}
+
+void operator delete(void* m)
+{
+       if ( m != NULL )
+               free( m );
+}
+
+void * operator new( unsigned int s )
+{
+       if ( s == 0 )
+               s = 1;
+        return malloc( s );
+}
index e7fdb22..a437c75 100644 (file)
@@ -1,20 +1,17 @@
-#include <process.h>
 #include <windows.h>
+#include <crtdll/process.h>
+#include <crtdll/errno.h>
+#include <crtdll/internal/file.h>
 
-int _cwait( int *termstat, int procHandle, int action )
+int    _cwait (int* pnStatus, int hProc, int nAction)
 {
-       DWORD RetVal;
-       RetVal = WaitForSingleObject((HANDLE)procHandle, INFINITE);
-       if (RetVal == WAIT_FAILED || RetVal == WAIT_ABANDONED) {
-               //errno = ECHILD;
+       nAction = 0;
+       if ( WaitForSingleObject((void *)hProc,INFINITE) != WAIT_OBJECT_0 ) {
+               __set_errno(ECHILD);
                return -1;
        }
-       if ( RetVal == WAIT_OBJECT_0 ) {
-               GetExitCodeProcess((HANDLE)procHandle, termstat);
-               return procHandle;
-       }
-
 
-       return -1;
-       // WAIT_TIMEOUT
-}
+       if ( !GetExitCodeProcess((void *)hProc,pnStatus) )
+               return -1;
+       return *pnStatus;
+}
\ No newline at end of file
index f8c9bad..64f6af5 100644 (file)
@@ -1,5 +1,7 @@
-#include <process.h>
+#include <crtdll/process.h>
 #include <windows.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/string.h>
 
 int system(const char *command)
 {
index 1dbaca1..64e7938 100644 (file)
@@ -1,5 +1,5 @@
 #include <windows.h>
-#include <process.h>
+#include <crtdll/process.h>
 
 void *_loaddll (char *name)
 {
@@ -9,4 +9,15 @@ void *_loaddll (char *name)
 int _unloaddll(void *handle)
 {
        return FreeLibrary(handle);
-}
\ No newline at end of file
+}
+
+FARPROC _getdllprocaddr(void *hModule,char * lpProcName, int iOrdinal)
+{
+   
+
+       if ( lpProcName != NULL ) 
+               return GetProcAddress(hModule, lpProcName);
+       else
+               return GetProcAddress(hModule, (LPSTR)iOrdinal);
+       return (NULL);
+}
index 779d8e3..1769cd2 100644 (file)
@@ -1,9 +1,12 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <process.h>
-#include <stdlib.h>
+#include <crtdll/process.h>
+#include <crtdll/stdlib.h>
+#include <stdarg.h>
 
-int _execl(const char *path, const char *argv0, ...)
+int    _execl(const char* szPath, const char* szArgv0, ...)
 {
-  return _spawnve(P_OVERLAY, path, (char *const*)&argv0, _environ);
+  va_list a = 0;
+  va_start(a,szArgv0);
+  return _spawnve(P_OVERLAY, szPath, (char *const*)a, _environ);
 }
index 485c758..0f5d5ad 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
 
 
-#include <process.h>
+#include <crtdll/process.h>
 
 #define scan_ptr() \
        const char **ptr; \
index b25fe9d..bb79013 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <process.h>
-#include <stdlib.h>
+#include <crtdll/process.h>
+#include <crtdll/stdlib.h>
 
 int _execlp(const char *path, const char *argv0, ...)
 {
index da5f708..b4d514e 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
 
-#include <process.h>
+#include <crtdll/process.h>
 
 
 #define scan_ptr() \
index 123b69f..d1d2bb8 100644 (file)
@@ -1,9 +1,9 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <process.h>
-#include <stdlib.h>
+#include <crtdll/process.h>
+#include <crtdll/stdlib.h>
 
-int _execv(const char *path, const char * const *argv)
+int _execv(const char* szPath, char* const* szaArgv)
 {
-  return _spawnve(P_OVERLAY, path, argv, _environ);
+  return _spawnve(P_OVERLAY, szPath, szaArgv, _environ);
 }
index 38b4a96..707a1de 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-//#include <libc/stubs.h>
-//#include <unistd.h>
-#include <process.h>
+//#include <crtdll/stubs.h>
+//#include <crtdll/unistd.h>
+#include <crtdll/process.h>
 
 int execve(const char *path,const  char * const argv[], char * const envp[])
 {
index b1f15d8..7dd5a22 100644 (file)
@@ -1,9 +1,9 @@
-/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details *///#include <libc/stubs.h>
-//#include <unistd.h>
-#include <process.h>
-#include <stdlib.h>
+/* 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>
 
-int _execvp(const char *path,const char * const argv[])
+int _execvp(const char* szPath, char* const* szaArgv)
 {
-  return _spawnvpe(P_OVERLAY, path, argv, _environ);
+  return _spawnvpe(P_OVERLAY, szPath, szaArgv, _environ);
 }
index df00045..b7393eb 100644 (file)
@@ -1,11 +1,11 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
 
 
-#include <process.h>
+#include <crtdll/process.h>
 
-int _execvpe(const char *path,const char * const argv[],const char * const envp[])
+int _execvpe(const char* szPath, char* const* szaArgv, char* const* szaEnv)
 {
-  return _spawnvpe(P_OVERLAY, path, argv, envp);
+  return _spawnvpe(P_OVERLAY, szPath, szaArgv, szaEnv);
 }
 
 
index b0ecf0b..499509e 100644 (file)
@@ -1,10 +1,12 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <process.h>
+#include <crtdll/process.h>
+#include <crtdll/stdlib.h>
+#include <stdarg.h>
 
-extern char **_environ;
-
-int _spawnl(int mode, const char *path, const char *argv0, ...)
+int _spawnl(int nMode, const char* szPath, const char* szArgv0,...)
 {
-  return spawnve(mode, path, (char * const *)&argv0, _environ);
+  va_list a = 0;
+  va_start(a,szArgv0);
+  return _spawnve(nMode, szPath, (char * const *)a, _environ);
 }
index ff582a8..0f1573f 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
 
-#include <process.h>
+#include <crtdll/process.h>
 
 #define scan_ptr() \
        const char **ptr; \
index 568cf87..3e5c55b 100644 (file)
@@ -1,9 +1,12 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <process.h>
-#include <stdlib.h>
+#include <crtdll/process.h>
+#include <crtdll/stdlib.h>
+#include <stdarg.h>
 
-int _spawnlp(int mode, const char *path, const char *argv0, ...)
+int _spawnlp(int nMode, const char* szPath, const char* szArgv0, ...)
 {
-  return _spawnvpe(mode, path, (char * const *)&argv0, (char * const *)_environ);
+  va_list a = 0;
+  va_start(a,szArgv0);
+  return _spawnvpe(nMode, szPath, (char * const *)a, _environ);
 }
index a4eb916..4ca400a 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
 
-#include <process.h>
+#include <crtdll/process.h>
 #define scan_ptr() \
        const char **ptr; \
        union { const char **ccpp; const char *ccp; } u; \
index 71d7403..1ebb2cc 100644 (file)
@@ -1,10 +1,9 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <process.h>
-#include <stdlib.h>
+#include <crtdll/process.h>
+#include <crtdll/stdlib.h>
 
-
-int _spawnv(int mode, const char *path,const char *const argv[])
+int _spawnv    (int nMode, const char* szPath, char* const* szaArgv)
 {
-  return _spawnve(mode, path, (char * const *)argv, _environ);
+  return _spawnve(nMode, szPath, (char * const *)szaArgv, _environ);
 }
index 86c83d5..00aec7f 100644 (file)
@@ -1,12 +1,12 @@
-#include <process.h>
-#include <string.h>
+#include <crtdll/process.h>
+#include <crtdll/string.h>
 #include <windows.h>
-#include <stdio.h>
+#include <crtdll/stdio.h>
 
 
 int _p_overlay = 2;
 
-int _spawnve(int mode, const char *path,const char *const argv[],const char *const envp[])
+int _spawnve(int nMode, const char* szPath, char* const* szaArgv, char* const* szaEnv)
 {
 
   char ApplicationName[MAX_PATH];
@@ -16,12 +16,12 @@ int _spawnve(int mode, const char *path,const char *const argv[],const char *con
   
   int i = 0;
   CommandLine[0] = 0;
-  while(argv[i] != NULL ) {
-       strcat(CommandLine,argv[i]);
+  while(szaArgv[i] != NULL ) {
+       strcat(CommandLine,szaArgv[i]);
        strcat(CommandLine," ");
        i++; 
   }
-  strcpy(ApplicationName,argv[0]);
+  strcpy(ApplicationName,szaArgv[0]);
  
   fflush(stdout); /* just in case */
   StartupInfo.cb = sizeof(STARTUPINFO);
@@ -29,15 +29,14 @@ int _spawnve(int mode, const char *path,const char *const argv[],const char *con
   StartupInfo.dwFlags = 0;
 
 
-//  if ( CreateProcessA(ApplicationName,CommandLine,NULL,NULL,TRUE,CREATE_NEW_CONSOLE|NORMAL_PRIORITY_CLASS,NULL,*envp,&StartupInfo,&ProcessInformation) ) {
-//     errno = GetLastError();
-//     return -1;
-//  }
+  if ( CreateProcessA(ApplicationName,CommandLine,NULL,NULL,TRUE,CREATE_NEW_CONSOLE|NORMAL_PRIORITY_CLASS,NULL,*szaEnv,&StartupInfo,&ProcessInformation) ) {
+       return -1;
+  }
 
   
 if (mode == P_OVERLAY)
-    _exit(i);
// if (nMode == P_OVERLAY)
//   _exit(i);
 
 // _P_NOWAIT or _P_NOWAITO 
-  return ProcessInformation.hProcess;
+  return (int )ProcessInformation.hProcess;
 }
index 98f0625..aecd80e 100644 (file)
@@ -1,9 +1,9 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <process.h>
-#include <stdlib.h>
+#include <crtdll/process.h>
+#include <crtdll/stdlib.h>
 
-int spawnvp(int mode, const char *path,const char *const argv[])
+int _spawnvp(int nMode, const char* szPath, char* const* szaArgv)
 {
-  return spawnvpe(mode, path, (char * const *)argv, _environ);
+  return spawnvpe(nMode, szPath, (char * const *)szaArgv, _environ);
 }
index 7620543..bdad981 100644 (file)
@@ -1,13 +1,12 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <process.h>
-#include <errno.h>
+#include <crtdll/process.h>
+#include <crtdll/errno.h>
 
 
-int _spawnvpe(int mode, const char *path,const char *const argv[],const char *const envp[])
+int _spawnvpe(int nMode, const char* szPath, char* const* szaArgv, char* const* szaEnv)
 {
 
-  char rpath[300];
-  return spawnve(mode, rpath, argv, envp);
+  return spawnve(nMode, szPath, szaArgv, szaEnv);
 
 }
diff --git a/reactos/lib/crtdll/process/threadid.c b/reactos/lib/crtdll/process/threadid.c
new file mode 100644 (file)
index 0000000..404ac06
--- /dev/null
@@ -0,0 +1,12 @@
+#include <windows.h>
+#include <crtdll/process.h>
+
+unsigned long __threadid (void)
+{
+        return GetCurrentThreadId();
+}
+
+void *__threadhandle(void)
+{
+        return GetCurrentThread();
+}
\ No newline at end of file
diff --git a/reactos/lib/crtdll/search/lfind.c b/reactos/lib/crtdll/search/lfind.c
new file mode 100644 (file)
index 0000000..b1e7634
--- /dev/null
@@ -0,0 +1,17 @@
+#include <crtdll/search.h>
+#include <crtdll/stdlib.h>
+
+
+void *_lfind(const void *key, const void *base, size_t *nelp,
+         size_t width, int (*compar)(const void *, const void *))
+{
+       char *char_base = (char *)base;
+       int i;
+       for(i=0;i<*nelp;i++) {
+               if ( compar(key,char_base) == 0)
+                       return char_base;
+               char_base += width;
+       }
+       return NULL;
+}
+               
\ No newline at end of file
diff --git a/reactos/lib/crtdll/search/lsearch.c b/reactos/lib/crtdll/search/lsearch.c
new file mode 100644 (file)
index 0000000..392cf92
--- /dev/null
@@ -0,0 +1,15 @@
+#include <crtdll/search.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/string.h>
+
+void *_lsearch(const void *key, void *base, size_t *nelp, size_t width,
+         int (*compar)(const void *, const void *))
+{
+       void *ret_find = _lfind(key,base,nelp,width,compar);
+       if ( ret_find != NULL )
+               return ret_find;
+
+       memcpy( base + (*nelp*width), key, width );
+        (*nelp)++;
+        return base ;
+}
\ No newline at end of file
index 8980aa8..9283dff 100644 (file)
@@ -2,8 +2,8 @@
    Exception handling and basis for signal support for DJGPP V2.0
    This software may be freely distributed, no warranty. */
 
-#include <signal.h>
-#include <stdlib.h>
+#include <crtdll/signal.h>
+#include <crtdll/stdlib.h>
 
 extern unsigned end __asm__ ("end");
 
@@ -53,4 +53,4 @@ raise(int sig)
 void __djgpp_traceback_exit(int sig)
 {
        _exit(3);
-}
\ No newline at end of file
+}
index e438eb8..34aafa6 100644 (file)
@@ -1,10 +1,9 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <libc/file.h>
-//#include <libc/local.h>
-//#include <libc/stdiohk.h>
+#include <crtdll/stdio.h>
+#include <crtdll/string.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/internal/file.h>
+
 
 FILE * __alloc_file(void);
 
@@ -68,7 +67,7 @@ int _fcloseall( void )
   __file_rec *fr = __file_rec_list;
   __file_rec **last_fr = &__file_rec_list;
   
-  int total_closed;
+  int total_closed = 0;
   int i = 0;
 
   /* Try to find an empty slot */
index 9742967..5244620 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <libc/file.h>
+#include <crtdll/stdio.h>
+#include <crtdll/internal/file.h>
 
 #ifdef clearerr
 #undef clearerr
index ad4a15a..a359e1a 100644 (file)
 
 #include <stdarg.h>
 
-//#include <internal/debug.h>
-#include <ctype.h>
-#include <string.h>
-#include <stdio.h>
-#include <string.h>
-
-//#undef isdigit
-
-size_t strnlen( const char *string, size_t count );
-
+//#include <crtdll/internal/debug.h>
+#include <crtdll/ctype.h>
+#include <crtdll/string.h>
+#include <crtdll/stdio.h>
+#include <crtdll/string.h>
 
 static int skip_atoi(const char **s)
 {
@@ -95,7 +90,7 @@ static char * number(FILE * f, long num, int base, int size, int precision
        if (num == 0)
                tmp[i++]='0';
        else while (num != 0)
-               tmp[i++] = digits[do_div(&num,base)];
+               tmp[i++] = digits[do_div((int *)&num,base)];
        if (i > precision)
                precision = i;
        size -= precision;
@@ -104,16 +99,19 @@ static char * number(FILE * f, long num, int base, int size, int precision
                        putc( ' ',f);
        if (sign)
                putc( sign,f);
-       if (type & SPECIAL)
-               if (base==8)
+       if (type & SPECIAL) {
+               if (base==8) {
                        putc( '0',f);
+               }
                else if (base==16) {
                        putc( '0', f);
                        putc( digits[33],f);
                }
-       if (!(type & LEFT))
+       }
+       if (!(type & LEFT)) {
                while (size-- > 0)
                        putc( c,f);
+       }
        while (i < precision--)
                putc( '0', f);
        while (i-- > 0)
@@ -260,10 +258,12 @@ int _doprnt(const char *fmt, va_list args, FILE *f)
 
                case 'n':
                        if (qualifier == 'l') {
-                               long * ip = va_arg(args, long *);
+                               long * ip;
+                               ip = va_arg(args, long *);
                                //*ip = (str - buf);
                        } else {
-                               int * ip = va_arg(args, int *);
+                               int * ip;
+                               ip  = va_arg(args, int *);
                                //*ip = (str - buf);
                        }
                        continue;
@@ -300,11 +300,12 @@ int _doprnt(const char *fmt, va_list args, FILE *f)
                }
                if (qualifier == 'l')
                        num = va_arg(args, unsigned long);
-               else if (qualifier == 'h')
+               else if (qualifier == 'h') {
                        if (flags & SIGN)
                                num = va_arg(args, short);
                        else
                                num = va_arg(args, unsigned short);
+               }
                else if (flags & SIGN)
                        num = va_arg(args, int);
                else
index 503d254..a14f773 100644 (file)
@@ -1,13 +1,12 @@
 /* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <libc/file.h>
+#include <crtdll/stdio.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/ctype.h>
+#include <crtdll/internal/file.h>
+
 
-//long double
-//atold(const char *ascii);
 #define atold  atof
 
 // dubious variable 
@@ -15,9 +14,9 @@
 
 int
 _doscan_low(FILE *iop, int (*scan_getc)(FILE *), int (*scan_ungetc)(int, FILE *),
-            const char *fmt, void **argp);
+            const char *fmt, va_list argp);
 
-//#include <libc/local.h>
+//#include <crtdll/local.h>
 
 #define        SPC     01
 #define        STP     02
@@ -53,20 +52,20 @@ static char _sctab[256] = {
 static int nchars = 0;
 
 int 
-_doscan(FILE *iop, const char *fmt, void **argp)
+_doscan(FILE *iop, const char *fmt, va_list argp)
 {
   return(_doscan_low(iop, fgetc, ungetc, fmt, argp));
 }
 
 int 
-_dowscan(FILE *iop, const wchar_t *fmt, void **argp)
+_dowscan(FILE *iop, const wchar_t *fmt, va_list argp)
 {
-  return(_doscan_low(iop, fgetwc, ungetwc, fmt, argp));
+  return(_doscan_low(iop, fgetwc, ((void *)ungetwc), ((void *)fmt), argp));
 }
 
 int
 _doscan_low(FILE *iop, int (*scan_getc)(FILE *), int (*scan_ungetc)(int, FILE *),
-            const char *fmt, void **argp)
+            const char *fmt, va_list argp)
 {
   register int ch;
   int nmatch, len, ch1;
@@ -83,7 +82,7 @@ _doscan_low(FILE *iop, int (*scan_getc)(FILE *), int (*scan_ungetc)(int, FILE *)
       goto def;
     ptr = 0;
     if (ch != '*')
-      ptr = (int **)argp++;
+       ptr = va_arg(argp, int **);
     else
       ch = *fmt++;
     len = 0;
@@ -210,7 +209,7 @@ _innum(int **ptr, int type, int len, int size, FILE *iop,
   np = numbuf;
   expseen = 0;
   negflg = 0;
-  while (((nchars++, c = scan_getc(iop)) != EOF) && (_sctab[c] & SPC))
+  while (((nchars++, c = scan_getc(iop)) != EOF)  && (_sctab[c] & SPC) )
     ;
   if (c == EOF) nchars--;
   if (c=='-') {
index dc6b79f..98caf76 100644 (file)
@@ -1,12 +1,12 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-//#include <libc/stubs.h>
-#include <stdio.h>
-#include <io.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdlib.h>
-//#include <unistd.h>
-#include <libc/file.h>
+//#include <crtdll/stubs.h>
+#include <crtdll/stdio.h>
+#include <crtdll/io.h>
+#include <crtdll/sys/types.h>
+#include <crtdll/sys/stat.h>
+#include <crtdll/stdlib.h>
+//#include <crtdll/unistd.h>
+#include <crtdll/internal/file.h>
 
 #if 0
 #ifndef __dj_include_stdio_h_
index a5055c9..04c661d 100644 (file)
@@ -1,4 +1,4 @@
-#include <stdio.h>
+#include <crtdll/stdio.h>
 
 FILE *_fdopen(int handle, char *mode)
 {
index ed17212..6de4573 100644 (file)
@@ -1,13 +1,13 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <libc/file.h>
+#include <crtdll/stdio.h>
+#include <crtdll/internal/file.h>
 
 #ifdef feof
 #undef feof
-feof(FILE *stream);
+int feof(FILE *stream);
 #endif
 
-feof(FILE *stream)
+int feof(FILE *stream)
 {
   return stream->_flag & _IOEOF;
 }
index 8fe3416..06d77c1 100644 (file)
@@ -1,14 +1,13 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <libc/file.h>
+#include <crtdll/stdio.h>
+#include <crtdll/internal/file.h>
 
 #ifdef ferror
 #undef ferror
-ferror(FILE *stream);
+int ferror(FILE *stream);
 #endif
 
-int
-ferror(FILE *stream)
+int ferror(FILE *stream)
 {
   return stream->_flag & _IOERR;
 }
index d51077a..9cf40b3 100644 (file)
@@ -1,14 +1,15 @@
 /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-//#include <libc/stubs.h>
-#include <stdio.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdlib.h>
-#include <libc/file.h>
-#include <io.h>
+
+#include <crtdll/stdio.h>
+#include <crtdll/errno.h>
+#include <crtdll/sys/types.h>
+#include <crtdll/sys/stat.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/internal/file.h>
+#include <crtdll/io.h>
+
 
 int
 fflush(FILE *f)
@@ -18,13 +19,13 @@ fflush(FILE *f)
 
   if (f == NULL)
   {
-//    int e = errno;
+     int e = errno;
 
-//    errno = 0;
+     __set_errno(0);
     _fwalk((void (*)(FILE *))fflush);
-//    if (errno)
-//      return EOF;
-//    errno = e;
+    if (_errno)
+      return EOF;
+    __set_errno(e);
     return 0;
   }
 
index 97f5fa3..2c123c7 100644 (file)
@@ -9,8 +9,8 @@
                25/02/99: Added fgetwc
  */
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <libc/file.h>
+#include <crtdll/stdio.h>
+#include <crtdll/internal/file.h>
 
 int
 fgetc(FILE *f)
index 2d8e452..c098b05 100644 (file)
@@ -1,7 +1,7 @@
-#include <stdio.h>
-#include <conio.h>
+#include <crtdll/stdio.h>
+#include <crtdll/conio.h>
 
 int    _fgetchar (void)
 {
        return _getch();
-}
\ No newline at end of file
+}
index 0214cf6..e063164 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <errno.h>
+#include <crtdll/stdio.h>
+#include <crtdll/errno.h>
 
 int
 fgetpos(FILE *stream, fpos_t *pos)
index 05ddd95..df78963 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <libc/file.h>
+#include <crtdll/stdio.h>
+#include <crtdll/internal/file.h>
 
 char *
 fgets(char *s, int n, FILE *f)
index 66f9b58..0060e25 100644 (file)
@@ -1,16 +1,13 @@
 /* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-//#include <libc/stubs.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <stdlib.h>
-//#include <unistd.h>
-#include <string.h>
-//#include <go32.h>
-#include <libc/file.h>
-//#include <libc/stdiohk.h>
-#include <io.h>
+
+#include <crtdll/stdio.h>
+#include <crtdll/sys/types.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/string.h>
+#include <crtdll/internal/file.h>
+#include <crtdll/io.h>
 
 /* Note: We set _fillsize to 512, and use that for reading instead of
    _bufsize, for performance reasons.  We double _fillsize each time
index a9e07e2..f895187 100644 (file)
@@ -1,4 +1,4 @@
-#include <stdio.h>
+#include <crtdll/stdio.h>
 
 #undef fileno
 int fileno(FILE *f) 
index 1cbfedc..b667a40 100644 (file)
@@ -1,13 +1,13 @@
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-//#include <libc/stubs.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <stdlib.h>
-//#include <unistd.h>
-//#include <go32.h>
-#include <libc/file.h>
-#include <io.h>
+//#include <crtdll/stubs.h>
+#include <crtdll/stdio.h>
+#include <crtdll/sys/types.h>
+#include <crtdll/stdlib.h>
+//#include <crtdll/unistd.h>
+//#include <crtdll/go32.h>
+#include <crtdll/internal/file.h>
+#include <crtdll/io.h>
 
 int
 _flsbuf(int c, FILE *f)
index 40ee5b7..e742d8e 100644 (file)
@@ -1,10 +1,10 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <sys/types.h>
-#include <stdio.h>
-#include <io.h>
-#include <fcntl.h>
-#include <libc/file.h>
+#include <crtdll/sys/types.h>
+#include <crtdll/stdio.h>
+#include <crtdll/io.h>
+#include <crtdll/fcntl.h>
+#include <crtdll/internal/file.h>
 
 
 FILE * __alloc_file(void);
index fbca105..13be50e 100644 (file)
@@ -1,19 +1,22 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <libc/file.h>
+#include <crtdll/stdio.h>
+#include <crtdll/internal/file.h>
 
 int
 fprintf(register FILE *iop, const char *fmt, ...)
 {
   int len;
   char localbuf[BUFSIZ];
+  va_list a=0;
+  
 
+  va_start( a, fmt ); 
   if (iop->_flag & _IONBF)
   {
     iop->_flag &= ~_IONBF;
     iop->_ptr = iop->_base = localbuf;
     iop->_bufsiz = BUFSIZ;
-    len = _doprnt(fmt, (&fmt)+1, iop);
+    len = _doprnt(fmt,a, iop);
     fflush(iop);
     iop->_flag |= _IONBF;
     iop->_base = NULL;
@@ -21,6 +24,6 @@ fprintf(register FILE *iop, const char *fmt, ...)
     iop->_cnt = 0;
   }
   else
-    len = _doprnt(fmt, (&fmt)+1, iop);
+    len = _doprnt(fmt, a, iop);
   return ferror(iop) ? EOF : len;
 }
index 82315c4..715469c 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <wchar.h>
-#include <libc/file.h>
+#include <crtdll/stdio.h>
+#include <crtdll/wchar.h>
+#include <crtdll/internal/file.h>
 
 int
 fputc(int c, FILE *fp)
index 2b76114..a9c5c8e 100644 (file)
@@ -1,7 +1,7 @@
-#include <stdio.h>
-#include <conio.h>
+#include <crtdll/stdio.h>
+#include <crtdll/conio.h>
 
 int    _fputchar (int c)
 {
        return _putch(c);
-}
\ No newline at end of file
+}
index 8bb3d7a..1f096dd 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <libc/file.h>
-#include <string.h>
+#include <crtdll/stdio.h>
+#include <crtdll/internal/file.h>
+#include <crtdll/string.h>
 #include <windows.h>
 
 int
index 5bf9163..fc44146 100644 (file)
@@ -1,10 +1,10 @@
 /* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <libc/file.h>
+#include <crtdll/stdio.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/string.h>
+#include <crtdll/internal/file.h>
 
 #define _fillsize _bufsiz
 
index 2eb39b2..681b429 100644 (file)
@@ -1,10 +1,10 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <sys/types.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <libc/file.h>
-#include <io.h>
+#include <crtdll/sys/types.h>
+#include <crtdll/stdio.h>
+#include <crtdll/fcntl.h>
+#include <crtdll/internal/file.h>
+#include <crtdll/io.h>
 
 
 
index 2eaacbd..e85b6e8 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-//#include <libc/local.h>
+#include <crtdll/stdio.h>
+//#include <crtdll/local.h>
 
 static __file_rec __initial_file_rec = {
   0,
index 2b13483..bf278be 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
+#include <crtdll/stdio.h>
 #include <stdarg.h>
-#include <libc/file.h>
+#include <crtdll/internal/file.h>
 
 int
 fscanf(FILE *f, const char *fmt, ...)
index 939718b..c3cd360 100644 (file)
@@ -2,10 +2,10 @@
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 
-#include <stdio.h>
-#include <libc/file.h>
-#include <fcntl.h>
-#include <io.h>
+#include <crtdll/stdio.h>
+#include <crtdll/internal/file.h>
+#include <crtdll/fcntl.h>
+#include <crtdll/io.h>
 
 #define _fillsize _bufsiz
 
index 491b9ad..718bb6e 100644 (file)
@@ -1,10 +1,10 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <errno.h>
-#include <libc/file.h>
+#include <crtdll/stdio.h>
+#include <crtdll/errno.h>
+#include <crtdll/internal/file.h>
 
 int
-fsetpos(FILE *stream, fpos_t *pos)
+fsetpos(FILE *stream,const fpos_t *pos)
 {
   if (stream && pos)
   {
index d597bc5..f2b76fb 100644 (file)
@@ -1,11 +1,11 @@
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-//#include <libc/stubs.h>
-#include <stdio.h>
-//#include <unistd.h>
-#include <libc/file.h>
-#include <fcntl.h>
-#include <io.h>
+//#include <crtdll/stubs.h>
+#include <crtdll/stdio.h>
+//#include <crtdll/unistd.h>
+#include <crtdll/internal/file.h>
+#include <crtdll/fcntl.h>
+#include <crtdll/io.h>
 
 
 long
index 4d4a862..ec2c484 100644 (file)
@@ -1,7 +1,8 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <libc/file.h>
-//#include <libc/local.h>
+#include <crtdll/stdio.h>
+#include <crtdll/internal/file.h>
+
+// not exported by crtdll
 
 #define __FILE_REC_MAX 20
 typedef struct __file_rec {
index 350dff6..137fd30 100644 (file)
@@ -1,9 +1,9 @@
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <libc/file.h>
+#include <crtdll/stdio.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/string.h>
+#include <crtdll/internal/file.h>
 
 size_t
 fwrite(const void *vptr, size_t size, size_t count, FILE *f)
index c283ff6..5fcae04 100644 (file)
@@ -1,17 +1,27 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
+#include <crtdll/stdio.h>
 #include <windows.h>
-#include <libc/file.h>
+#include <crtdll/internal/file.h>
 
 int getc(FILE *f)
 {
   int c;
-  DWORD NumberOfBytesRead;
+  DWORD NumberOfBytesRead =0;
+  if (f->_cnt > 0) {
+       f->_cnt--;
+       f->_flag &= ~_IOUNGETC;
+       return  *f->_ptr;
+  }
+       
   if ( !ReadFile(_get_osfhandle(f->_file),&c, 1, &NumberOfBytesRead,   NULL) )
        return -1;
   if ( NumberOfBytesRead == 0 )
          return -1;
-  return c;
+  putchar(c&0xFF);
+  return c&0xFF;
+
 }
 
 
index e087c43..fe0f036 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <libc/file.h>
+#include <crtdll/stdio.h>
+#include <crtdll/internal/file.h>
 
 #undef getchar
 int
index 9ee76ca..9188ddb 100644 (file)
@@ -1,5 +1,5 @@
 #include <windows.h>
-#include <stdlib.h>
+#include <crtdll/stdlib.h>
 
 void *malloc(size_t size);
 
index 7c84f13..6673b05 100644 (file)
@@ -8,7 +8,7 @@
  *              28/12/98: Appropriated for Reactos
  */
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
+#include <crtdll/stdio.h>
 
 char *
 gets(char *s)
index a8dd381..c47e11f 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <libc/file.h>
+#include <crtdll/stdio.h>
+#include <crtdll/internal/file.h>
 
 int
 getw(FILE *f)
index 119ea13..fdde0bb 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
+#include <crtdll/stdio.h>
+#include <crtdll/string.h>
+#include <crtdll/errno.h>
 
 
 #ifdef perror
index e2bfbd5..8ab3562 100644 (file)
@@ -1,10 +1,10 @@
 
-#include <io.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <libc/file.h>
+#include <crtdll/io.h>
+#include <crtdll/errno.h>
+#include <crtdll/stdio.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/string.h>
+#include <crtdll/internal/file.h>
 
 FILE *
 _popen (const char *cm, const char *md) /* program name, pipe mode */
index 0666bfb..a5a9992 100644 (file)
@@ -1,14 +1,16 @@
 /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <libc/file.h>
-#include <internal/debug.h>
+#include <crtdll/stdio.h>
+#include <crtdll/internal/file.h>
+
+
 int
 printf(const char *fmt, ...)
 {
   int len;
-
-  len = _doprnt(fmt, (&fmt)+1, stdout);
+  va_list a = 0;
+  va_start( a, fmt ); 
+  len = _doprnt(fmt, a, stdout);
 
   /* People were confused when printf() didn't flush stdout,
      so we'll do it to reduce confusion */
index 78317a7..6ed3e95 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
+#include <crtdll/stdio.h>
 #include <windows.h>
-#include <libc/file.h>
+#include <crtdll/internal/file.h>
 
 int putc(int c, FILE *fp)
 {
index d2a2fab..ff6840d 100644 (file)
@@ -8,7 +8,7 @@
  * UPDATE HISTORY:
  *              28/12/98: Created
  */
-#include <stdio.h>
+#include <crtdll/stdio.h>
 
 #undef putc
 #undef putchar
index 6bc8011..61c2b9d 100644 (file)
@@ -1,8 +1,8 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <io.h>
+#include <crtdll/stdio.h>
+#include <crtdll/io.h>
 #include <windows.h>
-#include <string.h>
+#include <crtdll/string.h>
 
 #undef putchar
 int
index 6d6f096..10aab3f 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <libc/file.h>
+#include <crtdll/stdio.h>
+#include <crtdll/internal/file.h>
 
 int
 putw(int w, FILE *f)
index d4b1ecb..3d5f0d2 100644 (file)
@@ -1,15 +1,11 @@
 #include <windows.h>
-#include <stdio.h>
-#include <io.h> 
+#include <crtdll/stdio.h>
+#include <crtdll/io.h> 
 
-int rename(const char *old, const char *new)
-{
-       return _rename(old,new);
-}
 
-int _rename(const char *old, const char *new)
+int rename(const char *old_, const char *new_)
 {
-       if ( !MoveFile(old,new) )
+       if ( !MoveFile(old_,new_) )
                return -1;
 
        return 0;
index 9a9a681..ddeacbf 100644 (file)
@@ -1,8 +1,8 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
 
-#include <stdio.h>
-#include <io.h>
-#include <libc/file.h>
+#include <crtdll/stdio.h>
+#include <crtdll/io.h>
+#include <crtdll/internal/file.h>
 
 
 void rewind(FILE *f)
index d3c5cb7..ab74a58 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
+#include <crtdll/stdio.h>
 #include <stdarg.h>
-#include <libc/file.h>
+#include <crtdll/internal/file.h>
 
 int
 scanf(const char *fmt, ...)
index 1fc7117..f8a6e1d 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <stdlib.h>
-#include <libc/file.h>
+#include <crtdll/stdio.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/internal/file.h>
 
 void
 setbuf(FILE *f, char *buf)
index b696229..5fb09f2 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-//#include <libc/stubs.h>
-#include <stdio.h>
-#include <stdlib.h>
+//#include <crtdll/stubs.h>
+#include <crtdll/stdio.h>
+#include <crtdll/stdlib.h>
 
 void setbuffer(FILE *f, void *buf, int size)
 {
index c75ef4d..c51097a 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
+#include <crtdll/stdio.h>
 
 void setlinebuf(FILE *f)
 {
index 78dd0fc..dee5684 100644 (file)
@@ -1,10 +1,10 @@
 /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <stdlib.h>
-#include <io.h>
-#include <libc/file.h>
+#include <crtdll/stdio.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/io.h>
+#include <crtdll/internal/file.h>
 
 #define _fillsize _bufsiz
 
index 87039b9..45de8f4 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
+#include <crtdll/stdio.h>
 #include <limits.h>
-#include <libc/file.h>
+#include <crtdll/internal/file.h>
 
 
 int
@@ -9,11 +9,13 @@ sprintf(char *str, const char *fmt, ...)
 {
   FILE _strbuf;
   int len;
+  va_list a = 0;
+  va_start( a, fmt ); 
 
   _strbuf._flag = _IOWRT|_IOSTRG;
   _strbuf._ptr = str;
   _strbuf._cnt = INT_MAX;
-  len = _doprnt(fmt, &(fmt)+1, &_strbuf);
+  len = _doprnt(fmt, a, &_strbuf);
   *_strbuf._ptr = 0;
   return len;
 }
index 6b0d583..782cff2 100644 (file)
@@ -1,8 +1,8 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
+#include <crtdll/stdio.h>
 #include <stdarg.h>
-#include <libc/file.h>
-//#include <libc/unconst.h>
+#include <crtdll/internal/file.h>
+//#include <crtdll/unconst.h>
 
 int
 sscanf(const char *str, const char *fmt, ...)
index 2cfcd12..2f1aff5 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <libc/file.h>
-//#include <libc/stdiohk.h>
+#include <crtdll/stdio.h>
+#include <crtdll/internal/file.h>
+//#include <crtdll/stdiohk.h>
 
 
 
@@ -16,7 +16,7 @@ FILE _crtdll_iob[] =
        // stdout
 {
  NULL, 0, NULL,
-   _IOWRT | _IOFBF |_IOSTRG,
+   _IOWRT | _IOLBF |_IOSTRG,
   1,0,0, NULL
 },
        // stderr
index cccdea8..83092aa 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <libc/file.h>
+#include <crtdll/stdio.h>
+#include <crtdll/internal/file.h>
 
 
 static void fcloseall_helper(FILE *f)
index 9c510d7..b4de524 100644 (file)
@@ -1,6 +1,6 @@
-#include <stdio.h>
 #include <windows.h>
-
+#include <crtdll/stdio.h>
+#include <crtdll/stdlib.h>
 
 
 char *_tempnam(const char *dir,const char *prefix )
index 9329fca..236f4d8 100644 (file)
@@ -2,16 +2,16 @@
 /* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-//#include <libc/stubs.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <fcntl.h>
-//#include <unistd.h>
-#include <io.h>
-#include <libc/file.h>
-#include <share.h>
+//#include <crtdll/stubs.h>
+#include <crtdll/stdio.h>
+#include <crtdll/string.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/errno.h>
+#include <crtdll/fcntl.h>
+//#include <crtdll/unistd.h>
+#include <crtdll/io.h>
+#include <crtdll/internal/file.h>
+#include <crtdll/share.h>
 
 #if 0
 #ifndef __dj_include_stdio_h_
index 3da55c6..a3ce21d 100644 (file)
@@ -1,19 +1,10 @@
 #include <windows.h>
-#include <stdio.h>
-#include <string.h>
+#include <crtdll/stdio.h>
+#include <crtdll/string.h>
 
-char *
-_tmpnam(char *s);
-
-char *
-tmpnam(char *s)
-{
-       return _tmpnam(s);
-}
 
 
-char *
-_tmpnam(char *s)
+char * tmpnam(char *s)
 {
        char PathName[MAX_PATH];
        static char static_buf[MAX_PATH];
index b38f9dc..5f3d0ef 100644 (file)
@@ -1,7 +1,8 @@
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <libc/file.h>
+#include <crtdll/stdio.h>
+#include <crtdll/internal/file.h>
+#include <crtdll/wchar.h>
 
 int
 ungetc(int c, FILE *f)
@@ -30,3 +31,10 @@ ungetc(int c, FILE *f)
 
   return c;
 }
+
+
+int
+ungetwc(wchar_t c, FILE *f)
+{
+       return ungetc(c,f);
+}
\ No newline at end of file
index 8b4f5e6..c7494bc 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
+#include <crtdll/stdio.h>
 #include <stdarg.h>
-#include <libc/file.h>
+#include <crtdll/internal/file.h>
 
 int
 vfprintf(FILE *f, const char *fmt, va_list ap)
index c9e71d9..dba04f4 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
+#include <crtdll/stdio.h>
 #include <stdarg.h>
-#include <libc/file.h>
+#include <crtdll/internal/file.h>
 
 int
 vprintf(const char *fmt, va_list ap)
index 425725a..5f2edc4 100644 (file)
@@ -1,8 +1,8 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
+#include <crtdll/stdio.h>
 #include <stdarg.h>
 #include <limits.h>
-#include <libc/file.h>
+#include <crtdll/internal/file.h>
 
 int
 vsprintf(char *str, const char *fmt, va_list ap)
similarity index 76%
rename from reactos/lib/crtdll/stdlib/Exit.c
rename to reactos/lib/crtdll/stdlib/_exit.c
index ee3e979..ee2684c 100644 (file)
@@ -1,15 +1,12 @@
 #include <windows.h>
-#include <stdlib.h>
-#include <io.h>
-#include <fcntl.h>
-#include <libc/atexit.h>
-
-void   _exit(int _status);
+#include <crtdll/stdlib.h>
+#include <crtdll/io.h>
+#include <crtdll/fcntl.h>
+#include <crtdll/internal/atexit.h>
 
 struct __atexit *__atexit_ptr = 0;
 
-void
-exit(int status)
+void exit(int status) 
 {
   //int i;
   struct __atexit *a = __atexit_ptr;
@@ -28,13 +25,15 @@ exit(int status)
   /* in case the program set it this way */
   setmode(0, O_TEXT);
   _exit(status);
+  for(;;);
 }
 
 
 
 void _exit(int _status)
 {
-       //ExitProcess(_status);
+       ExitProcess(_status);
+       for(;;);
 }
 
 void _cexit( void )
index 29ecabd..a7840b5 100644 (file)
@@ -1,6 +1,6 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <io.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/stdio.h>
+#include <crtdll/io.h>
 
 static char msg[] = "Abort!\r\n";
 
index 3bd28bd..2863888 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdlib.h>
+#include <crtdll/stdlib.h>
 
 int
 abs(int j)
index d9d4ba5..462fa07 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdlib.h>
-#include <libc/atexit.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/internal/atexit.h>
 
 int
 atexit(void (*a)(void))
index f9f7f98..2b93d8c 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdlib.h>
+#include <crtdll/stdlib.h>
 
 double
 atof(const char *ascii)
index ba4e2df..1d19cf0 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdlib.h>
+#include <crtdll/stdlib.h>
 
 int
 atoi(const char *str)
index 2680abd..0360505 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdlib.h>
+#include <crtdll/stdlib.h>
 
 long
 atol(const char *str)
index ce3f33a..1bcaeeb 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdlib.h>
+#include <crtdll/stdlib.h>
 
 long double
 _atold(const char *ascii)
index d6a5bac..a36e43f 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdlib.h>
+#include <crtdll/stdlib.h>
 
 void *
 bsearch(const void *key, const void *base0, size_t nelem,
index 1bb68c1..7325ed6 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdlib.h>
-#include <string.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/string.h>
 
 void *
 calloc(size_t size, size_t nelem)
index db56aef..be64654 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdlib.h>
+#include <crtdll/stdlib.h>
 
 div_t
 div(int num, int denom)
index f3a7fd1..6ef49cd 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
-#include <stdlib.h>
-#include <float.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/float.h>
 
 char *
 _ecvt (double value, int ndigits, int *decpt, int *sign)
index 6b978fc..85520eb 100644 (file)
@@ -1,9 +1,9 @@
 /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <float.h>
-#include <locale.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/stdio.h>
+#include <crtdll/string.h>
+#include <crtdll/float.h>
+#include <crtdll/locale.h>
 
 void __ecvround (char *, char *, const char *, int *);
 
index 0463b94..b2bfaa6 100644 (file)
@@ -1,5 +1,5 @@
 #include <windows.h>
-#include <errno.h>
+#include <crtdll/errno.h>
 
 #undef errno
 int errno;
index 40a7dcc..e9cf5ee 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
-#include <stdlib.h>
-#include <float.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/float.h>
 
 char *
 _fcvt (double value, int ndigits, int *decpt, int *sign)
index f34526f..df12c71 100644 (file)
@@ -1,9 +1,9 @@
 /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <float.h>
-#include <locale.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/stdio.h>
+#include <crtdll/string.h>
+#include <crtdll/float.h>
+#include <crtdll/locale.h>
 
 void __ecvround (char *, char *, const char *, int *);
 
index 35a68e7..cf43e3e 100644 (file)
@@ -7,7 +7,7 @@
  * UPDATE HISTORY:
  *              28/12/98: Created
  */
-#include <stdlib.h>
+#include <crtdll/stdlib.h>
 #include <windows.h>
 
 #undef fullpath
index 6ce9adf..f32157a 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/stdio.h>
+#include <crtdll/string.h>
 
 char *
 _gcvt (double value, int ndigits, char *buf)
index 9cf2109..f4f1acb 100644 (file)
@@ -9,8 +9,8 @@
  *              1998: Added ltoa Boudewijn Dekker
  */
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <errno.h>
-#include <stdlib.h>
+#include <crtdll/errno.h>
+#include <crtdll/stdlib.h>
 
 char *
 itoa(int value, char *string, int radix)
index eb2fb71..b1c4fa2 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdlib.h>
+#include <crtdll/stdlib.h>
 
 long
 labs(long j)
index 43cfc32..26cbfbb 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdlib.h>
+#include <crtdll/stdlib.h>
 
 ldiv_t
 ldiv(long num, long denom)
index 034a6f6..fc6580a 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdlib.h>
+#include <crtdll/stdlib.h>
 
 long long
 llabs(long long j)
index 3c92ad5..2a0e3f5 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdlib.h>
+#include <crtdll/stdlib.h>
 
 lldiv_t
 lldiv(long long num, long long denom)
index f851b67..e389412 100644 (file)
@@ -1,5 +1,5 @@
-#include <stdlib.h>
-#include <string.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/string.h>
 
 void _makepath( char *path, const char *drive, const char *dir, const char *fname, const char *ext )
 {
index bfc8547..f1792be 100644 (file)
@@ -1,6 +1,6 @@
 #include <windows.h>
-#include <stdlib.h>
-//#include <types.h>
+#include <crtdll/stdlib.h>
+//#include <crtdll/types.h>
 #include <ddk/ntddk.h>
 
 void* malloc(size_t _size)
index 1516059..f97c19e 100644 (file)
@@ -1,4 +1,4 @@
-#include <stdlib.h>
+#include <crtdll/stdlib.h>
 
 
 int    mblen           (const char* mbs, size_t sizeString)
index ddb0f06..c5aec4e 100644 (file)
@@ -1,5 +1,9 @@
 #include <windows.h>
-#include <stdlib.h>
+#include <crtdll/stdlib.h>
+
+#undef _cpumode
+unsigned char _cpumode = 0;
+unsigned char *_cpumode_dll = &_cpumode;
 
 void _seterrormode(int nMode)
 {
@@ -7,7 +11,7 @@ void _seterrormode(int nMode)
        return;
 }
 
-void _beep(unsigned nFreq, unsigned dur)
+void _beep(unsigned nFreq, unsigned nDur)
 {
        Beep(nFreq,nDur);
        return;
@@ -17,4 +21,4 @@ void _sleep(unsigned long ulTime)
 {
        Sleep(ulTime);
        return;
-}
\ No newline at end of file
+}
index 0dc3b74..cc91ccc 100644 (file)
@@ -1,6 +1,6 @@
 #include <windows.h>
-#include <stdlib.h>
-#include <string.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/string.h>
 
 
 
index a65c6b5..f2be7c5 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdlib.h>
+#include <crtdll/stdlib.h>
 
 /*-
  * Copyright (c) 1980, 1983 The Regents of the University of California.
index 3628947..78912a2 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdlib.h>
+#include <crtdll/stdlib.h>
 
 static unsigned long long next = 0;
 
index 9bc467f..66bf91e 100644 (file)
@@ -1,6 +1,6 @@
-#include <stdlib.h>
+#include <crtdll/stdlib.h>
 #include <windows.h>
-#include <string.h>
+#include <crtdll/string.h>
 
 void _searchenv(const char *file,const char *var,char *path )
 {
index 8dbe18b..86f157e 100644 (file)
@@ -1,5 +1,5 @@
-#include <stdlib.h>
-#include <string.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/string.h>
 
 void _splitpath( const char *path, char *drive, char *dir, char *fname, char *ext )
 {
index 832cb2e..289752b 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <math.h>
-#include <stdlib.h>
+#include <crtdll/math.h>
+#include <crtdll/stdlib.h>
 
 
 double
index 51a2522..cbe7e18 100644 (file)
@@ -1,9 +1,9 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
 #include <limits.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <libc/file.h>
+#include <crtdll/ctype.h>
+#include <crtdll/errno.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/internal/file.h>
 
 long
 strtol(const char *nptr, char **endptr, int base)
index cbcce23..6c5aec6 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdlib.h>
-#include <ctype.h>
-//#include <libc/unconst.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/ctype.h>
+//#include <crtdll/unconst.h>
 
 static double powten[] =
 {
index 26b4944..237aeac 100644 (file)
@@ -1,10 +1,10 @@
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
 #include <limits.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdlib.h>
-//#include <libc/unconst.h>
+#include <crtdll/ctype.h>
+#include <crtdll/errno.h>
+#include <crtdll/stdlib.h>
+//#include <crtdll/unconst.h>
 
 /* constants used in Solaris */
 #define LLONG_MIN       -9223372036854775807L-1L
index d076d07..ce4b432 100644 (file)
@@ -1,9 +1,9 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
 #include <limits.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <libc/file.h>
+#include <crtdll/ctype.h>
+#include <crtdll/errno.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/internal/file.h>
 
 
 /*
index 020d539..d94845e 100644 (file)
@@ -1,10 +1,10 @@
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
 #include <limits.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdlib.h>
-//#include <libc/unconst.h>
+#include <crtdll/ctype.h>
+#include <crtdll/errno.h>
+#include <crtdll/stdlib.h>
+//#include <crtdll/unconst.h>
 
 /*
  * Convert a string to an unsigned long integer.
diff --git a/reactos/lib/crtdll/stdlib/swab.c b/reactos/lib/crtdll/stdlib/swab.c
new file mode 100644 (file)
index 0000000..0126c59
--- /dev/null
@@ -0,0 +1,18 @@
+/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
+#include <crtdll/stdlib.h>
+
+void   _swab (const char* caFrom, char* caTo, size_t sizeToCopy)
+{
+  unsigned long temp;
+
+  sizeToCopy >>= 1; sizeToCopy++;
+#define        STEP    temp = *((const char *)caFrom)++,*((char *)caTo)++ = *((const char *)caFrom)++,*((char *)caTo)++ = temp
+  /* round to multiple of 8 */
+  while ((--sizeToCopy) & 07)
+    STEP;
+  sizeToCopy >>= 3;
+  while (--sizeToCopy >= 0) {
+    STEP; STEP; STEP; STEP;
+    STEP; STEP; STEP; STEP;
+  }
+}
index cdd1110..3d04153 100644 (file)
@@ -1,4 +1,4 @@
-#include <stdlib.h>
+#include <crtdll/stdlib.h>
 
 size_t wcstombs        (char* mbsDest, const wchar_t* wsConvert, size_t size)
 {
index cd8b19c..cb0589f 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
 
 
-#include <string.h>
+#include <crtdll/string.h>
 
 void *
 memchr(const void *s, int c, size_t n)
index 1c361a3..ed5b9ae 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <string.h>
+#include <crtdll/string.h>
 
 int
 memcmp(const void *s1, const void *s2, size_t n)
index 0e11701..609afd4 100644 (file)
@@ -17,3 +17,15 @@ memcpy (char *to, char *from, size_t count)
 
   return to;
 }
+
+void *__constant_memcpy(char *to, char *from, size_t count)
+{
+       return memcpy(to,from,count);
+}
+
+void *__memcpy(char *to, char *from, size_t count)
+{
+       return memcpy(to,from,count);
+}
+
+
index 6d8940a..d8af46e 100644 (file)
@@ -1,10 +1,10 @@
-#include <string.h>
+#include <crtdll/string.h>
 
 
 void * memmove(void *dest,const void *src,size_t count)
 {
-       char *char_dest = dest;
-       char *char_src = src;
+       char *char_dest = (char *)dest;
+       char *char_src = (char *)src;
 
        while(count > 0 )
        {
index 24ec583..ef1069d 100644 (file)
@@ -11,3 +11,19 @@ void * memset(void *src,int val,size_t count)
        }
        return src;
 }
+
+void *__memset_generic(void *src,int val,size_t count)
+{
+       return memset(src,val,count);
+}
+
+void *  __constant_c_and_count_memset(void *  s, unsigned long pattern, size_t count)
+{
+       return memset(s,pattern,count); 
+}
+  
+
+void * __constant_c_memset(void *src,int val,size_t count)
+{
+       return memset(src,val,count);
+}
index bc5ec32..a84ebb5 100644 (file)
  *  DISCLAMED. This includes but is not limited to warrenties of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Revision: 1.1 $
- * $Author: rex $
- * $Date: 1999/01/16 02:11:44 $
+ * $Revision: 1.2 $
+ * $Author: ariadne $
+ * $Date: 1999/04/02 21:44:05 $
  *
  */
 
-#include <string.h>
-#include <wchar.h>
+#include <crtdll/string.h>
+#include <crtdll/wchar.h>
 
 int
 strcasecmp (const char* sz1, const char* sz2)
 {
-       return stricmp (sz1, sz2);
+       return _stricmp (sz1, sz2);
 }
 
 int
@@ -43,6 +43,7 @@ strncasecmp   (const char* sz1, const char* sz2, size_t sizeMaxCompare)
 int
 wcscmpi (const wchar_t* ws1, const wchar_t* ws2)
 {
-       return wcsicmp (ws1, ws2);
+       //return wcsicmp (ws1, ws2);
+       return 0;
 }
 
index 3305047..fd09547 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <string.h>
+#include <crtdll/string.h>
 
 char *
 strcat(char *s, const char *append)
index 7b82a6e..3f8c76e 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <string.h>
+#include <crtdll/string.h>
 
 int
 strcmp(const char *s1, const char *s2)
index ada803c..1d08be5 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <string.h>
+#include <crtdll/string.h>
 
 int
 strcoll(const char *s1, const char *s2)
index 7e17b21..430182d 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <string.h>
+#include <crtdll/string.h>
 
 size_t
 strcspn(const char *s1, const char *s2)
index 695d89e..3214e4e 100644 (file)
@@ -1,10 +1,9 @@
 
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <string.h>
-#include <stdlib.h>
+#include <crtdll/string.h>
+#include <crtdll/stdlib.h>
 
-char *
-strdup(const char *_s)
+char *_strdup(const char *_s)
 {
   char *rv;
   if (_s == 0)
index bd28973..0f9f9eb 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-//#include <libc/unconst.h>
+#include <crtdll/stdio.h>
+#include <crtdll/string.h>
+#include <crtdll/stdlib.h>
+#include <crtdll/errno.h>
 
 
 char __syserr00[] = "No Error";
@@ -59,8 +58,9 @@ __syserr35, __syserr36, __syserr37, __syserr38
 
 int __sys_nerr = sizeof(__sys_errlist) / sizeof(__sys_errlist[0]);
 
-char *
-strerror(int errnum)
+int*   _sys_nerr_dll = &__sys_nerr;
+
+char *strerror(int errnum)
 {
   static char ebuf[40];                /* 64-bit number + slop */
   char *cp;
@@ -91,8 +91,7 @@ strerror(int errnum)
   return ebuf;
 }
 
-#undef errno
-extern int errno;
+
 char *_strerror(const char *s)
 {
        if ( s == NULL )
index 377414e..22b2eb4 100644 (file)
@@ -1,9 +1,9 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <string.h>
-#include <ctype.h>
+#include <crtdll/string.h>
+#include <crtdll/ctype.h>
 
 int
-stricmp(const char *s1, const char *s2)
+_stricmp(const char *s1, const char *s2)
 {
   while (toupper(*s1) == toupper(*s2))
   {
@@ -14,3 +14,9 @@ stricmp(const char *s1, const char *s2)
   }
   return toupper(*(unsigned const char *)s1) - toupper(*(unsigned const char *)(s2));
 }
+
+int
+_strcmpi(const char *s1, const char *s2)
+{
+       return stricmp(s1,s2);
+}
index d5b8d68..c68a3dd 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <string.h>
+#include <crtdll/string.h>
 
 size_t
 strlen(const char *str)
index cb0d28f..9a11967 100644 (file)
@@ -8,10 +8,10 @@
  * Copyright 1997 Uwe Bonnes
  */
 
-#include <string.h>
-#include <ctype.h>
+#include <crtdll/string.h>
+#include <crtdll/ctype.h>
 
-char * strlwr(char *x)
+char * _strlwr(char *x)
 {
        char  *y=x;
 
index 75fc9ee..d3803fe 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <string.h>
+#include <crtdll/string.h>
 
 char *
 strncat(char *dst, const char *src, size_t n)
index f90eb5b..0f2950e 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <string.h>
+#include <crtdll/string.h>
 
 
 int
index fdf7bd6..428a235 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <string.h>
+#include <crtdll/string.h>
 
 char *
 strncpy(char *dst, const char *src, size_t n)
index 3469c98..30563e9 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <string.h>
-#include <ctype.h>
+#include <crtdll/string.h>
+#include <crtdll/ctype.h>
 
-int
-strnicmp(const char *s1, const char *s2, size_t n)
+int _strnicmp(const char *s1, const char *s2, size_t n)
 {
 
   if (n == 0)
index 3027497..6b92fb3 100644 (file)
@@ -1,8 +1,8 @@
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-#include <string.h>
+#include <crtdll/string.h>
 
 size_t
-strnlen(const char *str, int count)
+strnlen(const char *str, size_t count)
 {
   const char *s;
 
index 5f642c4..c2968ae 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <string.h>
+#include <crtdll/string.h>
 
 
 char *
index e6f3399..688d6bf 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <string.h>
-//#include <libc/unconst.h>
+#include <crtdll/string.h>
+//#include <crtdll/unconst.h>
 
 char *
 strrchr(const char *s, int c)
index 1532db0..d6e234d 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <string.h>
+#include <crtdll/string.h>
 
 size_t
 strspn(const char *s1, const char *s2)
index 7a102a1..e62eeb0 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <string.h>
-//#include <libc/unconst.h>
+#include <crtdll/string.h>
+//#include <crtdll/unconst.h>
 
 char *
 strstr(const char *s, const char *find)
index c5c6d8c..62b0fdc 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <string.h>
+#include <crtdll/string.h>
 
 char *
 strtok(char *s, const char *delim)
index 320c653..5a007e4 100644 (file)
@@ -1,5 +1,5 @@
-#include <string.h>
-#include <ctype.h>
+#include <crtdll/string.h>
+#include <crtdll/ctype.h>
 
 unsigned long strtoul(const char *cp,char **endp,unsigned int base)
 {
index f0bf755..0cd73b8 100644 (file)
@@ -9,8 +9,8 @@
  */
 
 
-#include <string.h>
-#include <ctype.h>
+#include <crtdll/string.h>
+#include <crtdll/ctype.h>
 
 char *strupr(char *x)
 {
index 389b6f5..2c2495c 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <string.h>
+#include <crtdll/string.h>
 
 size_t
 strxfrm(char *dst,const char *src, size_t n)
index d8deb06..e75454f 100644 (file)
@@ -1,15 +1,13 @@
-#include       <sys/types.h>
-#include       <sys/stat.h>
-#include       <fcntl.h>
-#include       <string.h>
+#include       <crtdll/sys/types.h>
+#include       <crtdll/sys/stat.h>
+#include       <crtdll/fcntl.h>
+#include       <crtdll/string.h>
 #include       <windows.h>
-//#include     <libc/file.h>
+#include       <crtdll/internal/file.h>
 
-void UnixTimeToFileTime( time_t unix_time, FILETIME *filetime, DWORD remainder );
-time_t FileTimeToUnixTime( const FILETIME *filetime, DWORD *remainder );
 
 int
-fstat(int handle, struct stat *statbuf)
+_fstat(int handle, struct stat *statbuf)
 {
  
   BY_HANDLE_FILE_INFORMATION  FileInformation;
index f10455f..f8e409f 100644 (file)
@@ -1,13 +1,8 @@
-#include       <sys/types.h>
-#include       <sys/stat.h>
-#include       <fcntl.h>
-#include       <io.h>
+#include <crtdll/sys/types.h>
+#include <crtdll/sys/stat.h>
+#include <crtdll/fcntl.h>
+#include <crtdll/io.h>
 
-#undef stat
-int stat( const char *path, struct stat *buffer )
-{
-       return _stat(path,buffer);
-}
 
 int _stat( const char *path, struct stat *buffer )
 {
diff --git a/reactos/lib/crtdll/tchar/strdec.c b/reactos/lib/crtdll/tchar/strdec.c
new file mode 100644 (file)
index 0000000..05cbf98
--- /dev/null
@@ -0,0 +1,7 @@
+#include <crtdll/tchar.h>
+
+char * _strdec(const char *str1, const char *str2) 
+{ 
+       return (char *) (( str1 >= str2 ) ? ( str1 ) : --str2); 
+}
+
diff --git a/reactos/lib/crtdll/tchar/strinc.c b/reactos/lib/crtdll/tchar/strinc.c
new file mode 100644 (file)
index 0000000..bb1b49f
--- /dev/null
@@ -0,0 +1,6 @@
+#include <crtdll/tchar.h>
+
+char * _strinc(const char *str) 
+{ 
+       return (char *)(++str); 
+}
diff --git a/reactos/lib/crtdll/tchar/strncnt.c b/reactos/lib/crtdll/tchar/strncnt.c
new file mode 100644 (file)
index 0000000..b47cc20
--- /dev/null
@@ -0,0 +1,8 @@
+#include <crtdll/tchar.h>
+#include <crtdll/sys/types.h>
+#include <crtdll/string.h>
+
+size_t _strncnt( const char *str, size_t max) 
+{ 
+       return strnlen(str,max); 
+}
diff --git a/reactos/lib/crtdll/tchar/strnextc.c b/reactos/lib/crtdll/tchar/strnextc.c
new file mode 100644 (file)
index 0000000..b1c0585
--- /dev/null
@@ -0,0 +1,6 @@
+#include <crtdll/tchar.h>
+
+int _strnextc(const char *str) 
+{ 
+       return *(++str); 
+}
diff --git a/reactos/lib/crtdll/tchar/strninc.c b/reactos/lib/crtdll/tchar/strninc.c
new file mode 100644 (file)
index 0000000..72169a5
--- /dev/null
@@ -0,0 +1,6 @@
+#include <crtdll/tchar.h>
+
+char * _strninc(const char *str, size_t inc)
+{ 
+       return (char *)(str + inc); 
+}
diff --git a/reactos/lib/crtdll/tchar/strspnp.c b/reactos/lib/crtdll/tchar/strspnp.c
new file mode 100644 (file)
index 0000000..1a56476
--- /dev/null
@@ -0,0 +1,7 @@
+#include <crtdll/tchar.h>
+
+
+char * _strspnp( const char * str1, const char * str2) 
+{ 
+       return NULL; 
+}
\ No newline at end of file
index 3814ebc..404aadf 100644 (file)
@@ -9,10 +9,10 @@
  */
 
 #include <windows.h>
-#include <time.h>
+#include <crtdll/time.h>
+#include <crtdll/internal/file.h>
 
-// should be replace by a call to RtltimeToSecondsSince70
-time_t FileTimeToUnixTime( const FILETIME *filetime, DWORD *remainder ); 
+VOID STDCALL GetSystemTimeAsFileTime(LPFILETIME  lpSystemTimeAsFileTime );
 
 clock_t clock ( void )
 {
@@ -24,11 +24,11 @@ clock_t clock ( void )
        FILETIME  SystemTime;
        DWORD Remainder;
 
-       if ( !GetProcessTimes(-1,&CreationTime,&ExitTime,&KernelTime,&UserTime ) )
+       if ( !GetProcessTimes(GetCurrentProcess(),&CreationTime,&ExitTime,&KernelTime,&UserTime ) )
                return -1;
 
-       if ( !GetSystemTimeAsFileTime(&SystemTime) )
-               return -1;
+       GetSystemTimeAsFileTime(&SystemTime);
+               
 
        return FileTimeToUnixTime( &SystemTime,&Remainder ) - FileTimeToUnixTime( &CreationTime,&Remainder ); 
 }
\ No newline at end of file
index b00098f..0eee0f9 100644 (file)
@@ -39,17 +39,17 @@ static char sccsid[] = "@(#)ctime.c 5.23 (Berkeley) 6/22/90";
 
 
 
-#include <fcntl.h>
-#include <time.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include <crtdll/fcntl.h>
+#include <crtdll/time.h>
+#include <crtdll/string.h>
+#include <crtdll/ctype.h>
+#include <crtdll/stdio.h>
+#include <crtdll/stdlib.h>
 
 #include <windows.h>
 #include "tzfile.h"
 
-#include <io.h>
+#include <crtdll/io.h>
 
 #include "posixrul.h"
 
@@ -81,6 +81,8 @@ static char sccsid[] = "@(#)ctime.c   5.23 (Berkeley) 6/22/90";
 ** manual page of what this "time zone abbreviation" means (doing this so
 ** that tzname[0] has the "normal" length of three characters).
 */
+int _daylight_dll;
+
 static char WILDABBR[] = "   ";
 
 #ifndef TRUE
index 7f18460..97d6b59 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <time.h>
+#include <crtdll/time.h>
 
 double
 difftime(time_t time1, time_t time0)
index 252448e..cc6f0e9 100644 (file)
@@ -1,8 +1,8 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <string.h>
+#include <crtdll/string.h>
 
 
-#include <time.h>
+#include <crtdll/time.h>
 
 #define TM_YEAR_BASE 1900
 
index f682a7c..3a49372 100644 (file)
@@ -8,13 +8,18 @@
  *              28/12/98: Created
  */
 
-#include <windows.h>
-#include <time.h>
+/*
+ * DOS file system functions
+ *
+ * Copyright 1993 Erik Bos
+ * Copyright 1996 Alexandre Julliard
+ */
 
-// should be replace by a call to RtltimeToSecondsSince70
-// and moved to a header
+#include <windows.h>
+#include <crtdll/time.h>
+#include <crtdll/internal/file.h>
 
-time_t FileTimeToUnixTime( const FILETIME *filetime, DWORD *remainder ); 
+VOID STDCALL GetSystemTimeAsFileTime(LPFILETIME  lpSystemTimeAsFileTime );
 
 time_t
 time(time_t *t)
@@ -25,3 +30,190 @@ time(time_t *t)
        return FileTimeToUnixTime( &SystemTime,&Remainder ); 
 }
 
+/***********************************************************************
+ *           DOSFS_UnixTimeToFileTime
+ *
+ * Convert a Unix time to FILETIME format.
+ * The FILETIME structure is a 64-bit value representing the number of
+ * 100-nanosecond intervals since January 1, 1601, 0:00.
+ * 'remainder' is the nonnegative number of 100-ns intervals
+ * corresponding to the time fraction smaller than 1 second that
+ * couldn't be stored in the time_t value.
+ */
+void UnixTimeToFileTime( time_t unix_time, FILETIME *filetime,
+                               DWORD remainder )
+{
+    /* NOTES:
+
+       CONSTANTS: 
+       The time difference between 1 January 1601, 00:00:00 and
+       1 January 1970, 00:00:00 is 369 years, plus the leap years
+       from 1604 to 1968, excluding 1700, 1800, 1900.
+       This makes (1968 - 1600) / 4 - 3 = 89 leap days, and a total
+       of 134774 days.
+
+       Any day in that period had 24 * 60 * 60 = 86400 seconds.
+
+       The time difference is 134774 * 86400 * 10000000, which can be written
+       116444736000000000
+       27111902 * 2^32 + 3577643008
+       413 * 2^48 + 45534 * 2^32 + 54590 * 2^16 + 32768
+
+       If you find that these constants are buggy, please change them in all
+       instances in both conversion functions.
+
+       VERSIONS:
+       There are two versions, one of them uses long long variables and
+       is presumably faster but not ISO C. The other one uses standard C
+       data types and operations but relies on the assumption that negative
+       numbers are stored as 2's complement (-1 is 0xffff....). If this
+       assumption is violated, dates before 1970 will not convert correctly.
+       This should however work on any reasonable architecture where WINE
+       will run.
+
+       DETAILS:
+       
+       Take care not to remove the casts. I have tested these functions
+       (in both versions) for a lot of numbers. I would be interested in
+       results on other compilers than GCC.
+
+       The operations have been designed to account for the possibility
+       of 64-bit time_t in future UNICES. Even the versions without
+       internal long long numbers will work if time_t only is 64 bit.
+       A 32-bit shift, which was necessary for that operation, turned out
+       not to work correctly in GCC, besides giving the warning. So I
+       used a double 16-bit shift instead. Numbers are in the ISO version
+       represented by three limbs, the most significant with 32 bit, the
+       other two with 16 bit each.
+
+       As the modulo-operator % is not well-defined for negative numbers,
+       negative divisors have been avoided in DOSFS_FileTimeToUnixTime.
+
+       There might be quicker ways to do this in C. Certainly so in
+       assembler.
+
+       Claus Fischer, fischer@iue.tuwien.ac.at
+       */
+
+
+
+
+    unsigned long a0;                  /* 16 bit, low    bits */
+    unsigned long a1;                  /* 16 bit, medium bits */
+    unsigned long a2;                  /* 32 bit, high   bits */
+
+    /* Copy the unix time to a2/a1/a0 */
+    a0 =  unix_time & 0xffff;
+    a1 = (unix_time >> 16) & 0xffff;
+    /* This is obsolete if unix_time is only 32 bits, but it does not hurt.
+       Do not replace this by >> 32, it gives a compiler warning and it does
+       not work. */
+    a2 = (unix_time >= 0 ? (unix_time >> 16) >> 16 :
+          ~((~unix_time >> 16) >> 16));
+
+    /* Multiply a by 10000000 (a = a2/a1/a0)
+       Split the factor into 10000 * 1000 which are both less than 0xffff. */
+    a0 *= 10000;
+    a1 = a1 * 10000 + (a0 >> 16);
+    a2 = a2 * 10000 + (a1 >> 16);
+    a0 &= 0xffff;
+    a1 &= 0xffff;
+
+    a0 *= 1000;
+    a1 = a1 * 1000 + (a0 >> 16);
+    a2 = a2 * 1000 + (a1 >> 16);
+    a0 &= 0xffff;
+    a1 &= 0xffff;
+
+    /* Add the time difference and the remainder */
+    a0 += 32768 + (remainder & 0xffff);
+    a1 += 54590 + (remainder >> 16   ) + (a0 >> 16);
+    a2 += 27111902                     + (a1 >> 16);
+    a0 &= 0xffff;
+    a1 &= 0xffff;
+
+    /* Set filetime */
+    filetime->dwLowDateTime  = (a1 << 16) + a0;
+    filetime->dwHighDateTime = a2;
+}
+
+
+/***********************************************************************
+ *           DOSFS_FileTimeToUnixTime
+ *
+ * Convert a FILETIME format to Unix time.
+ * If not NULL, 'remainder' contains the fractional part of the filetime,
+ * in the range of [0..9999999] (even if time_t is negative).
+ */
+time_t FileTimeToUnixTime( const FILETIME *filetime, DWORD *remainder )
+{
+    /* Read the comment in the function DOSFS_UnixTimeToFileTime. */
+
+    unsigned long a0;                  /* 16 bit, low    bits */
+    unsigned long a1;                  /* 16 bit, medium bits */
+    unsigned long a2;                  /* 32 bit, high   bits */
+    unsigned long r;                   /* remainder of division */
+    unsigned int carry;         /* carry bit for subtraction */
+    int negative;               /* whether a represents a negative value */
+
+    /* Copy the time values to a2/a1/a0 */
+    a2 =  (unsigned long)filetime->dwHighDateTime;
+    a1 = ((unsigned long)filetime->dwLowDateTime ) >> 16;
+    a0 = ((unsigned long)filetime->dwLowDateTime ) & 0xffff;
+
+    /* Subtract the time difference */
+    if (a0 >= 32768           ) a0 -=             32768        , carry = 0;
+    else                        a0 += (1 << 16) - 32768        , carry = 1;
+
+    if (a1 >= 54590    + carry) a1 -=             54590 + carry, carry = 0;
+    else                        a1 += (1 << 16) - 54590 - carry, carry = 1;
+
+    a2 -= 27111902 + carry;
+    
+    /* If a is negative, replace a by (-1-a) */
+    negative = (a2 >= ((unsigned long)1) << 31);
+    if (negative)
+    {
+        /* Set a to -a - 1 (a is a2/a1/a0) */
+        a0 = 0xffff - a0;
+        a1 = 0xffff - a1;
+        a2 = ~a2;
+    }
+
+    /* Divide a by 10000000 (a = a2/a1/a0), put the rest into r.
+       Split the divisor into 10000 * 1000 which are both less than 0xffff. */
+    a1 += (a2 % 10000) << 16;
+    a2 /=       10000;
+    a0 += (a1 % 10000) << 16;
+    a1 /=       10000;
+    r   =  a0 % 10000;
+    a0 /=       10000;
+
+    a1 += (a2 % 1000) << 16;
+    a2 /=       1000;
+    a0 += (a1 % 1000) << 16;
+    a1 /=       1000;
+    r  += (a0 % 1000) * 10000;
+    a0 /=       1000;
+
+    /* If a was negative, replace a by (-1-a) and r by (9999999 - r) */
+    if (negative)
+    {
+        /* Set a to -a - 1 (a is a2/a1/a0) */
+        a0 = 0xffff - a0;
+        a1 = 0xffff - a1;
+        a2 = ~a2;
+
+        r  = 9999999 - r;
+    }
+
+    if (remainder) *remainder = r;
+
+    /* Do not replace this by << 32, it gives a compiler warning and it does
+       not work. */
+    return ((((time_t)a2) << 16) << 16) + (a1 << 16) + a0;
+
+}
+
+
+
index fcc3603..e2787a8 100644 (file)
@@ -1,6 +1,6 @@
 
 
-#include <wstring.h>
+#include <crtdll/wchar.h>
 
 wchar_t * wcscat(wchar_t * dest,const wchar_t * src)
 {
index 1fb1540..5bbd959 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
 
-#include <wstring.h>
+#include <crtdll/wchar.h>
 
 wchar_t* wcschr(const wchar_t* str, wchar_t ch)
 {
index 997bfb8..ab25af4 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
 
-#include <wstring.h>
+#include <crtdll/wchar.h>
 
 int wcscmp(const wchar_t* cs,const wchar_t * ct)
 {
index 712733e..5dac026 100644 (file)
@@ -8,9 +8,9 @@
  * Copyright 1997 Uwe Bonnes
  */
 
-#include <wstring.h>
+#include <crtdll/wchar.h>
 
-size_t wcscoll(wchar_t *a1,wchar_t *a2)
+int wcscoll(const wchar_t *a1,const wchar_t *a2)
 {
        /* FIXME: handle collates */
        return wcscmp(a1,a2);
index 4e122f5..44f71f0 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
 
-#include <wstring.h>
+#include <crtdll/wchar.h>
 
 wchar_t * wcscpy(wchar_t * str1,const wchar_t * str2)
 {
index 64d8475..2c3f2d2 100644 (file)
@@ -1,4 +1,4 @@
-#include <wstring.h>
+#include <crtdll/wchar.h>
 
 size_t wcscspn(const wchar_t *str,const wchar_t *reject)
 {
index ee21a9b..c6db721 100644 (file)
@@ -1,7 +1,7 @@
-#include <wstring.h>
+#include <crtdll/wchar.h>
 
 
-wchar_t *wcsdup(const wchar_t *ptr)
+wchar_t *_wcsdup(const wchar_t *ptr)
 {
        wchar_t *dup;
        dup = malloc((wcslen(ptr) + 1)*sizeof(wchar_t));
diff --git a/reactos/lib/crtdll/wchar/wcsftime.c b/reactos/lib/crtdll/wchar/wcsftime.c
new file mode 100644 (file)
index 0000000..4e402b5
--- /dev/null
@@ -0,0 +1,6 @@
+#include <crtdll/wchar.h>
+
+size_t wcsftime(wchar_t *str, size_t len, const wchar_t *fmt, const struct tm *tp )
+{
+       return 0;
+}
\ No newline at end of file
index 658e2d1..1cfaf8e 100644 (file)
@@ -1,8 +1,8 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
 
-#include <wstring.h>
+#include <crtdll/wchar.h>
 
-int wcsicmp(const wchar_t* cs,const wchar_t * ct)  
+int _wcsicmp(const wchar_t* cs,const wchar_t * ct)  
 {
        while (towlower(*cs) == towlower(*ct))
        {
index 31e81fa..6c40081 100644 (file)
@@ -1,11 +1,6 @@
 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
 
-#include <wstring.h>
-
-size_t wstrlen(const wchar_t *s)
-{
-    return wcslen(s);
-}
+#include <crtdll/wchar.h>
 
 
 size_t wcslen(const wchar_t * s)
@@ -17,3 +12,10 @@ size_t wcslen(const wchar_t * s)
        for (save = s; *save; ++save);
        return save-s;
 }
+
+size_t wstrlen(const wchar_t *s)
+{
+    return wcslen(s);
+}
+
+
index a4dc2ee..0dcf2da 100644 (file)
@@ -8,9 +8,9 @@
  * Copyright 1997 Uwe Bonnes
  */
 
-#include <wstring.h>
+#include <crtdll/wchar.h>
 
-wchar_t * wcslwr(wchar_t *x)
+wchar_t * _wcslwr(wchar_t *x)
 {
        wchar_t  *y=x;
 
index c4bfc7d..a76fb0f 100644 (file)
@@ -1,4 +1,4 @@
-#include <wstring.h>
+#include <crtdll/wchar.h>
 
 wchar_t * wcsncat(wchar_t * dest,const wchar_t * src,size_t count)
 {
index ad8d238..6341f46 100644 (file)
@@ -1,4 +1,4 @@
-#include <wstring.h>
+#include <crtdll/wchar.h>
 
 int wcsncmp(const wchar_t * cs,const wchar_t * ct,size_t count)
 {
index 7c8a1a1..5ae1f41 100644 (file)
@@ -1,6 +1,6 @@
-#include <wstring.h>
+#include <crtdll/wchar.h>
 
-wchar_t * wcsncpy(wchar_t * dest,const wchar_t *src,size_t count)
+wchar_t * _wcsncpy(wchar_t * dest,const wchar_t *src,size_t count)
 {
    int i;
    
index 8d4621b..b39ce44 100644 (file)
@@ -1,6 +1,6 @@
-#include <wstring.h>
+#include <crtdll/wchar.h>
 
-int wcsnicmp(const wchar_t * cs,const wchar_t * ct,size_t count)
+int _wcsnicmp(const wchar_t * cs,const wchar_t * ct,size_t count)
 {
   wchar_t *save = cs;
   while (towlower(*cs) == towlower(*ct) && (int)(cs - save) < count)
index b91b9d1..dc5796c 100644 (file)
@@ -1,4 +1,6 @@
-size_t wcsnlen(const wchar_t * s, size_t count)
+#include <crtdll/wchar.h>
+
+size_t _wcsnlen(const wchar_t * s, size_t count)
 {
       
         unsigned int len=0;
index 2906776..8568d96 100644 (file)
@@ -1,3 +1,5 @@
+#include <crtdll/wchar.h>
+
 wchar_t* wcsrchr(const wchar_t* str, wchar_t ch)
 {
   
index feaa270..695f0de 100644 (file)
@@ -1,4 +1,6 @@
-wchar_t * wcsrev(wchar_t *s) 
+#include <crtdll/wchar.h>
+
+wchar_t * _wcsrev(wchar_t *s) 
 {
        wchar_t  *e;
        wchar_t   a;
index a125b03..89d420a 100644 (file)
@@ -1,4 +1,6 @@
-size_t wcsspn(const wchar_t *str,const wchar_t *accept)
+#include <crtdll/wchar.h>
+
+size_t _wcsspn(const wchar_t *str,const wchar_t *accept)
 {
        wchar_t  *s;
        wchar_t  *t;
index 6bab793..ebe638f 100644 (file)
@@ -1,3 +1,5 @@
+#include <crtdll/wchar.h>
+
 wchar_t *wcsstr(const wchar_t *s,const wchar_t *b)
 {
        wchar_t *x;
index ed49ad4..3afd717 100644 (file)
@@ -1,3 +1,5 @@
+#include <crtdll/wchar.h>
+
 wchar_t *wcstok(wchar_t *s, const wchar_t *ct)
 {
        const wchar_t *spanp;
index 0024136..1c39976 100644 (file)
@@ -1,3 +1,38 @@
+#include <crtdll/wchar.h>
+
+
+long wcstol(const wchar_t *cp,wchar_t **endp,unsigned int base)
+{
+       long result = 0,value;
+       int sign = 1;
+
+       if ( *cp == L'-' ) {
+               sign = -1;
+               *cp++;
+       }
+
+       if (!base) {
+               base = 10;
+               if (*cp == L'0') {
+                       base = 8;
+                       cp++;
+                       if ((*cp == L'x') && iswxdigit(cp[1])) {
+                               cp++;
+                               base = 16;
+                       }
+               }
+       }
+       while (iswxdigit(*cp) && (value = iswdigit(*cp) ? *cp-L'0' : (iswlower(*cp)
+           ? towupper(*cp) : *cp)-L'A'+10) < base) {
+               result = result*base + value;
+               cp++;
+       }
+       if (endp)
+               *endp = (wchar_t *)cp;
+       return result * sign;
+}
+
+
 unsigned long wcstoul(const wchar_t *cp,wchar_t **endp,unsigned int base)
 {
        unsigned long result = 0,value;
index bb19f26..438b5a9 100644 (file)
@@ -1,4 +1,6 @@
-wchar_t *wcsupr(wchar_t *x)
+#include <crtdll/wchar.h>
+
+wchar_t *_wcsupr(wchar_t *x)
 {
        wchar_t  *y=x;
 
diff --git a/reactos/lib/crtdll/wchar/wcsxfrm.c b/reactos/lib/crtdll/wchar/wcsxfrm.c
new file mode 100644 (file)
index 0000000..f86a2b8
--- /dev/null
@@ -0,0 +1,6 @@
+#include <crtdll/string.h>
+
+size_t wcsxfrm( wchar_t *str1, const wchar_t *str2, size_t len )
+{
+       return 0;
+}
\ No newline at end of file