xref: /minix/external/bsd/tmux/dist/compat/cfmakeraw.c (revision 0a6a1f1d)
1 /* Id */
2 
3 /*
4  * Copyright (c) 2013 Dagobert Michelsen
5  * Copyright (c) 2013 Nicholas Marriott <nicm@users.sourceforge.net>
6  *
7  * Permission to use, copy, modify, and distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
16  * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
17  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #include <string.h>
21 
22 #include "tmux.h"
23 
24 void
cfmakeraw(struct termios * tio)25 cfmakeraw(struct termios *tio)
26 {
27 	tio->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
28 	tio->c_oflag &= ~OPOST;
29 	tio->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
30 	tio->c_cflag &= ~(CSIZE|PARENB);
31 	tio->c_cflag |= CS8;
32 }
33