]> diplodocus.org Git - nmh/blob - sbr/getanswer.c
We're not using the .Bu macro anymore.
[nmh] / sbr / getanswer.c
1
2 /*
3 * getanswer.c -- get a yes/no answer from the user
4 *
5 * This code is Copyright (c) 2002, by the authors of nmh. See the
6 * COPYRIGHT file in the root directory of the nmh distribution for
7 * complete copyright information.
8 */
9
10 #include <h/mh.h>
11 #include <stdio.h>
12
13
14 int
15 getanswer (char *prompt)
16 {
17 static int interactive = -1;
18
19 if (interactive < 0)
20 interactive = isatty (fileno (stdin)) ? 1 : 0;
21
22 return (interactive ? gans (prompt, anoyes) : 1);
23 }