home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / linux / 15838 < prev    next >
Encoding:
Text File  |  1992-11-07  |  2.4 KB  |  69 lines

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sdd.hp.com!hp-cv!ogicse!news.u.washington.edu!serval!hlu
  2. From: hlu@eecs.wsu.edu (H.J. Lu)
  3. Newsgroups: comp.os.linux
  4. Subject: Re: 'cfmakeraw' library call?
  5. Message-ID: <1992Nov6.043307.28508@serval.net.wsu.edu>
  6. Date: 6 Nov 92 04:33:07 GMT
  7. Article-I.D.: serval.1992Nov6.043307.28508
  8. References: <Bx9t0y.Gr1@ns1.nodak.edu>
  9. Sender: news@serval.net.wsu.edu (USENET News System)
  10. Organization: School of EECS, Washington State University
  11. Lines: 56
  12.  
  13. In article <Bx9t0y.Gr1@ns1.nodak.edu>, grosen@isc.cs.ndsu.nodak.edu (Johannes Grosen) writes:
  14. |> 
  15. |> I've been wanting to have 'script' on my machine for some time
  16. |> and decided to snarf the sources from the 4.3bsd-reno distribution.
  17. |> There were no problems except for a call to a function 'cfmakeraw'
  18. |> which I have never heard of before. From it's name and where it's
  19. |> called I would assume it puts a terminal in raw mode but I hate
  20. |> to 'ass-u-me' anything. Has anyone heard of this function? Can
  21. |> anyone confirm my assumptions?
  22. |> 
  23.  
  24. It is in 4.2 :-). Please do check if that works or not.
  25.  
  26.  
  27. |> Thanks!
  28. |> -- 
  29. |> Johannes Grosen
  30. |> ISC System Administrator
  31. |> grosen@isc.cs.ndsu.NoDak.edu
  32.  
  33.  
  34. H.J.
  35. -------
  36. /* Copyright (C) 1992 Free Software Foundation, Inc.
  37. This file is part of the GNU C Library.
  38.  
  39. The GNU C Library is free software; you can redistribute it and/or
  40. modify it under the terms of the GNU Library General Public License as
  41. published by the Free Software Foundation; either version 2 of the
  42. License, or (at your option) any later version.
  43.  
  44. The GNU C Library is distributed in the hope that it will be useful,
  45. but WITHOUT ANY WARRANTY; without even the implied warranty of
  46. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  47. Library General Public License for more details.
  48.  
  49. You should have received a copy of the GNU Library General Public
  50. License along with the GNU C Library; see the file COPYING.LIB.  If
  51. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  52. Cambridge, MA 02139, USA.  */
  53.  
  54. #include <ansidecl.h>
  55. #include <termios.h>
  56.  
  57. /* Set *T to indicate raw mode.  */
  58. void
  59. DEFUN(cfmakeraw, (t), struct termios *t)
  60. {
  61.   t->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
  62.   t->c_oflag &= ~OPOST;
  63.   t->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
  64.   t->c_cflag &= ~(CSIZE|PARENB);
  65.   t->c_cflag |= CS8;
  66.   t->c_cc[VMIN] = 0;
  67.   /* t->c_cc[VTIME] = ?; */
  68. }
  69.