--- nethack-3.4.3.orig/debian/control +++ nethack-3.4.3/debian/control @@ -0,0 +1,131 @@ +Source: nethack +Section: games +Priority: optional +Maintainer: Debian Nethack Maintainers +Uploaders: Ben Gertzfield , Joshua Kwan +Standards-Version: 3.6.1.0 +Build-Depends: flex, bison, groff-base, debhelper (>= 4.1.16), libx11-dev, libxt-dev, libxext-dev, libxmu-dev, xutils, bsdmainutils, libxaw7-dev | libxaw-dev, libncurses5-dev | libncurses-dev, libqt3-mt-dev, libgnome-dev, dpatch, po-debconf, bdftopcf + +Package: nethack-common +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, debianutils (>= 1.12) +Recommends: nethack-console | nethack-x11 | nethack-qt | nethack-gnome +Provides: nethack +Conflicts: suidmanager (<< 0.50), nethack (<< 3.4.0), gnomehack, nethack-console (<< ${Source-Version}), nethack-x11 (<< ${Source-Version}), nethack-gnome (<< ${Source-Version}), nethack-qt (<< ${Source-Version}), nethack-lisp (<< ${Source-Version}) +Replaces: nethack (<< 3.4.0), gnomehack +Description: Common files for Nethack dungeon crawl game + The various graphical front-ends for Nethack all share a large + number of files in common. This package contains the graphics, + dungeon levels, and utilities common to all Nethack front-ends. + . + Please install one of the following Nethack front-ends if you + actually wish to play the game. Each of them includes the + original non-graphical version, and they can all be installed + at the same time. + . + * nethack-console (no graphics, just plain Nethack) + * nethack-x11 (original X11/Athena-based graphical version) + * nethack-qt (newer Qt-based graphical version) + * nethack-gnome (experimental Gnome-based graphical version) + . + There is a nethack-spoilers package available, if you're really + desperate for help. + . + A few utilities -- recover, for retrieving your auto-save files in case + of a power failure, and dgn_comp and lev_comp, two utilities for making + your own Nethack levels and dungeons, have been included in + /usr/lib/games/nethack. 'recover' will be run every time your system + boots, if there are any auto-save files available. + +Package: nethack-console +Depends: ${shlibs:Depends}, nethack-common (= ${Source-Version}) +Architecture: any +Description: Text-based overhead view D&D-style adventure game + Nethack is a wonderfully silly, yet quite addicting, Dungeons and + Dragons-style adventure game. You play the part of a fierce fighter, + wizard, or any of many other classes, fighting your way down to + retrieve the Amulet of Yendor (try saying THAT one backwards!) for + your god. On the way, you might encounter a quantum mechanic or two, + or perhaps a microscopic space fleet, or -- if you're REALLY lucky -- + the Ravenous Bugblatter Beast of Traal. + . + This package contains the plain console version of Nethack. No + graphics here! + +Package: nethack-lisp +Depends: ${shlibs:Depends}, nethack-common (= ${Source-Version}) +Suggests: nethack-el +Architecture: any +Description: Text-based overhead view D&D-style adventure game + Nethack is a wonderfully silly, yet quite addicting, Dungeons and + Dragons-style adventure game. You play the part of a fierce fighter, + wizard, or any of many other classes, fighting your way down to + retrieve the Amulet of Yendor (try saying THAT one backwards!) for + your god. On the way, you might encounter a quantum mechanic or two, + or perhaps a microscopic space fleet, or -- if you're REALLY lucky -- + the Ravenous Bugblatter Beast of Traal. + . + This package contains the Lisp window version, required + for playing Nethack under Emacs. + +Package: nethack-x11 +Depends: ${shlibs:Depends}, ${misc:Depends}, nethack-common (= ${Source-Version}), xbase-clients (>= 3.3.3.1-5) +Architecture: any +Description: Text-based/X11 overhead view D&D-style adventure game + Nethack is a wonderfully silly, yet quite addicting, Dungeons and + Dragons-style adventure game. You play the part of a fierce fighter, + wizard, or any of many other classes, fighting your way down to + retrieve the Amulet of Yendor (try saying THAT one backwards!) for + your god. On the way, you might encounter a quantum mechanic or two, + or perhaps a microscopic space fleet, or -- if you're REALLY lucky -- + the Ravenous Bugblatter Beast of Traal. + . + This package contains the text and X11/Athena-based graphical versions + of Nethack. + +Package: nethack-qt +Depends: ${shlibs:Depends}, nethack-common (= ${Source-Version}) +Architecture: any +Description: Text-based/Qt overhead view D&D-style adventure game + Nethack is a wonderfully silly, yet quite addicting, Dungeons and + Dragons-style adventure game. You play the part of a fierce fighter, + wizard, or any of many other classes, fighting your way down to + retrieve the Amulet of Yendor (try saying THAT one backwards!) for + your god. On the way, you might encounter a quantum mechanic or two, + or perhaps a microscopic space fleet, or -- if you're REALLY lucky -- + the Ravenous Bugblatter Beast of Traal. + . + This package contains the text and Qt-based graphical versions + of Nethack. + +Package: nethack-gnome +Depends: ${shlibs:Depends}, nethack-common (= ${Source-Version}) +Architecture: any +Section: gnome +Description: Text-based/Gnome overhead view D&D-style adventure game + Nethack is a wonderfully silly, yet quite addicting, Dungeons and + Dragons-style adventure game. You play the part of a fierce fighter, + wizard, or any of many other classes, fighting your way down to + retrieve the Amulet of Yendor (try saying THAT one backwards!) for + your god. On the way, you might encounter a quantum mechanic or two, + or perhaps a microscopic space fleet, or -- if you're REALLY lucky -- + the Ravenous Bugblatter Beast of Traal. + . + This package contains the text and Gnome-based graphical versions + of Nethack. + +Package: nethack +Architecture: all +Depends: nethack-common, nethack-x11 | nethack-console | nethack-gnome | nethack-lisp | nethack-qt +Description: Overhead dungeon-crawler game (dummy package) + Nethack is a wonderfully silly, yet quite addicting, Dungeons and + Dragons-style adventure game. You play the part of a fierce fighter, + wizard, or any of many other classes, fighting your way down to + retrieve the Amulet of Yendor (try saying THAT one backwards!) for + your god. On the way, you might encounter a quantum mechanic or two, + or perhaps a microscopic space fleet, or -- if you're REALLY lucky -- + the Ravenous Bugblatter Beast of Traal. + . + This package is merely a dummy package that depends on nethack-common + and nethack-x11 to facilitate upgrades. You may safely remove it + from your system. --- nethack-3.4.3.orig/debian/nethackrc.tty +++ nethack-3.4.3/debian/nethackrc.tty @@ -0,0 +1,29 @@ +# +# System-wide NetHack configuration file for tty-based NetHack. +# + +OPTIONS=windowtype:tty,toptenwin,hilite_pet,hpmon +OPTIONS=fixinv,safe_pet,sortpack,tombstone,color +OPTIONS=verbose,news,fruit:potato +OPTIONS=dogname:Slinky +OPTIONS=catname:Rex +OPTIONS=pickup_types:$ +OPTIONS=nomail + +# Enable this if you want to see your inventory sorted in alphabetical +# order by item instead of by index letter: +# OPTIONS=sortloot:full +# or if you just want containers sorted: +# OPTIONS=sortloot:loot + +# +# Some sane menucolor defaults +# + +OPTIONS=menucolors +MENUCOLOR=" blessed "=green +MENUCOLOR=" holy "=green +MENUCOLOR=" uncursed "=yellow +MENUCOLOR=" cursed "=red +MENUCOLOR=" unholy "=red +MENUCOLOR=" cursed .* (being worn)"=orange&underline --- nethack-3.4.3.orig/debian/nethack-common.links +++ nethack-3.4.3/debian/nethack-common.links @@ -0,0 +1 @@ +usr/share/doc/nethack-common/copyright usr/lib/games/nethack/license --- nethack-3.4.3.orig/debian/nethack-gnome.menu +++ nethack-3.4.3/debian/nethack-gnome.menu @@ -0,0 +1,6 @@ +?package(nethack-gnome):needs="x11" \ + command="/usr/games/nethack-gnome" \ + hints="Roguelike,Maze,Dungeon" \ + section="Games/Adventure" \ + title="GNOME NetHack" \ + icon="/usr/share/pixmaps/nethack.xpm" --- nethack-3.4.3.orig/debian/qt/nethackrc +++ nethack-3.4.3/debian/qt/nethackrc @@ -0,0 +1,33 @@ +# +# System-wide NetHack configuration file for Qt-based NetHack. +# + +OPTIONS=windowtype:Qt,toptenwin,hilite_pet,tiled_map,!ascii_map +OPTIONS=fixinv,safe_pet,sortpack,tombstone,color,!number_pad +OPTIONS=verbose,news,fruit:potato +OPTIONS=dogname:Slinky +OPTIONS=catname:Rex +OPTIONS=pickup_types:$ +OPTIONS=nomail +OPTIONS=menustyle:partial,!time,showexp +OPTIONS=msghistory:200 + +# Enable this if you want to see your inventory sorted in alphabetical +# order by item instead of by index letter: +# OPTIONS=sortloot:full +# or if you just want containers sorted: +# OPTIONS=sortloot:loot + +# Optional Qt-specific options. + +# QT_TILEWIDTH=20 +# QT_TILEHEIGHT=24 + +# These are the possible settings for QT_FONTSIZE: +# t -> tiny +# s -> small +# m -> medium +# l -> large +# h -> huge + +# QT_FONTSIZE=m --- nethack-3.4.3.orig/debian/qt/nethack-tty.sh +++ nethack-3.4.3/debian/qt/nethack-tty.sh @@ -0,0 +1,64 @@ +#!/bin/sh + +set -e + +HACKSTYLE=qt + +if [ -z "$NETHACKOPTIONS" ]; then + if [ -e $HOME/.nethackrc ]; then + NETHACKOPTIONS=$HOME/.nethackrc + export NETHACKOPTIONS + else + NETHACKOPTIONS=/etc/nethack/nethackrc.tty + export NETHACKOPTIONS + fi +fi + +HACKDIR=/usr/lib/games/nethack +export HACKDIR +HACK=$HACKDIR/nethack-$HACKSTYLE + +# see if we can find the full path name of PAGER, so help files work properly +# assume that if someone sets up a special variable (HACKPAGER) for NetHack, +# it will already be in a form acceptable to NetHack +# ideas from brian@radio.astro.utoronto.ca +if test \( "xxx$PAGER" != xxx \) -a \( "xxx$HACKPAGER" = xxx \) +then + + HACKPAGER=$PAGER + +# use only the first word of the pager variable +# this prevents problems when looking for file names with trailing +# options, but also makes the options unavailable for later use from +# NetHack + for i in $HACKPAGER + do + HACKPAGER=$i + break + done + + if test ! -f $HACKPAGER + then + IFS=: + for i in $PATH + do + if test -f $i/$HACKPAGER + then + HACKPAGER=$i/$HACKPAGER + export HACKPAGER + break + fi + done + IFS=' ' + fi + if test ! -f $HACKPAGER + then + echo Cannot find $PAGER -- unsetting PAGER. + unset HACKPAGER + unset PAGER + fi +fi + +cd $HACKDIR + +exec $HACK "$@" $ARGS --- nethack-3.4.3.orig/debian/qt/nethack.sh +++ nethack-3.4.3/debian/qt/nethack.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +set -e + +HACKSTYLE=qt + +if [ -z "$NETHACKOPTIONS" ]; then + if [ -e $HOME/.nethackrc.$HACKSTYLE ]; then + NETHACKOPTIONS=$HOME/.nethackrc.$HACKSTYLE + export NETHACKOPTIONS + elif [ -e $HOME/.nethackrc ]; then + NETHACKOPTIONS=$HOME/.nethackrc + export NETHACKOPTIONS + else + NETHACKOPTIONS=/etc/nethack/nethackrc.$HACKSTYLE + export NETHACKOPTIONS + fi +fi + +HACKDIR=/usr/lib/games/nethack +export HACKDIR +HACK=$HACKDIR/nethack-$HACKSTYLE + +cd $HACKDIR + +export OVERRIDEWIN=$HACKSTYLE + +exec $HACK "$@" $ARGS --- nethack-3.4.3.orig/debian/nethack-common.postinst +++ nethack-3.4.3/debian/nethack-common.postinst @@ -0,0 +1,121 @@ +#!/bin/sh + +# Nethack post-installation script for Debian +# +# Ben Gertzfield (che@debian.org) 29 July 1997 +# Joshua Kwan (joshk@triplehelix.org) 11 Oct 2003 +# Copyright 1997 Ben Gertzfield, 2003 Joshua Kwan. This script is +# released under the GNU General Public License, version 2 or later. + +# Modified 10 October 1997 to fix permissions on /var/games/nethack. +# Modified 18 August 1998 to fix more upgrade problems from ancient +# nethacks +# Modified 11 April 2001 to change path to /var/games/nethack. +# Modified 23 March 2002, removed code to change path from +# /var/lib/games/nethack -> /var/games/nethack since the save files +# changed format anyway. +# Modified 11 Oct 2003, move all the preinst stuff here. + +set -e + +. /usr/share/debconf/confmodule + +LOGDIR=/var/games/nethack +OLDLOGDIR=/var/lib/games/nethack + +if [ "$1" = "configure" ]; then + # Only do this if we are upgrading from a version of Nethack + # that has incompatible save files from this version. + # Also check to see whether old save directory exists and contains + # files, that means we're upgrading from a version where nethack-common + # is new. + # + # Use lt-nl test here, because an empty $2 means a new install. + # lt-nl means empty is always greater than any other version, + # so the first part of this test will not return true on a new install. + if dpkg --compare-versions "$2" lt-nl 3.4.0 || \ + [ -d $OLDLOGDIR -a -n "`ls $OLDLOGDIR/save 2>/dev/null || true`" ]; then + # But, it's a non-issue if there were no save files to begin with. + if [ -d $LOGDIR -a -n "`ls $LOGDIR/save 2>/dev/null || true`" ]; then + PROCESSDIRS="$LOGDIR" + fi + + if [ -d $OLDLOGDIR -a -n "`ls $OLDLOGDIR/save 2>/dev/null || true`" ]; then + PROCESSDIRS="$PROCESSDIRS $OLDLOGDIR" + fi + + if [ -n "$PROCESSDIRS" ]; then + # The question should have been popped at this point + db_get nethack-common/backup-incompatible + + case "$RET" in + # Shouldn't happen, but handle just in case. + abort) + exit 1 + ;; + backup) + if [ -n "$PROCESSDIRS" ]; then + echo "Backing up incompatible save games from previous versions: " + + for GAMEDIR in $PROCESSDIRS; do + if [ ! -d $GAMEDIR ]; then continue; fi + + if [ ! -z "`ls $GAMEDIR/save 2>/dev/null || true`" ]; then + BACKUP=`tempfile --directory=/tmp --prefix=nethk --suffix .tar.gz` + echo " backing up $GAMEDIR to $BACKUP ..." + tar czf $BACKUP $GAMEDIR > /dev/null 2>&1 + fi + + rm -rf $GAMEDIR/save/ $GAMEDIR/*.gz + done + + echo "Don't forget to do something with these backup files!" + fi + ;; + purge) + rm -rf $LOGDIR $OLDLOGDIR + ;; + # Do nothing! This better happen... + ignore) + ;; + esac + fi + fi + + db_get nethack-common/recover-setgid + + if [ "$RET" = false ]; then + # Remove the statoverride that may have been left over from other + # configurations + if dpkg-statoverride --list /usr/lib/games/nethack/recover >/dev/null + then + dpkg-statoverride --remove /usr/lib/games/nethack/recover + fi + + # Just in case + chmod 755 /usr/lib/games/nethack/recover + else + if ! dpkg-statoverride --list /usr/lib/games/nethack/recover >/dev/null + then + dpkg-statoverride --add root games 2755 /usr/lib/games/nethack/recover + fi + + chmod 2755 /usr/lib/games/nethack/recover + fi + + db_stop + + for file in perm record logfile; do + test -e /var/games/nethack/$file || install -m 0664 -o root -g games \ + /dev/null /var/games/nethack/$file + done + + # stale rc.d file + if [ -f "/etc/rcS.d/S85nethack" ]; then + echo "Removing old init script and its symlinks." + rm -f /etc/init.d/nethack + update-rc.d -f nethack remove + fi +fi + +#DEBHELPER# --- nethack-3.4.3.orig/debian/nethack.sh +++ nethack-3.4.3/debian/nethack.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# SCCS Id: @(#)nethack.sh 3.3 90/02/26 + +HACKDIR=/usr/lib/games/nethack +export HACKDIR +HACK=$HACKDIR/nethack + +# see if we can find the full path name of PAGER, so help files work properly +# assume that if someone sets up a special variable (HACKPAGER) for NetHack, +# it will already be in a form acceptable to NetHack +# ideas from brian@radio.astro.utoronto.ca +if test \( "xxx$PAGER" != xxx \) -a \( "xxx$HACKPAGER" = xxx \) +then + + HACKPAGER=$PAGER + +# use only the first word of the pager variable +# this prevents problems when looking for file names with trailing +# options, but also makes the options unavailable for later use from +# NetHack + for i in $HACKPAGER + do + HACKPAGER=$i + break + done + + if test ! -f $HACKPAGER + then + IFS=: + for i in $PATH + do + if test -f $i/$HACKPAGER + then + HACKPAGER=$i/$HACKPAGER + export HACKPAGER + break + fi + done + IFS=' ' + fi + if test ! -f $HACKPAGER + then + echo Cannot find $PAGER -- unsetting PAGER. + unset HACKPAGER + unset PAGER + fi +fi + + +cd $HACKDIR +exec $HACK "$@" + --- nethack-3.4.3.orig/debian/nethack-x11.menu +++ nethack-3.4.3/debian/nethack-x11.menu @@ -0,0 +1,6 @@ +?package(nethack-x11):needs="x11" \ + command="/usr/games/xnethack" \ + hints="Roguelike,Maze,Dungeon" \ + section="Games/Adventure" \ + title="X NetHack" \ + icon="/usr/share/pixmaps/nethack.xpm" --- nethack-3.4.3.orig/debian/patches/14_common_config.dpatch +++ nethack-3.4.3/debian/patches/14_common_config.dpatch @@ -0,0 +1,138 @@ +#! /bin/sh -e +## 14_common_config.dpatch by Joshua Kwan +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Common config.h for all binary packages. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +Index: include/config.h +=================================================================== +RCS file: /cvsroot/pkg-nethack/nethack/include/config.h,v +retrieving revision 1.2 +diff -u -r1.2 config.h +--- include/config.h 9 Dec 2003 16:14:43 -0000 1.2 ++++ include/config.h 9 Dec 2003 16:33:15 -0000 +@@ -42,12 +42,19 @@ + * Define all of those you want supported in your binary. + * Some combinations make no sense. See the installation document. + */ ++ ++#ifndef LISP_GRAPHICS + #define TTY_GRAPHICS /* good old tty based graphics */ + /* #define X11_GRAPHICS */ /* X11 interface */ + /* #define QT_GRAPHICS */ /* Qt interface */ + /* #define GNOME_GRAPHICS */ /* Gnome interface */ + /* #define MSWIN_GRAPHICS */ /* Windows NT, CE, Graphics */ + ++/* Debian default window system is always tty; they have to set their ++ * own if they want another one (or just use the scripts */ ++#define DEFAULT_WINDOW_SYS "tty" ++#endif ++ + /* + * Define the default window system. This should be one that is compiled + * into your system (see defines above). Known window systems are: +@@ -83,11 +90,7 @@ + #endif + + #ifdef QT_GRAPHICS +-# define DEFAULT_WC_TILED_MAP /* Default to tiles if users doesn't say wc_ascii_map */ + # define USER_SOUNDS /* Use sounds */ +-# ifndef __APPLE__ +-# define USER_SOUNDS_REGEX +-# endif + # define USE_XPM /* Use XPM format for images (required) */ + # define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.ppm) */ + # ifndef DEFAULT_WINDOW_SYS +@@ -126,7 +129,7 @@ + * would allow: + * xpmtoppm x11tiles_big.xpm + */ +-/* # define USE_XPM */ /* Disable if you do not have the XPM library */ ++# define USE_XPM /* Disable if you do not have the XPM library */ + # ifdef USE_XPM + # define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.xpm) */ + # endif +@@ -143,16 +146,15 @@ + + #ifndef WIZARD /* allow for compile-time or Makefile changes */ + # ifndef KR1ED +-# define WIZARD "wizard" /* the person allowed to use the -D option */ ++# define WIZARD "root" /* the person allowed to use the -D option */ + # else + # define WIZARD +-# define WIZARD_NAME "wizard" ++# define WIZARD_NAME "root" + # endif + #endif + + #define LOGFILE "logfile" /* larger file for debugging purposes */ + #define NEWS "news" /* the file containing the latest hack news */ +-#define PANICLOG "paniclog" /* log of panic and impossible events */ + + /* + * If COMPRESS is defined, it should contain the full path name of your +@@ -169,11 +171,8 @@ + + #ifdef UNIX + /* path and file name extension for compression program */ +-#define COMPRESS "/usr/bin/compress" /* Lempel-Ziv compression */ +-#define COMPRESS_EXTENSION ".Z" /* compress's extension */ +-/* An example of one alternative you might want to use: */ +-/* #define COMPRESS "/usr/local/bin/gzip" */ /* FSF gzip compression */ +-/* #define COMPRESS_EXTENSION ".gz" */ /* normal gzip extension */ ++#define COMPRESS "/bin/gzip" /* FSF gzip compression */ ++#define COMPRESS_EXTENSION ".gz" /* normal gzip extension */ + #endif + + #ifndef COMPRESS +@@ -185,7 +184,7 @@ + * a tar-like file, thus making a neater installation. See *conf.h + * for detailed configuration. + */ +-/* #define DLB */ /* not supported on all platforms */ ++#define DLB /* not supported on all platforms */ + + /* + * Defining INSURANCE slows down level changes, but allows games that +@@ -204,7 +203,7 @@ + * otherwise it will be the current directory. + */ + # ifndef HACKDIR +-# define HACKDIR "/usr/games/lib/nethackdir" ++# define HACKDIR "/usr/lib/games/nethack" + # endif + + /* +@@ -214,7 +213,9 @@ + * since the user might create files in a directory of his choice. + * Of course SECURE is meaningful only if HACKDIR is defined. + */ +-/* #define SECURE */ /* do setuid(getuid()) after chdir() */ ++#define SECURE /* do setuid(getuid()) after chdir() */ ++#define PIXMAPDIR "/usr/share/pixmaps/nethack/" ++#define SIMPLE_MAIL + + /* + * If it is desirable to limit the number of people that can play Hack +@@ -338,6 +338,7 @@ + #endif + + #define EXP_ON_BOTL /* Show experience on bottom line */ ++#define PARANOID + /* #define SCORE_ON_BOTL */ /* added by Gary Erickson (erickson@ucivax) */ + + /* --- nethack-3.4.3.orig/debian/patches/19_gnome_ext_events.dpatch +++ nethack-3.4.3/debian/patches/19_gnome_ext_events.dpatch @@ -0,0 +1,79 @@ +#! /bin/sh -e +## 19_gnome_ext_events.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Extended menu didn't handle enough events. Handle stuff like mouse click + +if [ $# -lt 1 ]; then + echo "`basename $0`: script expects -patch|-unpatch as argument" >&2 + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}" + +case "$1" in + -patch) patch -p1 ${patch_opts} < $0;; + -unpatch) patch -R -p1 ${patch_opts} < $0;; + *) + echo "`basename $0`: script expects -patch|-unpatch as argument" >&2 + exit 1;; +esac + +exit 0 + +--- orig/nethack-3.4.3/win/gnome/gnmenu.c 2003-12-24 21:41:57.000000000 -0800 ++++ nethack-3.4.3/win/gnome/gnmenu.c 2004-04-28 22:28:13.000000000 -0700 +@@ -30,9 +30,9 @@ + guint32 lastTime; + } extMenu; + ++static extMenu info = { 0 }; + static GdkColor color_blue = { 0, 0, 0, 0xffff }; + +- + static void + ghack_menu_window_key(GtkWidget *menuWin, GdkEventKey *event, gpointer data) + { +@@ -83,10 +83,9 @@ + static void + ghack_menu_row_selected (GtkCList *clist, int row, int col, GdkEvent *event) + { +- /* FIXME: Do something */ ++ info.curItem = row; + } + +- + void + ghack_menu_window_clear(GtkWidget *menuWin, gpointer data) + { +@@ -640,6 +639,17 @@ + int i; + char c = event->string[0]; + ++ switch (event->keyval) ++ { ++ case GDK_Up: ++ --info->curItem; ++ return; ++ ++ case GDK_Down: ++ ++info->curItem; ++ return; ++ } ++ + clist = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(menuWin), "clist")); + g_assert(clist != NULL); + +@@ -697,7 +707,10 @@ + GtkWidget* swin; + GtkWidget* frame1; + GtkWidget* clist; +- extMenu info; ++ ++ /* Reset, because it's now a static var */ ++ info.charIdx = 0; ++ info.lastTime = 0; + + dialog = gnome_dialog_new("Extended Commands", + GNOME_STOCK_BUTTON_OK, --- nethack-3.4.3.orig/debian/patches/90_enh_hpmon.dpatch +++ nethack-3.4.3/debian/patches/90_enh_hpmon.dpatch @@ -0,0 +1,188 @@ +#! /bin/sh -e +## 90_enh_hpmon.dpatch by Ralph Churchill +## from: http://www.netsonic.fi/~walker/nh/hpmon.diff +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Enables color HP monitor for textmode NetHack. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +--- nh342orig/src/botl.c 2003-08-30 03:07:27.000000000 +0300 ++++ nh342hpmon/src/botl.c 2003-09-05 18:17:09.000000000 +0300 +@@ -3,6 +3,7 @@ + /* NetHack may be freely redistributed. See license for details. */ + + #include "hack.h" ++#include "wintty.h" + + #ifdef OVL0 + extern const char *hu_stat[]; /* defined in eat.c */ +@@ -248,6 +248,9 @@ + char newbot2[MAXCO]; + register char *nb; + int hp, hpmax; ++#if defined(HPMON) && !defined(LISP_GRAPHICS) ++ int hpcolor, hpattr; ++#endif + int cap = near_capacity(); + + hp = Upolyd ? u.mh : u.uhp; +@@ -256,6 +259,15 @@ + if(hp < 0) hp = 0; + (void) describe_level(newbot2); + Sprintf(nb = eos(newbot2), ++#ifdef HPMON ++ "%c:%-2ld HP:", oc_syms[COIN_CLASS], ++#ifndef GOLDOBJ ++ u.ugold ++#else ++ money_cnt(invent) ++#endif ++ ); ++#else /* HPMON */ + "%c:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d", oc_syms[COIN_CLASS], + #ifndef GOLDOBJ + u.ugold, +@@ -263,6 +275,39 @@ + money_cnt(invent), + #endif + hp, hpmax, u.uen, u.uenmax, u.uac); ++#endif /* HPMON */ ++#ifdef HPMON ++ curs(WIN_STATUS, 1, 1); ++ putstr(WIN_STATUS, 0, newbot2); ++ ++ Sprintf(nb = eos(newbot2), "%d(%d)", hp, hpmax); ++#if defined(TEXTCOLOR) && !defined(LISP_GRAPHICS) ++ if (iflags.use_color && iflags.use_hpmon) { ++ curs(WIN_STATUS, 1, 1); ++ hpattr = ATR_NONE; ++ if(hp == hpmax){ ++ hpcolor = NO_COLOR; ++ } else if(hp > (hpmax*2/3)) { ++ hpcolor = CLR_GREEN; ++ } else if(hp <= (hpmax/3)) { ++ hpcolor = CLR_RED; ++ if(hp<=(hpmax/10)) ++ hpattr = ATR_BLINK; ++ } else { ++ hpcolor = CLR_YELLOW; ++ } ++ if (hpcolor != NO_COLOR) ++ term_start_color(hpcolor); ++ if(hpattr!=ATR_NONE)term_start_attr(hpattr); ++ putstr(WIN_STATUS, hpattr, newbot2); ++ if(hpattr!=ATR_NONE)term_end_attr(hpattr); ++ if (hpcolor != NO_COLOR) ++ term_end_color(); ++ } ++#endif /* TEXTCOLOR */ ++ Sprintf(nb = eos(newbot2), " Pw:%d(%d) AC:%-2d", ++ u.uen, u.uenmax, u.uac); ++#endif /* HPMON */ + + if (Upolyd) + Sprintf(nb = eos(nb), " HD:%d", mons[u.umonnum].mlevel); +--- nethack/include/config.h~ 2003-10-12 15:47:13.000000000 -0700 ++++ nethack/include/config.h 2003-10-12 15:49:18.000000000 -0700 +@@ -345,6 +345,9 @@ + + #define EXP_ON_BOTL /* Show experience on bottom line */ + #define PARANOID ++ ++#define HPMON /* Color HP monitor */ ++ + /* #define SCORE_ON_BOTL */ /* added by Gary Erickson (erickson@ucivax) */ + + /* +--- nethack/src/options.c~ 2003-10-12 16:05:42.000000000 -0700 ++++ nethack/src/options.c 2003-10-12 16:06:44.000000000 -0700 +@@ -86,6 +86,9 @@ + #else + {"extmenu", (boolean *)0, FALSE, SET_IN_FILE}, + #endif ++#if defined(TEXTCOLOR) && defined(HPMON) ++ { "hpmon", &iflags.use_hpmon, FALSE, SET_IN_GAME}, ++#endif + #ifdef OPT_DISPMAP + {"fast_map", &flags.fast_map, TRUE, SET_IN_GAME}, + #else +--- nethack/include/flag.h~ 2003-10-12 16:04:12.000000000 -0700 ++++ nethack/include/flag.h 2003-10-12 16:05:17.000000000 -0700 +@@ -217,6 +217,11 @@ + boolean lan_mail; /* mail is initialized */ + boolean lan_mail_fetched; /* mail is awaiting display */ + #endif ++ ++#if defined(HPMON) && defined(TEXTCOLOR) ++ boolean use_hpmon; ++#endif ++ + /* + * Window capability support. + */ +--- nethack/dat/opthelp~ 2003-10-12 16:16:39.000000000 -0700 ++++ nethack/dat/opthelp 2003-10-12 16:16:09.000000000 -0700 +@@ -71,6 +71,9 @@ + color use different colors for objects on screen [TRUE for micros] + hilite_pet display pets in a highlighted manner [FALSE] + ++Boolean option if HPMON was set at compile time: ++hpmon color HP readout depending on how low it is [FALSE] ++ + Boolean option if TIMED_DELAY was set at compile time (tty interface only): + timed_delay on unix and VMS, use a timer instead of sending + extra screen output when attempting to pause for +--- nethack/doc/Guidebook.txt~ 2003-10-12 16:10:21.000000000 -0700 ++++ nethack/doc/Guidebook.txt 2003-10-12 16:14:39.000000000 -0700 +@@ -2338,6 +2338,11 @@ + Name your starting horse (ex. ``horsename:Trigger''). Can- + not be set with the `O' command. + ++ hpmon ++ Colors your hitpoint reading green when you attain <= 2/3 of ++ your total HP, yellow when you reach <= 1/3 of total, and red ++ when you are at or below 1/10 of your total HP. ++ + IBMgraphics + Use a predefined selection of IBM extended ASCII characters + to display the dungeon/effects/traps instead of having to +--- nethack/doc/Guidebook.mn~ 2003-10-12 16:10:32.000000000 -0700 ++++ nethack/doc/Guidebook.mn 2003-10-12 16:15:11.000000000 -0700 +@@ -1800,6 +1800,10 @@ + .lp horsename + Name your starting horse (ex. ``horsename:Trigger''). + Cannot be set with the `O' command. ++.lp hpmon ++Colors your HP reading green when you attain <= 2/3 of your total HP, ++yellow when you reach <= 1/3 of total, and red when you are at or below ++1/10 of your total HP. + .lp IBMgraphics + Use a predefined selection of IBM extended ASCII characters to display the + dungeon/effects/traps instead of having to define a full graphics set +--- nethack/doc/Guidebook.tex~ 2003-10-12 16:10:38.000000000 -0700 ++++ nethack/doc/Guidebook.tex 2003-10-12 16:15:28.000000000 -0700 +@@ -2229,6 +2229,11 @@ + Name your starting horse (ex.\ ``{\tt horsename:Trigger}''). + Cannot be set with the `{\tt O}' command. + %.lp ++\item[\ib{hpmon}] ++Colors your HP reading green when you attain <= 2/3 of your total HP, ++yellow when you reach <= 1/3 of total, and red when you are at or below ++1/10 of your total HP. ++%.lp + \item[\ib{IBMgraphics}] + Use a predefined selection of IBM extended ASCII characters to display the + dungeon/effects/traps instead of having to define a full graphics set --- nethack-3.4.3.orig/debian/patches/91_enh_menucolors.dpatch +++ nethack-3.4.3/debian/patches/91_enh_menucolors.dpatch @@ -0,0 +1,576 @@ +#! /bin/sh -e +## 91_enh_menucolors.dpatch by Pasi Kallinen +## from: http://www.cs.joensuu.fi/~pkalli/code/nh343-menucolor.diff +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Pasi Kallinen's patch to add colors to inventory items. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/dat/opthelp nethack-3.4.3-menucolor/dat/opthelp +--- nethack-3.4.3-orig/dat/opthelp 2003-12-09 17:23:52.000000000 +0200 ++++ nethack-3.4.3-menucolor/dat/opthelp 2003-12-10 05:06:38.000000000 +0200 +@@ -71,6 +71,9 @@ + color use different colors for objects on screen [TRUE for micros] + hilite_pet display pets in a highlighted manner [FALSE] + ++Boolean option if TEXTCOLOR and MENU_COLOR were set at compile time: ++menucolors use different colors for menus [TRUE for micros] ++ + Boolean option if TIMED_DELAY was set at compile time (tty interface only): + timed_delay on unix and VMS, use a timer instead of sending + extra screen output when attempting to pause for +@@ -169,6 +172,21 @@ + still denote your gender using the "male" and "female" + options, the "gender" option will take precedence. [RANDOM] + horsename the name of your first horse [NONE] ++menucolor Set colors for menus. (menucolor:"regex_string"=color) ++ If boolean option ``menucolors'' is true, menus will be shown ++ with different colors. ++ For example, setting ``menucolor:" blessed "=green'' shows ++ all lines in a menu with the text " blessed " in green. ++ The string is matched using regular expressions. ++ Valid values for the color are black, red, green, brown, blue, ++ magenta, cyan, gray, orange, lightgreen, yellow, lightblue, ++ lightmagenta, lightcyan and white. ++ You can define menucolor as many times as you wish; those ++ defined later will take precedence. ++ Instead of using this with OPTIONS, consider using ++ MENUCOLOR="regex_string"=color in the configuration file. ++ Setting menucolor has effect only if TEXTCOLOR and MENU_COLOR ++ were set at compile time. [NONE] + menu_* create single character accelerators for menu commands. Below + is a list of all commands. Each is followed by a list of window- + ports that implement them: 'x' is X11, 't' is tty, 'g' is Gem, +diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/include/color.h nethack-3.4.3-menucolor/include/color.h +--- nethack-3.4.3-orig/include/color.h 2003-12-09 17:23:52.000000000 +0200 ++++ nethack-3.4.3-menucolor/include/color.h 2003-12-10 05:08:55.000000000 +0200 +@@ -5,6 +5,12 @@ + #ifndef COLOR_H + #define COLOR_H + ++#ifdef MENU_COLOR ++# ifdef MENU_COLOR_REGEX ++# include ++# endif ++#endif ++ + /* + * The color scheme used is tailored for an IBM PC. It consists of the + * standard 8 colors, folowed by their bright counterparts. There are +@@ -49,4 +55,16 @@ + #define DRAGON_SILVER CLR_BRIGHT_CYAN + #define HI_ZAP CLR_BRIGHT_BLUE + ++#ifdef MENU_COLOR ++struct menucoloring { ++# ifdef MENU_COLOR_REGEX ++ struct re_pattern_buffer match; ++# else ++ char *match; ++# endif ++ int color, attr; ++ struct menucoloring *next; ++}; ++#endif /* MENU_COLOR */ ++ + #endif /* COLOR_H */ +diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/include/config.h nethack-3.4.3-menucolor/include/config.h +--- nethack-3.4.3-orig/include/config.h 2003-12-09 17:26:08.000000000 +0200 ++++ nethack-3.4.3-menucolor/include/config.h 2003-12-10 05:09:50.000000000 +0200 +@@ -348,6 +348,15 @@ + * bugs left here. + */ + ++#ifdef TTY_GRAPHICS ++# define MENU_COLOR ++# define MENU_COLOR_REGEX ++/* if MENU_COLOR_REGEX is defined, use regular expressions (GNU regex.h) ++ * otherwise use pmatch() to match menu color lines. ++ * pmatch() provides basic globbing: '*' and '?' wildcards. ++ */ ++#endif ++ + /*#define GOLDOBJ */ /* Gold is kept on obj chains - Helge Hafting */ + /*#define AUTOPICKUP_EXCEPTIONS */ /* exceptions to autopickup */ + +diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/include/extern.h nethack-3.4.3-menucolor/include/extern.h +--- nethack-3.4.3-orig/include/extern.h 2003-12-09 17:23:52.000000000 +0200 ++++ nethack-3.4.3-menucolor/include/extern.h 2003-12-10 05:10:29.000000000 +0200 +@@ -1405,6 +1405,9 @@ + E int FDECL(add_autopickup_exception, (const char *)); + E void NDECL(free_autopickup_exceptions); + #endif /* AUTOPICKUP_EXCEPTIONS */ ++#ifdef MENU_COLOR ++E boolean FDECL(add_menu_coloring, (char *)); ++#endif /* MENU_COLOR */ + + /* ### pager.c ### */ + +diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/include/flag.h nethack-3.4.3-menucolor/include/flag.h +--- nethack-3.4.3-orig/include/flag.h 2003-12-09 17:23:52.000000000 +0200 ++++ nethack-3.4.3-menucolor/include/flag.h 2003-12-10 05:12:35.000000000 +0200 +@@ -183,6 +183,9 @@ + char prevmsg_window; /* type of old message window to use */ + boolean extmenu; /* extended commands use menu interface */ + #endif ++#ifdef MENU_COLOR ++ boolean use_menu_color; /* use color in menus; only if wc_color */ ++#endif + #ifdef MFLOPPY + boolean checkspace; /* check disk space before writing files */ + /* (in iflags to allow restore after moving +diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/README.menucolor nethack-3.4.3-menucolor/README.menucolor +--- nethack-3.4.3-orig/README.menucolor 1970-01-01 02:00:00.000000000 +0200 ++++ nethack-3.4.3-menucolor/README.menucolor 2003-12-10 06:14:20.000000000 +0200 +@@ -0,0 +1,96 @@ ++ ++ This is version 1.3 of the menucolors patch. ++ ++ This patch allows the user to define in what color menus are shown. ++ For example, putting ++ ++ OPTIONS=menucolors ++ MENUCOLOR=" blessed "=green ++ MENUCOLOR=" holy "=green ++ MENUCOLOR=" cursed "=red ++ MENUCOLOR=" unholy "=red ++ MENUCOLOR=" cursed .* (being worn)"=orange&underline ++ ++ in the configuration file makes all known blessed items ++ show up in green, all cursed items show up in red and ++ all cursed worn items show up in orange and underlined ++ when viewing inventory. ++ ++ If you do not have GNU regex.h, comment ++ #define MENU_COLOR_REGEX out from include/config.h ++ and replace the MENUCOLOR lines in your config file with these: ++ ++ MENUCOLOR="* blessed *"=green ++ MENUCOLOR="* holy *"=green ++ MENUCOLOR="* cursed *"=red ++ MENUCOLOR="* unholy *"=red ++ MENUCOLOR="* cursed * (being worn)"=orange&underline ++ ++ ++ Colors: black, red, green, brown, blue, magenta, cyan, gray, orange, ++ lightgreen, yellow, lightblue, lightmagenta, lightcyan, white. ++ Attributes: none, bold, dim, underline, blink, inverse. ++ ++ Note that the terminal is free to interpret the attributes however ++ it wants. ++ ++ ++ TODO/BUGS: ++ ++ o Only works with TTY ++ o You can't use '=' or '&' in the match-string. ++ o Maybe add color-field to tty_menu_item in include/wintty.h ++ (so there's no need to find the color for the line again) ++ o Guidebook is not up to date ++ o Better place to put the functions, colornames[] and attrnames[]? ++ o Some menus do not need coloring; maybe add new parameter ++ to process_menu_window()? ++ ++ ++ FIXES: ++ ++ v1.3: ++ o Updated to use 3.4.3 codebase. ++ o Added a text to #version to show menucolors is compiled in. ++ ++ v1.2: ++ o Updated to use 3.4.2 codebase. ++ ++ v1.1: ++ o Updated to use 3.4.1 codebase. ++ o replaced USE_REGEX_MATCH with MENU_COLOR_REGEX ++ ++ v1.04: ++ o Oops! 1.03 worked only on *nixes... (GNU regex.h) ++ o Compile-time option USE_REGEX_MATCH: if it's defined, use regex, ++ otherwise use globbing. ('?' and '*' wildcards) ++ ++ v1.03: ++ ++ o Now using Nethack 3.4.0 codebase ++ o Compile-time option MENU_COLOR ++ o Strings match using regular expressions instead of globbing ++ o You can use attribute with color (attr must come after '&') ++ o Use ``MENUCOLOR="foo"=color'' instead of ``OPTIONS=menucolor=...'' ++ (Both work, but OPTIONS complains if you define menucolor ++ more than once) ++ ++ v1.02: ++ ++ o Should now work with OS/2, thanks to Jukka Lahtinen ++ o Strings match now using simple globbing. ('?' and '*' wildcards) ++ ++ v1.01: ++ ++ o Moved 'menucolors' boolean option, so now the options-menu ++ is in alphabetical order. ++ o Fixed 'menucolor' description in dat/opthelp. ++ o menu_colorings is now initialized to null in src/decl.c. ++ ++ v1.0: ++ ++ o Initial release ++ ++-- ++ Pasi Kallinen ++ pkalli@cs.joensuu.fi +diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/src/decl.c nethack-3.4.3-menucolor/src/decl.c +--- nethack-3.4.3-orig/src/decl.c 2003-12-09 17:23:52.000000000 +0200 ++++ nethack-3.4.3-menucolor/src/decl.c 2003-12-10 05:14:53.000000000 +0200 +@@ -235,6 +235,10 @@ + "white", /* CLR_WHITE */ + }; + ++#ifdef MENU_COLOR ++struct menucoloring *menu_colorings = 0; ++#endif ++ + struct c_common_strings c_common_strings = { + "Nothing happens.", "That's enough tries!", + "That is a silly thing to %s.", "shudder for a moment.", +diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/src/files.c nethack-3.4.3-menucolor/src/files.c +--- nethack-3.4.3-orig/src/files.c 2003-12-09 17:23:52.000000000 +0200 ++++ nethack-3.4.3-menucolor/src/files.c 2003-12-10 05:42:43.000000000 +0200 +@@ -1794,6 +1794,10 @@ + } else if (match_varname(buf, "BOULDER", 3)) { + (void) get_uchars(fp, buf, bufp, &iflags.bouldersym, TRUE, + 1, "BOULDER"); ++ } else if (match_varname(buf, "MENUCOLOR", 9)) { ++#ifdef MENU_COLOR ++ (void) add_menu_coloring(bufp); ++#endif + } else if (match_varname(buf, "GRAPHICS", 4)) { + len = get_uchars(fp, buf, bufp, translate, FALSE, + MAXPCHARS, "GRAPHICS"); +diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/src/options.c nethack-3.4.3-menucolor/src/options.c +--- nethack-3.4.3-orig/src/options.c 2003-12-09 17:23:52.000000000 +0200 ++++ nethack-3.4.3-menucolor/src/options.c 2003-12-10 05:19:58.000000000 +0200 +@@ -125,6 +125,15 @@ + #else + {"mail", (boolean *)0, TRUE, SET_IN_FILE}, + #endif ++#ifdef MENU_COLOR ++# ifdef MICRO ++ {"menucolors", &iflags.use_menu_color, TRUE, SET_IN_GAME}, ++# else ++ {"menucolors", &iflags.use_menu_color, FALSE, SET_IN_GAME}, ++# endif ++#else ++ {"menucolors", (boolean *)0, FALSE, SET_IN_GAME}, ++#endif + #ifdef WIZARD + /* for menu debugging only*/ + {"menu_tab_sep", &iflags.menu_tab_sep, FALSE, SET_IN_GAME}, +@@ -246,6 +255,7 @@ + { "horsename", "the name of your (first) horse (e.g., horsename:Silver)", + PL_PSIZ, DISP_IN_GAME }, + { "map_mode", "map display mode under Windows", 20, DISP_IN_GAME }, /*WC*/ ++ { "menucolor", "set menu colors", PL_PSIZ, SET_IN_FILE }, + { "menustyle", "user interface for object selection", + MENUTYPELEN, SET_IN_GAME }, + { "menu_deselect_all", "deselect all items in a menu", 4, SET_IN_FILE }, +@@ -964,6 +974,120 @@ + } + } + ++#ifdef MENU_COLOR ++extern struct menucoloring *menu_colorings; ++ ++static const struct { ++ const char *name; ++ const int color; ++} colornames[] = { ++ {"black", CLR_BLACK}, ++ {"red", CLR_RED}, ++ {"green", CLR_GREEN}, ++ {"brown", CLR_BROWN}, ++ {"blue", CLR_BLUE}, ++ {"magenta", CLR_MAGENTA}, ++ {"cyan", CLR_CYAN}, ++ {"gray", CLR_GRAY}, ++ {"orange", CLR_ORANGE}, ++ {"lightgreen", CLR_BRIGHT_GREEN}, ++ {"yellow", CLR_YELLOW}, ++ {"lightblue", CLR_BRIGHT_BLUE}, ++ {"lightmagenta", CLR_BRIGHT_MAGENTA}, ++ {"lightcyan", CLR_BRIGHT_CYAN}, ++ {"white", CLR_WHITE} ++}; ++ ++static const struct { ++ const char *name; ++ const int attr; ++} attrnames[] = { ++ {"none", ATR_NONE}, ++ {"bold", ATR_BOLD}, ++ {"dim", ATR_DIM}, ++ {"underline", ATR_ULINE}, ++ {"blink", ATR_BLINK}, ++ {"inverse", ATR_INVERSE} ++ ++}; ++ ++/* parse '"regex_string"=color&attr' and add it to menucoloring */ ++boolean ++add_menu_coloring(str) ++char *str; ++{ ++ int i, c = NO_COLOR, a = ATR_NONE; ++ struct menucoloring *tmp; ++ char *tmps, *cs = strchr(str, '='); ++ const char *err = (char *)0; ++ ++ if (!cs || !str) return FALSE; ++ ++ tmps = cs; ++ tmps++; ++ while (*tmps && isspace(*tmps)) tmps++; ++ ++ for (i = 0; i < SIZE(colornames); i++) ++ if (strstri(tmps, colornames[i].name) == tmps) { ++ c = colornames[i].color; ++ break; ++ } ++ if ((i == SIZE(colornames)) && (*tmps >= '0' && *tmps <='9')) ++ c = atoi(tmps); ++ ++ if (c > 15) return FALSE; ++ ++ tmps = strchr(str, '&'); ++ if (tmps) { ++ tmps++; ++ while (*tmps && isspace(*tmps)) tmps++; ++ for (i = 0; i < SIZE(attrnames); i++) ++ if (strstri(tmps, attrnames[i].name) == tmps) { ++ a = attrnames[i].attr; ++ break; ++ } ++ if ((i == SIZE(attrnames)) && (*tmps >= '0' && *tmps <='9')) ++ a = atoi(tmps); ++ } ++ ++ *cs = '\0'; ++ tmps = str; ++ if ((*tmps == '"') || (*tmps == '\'')) { ++ cs--; ++ while (isspace(*cs)) cs--; ++ if (*cs == *tmps) { ++ *cs = '\0'; ++ tmps++; ++ } ++ } ++ ++ tmp = (struct menucoloring *)alloc(sizeof(struct menucoloring)); ++#ifdef MENU_COLOR_REGEX ++ tmp->match.translate = 0; ++ tmp->match.fastmap = 0; ++ tmp->match.buffer = 0; ++ tmp->match.allocated = 0; ++ tmp->match.regs_allocated = REGS_FIXED; ++ err = re_compile_pattern(tmps, strlen(tmps), &tmp->match); ++#else ++ tmp->match = (char *)alloc(strlen(tmps)+1); ++ (void) memcpy((genericptr_t)tmp->match, (genericptr_t)tmps, strlen(tmps)+1); ++#endif ++ if (err) { ++ raw_printf("\nMenucolor regex error: %s\n", err); ++ wait_synch(); ++ free(tmp); ++ return FALSE; ++ } else { ++ tmp->next = menu_colorings; ++ tmp->color = c; ++ tmp->attr = a; ++ menu_colorings = tmp; ++ return TRUE; ++ } ++} ++#endif /* MENU_COLOR */ ++ + void + parseoptions(opts, tinitial, tfrom_file) + register char *opts; +@@ -1133,6 +1257,18 @@ + return; + } + ++ /* menucolor:"regex_string"=color */ ++ fullname = "menucolor"; ++ if (match_optname(opts, fullname, 9, TRUE)) { ++#ifdef MENU_COLOR ++ if (negated) bad_negation(fullname, FALSE); ++ else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) ++ if (!add_menu_coloring(op)) ++ badoption(opts); ++#endif ++ return; ++ } ++ + fullname = "msghistory"; + if (match_optname(opts, fullname, 3, TRUE)) { + op = string_for_env_opt(fullname, opts, negated); +diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/src/save.c nethack-3.4.3-menucolor/src/save.c +--- nethack-3.4.3-orig/src/save.c 2003-12-09 17:23:52.000000000 +0200 ++++ nethack-3.4.3-menucolor/src/save.c 2003-12-10 05:22:32.000000000 +0200 +@@ -48,6 +48,10 @@ + #define HUP + #endif + ++#ifdef MENU_COLOR ++extern struct menucoloring *menu_colorings; ++#endif ++ + /* need to preserve these during save to avoid accessing freed memory */ + static unsigned ustuck_id = 0, usteed_id = 0; + +@@ -953,12 +957,34 @@ + return; + } + ++#ifdef MENU_COLOR ++void ++free_menu_coloring() ++{ ++ struct menucoloring *tmp = menu_colorings; ++ ++ while (tmp) { ++ struct menucoloring *tmp2 = tmp->next; ++# ifdef MENU_COLOR_REGEX ++ (void) regfree(&tmp->match); ++# else ++ free(tmp->match); ++# endif ++ free(tmp); ++ tmp = tmp2; ++ } ++} ++#endif /* MENU_COLOR */ ++ + void + freedynamicdata() + { + unload_qtlist(); + free_invbuf(); /* let_to_name (invent.c) */ + free_youbuf(); /* You_buf,&c (pline.c) */ ++#ifdef MENU_COLOR ++ free_menu_coloring(); ++#endif + tmp_at(DISP_FREEMEM, 0); /* temporary display effects */ + #ifdef FREE_ALL_MEMORY + # define freeobjchn(X) (saveobjchn(0, X, FREE_SAVE), X = 0) +diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/util/makedefs.c nethack-3.4.3-menucolor/util/makedefs.c +--- nethack-3.4.3-orig/util/makedefs.c 2003-12-09 17:23:52.000000000 +0200 ++++ nethack-3.4.3-menucolor/util/makedefs.c 2003-12-10 06:03:57.000000000 +0200 +@@ -679,6 +679,13 @@ + #ifdef MAIL + "mail daemon", + #endif ++#ifdef MENU_COLOR ++# ifdef MENU_COLOR_REGEX ++ "menu colors via regular expressions", ++# else ++ "menu colors via pmatch", ++# endif ++#endif + #ifdef GNUDOS + "MSDOS protected mode", + #endif +diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/win/tty/wintty.c nethack-3.4.3-menucolor/win/tty/wintty.c +--- nethack-3.4.3-orig/win/tty/wintty.c 2003-12-09 17:23:52.000000000 +0200 ++++ nethack-3.4.3-menucolor/win/tty/wintty.c 2003-12-10 05:25:46.000000000 +0200 +@@ -125,6 +125,10 @@ + static char winpanicstr[] = "Bad window id %d"; + char defmorestr[] = "--More--"; + ++#ifdef MENU_COLOR ++extern struct menucoloring *menu_colorings; ++#endif ++ + #ifdef CLIPPING + # if defined(USE_TILES) && defined(MSDOS) + boolean clipping = FALSE; /* clipping on? */ +@@ -1128,6 +1132,28 @@ + } + } + ++#ifdef MENU_COLOR ++STATIC_OVL boolean ++get_menu_coloring(str, color, attr) ++char *str; ++int *color, *attr; ++{ ++ struct menucoloring *tmpmc; ++ if (iflags.use_menu_color) ++ for (tmpmc = menu_colorings; tmpmc; tmpmc = tmpmc->next) ++# ifdef MENU_COLOR_REGEX ++ if (re_search(&tmpmc->match, str, strlen(str), 0, 9999, 0) >= 0) { ++# else ++ if (pmatch(tmpmc->match, str)) { ++# endif ++ *color = tmpmc->color; ++ *attr = tmpmc->attr; ++ return TRUE; ++ } ++ return FALSE; ++} ++#endif /* MENU_COLOR */ ++ + STATIC_OVL void + process_menu_window(window, cw) + winid window; +@@ -1204,6 +1230,10 @@ + for (page_lines = 0, curr = page_start; + curr != page_end; + page_lines++, curr = curr->next) { ++#ifdef MENU_COLOR ++ int color = NO_COLOR, attr = ATR_NONE; ++ boolean menucolr = FALSE; ++#endif + if (curr->selector) + *rp++ = curr->selector; + +@@ -1219,6 +1249,13 @@ + * actually output the character. We're faster doing + * this. + */ ++#ifdef MENU_COLOR ++ if (iflags.use_menu_color && ++ (menucolr = get_menu_coloring(curr->str, &color,&attr))) { ++ term_start_attr(attr); ++ if (color != NO_COLOR) term_start_color(color); ++ } else ++#endif + term_start_attr(curr->attr); + for (n = 0, cp = curr->str; + #ifndef WIN32CON +@@ -1236,6 +1273,12 @@ + (void) putchar('#'); /* count selected */ + } else + (void) putchar(*cp); ++#ifdef MENU_COLOR ++ if (iflags.use_menu_color && menucolr) { ++ if (color != NO_COLOR) term_end_color(); ++ term_end_attr(attr); ++ } else ++#endif + term_end_attr(curr->attr); + } + } else { --- nethack-3.4.3.orig/debian/patches/15_recover_errormsg.dpatch +++ nethack-3.4.3/debian/patches/15_recover_errormsg.dpatch @@ -0,0 +1,107 @@ +#! /bin/sh -e +## 15_recover_errormsg.dpatch by Ian Jackson +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Be a little bit more useful with recover's error messages + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +--- nethack/util/recover.c~ 2003-10-18 16:08:36.000000000 -0700 ++++ nethack/util/recover.c 2003-10-18 16:18:46.000000000 -0700 +@@ -39,7 +39,7 @@ + #define Fprintf (void)nhce_message + static void nhce_message(FILE*, const char*, ...); + #endif +- ++#define Perror (void)perror + #define Close (void)close + + #ifdef UNIX +@@ -65,6 +65,7 @@ + #endif + char savename[SAVESIZE]; /* holds relative path of save file from playground */ + ++const char *dir = (char*)0; + + int + main(argc, argv) +@@ -72,7 +73,6 @@ + char *argv[]; + { + int argno; +- const char *dir = (char *)0; + #ifdef AMIGA + char *startdir = (char *)0; + #endif +@@ -138,7 +138,8 @@ + startdir = getcwd(0,255); + #endif + if (dir && chdir((char *) dir) < 0) { +- Fprintf(stderr, "%s: cannot chdir to %s.\n", argv[0], dir); ++ Fprintf(stderr, "%s: cannot chdir:", argv[0]); ++ Perror(dir); + exit(EXIT_FAILURE); + } + +@@ -275,7 +276,9 @@ + Fprintf(stderr, + "\nTrouble accessing level 0 (errno = %d).\n", errno); + #endif +- Fprintf(stderr, "Cannot open level 0 for %s.\n", basename); ++ Fprintf(stderr, "Cannot open level 0 for %s in directory %s: ", ++ basename, dir); ++ Perror(lock); + return(-1); + } + if (read(gfd, (genericptr_t) &hpid, sizeof hpid) != sizeof hpid) { +@@ -297,7 +300,8 @@ + != sizeof savename) || + (read(gfd, (genericptr_t) &version_data, sizeof version_data) + != sizeof version_data)) { +- Fprintf(stderr, "Error reading %s -- can't recover.\n", lock); ++ Fprintf(stderr, "Error reading, can't recover: "); ++ Perror(lock); + Close(gfd); + return(-1); + } +@@ -310,14 +314,16 @@ + */ + sfd = create_savefile(); + if (sfd < 0) { +- Fprintf(stderr, "Cannot create savefile %s.\n", savename); ++ Fprintf(stderr, "Cannot create savefile in %s: ", dir); ++ Perror(savename); + Close(gfd); + return(-1); + } + + lfd = open_levelfile(savelev); + if (lfd < 0) { +- Fprintf(stderr, "Cannot open level of save for %s.\n", basename); ++ Fprintf(stderr, "Cannot open level of save for %s: ", basename); ++ Perror(lock); + Close(gfd); + Close(sfd); + return(-1); +@@ -325,7 +331,8 @@ + + if (write(sfd, (genericptr_t) &version_data, sizeof version_data) + != sizeof version_data) { +- Fprintf(stderr, "Error writing %s; recovery failed.\n", savename); ++ Fprintf(stderr, "Error writing, recovery failed: "); ++ Perror(savename); + Close(gfd); + Close(sfd); + return(-1); --- nethack-3.4.3.orig/debian/patches/01_fix_qt.dpatch +++ nethack-3.4.3/debian/patches/01_fix_qt.dpatch @@ -0,0 +1,41 @@ +#! /bin/sh -e +## 01_qt_fixes.dpatch by Joshua Kwan +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Various accumulated Qt fixes. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +--- nethack-3.4.1.orig/win/Qt/qt_win.cpp ++++ nethack-3.4.1/win/Qt/qt_win.cpp +@@ -58,6 +58,7 @@ + #include "patchlevel.h" + #include "tile2x11.h" + #undef Warning ++#undef Invisible + #undef red + #undef green + #undef blue +--- nethack-3.4.1.orig/include/qt_win.h ++++ nethack-3.4.1/include/qt_win.h +@@ -34,7 +34,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #if QT_VERSION >= 300 --- nethack-3.4.3.orig/debian/patches/94_enh_sortloot.dpatch +++ nethack-3.4.3/debian/patches/94_enh_sortloot.dpatch @@ -0,0 +1,561 @@ +#! /bin/sh -e +## 94_enh_sortloot.dpatch by Jeroen Demeyer and Jukka Lahtinen +## from: http://www.netsonic.fi/~walker/nh/sortloot-343.diff +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Sort item lists alphabetically + +if [ $# -lt 1 ]; then + echo "`basename $0`: script expects -patch|-unpatch as argument" >&2 + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}" + +case "$1" in + -patch) patch -p1 ${patch_opts} < $0;; + -unpatch) patch -R -p1 ${patch_opts} < $0;; + *) + echo "`basename $0`: script expects -patch|-unpatch as argument" >&2 + exit 1;; +esac + +exit 0 + +diff -urd nethack-3.4.3/dat/opthelp nh343sortl/dat/opthelp +--- nethack-3.4.3/dat/opthelp 2003-12-08 01:39:13.000000000 +0200 ++++ nh343sortl/dat/opthelp 2004-01-09 17:41:16.000000000 +0200 +@@ -132,6 +132,11 @@ + scores the parts of the score list you wish to see when the game ends + You choose a combination of top scores, scores around the top + scores, and all of your own scores. [!own/3 top/2 around] ++sortloot controls the sortloot patch [none]: ++ full -- All pickup lists of items are sorted by item description ++ loot -- When inventory letters are shown, has no effect. ++ Otherwise sorts by description ++ none -- Works the traditional way, like without the patch + suppress_alert disable various version-specific warnings about changes + in game play or the user interface, such as notification given + for the 'Q' command that quitting is now done via #quit +diff -urd nethack-3.4.3/doc/Guidebook.mn nh343sortl/doc/Guidebook.mn +--- nethack-3.4.3/doc/Guidebook.mn 2003-12-08 01:39:13.000000000 +0200 ++++ nh343sortl/doc/Guidebook.mn 2004-01-09 17:41:16.000000000 +0200 +@@ -2111,6 +2111,18 @@ + Show your approximate accumulated score on bottom line (default off). + .lp "silent " + Suppress terminal beeps (default on). ++.lp sortloot ++Controls the behavior of the sortloot patch that sorts pickup lists for ++inventory and #loot commands and some others. ++The possible values are: ++.sd ++.si ++full - always sort the lists; ++loot - only sort the lists that don't use inventory ++ letters, like with the #loot and pickup commands; ++none - show lists the traditional way without sorting. ++.ei ++.ed + .lp sortpack + Sort the pack contents by type when displaying inventory (default on). + .lp sound +diff -urd nethack-3.4.3/doc/Guidebook.tex nh343sortl/doc/Guidebook.tex +--- nethack-3.4.3/doc/Guidebook.tex 2003-12-08 01:39:13.000000000 +0200 ++++ nh343sortl/doc/Guidebook.tex 2004-01-09 17:41:16.000000000 +0200 +@@ -2589,6 +2589,21 @@ + \item[\ib{silent}] + Suppress terminal beeps (default on). + %.lp ++\item[\ib{sortloot}] ++Controls the behavior of the sortloot patch that sorts pickup lists for ++inventory and \#loot commands and some others. ++ ++The possible values are: ++%.sd ++%.si ++{\tt full} --- always sort the lists;\\ ++{\tt loot} --- only sort the lists that don't use inventory ++ letters, like with the \#loot and pickup commands;\\ ++{\tt none} --- show lists the traditional way without sorting. ++%.ei ++%.ed ++%.lp ++The default is 'none', the way an unpatched game works. + \item[\ib{sortpack}] + Sort the pack contents by type when displaying inventory (default on). + %.lp +diff -urd nethack-3.4.3/doc/Guidebook.txt nh343sortl/doc/Guidebook.txt +--- nethack-3.4.3/doc/Guidebook.txt 2003-12-08 01:39:13.000000000 +0200 ++++ nh343sortl/doc/Guidebook.txt 2004-01-09 17:41:16.000000000 +0200 +@@ -2739,6 +2739,18 @@ + silent + Suppress terminal beeps (default on). + ++ sortloot ++ Controls the behavior of the sortloot patch that sorts ++ pickup lists for inventory and #loot commands and some ++ others. ++ The possible values are: ++ ++ full - always sort the lists ++ loot - only sort the lists that don't use inventory ++ letters, like with the #loot and pickup commands ++ none - show lists the traditional way without sorting ++ The default is 'none', the way an unpatched game works. ++ + sortpack + Sort the pack contents by type when displaying inventory (de- + fault on). +diff -urd nethack-3.4.3/include/extern.h nh343sortl/include/extern.h +--- nethack-3.4.3/include/extern.h 2003-12-08 01:39:13.000000000 +0200 ++++ nh343sortl/include/extern.h 2004-01-09 17:46:28.000000000 +0200 +@@ -1378,6 +1378,9 @@ + E boolean FDECL(not_fully_identified, (struct obj *)); + E char *FDECL(corpse_xname, (struct obj *,BOOLEAN_P)); + E char *FDECL(cxname, (struct obj *)); ++#ifdef SORTLOOT ++E char *FDECL(cxname2, (struct obj *)); ++#endif + E char *FDECL(killer_xname, (struct obj *)); + E const char *FDECL(singular, (struct obj *,char *(*)(OBJ_P))); + E char *FDECL(an, (const char *)); +diff -urd nethack-3.4.3/include/flag.h nh343sortl/include/flag.h +--- nethack-3.4.3/include/flag.h 2003-12-08 01:39:13.000000000 +0200 ++++ nh343sortl/include/flag.h 2004-01-09 17:41:16.000000000 +0200 +@@ -222,6 +222,9 @@ + boolean lan_mail; /* mail is initialized */ + boolean lan_mail_fetched; /* mail is awaiting display */ + #endif ++#ifdef SORTLOOT ++ char sortloot; /* sort items to loot alphabetically */ ++#endif + #ifdef PARANOID + boolean paranoid_hit; /* Ask for 'yes' when hitting peacefuls */ + #endif +diff -urd nethack-3.4.3/src/end.c nh343sortl/src/end.c +--- nethack-3.4.3/src/end.c 2003-12-08 01:39:13.000000000 +0200 ++++ nh343sortl/src/end.c 2004-01-09 17:46:28.000000000 +0200 +@@ -1065,6 +1065,11 @@ + boolean identified, all_containers; + { + register struct obj *box, *obj; ++#ifdef SORTLOOT ++ struct obj **oarray; ++ int i,j,n; ++ char *invlet; ++#endif /* SORTLOOT */ + char buf[BUFSZ]; + + for (box = list; box; box = box->nobj) { +@@ -1073,13 +1073,52 @@ + continue; /* wrong type of container */ + } else if (box->cobj) { + winid tmpwin = create_nhwindow(NHW_MENU); ++#ifdef SORTLOOT ++ /* count the number of items */ ++ for (n = 0, obj = box->cobj; obj; obj = obj->nobj) n++; ++ /* Make a temporary array to store the objects sorted */ ++ oarray = (struct obj **) alloc(n*sizeof(struct obj*)); ++ ++ /* Add objects to the array */ ++ i = 0; ++ invlet = flags.inv_order; ++ nextclass: ++ for (obj = box->cobj; obj; obj = obj->nobj) { ++ if (!flags.sortpack || obj->oclass == *invlet) { ++ if (iflags.sortloot == 'f' ++ || iflags.sortloot == 'l') { ++ /* Insert object at correct index */ ++ for (j = i; j; j--) { ++ if (strcmpi(cxname2(obj), cxname2(oarray[j-1]))>0 ++ || (flags.sortpack && ++ oarray[j-1]->oclass != obj->oclass)) ++ break; ++ oarray[j] = oarray[j-1]; ++ } ++ oarray[j] = obj; ++ i++; ++ } else { ++ /* Just add it to the array */ ++ oarray[i++] = obj; ++ } ++ } ++ } /* for loop */ ++ if (flags.sortpack) { ++ if (*++invlet) goto nextclass; ++ } ++#endif /* SORTLOOT */ + Sprintf(buf, "Contents of %s:", the(xname(box))); + putstr(tmpwin, 0, buf); + putstr(tmpwin, 0, ""); + #ifdef DUMP_LOG + if (dump_fp) dump("", buf); + #endif ++#ifdef SORTLOOT ++ for (i = 0; i < n; i++) { ++ obj = oarray[i]; ++#else + for (obj = box->cobj; obj; obj = obj->nobj) { ++#endif + if (identified) { + makeknown(obj->otyp); + obj->known = obj->bknown = +diff -urd nethack-3.4.3/src/invent.c nh343sortl/src/invent.c +--- nethack-3.4.3/src/invent.c 2003-12-08 01:39:13.000000000 +0200 ++++ nh343sortl/src/invent.c 2004-01-09 17:46:28.000000000 +0200 +@@ -1713,7 +1713,11 @@ + long* out_cnt; + #endif + { + struct obj *otmp; ++#ifdef SORTLOOT ++ struct obj **oarray; ++ int i, j; ++#endif + char ilet, ret; + char *invlet = flags.inv_order; + int n, classcount; +@@ -1793,10 +1797,66 @@ + return ret; + } + ++#ifdef SORTLOOT ++ /* count the number of items */ ++ for (n = 0, otmp = invent; otmp; otmp = otmp->nobj) ++ if(!lets || !*lets || index(lets, otmp->invlet)) n++; ++ ++ /* Make a temporary array to store the objects sorted */ ++ oarray = (struct obj **)alloc(n*sizeof(struct obj*)); ++ ++ /* Add objects to the array */ ++ i = 0; ++ for(otmp = invent; otmp; otmp = otmp->nobj) ++ if(!lets || !*lets || index(lets, otmp->invlet)) { ++ if (iflags.sortloot == 'f') { ++ /* Insert object at correct index */ ++ for (j = i; j; j--) { ++ if (strcmpi(cxname2(otmp), cxname2(oarray[j-1]))>0) break; ++ oarray[j] = oarray[j-1]; ++ } ++ oarray[j] = otmp; ++ i++; ++ } else { ++ /* Just add it to the array */ ++ oarray[i++] = otmp; ++ } ++ } ++#endif /* SORTLOOT */ ++ + start_menu(win); + nextclass: + classcount = 0; + any.a_void = 0; /* set all bits to zero */ ++#ifdef SORTLOOT ++ for(i = 0; i < n; i++) { ++ otmp = oarray[i]; ++ ilet = otmp->invlet; ++ if (!flags.sortpack || otmp->oclass == *invlet) { ++ if (flags.sortpack && !classcount) { ++ any.a_void = 0; /* zero */ ++ add_menu(win, NO_GLYPH, &any, 0, 0, ATR_INVERSE, ++ let_to_name(*invlet, FALSE), MENU_UNSELECTED); ++#ifdef DUMP_LOG ++ if (want_dump) ++ dump(" ", let_to_name(*invlet, FALSE)); ++#endif ++ classcount++; ++ } ++ any.a_char = ilet; ++ add_menu(win, obj_to_glyph(otmp), ++ &any, ilet, 0, ATR_NONE, doname(otmp), ++ MENU_UNSELECTED); ++#ifdef DUMP_LOG ++ if (want_dump) { ++ char letbuf[7]; ++ sprintf(letbuf, " %c - ", ilet); ++ dump(letbuf, doname(otmp)); ++ } ++#endif ++ } ++ } ++#else /* SORTLOOT */ + for(otmp = invent; otmp; otmp = otmp->nobj) { + ilet = otmp->invlet; + if(!lets || !*lets || index(lets, ilet)) { +@@ -1825,6 +1885,7 @@ + } + } + } ++#endif /* SORTLOOT */ + if (flags.sortpack) { + if (*++invlet) goto nextclass; + #ifdef WIZARD +@@ -1834,6 +1895,9 @@ + } + #endif + } ++#ifdef SORTLOOT ++ free(oarray); ++#endif + end_menu(win, (char *) 0); + + n = select_menu(win, want_reply ? PICK_ONE : PICK_NONE, &selected); +diff -urd nethack-3.4.3/src/objnam.c nh343sortl/src/objnam.c +--- nethack-3.4.3/src/objnam.c 2003-12-08 01:39:13.000000000 +0200 ++++ nh343sortl/src/objnam.c 2004-01-14 18:23:51.000000000 +0200 +@@ -15,6 +15,9 @@ + #endif + static char *NDECL(nextobuf); + static void FDECL(add_erosion_words, (struct obj *, char *)); ++#ifdef SORTLOOT ++char * FDECL(xname2, (struct obj *, boolean)); ++#endif + + struct Jitem { + int item; +@@ -233,6 +236,15 @@ + char * + xname(obj) + register struct obj *obj; ++#ifdef SORTLOOT ++{ ++ return xname2(obj, FALSE); ++} ++char * ++xname2(obj, ignore_oquan) ++register struct obj *obj; ++boolean ignore_oquan; ++#endif + { + register char *buf; + register int typ = obj->otyp; +@@ -469,6 +481,9 @@ + default: + Sprintf(buf,"glorkum %d %d %d", obj->oclass, typ, obj->spe); + } ++#ifdef SORTLOOT ++ if (!ignore_oquan) ++#endif + if (obj->quan != 1L) Strcpy(buf, makeplural(buf)); + + if (obj->onamelth && obj->dknown) { +@@ -853,6 +868,16 @@ + return corpse_xname(obj, FALSE); + return xname(obj); + } ++#ifdef SORTLOOT ++char * ++cxname2(obj) ++struct obj *obj; ++{ ++ if (obj->otyp == CORPSE) ++ return corpse_xname(obj, TRUE); ++ return xname2(obj, TRUE); ++} ++#endif /* SORTLOOT */ + + /* treat an object as fully ID'd when it might be used as reason for death */ + char * +diff -urd nethack-3.4.3/src/options.c nh343sortl/src/options.c +--- nethack-3.4.3/src/options.c 2003-12-08 01:39:13.000000000 +0200 ++++ nh343sortl/src/options.c 2004-01-09 17:41:16.000000000 +0200 +@@ -330,6 +330,9 @@ + { "scroll_amount", "amount to scroll map when scroll_margin is reached", + 20, DISP_IN_GAME }, /*WC*/ + { "scroll_margin", "scroll map when this far from the edge", 20, DISP_IN_GAME }, /*WC*/ ++#ifdef SORTLOOT ++ { "sortloot", "sort object selection lists by description", 4, SET_IN_GAME }, ++#endif + #ifdef MSDOS + { "soundcard", "type of sound card to use", 20, SET_IN_FILE }, + #endif +@@ -562,6 +565,10 @@ + flags.pickup_types[0] = '\0'; + flags.pickup_burden = MOD_ENCUMBER; + ++#ifdef SORTLOOT ++ iflags.sortloot = 'n'; ++#endif ++ + for (i = 0; i < NUM_DISCLOSURE_OPTIONS; i++) + flags.end_disclose[i] = DISCLOSE_PROMPT_DEFAULT_NO; + switch_graphics(ASCII_GRAPHICS); /* set default characters */ +@@ -2002,6 +2009,24 @@ + return; + } + ++#ifdef SORTLOOT ++ fullname = "sortloot"; ++ if (match_optname(opts, fullname, 4, TRUE)) { ++ op = string_for_env_opt(fullname, opts, FALSE); ++ if (op) { ++ switch (tolower(*op)) { ++ case 'n': ++ case 'l': ++ case 'f': iflags.sortloot = tolower(*op); ++ break; ++ default: badoption(opts); ++ return; ++ } ++ } ++ return; ++ } ++#endif /* SORTLOOT */ ++ + fullname = "suppress_alert"; + if (match_optname(opts, fullname, 4, TRUE)) { + op = string_for_opt(opts, negated); +@@ -2426,6 +2451,12 @@ + "teleport", "run", "walk", "crawl" + }; + ++#ifdef SORTLOOT ++static NEARDATA const char *sortltype[] = { ++ "none", "loot", "full" ++}; ++#endif ++ + /* + * Convert the given string of object classes to a string of default object + * symbols. +@@ -2703,7 +2734,7 @@ + boolean retval = FALSE; + + /* Special handling of menustyle, pickup_burden, pickup_types, +- * disclose, runmode, msg_window, menu_headings, and number_pad options. ++ * disclose, runmode, msg_window, menu_headings, number_pad and sortloot + #ifdef AUTOPICKUP_EXCEPTIONS + * Also takes care of interactive autopickup_exception_handling changes. + #endif +@@ -2858,6 +2889,26 @@ + } + destroy_nhwindow(tmpwin); + retval = TRUE; ++#ifdef SORTLOOT ++ } else if (!strcmp("sortloot", optname)) { ++ const char *sortl_name; ++ menu_item *sortl_pick = (menu_item *)0; ++ tmpwin = create_nhwindow(NHW_MENU); ++ start_menu(tmpwin); ++ for (i = 0; i < SIZE(sortltype); i++) { ++ sortl_name = sortltype[i]; ++ any.a_char = *sortl_name; ++ add_menu(tmpwin, NO_GLYPH, &any, *sortl_name, 0, ++ ATR_NONE, sortl_name, MENU_UNSELECTED); ++ } ++ end_menu(tmpwin, "Select loot sorting type:"); ++ if (select_menu(tmpwin, PICK_ONE, &sortl_pick) > 0) { ++ iflags.sortloot = sortl_pick->item.a_char; ++ free((genericptr_t)sortl_pick); ++ } ++ destroy_nhwindow(tmpwin); ++ retval = TRUE; ++#endif + } + #endif + else if (!strcmp("align_message", optname) || +@@ -3239,6 +3290,17 @@ + if (iflags.wc_scroll_margin) Sprintf(buf, "%d",iflags.wc_scroll_margin); + else Strcpy(buf, defopt); + } ++#ifdef SORTLOOT ++ else if (!strcmp(optname, "sortloot")) { ++ char *sortname = (char *)NULL; ++ for (i=0; i < SIZE(sortltype) && sortname==(char *)NULL; i++) { ++ if (iflags.sortloot == sortltype[i][0]) ++ sortname = (char *)sortltype[i]; ++ } ++ if (sortname != (char *)NULL) ++ Sprintf(buf, "%s", sortname); ++ } ++#endif + else if (!strcmp(optname, "player_selection")) + Sprintf(buf, "%s", iflags.wc_player_selection ? "prompts" : "dialog"); + #ifdef MSDOS +diff -urd nethack-3.4.3/src/pickup.c nh343sortl/src/pickup.c +--- nethack-3.4.3/src/pickup.c 2003-12-08 01:39:13.000000000 +0200 ++++ nh343sortl/src/pickup.c 2004-01-09 17:46:28.000000000 +0200 +@@ -690,9 +690,15 @@ + int how; /* type of query */ + boolean FDECL((*allow), (OBJ_P));/* allow function */ + { ++#ifdef SORTLOOT ++ int i, j; ++#endif + int n; + winid win; + struct obj *curr, *last; ++#ifdef SORTLOOT ++ struct obj **oarray; ++#endif + char *pack; + anything any; + boolean printed_type_name; +@@ -717,6 +723,33 @@ + return 1; + } + ++#ifdef SORTLOOT ++ /* Make a temporary array to store the objects sorted */ ++ oarray = (struct obj **)alloc(n*sizeof(struct obj*)); ++ ++ /* Add objects to the array */ ++ i = 0; ++ for (curr = olist; curr; curr = FOLLOW(curr, qflags)) { ++ if ((*allow)(curr)) { ++ if (iflags.sortloot == 'f' || ++ (iflags.sortloot == 'l' && !(qflags & USE_INVLET))) ++ { ++ /* Insert object at correct index */ ++ for (j = i; j; j--) ++ { ++ if (strcmpi(cxname2(curr), cxname2(oarray[j-1]))>0) break; ++ oarray[j] = oarray[j-1]; ++ } ++ oarray[j] = curr; ++ i++; ++ } else { ++ /* Just add it to the array */ ++ oarray[i++] = curr; ++ } ++ } ++ } ++#endif /* SORTLOOT */ ++ + win = create_nhwindow(NHW_MENU); + start_menu(win); + any.a_obj = (struct obj *) 0; +@@ -730,7 +763,12 @@ + pack = flags.inv_order; + do { + printed_type_name = FALSE; ++#ifdef SORTLOOT ++ for (i = 0; i < n; i++) { ++ curr = oarray[i]; ++#else /* SORTLOOT */ + for (curr = olist; curr; curr = FOLLOW(curr, qflags)) { ++#endif /* SORTLOOT */ + if ((qflags & FEEL_COCKATRICE) && curr->otyp == CORPSE && + will_feel_cockatrice(curr, FALSE)) { + destroy_nhwindow(win); /* stop the menu and revert */ +@@ -758,6 +796,9 @@ + pack++; + } while (qflags & INVORDER_SORT && *pack); + ++#ifdef SORTLOOT ++ free(oarray); ++#endif + end_menu(win, qstr); + n = select_menu(win, how, pick_list); + destroy_nhwindow(win); +--- nethack-3.4.3/include/config.h~ 2004-07-11 00:41:08.000000000 -0700 ++++ nethack-3.4.3/include/config.h 2004-07-11 00:41:54.000000000 -0700 +@@ -342,6 +342,7 @@ + #define PARANOID + + #define HPMON /* Color HP monitor */ ++#define SORTLOOT /* Sort yer loot by alphabetical order, not index */ + + /* #define SCORE_ON_BOTL */ /* added by Gary Erickson (erickson@ucivax) */ + --- nethack-3.4.3.orig/debian/patches/09_use_gnu_source.dpatch +++ nethack-3.4.3/debian/patches/09_use_gnu_source.dpatch @@ -0,0 +1,30 @@ +#! /bin/sh -e +## 09_use_gnu_source.dpatch by Joshua Kwan +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Define _GNU_SOURCE for RTLD_NEXT. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +--- a/sys/unix/unixres.c~ 2003-10-06 22:02:16.000000000 -0700 ++++ b/sys/unix/unixres.c 2003-10-06 22:02:33.000000000 -0700 +@@ -21,6 +21,7 @@ + # if defined(LINUX) + + /* requires dynamic linking with libc */ ++#define _GNU_SOURCE + #include + + static int --- nethack-3.4.3.orig/debian/patches/13_simple_mail.dpatch +++ nethack-3.4.3/debian/patches/13_simple_mail.dpatch @@ -0,0 +1,234 @@ +#! /bin/sh -e +## 13_simple_mail.dpatch by Joshua Kwan +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Simple mail + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --dry-run -p1 < $0 && patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --dry-run -R -p1 < $0 && patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +diff -urN orig/nethack-3.4.3/include/decl.h nethack-3.4.3/include/decl.h +--- orig/nethack-3.4.3/include/decl.h 2003-12-07 15:39:13.000000000 -0800 ++++ nethack-3.4.3/include/decl.h 2004-01-03 15:57:34.000000000 -0800 +@@ -385,6 +385,10 @@ + }; + #endif /* AUTOPICKUP_EXCEPTIONS */ + ++#ifdef SIMPLE_MAIL ++E int mailckfreq; ++#endif ++ + #undef E + + #endif /* DECL_H */ +diff -urN orig/nethack-3.4.3/include/flag.h nethack-3.4.3/include/flag.h +--- orig/nethack-3.4.3/include/flag.h 2003-12-07 15:39:13.000000000 -0800 ++++ nethack-3.4.3/include/flag.h 2004-01-03 15:57:34.000000000 -0800 +@@ -175,6 +175,9 @@ + uchar bouldersym; /* symbol for boulder display */ + boolean travel1; /* first travel step */ + coord travelcc; /* coordinates for travel_cache */ ++#ifdef SIMPLE_MAIL ++ boolean simplemail; /* simple mail format $NAME:$MESSAGE */ ++#endif + #ifdef WIZARD + boolean sanity_check; /* run sanity checks */ + boolean mon_polycontrol; /* debug: control monster polymorphs */ +diff -urN orig/nethack-3.4.3/include/unixconf.h nethack-3.4.3/include/unixconf.h +--- orig/nethack-3.4.3/include/unixconf.h 2003-12-07 15:39:13.000000000 -0800 ++++ nethack-3.4.3/include/unixconf.h 2004-01-03 15:57:34.000000000 -0800 +@@ -193,7 +193,6 @@ + # endif + #endif + +-#define MAILCKFREQ 50 + #endif /* MAIL */ + + +diff -urN orig/nethack-3.4.3/src/mail.c nethack-3.4.3/src/mail.c +--- orig/nethack-3.4.3/src/mail.c 2003-12-07 15:39:13.000000000 -0800 ++++ nethack-3.4.3/src/mail.c 2004-01-03 16:07:21.000000000 -0800 +@@ -5,6 +5,8 @@ + #include "hack.h" + + #ifdef MAIL ++#include ++#include + #include "mail.h" + + /* +@@ -36,6 +38,8 @@ + STATIC_DCL boolean FDECL(md_rush,(struct monst *,int,int)); + STATIC_DCL void FDECL(newmail, (struct mail_info *)); + ++int mailckfreq = 0; ++ + extern char *viz_rmin, *viz_rmax; /* line-of-sight limits (vision.c) */ + + #ifdef OVL0 +@@ -464,11 +468,15 @@ + void + ckmailstatus() + { ++#ifdef SIMPLE_MAIL ++ if (mailckfreq == 0) ++ mailckfreq = (iflags.simplemail ? 5 : 10); ++#else ++ mailckfreq = 10; ++#endif ++ + if(!mailbox || u.uswallow || !flags.biff +-# ifdef MAILCKFREQ +- || moves < laststattime + MAILCKFREQ +-# endif +- ) ++ || moves < laststattime + mailckfreq) + return; + + laststattime = moves; +@@ -501,9 +509,68 @@ + readmail(otmp) + struct obj *otmp; + { +-# ifdef DEF_MAILREADER /* This implies that UNIX is defined */ ++#ifdef DEF_MAILREADER + register const char *mr = 0; ++#endif /* DEF_MAILREADER */ ++#ifdef SIMPLE_MAIL ++ if (iflags.simplemail) ++ { ++ FILE* mb = fopen(mailbox, "r"); ++ char curline[102], *msg; ++ boolean seen_one_already = FALSE; ++ struct flock fl = { 0 }; ++ ++ fl.l_type = F_RDLCK; ++ fl.l_whence = SEEK_SET; ++ fl.l_start = 0; ++ fl.l_len = 0; ++ ++ if (!mb) ++ goto bail; ++ ++ /* Allow this call to block. */ ++ if (fcntl (fileno (mb), F_SETLKW, &fl) == -1) ++ goto bail; ++ ++ errno = 0; ++ ++ while (fgets(curline, 102, mb) != NULL) ++ { ++ fl.l_type = F_UNLCK; ++ fcntl (fileno(mb), F_UNLCK, &fl); ++ ++ pline("There is a%s message on this scroll.", ++ seen_one_already ? "nother" : ""); ++ ++ msg = strchr(curline, ':'); ++ ++ if (!msg) ++ goto bail; ++ ++ *msg = '\0'; ++ msg++; ++ ++ pline ("This message is from '%s'.", curline); ++ ++ msg[strlen(msg) - 1] = '\0'; /* kill newline */ ++ pline ("It reads: \"%s\".", msg); ++ ++ seen_one_already = TRUE; ++ errno = 0; ++ ++ fl.l_type = F_RDLCK; ++ fcntl(fileno(mb), F_SETLKW, &fl); ++ } + ++ fl.l_type = F_UNLCK; ++ fcntl(fileno(mb), F_UNLCK, &fl); ++ ++ fclose(mb); ++ unlink(mailbox); ++ return; ++ } ++# endif /* SIMPLE_MAIL */ ++# ifdef DEF_MAILREADER /* This implies that UNIX is defined */ + display_nhwindow(WIN_MESSAGE, FALSE); + if(!(mr = nh_getenv("MAILREADER"))) + mr = DEF_MAILREADER; +@@ -512,15 +578,21 @@ + (void) execl(mr, mr, (char *)0); + terminate(EXIT_FAILURE); + } +-# else +-# ifndef AMS /* AMS mailboxes are directories */ ++# else ++# ifndef AMS /* AMS mailboxes are directories */ + display_file(mailbox, TRUE); +-# endif /* AMS */ +-# endif /* DEF_MAILREADER */ ++# endif /* AMS */ ++# endif /* DEF_MAILREADER */ + + /* get new stat; not entirely correct: there is a small time + window where we do not see new mail */ + getmailstatus(); ++ return; ++ ++#ifdef SIMPLE_MAIL ++bail: ++ pline("It appears to be all gibberish."); /* bail out _professionally_ */ ++#endif + } + + # endif /* UNIX */ +@@ -587,10 +659,7 @@ + static int laststattime = 0; + + if(u.uswallow || !flags.biff +-# ifdef MAILCKFREQ +- || moves < laststattime + MAILCKFREQ +-# endif +- ) ++ || moves < laststattime + mailckfreq) + return; + + laststattime = moves; +diff -urN orig/nethack-3.4.3/sys/unix/unixmain.c nethack-3.4.3/sys/unix/unixmain.c +--- orig/nethack-3.4.3/sys/unix/unixmain.c 2003-12-07 15:39:13.000000000 -0800 ++++ nethack-3.4.3/sys/unix/unixmain.c 2004-01-03 15:57:34.000000000 -0800 +@@ -54,7 +54,9 @@ + register char *dir; + #endif + boolean exact_username; +- ++#ifdef SIMPLE_MAIL ++ char* e_simple = NULL; ++#endif + #if defined(__APPLE__) + /* special hack to change working directory to a resource fork when + running from finder --sam */ +@@ -84,6 +86,12 @@ + } + #endif + ++#ifdef SIMPLE_MAIL ++ /* figure this out early */ ++ e_simple = nh_getenv("SIMPLEMAIL"); ++ iflags.simplemail = (e_simple ? 1 : 0); ++#endif ++ + hname = argv[0]; + hackpid = getpid(); + (void) umask(0777 & ~FCMASK); --- nethack-3.4.3.orig/debian/patches/05_makefile_logic.dpatch +++ nethack-3.4.3/debian/patches/05_makefile_logic.dpatch @@ -0,0 +1,165 @@ +#! /bin/sh -e +## 05_makefile_logic.dpatch by Aaron Lehmann +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Move some of the logical burden to make + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +--- nethack-3.4.3/sys/unix/Makefile.src~ 2003-12-22 01:54:52.000000000 -0800 ++++ nethack-3.4.3/sys/unix/Makefile.src 2003-12-22 01:55:01.000000000 -0800 +@@ -125,7 +125,7 @@ + # flags for Linux + # compile normally + # CFLAGS = -O2 -fomit-frame-pointer -I../include +-# LFLAGS = -L/usr/X11R6/lib ++LFLAGS = -L/usr/X11R6/lib + # OR compile backwards compatible a.out format + # CFLAGS = -O2 -b i486-linuxaout -fomit-frame-pointer -I../include + # LFLAGS = -b i486-linuxaout -L/usr/X11R6/lib +@@ -146,18 +146,16 @@ + # directories. The ones given below is the usual spot for linux systems. + # The paths are for glibconfig.h and gnomesupport.h respectively. + # +-GNOMEINC=-I/usr/lib/glib/include -I/usr/lib/gnome-libs/include -I../win/gnome ++GNOMEINC=$(shell gnome-config --cflags gnomeui) + + # flags for debugging: + # CFLAGS = -g -I../include + +-CFLAGS = -O -I../include +-LFLAGS = +- + # The Qt and Be window systems are written in C++, while the rest of + # NetHack is standard C. If using Qt, uncomment the LINK line here to get + # the C++ libraries linked in. +-CXXFLAGS = $(CFLAGS) -I. -I$(QTDIR)/include ++QTDIR = /usr ++CXXFLAGS = $(CFLAGS) -I. -I$(QTDIR)/include/qt3 + CXX=g++ + #LINK=g++ + # For cross-compiling, eg. with gcc on Linux (see also CC further up): +@@ -212,10 +210,41 @@ + # ../win/BeOS/NHMenuWindow.cpp ../win/BeOS/NHMapWindow.cpp tile.c + #WINBEOBJ = winbe.o NHWindow.o NHMenuWindow.o NHMapWindow.o tile.o + ++# Files for the lisp port ++WINLISPSRC = ../win/lisp/winlisp.c tile.c ++WINLISPOBJ = winlisp.o tile.o ++ + # + # +-WINSRC = $(WINTTYSRC) +-WINOBJ = $(WINTTYOBJ) ++ifeq ($(WIN),console) ++ WINSRC = $(WINTTYSRC) ++ WINOBJ = $(WINTTYOBJ) ++ WINLIB = $(WINTTYLIB) ++endif ++ifeq ($(WIN),x11) ++ WINSRC = $(WINTTYSRC) $(WINX11SRC) ++ WINOBJ = $(WINTTYOBJ) $(WINX11OBJ) ++ WINLIB = $(WINTTYLIB) $(WINX11LIB) ++ CFLAGS += -I/usr/X11R6/include -DX11_GRAPHICS ++endif ++ifeq ($(WIN),gnome) ++ WINSRC = $(WINTTYSRC) $(WINGNOMESRC) ++ WINOBJ = $(WINTTYOBJ) $(WINGNOMEOBJ) ++ WINLIB = $(WINTTYLIB) $(WINGNOMELIB) ++ CFLAGS += -DGNOME_GRAPHICS ++endif ++ifeq ($(WIN),qt) ++ WINSRC = $(WINTTYSRC) $(WINQTSRC) ++ WINOBJ = $(WINTTYOBJ) $(WINQTOBJ) ++ WINLIB = $(WINTTYLIB) $(WINQTLIB) ++ CFLAGS += -DQT_GRAPHICS ++endif ++ifeq ($(WIN),lisp) ++ WINSRC = $(WINLISPSRC) ++ WINOBJ = $(WINLISPOBJ) ++ WINLIB = $(WINLISPLIB) ++ CFLAGS += -DLISP_GRAPHICS -DDEFAULT_WINDOW_SYS=\"lisp\" ++endif + + # on some systems the termcap library is in -ltermcap or -lcurses + # on 386 Xenix, the -ltermlib tputs() seems not to work; use -lcurses instead +@@ -230,24 +259,24 @@ + # WINTTYLIB = -ltermcap + # WINTTYLIB = -lcurses + # WINTTYLIB = -lcurses16 +-# WINTTYLIB = -lncurses +-WINTTYLIB = -ltermlib ++WINTTYLIB = -lncurses ++# WINTTYLIB = -ltermlib + # + # libraries for X11 + # If USE_XPM is defined in config.h, you will also need -lXpm here. +-WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11 ++WINX11LIB = -lXaw -lXmu -lXext -lXt -lXpm -lX11 -lm + # WINX11LIB = -lXaw -lXmu -lXt -lX11 + # WINX11LIB = -lXaw -lXmu -lXext -lXt -lXpm -lX11 -lm + # WINX11LIB = -lXaw -lXmu -lXpm -lXext -lXt -lX11 -lSM -lICE -lm # BSD/OS 2.0 + # + # libraries for Qt +-WINQTLIB = -L$(QTDIR)/lib -lqt ++WINQTLIB = -L$(QTDIR)/lib -lqt-mt + # + # libraries for KDE (with Qt) + WINKDELIB = -lkdecore -lkdeui -lXext + # + # libraries for Gnome +-WINGNOMELIB = -lgnomeui -lgnome -lart_lgpl -lgtk -lgdk -lpopt ++WINGNOMELIB = $(shell gnome-config --libs gnomeui) + # + # libraries for Gem port + WINGEMLIB = -le_gem -lgem +@@ -255,8 +284,6 @@ + # libraries for BeOS + WINBELIB = -lbe + +-WINLIB = $(WINTTYLIB) +- + # any other strange libraries your system needs (for Sysunix only -- the more + # specialized targets should already be right) + # +@@ -338,7 +365,7 @@ + GENCSRC = monstr.c vis_tab.c #tile.c + + # all windowing-system-dependent .c (for dependencies and such) +-WINCSRC = $(WINTTYSRC) $(WINX11SRC) $(WINGNOMESRC) $(WINGEMSRC) ++WINCSRC = $(WINTTYSRC) $(WINX11SRC) $(WINGNOMESRC) $(WINGEMSRC) $(WINLISPSRC) + # all windowing-system-dependent .cpp (for dependencies and such) + WINCXXSRC = $(WINQTSRC) $(WINBESRC) + +@@ -683,6 +710,9 @@ + $(CC) $(CFLAGS) -c ../win/gem/load_img.c + gr_rect.o: ../win/gem/gr_rect.c ../include/gr_rect.h + $(CC) $(CFLAGS) -c ../win/gem/gr_rect.c ++winlisp.o: ../win/lisp/winlisp.c $(HACK_H) ../include/winlisp.h \ ++ ../include/func_tab.h ../include/dlb.h ../include/patchlevel.h ++ $(CC) $(CFLAGS) -c ../win/lisp/winlisp.c + tile.o: tile.c $(HACK_H) + qt_win.o: ../win/Qt/qt_win.cpp $(HACK_H) ../include/func_tab.h \ + ../include/dlb.h ../include/patchlevel.h ../include/tile2x11.h \ +@@ -803,7 +833,8 @@ + weapon.o: weapon.c $(HACK_H) + were.o: were.c $(HACK_H) + wield.o: wield.c $(HACK_H) +-windows.o: windows.c $(HACK_H) ../include/wingem.h ../include/winGnome.h ++windows.o: windows.c $(HACK_H) ../include/wingem.h ../include/winGnome.h \ ++ ../include/winlisp.h + wizard.o: wizard.c $(HACK_H) ../include/qtext.h ../include/epri.h + worm.o: worm.c $(HACK_H) ../include/lev.h + worn.o: worn.c $(HACK_H) --- nethack-3.4.3.orig/debian/patches/08_linux_specifics.dpatch +++ nethack-3.4.3/debian/patches/08_linux_specifics.dpatch @@ -0,0 +1,94 @@ +#! /bin/sh -e +## 08_linux_specifics.dpatch by Joshua Kwan +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Debian (and Linux) specifics defined in unixconf.h. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +diff -ur nethack-3.4.3.old/include/unixconf.h nethack-3.4.3/include/unixconf.h +--- nethack-3.4.3.old/include/unixconf.h 2003-12-08 00:39:13.000000000 +0100 ++++ nethack-3.4.3/include/unixconf.h 2005-01-13 17:15:28.000000000 +0100 +@@ -32,12 +32,14 @@ + + + /* define any of the following that are appropriate */ +-#define SVR4 /* use in addition to SYSV for System V Release 4 */ ++/* #define SVR4 */ /* use in addition to SYSV for System V Release 4 */ + /* including Solaris 2+ */ + #define NETWORK /* if running on a networked system */ + /* e.g. Suns sharing a playground through NFS */ + /* #define SUNOS4 */ /* SunOS 4.x */ +-/* #define LINUX */ /* Another Unix clone */ ++#ifdef __linux__ ++#define LINUX /* Another Unix clone */ ++#endif + /* #define CYGWIN32 */ /* Unix on Win32 -- use with case sensitive defines */ + /* #define GENIX */ /* Yet Another Unix Clone */ + /* #define HISX */ /* Bull Unix for XPS Machines */ +@@ -102,7 +104,7 @@ + * If you want the static parts of your playground on a read-only file + * system, define VAR_PLAYGROUND to be where the variable parts are kept. + */ +-/* #define VAR_PLAYGROUND "/var/lib/games/nethack" */ ++#define VAR_PLAYGROUND "/var/games/nethack" + + + /* +@@ -132,7 +134,7 @@ + * "extra output" method is used, but not all systems provide access to + * a fine-grained timer. + */ +-/* #define TIMED_DELAY */ /* usleep() */ ++#define TIMED_DELAY /* usleep() */ + #endif + + /* +@@ -166,7 +168,7 @@ + + /* #define NO_MAILREADER */ /* have mail daemon just tell player of mail */ + +-#ifdef MAIL ++#ifdef MAIL + # if defined(BSD) || defined(ULTRIX) + # ifdef AMS + #define AMS_MAILBOX "/Mailbox" +@@ -189,7 +191,8 @@ + # endif + # endif + # else +-#define DEF_MAILREADER "/bin/mail" ++/* Debian mail reader is /usr/bin/mail, not /bin/mail */ ++#define DEF_MAILREADER "/usr/bin/mail" + # endif + #endif + +diff -ur nethack-3.4.3.old/src/mail.c nethack-3.4.3/src/mail.c +--- nethack-3.4.3.old/src/mail.c 2003-12-08 00:39:13.000000000 +0100 ++++ nethack-3.4.3/src/mail.c 2005-01-13 17:14:01.000000000 +0100 +@@ -68,10 +68,11 @@ + # if !defined(MAILPATH) && defined(AMS) /* Just a placeholder for AMS */ + # define MAILPATH "/dev/null" + # endif +-# if !defined(MAILPATH) && (defined(LINUX) || defined(__osf__)) ++# if !defined(MAILPATH) && defined(__osf__) + # define MAILPATH "/var/spool/mail/" + # endif +-# if !defined(MAILPATH) && defined(__FreeBSD__) ++/* Debian uses /var/mail, too. */ ++# if !defined(MAILPATH) && (defined(__FreeBSD__) || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__)) + # define MAILPATH "/var/mail/" + # endif + # if !defined(MAILPATH) && (defined(BSD) || defined(ULTRIX)) --- nethack-3.4.3.orig/debian/patches/12_lisp_windowing.dpatch +++ nethack-3.4.3/debian/patches/12_lisp_windowing.dpatch @@ -0,0 +1,2330 @@ +#! /bin/sh -e +## 12_lisp_windowing.dpatch by Ben Gertzfield +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Add LISP-based windowing system + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +Redistribution and use in source and binary forms, with or without modification, are permitted +provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials provided + with the distribution. + 3. The name of the author may not be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--- /dev/null 2003-05-01 12:00:27.000000000 -0700 ++++ nethack/include/winlisp.h 2002-01-10 19:54:20.000000000 -0800 +@@ -0,0 +1,70 @@ ++#ifndef WINLISP_H ++#define WINLISP_H ++ ++#ifndef E ++#define E extern ++#endif ++ ++#if defined(BOS) || defined(NHSTDC) ++#define DIMENSION_P int ++#else ++# ifdef WIDENED_PROTOTYPES ++#define DIMENSION_P unsigned int ++# else ++#define DIMENSION_P Dimension ++# endif ++#endif ++ ++extern struct window_procs tty_procs; ++ ++/* ### winlisp.c ### */ ++E void NDECL(win_lisp_init); ++E void FDECL(lisp_init_nhwindows, (int *, char **)); ++E void NDECL(lisp_player_selection); ++E void NDECL(lisp_askname); ++E void NDECL(lisp_get_nh_event) ; ++E void FDECL(lisp_exit_nhwindows, (const char *)); ++E void FDECL(lisp_suspend_nhwindows, (const char *)); ++E void NDECL(lisp_resume_nhwindows); ++E winid FDECL(lisp_create_nhwindow, (int)); ++E void FDECL(lisp_clear_nhwindow, (winid)); ++E void FDECL(lisp_display_nhwindow, (winid, BOOLEAN_P)); ++E void FDECL(lisp_destroy_nhwindow, (winid)); ++E void FDECL(lisp_curs, (winid,int,int)); ++E void FDECL(lisp_putstr, (winid, int, const char *)); ++E void FDECL(lisp_display_file, (const char *, BOOLEAN_P)); ++E void FDECL(lisp_start_menu, (winid)); ++E void FDECL(lisp_add_menu, (winid,int,const ANY_P *, ++ CHAR_P, CHAR_P, int, const char *, BOOLEAN_P)); ++E void FDECL(lisp_end_menu, (winid, const char *)); ++E int FDECL(lisp_select_menu, (winid, int, MENU_ITEM_P **)); ++E char FDECL(lisp_message_menu, (char, int, const char *mesg)); ++E void NDECL(lisp_update_inventory); ++E void NDECL(lisp_mark_synch); ++E void NDECL(lisp_wait_synch); ++#ifdef CLIPPING ++E void FDECL(lisp_cliparound, (int, int)); ++#endif ++#ifdef POSITIONBAR ++E void FDECL(lisp_update_positionbar, (char *)); ++#endif ++E void FDECL(lisp_print_glyph, (winid,XCHAR_P,XCHAR_P,int)); ++E void FDECL(lisp_raw_print, (const char *)); ++E void FDECL(lisp_raw_print_bold, (const char *)); ++E int NDECL(lisp_nhgetch); ++E int FDECL(lisp_nh_poskey, (int *, int *, int *)); ++E void NDECL(lisp_nhbell); ++E int NDECL(lisp_doprev_message); ++E char FDECL(lisp_yn_function, (const char *, const char *, CHAR_P)); ++E void FDECL(lisp_getlin, (const char *,char *)); ++E int NDECL(lisp_get_ext_cmd); ++E void FDECL(lisp_number_pad, (int)); ++E void NDECL(lisp_delay_output); ++ ++/* other defs that really should go away (they're tty specific) */ ++E void NDECL(lisp_start_screen); ++E void NDECL(lisp_end_screen); ++ ++E void FDECL(lisp_outrip, (winid,int)); ++ ++#endif /* WINLISP_H */ +--- nethack-3.4.2/src/windows.c 2003-08-29 17:07:43.000000000 -0700 ++++ nethack/src/windows.c 2002-04-23 17:44:58.000000000 -0700 +@@ -40,6 +40,10 @@ + #ifdef MSWIN_GRAPHICS + extern struct window_procs mswin_procs; + #endif ++#ifdef LISP_GRAPHICS ++#include "winlisp.h" ++extern struct window_procs lisp_procs; ++#endif + + STATIC_DCL void FDECL(def_raw_print, (const char *s)); + +@@ -81,6 +85,9 @@ + #ifdef MSWIN_GRAPHICS + { &mswin_procs, 0 }, + #endif ++#ifdef LISP_GRAPHICS ++ { &lisp_procs, win_lisp_init }, ++#endif + { 0, 0 } /* must be last */ + }; + +--- nethack-3.4.2/win/tty/termcap.c 2003-08-29 17:08:25.000000000 -0700 ++++ nethack/win/tty/termcap.c 2003-03-09 13:50:46.000000000 -0800 +@@ -1161,6 +1161,11 @@ + if (windowprocs.name != NULL && + !strcmpi(windowprocs.name, "Gem")) return TRUE; + #endif ++#ifdef LISP_GRAPHICS ++ /* XXX has_color() should be added to windowprocs */ ++ if (windowprocs.name != NULL && ++ !strcmpi(windowprocs.name, "lisp")) return TRUE; ++#endif + #ifdef QT_GRAPHICS + /* XXX has_color() should be added to windowprocs */ + if (windowprocs.name != NULL && +--- /dev/null 2003-05-01 12:00:27.000000000 -0700 ++++ nethack/win/lisp/ChangeLog 2003-06-03 02:04:26.000000000 -0700 +@@ -0,0 +1,304 @@ ++2003-06-03 Shawn Betts ++ ++ * winlisp.c (lisp_print_glyph): Pass special to the print-glyph ++ lisp function as a symbol. delete the MG_PET bit in special if ++ iflags.hilite_pet is not set. ++ (special_glyph_to_string): new function ++ ++2003-05-14 Shawn Betts ++ ++ * winlisp.c (lisp_string): Also escape the backslash character. ++ ++2002-09-19 Ryan Yeske ++ ++ * winlisp.c (lisp_cmd): nethack-api-* renamed to nhapi-*. ++ ++2002-09-16 Ryan Yeske ++ ++ * ../tty/termcap.c (has_color): Add condition for LISP_GRAPHICS ++ which returns TRUE. ++ ++2002-09-12 Ryan Yeske ++ ++ * winlisp.c (lisp_display_nhwindow): Add call to ++ `nethack-api-end'. ++ ++ * ../../include/config.h: Default to LISP_GRAPHICS. ++ ++ * ../../sys/unix/Makefile.src (WINSRC,WINOBJ,WINLIB): Set to ++ WINLISP* values. ++ (depend): Add winlisp.o dependancies. ++ ++ * winlisp.c (lisp_curs): Don't send winid. Add error check. ++ (lisp_putstr): Call `nethack-api-message' or ++ `nethack-api-menu-putstr' when appropriate. ++ (lisp_nhgetch): Update error message call. ++ (lisp_create_nhwindow): Don't send winids when creating message, ++ map, or status windows. ++ (lisp_clear_nhwindow): Call clear-message or clear-map instead of ++ clear-nhwindow. ++ (lisp_display_nhwindow): Call display-menu instead of ++ display-nhwindow. Call block when handling case of blocking on ++ displaying the map window. ++ (lisp_destroy_nhwindow): Use WIN_* values instead of hardcoded ++ numbers. ++ (lisp_print_glyph): Don't send winid. Add error check for bad ++ winids. ++ (lisp_outrip): Change reference to Enethack to nethack-el. ++ ++2002-04-23 Shawn ++ ++ * winlisp.c (lisp_player_selection): Update to use new 3.4.0 ++ functionality. ++ (lisp_print_glyph): likewise ++ ++2002-02-16 Shawn Betts ++ ++ * winlisp.c (read_string): take a pointer to a string as the ++ second argument. All callers updated. Rewritten to dynamically ++ resize the string in order to read an entire line. ++ (read_command): free the string returned from read_string ++ (lisp_askname): likewise ++ (lisp_display_nhwindow): likewise ++ (lisp_delay_output): likewise ++ (lisp_yn_function): likewise ++ ++2002-02-14 Shawn Betts ++ ++ * winlisp.c (lisp_print_glyph): Handle warning glyphs. ++ ++2002-01-27 Ryan C Yeske ++ ++ * winlisp.c (generate_status_line): Send flag values ++ individually. Always send values for all attributes. ++ ++2002-01-21 Ryan C Yeske ++ ++ * winlisp.c (lisp_add_menu): Add tile argument. ++ ++2002-01-22 shawn ++ ++ * winlisp.c (lisp_player_selection): use the existing menu system ++ to select a player. ++ (lisp_menu_item_t): add a new member, accelerator. ++ (lisp_current_accelerator): new static global. ++ (lisp_add_menu): pick our own selector when ch is 0. ++ (lisp_start_menu): reset lisp_current_accelerator to 'a'. ++ (lisp_add_menu): remove the identifier argument to the lisp_cmd ++ "add_menu". ++ (lisp_get_menu_identifier): first argument is now a char. ++ ++2002-01-20 Ryan C Yeske ++ ++ * winlisp.c (cmd_index): Add remaining functions. ++ ++2002-01-16 Ryan C Yeske ++ ++ * winlisp.c (lisp_exit_nhwindows): Don't wait for a dummy return ++ value. ++ (lisp_destroy_nhwindow): Don't destroy the status, message or map ++ windows. ++ ++2002-01-15 Ryan C Yeske ++ ++ * winlisp.c (lisp_exit_nhwindows): Don't wait for a dummy return ++ value. ++ ++2002-01-10 shawn ++ ++ * winlisp.c (win_lisp_init): new function ++ ++2002-01-09 Ryan C Yeske ++ ++ * winlisp.c (cmd_index): Add redraw command. ++ (C): New macro. ++ ++2002-01-01 shawn ++ ++ * winlisp.c (winid_list): new static global ++ (winid_list_len): likewise ++ (winid_list_max): likewise ++ (find_empty_cell): new function ++ (winid_is_taken): likewise ++ (add_winid): likewise ++ (get_unique_winid): likewise ++ (return_winid): likewise ++ (init_winid_list): likewise ++ ++2001-12-20 shawn ++ ++ * winlisp.c (read_command): return the command count as a string. ++ (num_digits): remove function ++ (power_of_ten): likewise ++ (lisp_nhgetch): command count works. ++ (enc_stat): extern reference ++ (hunger_stat): new constant ++ (generate_status_line): new function ++ (lisp_putstr): use generate_status_line to create the status line ++ call. ++ ++2001-12-19 shawn ++ ++ * winlisp.c: add extern declaration for glyph2tile and ++ total_tiles_used. ++ (lisp_print_glyph): pass the glyph's graphics tile index as an argument. ++ ++2001-12-02 Ryan Yeske ++ ++ * winlisp.c (lisp_cmd, lisp_list, lisp_t, lisp_nil, lisp_literal) ++ (lisp_cons, lisp_int, lisp_string): Update macros. Update all api ++ functions to use these macros. ++ (read_int, read_string, read_command): New functions. Update all ++ api functions to use these functions. ++ (lisp_create_nhwindow): Send specific window creation commands. ++ (lisp_cliparound): Comment out body. ++ ++2001-10-23 Ryan Yeske ++ ++ * winlisp.c (lisp_nhgetch): Don't silently loop on invalid ++ commands, send back a warning. ++ (lisp_yn_function): Make sure special handling is done for all ++ direction questions. Include prompt in call to ++ nethack-api-ask-direction. Include up, down and self directions. ++ If no default is set for a direction question, return space. ++ ++2001-10-19 shawn ++ ++ * winlisp.c (lisp_init_nhwindows): turn on showexp and time flags. ++ ++2001-10-17 Ryan Yeske ++ ++ * winlisp.c (lisp_display_nhwindow): Wait for a string if we are ++ blocking. ++ ++2001-07-19 shawn ++ ++ * winlisp.c (lisp_player_selection): terminate if we read a -1 as ++ a selection. ++ ++2001-07-16 Ryan Yeske ++ ++ * winlisp.c (lisp_delay_output): expect a return value from the ++ client. ++ ++2001-07-14 Ryan Yeske ++ ++ * winlisp.c (lisp_add_menu): Quote the attribute. ++ (lisp_outrip): Add a newline to output. ++ ++2001-07-06 shawn ++ ++ * winlisp.c (num_digits): new function ++ (power_of_ten): likewise ++ (lisp_nhgetch): handles repeated commands. ++ ++2001-07-05 shawn ++ ++ * winlisp.c (WINLISP_VOID_RETVAL): flushes stdout ++ ++2001-07-04 Ryan Yeske ++ ++ * winlisp.c (lisp_add_menu): Convert printf to lisp_* macros, ++ fixing a string quote bug. ++ ++2001-06-28 shawn ++ ++ * winlisp.c (zap_color): new define ++ (cmap_color): likewise ++ (obj_color): likewise ++ (mon_color): likewise ++ (invis_color): likewise ++ (pet_color): likewise ++ (lisp_print_glyph): export the color. export the ascii character ++ as a number. ++ ++2001-06-27 shawn ++ ++ * winlisp.c: fix a typo cmd_index ++ (lisp_yn_function): pass characters as numbers instead of ascii ++ characters. specially handle the "In what direction?" question. ++ (lisp_outrip): prints a properly formed lisp expression. ++ ++2001-06-21 Shawn Betts ++ ++ * winlisp.c (lisp_add_menu): items that are not selectable are ++ sent with an identifier of -1. ++ (lisp_select_menu): handle failed memory ++ allocation. ++ ++2001-05-06 shawn ++ ++ * winlisp.c (LINESIZ): new define ++ (lisp_menu_item_t): new struct ++ (lisp_menu_item_list): new static global ++ (lisp_menu_list_size): likewise ++ (lisp_menu_list_num): likewise ++ (cmd_index): fixed ddrop entry ++ (read_int): new function ++ (lisp_player_selection): use read_int ++ (lisp_askname): read the entire line to a string and parse data ++ from it. ++ (lisp_nhgetch): likewise ++ (lisp_create_nhwindow): likewise ++ (lisp_getlin): likewise ++ (lisp_yn_function): likewise ++ (lisp_start_menu): set lisp_menu_list_num to 0 ++ (lisp_add_menu): add an entry to lisp_menu_item_list ++ (lisp_add_menu): pass the item's ID to the client instead of the ++ actual identifier. ++ (lisp_get_menu_identifier): new function ++ (lisp_select_menu): parse the list of selected menu items ++ (lisp_print_glyph): escape backslashes in output ++ ++2000-10-01 Ryan Yeske ++ ++ * winlisp.c (cmd_index): renamed "ddoremarm" to "remarm" and ++ "ddoinv" to "inv". ++ ++2000-09-25 Shawn ++ ++ * winlisp.c: Added more key commands. ++ (lisp_player_selection): honours default player selections as ++ specified in the nethackrc file. ++ ++2000-09-22 Shawn ++ ++ * winlisp.c (lisp_nhgetch): changed while loop stop condition. ++ ++2000-09-19 Ryan yeske ++ ++ * winlisp.c (lisp_nh_getch): renamed from lisp_nh_getcmd() since ++ this is really called by the core when nethack wants a key. ++ (cmd_index): added gowest, gosouth, gonorth, goeast. ++ ++2000-09-12 shawn ++ ++ * winlisp.c (lisp_nh_poskey): Added code to read in an x,y,mod ++ combination instead of calling lisp_nhgetcmd. Currently commented ++ out until the lisp side catches up. added cmd_index structure to ++ translate incoming command strings to extended commands or ++ keystrokes. Changed lisp_nhgetch to lisp_nhgetcmd and changed the ++ lisp command it calls to 'nethack-get-command'. ++ ++2000-09-11 Ryan Yeske ++ ++ * winlisp.c (lisp_cmd, lisp_close_cmd, lisp_open, lisp_close, ++ lisp_quote, lisp_int, lisp_string, lisp_dot): created macros. ++ ++2000-09-10 Ryan Yeske ++ ++ * winlisp.c (lisp_outrip): added closing paren. ++ ++2000-08-21 Ryan Yeske ++ ++ * winlisp.c (lisp_nhgetch): change ch type to int from char. ++ ++2000-08-20 Ryan Yeske ++ ++ * winlisp.c (lisp_player_selection): role/race/gender/alignment ++ selection now sends (nethack-apix-choose-X ALIST) instead of ++ simply an alist. ++ (lisp_update_inventory): ++ s/nethack-api-updated-inventory/nethack-api-update-inventory/ ++ (WINLISP_VOID_RETVAL): added macro, called for every void ++ function. +--- /dev/null 2003-05-01 12:00:27.000000000 -0700 ++++ nethack/win/lisp/winlisp.c 2003-09-13 12:38:18.000000000 -0700 +@@ -0,0 +1,1871 @@ ++/* Copyright (c) Shawn Betts, Ryan Yeske, 2001 */ ++/* NetHack may be freely redistributed. See license for details. */ ++ ++/* ++ * "Main" file for the lisp/emacs window-port. This contains most of ++ * the interface routines. Please see doc/window.doc for an ++ * description of the window interface. ++ */ ++ ++#ifdef MSDOS /* from compiler */ ++#define SHORT_FILENAMES ++#endif ++ ++#include "hack.h" ++#include "winlisp.h" ++#include "func_tab.h" ++ ++#include "dlb.h" ++#ifdef SHORT_FILENAMES ++#include "patchlev.h" ++#else ++#include "patchlevel.h" ++#endif ++ ++#define CMD_KEY 0 ++#define CMD_EXT 1 ++ ++/* from tile.c */ ++extern short glyph2tile[]; ++extern int total_tiles_used; ++ ++typedef struct ++{ ++ anything identifier; ++ char accelerator; ++} lisp_menu_item_t; ++ ++/* An iterator for assigning accelerator keys. */ ++static char lisp_current_accelerator; ++ ++/* Helper structures to map menu id's to nethack anything's */ ++static lisp_menu_item_t lisp_menu_item_list[1000]; ++static int lisp_menu_list_size = 1000; ++static int lisp_menu_list_num; ++ ++extern char *enc_stat[]; ++const char *hunger_stat[] = { ++ "Satiated", ++ "", ++ "Hungry", ++ "Weak", ++ "Fainting", ++ "Fainted", ++ "Starved" ++}; ++ ++typedef struct ++{ ++ char *name; ++ int type; ++ int cmd; /* The command (a keystroke) */ ++}cmd_index_t; ++ ++#ifndef C ++#define C(c) (0x1f & (c)) ++#endif ++ ++cmd_index_t cmd_index[] = { {"gowest", CMD_KEY, 'h'}, ++ {"gowestontop", CMD_KEY, 'H'}, ++ {"gowestnear", CMD_KEY, C('h')}, ++ ++ {"gosouth", CMD_KEY, 'j'}, ++ {"gosouthontop", CMD_KEY, 'J'}, ++ {"gosouthnear", CMD_KEY, C('j')}, ++ ++ {"gonorth", CMD_KEY, 'k'}, ++ {"gonorthontop", CMD_KEY, 'K'}, ++ {"gonorthnear", CMD_KEY, C('k')}, ++ ++ {"goeast", CMD_KEY, 'l'}, ++ {"goeastontop", CMD_KEY, 'L'}, ++ {"goeastnear", CMD_KEY, C('l')}, ++ ++ {"gonorthwest", CMD_KEY, 'y'}, ++ {"gonorthwestontop", CMD_KEY, 'Y'}, ++ {"gonorthwestnear", CMD_KEY, C('y')}, ++ ++ {"gonortheast", CMD_KEY, 'u'}, ++ {"gonortheastontop", CMD_KEY, 'U'}, ++ {"gonortheastnear", CMD_KEY, C('u')}, ++ ++ {"gosouthwest", CMD_KEY, 'b'}, ++ {"gosouthwestontop", CMD_KEY, 'B'}, ++ {"gosouthwestnear", CMD_KEY, C('b')}, ++ ++ {"gosoutheast", CMD_KEY, 'n'}, ++ {"gosoutheastontop", CMD_KEY, 'N'}, ++ {"gosoutheastnear", CMD_KEY, C('n')}, ++ ++ {"idtrap", CMD_KEY, '^'}, ++ {"apply", CMD_KEY, 'a'}, ++ {"remarm", CMD_KEY, 'A'}, ++ {"close", CMD_KEY, 'c'}, ++ {"drop", CMD_KEY, 'd'}, ++ ++ {"ddrop", CMD_KEY, 'D'}, ++ {"eat", CMD_KEY, 'e'}, ++ {"engrave", CMD_KEY, 'E'}, ++ {"fire", CMD_KEY, 'f'}, ++ {"inv", CMD_KEY, 'i'}, ++ ++ {"typeinv", CMD_KEY, 'I'}, ++ {"open", CMD_KEY, 'o'}, ++ {"set", CMD_KEY, 'O'}, ++ {"pay", CMD_KEY, 'p'}, ++ {"puton", CMD_KEY, 'P'}, ++ ++ {"drink", CMD_KEY, 'q'}, ++ {"wieldquiver", CMD_KEY, 'Q'}, ++ {"read", CMD_KEY, 'r'}, ++ {"remring", CMD_KEY, 'R'}, ++ {"search", CMD_KEY, 's'}, ++ ++ {"save", CMD_KEY, 'S'}, ++ {"throw", CMD_KEY, 't'}, ++ {"takeoff", CMD_KEY, 'T'}, ++ {"simpleversion", CMD_KEY, 'v'}, ++ {"history", CMD_KEY, 'V'}, ++ ++ {"wield", CMD_KEY, 'w'}, ++ {"wear", CMD_KEY, 'W'}, ++ {"swapweapon", CMD_KEY, 'x'}, ++ {"enter_explore_mode", CMD_KEY, 'X'}, ++ {"zap", CMD_KEY, 'z'}, ++ ++ {"cast", CMD_KEY, 'Z'}, ++ {"up", CMD_KEY, '<'}, ++ {"down", CMD_KEY, '>'}, ++ {"whatis", CMD_KEY, '/'}, ++ {"help", CMD_KEY, '?'}, ++ ++ {"whatdoes", CMD_KEY, '&'}, ++ {"sh", CMD_KEY, '!'}, ++ {"discovered", CMD_KEY, '\\'}, ++ {"null", CMD_KEY, '.'}, ++ {"look", CMD_KEY, ':'}, ++ ++ {"quickwhatis", CMD_KEY, ';'}, ++ {"pickup", CMD_KEY, ','}, ++ {"togglepickup", CMD_KEY, '@'}, ++ {"prinuse", CMD_KEY, '*'}, ++ {"countgold", CMD_KEY, '$'}, ++ ++ {"kick", CMD_KEY, C('d')}, ++ {"listspells", CMD_KEY, '+'}, ++ {"redraw", CMD_KEY, C('r')}, ++ {"teleport", CMD_KEY, C('t')}, ++ {"callmon", CMD_KEY, 'C'}, ++ {"fight", CMD_KEY, 'F'}, ++ {"movenear", CMD_KEY, 'g'}, ++ {"move", CMD_KEY, 'G'}, ++ {"movenopickuporfight", CMD_KEY, 'm'}, ++ {"movenopickup", CMD_KEY, 'M'}, ++ {"showweapon", CMD_KEY, ')'}, ++ {"showarmor", CMD_KEY, '['}, ++ {"showrings", CMD_KEY, '='}, ++ {"showamulet", CMD_KEY, '"'}, ++ {"showtool", CMD_KEY, '('}, ++ {"attributes", CMD_KEY, C('x')}, ++#ifdef REDO ++ {"again", CMD_KEY, DOAGAIN}, ++#endif /* REDO */ ++ ++ /* wizard commands */ ++ {"wiz_detect", CMD_KEY, C('e')}, ++ {"wiz_map", CMD_KEY, C('f')}, ++ {"wiz_genesis", CMD_KEY, C('g')}, ++ {"wiz_identify", CMD_KEY, C('i')}, ++ {"wiz_where", CMD_KEY, C('o')}, ++ {"wiz_level_tele", CMD_KEY, C('v')}, ++ {"wiz_wish", CMD_KEY, C('w')}, ++ ++ /* wizard extended commands */ ++#ifdef WIZARD ++ {"light sources", CMD_EXT, 0}, ++ {"seenv", CMD_EXT, 0}, ++ {"stats", CMD_EXT, 0}, ++ {"timeout", CMD_EXT, 0}, ++ {"vision", CMD_EXT, 0}, ++#ifdef DEBUG ++ {"wizdebug", CMD_EXT, 0}, ++#endif /* DEBUG */ ++ {"wmode", CMD_EXT, 0}, ++#endif /* WIZARD */ ++ {"pray", CMD_EXT, 0}, ++ {"adjust", CMD_EXT, 0}, ++ {"chat", CMD_EXT, 0}, ++ {"conduct", CMD_EXT, 0}, ++ {"dip", CMD_EXT, 0}, ++ ++ {"enhance", CMD_EXT, 0}, ++ {"force", CMD_EXT, 0}, ++ {"invoke", CMD_EXT, 0}, ++ {"jump", CMD_EXT, 0}, ++ {"loot", CMD_EXT, 0}, ++ ++ {"monster", CMD_EXT, 0}, ++ {"name", CMD_EXT, 0}, ++ {"offer", CMD_EXT, 0}, ++ {"quit", CMD_EXT, 0}, ++ {"ride", CMD_EXT, 0}, ++ ++ {"rub", CMD_EXT, 0}, ++ {"sit", CMD_EXT, 0}, ++ {"turn", CMD_EXT, 0}, ++ {"twoweapon", CMD_EXT, 0}, ++ {"untrap", CMD_EXT, 0}, ++ ++ {"version", CMD_EXT, 0}, ++ {"wipe", CMD_EXT, 0}, ++ ++ {0, CMD_KEY, '\0'} }; ++ ++/* This variable is set when the user has selected an extended command. */ ++static int extended_cmd_id; ++ ++/* Interface definition, for windows.c */ ++struct window_procs lisp_procs = { ++ "lisp", ++ WC_COLOR|WC_HILITE_PET, ++ 0L, ++ lisp_init_nhwindows, ++ lisp_player_selection, ++ lisp_askname, ++ lisp_get_nh_event, ++ lisp_exit_nhwindows, ++ lisp_suspend_nhwindows, ++ lisp_resume_nhwindows, ++ lisp_create_nhwindow, ++ lisp_clear_nhwindow, ++ lisp_display_nhwindow, ++ lisp_destroy_nhwindow, ++ lisp_curs, ++ lisp_putstr, ++ lisp_display_file, ++ lisp_start_menu, ++ lisp_add_menu, ++ lisp_end_menu, ++ lisp_select_menu, ++ genl_message_menu, ++ lisp_update_inventory, ++ lisp_mark_synch, ++ lisp_wait_synch, ++#ifdef CLIPPING ++ lisp_cliparound, ++#endif ++#ifdef POSITIONBAR ++ lisp_update_positionbar, ++#endif ++ lisp_print_glyph, ++ lisp_raw_print, ++ lisp_raw_print_bold, ++ lisp_nhgetch, ++ lisp_nh_poskey, ++ lisp_nhbell, ++ lisp_doprev_message, ++ lisp_yn_function, ++ lisp_getlin, ++ lisp_get_ext_cmd, ++ lisp_number_pad, ++ lisp_delay_output, ++#ifdef CHANGE_COLOR /* the Mac uses a palette device */ ++ donull, ++ donull, ++#endif ++ /* other defs that really should go away (they're tty specific) */ ++ lisp_start_screen, ++ lisp_end_screen, ++ lisp_outrip, ++ genl_preference_update, ++}; ++ ++/* macros for printing lisp output */ ++#define lisp_cmd(s,body) \ ++ do \ ++ { \ ++ printf("(nhapi-%s ",s); \ ++ body; \ ++ printf(")\n"); \ ++ } \ ++ while (0) ++/* #define lisp_cmd0(s) printf ("(nhapi-%s)\n", s) */ ++#define lisp_list(body) \ ++ do \ ++ { \ ++ printf("("); \ ++ body; \ ++ printf(") "); \ ++ } \ ++ while (0) ++ ++#define lisp_open printf("(") ++#define lisp_close printf(") ") ++#define lisp_quote printf("'") ++#define lisp_dot printf(". ") ++#define lisp_t printf("t ") ++#define lisp_nil printf("nil ") ++#define lisp_literal(x) \ ++ do \ ++ { \ ++ lisp_quote; \ ++ printf ("%s ", x); \ ++ } \ ++ while (0) ++#define lisp_cons(x,y) \ ++ do \ ++ { \ ++ lisp_open; \ ++ x; \ ++ lisp_dot; \ ++ y; \ ++ lisp_close; \ ++ } \ ++ while (0) ++#define lisp_int(i) printf("%d ",i) ++#define lisp_string(s) \ ++ do \ ++ { \ ++ int nhi; \ ++ printf ("\""); \ ++ if (s) \ ++ for (nhi=0;nhi ", prompt); ++ fgets (line, BUFSZ, stdin); ++ rv = sscanf (line, "%d", i); ++ if (rv != 1) *i = -1; ++ return rv; ++} ++ ++static int ++read_string (prompt, str) ++ const char* prompt; ++ char **str; ++{ ++ char* rv; ++ int len; ++ int size; ++ char tmp[BUFSZ]; ++ ++ len = 0; ++ size = BUFSZ * 2; ++ *str = malloc (size); ++ (*str)[0] = '\0'; ++ ++ printf ("%s> ", prompt); ++ ++ do ++ { ++ /* Read the string */ ++ rv = fgets (tmp, BUFSZ, stdin); ++ if (rv == NULL) ++ break; ++ ++ len += strlen (tmp); ++ if (len >= size - 1) ++ { ++ size *= 2; ++ *str = realloc (*str, size); ++ if (*str == NULL) ++ panic ("Memory allocation failure; cannot get %u bytes", size); ++ } ++ strcat (*str, tmp); ++ } while (tmp[strlen (tmp) - 1] != '\n'); ++ ++ /* Did we read a string or error out? */ ++ if (rv == NULL) ++ { ++ free (*str); ++ return -1; ++ } ++ else ++ { ++ /* chop the newline */ ++ (*str) [strlen (*str) - 1] = '\0'; ++ return 0; ++ } ++} ++ ++ ++static int ++read_command (prompt, cmd, count) ++ const char *prompt; ++ char *cmd; ++ char *count; ++{ ++ char *buf; ++ int rv; ++ cmd[0] = '\0'; ++ *count = 0; ++ if (read_string (prompt, &buf) == -1) ++ return -1; ++ rv = sscanf (buf, "%s %s", cmd, count); ++ free (buf); ++ if (rv != 2) *count = 0; ++ return rv; ++} ++ ++void ++bail(mesg) ++ const char *mesg; ++{ ++ clearlocks (); ++ lisp_exit_nhwindows (mesg); ++ terminate (EXIT_SUCCESS); ++ /*NOTREACHED*/ ++} ++ ++void ++win_lisp_init () ++{ ++ /* Code to be executed on startup. */ ++} ++ ++void ++lisp_player_selection () ++{ ++ int i, k, n; ++ char pick4u = 'n', thisch, lastch = 0; ++ char pbuf[QBUFSZ], plbuf[QBUFSZ]; ++ winid win; ++ anything any; ++ menu_item *selected = 0; ++ ++ /* prevent an unnecessary prompt */ ++ rigid_role_checks(); ++ ++ /* Should we randomly pick for the player? */ ++ if (!flags.randomall && ++ (flags.initrole == ROLE_NONE || flags.initrace == ROLE_NONE || ++ flags.initgend == ROLE_NONE || flags.initalign == ROLE_NONE)) { ++ ++ pick4u = lisp_yn_function ("Shall I pick a character for you? [ynq] ", "ynq", 'y'); ++ ++ if (pick4u != 'y' && pick4u != 'n') ++ { ++ give_up: /* Quit */ ++ if (selected) free((genericptr_t) selected); ++ bail((char *)0); ++ /*NOTREACHED*/ ++ return; ++ } ++ ++ } ++ ++ (void) root_plselection_prompt(plbuf, QBUFSZ - 1, ++ flags.initrole, flags.initrace, flags.initgend, flags.initalign); ++ ++ /* Select a role, if necessary */ ++ /* we'll try to be compatible with pre-selected race/gender/alignment, ++ * but may not succeed */ ++ if (flags.initrole < 0) { ++ char rolenamebuf[QBUFSZ]; ++ /* Process the choice */ ++ if (pick4u == 'y' || flags.initrole == ROLE_RANDOM || flags.randomall) { ++ /* Pick a random role */ ++ flags.initrole = pick_role(flags.initrace, flags.initgend, ++ flags.initalign, PICK_RANDOM); ++ if (flags.initrole < 0) { ++/* lisp_putstr(BASE_WINDOW, 0, "Incompatible role!"); */ ++ flags.initrole = randrole(); ++ } ++ } else { ++ /* Prompt for a role */ ++ win = create_nhwindow(NHW_MENU); ++ start_menu(win); ++ any.a_void = 0; /* zero out all bits */ ++ for (i = 0; roles[i].name.m; i++) { ++ if (ok_role(i, flags.initrace, flags.initgend, ++ flags.initalign)) { ++ any.a_int = i+1; /* must be non-zero */ ++ thisch = lowc(roles[i].name.m[0]); ++ if (thisch == lastch) thisch = highc(thisch); ++ if (flags.initgend != ROLE_NONE && flags.initgend != ROLE_RANDOM) { ++ if (flags.initgend == 1 && roles[i].name.f) ++ Strcpy(rolenamebuf, roles[i].name.f); ++ else ++ Strcpy(rolenamebuf, roles[i].name.m); ++ } else { ++ if (roles[i].name.f) { ++ Strcpy(rolenamebuf, roles[i].name.m); ++ Strcat(rolenamebuf, "/"); ++ Strcat(rolenamebuf, roles[i].name.f); ++ } else ++ Strcpy(rolenamebuf, roles[i].name.m); ++ } ++ add_menu(win, NO_GLYPH, &any, thisch, ++ 0, ATR_NONE, an(rolenamebuf), MENU_UNSELECTED); ++ lastch = thisch; ++ } ++ } ++ any.a_int = pick_role(flags.initrace, flags.initgend, ++ flags.initalign, PICK_RANDOM)+1; ++ if (any.a_int == 0) /* must be non-zero */ ++ any.a_int = randrole()+1; ++ add_menu(win, NO_GLYPH, &any , '*', 0, ATR_NONE, ++ "Random", MENU_UNSELECTED); ++ any.a_int = i+1; /* must be non-zero */ ++ add_menu(win, NO_GLYPH, &any , 'q', 0, ATR_NONE, ++ "Quit", MENU_UNSELECTED); ++ Sprintf(pbuf, "Pick a role for your %s", plbuf); ++ end_menu(win, pbuf); ++ n = select_menu(win, PICK_ONE, &selected); ++ destroy_nhwindow(win); ++ ++ /* Process the choice */ ++ if (n != 1 || selected[0].item.a_int == any.a_int) ++ goto give_up; /* Selected quit */ ++ ++ flags.initrole = selected[0].item.a_int - 1; ++ free((genericptr_t) selected), selected = 0; ++ } ++ (void) root_plselection_prompt(plbuf, QBUFSZ - 1, ++ flags.initrole, flags.initrace, flags.initgend, flags.initalign); ++ } ++ ++ /* Select a race, if necessary */ ++ /* force compatibility with role, try for compatibility with ++ * pre-selected gender/alignment */ ++ if (flags.initrace < 0 || !validrace(flags.initrole, flags.initrace)) { ++ /* pre-selected race not valid */ ++ if (pick4u == 'y' || flags.initrace == ROLE_RANDOM || flags.randomall) { ++ flags.initrace = pick_race(flags.initrole, flags.initgend, ++ flags.initalign, PICK_RANDOM); ++ if (flags.initrace < 0) { ++/* lisp_putstr(BASE_WINDOW, 0, "Incompatible race!"); */ ++ flags.initrace = randrace(flags.initrole); ++ } ++ } else { /* pick4u == 'n' */ ++ /* Count the number of valid races */ ++ n = 0; /* number valid */ ++ k = 0; /* valid race */ ++ for (i = 0; races[i].noun; i++) { ++ if (ok_race(flags.initrole, i, flags.initgend, ++ flags.initalign)) { ++ n++; ++ k = i; ++ } ++ } ++ if (n == 0) { ++ for (i = 0; races[i].noun; i++) { ++ if (validrace(flags.initrole, i)) { ++ n++; ++ k = i; ++ } ++ } ++ } ++ ++ /* Permit the user to pick, if there is more than one */ ++ if (n > 1) { ++ win = create_nhwindow(NHW_MENU); ++ start_menu(win); ++ any.a_void = 0; /* zero out all bits */ ++ for (i = 0; races[i].noun; i++) ++ if (ok_race(flags.initrole, i, flags.initgend, ++ flags.initalign)) { ++ any.a_int = i+1; /* must be non-zero */ ++ add_menu(win, NO_GLYPH, &any, races[i].noun[0], ++ 0, ATR_NONE, races[i].noun, MENU_UNSELECTED); ++ } ++ any.a_int = pick_race(flags.initrole, flags.initgend, ++ flags.initalign, PICK_RANDOM)+1; ++ if (any.a_int == 0) /* must be non-zero */ ++ any.a_int = randrace(flags.initrole)+1; ++ add_menu(win, NO_GLYPH, &any , '*', 0, ATR_NONE, ++ "Random", MENU_UNSELECTED); ++ any.a_int = i+1; /* must be non-zero */ ++ add_menu(win, NO_GLYPH, &any , 'q', 0, ATR_NONE, ++ "Quit", MENU_UNSELECTED); ++ Sprintf(pbuf, "Pick the race of your %s", plbuf); ++ end_menu(win, pbuf); ++ n = select_menu(win, PICK_ONE, &selected); ++ destroy_nhwindow(win); ++ if (n != 1 || selected[0].item.a_int == any.a_int) ++ goto give_up; /* Selected quit */ ++ ++ k = selected[0].item.a_int - 1; ++ free((genericptr_t) selected), selected = 0; ++ } ++ flags.initrace = k; ++ } ++ (void) root_plselection_prompt(plbuf, QBUFSZ - 1, ++ flags.initrole, flags.initrace, flags.initgend, flags.initalign); ++ } ++ ++ /* Select a gender, if necessary */ ++ /* force compatibility with role/race, try for compatibility with ++ * pre-selected alignment */ ++ if (flags.initgend < 0 || !validgend(flags.initrole, flags.initrace, ++ flags.initgend)) { ++ /* pre-selected gender not valid */ ++ if (pick4u == 'y' || flags.initgend == ROLE_RANDOM || flags.randomall) { ++ flags.initgend = pick_gend(flags.initrole, flags.initrace, ++ flags.initalign, PICK_RANDOM); ++ if (flags.initgend < 0) { ++/* lisp_putstr(BASE_WINDOW, 0, "Incompatible gender!"); */ ++ flags.initgend = randgend(flags.initrole, flags.initrace); ++ } ++ } else { /* pick4u == 'n' */ ++ /* Count the number of valid genders */ ++ n = 0; /* number valid */ ++ k = 0; /* valid gender */ ++ for (i = 0; i < ROLE_GENDERS; i++) { ++ if (ok_gend(flags.initrole, flags.initrace, i, ++ flags.initalign)) { ++ n++; ++ k = i; ++ } ++ } ++ if (n == 0) { ++ for (i = 0; i < ROLE_GENDERS; i++) { ++ if (validgend(flags.initrole, flags.initrace, i)) { ++ n++; ++ k = i; ++ } ++ } ++ } ++ ++ /* Permit the user to pick, if there is more than one */ ++ if (n > 1) { ++ win = create_nhwindow(NHW_MENU); ++ start_menu(win); ++ any.a_void = 0; /* zero out all bits */ ++ for (i = 0; i < ROLE_GENDERS; i++) ++ if (ok_gend(flags.initrole, flags.initrace, i, ++ flags.initalign)) { ++ any.a_int = i+1; ++ add_menu(win, NO_GLYPH, &any, genders[i].adj[0], ++ 0, ATR_NONE, genders[i].adj, MENU_UNSELECTED); ++ } ++ any.a_int = pick_gend(flags.initrole, flags.initrace, ++ flags.initalign, PICK_RANDOM)+1; ++ if (any.a_int == 0) /* must be non-zero */ ++ any.a_int = randgend(flags.initrole, flags.initrace)+1; ++ add_menu(win, NO_GLYPH, &any , '*', 0, ATR_NONE, ++ "Random", MENU_UNSELECTED); ++ any.a_int = i+1; /* must be non-zero */ ++ add_menu(win, NO_GLYPH, &any , 'q', 0, ATR_NONE, ++ "Quit", MENU_UNSELECTED); ++ Sprintf(pbuf, "Pick the gender of your %s", plbuf); ++ end_menu(win, pbuf); ++ n = select_menu(win, PICK_ONE, &selected); ++ destroy_nhwindow(win); ++ if (n != 1 || selected[0].item.a_int == any.a_int) ++ goto give_up; /* Selected quit */ ++ ++ k = selected[0].item.a_int - 1; ++ free((genericptr_t) selected), selected = 0; ++ } ++ flags.initgend = k; ++ } ++ (void) root_plselection_prompt(plbuf, QBUFSZ - 1, ++ flags.initrole, flags.initrace, flags.initgend, flags.initalign); ++ } ++ ++ /* Select an alignment, if necessary */ ++ /* force compatibility with role/race/gender */ ++ if (flags.initalign < 0 || !validalign(flags.initrole, flags.initrace, ++ flags.initalign)) { ++ /* pre-selected alignment not valid */ ++ if (pick4u == 'y' || flags.initalign == ROLE_RANDOM || flags.randomall) { ++ flags.initalign = pick_align(flags.initrole, flags.initrace, ++ flags.initgend, PICK_RANDOM); ++ if (flags.initalign < 0) { ++/* lisp_putstr(BASE_WINDOW, 0, "Incompatible alignment!"); */ ++ flags.initalign = randalign(flags.initrole, flags.initrace); ++ } ++ } else { /* pick4u == 'n' */ ++ /* Count the number of valid alignments */ ++ n = 0; /* number valid */ ++ k = 0; /* valid alignment */ ++ for (i = 0; i < ROLE_ALIGNS; i++) { ++ if (ok_align(flags.initrole, flags.initrace, flags.initgend, ++ i)) { ++ n++; ++ k = i; ++ } ++ } ++ if (n == 0) { ++ for (i = 0; i < ROLE_ALIGNS; i++) { ++ if (validalign(flags.initrole, flags.initrace, i)) { ++ n++; ++ k = i; ++ } ++ } ++ } ++ ++ /* Permit the user to pick, if there is more than one */ ++ if (n > 1) { ++ win = create_nhwindow(NHW_MENU); ++ start_menu(win); ++ any.a_void = 0; /* zero out all bits */ ++ for (i = 0; i < ROLE_ALIGNS; i++) ++ if (ok_align(flags.initrole, flags.initrace, ++ flags.initgend, i)) { ++ any.a_int = i+1; ++ add_menu(win, NO_GLYPH, &any, aligns[i].adj[0], ++ 0, ATR_NONE, aligns[i].adj, MENU_UNSELECTED); ++ } ++ any.a_int = pick_align(flags.initrole, flags.initrace, ++ flags.initgend, PICK_RANDOM)+1; ++ if (any.a_int == 0) /* must be non-zero */ ++ any.a_int = randalign(flags.initrole, flags.initrace)+1; ++ add_menu(win, NO_GLYPH, &any , '*', 0, ATR_NONE, ++ "Random", MENU_UNSELECTED); ++ any.a_int = i+1; /* must be non-zero */ ++ add_menu(win, NO_GLYPH, &any , 'q', 0, ATR_NONE, ++ "Quit", MENU_UNSELECTED); ++ Sprintf(pbuf, "Pick the alignment of your %s", plbuf); ++ end_menu(win, pbuf); ++ n = select_menu(win, PICK_ONE, &selected); ++ destroy_nhwindow(win); ++ if (n != 1 || selected[0].item.a_int == any.a_int) ++ goto give_up; /* Selected quit */ ++ ++ k = selected[0].item.a_int - 1; ++ free((genericptr_t) selected), selected = 0; ++ } ++ flags.initalign = k; ++ } ++ } ++ /* Success! */ ++/* lisp_display_nhwindow(BASE_WINDOW, FALSE); */ ++} ++ ++/* Reads from standard in, the player's name. */ ++void ++lisp_askname () ++{ ++ char *line; ++ lisp_cmd ("askname",); ++ read_string ("string", &line); ++ strncpy (plname, line, PL_NSIZ); ++ plname[PL_NSIZ-1] = '\0'; ++ free (line); ++} ++ ++/* This is a noop for tty and X, so should it be a noop for us too? */ ++void ++lisp_get_nh_event () ++{ ++/* lisp_cmd ("get-event",); */ ++} ++ ++/* Global Functions */ ++void ++lisp_raw_print(str) ++ const char *str; ++{ ++ lisp_cmd ("raw-print", lisp_string (str)); ++} ++ ++void ++lisp_raw_print_bold(str) ++ const char *str; ++{ ++ lisp_cmd ("raw-print-bold", lisp_string (str)); ++} ++ ++void ++lisp_curs(window, x, y) ++ winid window; ++ int x, y; ++{ ++ if (window == WIN_MAP) ++ lisp_cmd ("curs", ++ lisp_int (x); ++ lisp_int (y)); ++ else if (window == WIN_STATUS) ++ { ++ /* do nothing */ ++ } ++ else ++ lisp_cmd ("error", lisp_string("lisp_curs bad window"); lisp_int (window)); ++} ++ ++static void ++generate_status_line () ++{ ++ /* Ripped from botl.c */ ++ int hp, hpmax; ++ ++ hp = Upolyd ? u.mh : u.uhp; ++ hpmax = Upolyd ? u.mhmax : u.uhpmax; ++ if(hp < 0) hp = 0; ++ ++ printf ("(nhapi-update-status "); ++ lisp_quote; ++ printf ("("); ++ lisp_list (lisp_string ("name"); ++ lisp_string (plname);); ++ if (Upolyd) ++ { ++ lisp_list (lisp_string ("rank"); ++ lisp_nil); ++ lisp_list (lisp_string ("monster"); ++ lisp_string (mons[u.umonnum].mname)); ++ } ++ else ++ { ++ lisp_list (lisp_string ("rank"); ++ lisp_string (rank_of(u.ulevel, Role_switch, flags.female)););; ++ lisp_list (lisp_string ("monster"); ++ lisp_nil); ++ } ++ ++ lisp_list (lisp_string ("St"); ++ lisp_int (ACURR(A_STR));); ++ lisp_list (lisp_string ("Dx"); ++ lisp_int (ACURR(A_DEX));); ++ lisp_list (lisp_string ("Co"); ++ lisp_int (ACURR(A_CON));); ++ lisp_list (lisp_string ("In"); ++ lisp_int (ACURR(A_INT));); ++ lisp_list (lisp_string ("Wi"); ++ lisp_int (ACURR(A_WIS));); ++ lisp_list (lisp_string ("Ch"); ++ lisp_int (ACURR(A_CHA));); ++ lisp_list (lisp_string ("Align"); ++ if (u.ualign.type == A_CHAOTIC) ++ lisp_string ("Chaotic"); ++ else if (u.ualign.type == A_NEUTRAL) ++ lisp_string ("Neutral"); ++ else ++ lisp_string ("Lawful");); ++ ++#ifdef SCORE_ON_BOTL ++ lisp_list (lisp_string ("Score"); ++ lisp_int (botl_score());); ++#endif ++ ++ if (In_endgame(&u.uz)) ++ { ++ lisp_list (lisp_string ("Dungeon"); ++ if (Is_astralevel(&u.uz)) ++ lisp_string ("Astral Plane"); ++ else ++ lisp_string ("End Game");); ++ } ++ else ++ { ++ lisp_list (lisp_string ("Dungeon"); ++ lisp_string (dungeons[u.uz.dnum].dname);); ++ } ++ ++ lisp_list (lisp_string ("Dlvl"); ++ lisp_int (depth(&u.uz));); ++ ++ lisp_list (lisp_string ("$"); ++ lisp_int (u.ugold);); ++ lisp_list (lisp_string ("HP"); ++ lisp_int (hp);); ++ lisp_list (lisp_string ("HPmax"); ++ lisp_int (hpmax);); ++ lisp_list (lisp_string ("PW"); ++ lisp_int (u.uen);); ++ lisp_list (lisp_string ("PWmax"); ++ lisp_int (u.uenmax);); ++ lisp_list (lisp_string ("AC"); ++ lisp_int (u.uac);); ++ ++ if (Upolyd) ++ { ++ lisp_list (lisp_string ("HD"); ++ lisp_int (mons[u.umonnum].mlevel);); ++ } ++ else ++ { ++ lisp_list (lisp_string ("HD"); ++ lisp_nil); ++ } ++ ++ lisp_list (lisp_string ("Level"); ++ lisp_int (u.ulevel);); ++#ifdef EXP_ON_BOTL ++ lisp_list (lisp_string ("XP"); ++ lisp_int (u.uexp);); ++#endif ++ lisp_list (lisp_string ("T"); ++ lisp_int (moves);); ++ ++ if (Confusion) ++ lisp_list (lisp_string ("confusion"); lisp_string ("Conf")); ++ else ++ lisp_list (lisp_string ("confusion"); lisp_nil); ++ ++ if (u.uhs != 1) ++ lisp_list (lisp_string ("hunger"); lisp_string (hunger_stat[u.uhs])); ++ else ++ lisp_list (lisp_string ("hunger"); lisp_nil); ++ ++ if (Sick) ++ { ++ if (u.usick_type & SICK_VOMITABLE) ++ lisp_list (lisp_string ("sick"); lisp_string ("FoodPois")); ++ if (u.usick_type & SICK_NONVOMITABLE) ++ lisp_list (lisp_string ("sick"); lisp_string ("Ill")); ++ } ++ else ++ lisp_list (lisp_string ("sick"); lisp_nil); ++ ++ if (Blind) ++ lisp_list (lisp_string ("blind"); lisp_string ("Blind")); ++ else ++ lisp_list (lisp_string ("blind"); lisp_nil); ++ ++ if (Stunned) ++ lisp_list (lisp_string ("stunned"); lisp_string ("Stun")); ++ else ++ lisp_list (lisp_string ("stunned"); lisp_nil); ++ ++ if (Hallucination) ++ lisp_list (lisp_string ("hallucination"); lisp_string ("Hallu")); ++ else ++ lisp_list (lisp_string ("hallucination"); lisp_nil); ++ ++ if (Slimed) ++ lisp_list (lisp_string ("slimed"); lisp_string ("Slime")); ++ else ++ lisp_list (lisp_string ("slimed"); lisp_nil); ++ ++ if (near_capacity() > UNENCUMBERED) ++ lisp_list (lisp_string ("encumbrance"); ++ lisp_string (enc_stat[near_capacity()])); ++ else ++ lisp_list (lisp_string ("encumbrance"); lisp_nil); ++ ++ printf (" ))\n"); ++} ++ ++void ++lisp_putstr(window, attr, str) ++ winid window; ++ int attr; ++ const char *str; ++{ ++ static char statline1[BUFSZ] = ""; ++ if (window == WIN_STATUS) ++ { ++ if (statline1[0]=='\0') ++ Strcpy (statline1, str); ++ else ++ { ++ generate_status_line (); ++ statline1[0]='\0'; ++ } ++ } ++ else if (window == WIN_MESSAGE) ++ lisp_cmd ("message", ++ lisp_literal (attr_to_string (attr)); ++ lisp_string (str)); ++ else ++ lisp_cmd ("menu-putstr", ++ lisp_int (window); ++ lisp_literal (attr_to_string (attr)); ++ lisp_string (str)); ++} ++ ++void ++lisp_start_menu(window) ++ winid window; ++{ ++ lisp_menu_list_num = 0; ++ lisp_current_accelerator = 'a'; ++ lisp_cmd ("start-menu", lisp_int (window)); ++} ++ ++void ++lisp_add_menu(window, glyph, identifier, ch, gch, attr, str, preselected) ++ winid window; /* window to use, must be of type NHW_MENU */ ++ int glyph; /* glyph to display with item (unused) */ ++ const anything *identifier; /* what to return if selected */ ++ char ch; /* keyboard accelerator (0 = pick our own) */ ++ char gch; /* group accelerator (0 = no group) */ ++ int attr; /* attribute for string (like tty_putstr()) */ ++ const char *str; /* menu string */ ++ boolean preselected; /* item is marked as selected */ ++{ ++ if (identifier->a_void) ++ { ++ lisp_menu_item_list[lisp_menu_list_num].identifier = *identifier; ++ if (ch == 0) ++ { ++ ch = lisp_menu_item_list[lisp_menu_list_num].accelerator = lisp_current_accelerator; ++ if (lisp_current_accelerator == 'z') ++ lisp_current_accelerator = 'A'; ++ else ++ lisp_current_accelerator++; ++ } ++ else ++ lisp_menu_item_list[lisp_menu_list_num].accelerator = ch; ++ ++ lisp_menu_list_num++; ++ } ++ else ++ ch = -1; ++ ++ lisp_cmd ("add-menu", ++ lisp_int (window); ++ lisp_int (glyph); ++ lisp_int (glyph2tile[glyph]); ++ lisp_int (ch); ++ lisp_int (gch); ++ lisp_literal (attr_to_string (attr)); ++ lisp_string (str); ++ preselected ? lisp_t : lisp_nil); ++} ++ ++void ++lisp_end_menu(window, prompt) ++ winid window; /* menu to use */ ++ const char *prompt; /* prompt to for menu */ ++{ ++ lisp_cmd ("end-menu", ++ lisp_int (window); ++ lisp_string (prompt)); ++} ++ ++static int ++lisp_get_menu_identifier(ch, identifier) ++ char ch; ++ anything *identifier; ++{ ++ int i; ++ ++ for(i=0; i < lisp_menu_list_num; i++) ++ { ++ if( lisp_menu_item_list[i].accelerator == ch ) ++ { ++ *identifier = lisp_menu_item_list[i].identifier; ++ return 1; ++ } ++ } ++ ++ return 0; ++} ++ ++int ++lisp_select_menu(window, how, menu_list) ++ winid window; ++ int how; ++ menu_item **menu_list; ++{ ++ const char *delim = "() \n"; ++ char *list; ++ char *token; ++ int size = 0; ++ ++ lisp_cmd ("select-menu", ++ lisp_int (window); ++ lisp_literal (how_to_string (how))); ++ ++ read_string ("menu", &list); ++ ++/* lisp_prompt ("menu"); */ ++/* fgets (list, LINESIZ, stdin); */ ++ ++ /* The client should submit a structure like this: ++ ++ ((ch count) (ch count) (ch count) ...) ++ ++ where ch is the accelerator for the menu item and count is the ++ number of them to select. ++ ++ We strtok it so we just get id count id count id count. */ ++ ++ token = strtok (list, delim); ++ ++ /* Start with some memory so realloc doesn't fail. */ ++ *menu_list = malloc (sizeof (menu_item)); ++ if (*menu_list == NULL) ++ { ++ panic ("Memory allocation failure; cannot get %u bytes", ++ sizeof (menu_item)); ++ } ++ size = 0; ++ ++ while (token != NULL) ++ { ++ /* Make more room in the array for the new item */ ++ size++; ++ if ((*menu_list = realloc (*menu_list, size * sizeof (menu_item))) == NULL) ++ { ++ panic ("Memory allocation failure; cannot get %u bytes", ++ size * sizeof (menu_item)); ++ } ++ ++ /* assign the item ID */ ++ lisp_get_menu_identifier (atoi (token), &(*menu_list)[size-1].item ); ++ ++ /* Read the item count */ ++ token = strtok (NULL, delim); ++ (*menu_list)[size-1].count = atoi (token); ++ ++ /* read the next item ID */ ++ token = strtok (NULL, delim); ++ } ++ ++ free (list); ++ ++ return size; ++} ++ ++/* This is a tty-specific hack. Do we need it? */ ++char ++lisp_message_menu(let, how, mesg) ++ char let; ++ int how; ++ const char *mesg; ++{ ++ lisp_cmd ("message-menu", ++ lisp_int (let); ++ lisp_literal (how_to_string (how)); ++ lisp_string (mesg)); ++ return '\0'; ++} ++ ++static int ++lisp_get_cmd(str) ++ const char *str; ++{ ++ int i; ++ ++ for (i=0; cmd_index[i].name != (char *)0; i++) ++ { ++ if (!strcmp (str, cmd_index[i].name)) ++ return i; ++ } ++ ++ return -1; ++} ++ ++static int ++lisp_get_ext_cmd_id (str) ++ const char *str; ++{ ++ int i; ++ ++ for (i=0; extcmdlist[i].ef_txt != (char *)0; i++) { ++ if (!strcmp (str, extcmdlist[i].ef_txt)) return i; ++ } ++ ++ return -1; ++} ++ ++/* static int */ ++/* num_digits(n) */ ++/* int n; */ ++/* { */ ++/* int i; */ ++/* int ret = 1; */ ++ ++/* for (i=10;n / i; i *= 10) */ ++/* { */ ++/* ret++; */ ++/* } */ ++ ++/* return ret; */ ++/* } */ ++ ++/* static */ ++/* int */ ++/* power_of_ten (n) */ ++/* int n; */ ++/* { */ ++/* int i; */ ++/* int power = 1; */ ++ ++/* for (i=0; i= 0) ++ { ++ cmd = count_cmd; ++ count_cmd = -1; ++ } ++ else ++ { ++ char cmdstr[BUFSZ]; ++ ++ read_command ("command", cmdstr, count_buf); ++ ++ count_pos = count_buf; ++ cmd = lisp_get_cmd (cmdstr); ++ if (cmd == -1) ++ { ++ printf ("(nhapi-message 'atr-none \"undefined-command %s\")\n", cmdstr); ++ cmd = lisp_get_cmd ("null"); ++ } ++ ++ if (atoi (count_pos) > 1) ++ { ++ char* tmp = count_pos; ++ count_pos++; ++ count_cmd = cmd; ++ return *tmp; ++ } ++ else ++ { ++ /* Since the count is 1, zero out the string. */ ++ *count_pos = 0; ++ } ++ } ++ ++ if (cmd_index[cmd].type == CMD_KEY) ++ { ++ return cmd_index[cmd].cmd; ++ } ++ else ++ { ++ if ((extended_cmd_id = lisp_get_ext_cmd_id (cmd_index[cmd].name)) == -1) ++ { ++ /* Can never happen. */ ++ printf ("%s:%d: Bad extended command name\n", __FILE__, __LINE__); ++ } ++ return '#'; ++ } ++} ++ ++int ++lisp_nh_poskey(x, y, mod) ++ int *x, *y, *mod; ++{ ++/* char scratch[256]; */ ++ ++/* printf ("(nethack-api-poskey)\n"); */ ++ ++/* scanf ("( %d %d '%255s )", x, y, scratch); */ ++/* if (!strcmp (scratch, "click-1")) *mod = CLICK_1; */ ++/* else *mod = CLICK_2; */ ++ ++/* return 0; */ ++ ++ return lisp_nhgetch(); ++} ++ ++static boolean inven_win_created = FALSE; ++ ++/* These globals are used to keep track of window IDs. */ ++static winid *winid_list = NULL; ++static int winid_list_len = 0; ++static int winid_list_max = 0; ++ ++/* returns index into winid_list that can be used. */ ++static int ++find_empty_cell () ++{ ++ int i; ++ ++ /* Check for a vacant spot in the list. */ ++ for (i=0; i= winid_list_max) ++ { ++ winid_list_max *= 2; ++ winid_list = realloc (winid_list, sizeof (int) * winid_list_max); ++ if (winid_list == NULL) ++ bail ("Out of memory\n"); ++ } ++ winid_list_len++; ++ ++ return winid_list_len-1; ++} ++ ++static int ++winid_is_taken (winid n) ++{ ++ int i; ++ ++ for (i=0; i +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Bug#154750; drop many and drop are the same, so pull the former + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +--- nethack/win/gnome/gnmain.c~ 2003-10-24 11:29:11.000000000 -0700 ++++ nethack/win/gnome/gnmain.c 2003-10-24 11:29:19.000000000 -0700 +@@ -381,12 +381,6 @@ + GINT_TO_POINTER('d'), NULL, GNOME_APP_PIXMAP_NONE, NULL, 'd',0 + }, + { +- GNOME_APP_UI_ITEM, N_("Drop Many"), +- N_("drop selected types of objects"), +- ghack_accelerator_selected, +- GINT_TO_POINTER('D'), NULL, GNOME_APP_PIXMAP_NONE, NULL, 'D',GDK_SHIFT_MASK +- }, +- { + GNOME_APP_UI_ITEM, N_("Eat"), + N_("eat something"), + ghack_accelerator_selected, --- nethack-3.4.3.orig/debian/patches/16_pixmapdir.dpatch +++ nethack-3.4.3/debian/patches/16_pixmapdir.dpatch @@ -0,0 +1,106 @@ +#! /bin/sh -e +## 16_pixmapdir.dpatch by Joshua Kwan +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Use /usr/share/pixmaps/nethack/ for pretty pictures. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +--- nethack/win/Qt/qt_win.cpp~ 2003-10-22 21:25:09.000000000 -0700 ++++ nethack/win/Qt/qt_win.cpp 2003-10-22 21:29:31.000000000 -0700 +@@ -3177,7 +3177,7 @@ + { + if (!pixmap) { + pixmap=new QPixmap; +- tryload(*pixmap, "rip.xpm"); ++ tryload(*pixmap, PIXMAPDIR "rip.xpm"); + } + riplines=0; + resize(pixmap->width(),pixmap->height()); +@@ -4286,7 +4286,7 @@ + tile_file = iflags.wc_tile_file; + + if (!img.load(tile_file)) { +- tile_file = "x11tiles"; ++ tile_file = PIXMAPDIR "x11tiles"; + if (!img.load(tile_file)) { + QString msg; + msg.sprintf("Cannot load x11tiles or nhtiles.bmp"); +--- nethack/win/X11/winX.c~ 2003-10-22 21:15:53.000000000 -0700 ++++ nethack/win/X11/winX.c 2003-10-22 21:16:08.000000000 -0700 +@@ -919,12 +919,12 @@ + { "message_lines", "Message_lines", XtRInt, sizeof(int), + XtOffset(AppResources *,message_lines), XtRString, "12" }, + { "pet_mark_bitmap", "Pet_mark_bitmap", XtRString, sizeof(String), +- XtOffset(AppResources *,pet_mark_bitmap), XtRString, "pet_mark.xbm" }, ++ XtOffset(AppResources *,pet_mark_bitmap), XtRString, PIXMAPDIR "pet_mark.xbm" }, + { "pet_mark_color", "Pet_mark_color", XtRPixel, sizeof(XtRPixel), + XtOffset(AppResources *,pet_mark_color), XtRString, "Red" }, + #ifdef GRAPHIC_TOMBSTONE + { "tombstone", "Tombstone", XtRString, sizeof(String), +- XtOffset(AppResources *,tombstone), XtRString, "rip.xpm" }, ++ XtOffset(AppResources *,tombstone), XtRString, PIXMAPDIR "rip.xpm" }, + { "tombtext_x", "Tombtext_x", XtRInt, sizeof(int), + XtOffset(AppResources *,tombtext_x), XtRString, "155" }, + { "tombtext_y", "Tombtext_y", XtRInt, sizeof(int), +--- nethack/win/gnome/gnbind.c~ 2003-10-22 21:20:43.000000000 -0700 ++++ nethack/win/gnome/gnbind.c 2003-10-22 21:20:49.000000000 -0700 +@@ -7,6 +7,8 @@ + * code in the Gnome port and the rest of the nethack game engine. + */ + ++#include "config.h" ++ + #include "gnbind.h" + #include "gnmain.h" + #include "gnaskstr.h" +@@ -97,7 +97,7 @@ + + #ifdef HACKDIR + //if (ghack_init_glyphs(HACKDIR "/t32-1024.xpm")) +- if (ghack_init_glyphs(HACKDIR "/x11tiles")) ++ if (ghack_init_glyphs(PIXMAPDIR "/x11tiles")) + g_error ("ERROR: Could not initialize glyphs.\n"); + #else + # error HACKDIR is not defined! +--- nethack/win/gnome/gnopts.c~ 2003-10-22 21:21:01.000000000 -0700 ++++ nethack/win/gnome/gnopts.c 2003-10-22 21:21:20.000000000 -0700 +@@ -97,13 +97,13 @@ + case 0: + /* They selected traditional */ + ghack_free_glyphs(); +- if (ghack_init_glyphs(HACKDIR "/x11tiles")) ++ if (ghack_init_glyphs(PIXMAPDIR "/x11tiles")) + g_error ("ERROR: Could not initialize glyphs.\n"); + ghack_reinit_map_window(); + break; + case 1: + ghack_free_glyphs(); +- if (ghack_init_glyphs(HACKDIR "/t32-1024.xpm")) ++ if (ghack_init_glyphs(PIXMAPDIR "/t32-1024.xpm")) + g_error ("ERROR: Could not initialize glyphs.\n"); + ghack_reinit_map_window(); + +--- nethack/win/gnome/gnmap.c~ 2003-10-22 21:57:08.000000000 -0700 ++++ nethack/win/gnome/gnmap.c 2003-10-22 21:57:20.000000000 -0700 +@@ -179,7 +179,7 @@ + NULL) ); + + /* Tile the map background with a pretty image */ +- background = gdk_imlib_load_image((char *) "mapbg.xpm"); ++ background = gdk_imlib_load_image((char *) PIXMAPDIR "mapbg.xpm"); + if (background == NULL) { + g_warning("Bummer! Failed to load the map background image (mapbg.xpm)!"); + } --- nethack-3.4.3.orig/debian/patches/12_lisp_windowing.copyright +++ nethack-3.4.3/debian/patches/12_lisp_windowing.copyright @@ -0,0 +1,20 @@ + +Redistribution and use in source and binary forms, with or without modification, are permitted +provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials provided + with the distribution. + 3. The name of the author may not be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --- nethack-3.4.3.orig/debian/patches/02_SECURITY_recover_secure.dpatch +++ nethack-3.4.3/debian/patches/02_SECURITY_recover_secure.dpatch @@ -0,0 +1,117 @@ +#! /bin/sh -e +## 02_SECURITY_recover_secure.dpatch by Joshua Kwan +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Make sure the user calling recover owns the file. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +--- nethack-3.4.1.orig/util/recover.c ++++ nethack-3.4.1/util/recover.c +@@ -16,6 +16,12 @@ + #include "win32api.h" + #endif + ++#ifdef SECURE ++#include ++#include ++#include ++#endif ++ + #ifdef VMS + extern int FDECL(vms_creat, (const char *,unsigned)); + extern int FDECL(vms_open, (const char *,int,unsigned)); +@@ -107,15 +113,23 @@ + } + #if defined(SECURE) && !defined(VMS) + if (dir +-# ifdef HACKDIR ++# ifdef VAR_PLAYGROUND ++ && strcmp(dir, VAR_PLAYGROUND) ++# else ++# ifdef HACKDIR + && strcmp(dir, HACKDIR) +-# endif ++# endif ++# endif /* VAR_PLAYGROUND */ + ) { + (void) setgid(getgid()); + (void) setuid(getuid()); + } + #endif /* SECURE && !VMS */ + ++#ifdef VAR_PLAYGROUND ++ if (!dir) dir = VAR_PLAYGROUND; ++#endif ++ + #ifdef HACKDIR + if (!dir) dir = HACKDIR; + #endif +@@ -158,11 +172,19 @@ + #endif + } + ++#ifdef SECURE ++static uid_t save_uid = -1; ++#endif ++ + int + open_levelfile(lev) + int lev; + { + int fd; ++#ifdef SECURE ++ struct stat level_stat; ++ uid_t uid; ++#endif + + set_levelfile_name(lev); + #if defined(MICRO) || defined(WIN32) || defined(MSDOS) +@@ -170,6 +192,21 @@ + #else + fd = open(lock, O_RDONLY, 0); + #endif ++ /* Security check: does the user calling recover own the file? */ ++#ifdef SECURE ++ if (fd != -1) { ++ uid = getuid(); ++ if (fstat(fd, &level_stat) == -1) { ++ Fprintf(stderr, "No permission to stat level file %s.\n", lock); ++ return -1; ++ } ++ if (uid != 0 && level_stat.st_uid != uid) { ++ Fprintf(stderr, "You are not the owner of level file %s.\n", lock); ++ return -1; ++ } ++ save_uid = level_stat.st_uid; ++ } ++#endif + return fd; + } + +@@ -183,6 +220,13 @@ + #else + fd = creat(savename, FCMASK); + #endif ++ ++#ifdef SECURE ++ if (fchown(fd, save_uid, -1) == -1) { ++ Fprintf(stderr, "could not chown %s to %i!\n", savename, ++ save_uid); ++ } ++#endif + return fd; + } + --- nethack-3.4.3.orig/debian/patches/92_enh_paranoid_hit.dpatch +++ nethack-3.4.3/debian/patches/92_enh_paranoid_hit.dpatch @@ -0,0 +1,148 @@ +#! /bin/sh -e +## 92_enh_paranoid_hit.dpatch by Joshua Kwan +## heavily edited from http://www.netsonic.fi/~walker/nh/paranoid-343.diff +## originally by David Damerell, Jonathan Nieder, Jukka Lahtinen, Stanislav +## Traykov +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Paranoid hit asks you to confirm 'yes' instead of 'y' when hitting peacefuls + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +diff -urd nethack-3.4.2/dat/opthelp nh342par/dat/opthelp +--- nethack-3.4.2/dat/opthelp 2003-08-30 03:07:07.000000000 +0300 ++++ nh342par/dat/opthelp 2003-09-05 16:36:28.000000000 +0300 +@@ -61,6 +61,9 @@ + Boolean option if MFLOPPY was set at compile time: + checkspace check free disk space before writing files to disk [TRUE] + ++Boolean option if PARANOID was set at compile time: ++paranoid_quit ask for explicit 'yes' when quitting [FALSE] ++ + Boolean option if EXP_ON_BOTL was set at compile time: + showexp display your accumulated experience points [FALSE] + +diff -urd nethack-3.4.2/doc/Guidebook.mn nh342par/doc/Guidebook.mn +--- nethack-3.4.2/doc/Guidebook.mn 2003-08-30 03:07:13.000000000 +0300 ++++ nh342par/doc/Guidebook.mn 2003-09-05 16:35:33.000000000 +0300 +@@ -1964,6 +1964,9 @@ + The value of this option should be a string containing the + symbols for the various object types. Any omitted types are filled in + at the end from the previous order. ++.lp paranoid_hit ++If true, asks you to type the word ``yes'' when hitting any peaceful ++monster, not just the letter ``y''. + .lp perm_invent + If true, always display your current inventory in a window. This only + makes sense for windowing system interfaces that implement this feature. +diff -urd nethack-3.4.2/doc/Guidebook.tex nh342par/doc/Guidebook.tex +--- nethack-3.4.2/doc/Guidebook.tex 2003-08-30 03:07:13.000000000 +0300 ++++ nh342par/doc/Guidebook.tex 2003-09-05 16:35:33.000000000 +0300 +@@ -2409,6 +2409,10 @@ + containing the symbols for the various object types. Any omitted types + are filled in at the end from the previous order. + %.lp ++\item[\ib{paranoid\_hit}] ++If true, asks you to type the word ``yes'' when hitting any peaceful ++monster, not just the letter ``y''. ++%.lp + \item[\ib{perm\_invent}] + If true, always display your current inventory in a window. This only + makes sense for windowing system interfaces that implement this feature. +diff -urd nethack-3.4.2/doc/Guidebook.txt nh342par/doc/Guidebook.txt +--- nethack-3.4.2/doc/Guidebook.txt 2003-08-30 03:07:13.000000000 +0300 ++++ nh342par/doc/Guidebook.txt 2003-09-05 16:35:33.000000000 +0300 +@@ -2554,6 +2554,10 @@ + Any omitted types are filled in at the end from the previous + order. + ++ paranoid_hit ++ If true, asks you to type the word ``yes'' when hitting any ++ peaceful monster, not just the letter ``y''. ++ + perm_invent + If true, always display your current inventory in a window. + This only makes sense for windowing system interfaces that +diff -urd nethack-3.4.2/include/flag.h nh342par/include/flag.h +--- nethack-3.4.2/include/flag.h 2003-08-30 03:07:17.000000000 +0300 ++++ nh342par/include/flag.h 2003-09-05 16:35:33.000000000 +0300 +@@ -217,6 +217,9 @@ + boolean lan_mail; /* mail is initialized */ + boolean lan_mail_fetched; /* mail is awaiting display */ + #endif ++#ifdef PARANOID ++ boolean paranoid_hit; /* Ask for 'yes' when hitting peacefuls */ ++#endif + + #if defined(HPMON) && defined(TEXTCOLOR) + boolean use_hpmon; + #endif + + /* + * Window capability support. + */ +diff -urd nethack-3.4.2/src/options.c nh342par/src/options.c +--- nethack-3.4.2/src/options.c 2003-08-30 03:07:36.000000000 +0300 ++++ nh342par/src/options.c 2003-09-05 16:35:33.000000000 +0300 +@@ -155,6 +155,9 @@ + #else + {"page_wait", (boolean *)0, FALSE, SET_IN_FILE}, + #endif ++#ifdef PARANOID ++ {"paranoid_hit", &iflags.paranoid_hit, FALSE, SET_IN_GAME}, ++#endif + {"perm_invent", &flags.perm_invent, FALSE, SET_IN_GAME}, + {"popup_dialog", &iflags.wc_popup_dialog, FALSE, SET_IN_GAME}, /*WC*/ + {"prayconfirm", &flags.prayconfirm, TRUE, SET_IN_GAME}, +diff -urd nethack-3.4.2/src/uhitm.c nh342par/src/uhitm.c +--- nethack-3.4.2/src/uhitm.c 2003-08-30 03:07:42.000000000 +0300 ++++ nh342par/src/uhitm.c 2003-09-05 16:35:33.000000000 +0300 +@@ -99,6 +99,9 @@ + struct obj *wep; /* uwep for attack(), null for kick_monster() */ + { + char qbuf[QBUFSZ]; ++#ifdef PARANOID ++ char buf[BUFSZ]; ++#endif + + /* if you're close enough to attack, alert any waiting monster */ + mtmp->mstrategy &= ~STRAT_WAITMASK; +@@ -199,11 +202,26 @@ + return(FALSE); + } + if (canspotmon(mtmp)) { ++#ifdef PARANOID ++ Sprintf(qbuf, "Really attack %s? [no/yes]", ++ mon_nam(mtmp)); ++ if (iflags.paranoid_hit) { ++ getlin (qbuf, buf); ++ (void) lcase (buf); ++ if (strcmp (buf, "yes")) { ++ flags.move = 0; ++ return(TRUE); ++ } ++ } else { ++#endif + Sprintf(qbuf, "Really attack %s?", mon_nam(mtmp)); + if (yn(qbuf) != 'y') { + flags.move = 0; + return(TRUE); + } ++#ifdef PARANOID ++ } ++#endif + } + } + --- nethack-3.4.3.orig/debian/patches/18_overridewin.dpatch +++ nethack-3.4.3/debian/patches/18_overridewin.dpatch @@ -0,0 +1,45 @@ +#! /bin/sh -e +## 18_overridewin.dpatch by Joshua Kwan +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Better way to do it. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +Index: src/windows.c +=================================================================== +RCS file: /cvsroot/pkg-nethack/nethack/src/windows.c,v +retrieving revision 1.1.1.1 +diff -u -u -r1.1.1.1 windows.c +--- src/windows.c 7 Oct 2003 19:00:21 -0000 1.1.1.1 ++++ src/windows.c 9 Dec 2003 18:20:08 -0000 +@@ -96,10 +103,16 @@ + choose_windows(s) + const char *s; + { ++ char *ow; const char *wt; + register int i; ++ ++ if (!strcmp(s, DEFAULT_WINDOW_SYS) && (ow = getenv("OVERRIDEWIN"))) ++ wt = ow; ++ else ++ wt = s; + + for(i=0; winchoices[i].procs; i++) +- if (!strcmpi(s, winchoices[i].procs->name)) { ++ if (!strcmpi(wt, winchoices[i].procs->name)) { + windowprocs = *winchoices[i].procs; + if (winchoices[i].ini_routine) (*winchoices[i].ini_routine)(); + return; --- nethack-3.4.3.orig/debian/patches/06_x11_data.dpatch +++ nethack-3.4.3/debian/patches/06_x11_data.dpatch @@ -0,0 +1,40 @@ +#! /bin/sh -e +## 06_x11_data.dpatch by Joshua Kwan +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Add optional tiles to the X11 build. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +--- a/sys/unix/Makefile.top~ 2003-10-06 22:00:18.000000000 -0700 ++++ b/sys/unix/Makefile.top 2003-10-06 22:00:55.000000000 -0700 +@@ -40,7 +40,7 @@ + SHELLDIR = $(PREFIX)/games + + # per discussion in Install.X11 and Install.Qt +-VARDATND = ++# VARDATND = + # VARDATND = x11tiles NetHack.ad pet_mark.xbm + # VARDATND = x11tiles NetHack.ad pet_mark.xbm rip.xpm + # for Atari/Gem +@@ -48,7 +48,7 @@ + # for BeOS + # VARDATND = beostiles + # for Gnome +-# VARDATND = x11tiles pet_mark.xbm rip.xpm mapbg.xpm ++VARDATND = x11tiles pet_mark.xbm rip.xpm mapbg.xpm + + VARDATD = data oracles options quest.dat rumors + VARDAT = $(VARDATD) $(VARDATND) --- nethack-3.4.3.orig/debian/patches/10_gnome_add_quiver.dpatch +++ nethack-3.4.3/debian/patches/10_gnome_add_quiver.dpatch @@ -0,0 +1,35 @@ +#! /bin/sh -e +## 10_gnome_add_quiver.dpatch by Joshua Kwan +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Add a 'Quiver/Ready' option to the GNOME UI menu. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +--- a/win/gnome/gnmain.c~ 2003-10-06 23:39:19.000000000 -0700 ++++ b/win/gnome/gnmain.c 2003-10-06 23:38:39.000000000 -0700 +@@ -361,6 +361,12 @@ + ghack_accelerator_selected, + GINT_TO_POINTER('t'), NULL, GNOME_APP_PIXMAP_NONE, NULL, 't',0 + }, ++ { ++ GNOME_APP_UI_ITEM, N_("Quiver/Ready"), ++ N_("ready or quiver some ammunition"), ++ ghack_accelerator_selected, ++ GINT_TO_POINTER('Q'), NULL, GNOME_APP_PIXMAP_NONE, NULL, 'Q',0 ++ }, + { + GNOME_APP_UI_ITEM, N_("Open Door"), + N_("open a door"), --- nethack-3.4.3.orig/debian/patches/00list +++ nethack-3.4.3/debian/patches/00list @@ -0,0 +1,21 @@ +01_fix_qt +02_SECURITY_recover_secure +04_manpage_paths +05_makefile_logic +06_x11_data +08_linux_specifics +09_use_gnu_source +10_gnome_add_quiver +12_lisp_windowing +13_simple_mail +14_common_config +15_recover_errormsg +16_pixmapdir +17_gnome_remove_drop_many +18_overridewin +19_gnome_ext_events +90_enh_hpmon +91_enh_menucolors +92_enh_paranoid_hit +93_enh_dump +94_enh_sortloot --- nethack-3.4.3.orig/debian/patches/04_manpage_paths.dpatch +++ nethack-3.4.3/debian/patches/04_manpage_paths.dpatch @@ -0,0 +1,52 @@ +#! /bin/sh -e +## 04_manpage_paths.dpatch by Joshua Kwan +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Change paths in the default manpage to what is used in Debian + other stuff. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 +--- nethack-3.4.1.orig/doc/nethack.6 ++++ nethack-3.4.1/doc/nethack.6 +@@ -108,9 +108,10 @@ + graphics characters), options may also be included in a configuration + file. + The default is located in your home directory and +-named .nethackrc on Unix systems. On other systems, the default may be +-different, usually NetHack.cnf. On DOS or Windows, the name is +-defaults.nh, while on the Macintosh or BeOS, it is NetHack Defaults. ++named .nethackrc on Unix systems. ++On Debian systems, use .nethackrc.gnome for the Gnome windowing port, ++use .nethackrc.x11 for the X11 windowing port, and use .nethackrc.qt for the ++QT windowing port. You can use .nethackrc.tty for the non-graphical version. + The configuration file's location may be specified by setting NETHACKOPTIONS + to a string consisting of an @ character followed by the filename. + .PP +@@ -197,7 +198,7 @@ + supplies a directory which is to serve as the playground. + It overrides the value from NETHACKDIR, HACKDIR, + or the directory specified by the game administrator during compilation +-(usually /usr/games/lib/nethackdir). ++(usually /usr/lib/games/nethackdir). + This option is usually only useful to the game administrator. + The playground must contain several auxiliary files such as help files, + the list of top scorers, and a subdirectory +@@ -283,7 +284,7 @@ + .br + MAILREADER Replacement for default reader + .br +- (probably /bin/mail or /usr/ucb/mail). ++ (probably /usr/bin/mail). + .br + NETHACKDIR Playground. --- nethack-3.4.3.orig/debian/patches/93_enh_dump.dpatch +++ nethack-3.4.3/debian/patches/93_enh_dump.dpatch @@ -0,0 +1,1760 @@ +#! /bin/sh -e +## 93_enh_dump.dpatch by Tom Friedetzky, Jukka Lahtinen, Darshan Shaligram +## from: http://www.netsonic.fi/~walker/nh/dump-343.diff +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Dump patch by Jukka Lahtinen. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) + if patch -f --dry-run -p1 < $0 >/dev/null 2>&1; then + patch -f --no-backup-if-mismatch -p1 < $0 + else + exit 1 + fi + ;; + -unpatch) + if patch -f --dry-run -R -p1 < $0 >/dev/null 2>&1; then + patch -f --no-backup-if-mismatch -R -p1 < $0 + else + exit 1 + fi + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +Nethack 3.4.3 dump patch, version 1.1 +diff -Nurd --exclude-from=diff_ign.txt nh343off/dat/opthelp nh343dump/dat/opthelp +--- nh343off/dat/opthelp Mon Dec 8 01:39:14 2003 ++++ nh343dump/dat/opthelp Thu Dec 11 19:49:06 2003 +@@ -92,6 +92,9 @@ + boulder override the default boulder symbol with another default: [`] + disclose the types of information you want offered at the end of the + game [ni na nv ng nc] ++dumpfile the name of the file where to dump the disclosure information ++ when the game ends (only if the patch has been compiled in) ++ [none] + fruit the name of a fruit you enjoy eating [slime mold] + (basically a whimsy which NetHack uses from time to time). + menustyle user interface for selection of multiple objects: +diff -Nurd --exclude-from=diff_ign.txt nh343off/doc/Guidebook.mn nh343dump/doc/Guidebook.mn +--- nh343off/doc/Guidebook.mn Mon Dec 8 01:39:14 2003 ++++ nh343dump/doc/Guidebook.mn Thu Dec 11 19:48:48 2003 +@@ -1770,6 +1770,12 @@ + .lp dogname + Name your starting dog (ex. ``dogname:Fang''). + Cannot be set with the `O' command. ++.lp dumpfile ++The name of a file where the disclosure information is written when the ++game ends. You may use the macro %n that will be replaced with the name ++of your player character. The game must have write permissions to the ++directory where the file is written. Normally /tmp may be used for unix ++systems. + .lp dungeon + Set the graphics symbols for displaying the dungeon + (default \&``\ |--------||.-|++##.##<><>_|\e\e#{}.}..##\ #}''). +diff -Nurd --exclude-from=diff_ign.txt nh343off/doc/Guidebook.tex nh343dump/doc/Guidebook.tex +--- nh343off/doc/Guidebook.tex Mon Dec 8 01:39:14 2003 ++++ nh343dump/doc/Guidebook.tex Thu Dec 11 19:48:46 2003 +@@ -2209,6 +2209,13 @@ + Name your starting dog (ex.\ ``{\tt dogname:Fang}''). + Cannot be set with the `{\tt O}' command. + %.lp ++\item[\ib{dumpfile}] ++The name of a file where the disclosure information is written when the ++game ends. You may use the macro %n that will be replaced with the name ++of your player character. The game must have write permissions to the ++directory where the file is written. Normally /tmp may be used for unix ++systems. ++%.lp + \item[\ib{dungeon}] + Set the graphics symbols for displaying the dungeon (default + ``\verb& |--------||.-|++##& \verb&.##<><>_|\\#{}.}..## #}&''). +diff -Nurd --exclude-from=diff_ign.txt nh343off/doc/Guidebook.txt nh343dump/doc/Guidebook.txt +--- nh343off/doc/Guidebook.txt Mon Dec 8 01:39:14 2003 ++++ nh343dump/doc/Guidebook.txt Thu Dec 11 19:48:44 2003 +@@ -2274,6 +2274,13 @@ + Name your starting dog (ex. ``dogname:Fang''). Cannot be set + with the `O' command. + ++ dumpfile ++ The name of a file where the disclosure information is ++ written when the game ends. You may use the macro %n that ++ will be replaced with the name of your player character. ++ The game must have write permissions to the directory where ++ the file is written. Normally /tmp may be used for unixes. ++ + dungeon + Set the graphics symbols for displaying the dungeon (default + `` |--------||.-|++##.##<><>_|\\#{}.}..## #}''). The dungeon +diff -Nurd --exclude-from=diff_ign.txt nh343off/include/decl.h nh343dump/include/decl.h +--- nh343off/include/decl.h Mon Dec 8 01:39:14 2003 ++++ nh343dump/include/decl.h Wed Dec 10 14:56:54 2003 +@@ -184,6 +184,9 @@ + E long done_money; + #endif + E char killer_buf[BUFSZ]; ++#ifdef DUMP_LOG ++E char dump_fn[]; /* dumpfile name (dump patch) */ ++#endif + E const char *configfile; + E NEARDATA char plname[PL_NSIZ]; + E NEARDATA char dogname[]; +diff -Nurd --exclude-from=diff_ign.txt nh343off/include/extern.h nh343dump/include/extern.h +--- nh343off/include/extern.h Mon Dec 8 01:39:14 2003 ++++ nh343dump/include/extern.h Wed Dec 10 22:53:14 2003 +@@ -131,6 +131,10 @@ + E int FDECL(describe_level, (char *)); + E const char *FDECL(rank_of, (int,SHORT_P,BOOLEAN_P)); + E void NDECL(bot); ++#ifdef DUMP_LOG ++E void FDECL(bot1str, (char *)); ++E void FDECL(bot2str, (char *)); ++#endif + + /* ### cmd.c ### */ + +@@ -166,6 +170,10 @@ + E int NDECL(extcmd_via_menu); + E void FDECL(enlightenment, (int)); + E void FDECL(show_conduct, (int)); ++#ifdef DUMP_LOG ++E void FDECL(dump_enlightenment, (int)); ++E void FDECL(dump_conduct, (int)); ++#endif + E int FDECL(xytod, (SCHAR_P,SCHAR_P)); + E void FDECL(dtoxy, (coord *,int)); + E int FDECL(movecmd, (CHAR_P)); +@@ -281,6 +289,9 @@ + E void FDECL(row_refresh, (int,int,int)); + E void NDECL(cls); + E void FDECL(flush_screen, (int)); ++#ifdef DUMP_LOG ++E void NDECL(dump_screen); ++#endif + E int FDECL(back_to_glyph, (XCHAR_P,XCHAR_P)); + E int FDECL(zapdir_to_glyph, (int,int,int)); + E int FDECL(glyph_at, (XCHAR_P,XCHAR_P)); +@@ -553,6 +564,10 @@ + #if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C) + E void FDECL(done, (int)); + E void FDECL(container_contents, (struct obj *,BOOLEAN_P,BOOLEAN_P)); ++#ifdef DUMP_LOG ++E void FDECL(dump, (char *, char *)); ++E void FDECL(do_containerconts, (struct obj *,BOOLEAN_P,BOOLEAN_P,BOOLEAN_P)); ++#endif + E void FDECL(terminate, (int)); + E int NDECL(num_genocides); + +@@ -790,6 +805,9 @@ + E char *FDECL(xprname, (struct obj *,const char *,CHAR_P,BOOLEAN_P,long,long)); + E int NDECL(ddoinv); + E char FDECL(display_inventory, (const char *,BOOLEAN_P)); ++#ifdef DUMP_LOG ++E char FDECL(dump_inventory, (const char *,BOOLEAN_P)); ++#endif + E int FDECL(display_binventory, (int,int,BOOLEAN_P)); + E struct obj *FDECL(display_cinventory,(struct obj *)); + E struct obj *FDECL(display_minventory,(struct monst *,int,char *)); +@@ -2237,6 +2255,9 @@ + E int NDECL(abon); + E int NDECL(dbon); + E int NDECL(enhance_weapon_skill); ++#ifdef DUMP_LOG ++E void NDECL(dump_weapon_skill); ++#endif + E void FDECL(unrestrict_weapon_skill, (int)); + E void FDECL(use_skill, (int,int)); + E void FDECL(add_weapon_skill, (int)); +diff -Nurd --exclude-from=diff_ign.txt nh343off/src/botl.c nh343dump/src/botl.c +--- nh343off/src/botl.c Mon Dec 8 01:39:14 2003 ++++ nh343dump/src/botl.c Wed Dec 10 15:09:44 2003 +@@ -165,10 +165,16 @@ + } + #endif + ++#ifdef DUMP_LOG ++void bot1str(char *newbot1) ++#else + STATIC_OVL void + bot1() ++#endif + { ++#ifndef DUMP_LOG + char newbot1[MAXCO]; ++#endif + register char *nb; + register int i,j; + +@@ -215,6 +221,15 @@ + if (flags.showscore) + Sprintf(nb = eos(nb), " S:%ld", botl_score()); + #endif ++#ifdef DUMP_LOG ++} ++STATIC_OVL void ++bot1() ++{ ++ char newbot1[MAXCO]; ++ ++ bot1str(newbot1); ++#endif + curs(WIN_STATUS, 1, 0); + putstr(WIN_STATUS, 0, newbot1); + } +@@ -242,10 +257,17 @@ + return ret; + } + ++#ifdef DUMP_LOG ++void bot2str(newbot2) ++char* newbot2; ++#else + STATIC_OVL void + bot2() ++#endif + { ++#ifndef DUMP_LOG + char newbot2[MAXCO]; ++#endif + register char *nb; + int hp, hpmax; + int cap = near_capacity(); +@@ -292,6 +314,14 @@ + if(Slimed) Sprintf(nb = eos(nb), " Slime"); + if(cap > UNENCUMBERED) + Sprintf(nb = eos(nb), " %s", enc_stat[cap]); ++#ifdef DUMP_LOG ++} ++STATIC_OVL void ++bot2() ++{ ++ char newbot2[MAXCO]; ++ bot2str(newbot2); ++#endif + curs(WIN_STATUS, 1, 1); + putstr(WIN_STATUS, 0, newbot2); + } +diff -Nurd --exclude-from=diff_ign.txt nh343off/src/cmd.c nh343dump/src/cmd.c +--- nh343off/src/cmd.c Mon Dec 8 01:39:14 2003 ++++ nh343dump/src/cmd.c Thu Dec 11 19:42:20 2003 +@@ -1126,6 +1126,300 @@ + return; + } + ++#ifdef DUMP_LOG ++void ++dump_enlightenment(final) ++int final; ++{ ++ int ltmp; ++ char buf[BUFSZ]; ++ char buf2[BUFSZ]; ++ char *youwere = " You were "; ++ char *youhave = " You have "; ++ char *youhad = " You had "; ++ char *youcould = " You could "; ++ ++ dump("", "Final attributes"); ++ ++#ifdef ELBERETH ++ if (u.uevent.uhand_of_elbereth) { ++ static const char * const hofe_titles[3] = { ++ "the Hand of Elbereth", ++ "the Envoy of Balance", ++ "the Glory of Arioch" ++ }; ++ dump(youwere, ++ (char *)hofe_titles[u.uevent.uhand_of_elbereth - 1]); ++ } ++#endif ++ ++ if (u.ualign.record >= 20) ++ dump(youwere, "piously aligned"); ++ else if (u.ualign.record > 13) ++ dump(youwere, "devoutly aligned"); ++ else if (u.ualign.record > 8) ++ dump(youwere, "fervently aligned"); ++ else if (u.ualign.record > 3) ++ dump(youwere, "stridently aligned"); ++ else if (u.ualign.record == 3) ++ dump(youwere, "aligned"); ++ else if (u.ualign.record > 0) ++ dump(youwere, "haltingly aligned"); ++ else if (u.ualign.record == 0) ++ dump(youwere, "nominally aligned"); ++ else if (u.ualign.record >= -3) dump(youhave, "strayed"); ++ else if (u.ualign.record >= -8) dump(youhave, "sinned"); ++ else dump(" You have ", "transgressed"); ++#ifdef WIZARD ++ if (wizard) { ++ Sprintf(buf, " %d", u.ualign.record); ++ dump(" Your alignment was ", buf); ++ } ++#endif ++ ++ /*** Resistances to troubles ***/ ++ if (Fire_resistance) dump(youwere, "fire resistant"); ++ if (Cold_resistance) dump(youwere, "cold resistant"); ++ if (Sleep_resistance) dump(youwere, "sleep resistant"); ++ if (Disint_resistance) dump(youwere, "disintegration-resistant"); ++ if (Shock_resistance) dump(youwere, "shock resistant"); ++ if (Poison_resistance) dump(youwere, "poison resistant"); ++ if (Drain_resistance) dump(youwere, "level-drain resistant"); ++ if (Sick_resistance) dump(youwere, "immune to sickness"); ++ if (Antimagic) dump(youwere, "magic-protected"); ++ if (Acid_resistance) dump(youwere, "acid resistant"); ++ if (Stone_resistance) dump(youwere, "petrification resistant"); ++ if (Invulnerable) dump(youwere, "invulnerable"); ++ if (u.uedibility) dump(youcould, "recognize detrimental food"); ++ ++ /*** Troubles ***/ ++ if (Halluc_resistance) dump(" ", "You resisted hallucinations"); ++ if (Hallucination) dump(youwere, "hallucinating"); ++ if (Stunned) dump(youwere, "stunned"); ++ if (Confusion) dump(youwere, "confused"); ++ if (Blinded) dump(youwere, "blinded"); ++ if (Sick) { ++ if (u.usick_type & SICK_VOMITABLE) ++ dump(youwere, "sick from food poisoning"); ++ if (u.usick_type & SICK_NONVOMITABLE) ++ dump(youwere, "sick from illness"); ++ } ++ if (Stoned) dump(youwere, "turning to stone"); ++ if (Slimed) dump(youwere, "turning into slime"); ++ if (Strangled) ++ dump(youwere, (u.uburied) ? "buried" : "being strangled"); ++ if (Glib) { ++ Sprintf(buf, "slippery %s", makeplural(body_part(FINGER))); ++ dump(youhad, buf); ++ } ++ if (Fumbling) dump(" ", "You fumbled"); ++ if (Wounded_legs ++#ifdef STEED ++ && !u.usteed ++#endif ++ ) { ++ Sprintf(buf, "wounded %s", makeplural(body_part(LEG))); ++ dump(youhad, buf); ++ } ++#ifdef STEED ++ if (Wounded_legs && u.usteed) { ++ Strcpy(buf, x_monnam(u.usteed, ARTICLE_YOUR, (char *)0, ++ SUPPRESS_SADDLE | SUPPRESS_HALLUCINATION, FALSE)); ++ *buf = highc(*buf); ++ Strcat(buf, " had wounded legs"); ++ dump(" ", buf); ++ } ++#endif ++ if (Sleeping) dump(" ", "You fell asleep"); ++ if (Hunger) dump(" ", "You hungered rapidly"); ++ ++ /*** Vision and senses ***/ ++ if (See_invisible) dump(" ", "You saw invisible"); ++ if (Blind_telepat) dump(youwere, "telepathic"); ++ if (Warning) dump(youwere, "warned"); ++ if (Warn_of_mon && flags.warntype) { ++ Sprintf(buf, "aware of the presence of %s", ++ (flags.warntype & M2_ORC) ? "orcs" : ++ (flags.warntype & M2_DEMON) ? "demons" : ++ something); ++ dump(youwere, buf); ++ } ++ if (Undead_warning) dump(youwere, "warned of undead"); ++ if (Searching) dump(youhad, "automatic searching"); ++ if (Clairvoyant) dump(youwere, "clairvoyant"); ++ if (Infravision) dump(youhad, "infravision"); ++ if (Detect_monsters) ++ dump(youwere, "sensing the presence of monsters"); ++ if (u.umconf) dump(youwere, "going to confuse monsters"); ++ ++ /*** Appearance and behavior ***/ ++ if (Adornment) { ++ int adorn = 0; ++ if(uleft && uleft->otyp == RIN_ADORNMENT) adorn += uleft->spe; ++ if(uright && uright->otyp == RIN_ADORNMENT) adorn += uright->spe; ++ if (adorn < 0) ++ dump(youwere, "poorly adorned"); ++ else ++ dump(youwere, "adorned"); ++ } ++ if (Invisible) dump(youwere, "invisible"); ++ else if (Invis) dump(youwere, "invisible to others"); ++ /* ordinarily "visible" is redundant; this is a special case for ++ the situation when invisibility would be an expected attribute */ ++ else if ((HInvis || EInvis || pm_invisible(youmonst.data)) && BInvis) ++ dump(youwere, "visible"); ++ if (Displaced) dump(youwere, "displaced"); ++ if (Stealth) dump(youwere, "stealthy"); ++ if (Aggravate_monster) dump(" ", "You aggravated monsters"); ++ if (Conflict) dump(" ", "You caused conflict"); ++ ++ /*** Transportation ***/ ++ if (Jumping) dump(youcould, "jump"); ++ if (Teleportation) dump(youcould, "teleport"); ++ if (Teleport_control) dump(youhad, "teleport control"); ++ if (Lev_at_will) dump(youwere, "levitating, at will"); ++ else if (Levitation) ++ dump(youwere, "levitating"); /* without control */ ++ else if (Flying) dump(youcould, "fly"); ++ if (Wwalking) dump(youcould, "walk on water"); ++ if (Swimming) dump(youcould, "swim"); ++ if (Breathless) dump(youcould, "survive without air"); ++ else if (Amphibious) dump(youcould, "breathe water"); ++ if (Passes_walls) dump(youcould, "walk through walls"); ++#ifdef STEED ++ if (u.usteed && (final < 2 || strcmp(killer, "riding accident"))) { ++ Sprintf(buf, "riding %s", y_monnam(u.usteed)); ++ dump(youwere, buf); ++ } ++#endif ++ if (u.uswallow) { ++ Sprintf(buf, "swallowed by %s", a_monnam(u.ustuck)); ++#ifdef WIZARD ++ if (wizard) Sprintf(eos(buf), " (%u)", u.uswldtim); ++#endif ++ dump(youwere, buf); ++ } else if (u.ustuck) { ++ Sprintf(buf, "%s %s", ++ (Upolyd && sticks(youmonst.data)) ? "holding" : "held by", ++ a_monnam(u.ustuck)); ++ dump(youwere, buf); ++ } ++ ++ /*** Physical attributes ***/ ++ if (u.uhitinc) ++ dump(youhad, ++ enlght_combatinc("to hit", u.uhitinc, final, buf)); ++ if (u.udaminc) ++ dump(youhad, ++ enlght_combatinc("damage", u.udaminc, final, buf)); ++ if (Slow_digestion) dump(youhad, "slower digestion"); ++ if (Regeneration) dump(" ", "You regenerated"); ++ if (u.uspellprot || Protection) { ++ int prot = 0; ++ ++ if(uleft && uleft->otyp == RIN_PROTECTION) prot += uleft->spe; ++ if(uright && uright->otyp == RIN_PROTECTION) prot += uright->spe; ++ if (HProtection & INTRINSIC) prot += u.ublessed; ++ prot += u.uspellprot; ++ ++ if (prot < 0) ++ dump(youwere, "ineffectively protected"); ++ else ++ dump(youwere, "protected"); ++ } ++ if (Protection_from_shape_changers) ++ dump(youwere, "protected from shape changers"); ++ if (Polymorph) dump(youwere, "polymorphing"); ++ if (Polymorph_control) dump(youhad, "polymorph control"); ++ if (u.ulycn >= LOW_PM) { ++ Strcpy(buf, an(mons[u.ulycn].mname)); ++ dump(youwere, buf); ++ } ++ if (Upolyd) { ++ if (u.umonnum == u.ulycn) Strcpy(buf, "in beast form"); ++ else Sprintf(buf, "polymorphed into %s", ++ an(youmonst.data->mname)); ++#ifdef WIZARD ++ if (wizard) Sprintf(eos(buf), " (%d)", u.mtimedone); ++#endif ++ dump(youwere, buf); ++ } ++ if (Unchanging) ++ dump(youcould, "not change from your current form"); ++ if (Fast) dump(youwere, Very_fast ? "very fast" : "fast"); ++ if (Reflecting) dump(youhad, "reflection"); ++ if (Free_action) dump(youhad, "free action"); ++ if (Fixed_abil) dump(youhad, "fixed abilities"); ++ if (Lifesaved) ++ dump(" ", "Your life would have been saved"); ++ if (u.twoweap) dump(youwere, "wielding two weapons at once"); ++ ++ /*** Miscellany ***/ ++ if (Luck) { ++ ltmp = abs((int)Luck); ++ Sprintf(buf, "%s%slucky (%d)", ++ ltmp >= 10 ? "extremely " : ltmp >= 5 ? "very " : "", ++ Luck < 0 ? "un" : "", Luck); ++ dump(youwere, buf); ++ } ++#ifdef WIZARD ++ else if (wizard) dump(" ", "Your luck was zero"); ++#endif ++ if (u.moreluck > 0) dump(youhad, "extra luck"); ++ else if (u.moreluck < 0) dump(youhad, "reduced luck"); ++ if (carrying(LUCKSTONE) || stone_luck(TRUE)) { ++ ltmp = stone_luck(FALSE); ++ if (ltmp <= 0) ++ dump(" ", "Bad luck did not time out for you"); ++ if (ltmp >= 0) ++ dump(" ", "Good luck did not time out for you"); ++ } ++ ++ if (u.ugangr) { ++ Sprintf(buf, " %sangry with you", ++ u.ugangr > 6 ? "extremely " : u.ugangr > 3 ? "very " : ""); ++#ifdef WIZARD ++ if (wizard) Sprintf(eos(buf), " (%d)", u.ugangr); ++#endif ++ Sprintf(buf2, "%s was %s", u_gname(), buf); ++ dump(" ", buf2); ++ } ++ ++ { ++ const char *p; ++ ++ buf[0] = '\0'; ++ if (final < 2) { /* quit/escaped/ascended */ ++ p = "survived after being killed "; ++ switch (u.umortality) { ++ case 0: p = "survived"; break; ++ case 1: Strcpy(buf, "once"); break; ++ case 2: Strcpy(buf, "twice"); break; ++ case 3: Strcpy(buf, "thrice"); break; ++ default: Sprintf(buf, "%d times", u.umortality); ++ break; ++ } ++ } else { /* game ended in character's death */ ++ p = "are dead"; ++ switch (u.umortality) { ++ case 0: impossible("dead without dying?"); ++ case 1: break; /* just "are dead" */ ++ default: Sprintf(buf, " (%d%s time!)", u.umortality, ++ ordin(u.umortality)); ++ break; ++ } ++ } ++ if (p) { ++ Sprintf(buf2, "You %s %s", p, buf); ++ dump(" ", buf2); ++ } ++ } ++ dump("", ""); ++ return; ++ ++} /* dump_enlightenment */ ++#endif ++ + /* + * Courtesy function for non-debug, non-explorer mode players + * to help refresh them about who/what they are. +@@ -1340,6 +1642,99 @@ + display_nhwindow(en_win, TRUE); + destroy_nhwindow(en_win); + } ++ ++#ifdef DUMP_LOG ++void ++dump_conduct(final) ++int final; ++{ ++ char buf[BUFSZ]; ++ int ngenocided; ++ ++ dump("", "Voluntary challenges"); ++ ++ if (!u.uconduct.food) ++ dump("", " You went without food"); ++ /* But beverages are okay */ ++ else if (!u.uconduct.unvegan) ++ dump("", " You followed a strict vegan diet"); ++ else if (!u.uconduct.unvegetarian) ++ dump("", " You were a vegetarian"); ++ else if (Role_if(PM_MONK) && u.uconduct.unvegetarian < 10) { ++ sprintf(buf, " You ate non-vegetarian food %ld time%s.", ++ u.uconduct.unvegetarian, plur(u.uconduct.unvegetarian)); ++ dump("", buf); ++ } ++ ++ if (!u.uconduct.gnostic) ++ dump("", " You were an atheist"); ++ ++ if (!u.uconduct.weaphit) ++ dump("", " You never hit with a wielded weapon"); ++ else if (Role_if(PM_MONK) && u.uconduct.weaphit < 10) { ++ Sprintf(buf, " You hit with a wielded weapon %ld time%s", ++ u.uconduct.weaphit, plur(u.uconduct.weaphit)); ++ dump("", buf); ++ } ++#ifdef WIZARD ++ else if (wizard) { ++ Sprintf(buf, "hit with a wielded weapon %ld time%s", ++ u.uconduct.weaphit, plur(u.uconduct.weaphit)); ++ dump(" You ", buf); ++ } ++#endif ++ if (!u.uconduct.killer) ++ dump("", " You were a pacifist"); ++ ++ if (!u.uconduct.literate) ++ dump("", " You were illiterate"); ++#ifdef WIZARD ++ else if (wizard) { ++ Sprintf(buf, "read items or engraved %ld time%s", ++ u.uconduct.literate, plur(u.uconduct.literate)); ++ dump(" You ", buf); ++ } ++#endif ++ ++ ngenocided = num_genocides(); ++ if (ngenocided == 0) { ++ dump("", " You never genocided any monsters"); ++ } else { ++ Sprintf(buf, "genocided %d type%s of monster%s", ++ ngenocided, plur(ngenocided), plur(ngenocided)); ++ dump(" You ", buf); ++ } ++ ++ if (!u.uconduct.polypiles) ++ dump("", " You never polymorphed an object"); ++ else { ++ Sprintf(buf, "polymorphed %ld item%s", ++ u.uconduct.polypiles, plur(u.uconduct.polypiles)); ++ dump(" You ", buf); ++ } ++ ++ if (!u.uconduct.polyselfs) ++ dump("", " You never changed form"); ++ else { ++ Sprintf(buf, "changed form %ld time%s", ++ u.uconduct.polyselfs, plur(u.uconduct.polyselfs)); ++ dump(" You ", buf); ++ } ++ ++ if (!u.uconduct.wishes) ++ dump("", " You used no wishes"); ++ else { ++ Sprintf(buf, "used %ld wish%s", ++ u.uconduct.wishes, (u.uconduct.wishes > 1L) ? "es" : ""); ++ dump(" You ", buf); ++ ++ if (!u.uconduct.wisharti) ++ dump("", " You did not wish for any artifacts"); ++ } ++ ++ dump("", ""); ++} ++#endif /* DUMP_LOG */ + + #endif /* OVLB */ + #ifdef OVL1 +diff -Nurd --exclude-from=diff_ign.txt nh343off/src/decl.c nh343dump/src/decl.c +--- nh343off/src/decl.c Mon Dec 8 01:39:14 2003 ++++ nh343dump/src/decl.c Wed Dec 10 16:56:06 2003 +@@ -209,6 +209,15 @@ + + NEARDATA struct mvitals mvitals[NUMMONS]; + ++/* originally from end.c */ ++#ifdef DUMP_LOG ++#ifdef DUMP_FN ++char dump_fn[] = DUMP_FN; ++#else ++char dump_fn[PL_PSIZ] = DUMMY; ++#endif ++#endif /* DUMP_LOG */ ++ + NEARDATA struct c_color_names c_color_names = { + "black", "amber", "golden", + "light blue", "red", "green", +diff -Nurd --exclude-from=diff_ign.txt nh343off/src/display.c nh343dump/src/display.c +--- nh343off/src/display.c Mon Dec 8 01:39:14 2003 ++++ nh343dump/src/display.c Thu Dec 11 19:27:20 2003 +@@ -117,6 +117,7 @@ + */ + #include "hack.h" + #include "region.h" ++#include + + STATIC_DCL void FDECL(display_monster,(XCHAR_P,XCHAR_P,struct monst *,int,XCHAR_P)); + STATIC_DCL int FDECL(swallow_to_glyph, (int, int)); +@@ -1370,6 +1370,105 @@ + + /* ========================================================================= */ + ++#ifdef DUMP_LOG ++/* D: Added to dump screen to output file */ ++STATIC_PTR uchar get_glyph_char(glyph) ++int glyph; ++{ ++ uchar ch; ++ register int offset; ++ ++ assert (!(glyph >= NO_GLYPH)); ++ ++ /* ++ * Map the glyph back to a character. ++ * ++ * Warning: For speed, this makes an assumption on the order of ++ * offsets. The order is set in display.h. ++ */ ++ if ((offset = (glyph - GLYPH_WARNING_OFF)) >= 0) { /* a warning flash */ ++ ch = def_warnsyms[offset].sym; ++ } else if ((offset = (glyph - GLYPH_SWALLOW_OFF)) >= 0) { /* swallow */ ++ /* see swallow_to_glyph() in display.c */ ++ ch = (uchar) defsyms[S_sw_tl + (offset & 0x7)].sym; ++ } else if ((offset = (glyph - GLYPH_ZAP_OFF)) >= 0) { /* zap beam */ ++ /* see zapdir_to_glyph() in display.c */ ++ ch = defsyms[S_vbeam + (offset & 0x3)].sym; ++ } else if ((offset = (glyph - GLYPH_CMAP_OFF)) >= 0) { /* cmap */ ++ ch = defsyms[offset].sym; ++ } else if ((offset = (glyph - GLYPH_OBJ_OFF)) >= 0) { /* object */ ++ ch = def_oc_syms[(int)objects[offset].oc_class]; ++ } else if ((offset = (glyph - GLYPH_RIDDEN_OFF)) >= 0) { /* mon ridden */ ++ ch = def_monsyms[(int)mons[offset].mlet]; ++ } else if ((offset = (glyph - GLYPH_BODY_OFF)) >= 0) { /* a corpse */ ++ ch = def_oc_syms[(int)objects[CORPSE].oc_class]; ++ } else if ((offset = (glyph - GLYPH_DETECT_OFF)) >= 0) { /* mon detect */ ++ ch = def_monsyms[(int)mons[offset].mlet]; ++ } else if ((offset = (glyph - GLYPH_INVIS_OFF)) >= 0) { /* invisible */ ++ ch = DEF_INVISIBLE; ++ } else if ((offset = (glyph - GLYPH_PET_OFF)) >= 0) { /* a pet */ ++ ch = def_monsyms[(int)mons[offset].mlet]; ++ } else { /* a monster */ ++ ch = monsyms[(int)mons[glyph].mlet]; ++ } ++ return ch; ++} ++ ++#ifdef TTY_GRAPHICS ++extern const char * FDECL(compress_str, (const char *)); ++#else ++const char* ++compress_str(str) /* copied from win/tty/wintty.c */ ++const char *str; ++{ ++ static char cbuf[BUFSZ]; ++ /* compress in case line too long */ ++ if((int)strlen(str) >= 80) { ++ register const char *bp0 = str; ++ register char *bp1 = cbuf; ++ ++ do { ++ if(*bp0 != ' ' || bp0[1] != ' ') ++ *bp1++ = *bp0; ++ } while(*bp0++); ++ } else ++ return str; ++ return cbuf; ++} ++#endif /* TTY_GRAPHICS */ ++ ++/* Take a screen dump */ ++void dump_screen() ++{ ++ register int x,y; ++ int lastc; ++ /* D: botl.c has a closer approximation to the size, but we'll go with ++ * this */ ++ char buf[300], *ptr; ++ ++ for (y = 0; y < ROWNO; y++) { ++ lastc = 0; ++ ptr = buf; ++ for (x = 1; x < COLNO; x++) { ++ uchar c = get_glyph_char(gbuf[y][x].glyph); ++ *ptr++ = c; ++ if (c != ' ') ++ lastc = x; ++ } ++ buf[lastc] = '\0'; ++ dump("", buf); ++ } ++ dump("", ""); ++ bot1str(buf); ++ ptr = (char *) compress_str((const char *) buf); ++ dump("", ptr); ++ bot2str(buf); ++ dump("", buf); ++ dump("", ""); ++ dump("", ""); ++} ++#endif /* DUMP_LOG */ ++ + /* + * back_to_glyph() + * +diff -Nurd --exclude-from=diff_ign.txt nh343off/src/end.c nh343dump/src/end.c +--- nh343off/src/end.c Mon Dec 8 01:39:14 2003 ++++ nh343dump/src/end.c Sat Dec 13 17:27:12 2003 +@@ -40,7 +40,13 @@ + STATIC_DCL void FDECL(artifact_score, (struct obj *,BOOLEAN_P,winid)); + STATIC_DCL void FDECL(savelife, (int)); + STATIC_DCL void FDECL(list_vanquished, (CHAR_P,BOOLEAN_P)); ++#ifdef DUMP_LOG ++extern void NDECL(dump_spells); ++void FDECL(do_vanquished, (int, BOOLEAN_P, BOOLEAN_P)); ++STATIC_DCL void FDECL(list_genocided, (int, BOOLEAN_P, BOOLEAN_P)); ++#else + STATIC_DCL void FDECL(list_genocided, (CHAR_P,BOOLEAN_P)); ++#endif /* DUMP_LOG */ + STATIC_DCL boolean FDECL(should_query_disclose_option, (int,char *)); + + #if defined(__BEOS__) || defined(MICRO) || defined(WIN32) || defined(OS2) +@@ -86,6 +92,62 @@ + + extern const char * const killed_by_prefix[]; /* from topten.c */ + ++#ifdef DUMP_LOG ++FILE *dump_fp = (FILE *)0; /* file pointer for dumps */ ++/* functions dump_init, dump_exit and dump are from the dump patch */ ++ ++void ++dump_init () ++{ ++ if (dump_fn[0]) { ++ char *p = (char *) strstr(dump_fn, "%n"); ++ if (p) { ++ int new_dump_fn_len = strlen(dump_fn)+strlen(plname)-2; /* %n */ ++ char *new_dump_fn = (char *) alloc((unsigned)(new_dump_fn_len+1)); ++ char *q = new_dump_fn; ++ strncpy(q, dump_fn, p-dump_fn); ++ q += p-dump_fn; ++ strncpy(q, plname, strlen(plname) + 1); ++ regularize(q); ++ q[strlen(plname)] = '\0'; ++ q += strlen(q); ++ p += 2; /* skip "%n" */ ++ strncpy(q, p, strlen(p)); ++ new_dump_fn[new_dump_fn_len] = '\0'; ++ ++ dump_fp = fopen(new_dump_fn, "w"); ++ if (!dump_fp) { ++ pline("Can't open %s for output.", new_dump_fn); ++ pline("Dump file not created."); ++ } ++ free(new_dump_fn); ++ ++ } else { ++ dump_fp = fopen (dump_fn, "w"); ++ ++ if (!dump_fp) { ++ pline("Can't open %s for output.", dump_fn); ++ pline("Dump file not created."); ++ } ++ } ++ } ++} ++ ++void ++dump_exit () ++{ ++ if (dump_fp) ++ fclose (dump_fp); ++} ++ ++void dump (pre, str) ++ char *pre, *str; ++{ ++ if (dump_fp) ++ fprintf (dump_fp, "%s%s\n", pre, str); ++} ++#endif /* DUMP_LOG */ ++ + /*ARGSUSED*/ + void + done1(sig_unused) /* called as signal() handler, so sent at least one arg */ +@@ -373,8 +435,13 @@ + makeknown(obj->otyp); + obj->known = obj->bknown = obj->dknown = obj->rknown = 1; + } ++#ifdef DUMP_LOG ++ (void) dump_inventory((char *)0, TRUE); ++ do_containerconts(invent, TRUE, TRUE, TRUE); ++#else + (void) display_inventory((char *)0, TRUE); + container_contents(invent, TRUE, TRUE); ++#endif /* DUMP_LOG */ + } + if (c == 'q') done_stopprint++; + } +@@ -388,14 +455,28 @@ + enlightenment(how >= PANICKED ? 1 : 2); /* final */ + if (c == 'q') done_stopprint++; + } ++#ifdef DUMP_LOG ++ if (dump_fp) { ++ dump_enlightenment((int) (how >= PANICKED ? 1 : 2)); ++ dump_spells(); ++ } ++#endif + + ask = should_query_disclose_option('v', &defquery); + if (!done_stopprint) ++#ifdef DUMP_LOG ++ do_vanquished(defquery, ask, TRUE); ++#else + list_vanquished(defquery, ask); ++#endif + + ask = should_query_disclose_option('g', &defquery); + if (!done_stopprint) ++#ifdef DUMP_LOG ++ list_genocided(defquery, ask,TRUE); ++#else + list_genocided(defquery, ask); ++#endif + + ask = should_query_disclose_option('c', &defquery); + if (!done_stopprint) { +@@ -405,6 +486,12 @@ + show_conduct(how >= PANICKED ? 1 : 2); + if (c == 'q') done_stopprint++; + } ++#ifdef DUMP_LOG ++ if (dump_fp) { ++ dump_conduct(how >= PANICKED ? 1 : 2); ++ dump_weapon_skill(); ++ } ++#endif + } + + /* try to get the player back in a viable state after being killed */ +@@ -524,6 +611,10 @@ + OBJ_NAME(objects[otmp->otyp]), + value, currency(value), points); + putstr(endwin, 0, pbuf); ++#ifdef DUMP_LOG ++ if (dump_fp) ++ dump("", pbuf); ++#endif + } + } + if (Has_contents(otmp)) +@@ -614,6 +705,22 @@ + program_state.gameover = 1; + /* in case of a subsequent panic(), there's no point trying to save */ + program_state.something_worth_saving = 0; ++#ifdef DUMP_LOG ++ /* D: Grab screen dump right here */ ++ if (dump_fn[0]) { ++ dump_init(); ++ Sprintf(pbuf, "%s, %s %s %s %s", plname, ++ aligns[1 - u.ualign.type].adj, ++ genders[flags.female].adj, ++ urace.adj, ++ (flags.female && urole.name.f)? ++ urole.name.f : urole.name.m); ++ dump("", pbuf); ++ /* D: Add a line for clearance from the screen dump */ ++ dump("", ""); ++ dump_screen(); ++ } ++#endif /* DUMP_LOG */ + /* render vision subsystem inoperative */ + iflags.vision_inited = 0; + /* might have been killed while using a disposable item, so make sure +@@ -770,15 +877,18 @@ + /* don't bother counting to see whether it should be plural */ + } + ++ Sprintf(pbuf, "%s %s the %s...", Goodbye(), plname, ++ how != ASCENDED ? ++ (const char *) ((flags.female && urole.name.f) ? ++ urole.name.f : urole.name.m) : ++ (const char *) (flags.female ? "Demigoddess" : "Demigod")); + if (!done_stopprint) { +- Sprintf(pbuf, "%s %s the %s...", Goodbye(), plname, +- how != ASCENDED ? +- (const char *) ((flags.female && urole.name.f) ? +- urole.name.f : urole.name.m) : +- (const char *) (flags.female ? "Demigoddess" : "Demigod")); + putstr(endwin, 0, pbuf); + putstr(endwin, 0, ""); + } ++#ifdef DUMP_LOG ++ if (dump_fp) dump("", pbuf); ++#endif + + if (how == ESCAPED || how == ASCENDED) { + register struct monst *mtmp; +@@ -805,25 +915,30 @@ + keepdogs(TRUE); + viz_array[0][0] |= IN_SIGHT; /* need visibility for naming */ + mtmp = mydogs; +- if (!done_stopprint) Strcpy(pbuf, "You"); ++ Strcpy(pbuf, "You"); + if (mtmp) { + while (mtmp) { +- if (!done_stopprint) +- Sprintf(eos(pbuf), " and %s", mon_nam(mtmp)); ++ Sprintf(eos(pbuf), " and %s", mon_nam(mtmp)); + if (mtmp->mtame) + u.urexp += mtmp->mhp; + mtmp = mtmp->nmon; + } + if (!done_stopprint) putstr(endwin, 0, pbuf); ++#ifdef DUMP_LOG ++ if (dump_fp) dump("", pbuf); ++#endif + pbuf[0] = '\0'; + } else { + if (!done_stopprint) Strcat(pbuf, " "); + } +- if (!done_stopprint) { +- Sprintf(eos(pbuf), "%s with %ld point%s,", ++ Sprintf(eos(pbuf), "%s with %ld point%s,", + how==ASCENDED ? "went to your reward" : + "escaped from the dungeon", + u.urexp, plur(u.urexp)); ++#ifdef DUMP_LOG ++ if (dump_fp) dump("", pbuf); ++#endif ++ if (!done_stopprint) { + putstr(endwin, 0, pbuf); + } + +@@ -855,6 +970,9 @@ + count, plur(count)); + } + putstr(endwin, 0, pbuf); ++#ifdef DUMP_LOG ++ if (dump_fp) dump("", pbuf); ++#endif + } + } + +@@ -879,12 +997,22 @@ + Sprintf(eos(pbuf), " with %ld point%s,", + u.urexp, plur(u.urexp)); + putstr(endwin, 0, pbuf); ++#ifdef DUMP_LOG ++ if (dump_fp) dump("", pbuf); ++#endif + } + + if (!done_stopprint) { + Sprintf(pbuf, "and %ld piece%s of gold, after %ld move%s.", + umoney, plur(umoney), moves, plur(moves)); + putstr(endwin, 0, pbuf); ++#ifdef DUMP_LOG ++ if (dump_fp) { ++ dump("", pbuf); ++ Sprintf(pbuf, "Killer: %s", killer); ++ dump("", pbuf); ++ } ++#endif + } + if (!done_stopprint) { + Sprintf(pbuf, +@@ -892,6 +1020,9 @@ + u.ulevel, u.uhpmax, plur(u.uhpmax), ends[how]); + putstr(endwin, 0, pbuf); + putstr(endwin, 0, ""); ++#ifdef DUMP_LOG ++ if (dump_fp) dump("", pbuf); ++#endif + } + if (!done_stopprint) + display_nhwindow(endwin, TRUE); +@@ -909,6 +1040,9 @@ + exit_nhwindows((char *)0); + topten(how); + } ++#ifdef DUMP_LOG ++ if (dump_fp) dump_exit(); ++#endif + + if(done_stopprint) { raw_print(""); raw_print(""); } + terminate(EXIT_SUCCESS); +@@ -919,6 +1053,16 @@ + container_contents(list, identified, all_containers) + struct obj *list; + boolean identified, all_containers; ++#ifdef DUMP_LOG ++{ ++ do_containerconts(list, identified, all_containers, FALSE); ++} ++ ++void do_containerconts(list, identified, all_containers, want_dump) ++struct obj *list; ++boolean identified, all_containers, want_dump; ++#endif ++/* The original container_contents function */ + { + register struct obj *box, *obj; + char buf[BUFSZ]; +@@ -932,6 +1076,9 @@ + Sprintf(buf, "Contents of %s:", the(xname(box))); + putstr(tmpwin, 0, buf); + putstr(tmpwin, 0, ""); ++#ifdef DUMP_LOG ++ if (dump_fp) dump("", buf); ++#endif + for (obj = box->cobj; obj; obj = obj->nobj) { + if (identified) { + makeknown(obj->otyp); +@@ -939,14 +1086,32 @@ + obj->dknown = obj->rknown = 1; + } + putstr(tmpwin, 0, doname(obj)); ++#ifdef DUMP_LOG ++ if (want_dump) dump(" ", doname(obj)); ++#endif + } ++#ifdef DUMP_LOG ++ if (want_dump) dump("",""); ++#endif + display_nhwindow(tmpwin, TRUE); + destroy_nhwindow(tmpwin); +- if (all_containers) ++ if (all_containers) { ++#ifdef DUMP_LOG ++ do_containerconts(box->cobj, identified, TRUE, ++ want_dump); ++#else + container_contents(box->cobj, identified, TRUE); ++#endif /* DUMP_LOG */ ++ } + } else { + pline("%s empty.", Tobjnam(box, "are")); + display_nhwindow(WIN_MESSAGE, FALSE); ++#ifdef DUMP_LOG ++ if (want_dump) { ++ dump(The(xname(box)), " is empty."); ++ dump("", ""); ++ } ++#endif + } + } + if (!all_containers) +@@ -977,6 +1142,17 @@ + list_vanquished(defquery, ask) + char defquery; + boolean ask; ++#ifdef DUMP_LOG ++{ ++ do_vanquished(defquery, ask, FALSE); ++} ++ ++void ++do_vanquished(defquery, ask, want_dump) ++int defquery; ++boolean ask; ++boolean want_dump; ++#endif + { + register int i, lev; + int ntypes = 0, max_lev = 0, nkilled; +@@ -1003,6 +1179,9 @@ + klwin = create_nhwindow(NHW_MENU); + putstr(klwin, 0, "Vanquished creatures:"); + putstr(klwin, 0, ""); ++#ifdef DUMP_LOG ++ if (want_dump) dump("", "Vanquished creatures"); ++#endif + + /* countdown by monster "toughness" */ + for (lev = max_lev; lev >= 0; lev--) +@@ -1031,6 +1210,9 @@ + nkilled, makeplural(mons[i].mname)); + } + putstr(klwin, 0, buf); ++#ifdef DUMP_LOG ++ if (want_dump) dump(" ", buf); ++#endif + } + /* + * if (Hallucination) +@@ -1040,9 +1222,15 @@ + putstr(klwin, 0, ""); + Sprintf(buf, "%ld creatures vanquished.", total_killed); + putstr(klwin, 0, buf); ++#ifdef DUMP_LOG ++ if (want_dump) dump(" ", buf); ++#endif + } + display_nhwindow(klwin, TRUE); + destroy_nhwindow(klwin); ++#ifdef DUMP_LOG ++ if (want_dump) dump("", ""); ++#endif + } + } + } +@@ -1059,10 +1247,18 @@ + return n; + } + ++#ifdef DUMP_LOG ++STATIC_OVL void ++list_genocided(defquery, ask, want_dump) ++int defquery; ++boolean ask; ++boolean want_dump; ++#else + STATIC_OVL void + list_genocided(defquery, ask) + char defquery; + boolean ask; ++#endif + { + register int i; + int ngenocided; +@@ -1079,8 +1275,12 @@ + if (c == 'q') done_stopprint++; + if (c == 'y') { + klwin = create_nhwindow(NHW_MENU); +- putstr(klwin, 0, "Genocided species:"); ++ Sprintf(buf, "Genocided species:"); ++ putstr(klwin, 0, buf); + putstr(klwin, 0, ""); ++#ifdef DUMP_LOG ++ if (want_dump) dump("", buf); ++#endif + + for (i = LOW_PM; i < NUMMONS; i++) + if (mvitals[i].mvflags & G_GENOD) { +@@ -1091,11 +1291,17 @@ + else + Strcpy(buf, makeplural(mons[i].mname)); + putstr(klwin, 0, buf); ++#ifdef DUMP_LOG ++ if (want_dump) dump(" ", buf); ++#endif + } + + putstr(klwin, 0, ""); + Sprintf(buf, "%d species genocided.", ngenocided); + putstr(klwin, 0, buf); ++#ifdef DUMP_LOG ++ if (want_dump) dump(" ", buf); ++#endif + + display_nhwindow(klwin, TRUE); + destroy_nhwindow(klwin); +diff -Nurd --exclude-from=diff_ign.txt nh343off/src/invent.c nh343dump/src/invent.c +--- nh343off/src/invent.c Mon Dec 8 01:39:14 2003 ++++ nh343dump/src/invent.c Thu Dec 11 19:25:08 2003 +@@ -19,7 +19,12 @@ + STATIC_DCL boolean FDECL(putting_on, (const char *)); + STATIC_PTR int FDECL(ckunpaid,(struct obj *)); + STATIC_PTR int FDECL(ckvalidcat,(struct obj *)); ++#ifdef DUMP_LOG ++static char FDECL(display_pickinv, ++ (const char *,BOOLEAN_P, long *, BOOLEAN_P)); ++#else + static char FDECL(display_pickinv, (const char *,BOOLEAN_P, long *)); ++#endif /* DUMP_LOG */ + #ifdef OVLB + STATIC_DCL boolean FDECL(this_type_only, (struct obj *)); + STATIC_DCL void NDECL(dounpaid); +@@ -1017,7 +1022,11 @@ + if (ilet == '?' && !*lets && *altlets) + allowed_choices = altlets; + ilet = display_pickinv(allowed_choices, TRUE, +- allowcnt ? &ctmp : (long *)0); ++ allowcnt ? &ctmp : (long *)0 ++#ifdef DUMP_LOG ++ , FALSE ++#endif ++ ); + if(!ilet) continue; + if (allowcnt && ctmp >= 0) { + cnt = ctmp; +@@ -1689,11 +1698,20 @@ + * inventory and return a count as well as a letter. If out_cnt is not null, + * any count returned from the menu selection is placed here. + */ ++#ifdef DUMP_LOG ++static char ++display_pickinv(lets, want_reply, out_cnt, want_dump) ++register const char *lets; ++boolean want_reply; ++long* out_cnt; ++boolean want_dump; ++#else + static char + display_pickinv(lets, want_reply, out_cnt) + register const char *lets; + boolean want_reply; + long* out_cnt; ++#endif + { + struct obj *otmp; + char ilet, ret; +@@ -1713,6 +1731,10 @@ + } else + win = WIN_INVEN; + ++#ifdef DUMP_LOG ++ if (want_dump) dump("", "Your inventory"); ++#endif ++ + /* + Exit early if no inventory -- but keep going if we are doing + a permanent inventory update. We need to keep going so the +@@ -1730,6 +1752,16 @@ + #else + pline("Not carrying anything."); + #endif ++#ifdef DUMP_LOG ++ if (want_dump) { ++#ifdef GOLDOBJ ++ dump(" ", "Not carrying anything"); ++#else ++ dump(" Not carrying anything", ++ u.ugold ? " except gold." : "."); ++#endif ++ } ++#endif + return 0; + } + +@@ -1747,6 +1779,14 @@ + want_reply ? PICK_ONE : PICK_NONE, + xprname(otmp, (char *)0, lets[0], TRUE, 0L, 0L)); + if (out_cnt) *out_cnt = -1L; /* select all */ ++#ifdef DUMP_LOG ++ if (want_dump) { ++ char letbuf[7]; ++ sprintf(letbuf, " %c - ", lets[0]); ++ dump(letbuf, ++ xprname(otmp, (char *)0, lets[0], TRUE, 0L, 0L)); ++ } ++#endif + break; + } + } +@@ -1765,12 +1805,23 @@ + any.a_void = 0; /* zero */ + add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings, + let_to_name(*invlet, FALSE), MENU_UNSELECTED); ++#ifdef DUMP_LOG ++ if (want_dump) ++ dump(" ", let_to_name(*invlet, FALSE)); ++#endif + classcount++; + } + any.a_char = ilet; + add_menu(win, obj_to_glyph(otmp), + &any, ilet, 0, ATR_NONE, doname(otmp), + MENU_UNSELECTED); ++#ifdef DUMP_LOG ++ if (want_dump) { ++ char letbuf[7]; ++ sprintf(letbuf, " %c - ", ilet); ++ dump(letbuf, doname(otmp)); ++ } ++#endif + } + } + } +@@ -1792,6 +1843,9 @@ + free((genericptr_t)selected); + } else + ret = !n ? '\0' : '\033'; /* cancelled */ ++#ifdef DUMP_LOG ++ if (want_dump) dump("", ""); ++#endif + + return ret; + } +@@ -1808,8 +1862,23 @@ + register const char *lets; + boolean want_reply; + { +- return display_pickinv(lets, want_reply, (long *)0); ++ return display_pickinv(lets, want_reply, (long *)0 ++#ifdef DUMP_LOG ++ , FALSE ++#endif ++ ); ++} ++ ++#ifdef DUMP_LOG ++/* See display_inventory. This is the same thing WITH dumpfile creation */ ++char ++dump_inventory(lets, want_reply) ++register const char *lets; ++boolean want_reply; ++{ ++ return display_pickinv(lets, want_reply, (long *)0, TRUE); + } ++#endif + + /* + * Returns the number of unpaid items within the given list. This includes +diff -Nurd --exclude-from=diff_ign.txt nh343off/src/options.c nh343dump/src/options.c +--- nh343off/src/options.c Mon Dec 8 01:39:14 2003 ++++ nh343dump/src/options.c Thu Dec 11 00:01:48 2003 +@@ -224,6 +224,14 @@ + SET_IN_GAME }, + { "dogname", "the name of your (first) dog (e.g., dogname:Fang)", + PL_PSIZ, DISP_IN_GAME }, ++#ifdef DUMP_LOG ++ { "dumpfile", "where to dump data (e.g., dumpfile:/tmp/dump.nh)", ++#ifdef DUMP_FN ++ PL_PSIZ, DISP_IN_GAME }, ++#else ++ PL_PSIZ, SET_IN_GAME }, ++#endif ++#endif + { "dungeon", "the symbols to use in drawing the dungeon map", + MAXDCHARS+1, SET_IN_FILE }, + { "effects", "the symbols to use in drawing special effects", +@@ -1077,6 +1085,19 @@ + return; + } + ++#ifdef DUMP_LOG ++ fullname = "dumpfile"; ++ if (match_optname(opts, fullname, 3, TRUE)) { ++#ifndef DUMP_FN ++ if (negated) bad_negation(fullname, FALSE); ++ else if ((op = string_for_opt(opts, !tfrom_file)) != 0 ++ && strlen(op) > 1) ++ nmcpy(dump_fn, op, PL_PSIZ); ++#endif ++ return; ++ } ++#endif ++ + fullname = "horsename"; + if (match_optname(opts, fullname, 5, TRUE)) { + if (negated) bad_negation(fullname, FALSE); +@@ -2933,6 +2954,10 @@ + } + else if (!strcmp(optname, "dogname")) + Sprintf(buf, "%s", dogname[0] ? dogname : none ); ++#ifdef DUMP_LOG ++ else if (!strcmp(optname, "dumpfile")) ++ Sprintf(buf, "%s", dump_fn[0] ? dump_fn: none ); ++#endif + else if (!strcmp(optname, "dungeon")) + Sprintf(buf, "%s", to_be_done); + else if (!strcmp(optname, "effects")) +diff -Nurd --exclude-from=diff_ign.txt nh343off/src/spell.c nh343dump/src/spell.c +--- nh343off/src/spell.c Mon Dec 8 01:39:14 2003 ++++ nh343dump/src/spell.c Thu Dec 11 00:16:02 2003 +@@ -1114,6 +1114,35 @@ + return FALSE; + } + ++#ifdef DUMP_LOG ++void ++dump_spells() ++{ ++ int i; ++ char buf[BUFSZ]; ++ ++ if (spellid(0) == NO_SPELL) { ++ dump("", "You didn't know any spells."); ++ dump("", ""); ++ return; ++ } ++ dump("", "Spells known in the end"); ++ ++ Sprintf(buf, "%-20s Level %-12s Fail", " Name", "Category"); ++ dump(" ",buf); ++ for (i = 0; i < MAXSPELL && spellid(i) != NO_SPELL; i++) { ++ Sprintf(buf, "%c - %-20s %2d%s %-12s %3d%%", ++ spellet(i), spellname(i), spellev(i), ++ spellknow(i) ? " " : "*", ++ spelltypemnemonic(spell_skilltype(spellid(i))), ++ 100 - percent_success(i)); ++ dump(" ", buf); ++ } ++ dump("",""); ++ ++} /* dump_spells */ ++#endif ++ + /* Integer square root function without using floating point. */ + STATIC_OVL int + isqrt(val) +diff -Nurd --exclude-from=diff_ign.txt nh343off/src/topten.c nh343dump/src/topten.c +--- nh343off/src/topten.c Mon Dec 8 01:39:14 2003 ++++ nh343dump/src/topten.c Thu Dec 11 00:42:28 2003 +@@ -358,6 +358,12 @@ + "Since you were in %s mode, the score list will not be checked.", + wizard ? "wizard" : "discover"); + topten_print(pbuf); ++#ifdef DUMP_LOG ++ if (dump_fn[0]) { ++ dump("", pbuf); ++ dump("", ""); ++ } ++#endif + } + goto showwin; + } +@@ -378,6 +384,9 @@ + } + + HUP topten_print(""); ++#ifdef DUMP_LOG ++ dump("", ""); ++#endif + + /* assure minimum number of points */ + if(t0->points < POINTSMIN) t0->points = 0; +@@ -422,6 +431,10 @@ + t1->points); + topten_print(pbuf); + topten_print(""); ++#ifdef DUMP_LOG ++ dump("", pbuf); ++ dump("", ""); ++#endif + } + } + if(occ_cnt < 0) { +@@ -453,16 +466,25 @@ + } + #endif /* UPDATE_RECORD_IN_PLACE */ + if(!done_stopprint) if(rank0 > 0){ +- if(rank0 <= 10) ++ if(rank0 <= 10) { + topten_print("You made the top ten list!"); +- else { ++#ifdef DUMP_LOG ++ dump("", "You made the top ten list!"); ++#endif ++ } else { + char pbuf[BUFSZ]; + Sprintf(pbuf, + "You reached the %d%s place on the top %d list.", + rank0, ordin(rank0), ENTRYMAX); + topten_print(pbuf); ++#ifdef DUMP_LOG ++ dump("", pbuf); ++#endif + } + topten_print(""); ++#ifdef DUMP_LOG ++ dump("", ""); ++#endif + } + } + if(rank0 == 0) rank0 = rank1; +@@ -488,8 +510,12 @@ + )) continue; + if (rank == rank0 - flags.end_around && + rank0 > flags.end_top + flags.end_around + 1 && +- !flags.end_own) ++ !flags.end_own) { + topten_print(""); ++#ifdef DUMP_LOG ++ dump("", ""); ++#endif ++ } + if(rank != rank0) + outentry(rank, t1, FALSE); + else if(!rank1) +@@ -547,6 +573,9 @@ + while(bp < linebuf + COLNO - 9) *bp++ = ' '; + Strcpy(bp, "Hp [max]"); + topten_print(linebuf); ++#ifdef DUMP_LOG ++ dump("", linebuf); ++#endif + } + + /* so>0: standout line; so=0: ordinary line */ +@@ -665,8 +694,15 @@ + while (bp < linebuf + (COLNO-1)) *bp++ = ' '; + *bp = 0; + topten_print_bold(linebuf); +- } else ++#ifdef DUMP_LOG ++ dump("*", linebuf[0]==' '? linebuf+1: linebuf); ++#endif ++ } else { + topten_print(linebuf); ++#ifdef DUMP_LOG ++ dump(" ", linebuf[0]==' '? linebuf+1: linebuf); ++#endif ++ } + Sprintf(linebuf, "%15s %s", "", linebuf3); + lngr = strlen(linebuf); + } +@@ -691,6 +727,9 @@ + topten_print_bold(linebuf); + } else + topten_print(linebuf); ++#ifdef DUMP_LOG ++ dump(" ", linebuf[0]==' '? linebuf+1: linebuf); ++#endif + } + + STATIC_OVL int +diff -Nurd --exclude-from=diff_ign.txt nh343off/src/weapon.c nh343dump/src/weapon.c +--- nh343off/src/weapon.c Mon Dec 8 01:39:14 2003 ++++ nh343dump/src/weapon.c Thu Dec 11 01:23:34 2003 +@@ -9,6 +9,10 @@ + */ + #include "hack.h" + ++#ifdef DUMP_LOG ++STATIC_DCL int FDECL(enhance_skill, (boolean)); ++#endif ++ + /* Categories whose names don't come from OBJ_NAME(objects[type]) + */ + #define PN_BARE_HANDED (-1) /* includes martial arts */ +@@ -851,6 +855,23 @@ + */ + int + enhance_weapon_skill() ++#ifdef DUMP_LOG ++{ ++ return enhance_skill(FALSE); ++} ++ ++void dump_weapon_skill() ++{ ++ enhance_skill(TRUE); ++} ++ ++int enhance_skill(boolean want_dump) ++/* This is the original enhance_weapon_skill() function slightly modified ++ * to write the skills to the dump file. I added the wrapper functions just ++ * because it looked like the easiest way to add a parameter to the ++ * function call. - Jukka Lahtinen, August 2001 ++ */ ++#endif + { + int pass, i, n, len, longest, + to_advance, eventually_advance, maxxed_cnt; +@@ -860,8 +881,15 @@ + anything any; + winid win; + boolean speedy = FALSE; ++#ifdef DUMP_LOG ++ char buf2[BUFSZ]; ++ boolean logged = FALSE; ++#endif + + #ifdef WIZARD ++#ifdef DUMP_LOG ++ if (!want_dump) ++#endif + if (wizard && yn("Advance skills without practice?") == 'y') + speedy = TRUE; + #endif +@@ -878,6 +906,11 @@ + else if (peaked_skill(i)) maxxed_cnt++; + } + ++#ifdef DUMP_LOG ++ if (want_dump) ++ dump("","Your skills at the end"); ++ else { ++#endif + win = create_nhwindow(NHW_MENU); + start_menu(win); + +@@ -905,6 +938,9 @@ + add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE, + "", MENU_UNSELECTED); + } ++#ifdef DUMP_LOG ++ } /* want_dump or not */ ++#endif + + /* List the skills, making ones that could be advanced + selectable. List the miscellaneous skills first. +@@ -916,8 +952,28 @@ + /* Print headings for skill types */ + any.a_void = 0; + if (i == skill_ranges[pass].first) ++#ifdef DUMP_LOG ++ { ++ if (want_dump) { ++ dump(" ",(char *)skill_ranges[pass].name); ++ logged=FALSE; ++ } else ++#endif + add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings, + skill_ranges[pass].name, MENU_UNSELECTED); ++#ifdef DUMP_LOG ++ } ++ if (want_dump) { ++ if (P_SKILL(i) > P_UNSKILLED) { ++ Sprintf(buf2,"%-*s [%s]", ++ longest, P_NAME(i),skill_level_name(i, buf)); ++ dump(" ",buf2); ++ logged=TRUE; ++ } else if (i == skill_ranges[pass].last && !logged) { ++ dump(" ","(none)"); ++ } ++ } else { ++#endif + + if (P_RESTRICTED(i)) continue; + /* +@@ -962,6 +1016,9 @@ + any.a_int = can_advance(i, speedy) ? i+1 : 0; + add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE, + buf, MENU_UNSELECTED); ++#ifdef DUMP_LOG ++ } /* !want_dump */ ++#endif + } + + Strcpy(buf, (to_advance > 0) ? "Pick a skill to advance:" : +@@ -971,6 +1028,12 @@ + Sprintf(eos(buf), " (%d slot%s available)", + u.weapon_slots, plur(u.weapon_slots)); + #endif ++#ifdef DUMP_LOG ++ if (want_dump) { ++ dump("",""); ++ n=0; ++ } else { ++#endif + end_menu(win, buf); + n = select_menu(win, to_advance ? PICK_ONE : PICK_NONE, &selected); + destroy_nhwindow(win); +@@ -987,6 +1050,9 @@ + } + } + } ++#ifdef DUMP_LOG ++ } ++#endif + } while (speedy && n > 0); + return 0; + } +diff -Nurd --exclude-from=diff_ign.txt nh343off/win/tty/wintty.c nh343dump/win/tty/wintty.c +--- nh343off/win/tty/wintty.c Mon Dec 8 01:39:14 2003 ++++ nh343dump/win/tty/wintty.c Thu Dec 11 01:16:56 2003 +@@ -162,7 +162,7 @@ + STATIC_DCL void FDECL(process_menu_window, (winid,struct WinDesc *)); + STATIC_DCL void FDECL(process_text_window, (winid,struct WinDesc *)); + STATIC_DCL tty_menu_item *FDECL(reverse, (tty_menu_item *)); +-STATIC_DCL const char * FDECL(compress_str, (const char *)); ++const char * FDECL(compress_str, (const char *)); + STATIC_DCL void FDECL(tty_putsym, (winid, int, int, CHAR_P)); + static char *FDECL(copy_of, (const char *)); + STATIC_DCL void FDECL(bail, (const char *)); /* __attribute__((noreturn)) */ +@@ -1722,7 +1722,7 @@ + } + + +-STATIC_OVL const char* ++const char* + compress_str(str) + const char *str; + { +--- nethack-3.4.3/include/config.h~ 2004-03-12 18:13:05.000000000 -0800 ++++ nethack-3.4.3/include/config.h 2004-03-12 18:13:26.000000000 -0800 +@@ -364,6 +364,8 @@ + + /*#define GOLDOBJ */ /* Gold is kept on obj chains - Helge Hafting */ + /*#define AUTOPICKUP_EXCEPTIONS */ /* exceptions to autopickup */ ++#define DUMP_LOG ++#define DUMP_FN "/var/games/nethack/dumps/%n.lastgame.txt" + + /* End of Section 5 */ + --- nethack-3.4.3.orig/debian/nethack-lisp.copyright +++ nethack-3.4.3/debian/nethack-lisp.copyright @@ -0,0 +1,131 @@ +This package was created by Ben Gertzfield on +Sun, 12 Dec 1999 14:23:01 -0800. It was originally Debianized by +Paul Haggart . + +Nethack's home site is: http://www.nethack.org/ + +This archive was downloaded from: +http://us.dl.sourceforge.net/sourceforge/nethack/nethack-342.tgz + +Copyright: + + NETHACK GENERAL PUBLIC LICENSE + (Copyright 1989 M. Stephenson) +. + (Based on the BISON general public license, + copyright 1988 Richard M. Stallman) + + Everyone is permitted to copy and distribute verbatim copies of this + license, but changing it is not allowed. You can also use this wording to + make the terms for other programs. + + The license agreements of most software companies keep you at the mercy of +those companies. By contrast, our general public license is intended to give +everyone the right to share NetHack. To make sure that you get the rights we +want you to have, we need to make restrictions that forbid anyone to deny you +these rights or to ask you to surrender the rights. Hence this license +agreement. + + Specifically, we want to make sure that you have the right to give away +copies of NetHack, that you receive source code or else can get it if you +want it, that you can change NetHack or use pieces of it in new free +programs, and that you know you can do these things. + + To make sure that everyone has such rights, we have to forbid you to +deprive anyone else of these rights. For example, if you distribute copies +of NetHack, you must give the recipients all the rights that you have. You +must make sure that they, too, receive or can get the source code. And you +must tell them their rights. + + Also, for our own protection, we must make certain that everyone finds out +that there is no warranty for NetHack. If NetHack is modified by someone +else and passed on, we want its recipients to know that what they have is +not what we distributed. + + Therefore we (Mike Stephenson and other holders of NetHack copyrights) make +the following terms which say what you must do to be allowed to distribute or +change NetHack. + + + COPYING POLICIES + + 1. You may copy and distribute verbatim copies of NetHack source code as +you receive it, in any medium, provided that you keep intact the notices on +all files that refer to copyrights, to this License Agreement, and to the +absence of any warranty; and give any other recipients of the NetHack +program a copy of this License Agreement along with the program. + + 2. You may modify your copy or copies of NetHack or any portion of it, and +copy and distribute such modifications under the terms of Paragraph 1 above +(including distributing this License Agreement), provided that you also do the +following: + + a) cause the modified files to carry prominent notices stating that you + changed the files and the date of any change; and + + b) cause the whole of any work that you distribute or publish, that in + whole or in part contains or is a derivative of NetHack or any part + thereof, to be licensed at no charge to all third parties on terms + identical to those contained in this License Agreement (except that you + may choose to grant more extensive warranty protection to some or all + third parties, at your option) + + c) You may charge a distribution fee for the physical act of + transferring a copy, and you may at your option offer warranty protection + in exchange for a fee. + + 3. You may copy and distribute NetHack (or a portion or derivative of it, +under Paragraph 2) in object code or executable form under the terms of +Paragraphs 1 and 2 above provided that you also do one of the following: + + a) accompany it with the complete machine-readable source code, which + must be distributed under the terms of Paragraphs 1 and 2 above; or, + + b) accompany it with full information as to how to obtain the complete + machine-readable source code from an appropriate archive site. (This + alternative is allowed only for noncommercial distribution.) + +For these purposes, complete source code means either the full source +distribution as originally released over Usenet or updated copies of the +files in this distribution used to create the object code or executable. + + 4. You may not copy, sublicense, distribute or transfer NetHack except as +expressly provided under this License Agreement. Any attempt otherwise to +copy, sublicense, distribute or transfer NetHack is void and your rights to +use the program under this License agreement shall be automatically +terminated. However, parties who have received computer software programs +from you with this License Agreement will not have their licenses terminated +so long as such parties remain in full compliance. + + +Stated plainly: You are permitted to modify NetHack, or otherwise use parts +of NetHack, provided that you comply with the conditions specified above; +in particular, your modified NetHack or program containing parts of NetHack +must remain freely available as provided in this License Agreement. In +other words, go ahead and share NetHack, but don't try to stop anyone else +from sharing it farther. + +The lisp-window patch used to build this package comes +with the following license: + +Copyright (c) Shawn Betts, Ryan Yeske, 2001 + +Redistribution and use in source and binary forms, with or without modification, are permitted +provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials provided + with the distribution. + 3. The name of the author may not be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --- nethack-3.4.3.orig/debian/nethack-common.manpages +++ nethack-3.4.3/debian/nethack-common.manpages @@ -0,0 +1,5 @@ +doc/nethack.6 +doc/recover.6 +doc/lev_comp.6 +doc/dgn_comp.6 +doc/dlb.6 --- nethack-3.4.3.orig/debian/nethack-common.templates +++ nethack-3.4.3/debian/nethack-common.templates @@ -0,0 +1,34 @@ +Template: nethack-common/backup-incompatible +Type: select +_Choices: abort, backup, purge, ignore +Default: backup +_Description: Should NetHack back up your old, incompatible save files? + You are upgrading from a version of NetHack whose save files are not + compatible with the version you are upgrading to. You may either have them + backed up into /tmp, purge them, ignore this problem completely, or abort + this installation and manually handle NetHack's save files. Your score files + will be lost if you choose to purge. + . + If you choose to back up, the files will be backed up into a + gzip-compressed tar archive in /tmp with a random name starting + with 'nethk' and ending in '.tar.gz'. + . + Old NetHack save files can be found in /var/games/nethack (or + /var/lib/games/nethack, for versions before 3.4.0). + +Template: nethack-common/recover-setgid +Type: boolean +Default: false +_Description: Would you like NetHack's recover utility to be setgid games? + The 'recover' program is installed as part of the nethack-common package + and exists to help the administrator recover broken save files, etc. + . + Recover is traditionally installed setgid games, although it does not + need to be in the Debian NetHack installation, as it is automatically + run at boot time as root. Its only usefulness as a setgid binary is + to let players as normal users on the system recover their save + files, should NetHack crash or their connection drop mid-game. + . + If you answer no, you will have to run recover as root or as someone + in group games to recover save files after a crash or a connection + drop. --- nethack-3.4.3.orig/debian/overrides/lintian/nethack-qt +++ nethack-3.4.3/debian/overrides/lintian/nethack-qt @@ -0,0 +1,3 @@ +nethack-qt: non-standard-executable-perm usr/lib/games/nethack/nethack-qt.sh 0755 != 2755 +nethack-qt: non-standard-executable-perm usr/lib/games/nethack/nethack-qt-tty.sh 0755 != 2755 +nethack-qt: menu-icon-missing /usr/share/pixmaps/nethack.xpm --- nethack-3.4.3.orig/debian/overrides/lintian/nethack-gnome +++ nethack-3.4.3/debian/overrides/lintian/nethack-gnome @@ -0,0 +1,3 @@ +nethack-gnome: non-standard-executable-perm usr/lib/games/nethack/nethack-gnome.sh 0755 != 2755 +nethack-gnome: non-standard-executable-perm usr/lib/games/nethack/nethack-gnome-tty.sh 0755 != 2755 +nethack-gnome: menu-icon-missing /usr/share/pixmaps/nethack.xpm --- nethack-3.4.3.orig/debian/overrides/lintian/nethack-lisp +++ nethack-3.4.3/debian/overrides/lintian/nethack-lisp @@ -0,0 +1,2 @@ +nethack-lisp: non-standard-executable-perm usr/lib/games/nethack/nethack-lisp.sh 0755 != 2755 +nethack-gnome: non-standard-executable-perm usr/lib/games/nethack/nethack-gnome.sh 0755 != 2755 --- nethack-3.4.3.orig/debian/overrides/lintian/nethack-common +++ nethack-3.4.3/debian/overrides/lintian/nethack-common @@ -0,0 +1,8 @@ +nethack-common: non-standard-executable-perm usr/lib/games/nethack/recover 0755 != 2755 +nethack-common: non-standard-executable-perm usr/lib/games/nethack/dgn_comp 0755 != 2755 +nethack-common: non-standard-executable-perm usr/lib/games/nethack/lev_comp 0755 != 2755 +nethack-common: non-standard-executable-perm usr/lib/games/nethack/dlb 0755 != 2755 +nethack-common: non-standard-dir-perm var/games/nethack/ 0775 != 0755 +nethack-common: non-standard-dir-perm var/games/nethack/save/ 0775 != 0755 +nethack-common: non-standard-dir-perm var/games/nethack/dumps/ 0775 != 0755 +nethack-common: menu-command-not-in-package /usr/lib/menu/nethack-common:6 /usr/games/nethack --- nethack-3.4.3.orig/debian/overrides/lintian/nethack-x11 +++ nethack-3.4.3/debian/overrides/lintian/nethack-x11 @@ -0,0 +1,3 @@ +nethack-x11: non-standard-executable-perm usr/lib/games/nethack/nethack-x11.sh 0755 != 2755 +nethack-x11: non-standard-executable-perm usr/lib/games/nethack/nethack-x11-tty.sh 0755 != 2755 +nethack-x11: menu-icon-missing /usr/share/pixmaps/nethack.xpm --- nethack-3.4.3.orig/debian/overrides/lintian/nethack-console +++ nethack-3.4.3/debian/overrides/lintian/nethack-console @@ -0,0 +1,3 @@ +nethack-console: non-standard-executable-perm usr/lib/games/nethack/nethack-console.sh 0755 != 2755 +nethack-console: non-standard-executable-perm usr/lib/games/nethack/nethack-console 0755 != 2755 +nethack-console: menu-icon-missing /usr/share/pixmaps/nethack.xpm --- nethack-3.4.3.orig/debian/nethack-gnome.postinst +++ nethack-3.4.3/debian/nethack-gnome.postinst @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +update-alternatives --install /usr/games/nethack nethack \ + /usr/lib/games/nethack/nethack-gnome-tty.sh 60 + +update-alternatives --install /usr/games/nethack nethack \ + /usr/lib/games/nethack/nethack-gnome.sh 50 + +#DEBHELPER# --- nethack-3.4.3.orig/debian/nethack-qt.menu +++ nethack-3.4.3/debian/nethack-qt.menu @@ -0,0 +1,6 @@ +?package(nethack-qt):needs="x11" \ + command="/usr/games/nethack-qt" \ + hints="Roguelike,Maze,Dungeon" \ + section="Games/Adventure" \ + title="Qt NetHack" \ + icon="/usr/share/pixmaps/nethack.xpm" --- nethack-3.4.3.orig/debian/nethack-common.dirs +++ nethack-3.4.3/debian/nethack-common.dirs @@ -0,0 +1,7 @@ +usr/share/pixmaps/nethack +usr/lib/games/nethack +var/games/nethack/save +var/games/nethack/dumps +etc/init.d +usr/share/doc/nethack-common +etc/nethack --- nethack-3.4.3.orig/debian/nethack-x11.postinst +++ nethack-3.4.3/debian/nethack-x11.postinst @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +update-alternatives --install /usr/games/nethack nethack \ + /usr/lib/games/nethack/nethack-x11-tty.sh 60 + +update-alternatives --install /usr/games/nethack nethack \ + /usr/lib/games/nethack/nethack-x11.sh 50 + +#DEBHELPER# --- nethack-3.4.3.orig/debian/nethack-common.config +++ nethack-3.4.3/debian/nethack-common.config @@ -0,0 +1,33 @@ +#!/bin/sh + +set -e + +. /usr/share/debconf/confmodule + +LOGDIR=/var/games/nethack +OLDLOGDIR=/var/lib/games/nethack + +# Use lt-nl test here, because an empty $2 means a new install. +# lt-nl means empty is always greater than any other version, +# so the first part of this test will not return true on a new install. +if dpkg --compare-versions "$2" lt-nl 3.4.0 || \ + [ -d $OLDLOGDIR -a -n "`ls $OLDLOGDIR/save 2>/dev/null || true`" ]; then + + # Save games are not to be treated lightly! + db_input high nethack-common/backup-incompatible || true + db_go + + db_get nethack-common/backup-incompatible + + if [ "$RET" = abort ]; then + db_stop + exit 1 + fi +fi + +db_input low nethack-common/recover-setgid || true +db_go + +db_stop + +exit 0 --- nethack-3.4.3.orig/debian/lisp/nethackrc +++ nethack-3.4.3/debian/lisp/nethackrc @@ -0,0 +1,19 @@ +# +# System-wide NetHack configuration file for lisp-window NetHack. +# + +OPTIONS=windowtype:lisp,toptenwin,hilite_pet,!number_pad +OPTIONS=fixinv,safe_pet,sortpack,tombstone,color +OPTIONS=verbose,news,fruit:potato +OPTIONS=dogname:Slinky +OPTIONS=catname:Rex +OPTIONS=pickup_types:$ +OPTIONS=nomail + +# Enable this if you want to see your inventory sorted in alphabetical +# order by item instead of by index letter: +# OPTIONS=sortloot:full +# or if you just want containers sorted: +# OPTIONS=sortloot:loot + + --- nethack-3.4.3.orig/debian/lisp/nethack.sh +++ nethack-3.4.3/debian/lisp/nethack.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +set -e + +HACKSTYLE=lisp + +if [ -z "$NETHACKOPTIONS" ]; then + if [ -e $HOME/.nethackrc ]; then + NETHACKOPTIONS=$HOME/.nethackrc + export NETHACKOPTIONS + elif [ -e $HOME/.nethackrc.$HACKSTYLE ]; then + NETHACKOPTIONS=$HOME/.nethackrc.$HACKSTYLE + export NETHACKOPTIONS + else + NETHACKOPTIONS=/etc/nethack/nethackrc.$HACKSTYLE + export NETHACKOPTIONS + fi +fi + +HACKDIR=/usr/lib/games/nethack +export HACKDIR +HACK=$HACKDIR/nethack-$HACKSTYLE + +cd $HACKDIR +exec $HACK "$@" --- nethack-3.4.3.orig/debian/nethack-qt.links +++ nethack-3.4.3/debian/nethack-qt.links @@ -0,0 +1,2 @@ +usr/lib/games/nethack/nethack-qt.sh usr/games/nethack-qt +usr/share/man/man6/nethack.6.gz usr/share/man/man6/nethack-qt.6.gz --- nethack-3.4.3.orig/debian/po/templates.pot +++ nethack-3.4.3/debian/po/templates.pot @@ -0,0 +1,98 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2004-05-22 23:04-0700\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: select +#. Choices +#: ../nethack-common.templates:3 +msgid "abort, backup, purge, ignore" +msgstr "" + +#. Type: select +#. Description +#: ../nethack-common.templates:5 +msgid "Should NetHack back up your old, incompatible save files?" +msgstr "" + +#. Type: select +#. Description +#: ../nethack-common.templates:5 +msgid "" +"You are upgrading from a version of NetHack whose save files are not " +"compatible with the version you are upgrading to. You may either have them " +"backed up into /tmp, purge them, ignore this problem completely, or abort " +"this installation and manually handle NetHack's save files. Your score files " +"will be lost if you choose to purge." +msgstr "" + +#. Type: select +#. Description +#: ../nethack-common.templates:5 +msgid "" +"If you choose to back up, the files will be backed up into a gzip-compressed " +"tar archive in /tmp with a random name starting with 'nethk' and ending in '." +"tar.gz'." +msgstr "" + +#. Type: select +#. Description +#: ../nethack-common.templates:5 +msgid "" +"Old NetHack save files can be found in /var/games/nethack (or /var/lib/games/" +"nethack, for versions before 3.4.0)." +msgstr "" + +#. Type: boolean +#. Description +#: ../nethack-common.templates:22 +msgid "Would you like NetHack's recover utility to be setgid games?" +msgstr "" + +#. Type: boolean +#. Description +#: ../nethack-common.templates:22 +msgid "" +"The 'recover' program is installed as part of the nethack-common package and " +"exists to help the administrator recover broken save files, etc." +msgstr "" + +#. Type: boolean +#. Description +#: ../nethack-common.templates:22 +msgid "" +"Recover is traditionally installed setgid games, although it does not need " +"to be in the Debian NetHack installation, as it is automatically run at boot " +"time as root. Its only usefulness as a setgid binary is to let players as " +"normal users on the system recover their save files, should NetHack crash or " +"their connection drop mid-game." +msgstr "" + +#. Type: boolean +#. Description +#: ../nethack-common.templates:22 +msgid "" +"If you answer no, you will have to run recover as root or as someone in " +"group games to recover save files after a crash or a connection drop." +msgstr "" --- nethack-3.4.3.orig/debian/po/ca.po +++ nethack-3.4.3/debian/po/ca.po @@ -0,0 +1,112 @@ +# nethack (debconf) translation to Catalan. +# Copyright (C) 2004 Free Software Foundation, Inc. +# Aleix Badia i Bosch , 2004 +msgid "" +msgstr "" +"Project-Id-Version: nethack_3.4.3-3_templates\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2004-05-22 23:04-0700\n" +"PO-Revision-Date: 2004-04-04 19:46GMT\n" +"Last-Translator: Aleix Badia i Bosch \n" +"Language-Team: Catalan \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: select +#. Choices +#: ../nethack-common.templates:3 +msgid "abort, backup, purge, ignore" +msgstr "abort, backup, purge, ignore" + +#. Type: select +#. Description +#: ../nethack-common.templates:5 +msgid "Should NetHack back up your old, incompatible save files?" +msgstr "" +"Voleu que el NetHack faci una còpia de seguretat dels fitxers " +"d'emmagatzematge antics i incompatibles?" + +#. Type: select +#. Description +#: ../nethack-common.templates:5 +msgid "" +"You are upgrading from a version of NetHack whose save files are not " +"compatible with the version you are upgrading to. You may either have them " +"backed up into /tmp, purge them, ignore this problem completely, or abort " +"this installation and manually handle NetHack's save files. Your score files " +"will be lost if you choose to purge." +msgstr "" +"Els fitxers d'emmagatzematge de la versió del Nethack que esteu actualitzant " +"no són compatibles amb la nova versió. Podeu fer-ne una còpia de seguretat " +"al directori /tmp, purgar-los, ignorar el problema o aturar la instal·lació " +"i gestionar-los manualment. Si escolliu l'opció de purgar-los es perdran " +"tots els fitxers de puntuació. " + +#. Type: select +#. Description +#: ../nethack-common.templates:5 +msgid "" +"If you choose to back up, the files will be backed up into a gzip-compressed " +"tar archive in /tmp with a random name starting with 'nethk' and ending in '." +"tar.gz'." +msgstr "" +"Si escolliu fer-ne una còpia de seguretat, els fitxers es copiaran a un " +"fitxer tar comprimit amb gzip. El fitxer es crearà al directori /tmp amb un " +"nom aleatori que començarà per 'nethk' i acabarà per '.tar.gz'." + +#. Type: select +#. Description +#: ../nethack-common.templates:5 +msgid "" +"Old NetHack save files can be found in /var/games/nethack (or /var/lib/games/" +"nethack, for versions before 3.4.0)." +msgstr "" +"Podeu trobar els fitxers antics d'emmagatzematge del Nethack al directori /" +"var/games/nethack (o a /var/lib/games/nethack en el cas de les versions " +"anteriors a la 3.4.0)." + +#. Type: boolean +#. Description +#: ../nethack-common.templates:22 +msgid "Would you like NetHack's recover utility to be setgid games?" +msgstr "Voleu que l'eina de recuperació del NetHack sigui setgid games?" + +#. Type: boolean +#. Description +#: ../nethack-common.templates:22 +msgid "" +"The 'recover' program is installed as part of the nethack-common package and " +"exists to help the administrator recover broken save files, etc." +msgstr "" +"El programa 'recover' s'instal·la com una part més del paquet nethack-" +"common. La seva funció és ajudar a l'administrador a recuperar fitxers " +"desats amb errors, etc." + +#. Type: boolean +#. Description +#: ../nethack-common.templates:22 +msgid "" +"Recover is traditionally installed setgid games, although it does not need " +"to be in the Debian NetHack installation, as it is automatically run at boot " +"time as root. Its only usefulness as a setgid binary is to let players as " +"normal users on the system recover their save files, should NetHack crash or " +"their connection drop mid-game." +msgstr "" +"El programa recover acostuma a instal·lar-se setgid games, tot i això, no " +"necessita estar en la instal·lació del Nethack de Debian ja que s'executa " +"automàticament com a superadministrador a l'arrencada. Ser setgid binari " +"només és útil al permetre als jugadors com els usuaris normals del sistema, " +"recuperar els fitxers emmagatzemats després d'un error del Nethack o la " +"desconnexió." + +#. Type: boolean +#. Description +#: ../nethack-common.templates:22 +msgid "" +"If you answer no, you will have to run recover as root or as someone in " +"group games to recover save files after a crash or a connection drop." +msgstr "" +"Si contesteu que no, per poder recuperar els fitxers desats després de " +"produir-se un error o una desconnexió, haureu d'executar el recover com a " +"superadministrador o qualsevol altre usuari del grup games. " --- nethack-3.4.3.orig/debian/po/fr.po +++ nethack-3.4.3/debian/po/fr.po @@ -0,0 +1,123 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +msgid "" +msgstr "" +"Project-Id-Version: nethack 3.4.2-2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2004-05-22 23:04-0700\n" +"PO-Revision-Date: 2003-11-03 22:46+0100\n" +"Last-Translator: Nicolas Bertolissio \n" +"Language-Team: French \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-15\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: select +#. Choices +#: ../nethack-common.templates:3 +msgid "abort, backup, purge, ignore" +msgstr "Abandonner, Garder, Effacer, Ignorer" + +#. Type: select +#. Description +#: ../nethack-common.templates:5 +msgid "Should NetHack back up your old, incompatible save files?" +msgstr "" +"Faut-il conserver vos anciennes sauvegardes (incompatibles) de NetHack ?" + +#. Type: select +#. Description +#: ../nethack-common.templates:5 +msgid "" +"You are upgrading from a version of NetHack whose save files are not " +"compatible with the version you are upgrading to. You may either have them " +"backed up into /tmp, purge them, ignore this problem completely, or abort " +"this installation and manually handle NetHack's save files. Your score files " +"will be lost if you choose to purge." +msgstr "" +"La nouvelle version de NetHack utilise des fichiers de sauvegarde qui ne " +"sont pas compatibles avec l'ancienne version. Vous pouvez garder " +"(provisoirement) les anciens dans /tmp, les effacer, ignorer totalement ce " +"problème ou abandonner cette installation et gérer manuellement les fichiers " +"de sauvegarde de NetHack. Vos fichiers de scores seront perdus si vous " +"choisissez « Effacer »." + +#. Type: select +#. Description +#: ../nethack-common.templates:5 +msgid "" +"If you choose to back up, the files will be backed up into a gzip-compressed " +"tar archive in /tmp with a random name starting with 'nethk' and ending in '." +"tar.gz'." +msgstr "" +"Si vous choisissez de les garder, les fichiers seront placés dans une " +"archive tar compressée avec gzip dans /tmp avec un nom aléatoire commençant " +"par « nethk » et se terminant en « .tar.gz »." + +#. Type: select +#. Description +#: ../nethack-common.templates:5 +msgid "" +"Old NetHack save files can be found in /var/games/nethack (or /var/lib/games/" +"nethack, for versions before 3.4.0)." +msgstr "" +"Les anciens fichiers de sauvegarde de NetHack se trouvent dans /var/games/" +"nethack (ou /var/lib/games/nethack, pour les versions antérieures à " +"la 3.4.0)." + +#. Type: boolean +#. Description +#: ../nethack-common.templates:22 +msgid "Would you like NetHack's recover utility to be setgid games?" +msgstr "Souhaitez-vous que l'outil de récupération soit « setgid games » ?" + +#. Type: boolean +#. Description +#: ../nethack-common.templates:22 +msgid "" +"The 'recover' program is installed as part of the nethack-common package and " +"exists to help the administrator recover broken save files, etc." +msgstr "" +"Le programme « recover » du paquet nethack-common est installé et sert à " +"aider l'administrateur à récupérer des fichiers de sauvegarde endommagés, " +"etc." + +#. Type: boolean +#. Description +#: ../nethack-common.templates:22 +msgid "" +"Recover is traditionally installed setgid games, although it does not need " +"to be in the Debian NetHack installation, as it is automatically run at boot " +"time as root. Its only usefulness as a setgid binary is to let players as " +"normal users on the system recover their save files, should NetHack crash or " +"their connection drop mid-game." +msgstr "" +"Recover est habituellement installé pour s'exécuter avec les droits du " +"groupe « games » (« setgid games »), bien que cela ne soit pas nécessaire " +"dans l'installation de NetHack de Debian, car il est lancé automatiquement " +"au démarrage avec les droits du super-utilisateur. Cela permet toutefois aux " +"joueurs de récupérer leurs fichiers de sauvegarde en tant qu'utilisateurs " +"non privilégiés sur le système si NetHack s'arrête inopinément ou que leur " +"connexion se coupe au milieu du jeu." + +#. Type: boolean +#. Description +#: ../nethack-common.templates:22 +msgid "" +"If you answer no, you will have to run recover as root or as someone in " +"group games to recover save files after a crash or a connection drop." +msgstr "" +"Si vous refusez, vous devrez utiliser recover en tant que super-utilisateur " +"ou qu'utilisateur du groupe games pour récupérer des fichiers de sauvegarde " +"après un plantage ou une coupure de connexion." --- nethack-3.4.3.orig/debian/po/POTFILES.in +++ nethack-3.4.3/debian/po/POTFILES.in @@ -0,0 +1 @@ +[type: gettext/rfc822deb] nethack-common.templates --- nethack-3.4.3.orig/debian/po/cs.po +++ nethack-3.4.3/debian/po/cs.po @@ -0,0 +1,119 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +msgid "" +msgstr "" +"Project-Id-Version: nethack\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2004-05-22 23:04-0700\n" +"PO-Revision-Date: 2004-07-26 13:51+0200\n" +"Last-Translator: Jan Outrata \n" +"Language-Team: Czech \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: select +#. Choices +#: ../nethack-common.templates:3 +msgid "abort, backup, purge, ignore" +msgstr "zru¹it, zálohovat, smazat, ignorovat" + +#. Type: select +#. Description +#: ../nethack-common.templates:5 +msgid "Should NetHack back up your old, incompatible save files?" +msgstr "Má NetHack zálohovat va¹e staré, nekompatibilní ukládací soubory?" + +#. Type: select +#. Description +#: ../nethack-common.templates:5 +msgid "" +"You are upgrading from a version of NetHack whose save files are not " +"compatible with the version you are upgrading to. You may either have them " +"backed up into /tmp, purge them, ignore this problem completely, or abort " +"this installation and manually handle NetHack's save files. Your score files " +"will be lost if you choose to purge." +msgstr "" +"Aktualizujete z verze NetHack, její¾ ukládací soubory nejsou kompatibilní s " +"verzí, na kterou aktualizujete. Mù¾ete je buï zálohovat do /tmp, smazat, " +"zcela tento problém ignorovat, nebo tuto instalaci zru¹it a nakládat s " +"ukládacími soubory hry NetHack manuálnì. Va¹e soubory s výsledky budou " +"ztraceny, pokud zvolíte smazání." + +#. Type: select +#. Description +#: ../nethack-common.templates:5 +msgid "" +"If you choose to back up, the files will be backed up into a gzip-compressed " +"tar archive in /tmp with a random name starting with 'nethk' and ending in '." +"tar.gz'." +msgstr "" +"Pokud zvolíte zálohovat, soubory budou zálohovány do archivu programu tar " +"komprimovaném programem gzip v /tmp s náhodným jménem zaèínajícím na 'nethk' " +"a konèícím s '.tar.gz'." + +#. Type: select +#. Description +#: ../nethack-common.templates:5 +msgid "" +"Old NetHack save files can be found in /var/games/nethack (or /var/lib/games/" +"nethack, for versions before 3.4.0)." +msgstr "" +"Staré ukládací soubory hry NetHack lze nalézt v /var/games/nethack (nebo /" +"var/lib/games/nethack, pro verze pøed 3.4.0)." + +#. Type: boolean +#. Description +#: ../nethack-common.templates:22 +msgid "Would you like NetHack's recover utility to be setgid games?" +msgstr "" +"Chcete nastavit SGID bit pro skupinu games u nástroje recover hry NetHack?" + +#. Type: boolean +#. Description +#: ../nethack-common.templates:22 +msgid "" +"The 'recover' program is installed as part of the nethack-common package and " +"exists to help the administrator recover broken save files, etc." +msgstr "" +"Program 'recover' je instalován jako souèást balíèku nethack-common a pomáhá " +"správci obnovit po¹kozené ukládací soubory, atd." + +#. Type: boolean +#. Description +#: ../nethack-common.templates:22 +msgid "" +"Recover is traditionally installed setgid games, although it does not need " +"to be in the Debian NetHack installation, as it is automatically run at boot " +"time as root. Its only usefulness as a setgid binary is to let players as " +"normal users on the system recover their save files, should NetHack crash or " +"their connection drop mid-game." +msgstr "" +"Recover je tradiènì instalován s nastaveným SGID bitem pro skupinu games, i " +"kdy¾ u Debianní instalace hry NetHack nemusí být, proto¾e je automaticky " +"spou¹tìn pøi startu systému pod u¾ivatelem root. S nastaveným SGID bitem je " +"u¾iteèný jenom pro umo¾nìní hráèùm jako obyèejným u¾ivatelùm systému obnovit " +"si jejich ukládací soubory, kdy¾ NetHack spadne nebo se pøeru¹í spojení " +"uprostøed hry." + +#. Type: boolean +#. Description +#: ../nethack-common.templates:22 +msgid "" +"If you answer no, you will have to run recover as root or as someone in " +"group games to recover save files after a crash or a connection drop." +msgstr "" +"Pokud odpovíte ne, budete muset pro obnovu ukládacích souborù po pádu nebo " +"pøeru¹ení spojení spustit recover pod u¾ivatelem root nebo nìkým ve skupinì " +"games." --- nethack-3.4.3.orig/debian/nethack.xpm +++ nethack-3.4.3/debian/nethack.xpm @@ -0,0 +1,56 @@ +/* XPM */ +static char *nethack[] = { +/* columns rows colors chars-per-pixel */ +"32 32 18 1", +" c black", +". c #191919", +"X c gray20", +"o c #007f00", +"O c #007f7f", +"+ c #7f7f00", +"@ c #4c4c4c", +"# c #666667", +"$ c gray50", +"% c blue", +"& c cyan", +"* c yellow", +"= c gray60", +"- c #b2b2b2", +"; c gray80", +": c gray90", +"> c white", +", c None", +/* pixels */ +",,,, , , , . , , ., ,,,,,", +",,,,, , , . , ,, , ,, , ,,,,,", +" , ,#X, , =$=$$=$., ,.#, , ,", +", , .,-: ,$:>>>>:::;=,,=-,. , ,,", +" ,.X ,=>-#>>::::;;*::$+:-, .X, ,", +" ,=>#.=>>>>>>:>:;;;;;;;;=.@;-, ,", +".,=>>$=::>>:>>::;::;;;;;=+::-, ,", +" ,O-$@->=-=-=$-=+=$#+=$;- .## .,", +" ,#-#O;>--===-OOO$####@;- .## ,", +" ,=>>-->=====O-$$O#OOO#;=@::- ,", +" ,=>-$;>==-=-===#######;-.@;; .,", +" ,.X =>-====$==$Oo#O#o--. .. ,", +", , . =>====$$-O#$O###O;- , ", +" , , =>-==-=OO$O$O##O@;- , ,", +", , .,=>======O$O#####@;-.. , , ", +",, , ,=>--====-O$##OO#@;- , ,,", +",,,, ,$>-====$$=#$O#O##-=.. , ,,", +",,,,, ,::====$=OO$O##@-: , ,,,", +",,, , ,@:--==$=$#####$;# , ,,", +",, , :;--O=O=O#O#o=:. , , ,", +", , .,->->-OO==O$$#@$:X--. , ,", +" =>>O::==--=$OO$:@ -:-. , ", +", ,,->;-;$;:$O$$##$:XX$=-:-. , ,", +" ,->:O$>= ::O=#O=:@ #:=$$:-., ", +" ,=>=-$O;+..;>>;;:@ @:$#$o:- , ", +".,=>$OO$:=. .;>:;@ . @:+O=#-;. ,", +" ,=>;;-:;. X#@+ .-----;@ ,", +" ,.;>>:;X , , , , .,$:;:;; , ", +", ,.;;--. , ,=---X , ,", +" , , ,,, , , ,,,,,,,,,,, , , ", +", , , ,,,,,, , . , ,", +",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," +}; --- nethack-3.4.3.orig/debian/nethack-gnome.dirs +++ nethack-3.4.3/debian/nethack-gnome.dirs @@ -0,0 +1,5 @@ +etc/nethack +usr/games +usr/lib/games/nethack +usr/share/man/man6 +usr/share/pixmaps/nethack --- nethack-3.4.3.orig/debian/nethack-console.menu +++ nethack-3.4.3/debian/nethack-console.menu @@ -0,0 +1,6 @@ +?package(nethack-console):needs="text" \ + command="/usr/games/nethack-console" \ + hints="Roguelike,Maze,Dungeon" \ + section="Games/Adventure" \ + title="NetHack (No GUI)" \ + icon="/usr/share/pixmaps/nethack.xpm" --- nethack-3.4.3.orig/debian/nethack-qt.postinst +++ nethack-3.4.3/debian/nethack-qt.postinst @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +update-alternatives --install /usr/games/nethack nethack \ + /usr/lib/games/nethack/nethack-qt-tty.sh 60 + +update-alternatives --install /usr/games/nethack nethack \ + /usr/lib/games/nethack/nethack-qt.sh 50 + +#DEBHELPER# --- nethack-3.4.3.orig/debian/recover-helper +++ nethack-3.4.3/debian/recover-helper @@ -0,0 +1,16 @@ +#!/bin/sh + +set -e + +cd /var/games/nethack || exit 1 + +for file in *.0; do + # We only try to recover our own files, and ignore the others. + if [ -f "$file" ] && [ ! -L "$file" ] && [ -O "$file" ]; then + /usr/lib/games/nethack/recover "/var/games/nethack/$file" + fi +done + +exit 0 + + --- nethack-3.4.3.orig/debian/nethack-lisp.dirs +++ nethack-3.4.3/debian/nethack-lisp.dirs @@ -0,0 +1,4 @@ +etc/nethack +usr/games +usr/lib/games/nethack +usr/share/man/man6 --- nethack-3.4.3.orig/debian/README.patches +++ nethack-3.4.3/debian/README.patches @@ -0,0 +1,24 @@ +Patches included in the Debian package of NetHack +================================================= + +90_enh_hpmon - by Ralph Churchill + Enables color HP monitor for textmode NetHack. + URL: http://www.netsonic.fi/~walker/nh/hpmon.diff + +91_enh_menucolors - by Pasi Kallinen + Pasi Kallinen's patch to add customizable colors to inventory items. + URL: http://www.cs.joensuu.fi/~pkalli/code/nh343-menucolor.diff + +92_enh_paranoid_hit - mostly by me: Joshua Kwan + Option to change logistics for hitting peacefuls, where you have to type + 'yes' instead of 'y' to confirm the hit. Old logic made it easy to hold + down 'y' because you were going up and left, and accidentally hit someone. + +93_enh_dump - by Tom Friedetzky, Jukka Lahtinen, Darshan Shaligram + Saves a snapshot of your inventory, skills, enlightenment, death conditions + into a file when you die, as a text file. + URL: http://www.netsonic.fi/~walker/nh/dump-343.diff + +94_enh_sortloot - by Jeroen Demeyer and Jukka Lahtinen + Sort item lists (container readouts, etc.) alphabetically. + URL: http://www.netsonic.fi/~walker/nh/sortloot-343.diff --- nethack-3.4.3.orig/debian/compat +++ nethack-3.4.3/debian/compat @@ -0,0 +1 @@ +4 --- nethack-3.4.3.orig/debian/nethack-qt.prerm +++ nethack-3.4.3/debian/nethack-qt.prerm @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +update-alternatives --remove nethack /usr/lib/games/nethack/nethack-qt.sh +update-alternatives --remove nethack /usr/lib/games/nethack/nethack-qt-tty.sh + +#DEBHELPER# --- nethack-3.4.3.orig/debian/nethack-x11.dirs +++ nethack-3.4.3/debian/nethack-x11.dirs @@ -0,0 +1,6 @@ +etc/X11/app-defaults +usr/X11R6/lib/X11/fonts/misc +etc/nethack +usr/games +usr/lib/games/nethack +usr/share/man/man6 --- nethack-3.4.3.orig/debian/nethack-common.postrm +++ nethack-3.4.3/debian/nethack-common.postrm @@ -0,0 +1,25 @@ +#!/bin/sh + +# Nethack post-remove script for Debian +# +# Ben Gertzfield (che@debian.org) 29 July 1997 +# Copyright 1997 Ben Gertzfield. This script is released under the +# GNU General Public License, version 2 or later. + +# Updated 13 October 2003 to move the debhelper above the save-files +# purge (seems to be reading from stdin, seeing the "Purging" echo +# as a command) + +# Updated 18 August 1998 to rm -rf the score/save directory on a purge, +# added debhelper comments + +set -e + +#DEBHELPER# + +if [ "$1" = "purge" ]; then + echo -n "Purging high-scores and save-files for Nethack... " + rm -rf /var/games/nethack/ + echo "done." +fi + --- nethack-3.4.3.orig/debian/changelog +++ nethack-3.4.3/debian/changelog @@ -0,0 +1,715 @@ +nethack (3.4.3-7ubuntu1) breezy; urgency=low + + * Rebuild for unmet deps + * Added bdftopcf to Build-Depends + * Corrected the bdftopcf path in debian/rules + + -- Sebastian Dröge Sat, 10 Sep 2005 17:17:50 +0200 + +nethack (3.4.3-7build1) breezy; urgency=low + + * Rebuild for new C++ ABI + + -- Matthias Klose Mon, 6 Jun 2005 16:30:32 +0000 + +nethack (3.4.3-7) unstable; urgency=low + + * Remove the nonfunctional watch file. Sigh. + * Add Czech translation of Debconf templates, thanks to Jan Outrata. + closes: #261795 + * Make sure recover-helper runs in /bin/sh, or things might go wrong. + closes: #293291 + * Patch work: + - 08_linux_specifics: Update from Robert Millan to fix FTBFS on + kfreebsd-gnu. closes: #290342 + + -- Joshua Kwan Thu, 17 Feb 2005 15:35:14 -0800 + +nethack (3.4.3-6) unstable; urgency=low + + * Patch work: + - all ENH patches: record source, authors, URL + - 94_enh_sortloot (new): add the sortloot patch. Not enabled by + default. + * Add a README.patches to note which patches are in Debian's Nethack + package. + * Correct date of old changelog entry - the upload really happened much + later than the entry. + * Add a watch file to benefit the DEHS project. + + -- Joshua Kwan Mon, 26 Jul 2004 20:15:57 -0700 + +nethack (3.4.3-5) unstable; urgency=low + + * Add Catalan translation (Closes: #248734) + * Patch work: + - 91_enh_menucolors: Fix Pasi Kallinen's email address. pk -> pkalli + - 19_gnome_ext_events (new): Fix a problem in Gnomehack where mouse click + events in the extended menu would not be handled (thus a certain + choice might be chosen, but a different one 'picked' by the code). + (Closes: #246265) + + -- Joshua Kwan Wed, 23 Jun 2004 11:32:05 -0700 + +nethack (3.4.3-4) unstable; urgency=low + + * Fix a call to 'su' in the init script that chokes zsh. + * Remove some old documentation relics (3.4.1 -> 3.4.3). + * Add NetHack.ad to nethack-x11's examples. + * nethack dummy package now depends on nethack-x11 | nethack-console | + nethack-gnome | nethack-lisp | nethack-qt. (Closes: #227192, #227405) + * Fix xlibs-dev dependency. + * 93_enh_dump.dpatch: Add the 'dump' patch that saves a log of interesting + data about your player when he/she ascends, dies, or escapes. Default + location will be in /var/games/nethack/dumps/${player}.lastgame.txt. + * Change debhelper dependency to debhelper (>= 4.1.16) as per + po-debconf(7). + * Change build-dependency on groff to just groff-base. + * Fix unquoted strings in .menu files, thanks lintian + * Change maintainer line to nethack-maint@triplehelix.org, pending the + resurrection of Alioth's lists. + + -- Joshua Kwan Sat, 13 Mar 2004 16:22:15 -0800 + +nethack (3.4.3-3) unstable; urgency=medium + + * Sigh, lost the nethack (arch all) package last upload. This should + fix all the testing-related breakage. + * Joshua Kwan : + - More build system cleanups. + - Remove x11/Makefile.src, missed last time. + - Remove old warnings and caveats in README.Debian that are obsoleted + with 18_overridewin.dpatch. (i.e., stick windowtype:tty into your + $NETHACKOPTIONS if you intend to set it) + - Applied a really great debian/rules simplification from + Aaron Lehmann + - 13_simple_mail.dpatch: allow our nethack patches to function + with dgamelaunch (not in the Debian archive -- yet). Does not + affect gameplay. + - Delete nh10.pcf.*, somehow during one build nh10.pcf.gz snuck in. + + -- Joshua Kwan Mon, 29 Dec 2003 11:16:22 -0800 + +nethack (3.4.3-2) unstable; urgency=medium + + * Joshua Kwan : + - Fix busted PIXMAPDIR that broke nethack-qt and nethack-gnome. + Was actually in CVS but not applied to the uploaded source. + - Lose t32-1024.xpm because it belongs to jnethack and doesn't work + with gnomehack. + - Clean up the build system by removing redundant Makefile.src's. + + 05_build_cflags.dpatch replaced by 05_makefile_logic.dpatch; + thanks Aaron Lehmann + + -- Joshua Kwan Sun, 21 Dec 2003 18:27:07 -0800 + +nethack (3.4.3-1) unstable; urgency=low + + * New upstream release. + - Merged patches: 03_char_signedness.dpatch, 07_explore_mode_save.dpatch, + 13_qt_warning_fixes.dpatch. + - Manually rediffed: 14_common_config.dpatch + - Fixed bugs: + + xnethack segfaults if you close the class selection window + (closes: #71234) + + Bustling Town level generation may cause weird store 'entering' + announcements and inaccessible stairs (closes: #216386) + * Joshua Kwan : + - Use perror() and change some wording in recover.c to make error + messages useful. (Closes: #72582) + - Set 'ignintr' in the GNOME default nethackrc to work around GNOME + library bug #216454. Will not close until the bug is resolved in a + non-hackish way. + - As per discussion on debian-devel, turn off number_pad by default + so as not to deviate from upstream. + - 16_pixmapdir.dpatch: move all pixmaps into /usr/share/pixmaps/nethack/ + and make all graphical nethacks work with this + - Keep logfile, record, and perm when backing up old save games, + because they are backwards-compatible with older versions. + (Closes: #141843) + - Remove the redundant 'Drop Many' entry from the GNOME Action menu. + (Closes: #154750) + - Use dpkg-statoverride(1) for storing recover setgid information if + enabled. + - Add French Debconf template translation by Nicolas Bertolissio + . (Closes: #218729) + - Document QT_FONTSIZE, QT_TILEWIDTH, QT_TILEHEIGHT in Qt nethackrc + (Closes: #141245) + - Remove the old /etc/init.d/nethack and its symlinks with a manual + call to update-rc.d on postinst, due to a sneaky name change that + crept in during 3.4.2 package work. (Closes: #223496) + - Fix a few warnings in patches. + - Make sure nethack-common and all the FE packages always have the + same version using ${Source-Version} dependencies both ways. + + -- Joshua Kwan Mon, 15 Dec 2003 21:49:50 -0800 + +nethack (3.4.2-2) unstable; urgency=low + + * Acknowledge a NMU we missed last time from Daniel Jacobwitz + , thanks! (Closes: #147166) + * Ben Gertzfield : + - Add symlink from /usr/lib/games/nethack/license to + /usr/share/doc/nethack-common/copyright. (Closes: #215673) + - Really include upstream source URL for LISP window system in + copyright file. + - Really include LISP windowing system patch from 0.9.2 upstream. + (Closes: #215899) + - Add 07_explore_mode_save.dpatch to use correct temporary + buffer in sys/unix/unixmain.c when munging save file in + explore mode. (Closes: #203229) + * Joshua Kwan : + - Add 92_enh_paranoid_hit.dpatch to force user to say 'yes' when + asked to hit a peaceful monster; disabled by default, in-game + option. (Closes: #62361) + + -- Joshua Kwan Wed, 15 Oct 2003 09:03:15 -0700 + +nethack (3.4.2-1) unstable; urgency=low + + * NetHack is now comaintained by Ben Gertzfield and Joshua Kwan. + * New upstream version (closes: #208817) + - You can no longer eat while sleeping, possibly fixed in this version, + which closes: #184855 + * Acknowledge NMUs/patches, thanks all around to: + - Mario Lang (Closes: #186609, #187167) + - Brian Nelson (Closes: #184173, #180215) + * Ben Gertzfield : + - Merge LISP window system patch into dpatch patches. + - Merge LISP window system copyright into main copyright file. + - Add upstream source URL for LISP window system to copyright file. + - Update 12_lisp_windowing.dpatch to upstream nethack_el-0.9.2.tar.gz. + - Add Joshua Kwan to uploaders list for co-maintainership. + * Joshua Kwan : + - Fix FTBFS caused by 'Invisible' being a youprop.h #define + and used in a QListViewIterator enumerated type. (Closes: #213874) + - Fix char signedness issue in gnbind.c (Closes: #170531) + - Build nethack dummy package in binary-indep target. (Closes: #186619) + - Steal t32-1024.xpm from jnethack - it's missing from NetHack upstream. + This allows nethack-gnome to use the larger tileset. (Closes: #140398) + - Now using dh_installinit; use defaults, so we don't go to + /etc/rcS.d and start before NIS. (Closes: #164132) + - No clue how this is meant to help, but it doesn't break anything, + so let's wrap all our menu stuff in sh -c '' and see what happens. + (Closes: #168385, #168386, #152232) + - Allow the administrator to decide whether recover should be setgid + games. (Closes: #148983) + - Add a menu item to GNOME menu for readying/quivering. (Closes: #154627) + - Also fix many qt_win.{cpp,h} warnings. + - Bump Standards-Version to 3.6.1.0: + o Use our own CFLAGS, this allows us to use DEB_BUILD_OPTIONS=noopt + o Use /var/mail instead of /var/spool/mail (although both worked as + the two are still symlinked to each other) + o Question about old savegame backup becomes a debconf question, + and moved meat of the logic into postinst + - Use debian/compat instead of DH_COMPAT, bump it to V4. + - Use 'ln -sf' and 'gzip -f' so that multiple calls of binary-arch + work without cleaning. + - Fixed upstream URL to one that works + - Fix clean target so that pristine config.h is restored upon clean + - Removed redundant call to update-rc.d. + - Compress the nethack-common changelog.Debian. + - Migrate source modifications to dpatch patches and build-depend on + dpatch. + - Consolidate massive amounts of nearly duplicate config.hs into one + common configuration patch for include/config.h and add additional + -Ds to CFLAGS for each build. + - Add some enhancement patches (Save/bones are NOT affected): + + 90_enh_hpmon.dpatch: HP monitor which visually alerts you when + HP goes below 2/3, 1/3, and 1/10 of total. + + 91_enh_menucolors.dpatch: Enables you to specify regular + expressions to highlight in your inventory (for example, + cursed/uncursed/blessed items.) + + -- Ben Gertzfield Mon, 13 Oct 2003 17:22:01 -0700 + +nethack (3.4.1-1.2) unstable; urgency=low + + * NMU + * Apply patch to build nethack-lisp (required for nethack-el) + (Closes: Bug#186609) + + -- Mario Lang Tue, 1 Apr 2003 11:08:26 +0200 + +nethack (3.4.1-1.1) unstable; urgency=low + + * Non-maintainer upload. + * Fix build-dependencies so that package is buildable on unstable. + (Closes: #184173) + * Build against multi-threaded Qt3. (Closes: #180215) + * Include qmemarray.h instead of obsolete qarray.h so that a dependency + on libqt3-compat-headers is not needed. + + -- Brian Nelson Fri, 14 Mar 2003 22:25:03 -0800 + +nethack (3.4.1-1) unstable; urgency=low + + * New upstream version. (Closes: #182742) + * Upstream included patch to build Nethack on ia64. (Closes: #142079) + * Boulder -> Landmine segfault fixed upstream. (Closes: #144779) + * Change Build-Depends to depend on libxaw7-dev | libxaw-dev. + (Closes: #169995) + * Top ten list buffer overflow fixed upstream. (Closes: #181854) + * Mention .nethackrc.gnome, .nethackrc.x11, and .nethackrc.qt files + (custom to Debian) in nethack manpage. (Closes: #153738) + * Okay, okay, I made a nethack-console package that has no + dependancies on any X11 libs or other big packages. + (Closes: #140303, #142018) + * Move dependancy on xbase-clients to nethack-x11. It's the only + one that needs font making. + * Note: We define __USE_GNU in sys/unixres.c; looks like the + constant RTLD_NEXT is only defined if __USE_GNU is defined. + * Use Guidebook.txt for docs. For some reason, plain 'Guidebook' + is full of garbage now after 'make Guidebook'. + (Closes: #173127, #177252) + + -- Ben Gertzfield Sat, 1 Mar 2003 17:03:11 -0800 + +nethack (3.4.0-4) unstable; urgency=high + + * Install recover and recover-helper mode 644, not 664. (Closes: #167542) + + -- Ben Gertzfield Sun, 3 Nov 2002 22:45:27 -0800 + +nethack (3.4.0-3.1) unstable; urgency=high + + * NMU by the security team. + * Import security fixes from the slashem package (Closes: #147166). + + -- Daniel Jacobowitz Sat, 6 Jul 2002 17:01:05 -0400 + +nethack (3.4.0-3) unstable; urgency=low + + * Change DEFAULT_WINDOW_SYS to "tty" unconditionally for all + GUI frontends. This fixes the case where a user sets + NETHACKOPTIONS to customize just the dog/cat name or what have you, + but doesn't set a windowtype:tty flag. Then, the /usr/bin/nethack + script will not touch NETHACKOPTIONS, and it will give a strange + error when it starts up the Qt/Gnome version if X is unavailable. + (Closes: #142055) + * Patch unixconf.h to use /usr/bin/mail instead of /bin/mail. + (Closes: #142000) + * Fix nethackrc.qt -> .nethackrc.qt typo in README.Debian. + (Closes: #141244) + * Not defining SCORE_ON_BOTL for the time being -- it introduces + a save-game file incompatibility, so I will do that for the next + upstream release. + + -- Ben Gertzfield Wed, 10 Apr 2002 12:31:21 +0900 + +nethack (3.4.0-2) unstable; urgency=MEDIUM + + * Fix recover to use VAR_PLAYGROUND, not HACKDIR. (Closes: #140701) + * Fix menu entries. Now nethack-common has the /usr/games/nethack + entry (assumed to be text; if the user overrides it, they can + override the menu entry too), nethack-x11 has /usr/games/xnethack, + etc. etc. (Closes: #140704) + * Fix a security bug in recover; other users could "recover" + save games belonging to users besides themselves. However, + they could not load the generated save file unless they could + also change their UID, as the save file name is always ###playername, + where ### is the UID allowed to open saved game. + * Now, recover will only "recover" crash files belonging to the + same user (or any user, if run by root). Also, it chowns the + resultant save file to the original owner of the crash files. + (Closes: #104247) + * Add hints "Roguelike,Maze,Dungeon" to menu entries Just For Fun. + + -- Ben Gertzfield Tue, 2 Apr 2002 23:10:06 +0900 + +nethack (3.4.0-1) unstable; urgency=low + + * New upstream version. + * Split into nethack-common, nethack-x11, nethack-gnome, nethack-qt + packages. (See README.Debian for details.) + (Closes: #88129, #43764, #78046, #53356, #58528) + * nethack package is now a dummy package that depends on nethack-common + and nethack-x11 for backwards compatibility. + * /usr/games/nethack now managed by update-alternatives; can be + set to either tty or graphical version. + * Save files changed format again; prompt to back up and wipe + /var/games/nethack and/or /var/lib/games/nethack on upgrade. + * Use dh_installman instead of dh_installmanpages. + * Use dh_installxfonts to register X fonts, etc. + * Install dlb utility in /usr/lib/games/nethack. (Closes: #129741) + * Make sure NetHack.tile_file is not commented out in app-defaults + file. (Closes: #119673) + * config files moved to /etc/nethack/nethackrc.* for various + windowing types. Config files in ~/.nethackrc.* now supported + per-windowing type. (HACKOPTIONS still overrides them, though.) + * Fixed numpad issue many moons ago in xterm: (Closes: #52744) + * Unable to reproduce old ?a ?b bug in xnethack. (Closes: #86959) + * (Oops, typo when fixed manpage in last version.) (Closes: #111097) + * desparate -> desperate in package description (Closes: #125180) + * Using --prefix for tempfile now. (Closes: #54586) + * Shipping with NetHack*autofocus: False in X11 application-defaults + file to work around odd Xaw bugs that pop up now and again; the + patch supplied in #94298 no longer applies to 3.4.0, but the + crashes still show up with NetHack*autofocus: True once in + a while. + + -- Ben Gertzfield Sat, 23 Mar 2002 21:57:18 +0900 + +nethack (3.3.1-7) unstable; urgency=low + + * Sorry for being out of touch for a while. I'm back in business + now that I'm settled down in Tokyo, and have my own desktop computer + again. + * Work-around for Xt-related segfaults. May be fixed upstream in + next release. (Closes: #94298) + * Use upstream NetHack application-defaults file, and merge in changes + from upstream nethack.rc for X11 with our customized Debian one. + (Closes: #95533) + * Check for existence of old /var/lib/games/nethack dir before + warning about its possible existence (covers when a user installs + a pre 3.3.1-5 nethack, purges it, then installs a newer one). + (Closes: #95536) + * Fix manpage to refer to /usr/bin/mail and + /usr/lib/games/nethack. (Closes: #111096) + + -- Ben Gertzfield Sat, 22 Sep 2001 20:13:10 +0900 + +nethack (3.3.1-6) unstable; urgency=MEDIUM + + * Whoops. Forgot to copy over the old save/high score files + from /var/lib/games/nethack -> /var/games/nethack. + Do so carefully, then remove the old directory. (Closes: #92501) + * postrm/preinst still had old dir in there. Oops. + So did /etc/init.d/nethack.. I'm very embarassed. Fixed. + * The preinst does still look in /var/lib/games/nethack for + pre-3.3.1 versions to archive them. + + -- Ben Gertzfield Thu, 12 Apr 2001 20:01:04 -0700 + +nethack (3.3.1-5) unstable; urgency=low + + * Fix FHS bug (/var/lib/games -> /var/games). (Closes: #92501) + * Just a note, I'm not working on building gnomehack as of yet, + because with GTK+ 1.2.9 and later, it's quite useless, since + nethack has to run set-GID and GTK+ >= 1.2.9 forbids this + (with good reason.) + * A lot of bugs were reassigned from gnomehack to nethack that + are not nethack bugs. + - Nethack is in .orig.tar.gz+.diff.gz format. (Closes: #62976) + - No alsa deps for nethack. (Closes: #56738) + - The stairs bug mentioned is unreproducable in stock Nethack. + (Closes: #72202) + - Menu entry for creating new game bug? Seems gnome-specific. + (Closes: #79771) + - Options dialog bug is gnomehack-specific. (Closes: #64944) + - Gnomehack used a different recovery script that was broken. + Not applicable to nethack. (Closes: #69080, #71193) + + -- Ben Gertzfield Wed, 11 Apr 2001 18:45:00 -0700 + +nethack (3.3.1-4) unstable; urgency=medium + + * Add Build-Deps on libxaw-dev and bsdmainutils. (Closes: #89565) + Thanks to neuro and BenC for pointing these out. + + -- Ben Gertzfield Tue, 13 Mar 2001 20:05:13 -0800 + +nethack (3.3.1-3) unstable; urgency=low + + * Buh. Stupid typo in /etc/init.d/nethack; doesn't actually run. + Fixed. Also implemented stop|reload|restart|force-reload (which + do nothing, as this is a rcS.d-only script) for policy reasons. + * Lintian fix: make symlink for license file relative. + * Lintian fix: don't use menu icon "none". + + -- Ben Gertzfield Mon, 12 Mar 2001 23:53:45 -0800 + +nethack (3.3.1-2) unstable; urgency=low + + * Bug hunting release: add Build-Depends (Closes: #84643) + * Change init.d/nethack to not exit on failure, and be ash-compliant + (Closes: #75972) + * Move app-defaults to new /etc/X11 location and make it a + conffile. (Closes: #86281) + * Patch from Ian Jackson to make recover look in the right place. + (Closes: #72584) + * Fixed LOGDIR typo long ago. (Closes: #65486) + * Remove call to dh_suidregister and add Conflicts: suidmanager (<< 0.50) + * Change calls to /usr/X11R6/bin/ utilities to /usr/bin/X11/. + * Add Depends: on xutils, as we call mkfontdir in postinst/postrm. + + -- Ben Gertzfield Mon, 12 Mar 2001 21:14:57 -0800 + +nethack (3.3.1-1) unstable; urgency=low + + * New upstream version. (Huzzah!) + * Wow. I don't have to build with special patches any more; just + about *everything* was accepted upstream. Go DevTeam! You guys + rule. :) (One thing I noticed wasn't patched upstream was + disabling IBMgraphics on the Rogue level. If people still notice + problems, let me know; the historic problems with IBMgraphics + on the rogue level may have been fixed. + + -- Ben Gertzfield Fri, 11 Aug 2000 16:52:27 -0700 + +nethack (3.3.0-9) unstable; urgency=low + + * Fix LOGDIR typo that could cause segfaults. (Eek!) Closes: #65486 + + -- Ben Gertzfield Sun, 11 Jun 2000 23:03:35 -0700 + +nethack (3.3.0-8) frozen unstable; urgency=low + + * Fix preinst to not print all messages on one line. (Ick. :) + + -- Ben Gertzfield Mon, 31 Jan 2000 13:27:37 -0800 + +nethack (3.3.0-7) unstable; urgency=low + + * Patch to fix bones-file handling in /var/lib/games/nethack. + (The bones-file functions were changed from 3.2.2 and so + broke my older patch.) Closes: #54961 + + -- Ben Gertzfield Wed, 12 Jan 2000 21:50:01 -0800 + +nethack (3.3.0-6) unstable; urgency=low + + * Change /usr/games/nethack script to remove stupid 'max number of + Nethack players at once' hack. + * Change /etc/init.d/nethack to work on *any* lock files in + /var/lib/games/nethack (use *.0 instead of *lock.0) + * Patch to fix nasty bugs introduced by separating lock/savefiles + into /var/lib/games/nethack. (Forgot some /s to a few sprintfs, + ouch!) + * Patch to fix recover to work with separate /var/lib/games/nethack + once again. Closes: #52995 + * Change default cat/dog/fruit names when using xnethack to be + more.. Debian-y. :) + + -- Ben Gertzfield Wed, 5 Jan 2000 16:32:53 -0800 + +nethack (3.3.0-5) unstable; urgency=low + + * Make root the user able to enter wizard (debug) mode with 'nethack -D' + instead of user 'wizard', the old default. Closes: #53901 + * Add link from /usr/lib/games/nethack/license -> + /usr/share/doc/nethack/copyright so ?i works in game. Closes: #53979 + * Make sure we pass arguments to nethack when run from xnethack + script. Fixes: #54104 + + -- Ben Gertzfield Wed, 5 Jan 2000 10:23:32 -0800 + +nethack (3.3.0-4) unstable; urgency=low + + * Add color patch to fix swap of red and blue colors. + * Port Linux console IBMgraphics patch from 3.2.2. + * Remove all use of --suffix argument to tempfile, to make + building slink packages easier. Closes: #52968 + + -- Ben Gertzfield Fri, 17 Dec 1999 15:26:05 -0800 + +nethack (3.3.0-3) unstable; urgency=low + + * Fix missing 'esac' at end of /etc/init.d/nethack. Closes: #52738 + + -- Ben Gertzfield Tue, 14 Dec 1999 15:35:32 -0800 + +nethack (3.3.0-2) unstable; urgency=low + + * Note split of spoilers in README.Debian. Closes: #52628 + * Improve logic in preinst for various combinations of 'install' and + 'upgrade' arguments. + * Test for existence of /var/lib/games/nethack before trying to archive + it in preinst. Closes: #52666 + * (Yes, 3.3.0 fixes the Y2K bugs in Nethack! Sorry for not mentioning + this below.) + + -- Ben Gertzfield Mon, 13 Dec 1999 22:15:10 -0800 + +nethack (3.3.0-1) unstable; urgency=low + + * Finally! A new upstream version! Fixes: #52565 + * No more bashisms in postinst. Fixes: #36006 + * Use /etc/init.d/nethack and a link /etc/rcS.d/nethack instead + of /etc/rc.boot/nethack. Fixes: #32441 + * Spoilers split off into separate nethack-spoilers package. (Note: + spoilers may be out of date now for 3.3.0!) + * NOTE NOTE NOTE: Save files from 3.2.2 are *NOT COMPATIBLE* with + 3.3.0 so the preinst will prompt the user and archive the old + save directory, or abort. + * Now depends on debianutils (>= 1.13) because we use 'tempfile' + program in the preinst to get a safe filename for archiving + into for the above NOTE NOTE NOTE. This sucks, though, because + slink's debianutils is 1.10, but it doesn't support the + --suffix we need to make a tempfile with .tar.gz as the extension. + + -- Ben Gertzfield Sun, 12 Dec 1999 14:22:23 -0800 + +nethack (3.2.2-16) unstable; urgency=low + + * Use Richard Braakman's wonderful patch to fix color support in + Nethack with ncurses 4.2. (Fixes: #27817) + * Use Hartmut Koptein's patch for glibc 2.1 prototypes checking. + (Fixes: #32012) + + -- Ben Gertzfield Thu, 21 Jan 1999 07:00:41 -0800 + +nethack (3.2.2-15) frozen unstable; urgency=low + + * Recompile with ncurses 4.2. + + -- Ben Gertzfield Fri, 30 Oct 1998 12:38:12 -0800 + +nethack (3.2.2-14) unstable; urgency=low + + * Add test in preinst to make sure we don't check $2 on anything + but an upgrade, as dpkg can call the preinst with no $2 if + we're doing a fresh install, and that'll make my test to see + what version we're upgrading from crash. (Fixes: #27101) + + -- Ben Gertzfield Sat, 26 Sep 1998 10:57:36 -0700 + +nethack (3.2.2-13) unstable; urgency=low + + * Applied David Damerell's paranoid_quit and big top 10 patches. + (Fixes: #26609) + + -- Ben Gertzfield Mon, 21 Sep 1998 19:30:22 -0700 + +nethack (3.2.2-12) unstable; urgency=low + + * Made postinst really anal on checks for upgrades from old versions, + to make all permissions correct. (Fixes: #25881, #19588) + * Converted debian/rules to debhelper. (Fixes: #14492) + * /var/lib/games/nethack/{record,logfile,perm} are no longer conffiles, + and the management of them has moved to the postinst/postrm scripts. + * Enabled tiles by default when running with X enhancements. + * Created xnethack script to run the X-based nethack. + * Disabled the mail daemon mail-check in X-based nethack, as it + could cause nethack to freeze if run from the menu entry (as + opposed to from within an xterm). + + -- Ben Gertzfield Tue, 18 Aug 1998 17:10:16 -0700 + +nethack (3.2.2-11) unstable; urgency=low + + * Hamm release of 3.2.2-10. + + -- Ben Gertzfield Tue, 28 Oct 1997 17:38:11 -0800 + +nethack (3.2.2-10) stable; urgency=low + + * Re-built with libc5 libraries, as 3.2.2-7 was broken. + * Fixed text menu entry pausing bug. + * Took out dpkg-shlibdeps call for the lib5 build. + * Changed chmod /var/lib/games/nethack 04775 in postinst to 02775. + + -- Ben Gertzfield Tue, 28 Oct 1997 12:53:37 -0800 + +nethack (3.2.2-9) unstable; urgency=low + + * Re-added fix for permissions on /var/lib/games/nethack to postinst; + fixes bug #13596. + * Added X NetHack entry to menu file, fixes wishlist #13036. + * Menu entry for text NetHack now pauses after the game ends, fixes + bug #13035. + * Built with all-glibc libraries, fixes bug #12793. + * Copied 'license' text-file to /usr/lib/games/nethack, fixes bug #13033. + * Upgraded to Standards-Version 2.3.0.0. + + -- Ben Gertzfield Fri, 10 Oct 1997 16:17:46 -0700 + +nethack (3.2.2-8) unstable; urgency=low + + * New maintainer. + * Compiled under libc6. + * Added patch for proper IBM graphics support. + * Added patch for sound (speaker) support at the console. + * No longer writes to /usr/lib/games/nethack; fixes bug #10454. + * No longer uses i386-specific commands in makefile; fixes bug #10795. + * Re-added dgn_comp and lev_comp to package; fixes bug #11013. + * Created /etc/rc.boot/nethack to recover save-files on boot; + fixes bug #11012. + * Changed rules file to no longer use debstd. + * Made the recover utility setgid and removed the -d option to + prevent cheating. + * Really fixed bug #10149 -- both logfile and record are now + conffiles. + * If upgrading from a version with incompatible logfile/record files, + warns before clearing out /var/lib/games/nethack. + + -- Ben Gertzfield Wed, 23 Jul 1997 20:33:26 -0500 + +nethack (3.2.2-7) frozen unstable; urgency=low + + * changes to makefile to force compiling under libc5 + * fixed bug #10149: upgrading no longer kills the high score file + * fixed bug #9839: now provides nh10 font + + -- Paul Haggart Mon, 26 May 1997 22:34:36 -0400 + +nethack (3.2.2-6) frozen unstable; urgency=low + + * routine cleanup of makefiles + * fixed debian/rules to actually clean up on 'debian/rules clean' + * fixed bug #9288: debian/rules doesn't delete manpages until after build + * fixed bug #9287: X11 support added + + -- Paul Haggart Thu, 1 May 1997 19:32:57 -0400 + +nethack (3.2.2-5) frozen unstable; urgency=low + + * postinst tweak to allow saved games to actually save + + -- Paul Haggart Wed, 23 Apr 1997 22:55:20 -0400 + +nethack (3.2.2-4) frozen unstable; urgency=low + + * added postinst to fix bad permissions/owners on upgrades + * fixed termcap/terminfo bug + + -- Paul Haggart Tue, 8 Apr 1997 22:35:44 -0400 + +nethack (3.2.2-3) unstable; urgency=high + + * fixed -massive- error with lockfiles + * fixed gzip error with saved games + * now includes 'recovery' so you can try to restore a crashed game + + -- Paul Haggart Sat, 15 Feb 1997 18:43:48 -0500 + +nethack (3.2.2-2) unstable; urgency=low + + * changed email address from 'debian.com' to 'debian.org' + + -- Paul Haggart Wed, 12 Feb 1997 15:55:33 -0500 + +nethack (3.2.2-1) unstable; urgency=low + + * new upstream source (sorry this took so long to get done!) + * wizard patch removed .. it wouldn't patch into 3.2.2 + + -- Paul Haggart Mon, 10 Feb 1997 22:08:09 -0500 + +nethack (3.2.1-4) unstable; urgency=low + + * removed qt interface because of policy complaints + + -- Paul Haggart Mon, 2 Dec 1996 15:08:15 -0500 + +nethack (3.2.1-3) unstable; urgency=low + + * added wizard patch + + -- Paul Haggart Mon, 18 Nov 1996 19:12:24 -0500 + +nethack (3.2.1-2) unstable; urgency=low + + * added qt interface + * added spoiler files + + -- Paul Haggart Sat, 16 Nov 1996 02:22:05 -0500 + +nethack (3.2.1-1) unstable; urgency=low + + * New maintainer + * Initial release + + -- Paul Haggart Sun, 27 Oct 1996 05:56:48 -0500 + + --- nethack-3.4.3.orig/debian/rules +++ nethack-3.4.3/debian/rules @@ -0,0 +1,168 @@ +#!/usr/bin/make -f + +# Nethack build script for Debian +# +# Behold, mortal, the origins of this makefile... +# +# Ben Gertzfield wrote the original debian/rules in 1997. +# Joshua Kwan revised it in 2003. +# +# Copyright 1997-2003 Ben Gertzfield, Joshua Kwan. This script is +# released under the GNU General Public License, version 2 or later. + +include /usr/share/dpatch/dpatch.make + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + optimize := -O0 +else + optimize := -O2 +endif + +export CFLAGS = $(optimize) -I../include -g -Wall -DGCC_WARN + +TARGETS = console lisp x11 gnome qt + +TARGET_NAMES = $(TARGETS:%=build-%) +TARGET_STAMPS = $(TARGET_NAMES:%=%-stamp) + +build: patch-stamp build-stamp +build-stamp: $(TARGET_NAMES) build-common + touch build-stamp + +Makefile: +# setup.sh makes the symlinks for the Makefiles. Giving it any +# (in this case, 1) tells it to make symlinks. + sh sys/unix/setup.sh 1 + +$(TARGET_NAMES): %: %-stamp + +$(TARGET_STAMPS): Makefile patch-stamp + dh_testdir + dh_installdirs + + touch include/config.h + $(MAKE) nethack WIN=$(patsubst build-%-stamp,%,$@) + cp src/nethack debian/$(patsubst build-%-stamp,%,$@) + touch $@ + +build-common: patch-stamp build-common-stamp + +build-common-stamp: Makefile $(TARGET_NAMES) + $(MAKE) CFLAGS="$(CFLAGS) -DUSE_XPM" \ + Guidebook data oracles options quest.dat rumors dungeon spec_levs \ + check-dlb x11tiles pet_mark.xbm rip.xpm mapbg.xpm + cd util && $(MAKE) recover + touch build-common-stamp + +clean: unpatch + dh_testdir + dh_testroot + rm -f build-stamp build-common-stamp $(TARGET_STAMPS) + rm -f nh10.pcf* + rm -f $(patsubst %,debian/%/nethack,$(TARGETS)) + -$(MAKE) spotless + -find . -name Makefile -print0 | xargs -r -0 rm + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + dh_installinit --no-start -pnethack-common + dh_link + + chgrp games debian/nethack-common/usr/lib/games/nethack + chgrp -R games debian/nethack-common/var/games/nethack + chmod -R 0775 debian/nethack-common/var/games/nethack + + install -m 0755 -o root -g root debian/recover-helper \ + debian/nethack-common/usr/lib/games/nethack/recover-helper + + install -m 0644 -o root -g root dat/nhdat \ + debian/nethack-common/usr/lib/games/nethack/nhdat + + install -m 0644 -o root -g root debian/nethackrc.tty \ + debian/nethack-common/etc/nethack/nethackrc.tty + + install -m 0644 -o root -g root debian/nethack.xpm \ + debian/nethack-common/usr/share/pixmaps + + install -m 644 debian/x11/NetHack.ad \ + debian/nethack-x11/etc/X11/app-defaults/NetHack + + /usr/bin/bdftopcf -o nh10.pcf win/X11/nh10.bdf + gzip -9f nh10.pcf + install -m 644 nh10.pcf.gz debian/nethack-x11/usr/X11R6/lib/X11/fonts/misc/ + # all graphics data needed by the graphical front ends + for file in x11tiles pet_mark.xbm rip.xpm mapbg.xpm; do \ + install -m 0644 -o root -g root dat/$$file \ + debian/nethack-common/usr/share/pixmaps/nethack/; \ + done + + # install all utilities + for prg in recover dgn_comp lev_comp dlb; do \ + install -m 0755 -o root -g games util/$$prg \ + debian/nethack-common/usr/lib/games/nethack/$$prg; \ + done + + # all shell scripts, nethack binaries, overrides, and nethackrcs + for flavor in $(TARGETS); do \ + install -m 0755 -o root -g games debian/$$flavor/nethack.sh \ + debian/nethack-$$flavor/usr/lib/games/nethack/nethack-$$flavor.sh; \ + if [ -f "debian/$$flavor/nethack-tty.sh" ]; then \ + install -m 0755 -o root -g games debian/$$flavor/nethack-tty.sh \ + debian/nethack-$$flavor/usr/lib/games/nethack/nethack-$$flavor-tty.sh; \ + fi; \ + install -m 0644 -o root -g root debian/$$flavor/nethackrc \ + debian/nethack-$$flavor/etc/nethack/nethackrc.$$flavor; \ + install -m 2755 -o root -g games debian/$$flavor/nethack \ + debian/nethack-$$flavor/usr/lib/games/nethack/nethack-$$flavor; \ + done + + for pkg in $(addprefix nethack-,$(TARGETS) common); do \ + if [ -f "debian/overrides/lintian/$$pkg" ]; then \ + mkdir -p debian/$$pkg/usr/share/lintian/overrides; \ + cp debian/overrides/lintian/$$pkg debian/$$pkg/usr/share/lintian/overrides; \ + fi; \ + done + +# spoilers have been split out into nethack-spoilers + +binary-indep: build + dh_testdir + dh_testroot + dh_installdocs -i -A debian/README.Debian + dh_installchangelogs -i + dh_compress -i + dh_gencontrol -i + dh_fixperms -i + dh_builddeb -i + +binary-arch: build install + dh_testdir + dh_testroot + dh_installdocs -a -A debian/README.Debian README.menucolor + dh_installdocs -pnethack-common debian/README.patches + dh_installmenu -a + dh_installdebconf -pnethack-common + dh_installexamples -pnethack-x11 debian/x11/NetHack.ad + dh_installman -a + dh_installchangelogs -a + dh_installxfonts -a + dh_strip -a + dh_compress -a + dh_fixperms -a -Xnethack + dh_installdeb -a + dh_shlibdeps -a + dh_gencontrol -a + dh_md5sums -a + dh_builddeb -a + +source diff: + @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false + +binary: binary-indep binary-arch + +.PHONY: build build-common clean binary-indep binary-arch binary source diff install patch unpatch $(TARGET_NAMES) --- nethack-3.4.3.orig/debian/nethack-common.docs +++ nethack-3.4.3/debian/nethack-common.docs @@ -0,0 +1 @@ +doc/Guidebook.txt --- nethack-3.4.3.orig/debian/nethack-console.links +++ nethack-3.4.3/debian/nethack-console.links @@ -0,0 +1,2 @@ +usr/lib/games/nethack/nethack-console.sh usr/games/nethack-console +usr/share/man/man6/nethack.6.gz usr/share/man/man6/nethack-console.6.gz --- nethack-3.4.3.orig/debian/nethack-gnome.links +++ nethack-3.4.3/debian/nethack-gnome.links @@ -0,0 +1,2 @@ +usr/lib/games/nethack/nethack-gnome.sh usr/games/nethack-gnome +usr/share/man/man6/nethack.6.gz usr/share/man/man6/nethack-gnome.6.gz --- nethack-3.4.3.orig/debian/nethack-qt.dirs +++ nethack-3.4.3/debian/nethack-qt.dirs @@ -0,0 +1,4 @@ +etc/nethack +usr/games +usr/lib/games/nethack +usr/share/man/man6 --- nethack-3.4.3.orig/debian/nethack-console.postinst +++ nethack-3.4.3/debian/nethack-console.postinst @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +update-alternatives --install /usr/games/nethack nethack \ + /usr/lib/games/nethack/nethack-console.sh 50 + +#DEBHELPER# --- nethack-3.4.3.orig/debian/nethack-console.prerm +++ nethack-3.4.3/debian/nethack-console.prerm @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +update-alternatives --remove nethack /usr/lib/games/nethack/nethack-console.sh + +#DEBHELPER# --- nethack-3.4.3.orig/debian/nethack-lisp.links +++ nethack-3.4.3/debian/nethack-lisp.links @@ -0,0 +1,2 @@ +usr/lib/games/nethack/nethack-lisp.sh usr/games/nethack-lisp +usr/share/man/man6/nethack.6.gz usr/share/man/man6/nethack-lisp.6.gz --- nethack-3.4.3.orig/debian/console/nethackrc +++ nethack-3.4.3/debian/console/nethackrc @@ -0,0 +1,29 @@ +# +# System-wide NetHack configuration file for console-only NetHack. +# +OPTIONS=windowtype:tty,toptenwin,hilite_pet,!number_pad,hpmon +OPTIONS=fixinv,safe_pet,sortpack,tombstone,color +OPTIONS=verbose,news,fruit:potato +OPTIONS=dogname:Slinky +OPTIONS=catname:Rex +OPTIONS=pickup_types:$ +OPTIONS=nomail + +# Enable this if you want to see your inventory sorted in alphabetical +# order by item instead of by index letter: +# OPTIONS=sortloot:full +# or if you just want containers sorted: +# OPTIONS=sortloot:loot + +# +# Some sane defaults for menucolor +# + +OPTIONS=menucolors +MENUCOLOR=" blessed "=green +MENUCOLOR=" holy "=green +MENUCOLOR=" uncursed "=yellow +MENUCOLOR=" cursed "=red +MENUCOLOR=" unholy "=red +MENUCOLOR=" cursed .* (being worn)"=orange&underline + --- nethack-3.4.3.orig/debian/console/nethack.sh +++ nethack-3.4.3/debian/console/nethack.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +set -e + +HACKSTYLE=console + +if [ -z "$NETHACKOPTIONS" ]; then + if [ -e $HOME/.nethackrc ]; then + NETHACKOPTIONS=$HOME/.nethackrc + export NETHACKOPTIONS + elif [ -e $HOME/.nethackrc.$HACKSTYLE ]; then + NETHACKOPTIONS=$HOME/.nethackrc.$HACKSTYLE + export NETHACKOPTIONS + elif [ -e $HOME/.nethackrc.tty ]; then + NETHACKOPTIONS=$HOME/.nethackrc.tty + export NETHACKOPTIONS + else + NETHACKOPTIONS=/etc/nethack/nethackrc.$HACKSTYLE + export NETHACKOPTIONS + fi +fi + +HACKDIR=/usr/lib/games/nethack +export HACKDIR +HACK=$HACKDIR/nethack-$HACKSTYLE + +cd $HACKDIR +exec $HACK "$@" --- nethack-3.4.3.orig/debian/nethack-x11.links +++ nethack-3.4.3/debian/nethack-x11.links @@ -0,0 +1,3 @@ +usr/lib/games/nethack/nethack-x11.sh usr/games/xnethack +usr/share/man/man6/nethack.6.gz usr/share/man/man6/xnethack.6.gz + --- nethack-3.4.3.orig/debian/nethack-gnome.prerm +++ nethack-3.4.3/debian/nethack-gnome.prerm @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +update-alternatives --remove nethack /usr/lib/games/nethack/nethack-gnome.sh +update-alternatives --remove nethack /usr/lib/games/nethack/nethack-gnome-tty.sh + +#DEBHELPER# --- nethack-3.4.3.orig/debian/gnome/nethackrc +++ nethack-3.4.3/debian/gnome/nethackrc @@ -0,0 +1,21 @@ +# +# System-wide NetHack configuration file for Gnome-based NetHack. +# + +OPTIONS=windowtype:gnome,toptenwin,hilite_pet,!number_pad +OPTIONS=fixinv,safe_pet,sortpack,tombstone,color +OPTIONS=verbose,news,fruit:potato +OPTIONS=dogname:Slinky +OPTIONS=catname:Rex +OPTIONS=pickup_types:$ +OPTIONS=nomail,ignintr +OPTIONS=menustyle:partial,!time,showexp +OPTIONS=msghistory:200 + +# Enable this if you want to see your inventory sorted in alphabetical +# order by item instead of by index letter: +# OPTIONS=sortloot:full +# or if you just want containers sorted: +# OPTIONS=sortloot:loot + + --- nethack-3.4.3.orig/debian/gnome/nethack-tty.sh +++ nethack-3.4.3/debian/gnome/nethack-tty.sh @@ -0,0 +1,64 @@ +#!/bin/sh + +set -e + +HACKSTYLE=gnome + +if [ -z "$NETHACKOPTIONS" ]; then + if [ -e $HOME/.nethackrc ]; then + NETHACKOPTIONS=$HOME/.nethackrc + export NETHACKOPTIONS + else + NETHACKOPTIONS=/etc/nethack/nethackrc.tty + export NETHACKOPTIONS + fi +fi + +HACKDIR=/usr/lib/games/nethack +export HACKDIR +HACK=$HACKDIR/nethack-$HACKSTYLE + +# see if we can find the full path name of PAGER, so help files work properly +# assume that if someone sets up a special variable (HACKPAGER) for NetHack, +# it will already be in a form acceptable to NetHack +# ideas from brian@radio.astro.utoronto.ca +if test \( "xxx$PAGER" != xxx \) -a \( "xxx$HACKPAGER" = xxx \) +then + + HACKPAGER=$PAGER + +# use only the first word of the pager variable +# this prevents problems when looking for file names with trailing +# options, but also makes the options unavailable for later use from +# NetHack + for i in $HACKPAGER + do + HACKPAGER=$i + break + done + + if test ! -f $HACKPAGER + then + IFS=: + for i in $PATH + do + if test -f $i/$HACKPAGER + then + HACKPAGER=$i/$HACKPAGER + export HACKPAGER + break + fi + done + IFS=' ' + fi + if test ! -f $HACKPAGER + then + echo Cannot find $PAGER -- unsetting PAGER. + unset HACKPAGER + unset PAGER + fi +fi + +cd $HACKDIR + +exec $HACK "$@" $ARGS --- nethack-3.4.3.orig/debian/gnome/nethack.sh +++ nethack-3.4.3/debian/gnome/nethack.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +set -e + +HACKSTYLE=gnome + +if [ -z "$NETHACKOPTIONS" ]; then + if [ -e $HOME/.nethackrc.$HACKSTYLE ]; then + NETHACKOPTIONS=$HOME/.nethackrc.$HACKSTYLE + export NETHACKOPTIONS + elif [ -e $HOME/.nethackrc ]; then + NETHACKOPTIONS=$HOME/.nethackrc + export NETHACKOPTIONS + else + NETHACKOPTIONS=/etc/nethack/nethackrc.$HACKSTYLE + export NETHACKOPTIONS + fi +fi + +HACKDIR=/usr/lib/games/nethack +export HACKDIR +HACK=$HACKDIR/nethack-$HACKSTYLE + +cd $HACKDIR + +export OVERRIDEWIN=$HACKSTYLE + +exec $HACK "$@" $ARGS --- nethack-3.4.3.orig/debian/nethack-common.menu +++ nethack-3.4.3/debian/nethack-common.menu @@ -0,0 +1,6 @@ +?package(nethack-common):command="/usr/games/nethack" \ + needs="text" \ + hints="Roguelike,Maze,Dungeon" \ + section="Games/Adventure" \ + title="NetHack" \ + icon="/usr/share/pixmaps/nethack.xpm" --- nethack-3.4.3.orig/debian/copyright +++ nethack-3.4.3/debian/copyright @@ -0,0 +1,135 @@ +This package was created by Ben Gertzfield on +Sun, 12 Dec 1999 14:23:01 -0800. It was originally Debianized by +Paul Haggart . + +Nethack's home site is: http://www.nethack.org/ + +This archive was downloaded from: +http://us.dl.sourceforge.net/sourceforge/nethack/nethack-343-src.tgz + +The LISP windowing patch is available from: + +http://savannah.nongnu.org/download/nethack-el/ + +Copyright: + + NETHACK GENERAL PUBLIC LICENSE + (Copyright 1989 M. Stephenson) +. + (Based on the BISON general public license, + copyright 1988 Richard M. Stallman) + + Everyone is permitted to copy and distribute verbatim copies of this + license, but changing it is not allowed. You can also use this wording to + make the terms for other programs. + + The license agreements of most software companies keep you at the mercy of +those companies. By contrast, our general public license is intended to give +everyone the right to share NetHack. To make sure that you get the rights we +want you to have, we need to make restrictions that forbid anyone to deny you +these rights or to ask you to surrender the rights. Hence this license +agreement. + + Specifically, we want to make sure that you have the right to give away +copies of NetHack, that you receive source code or else can get it if you +want it, that you can change NetHack or use pieces of it in new free +programs, and that you know you can do these things. + + To make sure that everyone has such rights, we have to forbid you to +deprive anyone else of these rights. For example, if you distribute copies +of NetHack, you must give the recipients all the rights that you have. You +must make sure that they, too, receive or can get the source code. And you +must tell them their rights. + + Also, for our own protection, we must make certain that everyone finds out +that there is no warranty for NetHack. If NetHack is modified by someone +else and passed on, we want its recipients to know that what they have is +not what we distributed. + + Therefore we (Mike Stephenson and other holders of NetHack copyrights) make +the following terms which say what you must do to be allowed to distribute or +change NetHack. + + + COPYING POLICIES + + 1. You may copy and distribute verbatim copies of NetHack source code as +you receive it, in any medium, provided that you keep intact the notices on +all files that refer to copyrights, to this License Agreement, and to the +absence of any warranty; and give any other recipients of the NetHack +program a copy of this License Agreement along with the program. + + 2. You may modify your copy or copies of NetHack or any portion of it, and +copy and distribute such modifications under the terms of Paragraph 1 above +(including distributing this License Agreement), provided that you also do the +following: + + a) cause the modified files to carry prominent notices stating that you + changed the files and the date of any change; and + + b) cause the whole of any work that you distribute or publish, that in + whole or in part contains or is a derivative of NetHack or any part + thereof, to be licensed at no charge to all third parties on terms + identical to those contained in this License Agreement (except that you + may choose to grant more extensive warranty protection to some or all + third parties, at your option) + + c) You may charge a distribution fee for the physical act of + transferring a copy, and you may at your option offer warranty protection + in exchange for a fee. + + 3. You may copy and distribute NetHack (or a portion or derivative of it, +under Paragraph 2) in object code or executable form under the terms of +Paragraphs 1 and 2 above provided that you also do one of the following: + + a) accompany it with the complete machine-readable source code, which + must be distributed under the terms of Paragraphs 1 and 2 above; or, + + b) accompany it with full information as to how to obtain the complete + machine-readable source code from an appropriate archive site. (This + alternative is allowed only for noncommercial distribution.) + +For these purposes, complete source code means either the full source +distribution as originally released over Usenet or updated copies of the +files in this distribution used to create the object code or executable. + + 4. You may not copy, sublicense, distribute or transfer NetHack except as +expressly provided under this License Agreement. Any attempt otherwise to +copy, sublicense, distribute or transfer NetHack is void and your rights to +use the program under this License agreement shall be automatically +terminated. However, parties who have received computer software programs +from you with this License Agreement will not have their licenses terminated +so long as such parties remain in full compliance. + + +Stated plainly: You are permitted to modify NetHack, or otherwise use parts +of NetHack, provided that you comply with the conditions specified above; +in particular, your modified NetHack or program containing parts of NetHack +must remain freely available as provided in this License Agreement. In +other words, go ahead and share NetHack, but don't try to stop anyone else +from sharing it farther. + +The lisp-window patch used to build this package comes +with the following license: + +Copyright (c) Shawn Betts, Ryan Yeske, 2001 + +Redistribution and use in source and binary forms, with or without modification, are permitted +provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials provided + with the distribution. + 3. The name of the author may not be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --- nethack-3.4.3.orig/debian/nethack-x11.prerm +++ nethack-3.4.3/debian/nethack-x11.prerm @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +update-alternatives --remove nethack /usr/lib/games/nethack/nethack-x11.sh + +update-alternatives --remove nethack /usr/lib/games/nethack/nethack-x11-tty.sh + +#DEBHELPER# --- nethack-3.4.3.orig/debian/x11/NetHack.ad +++ nethack-3.4.3/debian/x11/NetHack.ad @@ -0,0 +1,190 @@ +! The display_file, tombstone, and menu windows are all formatted assuming +! a fixed width font. Text windows may or may not be formatted as above. +! The rip window applies if the GRAPHIC_TOMBSTONE option is turned on, and +! requires a 12 pixel font for correct appearance. +! +NetHack*font: variable +NetHack*display_file*font: fixed +NetHack*tombstone*font: fixed +NetHack*rip*font: -*-times-medium-r-*-*-12-*-*-*-*-*-*-* +NetHack*menu*font: fixed +!NetHack*text*font: fixed +NetHack*map*font: nh10 + +! To use full-color tiles for the map, uncomment the tile file name. +! If you use a 100dpi (or greater) monitor you may wish to double the +! tile size so you can see the figures. If NetHack was compiled to +! use XPM (USE_XPM in config.h), the tile_file is a standard XPM file. +! Otherwise, it is a custom format. double_tile_size only applies to +! the custom format - to enlarge an XPM file, use processing tools +! such as XV or preferably PBMplus. +! +NetHack.tile_file: /usr/share/pixmaps/nethack/x11tiles +!NetHack.double_tile_size: True +! +! The annotation of pets. +NetHack.pet_mark_bitmap: /usr/share/pixmaps/nethack/pet_mark.xbm +NetHack.pet_mark_color: Red + +! Tombstone +! The image file +NetHack.tombstone: /usr/share/pixmaps/nethack/rip.xpm +! Text starts at (tombtext_x, tombtext_y) and subsequent lines +! are displaced by (tombtext_dx, tombtext_dy) pixels. If you +NetHack.tombtext_x: 155 +NetHack.tombtext_y: 78 +NetHack.tombtext_dx: 0 +NetHack.tombtext_dy: 13 +! The color to use for the text on the hero's tombstone +NetHack*rip*foreground: black + +! Translation tables. There are currently several actions in nethack, but +! the only one you should be using is "input()", which, with no parameters, +! uses XLookupString to translate your keypress into a command. You +! can optionally give it parameters to change the behavior, see the example +! below. Note that you have to specify the translations in every appropriate +! window. +NetHack*message*translations: : input() +! +! Example extra translations for the map window. +! +NetHack*map*translations: #override \ + !Left: input(h) \n\ + !Right: input(l) \n\ + !Up: input(k) \n\ + !Down: input(j) +! +! The icon to use; supported values are nh72, nh56, and nh32; nh72 is the +! default. Some window managers may not support the larger icon sizes. +! It is not guaranteed that the window manager will honor the icon selection. +NetHack*icon: nh56 +! +! If True, the default, a popup for single character prompts such as y/n +! questions is _not_ used. +NetHack*slow: True + +! The number of lines the message window will show without scrolling. +!NetHack*message_lines: 12 +! +! If True, the message window has a line that seperates old and new messages. +!NetHack*message_line: True +! +! If True, force keyboard to attach to popup windows. Some window managers +! enforce a click-to-focus-keyboard policy (e.g. the DECwindows wm). NetHack +! has a lot of popups and is almost unplayable without some kind of autofocus. +NetHack*autofocus: False +! +! Specify the number of rows and columns of the map window. The default +! is the standard 80x21 window. Note: this _does_not_ change nethack's +! level size, only what you see of it. +!NetHack*map*rows: 21 +!NetHack*map*columns: 80 + +! Parts of the fancy status display. +! +NetHack*status_condition.borderWidth: 0 +NetHack*status_info*borderWidth: 0 + +! Sample color screen entries. +! +NetHack*nethack.background: wheat +NetHack*map*yellow: gold +NetHack*map*brown: tan +NetHack*map*gray: grey85 +NetHack*map*foreground: wheat +NetHack*map*background: grey40 + +NetHack*fancy_status.skipAdjust: True +NetHack*fancy_status.background: wheat +NetHack*status_info*foreground: Sienna +NetHack*status_info*background: wheat +NetHack*status_info.background: wheat +NetHack*status_attributes*foreground: black +NetHack*status_attributes*background: white +NetHack*status_condition*foreground: red +NetHack*status_condition*background: wheat +NetHack*Scrollbar*foreground: Sienna +NetHack*Scrollbar*background: wheat +NetHack*status_info*showGrip: False +NetHack*status_attributes*showGrip: False + +NetHack*player_selection*random.borderColor: blue +NetHack*player_selection*random.borderWidth: 2 +NetHack*player_selection*random.foreground: blue +NetHack*player_selection*random.accelerators: #override\n\ + Return: set() notify() unset() +NetHack*player_selection*quit.borderColor: blue +NetHack*player_selection*quit.foreground: blue +NetHack*player_selection*Command.borderColor: red +NetHack*player_selection*Command.foreground: red +NetHack*player_selection*quit.accelerators: #override\n\ + Escape: set() notify() unset() + +NetHack*race_selection*random.borderColor: blue +NetHack*race_selection*random.borderWidth: 2 +NetHack*race_selection*random.foreground: blue +NetHack*race_selection*random.accelerators: #override\n\ + Return: set() notify() unset() +NetHack*race_selection*quit.borderColor: blue +NetHack*race_selection*quit.foreground: blue +NetHack*race_selection*Command.borderColor: red +NetHack*race_selection*Command.foreground: red +NetHack*race_selection*quit.accelerators: #override\n\ + Escape: set() notify() unset() + +NetHack*gender_selection*random.borderColor: blue +NetHack*gender_selection*random.borderWidth: 2 +NetHack*gender_selection*random.foreground: blue +NetHack*gender_selection*random.accelerators: #override\n\ + Return: set() notify() unset() +NetHack*gender_selection*quit.borderColor: blue +NetHack*gender_selection*quit.foreground: blue +NetHack*gender_selection*Command.borderColor: red +NetHack*gender_selection*Command.foreground: red +NetHack*gender_selection*quit.accelerators: #override\n\ + Escape: set() notify() unset() + +NetHack*alignment_selection*random.borderColor: blue +NetHack*alignment_selection*random.borderWidth: 2 +NetHack*alignment_selection*random.foreground: blue +NetHack*alignment_selection*random.accelerators: #override\n\ + Return: set() notify() unset() +NetHack*alignment_selection*quit.borderColor: blue +NetHack*alignment_selection*quit.foreground: blue +NetHack*alignment_selection*Command.borderColor: red +NetHack*alignment_selection*Command.foreground: red +NetHack*alignment_selection*quit.accelerators: #override\n\ + Escape: set() notify() unset() + +NetHack*extended_commands*dismiss.borderColor: blue +NetHack*extended_commands*dismiss.foreground: blue +NetHack*extended_commands*help.borderColor: blue +NetHack*extended_commands*help.foreground: blue +NetHack*extended_commands*Command.borderColor: red +NetHack*extended_commands*Command.foreground: red +NetHack*extended_commands*help.accelerators: #override\n\ + :?: set() notify() unset() +NetHack*extended_commands*dismiss.accelerators: #override\n\ + Escape: set() notify() unset() +! +! +! The following are the default 15 colors that the nethack map uses. +! If they don't look good on your screen, change them. +! +! The foreground color is used as "no color". +! +!NetHack*map*black: black +!NetHack*map*red: red +!NetHack*map*green: pale green +!NetHack*map*brown: brown +!NetHack*map*blue: blue +!NetHack*map*magenta: magenta +!NetHack*map*cyan: light cyan +!NetHack*map*gray: gray +!NetHack*map*orange: orange +!NetHack*map*bright_green: green +!NetHack*map*yellow: yellow +!NetHack*map*bright_blue: royal blue +!NetHack*map*bright_magenta: violet +!NetHack*map*bright_cyan: cyan +!NetHack*map*white: white --- nethack-3.4.3.orig/debian/x11/nethackrc +++ nethack-3.4.3/debian/x11/nethackrc @@ -0,0 +1,83 @@ +# +# System-wide NetHack configuration file for X-based NetHack. +# + +OPTIONS=windowtype:x11,toptenwin,hilite_pet,!number_pad +OPTIONS=fixinv,safe_pet,sortpack,tombstone,color +OPTIONS=verbose,news,fruit:potato +OPTIONS=dogname:Slinky +OPTIONS=catname:Rex +OPTIONS=pickup_types:$ +OPTIONS=nomail + +# Enable this if you want to see your inventory sorted in alphabetical +# order by item instead of by index letter: +# OPTIONS=sortloot:full +# or if you just want containers sorted: +# OPTIONS=sortloot:loot + +# +# There are 17 object symbols and various graphics symbols. +# The descriptions of these symbols can be found in dat/opthelp. +# +# +# Font: nh10 (10x20) +# +OBJECTS= 180 183 188 192 181 184 182 189 190 196 \ + 191 194 193 187 185 186 195 +# +DUNGEON= 032 025 018 013 012 014 011 015 023 024 \ + 022 021 128 129 130 131 132 035 035 133 \ + 134 135 136 137 145 146 144 124 143 142 \ + 141 140 149 150 031 031 147 148 031 161 \ + 140 +# +TRAPS= 138 138 138 138 138 138 138 138 138 138 \ + 138 138 138 138 138 139 138 138 138 138 \ + 138 138 +# +EFFECTS= 151 152 153 154 155 156 157 158 \ + 159 160 161 162 \ + 163 164 165 166 167 168 169 170 \ + 171 172 173 174 175 176 177 178 179 +# +# +# Font: ibm (8x14) +# +#OBJECTS= 207 210 215 219 208 211 209 216 217 223 \ +# 218 221 220 214 212 213 222 +# +#DUNGEON= 032 128 129 130 131 132 133 134 135 136 \ +# 137 138 139 045 124 142 143 035 035 144 \ +# 145 146 147 148 155 156 227 124 154 153 \ +# 152 151 159 160 200 200 157 158 250 170 \ +# 151 +# +#TRAPS= 149 149 149 149 149 149 149 149 149 149 \ +# 149 149 149 149 149 150 149 149 149 149 \ +# 149 149 +# +#EFFECTS= 161 162 163 164 165 166 167 168 \ +# 169 170 171 172 \ +# 173 174 175 176 177 178 179 180 \ +# 181 182 183 184 185 186 187 188 189 +# +# +# Font: a "standard" font like 6x13 +# Note that this version is unlikely to work on a tty on a Unix system because +# many of these characters are also control characters. +# +#DUNGEON = 032 025 018 013 012 014 011 015 023 024 \ +# 022 021 031 045 124 043 043 035 035 031 \ +# 035 001 060 062 060 062 019 124 092 035 \ +# 123 125 031 125 046 046 035 035 046 127 \ +# 125 +# +#TRAPS= 094 094 094 094 094 094 094 094 094 094 \ +# 094 094 094 094 094 002 094 094 094 094 \ +# 094 094 +# +#EFFECTS= 124 045 092 047 042 033 041 040 \ +# 048 035 064 042 \ +# 047 045 092 124 124 092 045 047 \ +# 047 064 092 064 064 064 092 064 047 --- nethack-3.4.3.orig/debian/x11/nethack-tty.sh +++ nethack-3.4.3/debian/x11/nethack-tty.sh @@ -0,0 +1,64 @@ +#!/bin/sh + +set -e + +HACKSTYLE=x11 + +if [ -z "$NETHACKOPTIONS" ]; then + if [ -e $HOME/.nethackrc ]; then + NETHACKOPTIONS=$HOME/.nethackrc + export NETHACKOPTIONS + else + NETHACKOPTIONS=/etc/nethack/nethackrc.tty + export NETHACKOPTIONS + fi +fi + +HACKDIR=/usr/lib/games/nethack +export HACKDIR +HACK=$HACKDIR/nethack-$HACKSTYLE + +# see if we can find the full path name of PAGER, so help files work properly +# assume that if someone sets up a special variable (HACKPAGER) for NetHack, +# it will already be in a form acceptable to NetHack +# ideas from brian@radio.astro.utoronto.ca +if test \( "xxx$PAGER" != xxx \) -a \( "xxx$HACKPAGER" = xxx \) +then + + HACKPAGER=$PAGER + +# use only the first word of the pager variable +# this prevents problems when looking for file names with trailing +# options, but also makes the options unavailable for later use from +# NetHack + for i in $HACKPAGER + do + HACKPAGER=$i + break + done + + if test ! -f $HACKPAGER + then + IFS=: + for i in $PATH + do + if test -f $i/$HACKPAGER + then + HACKPAGER=$i/$HACKPAGER + export HACKPAGER + break + fi + done + IFS=' ' + fi + if test ! -f $HACKPAGER + then + echo Cannot find $PAGER -- unsetting PAGER. + unset HACKPAGER + unset PAGER + fi +fi + +cd $HACKDIR + +exec $HACK "$@" $ARGS --- nethack-3.4.3.orig/debian/x11/nethack.sh +++ nethack-3.4.3/debian/x11/nethack.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +set -e + +HACKSTYLE=x11 + +if [ -z "$NETHACKOPTIONS" ]; then + if [ -e $HOME/.nethackrc.$HACKSTYLE ]; then + NETHACKOPTIONS=$HOME/.nethackrc.$HACKSTYLE + export NETHACKOPTIONS + elif [ -e $HOME/.nethackrc ]; then + NETHACKOPTIONS=$HOME/.nethackrc + export NETHACKOPTIONS + else + NETHACKOPTIONS=/etc/nethack/nethackrc.$HACKSTYLE + export NETHACKOPTIONS + fi +fi + +HACKDIR=/usr/lib/games/nethack +export HACKDIR +HACK=$HACKDIR/nethack-$HACKSTYLE + +cd $HACKDIR + +export OVERRIDEWIN=$HACKSTYLE + +exec $HACK "$@" $ARGS --- nethack-3.4.3.orig/debian/nethack-console.dirs +++ nethack-3.4.3/debian/nethack-console.dirs @@ -0,0 +1,4 @@ +etc/nethack +usr/games +usr/lib/games/nethack +usr/share/man/man6 --- nethack-3.4.3.orig/debian/README.Debian +++ nethack-3.4.3/debian/README.Debian @@ -0,0 +1,111 @@ +README for Debian GNU/Linux Nethack 3.4.3 +----------------------------------------- + +[ Apologies for Save File Format Change ] + +The save-game format has changed again for Nethack 3.4.0. You +should have been prompted by the installer to back up your old +save game files and high score list into /tmp. Unfortunately, +your old save-games are no longer useful with Nethack 3.4.0, +although it may be possible to merge the old high score lists. + +Note that the save-game and bones format are the same between +3.4.0 and 3.4.1. You do not need to clean out your save games +for this upgrade. + +[ New in Nethack for Debian 3.4.1-1 and Later ] + +Back by popular demand is the no-frills nethack-console package. +This package has NO graphical interface, and does not even depend +on xbase-clients. + +The nethack-console package supports either ~/.nethackrc or +~/.nethackrc.console files for configuration. + +[ New in Nethack for Debian 3.4.0-1 and Later ] + +The Debian Nethack packages have been restructured. Now, +separate packages are provided for each graphical interface: + + * nethack-x11 + * nethack-gnome + * nethack-qt + +Each of these packages also contains the classic text-based +interface. You can get the classic interface by running +/usr/games/nethack, or a graphical interface by running: + +(for x11): /usr/games/xnethack +(for gnome): /usr/games/nethack-gnome +(for qt): /usr/games/nethack-qt + +[ Changing the default graphical interface ] + +The /usr/games/nethack symlink is maintained with update-alternatives, +so if you wish to make one of the graphical interfaces the default, +simply run (as root): + +# update-alternatives --config nethack + +The common dungeon files and utilities have been moved out +into a separate package, nethack-common. + +The old nethack package is now a dummy package that just depends +on nethack-common and nethack-x11 to behave how the old version +did. + +Please note that the Gnome interface is not yet fully stable, +and is known to have some bugs. If you value your character, please +use the x11, qt, or text interfaces. + +[ Configuration Files for 3.4.0-1 and Later ] + +The previous Debian releases of Nethack did not provide for +separate configuration files for each windowing system. (If +you ran xnethack, ~/.nethackrc was ignored.) Now, each windowing +system has its own set of system defaults and per-user defaults: + +x11: ~/.nethackrc.x11 or /etc/nethack/nethackrc.x11 +gnome: ~/.nethackrc.gnome or /etc/nethack/nethackrc.gnome +qt: ~/.nethackrc.qt or /etc/nethack/nethackrc.qt + +text: ~/.nethackrc or /etc/nethack/nethackrc.tty + +If the HACKOPTIONS environment variable is set to a filename, +that configuration file is always used. Otherwise, the per-user +config file is tried for the appropriate windowing system +(~/.nethackrc.gnome for gnome, etc). If that is not found, +the system-wide default in /etc/nethack is used. + +[ Game Dumps ] + +Summaries of the immediately previous game that someone has played will +always be saved upon death, escape, or ascension in /var/games/nethack/dumps. +These are ideal for posting to newsgroups and bragging to your friends. + +The configuration file hardcodes the path for 'dumpfile' (the location where +this log will be saved) and it cannot be changed, so there is no chance of +being able to create files in arbitrary places with gid: games. + +[ Description of Nethack ] + +Nethack is a wonderfully silly yet quite addicting Dungeons and +Dragons-style adventure game. You play the part of a fierce fighter, +wizard, or any of many other classes, fighting your way down to +retrieve the Amulet of Yendor (try saying THAT one backwards!) for +your god. On the way, you might encounter a quantum mechanic or two, +or perhaps a microscopic space fleet, or -- if you're REALLY lucky -- +the Ravenous Bugblatter Beast of Traal. + +There is a nethack-spoilers package available separately if you are +really stuck, to be used only as a last resort. + +A few utilities -- recover, for retrieving your auto-save files in case +of a power failure, and dgn_comp and lev_comp, two utilities for making +your own Nethack levels and dungeons, have been included in +/usr/lib/games/nethack. As of Nethack 3.4.0, the dlb utility is +included for master hackers. + +The recover utility will be run upon bootup by /etc/init.d/nethack-common. +Any auto-save files still on the system from a possible crash will be +retrieved and converted into proper save files. --- nethack-3.4.3.orig/debian/nethack-common.init +++ nethack-3.4.3/debian/nethack-common.init @@ -0,0 +1,66 @@ +#!/bin/sh + +# Nethack save-file recovery script for Debian +# +# Ben Gertzfield (che@debian.org) 29 July 1997 +# Copyright 1997 Ben Gertzfield. This script is released under the +# GNU General Public License, version 2 or later. + +PATH=/bin:/usr/bin:/sbin:/usr/sbin + +GAMEDIR=/var/games/nethack + +set -e + +cd $GAMEDIR + +case "$1" in + start) + # Has the nethack package been removed? + test -x /usr/lib/games/nethack/recover-helper || exit 0 + + for file in *.0; do + + # Note "$file" is always explicitly quoted to avoid attack. + # If there are no files, then "$file" = "*.0", which doesn't + # exist, so we skip once through this loop and exit. + # Also, the way this is written, some of the files may + # disappear before we look at them. + + # Also check -L--there shouldn't be any symlinks, but if there + # are, we aren't going to process them. + + if [ -f "$file" ] && [ ! -L "$file" ]; then + # Use 'find' to reliably determine the file's owner user name. + owner="$(find "$file" -maxdepth 0 -printf '%u')" + + # Refuse to recover root's nethack files. + if [ "xroot" = "x$owner" ]; then + echo "Ignoring root's Nethack unrecovered save file." + else + echo "Recovering Nethack save files owned by $owner: " + + # "$owner" is explicitly quoted to avoid attack. + # In particular, if the "find" command above fails, + # so will the 'su' command below. + + # There really isn't a good safe way to pass a filename to + # a child shell through 'su -c', so instead we use a helper + # script running as the user which recovers everything + # owned by that user. This avoids the issue of quoting + # filenames passed through the shell entirely. + + su --shell=/bin/sh -c /usr/lib/games/nethack/recover-helper "$owner" + fi + fi + + done + ;; + stop|reload|restart|force-reload) + ;; + *) + N=/etc/init.d/nethack-common + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac