]> git.pond.sub.org Git - empserver/commitdiff
contact: Rename getcontact() to in_contact()
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 23 Oct 2016 16:45:27 +0000 (18:45 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 18:09:20 +0000 (20:09 +0200)
The next commit will create a contact file, and the macro to get a
contact entry will be named getcontact().  Rename the existing
getcontact() out of the way.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
include/nat.h
src/lib/commands/decl.c
src/lib/commands/news.c
src/lib/commands/rela.c
src/lib/commands/repo.c
src/lib/common/nat.c
src/lib/common/nstreval.c
src/lib/subs/natarg.c
src/lib/update/nat.c

index 3a4e021be7395ced12a9f29611affb7f7d17d93c..955ce95c1cd88be0245b75a0fe1fa5a11edf491f 100644 (file)
@@ -168,7 +168,7 @@ extern char *natstate(struct natstr *np);
 extern int getrel(struct natstr *np, natid them);
 extern int relations_with(natid, natid);
 extern int getrejects(natid them, struct natstr *np);
-extern int getcontact(struct natstr *np, natid them);
+extern int in_contact(struct natstr *np, natid them);
 extern void putrel(struct natstr *np, natid them, int relate);
 extern void putreject(struct natstr *np, natid them, int how, int what);
 extern void agecontact(struct natstr *np);
index 80436c8892149d1125dd0dc5a754955bd05192cf..5eeda4f927f9700a8bc45fc1d39c82d4fb7c6926 100644 (file)
@@ -87,7 +87,7 @@ decl(void)
        if (who == (natid)ni.cur)
            continue;
        if (opt_HIDDEN) {
-           if (!player->god && !getcontact(natp, ni.cur)) {
+           if (!player->god && !in_contact(natp, ni.cur)) {
                pr("You haven't contacted country #%d yet\n", ni.cur);
                continue;
            }
index 35ba3e8ce933c21691bbeacc6baf6e1e94a8fc49..53adfb7ee5c28c6cf54ae7c3f71b3520ba7cd7b0 100644 (file)
@@ -103,8 +103,8 @@ news(void)
                nws.nws_ntm = 1;
            if (opt_HIDDEN) {
                if (!player->god &&
-                   !(getcontact(getnatp(player->cnum), nws.nws_ano) &&
-                     getcontact(getnatp(player->cnum), nws.nws_vno)))
+                   !(in_contact(getnatp(player->cnum), nws.nws_ano) &&
+                     in_contact(getnatp(player->cnum), nws.nws_vno)))
                    continue;
            }
            page_has_news[rpt[nws.nws_vrb].r_newspage] = 1;
index 5b485d2d5efde1d17bc879be151d9efdf49caa75..da73d6419993608fe1be92cf9f1eb729d3ed2ea3 100644 (file)
@@ -69,9 +69,9 @@ rela(void)
        if (np->nat_stat < STAT_SANCT)
            continue;
        if (opt_HIDDEN) {
-           if (!player->god && !getcontact(natp, cn))
+           if (!player->god && !in_contact(natp, cn))
                continue;
-           if (!player->god && !getcontact(getnatp(player->cnum), cn))
+           if (!player->god && !in_contact(getnatp(player->cnum), cn))
                continue;
        }
        pr("%3d) %-20.20s  ", cn, cname(cn));
index 2be2e2412b55548b089bc34cc5387395266dcffb..1c73fd43ed17dd56158688625a92b73c98148e5e 100644 (file)
@@ -58,7 +58,7 @@ repo(void)
        if (nat.nat_stat == STAT_UNUSED)
            continue;
        if (opt_HIDDEN) {
-           if (!player->god && !getcontact(natp, ni.cur))
+           if (!player->god && !in_contact(natp, ni.cur))
                continue;
        }
        if (!player->god && nat.nat_stat != STAT_ACTIVE)
index f5372e785c027f0438967f79be93b5a32d57b54d..ebdcef98e1c03ee06a1b79a4b415c2975940178d 100644 (file)
@@ -108,7 +108,7 @@ agecontact(struct natstr *np)
 }
 
 int
-getcontact(struct natstr *np, natid them)
+in_contact(struct natstr *np, natid them)
 {
     return np->nat_contact[them];
 }
index 0cc5b49b7948f427bf697cf8f9958376f54ec7de..e5820947e6e51dc5dfa087085b6bbaf0b239259b 100644 (file)
@@ -184,7 +184,7 @@ nstr_eval(struct valstr *val, natid cnum, void *ptr, enum nsc_type want)
                break;
            natp = getnatp(cnum);
            if (natp->nat_stat != STAT_GOD
-               && !(getcontact(natp, idx) && getcontact(ptr, idx)))
+               && !(in_contact(natp, idx) && in_contact(ptr, idx)))
                val->val_as.lng = -1;
        }
        break;
index c53dff7d4b267b2ecf8b7a8064b58791bbdfcdc1..48f4bcf6ce48cc882e35cfcc1d82a4223edca1d9 100644 (file)
@@ -95,7 +95,8 @@ natarg(char *arg, char *prompt)
     if (!np)
        return -1;
     if (opt_HIDDEN) {
-       if (!player->god && !getcontact(getnatp(player->cnum), np->nat_cnum)) {
+       if (!player->god
+           && !in_contact(getnatp(player->cnum), np->nat_cnum)) {
            if (np->nat_stat != STAT_GOD) {
                pr("Country '%s' has not been contacted.\n", arg);
                return -1;
index dcec39ee26cc0ba3aff3ccf3e733cc54de3c296e..ad3607a84f86bf9f3c3c1302183ba43657fc112e 100644 (file)
@@ -252,7 +252,7 @@ share_incr(double res[], double tech[])
            if (other->nat_stat != STAT_ACTIVE)
                continue;
            if (opt_HIDDEN) {
-               if (!getcontact(np, j))
+               if (!in_contact(np, j))
                    continue;
            }