3 ** Unix system-dependant routines for editline library.
8 #if defined(HAVE_TCGETATTR)
15 static struct termios old;
19 (void)tcgetattr(0, &old);
20 rl_erase = old.c_cc[VERASE];
21 rl_kill = old.c_cc[VKILL];
22 rl_eof = old.c_cc[VEOF];
23 rl_intr = old.c_cc[VINTR];
24 rl_quit = old.c_cc[VQUIT];
29 new.c_lflag &= ~(ECHO | ICANON);
30 new.c_iflag &= ~(ISTRIP | INPCK);
33 (void)tcsetattr(0, TCSANOW, &new);
36 (void)tcsetattr(0, TCSANOW, &old);
46 static struct sgttyb old_sgttyb;
47 static struct tchars old_tchars;
48 struct sgttyb new_sgttyb;
49 struct tchars new_tchars;
52 (void)ioctl(0, TIOCGETP, &old_sgttyb);
53 rl_erase = old_sgttyb.sg_erase;
54 rl_kill = old_sgttyb.sg_kill;
56 (void)ioctl(0, TIOCGETC, &old_tchars);
57 rl_eof = old_tchars.t_eofc;
58 rl_intr = old_tchars.t_intrc;
59 rl_quit = old_tchars.t_quitc;
61 new_sgttyb = old_sgttyb;
62 new_sgttyb.sg_flags &= ~ECHO;
63 new_sgttyb.sg_flags |= RAW;
65 new_sgttyb.sg_flags |= PASS8;
66 #endif /* defined(PASS8) */
67 (void)ioctl(0, TIOCSETP, &new_sgttyb);
69 new_tchars = old_tchars;
70 new_tchars.t_intrc = -1;
71 new_tchars.t_quitc = -1;
72 (void)ioctl(0, TIOCSETC, &new_tchars);
75 (void)ioctl(0, TIOCSETP, &old_sgttyb);
76 (void)ioctl(0, TIOCSETC, &old_tchars);
79 #endif /* defined(HAVE_TCGETATTR) */
88 if (stat(path, &Sb) >= 0)
89 (void)strcat(p, S_ISDIR(Sb.st_mode) ? "/" : " ");