diff --git a/include/decl.h b/include/decl.h index 35e99bb77..984d3f097 100644 --- a/include/decl.h +++ b/include/decl.h @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)decl.h 3.5 2004/11/22 */ +/* SCCS Id: @(#)decl.h 3.5 2005/11/19 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -203,7 +203,6 @@ E const char *nomovemsg; E const char nul[]; E char lock[]; -E const char sdir[], ndir[]; E const schar xdir[], ydir[], zdir[]; E NEARDATA schar tbx, tby; /* set in mthrowu.c */ diff --git a/include/extern.h b/include/extern.h index 6d9f63840..cbca118d0 100644 --- a/include/extern.h +++ b/include/extern.h @@ -183,6 +183,7 @@ E void FDECL(savech, (CHAR_P)); #ifdef WIZARD E void NDECL(add_debug_extended_commands); #endif /* WIZARD */ +E void FDECL(reset_commands, (BOOLEAN_P)); E void FDECL(rhack, (char *)); E int NDECL(doextlist); E int NDECL(extcmd_via_menu); diff --git a/include/flag.h b/include/flag.h index f690cdbca..4d738c01a 100644 --- a/include/flag.h +++ b/include/flag.h @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)flag.h 3.5 2003/11/09 */ +/* SCCS Id: @(#)flag.h 3.5 2005/11/19 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -307,4 +307,34 @@ extern NEARDATA struct instance_flags iflags; #define RUN_STEP 2 /* update display every single step */ #define RUN_CRAWL 3 /* walk w/ extra delay after each update */ +/* command parsing, mainly dealing with number_pad handling; + not saved and restored */ + +#ifdef NHSTDC +/* forward declaration sufficient to declare pointers */ +struct func_tab; /* from func_tab.h */ +#endif + +/* commands[] is used to directly access cmdlist[] instead of looping + through it to find the entry for a given input character; + move_X is the character used for moving one step in direction X; + alphadirchars corresponds to old sdir, + dirchars corresponds to ``iflags.num_pad ? ndir : sdir''; + pcHack_compat and phone_layout only matter when num_pad is on, + swap_yz only matters when it's off */ +struct cmd { + unsigned serialno; /* incremented after each update */ + boolean num_pad; /* same as iflags.num_pad except during updates */ + boolean pcHack_compat; /* for numpad: affects 5, M-5, and M-0 */ + boolean phone_layout; /* inverted keypad: 1,2,3 above, 7,8,9 below */ + boolean swap_yz; /* German keyboads; use z to move NW, y to zap */ + char move_W, move_NW, move_N, move_NE, + move_E, move_SE, move_S, move_SW; + const char *dirchars; /* current movement/direction characters */ + const char *alphadirchars; /* same as dirchars if !numpad */ + const struct func_tab *commands[256]; /* indexed by input character */ +}; + +extern NEARDATA struct cmd Cmd; + #endif /* FLAG_H */