#ifndef lint
static char *RCSid = "$Header: /usr/brule/guest/empire/empire/emprcs/lib/commands/wai.c,v 2.1 1995/05/30 18:49:16 empire Exp $";
#endif /* not lint */

/*
 * wai.c
 *
 * continuously wait for telegrams & announcements; print them out when
 * you get them.
 *
 */

#include "misc.h"
#include "player.h"
#include "nat.h"
#include "file.h"
#include "io.h"

wai()
{
	struct natstr *np;

	np = getnatp(player->cnum);
	io_output(player->iop, IO_WAIT);
	if (np->nat_ann == 0 && np->nat_tgms == 0) {
		player->waiting++;
		io_input(player->iop, IO_WAIT);
		player->waiting--;
	}
	if (player->aborted || io_eof(player->iop))
		return RET_OK;
	if (np->nat_ann != 0)
		player->argp[0] = "wire";
	if (np->nat_tgms != 0)
		player->argp[0] = "read";
	return rea();
}  
