From 88a48cd6ffb329191233ca2db19874a661946753 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 3 Jul 2019 11:57:19 -0700 Subject: [PATCH 1/2] makedefs dat/options TERMINFO Noticed after building a curses-only binary; configuration setting "terminal info library" is only of interest as an optional feature when the build includes tty. There were several other settings that apply to some interfaces and not others but would be listed if the feature was defined (possibly after building for an interface which supported it, then left in place when switching to another which doesn't). I left most of those with commented out conditionals in case other interfaces start supporting them. So you might still get something like "tiles file in XPM format" for a binary that doesn't support tiles if USE_XPM has been defined for some reason. --- util/makedefs.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/util/makedefs.c b/util/makedefs.c index 813b649e7..42108cc79 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 makedefs.c $NHDT-Date: 1557254354 2019/05/07 18:39:14 $ $NHDT-Branch: NetHack-3.6.2 $:$NHDT-Revision: 1.145 $ */ +/* NetHack 3.6 makedefs.c $NHDT-Date: 1562180226 2019/07/03 18:57:06 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.149 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. */ /* Copyright (c) M. Stephenson, 1990, 1991. */ @@ -1526,9 +1526,11 @@ static const char *build_opts[] = { #ifdef TEXTCOLOR "color", #endif +#ifdef TTY_GRAPHICS #ifdef TTY_TILES_ESCCODES "console escape codes for tile hinting", #endif +#endif #ifdef COM_COMPL "command line completion", #endif @@ -1653,20 +1655,25 @@ static const char *build_opts[] = { #ifdef SUSPEND "suspend command", #endif +#ifdef TTY_GRAPHICS #ifdef TERMINFO "terminal info library", #else -#if defined(TERMLIB) \ - || ((!defined(MICRO) && !defined(WIN32)) && defined(TTY_GRAPHICS)) +#if defined(TERMLIB) || (!defined(MICRO) && !defined(WIN32)) "terminal capability library", #endif #endif +#endif /*TTY_GRAPHICS*/ +/*#ifdef X11_GRAPHICS*/ #ifdef USE_XPM - "tile_file in XPM format", + "tiles file in XPM format", #endif +/*#endif*/ +/*#if (defined(QT_GRAPHICS) || defined(X11_GRAPHICS)*/ #ifdef GRAPHIC_TOMBSTONE "graphical RIP screen", #endif +/*#endif*/ #ifdef TIMED_DELAY "timed wait for display effects", #endif @@ -1719,25 +1726,25 @@ static struct win_info window_opts[] = { #ifdef X11_GRAPHICS { "X11", "X11" }, #endif -#ifdef QT_GRAPHICS +#ifdef QT_GRAPHICS /* too vague; there are multiple incompatible versions */ { "Qt", "Qt" }, #endif -#ifdef GNOME_GRAPHICS +#ifdef GNOME_GRAPHICS /* unmaintained/defunct */ { "Gnome", "Gnome" }, #endif -#ifdef MAC +#ifdef MAC /* defunct OS 9 interface */ { "mac", "Mac" }, #endif -#ifdef AMIGA_INTUITION +#ifdef AMIGA_INTUITION /* unmaintained/defunct */ { "amii", "Amiga Intuition" }, #endif -#ifdef GEM_GRAPHICS +#ifdef GEM_GRAPHICS /* defunct Atari interface */ { "Gem", "Gem" }, #endif -#ifdef MSWIN_GRAPHICS +#ifdef MSWIN_GRAPHICS /* win32 */ { "mswin", "mswin" }, #endif -#ifdef BEOS_GRAPHICS +#ifdef BEOS_GRAPHICS /* unmaintained/defunct */ { "BeOS", "BeOS InterfaceKit" }, #endif { 0, 0 } From 4a74968a5890a387d346004d8bfd08b6cadfb4c6 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 3 Jul 2019 13:43:24 -0700 Subject: [PATCH 2/2] shk doname for containers Rescue some old code from bit rot. It may be useful if the shop side of things ever gets fixed. (Itemized billing reveals container contents. I'm sure that it's in the bugzilla list but can't find it.) --- src/objnam.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/objnam.c b/src/objnam.c index 0992fb518..bb876dfd8 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 objnam.c $NHDT-Date: 1561081353 2019/06/21 01:42:33 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.244 $ */ +/* NetHack 3.6 objnam.c $NHDT-Date: 1562186589 2019/07/03 20:43:09 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.245 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2011. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1838,6 +1838,30 @@ struct obj *obj; return s; } +#if 0 /* stalled-out work in progress */ +/* Doname2() for itemized buying of 'obj' from a shop */ +char * +payDoname(obj) +struct obj *obj; +{ + static const char and_contents[] = " and its contents"; + char *p = doname(obj); + + if (Is_container(obj) && !obj->cknown) { + if (obj->unpaid) { + if ((int) strlen(p) + sizeof and_contents - 1 < BUFSZ - PREFIX) + Strcat(p, and_contents); + *p = highc(*p); + } else { + p = strprepend(p, "Contents of "); + } + } else { + *p = highc(*p); + } + return p; +} +#endif /*0*/ + /* returns "[your ]xname(obj)" or "Foobar's xname(obj)" or "the xname(obj)" */ char * yname(obj)