home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / ingres04.lzh / source / monitor / print.c < prev    next >
Encoding:
C/C++ Source or Header  |  1985-01-23  |  657 b   |  43 lines

  1. # include    "monitor.h"
  2. # include    <ingres.h>
  3. # include    <aux.h>
  4. # include    <sccs.h>
  5.  
  6. SCCSID(@(#)print.c    8.1    12/31/84)
  7.  
  8.  
  9.  
  10. /*
  11. **  PRINT QUERY BUFFER
  12. **
  13. **    The logical query buffer is printed on the terminal regardless
  14. **    of the "Nodayfile" mode.  Autoclear is reset, so the query
  15. **    may be rerun.
  16. **
  17. **    Uses trace flag 6
  18. */
  19.  
  20. print()
  21. {
  22.     FILE        *iop;
  23.     register char    c;
  24.  
  25.     /* BACK UP FILE & UPDATE LAST PAGE */
  26.     Autoclear = 0;
  27.     clrline(1);
  28.     fflush(Qryiop);
  29.     if ((iop = fopen(Qbname, "r")) == NULL)
  30.         syserr("print: open 1");
  31.  
  32.     /* list file on standard output */
  33.     Notnull = 0;
  34.     while ((c = getc(iop)) > 0)
  35.     {
  36.         putchar(c);
  37.         Notnull++;
  38.     }
  39.  
  40.     fclose(iop);
  41.     cgprompt();
  42. }
  43.