Commit in reactos on MAIN
lib/msvcrt/stdio/fflush.c+1-11.11 -> 1.12
                /filbuf.c+3-31.10 -> 1.11
                /flsbuf.c+4-41.8 -> 1.9
                /fwrite.c+1-11.6 -> 1.7
                /putchar.c+2-21.6 -> 1.7
                /setvbuf.c+6-21.5 -> 1.6
                /stdhnd.c+2-21.7 -> 1.8
include/msvcrt/stdio.h+23-231.7 -> 1.8
+42-38
8 modified files
- Made some flags for the flag value from the FILE structure compatible with the mingw headers.
- Use _IO_LBF instead of _IOLBF, because _IOSTRG and _IOLBF has the same value.

reactos/lib/msvcrt/stdio
fflush.c 1.11 -> 1.12
diff -u -r1.11 -r1.12
--- fflush.c	8 Jan 2004 18:42:44 -0000	1.11
+++ fflush.c	21 Apr 2004 21:40:43 -0000	1.12
@@ -81,7 +81,7 @@
     f->_flag &= ~_IOAHEAD;
 
 
-    f->_cnt = (f->_flag&(_IOLBF|_IONBF)) ? 0 : f->_bufsiz;
+    f->_cnt = (f->_flag&(_IO_LBF|_IONBF)) ? 0 : f->_bufsiz;
 
 // how can write return less than rn without being on error ???
 

reactos/lib/msvcrt/stdio
filbuf.c 1.10 -> 1.11
diff -u -r1.10 -r1.11
--- filbuf.c	16 Jul 2003 02:45:24 -0000	1.10
+++ filbuf.c	21 Apr 2004 21:40:43 -0000	1.11
@@ -34,7 +34,7 @@
     if ((f->_base = malloc(size+1)) == NULL) {
 	// error ENOMEM
       f->_flag |= _IONBF;
-      f->_flag &= ~(_IOFBF|_IOLBF);
+      f->_flag &= ~(_IOFBF|_IO_LBF);
     } else {
       f->_flag |= _IOMYBUF;
       f->_bufsiz = size;
@@ -45,9 +45,9 @@
 
   // flush stdout before reading from stdin 
   if (f == stdin) {
-    if (stdout->_flag&_IOLBF)
+    if (stdout->_flag&_IO_LBF)
       fflush(stdout);
-    if (stderr->_flag&_IOLBF)
+    if (stderr->_flag&_IO_LBF)
       fflush(stderr);
   }
 

reactos/lib/msvcrt/stdio
flsbuf.c 1.8 -> 1.9
diff -u -r1.8 -r1.9
--- flsbuf.c	11 Jul 2003 21:58:09 -0000	1.8
+++ flsbuf.c	21 Apr 2004 21:40:43 -0000	1.9
@@ -40,19 +40,19 @@
         size = 4096;
         if ((f->_base = base = malloc(size)) == NULL) {
             f->_flag |= _IONBF;
-            f->_flag &= ~(_IOFBF|_IOLBF);
+            f->_flag &= ~(_IOFBF|_IO_LBF);
         } else {
             f->_flag |= _IOMYBUF;
             f->_cnt = f->_bufsiz = size;
             f->_ptr = base;
             rn = 0;
             if (f == stdout && isatty(fileno(stdout))) {
-                f->_flag |= _IOLBF;
+                f->_flag |= _IO_LBF;
             }
         }
     }
 
