Category : C++ Source Code
Archive   : VCCRT2.ZIP
Filename : PUTS.C

 
Output of file : PUTS.C contained in archive : VCCRT2.ZIP
/***
*puts.c - put a string to stdout
*
* Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved.
*
*Purpose:
* defines puts() - put a string to stdout
*
*******************************************************************************/

#include
#include
#include
#include
#include
#include


/***
*int puts(string) - put a string to stdout with newline
*
*Purpose:
* Write a string to stdout; don't include '\0' but append '\n'. Uses
* temporary buffering for efficiency on stdout if unbuffered.
*
*Entry:
* char *string - string to output
*
*Exit:
* Good return = 0
* Error return = EOF
*
*Exceptions:
*
*******************************************************************************/

int
puts (string)
const char *string;
{
REG1 FILE _NEAR_ *stream = stdout;
REG4 int buffing;
REG2 unsigned int length;
REG3 unsigned int ndone;
int retval;

assert(string != NULL);
#ifdef _BAT16
printf(string);
#endif
#ifdef _QWIN
/* If QWIN system is not used, stdout is not supported. */
if (!_qwinused)
return(EOF);
#endif

length = strlen(string);
buffing = _stbuf(stream);

ndone = fwrite(string,1,length,stream);

if (ndone == length) {
putc('\n',stream);
retval = 0; /* success */
}
else
retval = EOF; /* error */

_ftbuf(buffing, stream);

return(retval);
}


  3 Responses to “Category : C++ Source Code
Archive   : VCCRT2.ZIP
Filename : PUTS.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/