2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: termget.c /main/3 1995/10/31 12:03:12 rswiston $ */
26 #include <sys/termios.h>
33 fprintf(Ptr, "%s \n", Str);
38 int FilePtr, i, Error=0;
39 struct termios termio_orig;
41 Ptr = fopen("term.log", "a");
42 if ((FilePtr = open("/dev/tty", O_RDWR)) < 0)
43 {LogError("Could not open tty "); exit(-1);}
44 if(tcgetattr(FilePtr, &termio_orig) < 0)
45 {LogError("tcgetattr failed "); exit(-1);}
46 if (termio_orig.c_cc[VINTR] != '!')
47 {LogError("intr not set"); Error = 1;}
48 if (termio_orig.c_cc[VQUIT] != '@')
49 {LogError("quit not set"); Error = 1;}
50 if (termio_orig.c_cc[VERASE] != '#')
51 {LogError("erase not set"); Error = 1;}
52 if (termio_orig.c_cc[VKILL] != '$')
53 {LogError("kill not set"); Error = 1;}
54 if (termio_orig.c_cc[VEOF] != '%')
55 {LogError("eof not set"); Error = 1;}
56 if (termio_orig.c_cc[VEOL] != '^')
57 {LogError("eol not set"); Error = 1;}
58 if (termio_orig.c_cc[VSWTCH] != '&')
59 {LogError("swtch not set"); Error = 1;}
60 if (termio_orig.c_cc[VSTART] != '*')
61 {LogError("start not set"); Error = 1;}
62 if (termio_orig.c_cc[VSTOP] != '(')
63 {LogError("stop not set"); Error = 1;}
64 if (termio_orig.c_cc[VSUSP] != ')')
65 {LogError("susp not set"); Error = 1;}
66 if (Error == 1) LogError("Test Failed");
67 else LogError("Test Passed");