diff options
author | jsm <jsm@NetBSD.org> | 2000-09-25 14:08:08 +0000 |
---|---|---|
committer | jsm <jsm@NetBSD.org> | 2000-09-25 14:08:08 +0000 |
commit | b70cf02d334c9377130caff93e07b0afbc39189a (patch) | |
tree | 671edd6f4a6f2e1e5b79cdf2660f0e111f3ba1d3 /battlestar/extern.h | |
parent | 8c9fde9e88ab1979b6e44b73721761d5a3ff5236 (diff) | |
download | bsdgames-darwin-b70cf02d334c9377130caff93e07b0afbc39189a.tar.gz bsdgames-darwin-b70cf02d334c9377130caff93e07b0afbc39189a.tar.zst bsdgames-darwin-b70cf02d334c9377130caff93e07b0afbc39189a.zip |
Add OBJ_AN flag to objflags so as to use "a" or "an" appropriately in
messages; avoids "a amulet", "a Elf". Define and use macros to use
"a", "an", "the", "is", "are" appropriately. Partly based on OpenBSD.
Diffstat (limited to 'battlestar/extern.h')
-rw-r--r-- | battlestar/extern.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/battlestar/extern.h b/battlestar/extern.h index e03cdd39..0982ec16 100644 --- a/battlestar/extern.h +++ b/battlestar/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.25 2000/09/24 14:11:09 jsm Exp $ */ +/* $NetBSD: extern.h,v 1.26 2000/09/25 14:08:08 jsm Exp $ */ /* * Copyright (c) 1983, 1993 @@ -229,6 +229,7 @@ /* Flags for objects. */ #define OBJ_PLURAL 1 +#define OBJ_AN 2 struct room { const char *name; @@ -256,6 +257,14 @@ extern const int objwt[NUMOFOBJECTS]; extern const int objcumber[NUMOFOBJECTS]; extern const int objflags[NUMOFOBJECTS]; #define is_plural_object(n) (objflags[(n)] & OBJ_PLURAL) +/* + * These macros yield words to use with objects (followed but not preceded + * by spaces, or with no spaces if the expansion is the empty string). + */ +#define A_OR_AN(n) (objflags[(n)] & OBJ_AN ? "an " : "a ") +#define A_OR_AN_OR_THE(n) (is_plural_object((n)) ? "the " : A_OR_AN((n))) +#define A_OR_AN_OR_BLANK(n) (is_plural_object((n)) ? "" : A_OR_AN((n))) +#define IS_OR_ARE(n) (is_plural_object((n)) ? "are " : "is ") /* current input line */ #define WORDLEN 15 |