9 date 92.12.15.00.20.22; author jromine; state Exp;
14 date 92.11.12.00.57.49; author jromine; state Exp;
19 date 92.10.26.22.38.03; author jromine; state Exp;
24 date 90.04.05.15.31.15; author sources; state Exp;
29 date 90.04.05.14.45.27; author sources; state Exp;
34 date 90.02.06.13.03.44; author sources; state Exp;
39 date 90.02.05.14.22.01; author sources; state Exp;
44 date 90.02.05.14.20.51; author sources; state Exp;
58 @/* getans.c - get an answer from the user and return a string array */
60 static char ident[] = "@@(#)$Id: getans.c,v 1.7 1992/11/12 00:57:49 jromine Exp jromine $";
71 static char ansbuf[BUFSIZ];
73 static int interrupted;
75 static jmp_buf sigenv;
77 static TYPESIG intrser ();
79 char **getans (prompt, ansp)
90 istat = signal (SIGINT, intrser);
92 switch (setjmp (sigenv)) {
94 istat = signal (SIGINT, intrser);
98 (void) signal (SIGINT, istat);
103 printf ("%s", prompt);
104 (void) fflush (stdout);
106 while ((i = getchar ()) != '\n') {
108 if (i == EOF || interrupted) {
110 (void) signal (SIGINT, istat);
115 longjmp (sigenv, DONE);
117 if (cp < &ansbuf[sizeof ansbuf - 1])
121 if (ansbuf[0] == '?' || cp == ansbuf) {
122 printf ("Options are:\n");
123 printsw (ALL, ansp, "");
126 cpp = brkstring (ansbuf, " ", NULLCP);
127 switch (smatch (*cpp, ansp)) {
129 ambigsw (*cpp, ansp);
132 printf (" -%s unknown. Hit <CR> for help.\n", *cpp);
135 (void) signal (SIGINT, istat);
142 static TYPESIG intrser (i)
146 (void) signal(SIGINT, intrser);
149 longjmp (sigenv, NOTOK);
162 static char ident[] = "@@(#)$Id: getans.c,v 1.6 1992/10/26 22:38:03 jromine Exp jromine $";
196 @add TYPESIG on intrser
201 static char ident[] = "@@(#)$Id: getans.c,v 1.5 1990/04/05 15:31:15 sources Exp jromine $";
204 static TYPESIG intrser () {
215 static char ident[] = "@@(#)$Id:$";
218 static int intrser ();
221 static int intrser () {
232 static char ident[] = "$Id:";