view sbr/getanswer.c @ 12:441a2190cfae

Lion fix
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 21 Apr 2012 13:10:49 +0900
parents bce86c4163a3
children
line wrap: on
line source

/* getanswer.c - get a yes/no answer from the user */

#include "../h/mh.h"
#include <stdio.h>


int     getanswer (prompt)
register char   *prompt;
{
    static int  interactive = NOTOK;

    if (interactive < OK)
	interactive = isatty (fileno (stdin)) ? DONE : OK;

    return (interactive ? gans (prompt, anoyes) : DONE);
}