#include <stdio.h>
#include <signal.h>
#include <curses.h>
-#ifdef _AUX_SOURCE
-#include <sys/termio.h>
-#include <sys/ttychars.h>
-#endif /* _AUX_SOURCE */
+#ifdef POSIX
+#include <sys/termios.h>
+#endif /* POSIX */
#include <ctype.h>
#include <strings.h>
#ifndef sun
}
}
else {
-#ifdef _AUX_SOURCE
- struct termio ttybuf, nttybuf;
+#ifdef POSIX
+ struct termios ttybuf, nttybuf;
#else
struct sgttyb ttybuf, nttybuf;
-#endif /* _AUX_SOURCE */
+#endif /* POSIX */
printf("%s", prompt);
/* turn off echoing */
-#ifdef _AUX_SOURCE
- (void) ioctl(0, TCGETA, (char *)&ttybuf);
+#ifdef POSIX
+ tcgetattr(0, &ttybuf);
nttybuf = ttybuf;
nttybuf.c_lflag &= ~ECHO;
- (void)ioctl(0, TCSETA, (char *)&nttybuf);
+ tcsetattr(0, TCSANOW, &nttybuf);
if (gets(buf) == NULL) {
- (void) ioctl(0, TCSETA, (char *)&ttybuf);
+ tcsetattr(0, TCSANOW, &ttybuf);
putchar('\n');
return 0;
}
}
putchar('\n');
(void) ioctl(0, TIOCSETP, (char *)&ttybuf);
-#endif /* _AUX_SOURCE */
+#endif /* POSIX */
Start_paging();
return 1;
}