Category : C Source Code
Archive   : MIKES40C.ZIP
Filename : PRNCHK.C

 
Output of file : PRNCHK.C contained in archive : MIKES40C.ZIP
#include
#include

/*************************************************
Check printer status and flash message on screen
if not ready. User can abort by hitting Esc key
returning a -1. Routine will return a 0 when
printer has been put online and is ready.
**************************************************/
chk_printer()
{
while ((prtest()) != 0x90) { /* Check for printer error */
if (kbhit())
if ((getch()) == ESCAPE) /* Abort if escape is pressed */
return(-1);
prterr(); /* Otherwise flash error message */
}
return(0);
}


prterr() /* Error message for printer */
{
char *tscr;

tscr = malloc(4000);
getscrn(tscr, 0);
put_screen(" ", 0x4f, 28, 1,
25, 11, 0);
put_screen(" ERROR - Printer not ready! ", 0x4f, 28, 1,
25, 12, 0);
put_screen(" ESC to exit ", 0x4f, 28, 1,
25, 13, 0);

wait(2);
putscrn(tscr, 0);
free(tscr);
}


prtest() /* Test for printer status (0x90 is good) */
{
union REGS REG;

REG.h.ah = 0x2; /* Function 2 */
REG.x.dx = 0; /* First printer number */
int86(0x17, ®, ®);
return(REG.h.ah);
}




  3 Responses to “Category : C Source Code
Archive   : MIKES40C.ZIP
Filename : PRNCHK.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/