X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=blobdiff_plain;f=advent.h;h=4a6679ef2a1a4f804d0c6dd2b709e35bfda51de3;hp=ff62476379a7f16dda8212109ef28a52cbc02cb5;hb=deb61e3dcd060dac685feb71aa21e52165fd8691;hpb=c84d37091899d4bfcd747dd4afd182d81c3720b3 diff --git a/advent.h b/advent.h index ff62476..4a6679e 100644 --- a/advent.h +++ b/advent.h @@ -77,7 +77,7 @@ struct game_t { extern struct game_t game; -extern long LNLENG, LNPOSN, PARMS[]; +extern long LNLENG, LNPOSN; extern char rawbuf[LINESIZE], INLINE[LINESIZE + 1]; extern const char ascii_to_advent[]; extern const char advent_to_ascii[]; @@ -90,13 +90,14 @@ extern bool oldstyle, editline, prompt; extern void* xmalloc(size_t size); extern char* xstrdup(const char*); extern void packed_to_token(long, char token[]); -extern void speak(const char*); +extern void token_to_packed(char token[], long*); +extern void vspeak(const char*, va_list); extern bool wordeq(token_t, token_t); extern bool wordempty(token_t); extern void wordclear(token_t *); -extern void PSPEAK(vocab_t, int); -extern void RSPEAK(vocab_t); -extern void SETPRM(long, long, long); +extern void speak(const char*, ...); +extern void pspeak(vocab_t, int, ...); +extern void rspeak(vocab_t, ...); extern bool GETIN(FILE *, token_t*, token_t*, token_t*, token_t*); extern void echo_input(FILE*, char*, char*); extern char* get_input(void); @@ -180,8 +181,16 @@ extern long AMBER, ATTACK, AXE, BACK, BATTERY, BEAR, enum speechpart {unknown, intransitive, transitive}; +struct command_t { + enum speechpart part; + vocab_t verb; + vocab_t obj; + token_t wd1, wd1x; + token_t wd2, wd2x; +}; + void initialise(void); -int action(FILE *input, enum speechpart part, token_t verb, token_t obj); +int action(FILE *input, struct command_t *command); /* Phase codes for action returns. * These were at one time FORTRAN line numbers.