home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / BDSC / BDSC-2 / LPRINT.C < prev    next >
Text File  |  2000-06-30  |  896b  |  47 lines

  1. /*
  2.     New functions for BDS C v1.4x: "lprintf" and "lputs"
  3.     Written 1/18/81 by Leor Zolman
  4. */
  5.  
  6. #include <bdscio.h>
  7. #define LISTDEV 2
  8.  
  9. /*
  10.     Formatted output to the list device. Usage:
  11.  
  12.     lprintf(format, arg1, arg2, ...)
  13.     char *format;
  14.  
  15.     Works just like "printf", except the output line is written
  16.     to the lineprinter instead of to the console.
  17. */
  18.  
  19. lprintf(format)
  20. char *format;
  21. {
  22.     char txtlin[MAXLINE];
  23.     _spr(txtlin,&format);
  24.     lputs(txtlin);
  25. }
  26.  
  27. /*
  28.     Put a line out to the list device. Usage:
  29.  
  30.     lputs(str)
  31.     char *str;
  32.  
  33.     Works just like "puts", except the output line goes to the
  34.     printer instead of to the console:
  35. */
  36.  
  37. lputs(str)
  38. char *str;
  39. {
  40.     char c;
  41.     while (c = *str++) {
  42.         if (c == '\n') putc('\r',LISTDEV);
  43.         putc(c,LISTDEV);
  44.     }
  45. }
  46.  
  47.