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