-    if (f->_flag & _IOLBF) {
+    if (f->_flag & _IO_LBF) {
         /* in line-buffering mode we get here on each character */
         *f->_ptr++ = c;
         rn = f->_ptr - base;
@@ -90,7 +90,7 @@
         rn -= n;
         base += n;
     }
-    if ((f->_flag & (_IOLBF|_IONBF)) == 0) {
+    if ((f->_flag & (_IO_LBF|_IONBF)) == 0) {
         f->_cnt--;
         *f->_ptr++ = c;
     }

reactos/lib/msvcrt/stdio
fwrite.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- fwrite.c	11 Jul 2003 21:58:09 -0000	1.6
+++ fwrite.c	21 Apr 2004 21:40:43 -0000	1.7
@@ -44,7 +44,7 @@
         return 1;
   }
 
-  if (iop->_flag & _IOLBF)
+  if (iop->_flag & _IO_LBF)
   {
      while (to_write > 0)
      {

reactos/lib/msvcrt/stdio
putchar.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- putchar.c	11 Jul 2003 21:58:09 -0000	1.6
+++ putchar.c	21 Apr 2004 21:40:43 -0000	1.7
@@ -21,7 +21,7 @@
 int putchar(int c)
 {
   int r = putc(c, stdout);
-  if (stdout->_flag & _IOLBF)
+  if (stdout->_flag & _IO_LBF)
      fflush(stdout);
   return r;
 }
@@ -32,7 +32,7 @@
 wint_t putwchar(wint_t c)
 {
   wint_t r = putwc(c, stdout);
-  if (stdout->_flag & _IOLBF)
+  if (stdout->_flag & _IO_LBF)
      fflush(stdout);
   return r;
 }

reactos/lib/msvcrt/stdio
setvbuf.c 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- setvbuf.c	11 Jul 2003 21:58:09 -0000	1.5
+++ setvbuf.c	21 Apr 2004 21:40:43 -0000	1.6
@@ -20,10 +20,14 @@
   }
   if ( f->_base != NULL )
   	fflush(f);
+  /* Cannot use _IOLBF as flag value because _IOLBF is equal to _IOSTRG */
+  if (type == _IOLBF) 
+      type = _IO_LBF;
+    
   switch (type)
   {
   case _IOFBF:
-  case _IOLBF:
+  case _IO_LBF:
     if (len <= 0) {
 	__set_errno (EINVAL);
 	return EOF;
@@ -43,7 +47,7 @@
       free(f->_base);
     f->_cnt = 0;
 
-    f->_flag &= ~(_IONBF|_IOFBF|_IOLBF|_IOUNGETC);
+    f->_flag &= ~(_IONBF|_IOFBF|_IO_LBF|_IOUNGETC);
     f->_flag |= type;
     if (type != _IONBF)
     {

reactos/lib/msvcrt/stdio
stdhnd.c 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- stdhnd.c	11 Jul 2003 21:58:09 -0000	1.7
+++ stdhnd.c	21 Apr 2004 21:40:43 -0000	1.8
@@ -7,13 +7,13 @@
 	// stdin
 {
  NULL, 0, NULL,
-  _IOREAD | _IOLBF ,
+  _IOREAD | _IO_LBF ,
   0, 0,0, NULL
 },
 	// stdout
 {
  NULL, 0, NULL,
-   _IOWRT | _IOLBF |_IOSTRG,
+   _IOWRT | _IO_LBF |_IOSTRG,
   1,0,0, NULL
 },
 	// stderr

reactos/include/msvcrt
stdio.h 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- stdio.h	25 Aug 2003 01:37:47 -0000	1.7
+++ stdio.h	21 Apr 2004 21:40:43 -0000	1.8
@@ -22,9 +22,9 @@
  *  DISCLAIMED. This includes but is not limited to warranties of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Revision: 1.7 $
- * $Author: sedwards $
- * $Date: 2003/08/25 01:37:47 $
+ * $Revision: 1.8 $
+ * $Author: hbirr $
+ * $Date: 2004/04/21 21:40:43 $
  *
  */
 /* Appropriated for Reactos Crtdll by Ariadne */
@@ -46,26 +46,22 @@
 #include <msvcrt/stddef.h>
 
 
-/* Some flags for the iobuf structure provided by djgpp stdio.h */
-#define _IOREAD   0x000010
-#define _IOWRT    0x000020
-#define _IOMYBUF  0x000040
-#define _IOEOF    0x000100
-#define _IOERR    0x000200
-#define _IOSTRG   0x000400
+#define _IOREAD   0x0001
+#define _IOWRT    0x0002
+#define _IOMYBUF  0x0008  /* stdio malloc()'d buffer */
+#define _IOEOF    0x0010  /* EOF reached on read */
+#define _IOERR    0x0020  /* I/O error from system */
+#define _IOSTRG   0x0040  /* Strange or no file descriptor */
 
-#define _IOBINARY 0x000800
+#define _IOBINARY 0x040000
 #define _IOTEXT   0x000000
 
-#define _IOAPPEND 0x002000
-#define _IORMONCL 0x004000  /* remove on close, for temp files */
-/* if _flag & _IORMONCL, ._name_to_remove needs freeing */
-#define _IOUNGETC 0x010000  /* there is an ungetc'ed character in the buffer */
-#define _IOCOMMIT 0x008000
-
-#define _IODIRTY  0x000080
-#define _IOAHEAD  0x000008
-#define _IORW (_IOREAD | _IOWRITE )
+#define _IOCOMMIT 0x100000
+
+#define _IODIRTY  0x010000
+#define _IOAHEAD  0x020000
+
+
 
 
 /*
@@ -180,9 +176,13 @@
  * 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 */
+#define _IOFBF    0x0000     /* full buffered */
+#define _IOLBF    0x0040     /* line buffered */
+#define _IONBF    0x0004     /* not buffered */
+
+#define _IO_LBF   0x80000    /* this value is used insteat of _IOLBF within the 
+                                structure FILE as value for _flags, 
+                                because _IOLBF has the same value as _IOSTRG */
 
 int setvbuf(FILE* fileSetBuffer, char* caBuffer, int nMode, size_t sizeBuffer);
 
CVSspam 0.2.8