2 ** Unix system-dependant routines for editline library.
6 #if defined(HAVE_TCGETATTR)
13 static struct termios old
;
17 (void)tcgetattr(0, &old
);
18 rl_erase
= old
.c_cc
[VERASE
];
19 rl_kill
= old
.c_cc
[VKILL
];
20 rl_eof
= old
.c_cc
[VEOF
];
21 rl_intr
= old
.c_cc
[VINTR
];
22 rl_quit
= old
.c_cc
[VQUIT
];
25 new.c_lflag
&= ~(ECHO
| ICANON
| ISIG
| IEXTEN
);
26 new.c_iflag
&= ~(ICRNL
);
29 (void)tcsetattr(0, TCSADRAIN
, &new);
32 (void)tcsetattr(0, TCSADRAIN
, &old
);
36 #if defined(HAVE_TERMIO)
43 static struct termio old
;
47 (void)ioctl(0, TCGETA
, &old
);
48 rl_erase
= old
.c_cc
[VERASE
];
49 rl_kill
= old
.c_cc
[VKILL
];
50 rl_eof
= old
.c_cc
[VEOF
];
51 rl_intr
= old
.c_cc
[VINTR
];
52 rl_quit
= old
.c_cc
[VQUIT
];
57 new.c_lflag
&= ~(ECHO
| ICANON
);
60 (void)ioctl(0, TCSETAW
, &new);
63 (void)ioctl(0, TCSETAW
, &old
);
73 static struct sgttyb old_sgttyb
;
74 static struct tchars old_tchars
;
75 struct sgttyb new_sgttyb
;
76 struct tchars new_tchars
;
79 (void)ioctl(0, TIOCGETP
, &old_sgttyb
);
80 rl_erase
= old_sgttyb
.sg_erase
;
81 rl_kill
= old_sgttyb
.sg_kill
;
83 (void)ioctl(0, TIOCGETC
, &old_tchars
);
84 rl_eof
= old_tchars
.t_eofc
;
85 rl_intr
= old_tchars
.t_intrc
;
86 rl_quit
= old_tchars
.t_quitc
;
88 new_sgttyb
= old_sgttyb
;
89 new_sgttyb
.sg_flags
&= ~ECHO
;
90 new_sgttyb
.sg_flags
|= RAW
;
91 (void)ioctl(0, TIOCSETP
, &new_sgttyb
);
93 new_tchars
= old_tchars
;
94 new_tchars
.t_intrc
= -1;
95 new_tchars
.t_quitc
= -1;
96 (void)ioctl(0, TIOCSETC
, &new_tchars
);
99 (void)ioctl(0, TIOCSETP
, &old_sgttyb
);
100 (void)ioctl(0, TIOCSETC
, &old_tchars
);
103 #endif /* defined(HAVE_TERMIO) */
104 #endif /* defined(HAVE_TCGETATTR) */
107 rl_add_slash(path
, p
)
113 if (stat(path
, &Sb
) >= 0)
114 (void)strcat(p
, S_ISDIR(Sb
.st_mode
) ? "/" : " ");
118 * $PchId: sysunix.c,v 1.4 1996/02/22 21:16:56 philip Exp $