#ifndef lint
static char *RCSid = "$Header: /SRX/empire/EMP/player/commands/acce.c 1.0 90/03/17 09:51:56 bailey Exp $";
#endif /* not lint */

/*
 * acce.c
 *
 * hacked from rela.c
 *
 */

#include "misc.h"
#include "var.h"
#include "nat.h"
#include "sect.h"
#include "file.h"
#include "xy.h"

#ifdef	REJECTS

/*
 * report rejection status of telegrams and treaties.
 * Optional argument reports staus from the
 * viewpoint of another country
 */
int
acce()
{
	extern	char *argp[];
	struct	natstr *natp;
	struct	natstr *np;
	natid	cn;
	natid	as;
	int	n;

	if (argp[1] == 0)
		as = cnum;
	else {
		if ((n = natarg(argp[1], "Which country? ")) <= 0) {
			pr("Bad country number\n");
			return RET_SYN;
		}
		as = (natid) n;
	}
	if ((natp = getnatp(as)) == 0) {
		pr(fmt("Bad country number %d\n", cnum));
		return RET_SYN;
	}
	pr(fmt("\t%s Acceptance Status Report\t", cname(as)));
	prdate();
#ifdef MERC
	pr(fmt("\n  Acceptance status          %5s                theirs\n",
			cnum == as ? "yours" : " his"));
	pr(fmt("                       tel trty anno loan   tel trty anno loan\n"));
#else
	pr(fmt("\n  Acceptance status            %5s           theirs\n",
			cnum == as ? "yours" : "his"));
	pr(fmt("                             tel  trty anno     tel  trty anno \n"));
#endif
	for (cn=1; cn < MAXNOC; cn++) {
		if ((np = getnatp(cn)) == 0)
			break;
		if (cn == as)
			continue;
		if ((np->nat_stat & STAT_NORM) == 0 &&
		    (np->nat_stat & STAT_SANCT) == 0)
			continue;
#ifdef MERC
		pr(fmt("%3d) %-14.14s  ", cn, cname(cn)));
#else
		pr(fmt("%3d) %-20.20s  ", cn, cname(cn)));
#endif
		pr(fmt("%-9s %s\n", rejectname(natp, cn), rejectname(np, as)));
	}
	return RET_OK;
}
#endif	REJECTS
