X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Ffputc.c;h=d17c936c365e35d1757ba91befdffd7835127e0a;hb=refs%2Ftags%2FOLD;hp=4321b30a2d9c7b3fec376d474ab9a61f6b767ff3;hpb=34893ecc2200dc7017c36a54cb6c5f4c2378b5ec;p=pdclib diff --git a/functions/stdio/fputc.c b/functions/stdio/fputc.c index 4321b30..d17c936 100644 --- a/functions/stdio/fputc.c +++ b/functions/stdio/fputc.c @@ -1,8 +1,58 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ 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); +} +*/