doCR() { int i; char CR, LF, c[2], getMod_Peek(); int ch; CR=13; LF=10; ra.crtColumn = 1; if (ra.outFlag) return; /* output is being s(kip)ped */ if (!ra.usingWCprotocol && !ansi_tut){ putch('\r'); putch('\n'); if (p_port) { if(biosprint(0, '\r', p_port-1) & 0x29) { doStatusLine(S_MSGS,"\07 Check Printer \07 \n\r"); p_port = 0; } if(biosprint(0, '\n', p_port-1) & 0x29) { doStatusLine(S_MSGS, "\07 Check Printer \07 \n\r"); p_port = 0; } } } scrn++; if(ra.termMore && !ra.usingWCprotocol && !pause_override){ if (scrn > ( ra.pause_at & 0x7f) ) { scrn=0; doCharPause(1); } } else if (scrn > ( ra.pause_at & 0x7f) ) scrn = 0; if (ra.haveCarrier) { if (!ra.usingWCprotocol ) { outMod('\r'); if (ra.termLF) outMod('\n'); } else { /* sendWCChar('\r'); if (ra.termLF) sendWCChar('\n'); */ _write(upld, &CR, 1); if (ra.termLF) _write(upld, &LF, 1); } } ra.prevChar = ' '; return TRUE; }
/****************************************************************************** * Dumps the string of given length, to Prt. No char in Str has special * * meaning, and even zero (NULL) chars are dumped. Every char is dumped twice. * * If however DirectPrint is non zero, string is dumped to specifed lpt port. * ******************************************************************************/ static void PutString2(FILE *Prt, int DirectPrint, char *Str, int Len) { int i; if (DirectPrint) { #ifdef __MSDOS__ for (i = 0; i < Len; i++) { biosprint(0, Str[i], DirectPrint - 1); biosprint(0, Str[i], DirectPrint - 1); } #else GIF_EXIT("Can not print directly to a printer if not MSDOS."); #endif /* __MSDOS__ */ } else for (i = 0; i < Len; i++) { fputc(Str[i], Prt); fputc(Str[i], Prt); } }
void main (void) { int status = 0; int old_status = 0; do { status = biosprint(2, 0, 0); // Read LPT1 if (status != old_status) { if (status & 1) printf ("Time-out\t"); if (status & 8) printf ("Output Error\t"); if (status & 16) printf ("Printer Selected\t"); if (status & 32) printf ("Out of Paper\t"); if (status & 64) printf ("Acknowledge\t"); if (status & 128) printf ("Printer Not Busy"); printf ("\n"); old_status = status; } } while (! kbhit()); }