summaryrefslogtreecommitdiffstats
path: root/larn
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2008-02-03 20:11:04 +0000
committerdholland <dholland@NetBSD.org>2008-02-03 20:11:04 +0000
commitccda27626c3c6cd1976164c34418d0fd2f920b62 (patch)
treefbb1346b8cce7bc477e94eef43ec6b43d99bb70b /larn
parent476d2b8cf076c51c8aa05419833b24369b8ee286 (diff)
downloadbsdgames-darwin-ccda27626c3c6cd1976164c34418d0fd2f920b62.tar.gz
bsdgames-darwin-ccda27626c3c6cd1976164c34418d0fd2f920b62.tar.zst
bsdgames-darwin-ccda27626c3c6cd1976164c34418d0fd2f920b62.zip
Larn does not need its own private versions of functions from <ctype.h>.
Also, remove the function gettokstr(), which is not used. From larn 12.2.
Diffstat (limited to 'larn')
-rw-r--r--larn/data.c54
-rw-r--r--larn/extern.h3
-rw-r--r--larn/global.c29
-rw-r--r--larn/header.h12
-rw-r--r--larn/io.c5
-rw-r--r--larn/monster.c5
-rw-r--r--larn/tok.c5
7 files changed, 17 insertions, 96 deletions
diff --git a/larn/data.c b/larn/data.c
index a62eaf5c..4f359940 100644
--- a/larn/data.c
+++ b/larn/data.c
@@ -1,4 +1,4 @@
-/* $NetBSD: data.c,v 1.12 2008/01/28 05:38:53 dholland Exp $ */
+/* $NetBSD: data.c,v 1.13 2008/02/03 20:11:04 dholland Exp $ */
/*-
* Copyright (c) 1988 The Regents of the University of California.
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)data.c 5.3 (Berkeley) 5/13/91";
#else
-__RCSID("$NetBSD: data.c,v 1.12 2008/01/28 05:38:53 dholland Exp $");
+__RCSID("$NetBSD: data.c,v 1.13 2008/02/03 20:11:04 dholland Exp $");
#endif
#endif /* not lint */
@@ -623,56 +623,6 @@ const char *spelmes[] = {"",
/* 16 */ "the %s loves the water!"
};
-u_char to_lower[] = /* tolower[character] = lower case converted
- * character */
-{
- 0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007, 0010, 0011, 0012, 0013, 0014, 0015, 0016, 0017, /* NUL-SI */
- 0020, 0021, 0022, 0023, 0024, 0025, 0026, 0027, 0030, 0031, 0032, 0033, 0034, 0035, 0036, 0037, /* DLE-US */
- 0040, 0041, 0042, 0043, 0044, 0045, 0046, 0047, 0050, 0051, 0052, 0053, 0054, 0055, 0056, 0057, /* SP-/ */
- 0060, 0061, 0062, 0063, 0064, 0065, 0066, 0067, 0070, 0071, 0072, 0073, 0074, 0075, 0076, 0077, /* 0-? */
- 0100, 0141, 0142, 0143, 0144, 0145, 0146, 0147, 0150, 0151, 0152, 0153, 0154, 0155, 0156, 0157, /* @-O */
- 0160, 0161, 0162, 0163, 0164, 0165, 0166, 0167, 0170, 0171, 0172, 0133, 0134, 0135, 0136, 0137, /* P-_ */
- 0140, 0141, 0142, 0143, 0144, 0145, 0146, 0147, 0150, 0151, 0152, 0153, 0154, 0155, 0156, 0157, /* `-o */
- 0160, 0161, 0162, 0163, 0164, 0165, 0166, 0167, 0170, 0171, 0172, 0173, 0174, 0175, 0176, 0177, /* p-DEL */
-};
-
-u_char to_upper[] = /* toupper[character] = upper case converted
- * character */
-{
- 0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007, 0010, 0011, 0012, 0013, 0014, 0015, 0016, 0017, /* NUL-SI */
- 0020, 0021, 0022, 0023, 0024, 0025, 0026, 0027, 0030, 0031, 0032, 0033, 0034, 0035, 0036, 0037, /* DLE-US */
- 0040, 0041, 0042, 0043, 0044, 0045, 0046, 0047, 0050, 0051, 0052, 0053, 0054, 0055, 0056, 0057, /* SP-/ */
- 0060, 0061, 0062, 0063, 0064, 0065, 0066, 0067, 0070, 0071, 0072, 0073, 0074, 0075, 0076, 0077, /* 0-? */
- 0100, 0101, 0102, 0103, 0104, 0105, 0106, 0107, 0110, 0111, 0112, 0113, 0114, 0115, 0116, 0117, /* @-O */
- 0120, 0121, 0122, 0123, 0124, 0125, 0126, 0127, 0130, 0131, 0132, 0133, 0134, 0135, 0136, 0137, /* P-_ */
- 0140, 0101, 0102, 0103, 0104, 0105, 0106, 0107, 0110, 0111, 0112, 0113, 0114, 0115, 0116, 0117, /* `-o */
- 0120, 0121, 0122, 0123, 0124, 0125, 0126, 0127, 0130, 0131, 0132, 0173, 0174, 0175, 0176, 0177, /* p-DEL */
-};
-
-u_char is_digit[] = /* isdigit[character] = TRUE || FALSE */
-{
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* NUL-SI */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* DLE-US */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* SP-/ */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, /* 0-? */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* @-O */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* P-_ */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* `-o */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* p-DEL */
-};
-
-u_char is_alpha[] = /* isalpha[character] = TRUE || FALSE */
-{
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* NUL-SI */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* DLE-US */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* SP-/ */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0-? */
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* @-O */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* P-_ */
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* `-o */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* p-DEL */
-};
-
/*
* function to create scroll numbers with appropriate probability of
* occurrence
diff --git a/larn/extern.h b/larn/extern.h
index 71cad280..9b342a45 100644
--- a/larn/extern.h
+++ b/larn/extern.h
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.8 2008/02/03 19:20:41 dholland Exp $ */
+/* $NetBSD: extern.h,v 1.9 2008/02/03 20:11:04 dholland Exp $ */
/*
* Copyright (c) 1997 Christos Zoulas. All rights reserved.
@@ -95,7 +95,6 @@ int stealsomething(void);
int emptyhanded(void);
void creategem(void);
void adjustcvalues(int, int);
-void gettokstr(char *);
int getpassword(void);
int getyn(void);
int packweight(void);
diff --git a/larn/global.c b/larn/global.c
index 28d24b5a..82e1ef44 100644
--- a/larn/global.c
+++ b/larn/global.c
@@ -1,4 +1,4 @@
-/* $NetBSD: global.c,v 1.9 2008/01/28 05:38:53 dholland Exp $ */
+/* $NetBSD: global.c,v 1.10 2008/02/03 20:11:05 dholland Exp $ */
/*
* global.c Larn is copyrighted 1986 by Noah Morgan.
@@ -23,7 +23,7 @@
*/
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: global.c,v 1.9 2008/01/28 05:38:53 dholland Exp $");
+__RCSID("$NetBSD: global.c,v 1.10 2008/02/03 20:11:05 dholland Exp $");
#endif /* not lint */
#include <string.h>
@@ -794,31 +794,6 @@ adjustcvalues(int theitem, int arg)
}
/*
- function to read a string from token input "string"
- returns a pointer to the string
- */
-void
-gettokstr(str)
- char *str;
-{
- int i, j;
- i = 50;
- while ((lgetchar() != '"') && (--i > 0));
- i = 36;
- while (--i > 0) {
- if ((j = lgetchar()) != '"')
- *str++ = j;
- else
- i = 0;
- }
- *str = 0;
- i = 50;
- if (j != '"')
- /* if end due to too long, then find closing quote */
- while ((lgetchar() != '"') && (--i > 0));
-}
-
-/*
function to ask user for a password (no echo)
returns 1 if entered correctly, 0 if not
*/
diff --git a/larn/header.h b/larn/header.h
index ad69b217..70627425 100644
--- a/larn/header.h
+++ b/larn/header.h
@@ -1,4 +1,4 @@
-/* $NetBSD: header.h,v 1.20 2008/02/03 20:01:24 dholland Exp $ */
+/* $NetBSD: header.h,v 1.21 2008/02/03 20:11:05 dholland Exp $ */
/* header.h Larn is copyrighted 1986 by Noah Morgan. */
@@ -337,7 +337,7 @@ extern u_char course[];
extern char diagfile[], helpfile[], ckpfile[], larnlevels[],
playerids[], optsfile[1024], psname[], savefilename[],
scorefile[];
-extern u_char *inbuffer, is_alpha[], is_digit[];
+extern u_char *inbuffer;
extern u_char item[MAXX][MAXY], iven[], know[MAXX][MAXY];
extern const char *levelname[];
extern char logfile[], loginname[], logname[], lastmonst[];
@@ -356,7 +356,7 @@ extern u_char screen[MAXX][MAXY], sex;
extern const char *speldescript[];
extern const char *scrollhide[], *scrollname[];
extern u_char spelknow[];
-extern u_char splev[], stealth[MAXX][MAXY], to_lower[], to_upper[], wizard;
+extern u_char splev[], stealth[MAXX][MAXY], wizard;
extern short diroffx[], diroffy[], hitflag, hit2flag, hit3flag, hitp[MAXX][MAXY];
extern short iarg[MAXX][MAXY], ivenarg[], lasthx, lasthy, lastnum, lastpx,
lastpy;
@@ -441,10 +441,4 @@ extern int rmst, lasttime;
/* macros for miscellaneous data conversion */
#define min(x,y) (((x)>(y))?(y):(x))
#define max(x,y) (((x)>(y))?(x):(y))
-#define isalpha(x) (is_alpha[x])
-#define isdigit(x) (is_digit[x])
-#define tolower(x) (to_lower[x])
-#define toupper(x) (to_upper[x])
-#define lcc(x) (to_lower[x])
-#define ucc(x) (to_upper[x])
#endif /* NODEFS */
diff --git a/larn/io.c b/larn/io.c
index c6f41522..36e950cd 100644
--- a/larn/io.c
+++ b/larn/io.c
@@ -1,4 +1,4 @@
-/* $NetBSD: io.c,v 1.21 2008/02/03 19:20:41 dholland Exp $ */
+/* $NetBSD: io.c,v 1.22 2008/02/03 20:11:05 dholland Exp $ */
/*
* io.c Larn is copyrighted 1986 by Noah Morgan.
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: io.c,v 1.21 2008/02/03 19:20:41 dholland Exp $");
+__RCSID("$NetBSD: io.c,v 1.22 2008/02/03 20:11:05 dholland Exp $");
#endif /* not lint */
#include "header.h"
@@ -74,6 +74,7 @@ __RCSID("$NetBSD: io.c,v 1.21 2008/02/03 19:20:41 dholland Exp $");
#include <termcap.h>
#include <fcntl.h>
#include <errno.h>
+#include <ctype.h>
#ifdef TERMIO
#include <termio.h>
diff --git a/larn/monster.c b/larn/monster.c
index 2b691569..00f01163 100644
--- a/larn/monster.c
+++ b/larn/monster.c
@@ -1,4 +1,4 @@
-/* $NetBSD: monster.c,v 1.14 2008/02/03 19:20:42 dholland Exp $ */
+/* $NetBSD: monster.c,v 1.15 2008/02/03 20:11:05 dholland Exp $ */
/*
* monster.c Larn is copyrighted 1986 by Noah Morgan.
@@ -100,11 +100,12 @@
*/
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: monster.c,v 1.14 2008/02/03 19:20:42 dholland Exp $");
+__RCSID("$NetBSD: monster.c,v 1.15 2008/02/03 20:11:05 dholland Exp $");
#endif /* not lint */
#include <string.h>
#include <stdlib.h>
+#include <ctype.h>
#include "header.h"
#include "extern.h"
diff --git a/larn/tok.c b/larn/tok.c
index 13512eb7..6ca1f672 100644
--- a/larn/tok.c
+++ b/larn/tok.c
@@ -1,9 +1,9 @@
-/* $NetBSD: tok.c,v 1.8 2008/02/03 20:01:24 dholland Exp $ */
+/* $NetBSD: tok.c,v 1.9 2008/02/03 20:11:05 dholland Exp $ */
/* tok.c Larn is copyrighted 1986 by Noah Morgan. */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: tok.c,v 1.8 2008/02/03 20:01:24 dholland Exp $");
+__RCSID("$NetBSD: tok.c,v 1.9 2008/02/03 20:11:05 dholland Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -12,6 +12,7 @@ __RCSID("$NetBSD: tok.c,v 1.8 2008/02/03 20:01:24 dholland Exp $");
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
+#include <ctype.h>
#include "header.h"
#include "extern.h"