X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Futil.c;h=e8b221acba01c78783b1e7a5bfcdf7546f99eede;hb=82aed0c41cd917fdf9cdb20db788fe9da0662eba;hp=ba1e30946584a627019b4166e4a0b1f4065fad6b;hpb=4145f7369d761b32a10309a2623d98e64de7f444;p=sympathy.git diff --git a/src/util.c b/src/util.c index ba1e309..e8b221a 100644 --- a/src/util.c +++ b/src/util.c @@ -10,6 +10,9 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.5 2008/02/24 00:42:53 james + * *** empty log message *** + * * Revision 1.4 2008/02/23 13:05:58 staffcvs * *** empty log message *** * @@ -78,17 +81,15 @@ set_blocking (int fd) fcntl (fd, F_SETFL, arg); } + + void -raw_termios (struct termios *termios) +default_termios (struct termios *termios) { - - termios->c_iflag = 0; -/*ICRNL | IXON;*/ + termios->c_iflag = PARMRK | INPCK; termios->c_oflag = NL0 | CR0 | TAB0 | BS0 | VT0 | FF0; termios->c_lflag = 0; -/* - ISIG | ICANON | IEXTEN | ECHO | ECHOE | ECHOK | ECHOCTL | ECHOKE; -*/ + termios->c_cflag = CS8 | CREAD | CLOCAL; termios->c_cc[VINTR] = 003; termios->c_cc[VQUIT] = 034; @@ -105,19 +106,36 @@ raw_termios (struct termios *termios) termios->c_cc[VREPRINT] = 022; termios->c_cc[VDISCARD] = 017; + } void -default_termios (struct termios *termios) +client_termios (struct termios *termios) { + memset (termios, 0, sizeof (termios)); -// memset (termios, 0, sizeof (termios)); + termios->c_iflag = ICRNL | IXON | PARMRK | INPCK; + termios->c_oflag = OPOST | ONLCR | NL0 | CR0 | TAB0 | BS0 | VT0 | FF0; + termios->c_lflag = + ISIG | ICANON | IEXTEN | ECHO | ECHOE | ECHOK | ECHOCTL | ECHOKE; + termios->c_cflag = CS8 | CREAD | CLOCAL; - raw_termios (termios); + termios->c_cc[VINTR] = 003; + termios->c_cc[VQUIT] = 034; + termios->c_cc[VERASE] = 0177; + termios->c_cc[VKILL] = 025; + termios->c_cc[VEOF] = 004; + termios->c_cc[VEOL] = 0; + termios->c_cc[VEOL2] = 0; + termios->c_cc[VSTART] = 021; + termios->c_cc[VSTOP] = 023; + termios->c_cc[VSUSP] = 032; + termios->c_cc[VLNEXT] = 026; + termios->c_cc[VWERASE] = 027; + termios->c_cc[VREPRINT] = 022; + termios->c_cc[VDISCARD] = 017; - termios->c_cflag = CS8 | CREAD | CLOCAL; - termios->c_iflag |= PARMRK | INPCK; - //cfsetispeed (termios, B9600); - //cfsetospeed (termios, B9600); + cfsetispeed (termios, B9600); + cfsetospeed (termios, B9600); }