]> andersk Git - moira.git/blobdiff - clients/moira/menu.c
randomized continuation lines
[moira.git] / clients / moira / menu.c
index 965bc5a9d946d187975360be6f13dbdde4fa2dfb..6c0ae53fc23bd50f5487ded3723adb36e37b8573 100644 (file)
@@ -25,16 +25,19 @@ static char rcsid_menu_c[] = "$Header$";
 #include <mit-copyright.h>
 #include <sys/types.h>
 #include <stdio.h>
+#include <string.h>
 #include <signal.h>
 #include <curses.h>
-#ifdef _AUX_SOURCE
-#include <sys/termio.h>
-#include <sys/ttychars.h>
-#endif /* _AUX_SOURCE */
+#ifdef POSIX
+#include <unistd.h>
+#include <termios.h>
+#endif /* POSIX */
 #include <ctype.h>
-#include <strings.h>
+#ifndef sun
 #include <varargs.h>
+#endif
 #include <com_err.h>
+#include <moira.h>
 #include "menu.h"
 
 #ifndef __STDC__
@@ -49,13 +52,19 @@ static char rcsid_menu_c[] = "$Header$";
 
 extern int interrupt;          /* will be set if ^C is received */
 extern FILE *fdopen();
+#ifndef sgi
 extern int getpid();
+#endif
 extern char *calloc();
 extern char *whoami;
 
 FILE *log_file = (FILE *) NULL;                /* file stream of log file */
 int more_flg = 1;
 
+#ifdef POSIX
+extern char *malloc();
+#endif
+
 /* Structure for holding current displayed menu */
 struct menu_screen {
     WINDOW *ms_screen;         /* Window for this menu */
@@ -159,7 +168,6 @@ make_ms(length)
     int length;
 {
     struct menu_screen *ms;
-    char *malloc();
 
     if (MAX_TITLE + length + MIN_INPUT > LINES) {
        fputs("Menu too big!\n", stderr);
@@ -595,20 +603,20 @@ int Password_input(prompt, buf, buflen)
        }
     }
     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;
        }
@@ -626,7 +634,7 @@ int Password_input(prompt, buf, buflen)
        }
        putchar('\n');
        (void) ioctl(0, TIOCSETP, (char *)&ttybuf);
-#endif /* _AUX_SOURCE */
+#endif /* POSIX */
        Start_paging();
        return 1;
     }
This page took 0.04857 seconds and 4 git commands to generate.