From ccda27626c3c6cd1976164c34418d0fd2f920b62 Mon Sep 17 00:00:00 2001 From: dholland Date: Sun, 3 Feb 2008 20:11:04 +0000 Subject: Larn does not need its own private versions of functions from . Also, remove the function gettokstr(), which is not used. From larn 12.2. --- larn/data.c | 54 ++---------------------------------------------------- larn/extern.h | 3 +-- larn/global.c | 29 ++--------------------------- larn/header.h | 12 +++--------- larn/io.c | 5 +++-- larn/monster.c | 5 +++-- larn/tok.c | 5 +++-- 7 files changed, 17 insertions(+), 96 deletions(-) (limited to 'larn') 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 #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 @@ -793,31 +793,6 @@ adjustcvalues(int theitem, int arg) bottomline(); } -/* - 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 #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 #include #include +#include #ifdef TERMIO #include 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 #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 #include +#include #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 #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 @@ -12,6 +12,7 @@ __RCSID("$NetBSD: tok.c,v 1.8 2008/02/03 20:01:24 dholland Exp $"); #include #include #include +#include #include "header.h" #include "extern.h" -- cgit v1.2.3-56-ge451