Mercurial > hg > Applications > mh
comparison sbr/getanswer.c @ 0:bce86c4163a3
Initial revision
author | kono |
---|---|
date | Mon, 18 Apr 2005 23:46:02 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:bce86c4163a3 |
---|---|
1 /* getanswer.c - get a yes/no answer from the user */ | |
2 | |
3 #include "../h/mh.h" | |
4 #include <stdio.h> | |
5 | |
6 | |
7 int getanswer (prompt) | |
8 register char *prompt; | |
9 { | |
10 static int interactive = NOTOK; | |
11 | |
12 if (interactive < OK) | |
13 interactive = isatty (fileno (stdin)) ? DONE : OK; | |
14 | |
15 return (interactive ? gans (prompt, anoyes) : DONE); | |
16 } |