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