home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / compat / termios / cfmakraw.c next >
Encoding:
C/C++ Source or Header  |  1996-09-15  |  674 b   |  31 lines

  1. #include <errno.h>
  2. #include <stddef.h>
  3. #include <termios.h>
  4. #include <sys/exceptn.h>
  5.  
  6. void
  7. cfmakeraw (struct termios *termiosp)
  8. {
  9.   /* check arguments */
  10.   if (termiosp == NULL)
  11.     {
  12.       errno = EINVAL;
  13.       return;
  14.     }
  15.  
  16.   /* disable ^C */
  17.   __djgpp_set_ctrl_c (0);
  18.  
  19.   /* clear flags */
  20.   termiosp->c_iflag &= ~(BRKINT|ICRNL|IGNBRK|IGNCR|INLCR|ISTRIP|PARMRK|IXON);
  21. #if defined (IMAXBEL)
  22.   termiosp->c_iflag &= ~IMAXBEL;
  23. #endif
  24.   termiosp->c_oflag &= ~OPOST;
  25.   termiosp->c_lflag &= ~(ECHONL|ICANON|IEXTEN|ISIG);
  26.   termiosp->c_cflag &= ~(CSIZE|PARENB);
  27.   termiosp->c_cflag |= CS8;
  28.   termiosp->c_cc[VMIN] = 1;
  29.   termiosp->c_cc[VTIME] = 0;
  30. }
  31.