]> pd.if.org Git - pdclib/blobdiff - functions/stdio/fputc.c
Merged PDPCLIB and Therx code.
[pdclib] / functions / stdio / fputc.c
index 4321b30a2d9c7b3fec376d474ab9a61f6b767ff3..a89d2984b7ab57cd60ba6a33259eaf094775b14f 100644 (file)
@@ -6,3 +6,53 @@
 // ----------------------------------------------------------------------------
 
 int fputc( int c, FILE * stream ) { /* TODO */ };
+
+/* PDPC code - unreviewed
+{
+    char buf[1];
+
+#ifndef __MVS__
+    stream->quickBin = 0;
+    if ((stream->upto < (stream->endbuf - 2))
+        && (stream->bufTech != _IONBF))
+    {
+        if (stream->textMode)
+        {
+            if (c == '\n')
+            {
+                if (stream->bufTech == _IOFBF)
+                {
+                    *stream->upto++ = '\r';
+                    *stream->upto++ = '\n';
+                }
+                else
+                {
+                    buf[0] = (char)c;
+                    if (fwrite(buf, 1, 1, stream) != 1)
+                    {
+                        return (EOF);
+                    }
+                }
+            }
+            else
+            {
+                *stream->upto++ = (char)c;
+            }
+        }
+        else
+        {
+            *stream->upto++ = (char)c;
+        }
+    }
+    else
+#endif
+    {
+        buf[0] = (char)c;
+        if (fwrite(buf, 1, 1, stream) != 1)
+        {
+            return (EOF);
+        }
+    }
+    return (c);
+}
+*/