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 / ENTERPRS / CPM / UTILS / S / UZIUTILS.ARK / XDEVTTY.C < prev    next >
Text File  |  1988-12-24  |  1KB  |  71 lines

  1.  
  2. /**************************************************
  3. UZI (Unix Z80 Implementation) Utilities:  xdevtty.c
  4. ***************************************************/
  5.  
  6.  
  7. #include "unix.h"
  8. #include "extern.h"
  9.  
  10. #define LINESIZ 128
  11.  
  12. static char line[LINESIZ];
  13.  
  14. tty_read(minor, rawflag)
  15. int16 minor;
  16. int rawflag;
  17. {
  18.     int nread;
  19.  
  20.     line[0] = udata.u_count;
  21.     line[1] = 0;
  22.     bdos(10,line);  /* Read console buffer */
  23.     bdos(2,'\n');
  24.     nread = line[1];
  25.     line[nread+2] = '\n';
  26.     bcopy(line+2,udata.u_base,nread+1);
  27.     return(nread+1);
  28. }
  29.  
  30.  
  31. tty_write(minor, rawflag)
  32. int16 minor;
  33. int rawflag;
  34. {
  35.     while (udata.u_count-- != 0)
  36.     {
  37.         if (*udata.u_base=='\n')
  38.         bdos(2,'\r');
  39.         bdos(2,*udata.u_base);
  40.     ++udata.u_base;
  41.     }
  42. }
  43.  
  44.  
  45. _putc(c)
  46. int c;
  47. {
  48.     bdos(2,c);
  49. }
  50.  
  51.  
  52. tty_open(minor)
  53. int minor;
  54. {
  55.     return(0);
  56. }
  57.  
  58.  
  59. tty_close(minor)
  60. int minor;
  61. {
  62.     return(0);
  63. }
  64.  
  65.  
  66. tty_ioctl(minor)
  67. int minor;
  68. {
  69.     return(-1);
  70. }
  71.