X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fstdio%2Ffputc.c;h=a89d2984b7ab57cd60ba6a33259eaf094775b14f;hp=4321b30a2d9c7b3fec376d474ab9a61f6b767ff3;hb=0a5395faab237ba9008352b0f4bee9659bbd3d5f;hpb=34893ecc2200dc7017c36a54cb6c5f4c2378b5ec diff --git a/functions/stdio/fputc.c b/functions/stdio/fputc.c index 4321b30..a89d298 100644 --- a/functions/stdio/fputc.c +++ b/functions/stdio/fputc.c @@ -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); +} +*/