GLK: ALAN2: Remove all prototype ifdef blocks

This commit is contained in:
Paul Gilbert 2019-06-20 22:20:59 -07:00
parent ad1cecaeac
commit 8f75589971
28 changed files with 246 additions and 1690 deletions

View File

@ -54,17 +54,7 @@ BPTR cd;
namespace Glk {
namespace Alan2 {
#ifdef _PROTOTYPES_
static void switches(
unsigned argc,
char *argv[]
)
#else
static void switches(argc, argv)
unsigned argc;
char *argv[];
#endif
{
static void switches(unsigned argc, char *argv[]) {
#ifndef GLK
uint i;
@ -173,18 +163,7 @@ wb_parse(void)
#endif
#endif
#ifdef _PROTOTYPES_
void args(
int argc,
char * argv[]
)
#else
void args(argc, argv)
int argc;
char *argv[];
#endif
{
void args(int argc, char * argv[]) {
char *prgnam;
#ifdef __mac__

View File

@ -38,11 +38,7 @@ namespace Alan2 {
#define PROGNAME "alan2"
#endif
#ifdef _PROTOTYPES_
extern void args(int argc, char *argv[]);
#else
extern void args();
#endif
} // End of namespace Alan2
} // End of namespace Glk

View File

@ -45,15 +45,7 @@
namespace Glk {
namespace Alan2 {
#ifdef _PROTOTYPES_
static void showatrs(
Aword atradr
)
#else
static void showatrs(atradr)
Aword atradr;
#endif
{
static void showatrs(Aword atradr) {
AtrElem *at;
int i;
char str[80];
@ -71,13 +63,7 @@ static void showatrs(atradr)
}
}
#ifdef _PROTOTYPES_
static void showobjs(void)
#else
static void showobjs()
#endif
{
static void showobjs() {
char str[80];
int obj;
@ -89,16 +75,7 @@ static void showobjs()
}
}
#ifdef _PROTOTYPES_
static void showobj(
int obj
)
#else
static void showobj(obj)
int obj;
#endif
{
static void showobj(int obj) {
char str[80];
#define OBJ (obj-OBJMIN)
@ -138,13 +115,7 @@ static void showobj(obj)
#undef OBJ
}
#ifdef _PROTOTYPES_
static void showcnts(void)
#else
static void showcnts()
#endif
{
static void showcnts() {
char str[80];
int cnt;
#define CNT (cnt-CNTMIN)
@ -162,16 +133,7 @@ static void showcnts()
#undef CNT
}
#ifdef _PROTOTYPES_
static void showcnt(
int cnt
)
#else
static void showcnt(cnt)
int cnt;
#endif
{
static void showcnt(int cnt) {
char str[80];
int i;
Abool found = FALSE;
@ -211,13 +173,7 @@ static void showcnt(cnt)
#undef CNT
}
#ifdef _PROTOTYPES_
static void showlocs(void)
#else
static void showlocs()
#endif
{
static void showlocs() {
char str[80];
int loc;
@ -229,16 +185,7 @@ static void showlocs()
}
}
#ifdef _PROTOTYPES_
static void showloc(
int loc
)
#else
static void showloc(loc)
int loc;
#endif
{
static void showloc(int loc) {
char str[80];
@ -256,13 +203,7 @@ static void showloc(loc)
showatrs(locs[loc-LOCMIN].atrs);
}
#ifdef _PROTOTYPES_
static void showacts(void)
#else
static void showacts()
#endif
{
static void showacts() {
char str[80];
int act;
@ -274,16 +215,7 @@ static void showacts()
}
}
#ifdef _PROTOTYPES_
static void showact(
int act
)
#else
static void showact(act)
int act;
#endif
{
static void showact(int act) {
char str[80];
Boolean oldstp;
@ -318,13 +250,7 @@ static void showact(act)
showatrs(acts[act-ACTMIN].atrs);
}
#ifdef _PROTOTYPES_
static void showevts(void)
#else
static void showevts()
#endif
{
static void showevts() {
int evt, i;
char str[80];
Boolean scheduled;
@ -353,37 +279,21 @@ static void showevts()
static Boolean trc, stp;
static int loc;
#ifdef _PROTOTYPES_
void saveInfo(void)
#else
void saveInfo()
#endif
{
void saveInfo() {
/* Save some important things */
trc = trcflg; trcflg = FALSE;
stp = stpflg; stpflg = FALSE;
loc = cur.loc; cur.loc = where(HERO);
}
#ifdef _PROTOTYPES_
void restoreInfo(void)
#else
void restoreInfo()
#endif
{
void restoreInfo() {
/* Restore! */
trcflg = trc;
stpflg = stp;
cur.loc = loc;
}
#ifdef _PROTOTYPES_
void debug(void)
#else
void debug()
#endif
{
void debug() {
char buf[256];
char c;
int i;
@ -483,13 +393,7 @@ void debug()
shown to the player.
*/
#ifdef _PROTOTYPES_
void debugsay(int item)
#else
void debugsay(item)
int item;
#endif
{
void debugsay(int item) {
saveInfo();
needsp = FALSE;
col = 1;

View File

@ -28,18 +28,10 @@
namespace Glk {
namespace Alan2 {
#ifdef _PROTOTYPES_
extern void saveInfo(void);
extern void restoreInfo(void);
extern void debug(void);
extern void debugsay(int item);
#else
extern void saveInfo();
extern void restoreInfo();
extern void debug();
extern void debugsay();
#endif
extern void debugsay(int item);
} // End of namespace Alan2
} // End of namespace Glk

View File

@ -32,13 +32,7 @@ static int decodeBuffer; /* Bits to be input */
static int bitsToGo; /* Bits still in buffer */
static int garbageBits; /* Bits past EOF */
#ifdef _PROTOTYPES_
static int inputBit(void)
#else
static int inputBit()
#endif
{
static int inputBit() {
int bit;
if (!bitsToGo) { /* More bits available ? */
@ -63,12 +57,7 @@ static CodeValue value; /* Currently seen code value */
static CodeValue low, high; /* Current code region */
#ifdef _PROTOTYPES_
void startDecoding(void)
#else
void startDecoding()
#endif
{
void startDecoding() {
int i;
bitsToGo = 0;
@ -81,13 +70,7 @@ void startDecoding()
high = TOPVALUE;
}
#ifdef _PROTOTYPES_
int decodeChar(void)
#else
int decodeChar()
#endif
{
int decodeChar() {
long range;
int f;
int symbol;
@ -144,12 +127,7 @@ typedef struct DecodeInfo {
restore and continue later.
*/
#ifdef _PROTOTYPES_
void *pushDecode(void)
#else
void *pushDecode()
#endif
{
void *pushDecode() {
DecodeInfo *info;
info = (DecodeInfo *) allocate(sizeof(DecodeInfo));
@ -171,13 +149,7 @@ void *pushDecode()
continue after having decoded something else.
*/
#ifdef _PROTOTYPES_
void popDecode(void *i)
#else
void popDecode(i)
void *i;
#endif
{
void popDecode(void *i) {
DecodeInfo *info = (DecodeInfo *) i;
fseek(txtfil, info->fpos, 0);
decodeBuffer = info->buffer;

View File

@ -31,17 +31,10 @@
namespace Glk {
namespace Alan2 {
#ifdef _PROTOTYPES_
extern void startDecoding(void);
extern int decodeChar(void);
extern void *pushDecode(void);
extern void popDecode(void *info);
#else
extern void startDecoding();
extern int decodeChar();
extern void *pushDecode();
extern void popDecode();
#endif
} // End of namespace Alan2
} // End of namespace Glk

File diff suppressed because it is too large Load Diff

View File

@ -37,7 +37,6 @@ extern int etop; /* Event queue top pointer */
extern Boolean looking; /* LOOKING? flag */
extern int dscrstkp; /* Point into describe stack */
#ifdef _PROTOTYPES_
extern void sys(Aword fpos, Aword len);
extern Boolean confirm(MsgKind msgno);
extern Aptr attribute(Aword item, Aword atr);
@ -80,49 +79,6 @@ extern Aint agrcount(Aword whr);
extern Abool isHere(Aword item);
extern Abool isNear(Aword item);
#else
extern void sys();
extern Boolean confirm();
extern Aptr attribute();
extern void say();
extern void saynum();
extern void saystr();
extern Aptr strattr();
extern void setstr();
extern void getstr();
extern void print();
extern void look();
extern void make();
extern void set();
extern void incr();
extern void decr();
extern void use();
extern void describe();
extern void list();
extern void locate();
extern void empty();
extern void score();
extern void visits();
extern void schedule();
extern void cancl();
extern void quit();
extern void restart();
extern void save();
extern void restore();
extern void say();
extern void sayint();
extern Aword rnd();
extern Abool btw();
extern Aword contains()
extern Abool streq();
extern Abool in();
extern Aword where();
extern Aword agrmax();
extern Aword agrsum();
extern Abool isHere();
extern Abool isNear();
#endif
} // End of namespace Alan2
} // End of namespace Glk

View File

@ -42,15 +42,7 @@ namespace Alan2 {
static int pc;
#ifdef _PROTOTYPES_
static void if_(
Aword v
)
#else
static void if_(v)
Aword v;
#endif
{
static void if_(Aword v) {
int lev = 1;
Aword i;
@ -75,13 +67,7 @@ static void if_(v)
}
}
#ifdef _PROTOTYPES_
static void else_(void)
#else
static void else_()
#endif
{
static void else_() {
int lev = 1;
Aword i;
@ -101,25 +87,13 @@ static void else_()
}
}
#ifdef _PROTOTYPES_
static void depstart(void)
#else
static void depstart(void)
#endif
{
static void depstart() {
/* A DEPSTART was executed so skip across the redundant DEPCASE to
start at the first expression */
pc++;
}
#ifdef _PROTOTYPES_
static void swap(void)
#else
static void swap()
#endif
{
static void swap() {
Aptr v1 = pop();
Aptr v2 = pop();
@ -127,17 +101,7 @@ static void swap()
push(v2);
}
#ifdef _PROTOTYPES_
static void depexec(
Aword v
)
#else
static void depexec(v)
Aword v;
#endif
{
static void depexec(Aword v) {
int lev = 1;
Aword i;
@ -163,13 +127,7 @@ static void depexec(v)
}
}
#ifdef _PROTOTYPES_
static void depcase(void)
#else
static void depcase()
#endif
{
static void depcase() {
int lev = 1;
Aword i;
@ -192,14 +150,7 @@ static void depcase()
}
}
#ifdef _PROTOTYPES_
void interpret(Aaddr adr)
#else
void interpret(adr)
Aaddr adr;
#endif
{
void interpret(Aaddr adr) {
Aaddr oldpc;
Aword i;

View File

@ -26,11 +26,7 @@
namespace Glk {
namespace Alan2 {
#ifdef _PROTOTYPES_
extern void interpret(Aaddr adr);
#else
extern void interpret();
#endif
} // End of namespace Alan2
} // End of namespace Glk

View File

@ -131,13 +131,7 @@ Boolean skipsp = FALSE;
return buffers...
*/
#ifdef _PROTOTYPES_
void terminate(int code)
#else
void terminate(code)
int code;
#endif
{
void terminate(int code) {
#ifdef __amiga__
#ifdef AZTEC_C
#include <fcntl.h>
@ -184,12 +178,7 @@ void terminate(code)
usage()
*/
#ifdef _PROTOTYPES_
void usage(void)
#else
void usage()
#endif
{
void usage() {
printf("Usage:\n\n");
printf(" %s [<switches>] <adventure>\n\n", PROGNAME);
printf("where the possible optional switches are:\n");
@ -216,13 +205,7 @@ void usage()
Print a little text blaming the user for the system error.
*/
#ifdef _PROTOTYPES_
void syserr(const char *str)
#else
void syserr(str)
char *str;
#endif
{
void syserr(const char *str) {
#ifdef GLK
::error("%s", str);
#else
@ -261,13 +244,7 @@ of an Adventure that never was.$n$nSYSTEM ERROR: ");
Print an error message, force new player input and abort.
*/
#ifdef _PROTOTYPES_
void error(MsgKind msgno) /* IN - The error message number */
#else
void error(msgno)
MsgKind msgno; /* IN - The error message number */
#endif
{
void error(MsgKind msgno /* IN - The error message number */) {
if (msgno != MSGMAX)
prmsg(msgno);
wrds[wrdidx] = EOF; /* Force new player input */
@ -285,8 +262,7 @@ void error(msgno)
Print the the status line on the top of the screen.
*/
void statusline(void)
{
void statusline() {
#ifdef GLK
uint glkWidth;
char line[100];
@ -354,15 +330,13 @@ needsp = FALSE;
Print some text and log it if logging is on.
*/
void logprint(char str[])
{
void logprint(char str[]) {
printf(str);
if (logflg)
fprintf(logfil, "%s", str);
}
/*======================================================================
newline()
@ -370,12 +344,7 @@ void logprint(char str[])
Make a newline, but check for screen full.
*/
#ifdef _PROTOTYPES_
void newline(void)
#else
void newline()
#endif
{
void newline() {
#ifdef GLK
g_vm->glk_put_char('\n');
#else
@ -409,12 +378,7 @@ void newline()
Make a new paragraph, i.e one empty line (one or two newlines).
*/
#ifdef _PROTOTYPES_
void para(void)
#else
void para()
#endif
{
void para() {
if (col != 1)
newline();
newline();
@ -428,12 +392,7 @@ void para()
Clear the screen.
*/
#ifdef _PROTOTYPES_
void clear(void)
#else
void clear()
#endif
{
void clear() {
#ifdef GLK
g_vm->glk_window_clear(glkMainWin);
#else
@ -453,13 +412,7 @@ void clear()
Safely allocate new memory.
*/
#ifdef _PROTOTYPES_
void *allocate(unsigned long len) /* IN - Length to allocate */
#else
void *allocate(len)
unsigned long len; /* IN - Length to allocate */
#endif
{
void *allocate(unsigned long len /* IN - Length to allocate */) {
void *p = (void *)malloc((size_t)len);
if (p == NULL)
@ -476,13 +429,7 @@ void *allocate(len)
Justify a string so that it wraps at end of screen.
*/
#ifdef _PROTOTYPES_
static void just(char str[])
#else
static void just(str)
char str[];
#endif
{
static void just(char str[]) {
#ifdef GLK
logprint(str);
#else
@ -524,12 +471,7 @@ static void just(str)
Output a space if needed.
*/
#ifdef _PROTOTYPES_
static void space(void)
#else
static void space()
#endif
{
static void space() {
if (skipsp)
skipsp = FALSE;
else {
@ -542,7 +484,6 @@ static void space()
}
/*----------------------------------------------------------------------
sayparam()
@ -551,13 +492,7 @@ static void space()
them if possible.
*/
#ifdef _PROTOTYPES_
static void sayparam(int p)
#else
static void sayparam(p)
int p;
#endif
{
static void sayparam(int p) {
int i;
for (i = 0; i <= p; i++)
@ -591,15 +526,9 @@ static void sayparam(p)
T = tabulation
$ = no space needed after this
*/
#ifdef _PROTOTYPES_
static void prsym(
char *str /* IN - The string starting with '$' */
)
#else
static void prsym(str)
char *str; /* IN - The string starting with '$' */
#endif
{
char *str /* IN - The string starting with '$' */
) {
switch (toLower(str[1])) {
case 'n':
newline();
@ -671,13 +600,7 @@ static void prsym(str)
recogniced and performed.
*/
#ifdef _PROTOTYPES_
void output(char original[])
#else
void output(original)
char original[];
#endif
{
void output(char original[]) {
char ch;
char *str, *copy;
char *symptr;
@ -718,13 +641,7 @@ void output(original)
Print a message from the message table.
*/
#ifdef _PROTOTYPES_
void prmsg(MsgKind msg) /* IN - message number */
#else
void prmsg(msg)
MsgKind msg; /* IN - message number */
#endif
{
void prmsg(MsgKind msg /* IN - message number */) {
interpret(msgs[msg].stms);
}
@ -739,91 +656,41 @@ void prmsg(msg)
\*----------------------------------------------------------------------*/
/* How to know we are at end of a table */
#ifdef _PROTOTYPES_
Boolean eot(Aword *adr)
#else
Boolean eot(adr)
Aword *adr;
#endif
{
Boolean eot(Aword *adr) {
return *adr == EOF;
}
#ifdef _PROTOTYPES_
Boolean isObj(Aword x)
#else
Boolean isObj(x)
Aword x;
#endif
{
Boolean isObj(Aword x) {
return x >= OBJMIN && x <= OBJMAX;
}
#ifdef _PROTOTYPES_
Boolean isCnt(Aword x)
#else
Boolean isCnt(x)
Aword x;
#endif
{
Boolean isCnt(Aword x) {
return (x >= CNTMIN && x <= CNTMAX) ||
(isObj(x) && objs[x-OBJMIN].cont != 0) ||
(isAct(x) && acts[x-ACTMIN].cont != 0);
}
#ifdef _PROTOTYPES_
Boolean isAct(Aword x)
#else
Boolean isAct(x)
Aword x;
#endif
{
Boolean isAct(Aword x) {
return x >= ACTMIN && x <= ACTMAX;
}
#ifdef _PROTOTYPES_
Boolean isLoc(Aword x)
#else
Boolean isLoc(x)
Aword x;
#endif
{
Boolean isLoc(Aword x) {
return x >= LOCMIN && x <= LOCMAX;
}
#ifdef _PROTOTYPES_
Boolean isNum(Aword x)
#else
Boolean isNum(x)
Aword x;
#endif
{
Boolean isNum(Aword x) {
return x >= LITMIN && x <= LITMAX && litValues[x-LITMIN].type == TYPNUM;
}
#ifdef _PROTOTYPES_
Boolean isStr(Aword x)
#else
Boolean isStr(x)
Aword x;
#endif
{
Boolean isStr(Aword x) {
return x >= LITMIN && x <= LITMAX && litValues[x-LITMIN].type == TYPSTR;
}
#ifdef _PROTOTYPES_
Boolean isLit(Aword x)
#else
Boolean isLit(x)
Aword x;
#endif
{
Boolean isLit(Aword x) {
return x >= LITMIN && x <= LITMAX;
}
/*======================================================================
exitto()
@ -831,13 +698,7 @@ Boolean isLit(x)
Is there an exit from one location to another?
*/
#ifdef _PROTOTYPES_
Boolean exitto(int to, int from)
#else
Boolean exitto(to, from)
int to, from;
#endif
{
Boolean exitto(int to, int from) {
ExtElem *ext;
if (locs[from-LOCMIN].exts == 0)
@ -849,8 +710,7 @@ Boolean exitto(to, from)
return(FALSE);
}
#ifdef CHECKOBJ
/*======================================================================
@ -898,13 +758,7 @@ void checkobj(obj)
Count the number of items in a container.
*/
#ifdef _PROTOTYPES_
static int count(int cnt) /* IN - the container to count */
#else
static int count(cnt)
int cnt; /* IN - the container to count */
#endif
{
static int count(int cnt /* IN - the container to count */) {
int i, j = 0;
for (i = OBJMIN; i <= OBJMAX; i++)
@ -915,24 +769,16 @@ static int count(cnt)
}
/*----------------------------------------------------------------------
sumatr()
Sum the values of one attribute in a container. Recursively.
*/
#ifdef _PROTOTYPES_
static int sumatr(
Aword atr, /* IN - the attribute to sum over */
Aword cnt /* IN - the container to sum */
)
#else
static int sumatr(atr, cnt)
Aword atr; /* IN - the attribute to sum over */
Aword cnt; /* IN - the container to sum */
#endif
{
) {
int i;
int sum = 0;
@ -946,25 +792,16 @@ static int sumatr(atr, cnt)
}
/*======================================================================
checklim()
Checks if a limit for a container is exceeded.
*/
#ifdef _PROTOTYPES_
Boolean checklim(
Aword cnt, /* IN - Container code */
Aword obj /* IN - The object to add */
)
#else
Boolean checklim(cnt, obj)
Aword cnt; /* IN - Container code */
Aword obj; /* IN - The object to add */
#endif
{
) {
LimElem *lim;
Aword props;
@ -999,9 +836,6 @@ Boolean checklim(cnt, obj)
}
/*----------------------------------------------------------------------*\
Action routines
@ -1016,17 +850,10 @@ Boolean checklim(cnt, obj)
Tries a check, returns TRUE if it passed, FALSE else.
*/
#ifdef _PROTOTYPES_
static Boolean trycheck(
Aaddr adr, /* IN - ACODE address to check table */
Boolean act /* IN - Act if it fails ? */
)
#else
static Boolean trycheck(adr, act)
Aaddr adr; /* IN - ACODE address to check table */
Boolean act; /* IN - Act if it fails ? */
#endif
{
) {
ChkElem *chk;
chk = (ChkElem *) addrTo(adr);
@ -1054,13 +881,7 @@ static Boolean trycheck(adr, act)
Move hero in a direction.
*/
#ifdef _PROTOTYPES_
void go(int dir)
#else
void go(dir)
int dir;
#endif
{
void go(int dir) {
ExtElem *ext;
Boolean ok;
Aword oldloc;
@ -1109,7 +930,6 @@ void go(dir)
}
/*----------------------------------------------------------------------
findalt()
@ -1118,17 +938,10 @@ void go(dir)
the address to it.
*/
#ifdef _PROTOTYPES_
static AltElem *findalt(
Aword vrbsadr, /* IN - Address to start of list */
Aword param /* IN - Which parameter to match */
)
#else
static AltElem *findalt(vrbsadr, param)
Aword vrbsadr; /* IN - Address to start of list */
Aword param; /* IN - Which parameter to match */
#endif
{
) {
VrbElem *vrb;
AltElem *alt;
@ -1146,8 +959,6 @@ static AltElem *findalt(vrbsadr, param)
}
/*======================================================================
possible()
@ -1155,12 +966,7 @@ static AltElem *findalt(vrbsadr, param)
Check if current action is possible according to the CHECKs.
*/
#ifdef _PROTOTYPES_
Boolean possible(void)
#else
Boolean possible()
#endif
{
Boolean possible() {
AltElem *alt[MAXPARAMS+2]; /* List of alt-pointers, one for each param */
int i; /* Parameter index */
@ -1197,7 +1003,6 @@ Boolean possible()
}
/*----------------------------------------------------------------------
do_it()
@ -1205,12 +1010,7 @@ Boolean possible()
Execute the action commanded by hero.
*/
#ifdef _PROTOTYPES_
static void do_it(void)
#else
static void do_it()
#endif
{
static void do_it() {
AltElem *alt[MAXPARAMS+2]; /* List of alt-pointers, one for each param */
Boolean done[MAXPARAMS+2]; /* Is it done */
int i; /* Parameter index */
@ -1339,7 +1139,6 @@ static void do_it()
}
/*======================================================================
action()
@ -1348,15 +1147,7 @@ static void do_it()
such as THEM or lists of objects.
*/
#ifdef _PROTOTYPES_
void action(
ParamElem plst[] /* IN - Plural parameter list */
)
#else
void action(plst)
ParamElem plst[];
#endif
{
void action(ParamElem plst[] /* IN - Plural parameter list */) {
int i, mpos;
char marker[10];
@ -1380,7 +1171,6 @@ void action(plst)
}
/*----------------------------------------------------------------------*\
Event Handling
@ -1395,12 +1185,7 @@ void action(plst)
Check if any events are pending. If so execute them.
*/
#ifdef _PROTOTYPES_
static void eventchk(void)
#else
static void eventchk()
#endif
{
static void eventchk() {
while (etop != 0 && eventq[etop-1].time == cur.tick) {
etop--;
if (isLoc(eventq[etop].where))
@ -1417,9 +1202,6 @@ static void eventchk()
}
/*----------------------------------------------------------------------*\
Main program and initialisation
@ -1450,13 +1232,7 @@ static char logfnm[256];
checkvers()
*/
#ifdef _PROTOTYPES_
static void checkvers(AcdHdr *header)
#else
static void checkvers(header)
AcdHdr *header;
#endif
{
static void checkvers(AcdHdr *header) {
char vers[4];
char state[2];
@ -1508,12 +1284,7 @@ static void checkvers(header)
load()
*/
#ifdef _PROTOTYPES_
static void load(void)
#else
static void load()
#endif
{
static void load() {
AcdHdr tmphdr;
Aword crc = 0;
int i;
@ -1598,12 +1369,7 @@ static void load()
checkdebug()
*/
#ifdef _PROTOTYPES_
static void checkdebug(void)
#else
static void checkdebug()
#endif
{
static void checkdebug() {
/* Make sure he can't debug if not allowed! */
if (!header->debug) {
if (dbgflg|trcflg|stpflg)
@ -1628,12 +1394,7 @@ static void checkdebug()
initheader()
*/
#ifdef _PROTOTYPES_
static void initheader(void)
#else
static void initheader()
#endif
{
static void initheader() {
dict = (WrdElem *) addrTo(header->dict);
/* Find out number of entries in dictionary */
for (dictsize = 0; !endOfTable(&dict[dictsize]); dictsize++);
@ -1658,12 +1419,7 @@ static void initheader()
initstrings()
*/
#ifdef _PROTOTYPES_
static void initstrings(void)
#else
static void initstrings()
#endif
{
static void initstrings() {
IniElem *init;
for (init = (IniElem *) addrTo(header->init); !endOfTable(init); init++) {
@ -1678,12 +1434,7 @@ static void initstrings()
start()
*/
#ifdef _PROTOTYPES_
static void start(void)
#else
static void start()
#endif
{
static void start() {
int startloc;
cur.tick = -1;
@ -1707,12 +1458,7 @@ static void start()
Initialization, program load etc.
*/
#ifdef _PROTOTYPES_
static void init(void)
#else
static void init()
#endif
{
static void init() {
int i;
/* Initialise some status */
@ -1750,12 +1496,7 @@ static void init()
Let the current actor move. If player, ask him.
*/
#ifdef _PROTOTYPES_
static void movactor(void)
#else
static void movactor()
#endif
{
static void movactor() {
ScrElem *scr;
StepElem *step;
ActElem *act = (ActElem *) &acts[cur.act-ACTMIN];
@ -1844,12 +1585,7 @@ static void movactor()
Open the necessary files.
*/
#ifdef _PROTOTYPES_
static void openFiles(void)
#else
static void openFiles()
#endif
{
static void openFiles() {
char str[256];
char *usr = "";
time_t tick;

View File

@ -97,8 +97,6 @@ extern Boolean needsp;
#define endOfTable(x) eot((Aword *) x)
#ifdef _PROTOTYPES_
extern void *allocate(unsigned long len);
extern void terminate(int code);
extern void usage(void);
@ -128,29 +126,6 @@ extern Boolean isStr(Aword x);
/* Run the game! */
extern void run(void);
#else
extern void *allocate();
extern void terminate();
extern void syserr();
extern void usage();
extern void error();
extern void output();
extern void statusline();
extern void prmsg();
extern void print();
extern void para();
extern void newline();
extern Boolean checklim();
extern Boolean possible();
extern Boolean eot();
extern Boolean isObj();
extern Boolean isCnt();
extern Boolean isAct();
extern Boolean isLoc();
extern Boolean isLit();
extern void run();
#endif
} // End of namespace Alan2
} // End of namespace Glk

View File

@ -27,13 +27,7 @@
namespace Glk {
namespace Alan2 {
#ifdef _PROTOTYPES_
void compact(ParamElem a[])
#else
void compact(a)
ParamElem a[];
#endif
{
void compact(ParamElem a[]) {
int i, j;
for (i = 0, j = 0; a[j].code != (Aword)EOF; j++)
@ -42,14 +36,7 @@ void compact(a)
a[i].code = (Aword)EOF;
}
#ifdef _PROTOTYPES_
int lstlen(ParamElem a[])
#else
int lstlen(a)
ParamElem a[];
#endif
{
int lstlen(ParamElem a[]) {
int i = 0;
while (a[i].code != (Aword)EOF)
@ -57,29 +44,14 @@ int lstlen(a)
return (i);
}
#ifdef _PROTOTYPES_
Boolean inlst(ParamElem l[], Aword e)
#else
Boolean inlst(l, e)
ParamElem l[];
Aword e;
#endif
{
Boolean inlst(ParamElem l[], Aword e) {
int i;
for (i = 0; l[i].code != (Aword)EOF && l[i].code != e; i++);
return (l[i].code == e);
}
#ifdef _PROTOTYPES_
void lstcpy(ParamElem a[], ParamElem b[])
#else
void lstcpy(a, b)
ParamElem a[], b[];
#endif
{
void lstcpy(ParamElem a[], ParamElem b[]) {
int i;
for (i = 0; b[i].code != (Aword)EOF; i++)
@ -87,14 +59,7 @@ void lstcpy(a, b)
a[i].code = (Aword)EOF;
}
#ifdef _PROTOTYPES_
void sublst(ParamElem a[], ParamElem b[])
#else
void sublst(a, b)
ParamElem a[], b[];
#endif
{
void sublst(ParamElem a[], ParamElem b[]) {
int i;
for (i = 0; a[i].code != (Aword)EOF; i++)
@ -103,14 +68,7 @@ void sublst(a, b)
compact(a);
}
#ifdef _PROTOTYPES_
void mrglst(ParamElem a[], ParamElem b[])
#else
void mrglst(a, b)
ParamElem a[], b[];
#endif
{
void mrglst(ParamElem a[], ParamElem b[]) {
int i,last;
for (last = 0; a[last].code != (Aword)EOF; last++); /* Find end of list */
@ -121,14 +79,7 @@ void mrglst(a, b)
}
}
#ifdef _PROTOTYPES_
void isect(ParamElem a[], ParamElem b[])
#else
void isect(a, b)
ParamElem a[], b[];
#endif
{
void isect(ParamElem a[], ParamElem b[]) {
int i, last = 0;
for (i = 0; a[i].code != (Aword)EOF; i++)
@ -137,15 +88,7 @@ void isect(a, b)
a[last].code = (Aword)EOF;
}
#ifdef _PROTOTYPES_
void cpyrefs(ParamElem p[], Aword r[])
#else
void cpyrefs(p, r)
ParamElem p[];
Aword r[];
#endif
{
void cpyrefs(ParamElem p[], Aword r[]) {
int i;
for (i = 0; r[i] != (Aword)EOF; i++) {

View File

@ -40,7 +40,6 @@
namespace Glk {
namespace Alan2 {
#ifdef _PROTOTYPES_
extern void compact(ParamElem *a);
extern int lstlen(ParamElem *a);
extern Boolean inlst(ParamElem *l, Aword e);
@ -49,16 +48,6 @@ extern void sublst(ParamElem *a, ParamElem *b);
extern void mrglst(ParamElem *a, ParamElem *b);
extern void isect(ParamElem *a, ParamElem *b);
extern void cpyrefs(ParamElem *p, Aword *r);
#else
extern void compact();
extern int lstlen();
extern Boolean inlst();
extern void lstcpy();
extern void sublst();
extern void mrglst();
extern void isect();
extern void cpyrefs();
#endif
} // End of namespace Alan2
} // End of namespace Glk

View File

@ -97,16 +97,7 @@ static char isobuf[LISTLEN+1]; /* The input buffer in ISO */
static Boolean eol = TRUE; /* Looking at End of line? Yes, initially */
#ifdef _PROTOTYPES_
static void unknown(
char token[]
)
#else
static void unknown(token)
char token[];
#endif
{
static void unknown(char token[]) {
char *str = (char *)allocate((int)strlen(token)+4);
str[0] = '\'';
@ -122,19 +113,10 @@ static void unknown(token)
}
static char *token;
#ifdef _PROTOTYPES_
static int lookup(
char wrd[]
)
#else
static int lookup(wrd)
char wrd[];
#endif
{
static int lookup(char wrd[]) {
int i;
for (i = 0; !endOfTable(&dict[i]); i++) {
@ -145,31 +127,14 @@ static int lookup(wrd)
return(EOF);
}
#ifdef _PROTOTYPES_
static int number(
char token[] /* IN - The string to convert to a number */
)
#else
static int number(token)
char token[]; /* IN - The string to convert to a number */
#endif
{
static int number(char token[] /* IN - The string to convert to a number */) {
int i;
sscanf(token, "%d", &i);
return i;
}
#ifdef _PROTOTYPES_
static char *gettoken(
char *buf
)
#else
static char *gettoken(buf)
char *buf;
#endif
{
static char *gettoken(char *buf) {
static char *marker;
static char oldch;
@ -196,13 +161,7 @@ static char *gettoken(buf)
return buf;
}
#ifdef _PROTOTYPES_
static void agetline(void)
#else
static void agetline()
#endif
{
static void agetline() {
para();
do {
#if defined(HAVE_ANSI) || defined(GLK)
@ -249,13 +208,7 @@ static void agetline()
lin = 1;
}
#ifdef _PROTOTYPES_
static void scan(void)
#else
static void scan()
#endif
{
static void scan() {
int i;
int w;
char *str;
@ -301,7 +254,6 @@ static void scan()
}
/*----------------------------------------------------------------------*\
PARSE DATA & PROCEDURES
@ -321,12 +273,7 @@ static void scan()
static int allLength; /* No. of objects matching 'all' */
#ifdef _PROTOTYPES_
static void nonverb(void)
#else
static void nonverb()
#endif
{
static void nonverb() {
if (isDir(wrds[wrdidx])) {
wrdidx++;
if (wrds[wrdidx] != EOF && !isConj(wrds[wrdidx]))
@ -339,16 +286,7 @@ static void nonverb()
error(M_WHAT);
}
#ifdef _PROTOTYPES_
static void buildall(
ParamElem list[]
)
#else
static void buildall(list)
ParamElem list[];
#endif
{
static void buildall(ParamElem list[]) {
int o, i = 0;
Boolean found = FALSE;
@ -364,16 +302,7 @@ static void buildall(list)
list[i].code = EOF;
}
#ifdef _PROTOTYPES_
static void unambig(
ParamElem plst[]
)
#else
static void unambig(plst)
ParamElem plst[];
#endif
{
static void unambig(ParamElem plst[]) {
int i;
Boolean found = FALSE; /* Adjective or noun found ? */
static ParamElem *refs; /* Entities referenced by word */
@ -477,16 +406,7 @@ static void unambig(plst)
}
}
#ifdef _PROTOTYPES_
static void simple(
ParamElem olst[]
)
#else
static void simple(olst)
ParamElem olst[];
#endif
{
static void simple(ParamElem olst[]) {
static ParamElem *tlst = NULL;
int savidx = wrdidx;
Boolean savplur = FALSE;
@ -543,15 +463,7 @@ static void simple(olst)
entity tables. Particularly this goes for literals...
*/
#ifdef _PROTOTYPES_
static void complex(
ParamElem olst[]
)
#else
static void complex(olst)
ParamElem olst[];
#endif
{
static void complex(ParamElem olst[]) {
static ParamElem *alst = NULL;
if (alst == NULL)
@ -576,16 +488,7 @@ static void complex(olst)
simple(olst); /* Look for simple noun group */
}
#ifdef _PROTOTYPES_
static Boolean claCheck(
ClaElem *cla /* IN - The cla elem to check */
)
#else
static Boolean claCheck(cla)
ClaElem *cla; /* IN - The cla elem to check */
#endif
{
static Boolean claCheck(ClaElem *cla /* IN - The cla elem to check */) {
Boolean ok = FALSE;
if ((cla->classes&(Aword)CLA_OBJ) != 0)
@ -614,8 +517,7 @@ static Boolean claCheck(cla)
access to remote object), we need to remove non-present parameters
*/
static void resolve(ParamElem plst[])
{
static void resolve(ParamElem plst[]) {
int i;
if (allLength > 0) return; /* ALL has already done this */
@ -630,16 +532,7 @@ static void resolve(ParamElem plst[])
}
}
#ifdef _PROTOTYPES_
static void tryMatch(
ParamElem mlst[] /* OUT - List of params allowed by multiple */
)
#else
static void tryMatch(mlst)
ParamElem mlst[]; /* OUT - List of params allowed by multiple */
#endif
{
static void tryMatch(ParamElem mlst[] /* OUT - List of params allowed by multiple */) {
ElmElem *elms; /* Pointer to element list */
StxElem *stx; /* Pointer to syntax list */
ClaElem *cla; /* Pointer to class definitions */
@ -791,16 +684,7 @@ static void tryMatch(mlst)
plural = anyPlural; /* Remember that we found plural objects */
}
#ifdef _PROTOTYPES_
static void match(
ParamElem *mlst /* OUT - List of params allowed by multiple */
)
#else
static void match(mlst)
ParamElem *mlst; /* OUT - List of params allowed by multiple */
#endif
{
static void match(ParamElem *mlst /* OUT - List of params allowed by multiple */) {
tryMatch(mlst); /* ... to understand what he said */
if (wrds[wrdidx] != EOF && !isConj(wrds[wrdidx]))
error(M_WHAT);
@ -808,13 +692,7 @@ static void match(mlst)
wrdidx++; /* If so skip the AND */
}
#ifdef _PROTOTYPES_
void parse(void)
#else
void parse()
#endif
{
void parse() {
if (mlst == NULL) { /* Allocate large enough paramlists */
mlst = (ParamElem *) allocate(sizeof(ParamElem)*(MAXENTITY+1));
mlst[0].code = EOF;

View File

@ -39,15 +39,9 @@ extern int litCount;
extern int vrbwrd;
#ifdef _PROTOTYPES_
/* Parse a new player command */
extern void parse(void);
#else
extern void parse();
#endif
} // End of namespace Alan2
} // End of namespace Glk

View File

@ -33,13 +33,8 @@ namespace Alan2 {
#define LINELENGTH 80
#define HISTORYLENGTH 20
#ifdef _PROTOTYPES_
extern Boolean readline(char usrbuf[]);
#else
extern Boolean readline();
#endif
} // End of namespace Alan2
} // End of namespace Glk

View File

@ -34,13 +34,7 @@ namespace Alan2 {
Return the reversed bytes in the Aword
*/
#ifdef _PROTOTYPES_
Aword reversed(Aword w) /* IN - The ACODE word to swap bytes of */
#else
Aword reversed(w)
Aword w; /* IN - The ACODE word to swap bytes of */
#endif
{
Aword reversed(Aword w /* IN - The ACODE word to swap bytes of */) {
Aword s; /* The swapped ACODE word */
char *wp, *sp;
int i;
@ -54,26 +48,11 @@ Aword reversed(w)
return s;
}
#ifdef _PROTOTYPES_
void reverse(Aword *w) /* IN - The ACODE word to reverse bytes in */
#else
void reverse(w)
Aword *w; /* IN - The ACODE word to reverse bytes in */
#endif
{
void reverse(Aword *w /* IN - The ACODE word to reverse bytes in */) {
*w = reversed(*w);
}
#ifdef _PROTOTYPES_
static void reverseTable(Aword adr, int len)
#else
static void reverseTable(adr, len)
Aword adr;
int len;
#endif
{
static void reverseTable(Aword adr, int len) {
Aword *e = &memory[adr];
int i;
@ -86,14 +65,7 @@ static void reverseTable(adr, len)
}
}
#ifdef _PROTOTYPES_
static void reverseStms(Aword adr)
#else
static void reverseStms(adr)
Aword adr;
#endif
{
static void reverseStms(Aword adr) {
Aword *e = &memory[adr];
if (adr != 0)
@ -104,14 +76,7 @@ static void reverseStms(adr)
}
}
#ifdef _PROTOTYPES_
static void reverseMsgs(Aword adr)
#else
static void reverseMsgs(adr)
Aword adr;
#endif
{
static void reverseMsgs(Aword adr) {
MsgElem *e = (MsgElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@ -123,14 +88,7 @@ static void reverseMsgs(adr)
}
}
#ifdef _PROTOTYPES_
static void reverseWrds(Aword adr)
#else
static void reverseWrds(adr)
Aword adr;
#endif
{
static void reverseWrds(Aword adr) {
WrdElem *e = (WrdElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@ -145,13 +103,7 @@ static void reverseWrds(adr)
}
}
#ifdef _PROTOTYPES_
static void reverseChks(Aword adr)
#else
static void reverseChks(adr)
Aword adr;
#endif
{
static void reverseChks(Aword adr) {
ChkElem *e = (ChkElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@ -164,13 +116,7 @@ static void reverseChks(adr)
}
}
#ifdef _PROTOTYPES_
static void reverseAlts(Aword adr)
#else
static void reverseAlts(adr)
Aword adr;
#endif
{
static void reverseAlts(Aword adr) {
AltElem *e = (AltElem *)&memory[adr];
if (adr != 0 && !endOfTable(e) && !e->done) {
@ -184,14 +130,7 @@ static void reverseAlts(adr)
}
}
#ifdef _PROTOTYPES_
static void reverseVrbs(Aword adr)
#else
static void reverseVrbs(adr)
Aword adr;
#endif
{
static void reverseVrbs(Aword adr) {
VrbElem *e = (VrbElem *)&memory[adr];
if (adr != 0 && !endOfTable(e)) {
@ -203,14 +142,7 @@ static void reverseVrbs(adr)
}
}
#ifdef _PROTOTYPES_
static void reverseSteps(Aword adr)
#else
static void reverseSteps(adr)
Aword adr;
#endif
{
static void reverseSteps(Aword adr) {
StepElem *e = (StepElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@ -223,14 +155,7 @@ static void reverseSteps(adr)
}
}
#ifdef _PROTOTYPES_
static void reverseScrs(Aword adr)
#else
static void reverseScrs(adr)
Aword adr;
#endif
{
static void reverseScrs(Aword adr) {
ScrElem *e = (ScrElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@ -243,14 +168,7 @@ static void reverseScrs(adr)
}
}
#ifdef _PROTOTYPES_
static void reverseActs(Aword adr)
#else
static void reverseActs(adr)
Aword adr;
#endif
{
static void reverseActs(Aword adr) {
ActElem *e = (ActElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@ -266,14 +184,7 @@ static void reverseActs(adr)
}
}
#ifdef _PROTOTYPES_
static void reverseObjs(Aword adr, Boolean v2_5)
#else
static void reverseObjs(adr, v2_5)
Aword adr;
Boolean v2_5; /* TRUE if it's a v2.5 format game */
#endif
{
static void reverseObjs(Aword adr, Boolean v2_5) {
ObjElem *e = (ObjElem *) &memory[adr];
ObjElem25 *e25 = (ObjElem25 *) &memory[adr];
@ -303,14 +214,7 @@ static void reverseObjs(adr, v2_5)
}
}
#ifdef _PROTOTYPES_
static void reverseExts(Aword adr)
#else
static void reverseExts(adr)
Aword adr;
#endif
{
static void reverseExts(Aword adr) {
ExtElem *e = (ExtElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@ -325,13 +229,7 @@ static void reverseExts(adr)
}
}
#ifdef _PROTOTYPES_
static void reverseLocs(Aword adr)
#else
static void reverseLocs(adr)
Aword adr;
#endif
{
static void reverseLocs(Aword adr) {
LocElem *e = (LocElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@ -348,14 +246,7 @@ static void reverseLocs(adr)
}
}
#ifdef _PROTOTYPES_
static void reverseClas(Aword adr)
#else
static void reverseClas(adr)
Aword adr;
#endif
{
static void reverseClas(Aword adr) {
ClaElem *e = (ClaElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@ -369,14 +260,7 @@ static void reverseClas(adr)
reverse(&((Aword *)e)[1]); /* The verb code is stored after the table */
}
#ifdef _PROTOTYPES_
static void reverseElms(Aword adr)
#else
static void reverseElms(adr)
Aword adr;
#endif
{
static void reverseElms(Aword adr) {
ElmElem *e = (ElmElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@ -389,14 +273,7 @@ static void reverseElms(adr)
}
}
#ifdef _PROTOTYPES_
static void reverseStxs(Aword adr)
#else
static void reverseStxs(adr)
Aword adr;
#endif
{
static void reverseStxs(Aword adr) {
StxElem *e = (StxElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@ -408,13 +285,7 @@ static void reverseStxs(adr)
}
}
#ifdef _PROTOTYPES_
static void reverseEvts(Aword adr)
#else
static void reverseEvts(adr)
Aword adr;
#endif
{
static void reverseEvts(Aword adr) {
EvtElem *e = (EvtElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@ -426,15 +297,7 @@ static void reverseEvts(adr)
}
}
#ifdef _PROTOTYPES_
static void reverseLims(Aword adr)
#else
static void reverseLims(adr)
Aword adr;
#endif
{
static void reverseLims(Aword adr) {
LimElem *e = (LimElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@ -446,14 +309,7 @@ static void reverseLims(adr)
}
}
#ifdef _PROTOTYPES_
static void reverseCnts(Aword adr)
#else
static void reverseCnts(adr)
Aword adr;
#endif
{
static void reverseCnts(Aword adr) {
CntElem *e = (CntElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@ -468,14 +324,7 @@ static void reverseCnts(adr)
}
}
#ifdef _PROTOTYPES_
static void reverseRuls(Aword adr)
#else
static void reverseRuls(adr)
Aword adr;
#endif
{
static void reverseRuls(Aword adr) {
RulElem *e = (RulElem *) &memory[adr];
if (adr != 0 && !endOfTable(e)) {
@ -489,7 +338,6 @@ static void reverseRuls(adr)
}
/*----------------------------------------------------------------------
reverseHdr()
@ -497,13 +345,7 @@ static void reverseRuls(adr)
Reverse the header structure.
*/
#ifdef _PROTOTYPES_
void reverseHdr(AcdHdr *hdr)
#else
void reverseHdr(hdr)
AcdHdr *hdr;
#endif
{
void reverseHdr(AcdHdr *hdr) {
int i;
/* Reverse all words in the header except the first (version marking) */
@ -520,13 +362,7 @@ void reverseHdr(hdr)
makes the .ACD files fully compatible across architectures
*/
#ifdef _PROTOTYPES_
void reverseACD(Boolean v2_5)
#else
void reverseACD(v2_5)
Boolean v2_5;
#endif
{
void reverseACD(Boolean v2_5) {
reverseHdr(header);
reverseWrds(header->dict);
reverseTable(header->oatrs, sizeof(AtrElem));

View File

@ -26,20 +26,11 @@
namespace Glk {
namespace Alan2 {
#ifdef _PROTOTYPES_
extern void reverseHdr(AcdHdr *hdr);
extern void reverseACD(Boolean v25);
extern void reverse(Aword *word);
extern Aword reversed(Aword word);
#else
extern void reverseHdr();
extern void reverseACD();
extern void reverse();
extern Aword reversed();
#endif
} // End of namespace Alan2
} // End of namespace Glk

View File

@ -36,12 +36,7 @@
namespace Glk {
namespace Alan2 {
#ifdef _PROTOTYPES_
void rules(void)
#else
void rules()
#endif
{
void rules() {
Boolean change = TRUE;
int i;

View File

@ -30,14 +30,8 @@ namespace Alan2 {
/* TYPES */
#ifdef _PROTOTYPES_
extern void rules(void);
#else
extern void rules();
#endif
} // End of namespace Alan2
} // End of namespace Glk

View File

@ -36,37 +36,19 @@ static Aptr stack[STACKSIZE];
static int stackp = 0;
#ifdef _PROTOTYPES_
void push(Aptr i)
#else
void push(i)
Aptr i;
#endif
{
void push(Aptr i) {
if (stackp == STACKSIZE)
syserr("Out of stack space.");
stack[stackp++] = i;
}
#ifdef _PROTOTYPES_
Aptr pop(void)
#else
Aptr pop()
#endif
{
Aptr pop() {
if (stackp == 0)
syserr("Stack underflow.");
return(stack[--stackp]);
}
#ifdef _PROTOTYPES_
Aptr top(void)
#else
Aptr top()
#endif
{
Aptr top() {
return(stack[stackp-1]);
}

View File

@ -30,18 +30,10 @@ namespace Alan2 {
/* TYPES */
#ifdef _PROTOTYPES_
extern Aptr pop(void);
extern void push(Aptr item);
extern Aptr top(void);
#else
extern Aptr pop();
extern void push();
extern Aptr top();
#endif
} // End of namespace Alan2
} // End of namespace Glk

View File

@ -41,9 +41,7 @@ extern void fprintf(Common::WriteStream *ws, const char *fmt, ...) {
}
#endif
#ifdef _PROTOTYPES_
extern void syserr(char str[]);
#endif
#ifdef __vms__

View File

@ -43,7 +43,6 @@ namespace Glk {
namespace Alan2 {
#define GLK
#define _PROTOTYPES_
#define __win__
#ifdef GLK
@ -136,21 +135,18 @@ extern void fprintf(Common::WriteStream *ws, const char *fmt, ...);
#endif
#ifdef __STDC__
#define _PROTOTYPES_
#include <stdlib.h>
#include <string.h>
#endif
#ifdef __vms__
/* Our VAXC doesn't define __STDC__ */
#define _PROTOTYPES_
#include <stdlib.h>
#include <string.h>
#endif
#ifdef __mac__
#define _PROTOTYPES_
#include <stdlib.h>
#include <string.h>
#include <unix.h>
@ -354,8 +350,6 @@ extern char *strdup(char *str);
#endif
#ifdef _PROTOTYPES_
/* Native character functions */
extern int isSpace(int c); /* IN - Native character to test */
extern int isLower(int c); /* IN - Native character to test */
@ -384,25 +378,6 @@ extern void fromIso(char copy[], /* OUT - Mapped string */
extern void toNative(char copy[], /* OUT - Mapped string */
char original[], /* IN - string to convert */
int charset); /* IN - current character set */
#else
extern int isSpace();
extern int isLower();
extern int isUpper();
extern int isLetter();
extern int toLower();
extern int toUpper();
extern char *strlow();
extern char *strupp();
extern int isISOLetter();
extern char toLowerCase();
extern char toUpperCase();
extern char *stringLower();
extern char *stringUpper();
extern void toIso();
extern void fromIso();
#endif
} // End of namespace Alan2
} // End of namespace Glk

View File

@ -34,12 +34,7 @@ namespace Alan2 {
from the header.
*/
#ifdef _PROTOTYPES_
void getPageSize(void)
#else
void getPageSize()
#endif
{
void getPageSize() {
#ifdef GLK
paglen = 0;
pagwidth = 0;

View File

@ -28,13 +28,7 @@
namespace Glk {
namespace Alan2 {
#ifdef _PROTOTYPES_
extern void getPageSize(void);
#else
extern void getPageSize();
#endif
} // End of namespace Alan2
} // End of namespace Glk

View File

@ -0,0 +1,45 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "glk/alan2/types.h"
namespace Glk {
namespace Alan2 {
void CurVars::synchronize(Common::Serializer &s) {
s.syncAsSint32LE(vrb);
s.syncAsSint32LE(obj);
s.syncAsSint32LE(loc);
s.syncAsSint32LE(act);
s.syncAsSint32LE(tick);
s.syncAsSint32LE(score);
s.syncAsSint32LE(visits);
}
void EvtqElem::synchronize(Common::Serializer &s) {
s.syncAsSint32LE(time);
s.syncAsSint32LE(event);
s.syncAsSint32LE(where);
};
} // End of namespace Alan2
} // End of namespace Glk