accept: rejectname() makes no sense outside acce(); inline
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
6d2244093a
commit
4877a2f024
3 changed files with 22 additions and 28 deletions
|
@ -166,7 +166,6 @@ extern double techfact(int level, double mult);
|
||||||
|
|
||||||
extern char *cname(natid n);
|
extern char *cname(natid n);
|
||||||
extern char *relatename(struct natstr *np, natid other);
|
extern char *relatename(struct natstr *np, natid other);
|
||||||
extern char *rejectname(struct natstr *np, natid other);
|
|
||||||
extern char *natstate(struct natstr *np);
|
extern char *natstate(struct natstr *np);
|
||||||
extern int getrel(struct natstr *np, natid them);
|
extern int getrel(struct natstr *np, natid them);
|
||||||
extern int relations_with(natid, natid);
|
extern int relations_with(natid, natid);
|
||||||
|
|
|
@ -42,6 +42,25 @@
|
||||||
int
|
int
|
||||||
acce(void)
|
acce(void)
|
||||||
{
|
{
|
||||||
|
static char *rejects[] = {
|
||||||
|
/* must follow reject flags defined in nat.h */
|
||||||
|
" YES YES YES YES",
|
||||||
|
" NO YES YES YES",
|
||||||
|
" YES NO YES YES",
|
||||||
|
" NO NO YES YES",
|
||||||
|
" YES YES NO YES",
|
||||||
|
" NO YES NO YES",
|
||||||
|
" YES NO NO YES",
|
||||||
|
" NO NO NO YES",
|
||||||
|
" YES YES YES NO ",
|
||||||
|
" NO YES YES NO ",
|
||||||
|
" YES NO YES NO ",
|
||||||
|
" NO NO YES NO ",
|
||||||
|
" YES YES NO NO ",
|
||||||
|
" NO YES NO NO ",
|
||||||
|
" YES NO NO NO ",
|
||||||
|
" NO NO NO NO "
|
||||||
|
};
|
||||||
struct natstr *natp;
|
struct natstr *natp;
|
||||||
struct natstr *np;
|
struct natstr *np;
|
||||||
natid cn;
|
natid cn;
|
||||||
|
@ -67,7 +86,9 @@ acce(void)
|
||||||
if (np->nat_stat == STAT_UNUSED)
|
if (np->nat_stat == STAT_UNUSED)
|
||||||
continue;
|
continue;
|
||||||
pr("%3d) %-14.14s ", cn, cname(cn));
|
pr("%3d) %-14.14s ", cn, cname(cn));
|
||||||
pr("%-9s %s\n", rejectname(natp, cn), rejectname(np, as));
|
pr("%s %s\n",
|
||||||
|
rejects[getrejects(cn, natp)],
|
||||||
|
rejects[getrejects(as, np)]);
|
||||||
}
|
}
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,32 +63,6 @@ relatename(struct natstr *np, natid other)
|
||||||
return relates[getrel(np, other)];
|
return relates[getrel(np, other)];
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
|
||||||
rejectname(struct natstr *np, natid other)
|
|
||||||
{
|
|
||||||
static char *rejects[] = {
|
|
||||||
/* must follow reject flags defined in nat.h */
|
|
||||||
" YES YES YES YES",
|
|
||||||
" NO YES YES YES",
|
|
||||||
" YES NO YES YES",
|
|
||||||
" NO NO YES YES",
|
|
||||||
" YES YES NO YES",
|
|
||||||
" NO YES NO YES",
|
|
||||||
" YES NO NO YES",
|
|
||||||
" NO NO NO YES",
|
|
||||||
" YES YES YES NO ",
|
|
||||||
" NO YES YES NO ",
|
|
||||||
" YES NO YES NO ",
|
|
||||||
" NO NO YES NO ",
|
|
||||||
" YES YES NO NO ",
|
|
||||||
" NO YES NO NO ",
|
|
||||||
" YES NO NO NO ",
|
|
||||||
" NO NO NO NO "
|
|
||||||
};
|
|
||||||
|
|
||||||
return rejects[getrejects(other, np)];
|
|
||||||
}
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
natstate(struct natstr *np)
|
natstate(struct natstr *np)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue