diff -c -N frotz-2.32/Makefile frotz-2.32+sz/Makefile
*** frotz-2.32/Makefile Fri Oct 17 22:11:10 1997
--- frotz-2.32+sz/Makefile Fri Nov 27 02:17:14 1998
***************
*** 33,38 ****
--- 33,40 ----
# than curses.h.
#
# These defines add various cosmetic features to the interpreter:
+ # -DSTRICTZ: Do stricter error checking. Adapted from Andrew
+ # Plotkin's zip_zstrict_patch.
# -DCOLOR_SUPPORT: If the terminal you're using has color support, frotz
# will use the curses color routines...if your curses
# library supports color.
***************
*** 42,48 ****
# to define it--it can't hurt anything--but you do
# have that option.
#
! #DEFS = -DUSE_GETOPT_H -DCOLOR_SUPPORT -DEMACS_EDITING
DEFS =
# This should point to the location of your curses or ncurses include file
--- 44,50 ----
# to define it--it can't hurt anything--but you do
# have that option.
#
! #DEFS = -DUSE_GETOPT_H -DSTRICTZ -DCOLOR_SUPPORT -DEMACS_EDITING
DEFS =
# This should point to the location of your curses or ncurses include file
***************
*** 62,70 ****
# Nothing under this line should need to be changed.
+ #ifdef STRICTZ
+
+ /* Definitions for STRICTZ functions and error codes. */
+
+ extern int strictz_report_mode;
+
+ void init_strictz (void);
+ void report_strictz_error (int, const char *);
+
+ /* Error codes */
+ #define STRZERR_NO_ERROR (0)
+ #define STRZERR_JIN (1)
+ #define STRZERR_GET_CHILD (2)
+ #define STRZERR_GET_PARENT (3)
+ #define STRZERR_GET_SIBLING (4)
+ #define STRZERR_GET_PROP_ADDR (5)
+ #define STRZERR_GET_PROP (6)
+ #define STRZERR_PUT_PROP (7)
+ #define STRZERR_CLEAR_ATTR (8)
+ #define STRZERR_SET_ATTR (9)
+ #define STRZERR_TEST_ATTR (10)
+ #define STRZERR_MOVE_OBJECT (11)
+ #define STRZERR_MOVE_OBJECT_2 (12)
+ #define STRZERR_REMOVE_OBJECT (13)
+ #define STRZERR_GET_NEXT_PROP (14)
+ #define STRICTZ_NUM_ERRORS (15)
+
+ /* There are four error reporting modes: never report errors;
+ report only the first time a given error type occurs; report
+ every time an error occurs; or treat all errors as fatal
+ errors, killing the interpreter. I strongly recommend
+ "report once" as the default. But you can compile in a
+ different default by changing the definition of
+ STRICTZ_DEFAULT_REPORT_MODE. In any case, the player can
+ specify a report mode on the command line by typing "-Z 0"
+ through "-Z 3". */
+
+ #define STRICTZ_REPORT_NEVER (0)
+ #define STRICTZ_REPORT_ONCE (1)
+ #define STRICTZ_REPORT_ALWAYS (2)
+ #define STRICTZ_REPORT_FATAL (3)
+
+ #define STRICTZ_DEFAULT_REPORT_MODE STRICTZ_REPORT_ONCE
+
+ #endif /* STRICTZ */
+
/*** Various global functions ***/
+ #ifdef STRICTZ
+ if (zargs[0] == 0) {
+ report_strictz_error (STRZERR_GET_NEXT_PROP,
+ "@get_next_prop called with object 0");
+ store (0);
+ return;
+ }
+ #endif
+
/* Property id is in bottom five (six) bits */
+ #ifdef STRICTZ
+ if (zargs[0] == 0) {
+ report_strictz_error (STRZERR_GET_PROP,
+ "@get_prop called with object 0");
+ store (0);
+ return;
+ }
+ #endif
+
/* Property id is in bottom five (six) bits */
+ #ifdef STRICTZ
+ if (zargs[0] == 0) {
+ report_strictz_error (STRZERR_PUT_PROP,
+ "@put_prop called with object 0");
+ return;
+ }
+ #endif
+
/* Property id is in bottom five or six bits */