Category : Files from Magazines
Archive   : CUJ9411.ZIP
Filename : OSPRINT.C

 
Output of file : OSPRINT.C contained in archive : CUJ9411.ZIP
---------- Listing 4: The file osprint.c ---------------

// osprint -- ostream::_Print(const char *, ...)
#include
#include
#include
#include
#include

ostream& ostream::_Print(const char *code, ...)
{ // format data for inserter
_TRY_IO_BEGIN
if (!opfx())
setstate(badbit);
else
{ // build format and convert
char buf[_MAX_EXP_DIG + _MAX_SIG_DIG + 16];
char fmt[8];
char *s = fmt;
*s++ = '%';
if (code[0] != ' ' && flags() & showpos)
*s++ = '+';
if (code[0] == 'B' && flags() & showbase
|| code[0] == 'P' && flags() & showpoint)
*s++ = '#';
if (code[1] == '.')
*s++ = '.', *s++ = '*';
if (code[2] != ' ')
*s++ = code[2];
*s = code[3];
if (flags() & uppercase && strchr("egx", *s) != 0)
*s = toupper(*s);
*++s = '\0';
va_list ap;
va_start(ap, code);
_Pad(code, buf, vsprintf(buf, fmt, ap));
va_end(ap);
}
osfx();
_CATCH_IO_END
return (*this);
}



  3 Responses to “Category : Files from Magazines
Archive   : CUJ9411.ZIP
Filename : OSPRINT.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/