mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-22 18:56:38 +00:00
BDECFLAGS (with a whitespace change or two)
This commit is contained in:
parent
5ef18a82df
commit
4ca3536e6c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=65184
|
@ -88,7 +88,7 @@ struct hashtab /* hash table for vocabulary */
|
|||
struct text
|
||||
#ifdef OLDSTUFF
|
||||
{ int seekadr; /* DATFILE must be < 2**16 */
|
||||
#endif OLDSTUFF
|
||||
#endif /* !OLDSTUFF */
|
||||
{ char *seekadr; /* Msg start in virtual disk */
|
||||
int txtlen; /* length of msg starting here */
|
||||
};
|
||||
|
@ -160,59 +160,59 @@ int turns,lmwarn,iwest,knfloc,detail, /* various flags & counters */
|
|||
|
||||
int demo,limit;
|
||||
|
||||
int at(int);
|
||||
int bug(int);
|
||||
void carry(int,int);
|
||||
void caveclose(void);
|
||||
void checkhints(void);
|
||||
void ciao(void);
|
||||
void closing(void);
|
||||
unsigned long crc(const char *, int);
|
||||
void crc_start(void);
|
||||
int dark(void);
|
||||
void datime(int *, int *);
|
||||
char *decr(char,char,char,char,char);
|
||||
void die(int);
|
||||
void done(int);
|
||||
void drop(int,int);
|
||||
void dstroy(int);
|
||||
int fdwarf(void);
|
||||
int forced(int);
|
||||
void getin(char **, char **);
|
||||
int here(int);
|
||||
void init(void);
|
||||
void juggle(int);
|
||||
int liq(void);
|
||||
int liqloc(int);
|
||||
int march(void);
|
||||
void move(int,int);
|
||||
void mspeak(int);
|
||||
int pct(int);
|
||||
void poof(void);
|
||||
void pspeak(int, int);
|
||||
int put(int,int,int);
|
||||
int ran(int);
|
||||
void rdata(void);
|
||||
int restore(const char *);
|
||||
void rspeak(int);
|
||||
int save(const char *);
|
||||
int score(void);
|
||||
void speak(const struct text *);
|
||||
int Start(void);
|
||||
void startup(void);
|
||||
int toting(int);
|
||||
void trapdel(int);
|
||||
int trdrop(void);
|
||||
int trfeed(void);
|
||||
int trfill(void);
|
||||
int trkill(void);
|
||||
int tropen(void);
|
||||
int trsay(void);
|
||||
int trtake(void);
|
||||
int trtoss(void);
|
||||
int vocab(const char *,int,int);
|
||||
int yes(int,int,int);
|
||||
int yesm(int,int,int);
|
||||
int at (int objj);
|
||||
int bug (int n);
|
||||
void carry (int, int);
|
||||
void caveclose (void);
|
||||
void checkhints (void);
|
||||
void ciao (void);
|
||||
void closing (void);
|
||||
u_long crc (const char *ptr, int nr);
|
||||
void crc_start (void);
|
||||
int dark (void);
|
||||
void datime (int *d, int *t);
|
||||
char *decr (int, int, int, int, int);
|
||||
void die (int entry);
|
||||
void done (int entry);
|
||||
void drop (int object,int where);
|
||||
void dstroy (int);
|
||||
int fdwarf (void);
|
||||
int forced (int locc);
|
||||
void getin (char **wrd1, char **wrd2);
|
||||
int here (int objj);
|
||||
void init (void);
|
||||
void juggle (int);
|
||||
int liq (void);
|
||||
int liqloc (int locc);
|
||||
int march (void);
|
||||
void move (int, int);
|
||||
void mspeak (int);
|
||||
int pct (int n);
|
||||
void poof (void);
|
||||
void pspeak (int m, int skip);
|
||||
int put (int, int, int);
|
||||
int ran (int range);
|
||||
void rdata (void);
|
||||
int restore (const char *infile);
|
||||
void rspeak (int);
|
||||
int save (const char *);
|
||||
int score (void);
|
||||
void speak (const struct text *);
|
||||
int Start (void);
|
||||
void startup (void);
|
||||
int toting (int objj);
|
||||
void trapdel (int sig);
|
||||
int trdrop (void);
|
||||
int trfeed (void);
|
||||
int trfill (void);
|
||||
int trkill (void);
|
||||
int tropen (void);
|
||||
int trsay (void);
|
||||
int trtake (void);
|
||||
int trtoss (void);
|
||||
int vocab (const char *,int,int);
|
||||
int yes (int x, int y, int z);
|
||||
int yesm (int x, int y, int z);
|
||||
|
||||
/* We need to get a little tricky to avoid strings */
|
||||
#define DECR(a,b,c,d,e) decr('a'+'+','b'+'-','c'+'#','d'+'&','e'+'%')
|
||||
|
|
|
@ -68,7 +68,7 @@ init() /* everything for 1st time run */
|
|||
}
|
||||
|
||||
char *decr(a,b,c,d,e)
|
||||
char a,b,c,d,e;
|
||||
const unsigned char a,b,c,d,e;
|
||||
{
|
||||
static char buf[6];
|
||||
|
||||
|
@ -206,7 +206,9 @@ linkdata() /* secondary data manipulation */
|
|||
void
|
||||
trapdel(sig) /* come here if he hits a del */
|
||||
int sig;
|
||||
{ delhit = 1; /* main checks, treats as QUIT */
|
||||
{
|
||||
sig = 0;
|
||||
delhit = 1; /* main checks, treats as QUIT */
|
||||
signal(2,trapdel); /* catch subsequent DELs */
|
||||
}
|
||||
|
||||
|
|
|
@ -116,6 +116,7 @@ yes(x,y,z) /* confirm with rspeak */
|
|||
int x,y,z;
|
||||
{ int result;
|
||||
int ch;
|
||||
|
||||
result = FALSE;
|
||||
for (;;)
|
||||
{ rspeak(x); /* tell him what we want*/
|
||||
|
@ -140,6 +141,7 @@ yesm(x,y,z) /* confirm with mspeak */
|
|||
int x,y,z;
|
||||
{ int result;
|
||||
int ch;
|
||||
|
||||
result = FALSE;
|
||||
for (;;)
|
||||
{ mspeak(x); /* tell him what we want*/
|
||||
|
@ -342,6 +344,7 @@ rtrav() /* read travel table */
|
|||
char *s;
|
||||
char buf[12];
|
||||
int len,m,n,entries;
|
||||
|
||||
entries = 0;
|
||||
t = NULL;
|
||||
for (oldloc= -1;;) /* get another line */
|
||||
|
@ -412,16 +415,16 @@ int loq;
|
|||
}
|
||||
}
|
||||
|
||||
#endif DEBUG
|
||||
#endif /* DEBUG */
|
||||
|
||||
static void
|
||||
rvoc()
|
||||
{ char *s; /* read the vocabulary */
|
||||
int index;
|
||||
int rv_index;
|
||||
char buf[6];
|
||||
for (;;)
|
||||
{ index=rnum();
|
||||
if (index<0) break;
|
||||
{ rv_index=rnum();
|
||||
if (rv_index<0) break;
|
||||
for (s=buf,*s=0;; s++) /* get the word */
|
||||
if ((*s=next())==TAB || *s=='\n' || *s==LF
|
||||
|| *s==' ') break;
|
||||
|
@ -429,7 +432,7 @@ rvoc()
|
|||
if (*s!='\n' && *s!=LF) FLUSHLF; /* can be comments */
|
||||
*s=0;
|
||||
/* printf("\"%s\"=%d\n",buf,index);*/
|
||||
vocab(buf,-2,index);
|
||||
vocab(buf,-2,rv_index);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -523,14 +526,14 @@ int m; /* msg is the number of all the p msgs for this place */
|
|||
int skip; /* assumes object 1 doesn't have prop 1, obj 2 no prop 2 &c*/
|
||||
{
|
||||
char *s,nonfirst;
|
||||
char *numst, save;
|
||||
char *numst, ps_save;
|
||||
struct text *msg;
|
||||
char *tbuf;
|
||||
|
||||
msg = &ptext[m];
|
||||
if ((tbuf=(char *) malloc(msg->txtlen + 1)) == 0)
|
||||
errx(1, "Out of memory!");
|
||||
memcpy(tbuf, msg->seekadr, msg->txtlen + 1); /* Room to null */
|
||||
memcpy(tbuf, msg->seekadr, (u_int)msg->txtlen + 1); /* Room to null */
|
||||
s = tbuf;
|
||||
|
||||
nonfirst=0;
|
||||
|
@ -538,7 +541,7 @@ int skip; /* assumes object 1 doesn't have prop 1, obj 2 no prop 2 &c*/
|
|||
{ tape=iotape; /* restart decryption tape */
|
||||
for (numst=s; (*s^= *tape++)!=TAB; s++); /* get number */
|
||||
|
||||
save = *s; /* Temporarily trash the string (cringe) */
|
||||
ps_save = *s; /* Temporarily trash the string (cringe) */
|
||||
*s++ = 0; /* decrypting number within the string */
|
||||
|
||||
if (atoi(numst) != 100 * skip && skip >= 0)
|
||||
|
|
|
@ -53,6 +53,7 @@ static const char rcsid[] =
|
|||
/* Re-coding of advent in C: main program */
|
||||
|
||||
#include <sys/file.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
|
@ -62,9 +63,7 @@ static const char rcsid[] =
|
|||
|
||||
|
||||
int
|
||||
main(argc,argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
int rval,ll;
|
||||
|
@ -546,7 +545,7 @@ char **argv;
|
|||
rspeak(197);
|
||||
done(3);
|
||||
|
||||
case 29: /* wake */
|
||||
case 29: /* wake */
|
||||
if (obj!=dwarf||!closed) goto l2011;
|
||||
rspeak(199);
|
||||
done(3);
|
||||
|
|
|
@ -74,9 +74,7 @@ static const char rcsid[] =
|
|||
#define LINE 10 /* How many values do we get on a line? */
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
FILE *infile;
|
||||
int c, count, linestart;
|
||||
|
@ -89,7 +87,7 @@ char *argv[];
|
|||
puts(SIG1);
|
||||
puts(SIG2);
|
||||
puts(" */");
|
||||
printf("\n\nchar data_file[] =\n{");
|
||||
printf("\n\nunsigned char data_file[] =\n{");
|
||||
srandom(SEED);
|
||||
count = 0;
|
||||
linestart = YES;
|
||||
|
|
|
@ -48,7 +48,7 @@ static const char rcsid[] =
|
|||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
# include "hdr.h"
|
||||
#include "hdr.h"
|
||||
|
||||
static void badmove (void);
|
||||
static int bitset (int,int);
|
||||
|
|
|
@ -51,7 +51,8 @@ static const char rcsid[] =
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
# include "hdr.h"
|
||||
#include <sys/cdefs.h>
|
||||
#include "hdr.h"
|
||||
|
||||
static int wizard (void);
|
||||
|
||||
|
|
Loading…
Reference in a new issue