3 ** Unix system-dependant routines for editline library.
7 #if defined(HAVE_TCGETATTR)
14 static struct termios old
;
18 (void)tcgetattr(0, &old
);
19 rl_erase
= old
.c_cc
[VERASE
];
20 rl_kill
= old
.c_cc
[VKILL
];
21 rl_eof
= old
.c_cc
[VEOF
];
22 rl_intr
= old
.c_cc
[VINTR
];
23 rl_quit
= old
.c_cc
[VQUIT
];
26 new.c_lflag
&= ~(ECHO
| ICANON
| ISIG
| IEXTEN
);
27 new.c_iflag
&= ~(ICRNL
);
30 (void)tcsetattr(0, TCSADRAIN
, &new);
33 (void)tcsetattr(0, TCSADRAIN
, &old
);
37 #if defined(HAVE_TERMIO)
44 static struct termio old
;
48 (void)ioctl(0, TCGETA
, &old
);
49 rl_erase
= old
.c_cc
[VERASE
];
50 rl_kill
= old
.c_cc
[VKILL
];
51 rl_eof
= old
.c_cc
[VEOF
];
52 rl_intr
= old
.c_cc
[VINTR
];
53 rl_quit
= old
.c_cc
[VQUIT
];
58 new.c_lflag
&= ~(ECHO
| ICANON
);
61 (void)ioctl(0, TCSETAW
, &new);
64 (void)ioctl(0, TCSETAW
, &old
);
74 static struct sgttyb old_sgttyb
;
75 static struct tchars old_tchars
;
76 struct sgttyb new_sgttyb
;
77 struct tchars new_tchars
;
80 (void)ioctl(0, TIOCGETP
, &old_sgttyb
);
81 rl_erase
= old_sgttyb
.sg_erase
;
82 rl_kill
= old_sgttyb
.sg_kill
;
84 (void)ioctl(0, TIOCGETC
, &old_tchars
);
85 rl_eof
= old_tchars
.t_eofc
;
86 rl_intr
= old_tchars
.t_intrc
;
87 rl_quit
= old_tchars
.t_quitc
;
89 new_sgttyb
= old_sgttyb
;
90 new_sgttyb
.sg_flags
&= ~ECHO
;
91 new_sgttyb
.sg_flags
|= RAW
;
92 (void)ioctl(0, TIOCSETP
, &new_sgttyb
);
94 new_tchars
= old_tchars
;
95 new_tchars
.t_intrc
= -1;
96 new_tchars
.t_quitc
= -1;
97 (void)ioctl(0, TIOCSETC
, &new_tchars
);
100 (void)ioctl(0, TIOCSETP
, &old_sgttyb
);
101 (void)ioctl(0, TIOCSETC
, &old_tchars
);
104 #endif /* defined(HAVE_TERMIO) */
105 #endif /* defined(HAVE_TCGETATTR) */
108 rl_add_slash(path
, p
)
114 if (stat(path
, &Sb
) >= 0)
115 (void)strcat(p
, S_ISDIR(Sb
.st_mode
) ? "/" : " ");
119 * $PchId: sysunix.c,v 1.4 1996/02/22 21:16:56 philip Exp $