extern int nstr_coerce_val(struct valstr *, nsc_type, char *);
extern int nstr_exec(struct nscstr *, int, void *);
extern void nstr_exec_val(struct valstr *, natid, void *, nsc_type);
+extern char *symbol_by_value(int, struct symbol *);
#endif /* _NSC_H_ */
#include "file.h"
#include "nat.h"
#include "prototypes.h"
+#include "nsc.h"
struct look_list {
union {
sort_lookup_list();
}
-static char *
-lookup(int key, struct symbol *table)
-{
- int i;
-
- for (i = 0; table[i].name; i++)
- if (key == table[i].value)
- return table[i].name;
-
- return NULL;
-}
-
void
show_bridge(int tlev)
{
for (i = j = 0; i < 32; i++) {
if (!(np->n_flags & bit(i)))
continue;
- if (NULL != (p = lookup(bit(i), nuke_chr_flags))) {
+ if (NULL != (p = symbol_by_value(bit(i), nuke_chr_flags))) {
if (j++ > 0)
pr(" ");
pr(p);
for (j = n = 0; j < 32; j++) {
if (!(mp->m_flags & bit(j)))
continue;
- if (NULL != (p = lookup(bit(j), ship_chr_flags))) {
+ if (NULL != (p = symbol_by_value(bit(j), ship_chr_flags))) {
if (n++ > 0)
pr(" ");
pr(p);
for (i = n = 0; i < 32; i++) {
if (!(pp->pl_flags & bit(i)))
continue;
- if (NULL != (p = lookup(bit(i), plane_chr_flags))) {
+ if (NULL != (p = symbol_by_value(bit(i), plane_chr_flags))) {
if (n++ > 0)
pr(" ");
pr(p);
for (j = n = 0; j < 32; j++) {
if (!(lcp->l_flags & bit(j)))
continue;
- if (NULL != (p = lookup(bit(j), land_chr_flags))) {
+ if (NULL != (p = symbol_by_value(bit(j), land_chr_flags))) {
if (n++ > 0)
pr(" ");
pr(p);