Category : Recently Uploaded Files
Archive   : SNIP9503.ZIP
Filename : CTRLPRNT.C

 
Output of file : CTRLPRNT.C contained in archive : SNIP9503.ZIP
/*
** Print a line of text, displaying Ctrl characters using leading carets
** public domain by Bob Stout
*/

void ctrl_print(char *line)
{
while (*line)
{
if (' ' > *line)
{
putchar('^');
putchar('@' + (*line++));
}
else putchar(*line++);
}
if (!strcmp((line - 2), "\x0d\x0a") || !strcmp((line - 2), "\x0a\x0d"))
putchar('\n');
}

#ifdef TEST

#include
#include
#include
#include

main()
{
char *p, *test = "This is a test";

for (p = strupr(test); *p; ++p)
{
if (isalpha(*p))
*p = *p - 64;
}
ctrl_print(test);
return EXIT_SUCCESS;
}

#endif /* TEST */


  3 Responses to “Category : Recently Uploaded Files
Archive   : SNIP9503.ZIP
Filename : CTRLPRNT.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/