home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / 2MONITOR.ZIP / MPRT.C < prev    next >
C/C++ Source or Header  |  1989-09-10  |  1KB  |  42 lines

  1. /* MPRT - - Prints Mono Screen to PRN                                     */
  2. /* Written 9/89 by W. J. Morton                                           */
  3.  
  4. #define INCL_BASE
  5.  
  6. #include <string.h>
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <os2.h>
  10. #include <ctype.h>
  11.  
  12. VIOPHYSBUF     viopbBuf;                  /* Structure for physical buf   */
  13. PCH            pchScreen;
  14.  
  15. void main(int argc, char **argv)
  16.  
  17. {
  18.    register int   i;
  19.    int      row, col;
  20.    FILE     *prn;
  21.  
  22.    viopbBuf.pBuf = (PCH) 0xB0000L;
  23.    viopbBuf.cb = 4000;
  24.    VioGetPhysBuf(&viopbBuf, 0);
  25.    pchScreen = MAKEP(viopbBuf.asel[0],0);
  26.    i = 0;
  27.    prn = fopen("prn","w");                /* Open printer                 */
  28.    for(row = 1; row <= 25; ++row)
  29.       {
  30.       for (col = 1; col <= 80; ++col)
  31.          {
  32.          fputc(*(pchScreen + i), prn);    /* Put chars to printer         */
  33.          i += 2;
  34.          }
  35.       fputc('\n', prn);                   /* Newline after 80 cols        */
  36.       }
  37.    fputc('\f', prn);                      /* Formfeed at end              */
  38.    return;                                                 
  39. }
  40.  
  41.  
  42.