save/restore changes - part 3

This is the third of a series of savefile-related changes.

    This adds early-days experimental support for a completely optional
    'sfctool' utility (savefile conversion tool), to be able to export
    a savefile's contents into a more portable format. There are likely
    to be bugs at this stage. In this initial first-attempt, the export
    format is a very simple ascii output.

    NetHack can be built entirely, without also building this tool.
    NetHack has no dependencies on the tool.

    Attempts were made to minimize duplication of existing NetHack code.
    To achieve that, unfortunately, #ifdef SFCTOOL and #ifndef SFCTOOL
    had to be sprinkled around through some of the existing NetHack
    source code, so that it could be re-used for building the utility.

    The process for building the sfctool typically recompiles the source
    files with #define SFCTOOL and a distinct object file with SF- is
    produced.

sfctool notes:

    Universal ctags is used and required to produce the sfctool utility.

    Some targets were added to the Unix and Windows Makefiles to
    facilitate the build process.

         make sfctool

    That should build a copy in util.

    Note: At present, the Unix Makefiles do not copy sfctool over to the
          NetHack playground during 'make install' or 'make update'.
          Until that gets resolved by someone, The tool will
          have to be manually copied there by the builder/admin if
          desired.
          cp util/sfctool ~/nh/install/games/lib/nethackdir/sfctool

    Also, a separate Visual Studio sfctool.sln solution was written and
    placed in sys/windows/vs. That has has only very limited testing.

    Usage:

      i)  To convert an existing savefile to an exportascii format
          that co-resides with the savefile:

          sfctool -c savefile

          That *must* be executed on the same platform / architecture /
          data model that produced the save file in the first place.

     ii)  To unconvert an existing exportascii format export file to a
          historical format savefile that can then be used by NetHack:

          sfctool -u savefile

          That must be executed on the same target platform / architecture /
          data model that was used to build the NetHack that will
          utilize the save file that results.

     A Windows example:

          sfctool -c Fred.NetHack-saved-game

          That should result in creation of Fred.NetHack-saved-game.exportascii
          from existing savefile:
              %USERPROFILE%\AppData\Local\NetHack\3.7\Fred.NetHack-saved-game

     A Unix example:

          sfctool -c 1000wizard

          That should result in creation of 1000wizard.exportascii.gz
          from existing savefile in the playground save directory:
              1000wizard.gz

  Current Mechanics:
     1. Makefile recipe, or script uses universal ctags to produce
        util/sf.tags.

     2. util/sftags is built and executed to read util/sf.tags and
        generate: include/sfproto.h and src/sfdata.c.

     3. util/sfctool is built from the following:
        generated file compiled with -DSFCTOOL:
                    src/sfdata.c       -> sfdata.o
        existing files compiled with -DSFCTOOL:
                    util/sfctool.c     -> sfctool.o
                    util/sfexpasc.c    -> sfexpasc.o
                    src/alloc.c        -> sf-alloc.o
                    src/monst.c        -> sf-monst.o
                    src/objects.c      -> sf-objects.o
                    src/sfbase.c       -> sfbase.o
                    src/sfstruct.c     -> sfstruct.o
                    src/nhlua.c        -> sf-nhlua.o
                    util/panic.c       -> panic.o
                    src/date.c         -> sf-date.o
                    src/decl.c         -> sf-decl.o
                    src/artifact.c     -> sf-artifact.o
                    src/dungeon.c      -> sf-dungeon.o
                    src/end.c          -> sf-end.o
                    src/engrave.c      -> sf-engrave.o
                    src/cfgfiles.c     -> sf-cfgfiles.o
                    src/files.c        -> sf-files.o
                    src/light.c        -> sf-light.o
                    src/mdlib.c        -> sf-mdlib.o
                    src/mkmaze.c       -> sf-mkmaze.o
                    src/mkroom.c       -> sf-mkroom.o
                    src/o_init.c       -> sf-o_init.o
                    src/region.c       -> sf-region.o
                    src/restore.c      -> sf-restore.o
                    src/rumors.c       -> sf-rumors.o
                    src/sys.c          -> sf-sys.o
                    src/timeout.c      -> sf-timeout.o
                    src/track.c        -> sf-track.o
                    src/version.c      -> sf-version.o
                    src/worm.c         -> sf-worm.o
                    src/strutil.c      -> strutil.o
This commit is contained in:
nhmall
2025-05-25 20:38:17 -04:00
parent 82fd29c429
commit a654d08c3b
49 changed files with 7578 additions and 257 deletions

View File

@@ -288,6 +288,11 @@ package: $(GAME) recover $(VARDAT) spec_levs
recover: $(GAME)
( cd util ; $(MAKE) $(RECOVERBIN) )
# sfctool can be configured by the sysadmin to convert the savefile
# content format as necessary.
sfctool: $(GAME)
( cd util ; $(MAKE) sfctool )
dofiles:
target=`sed -n \
-e '/librarian/{' \

View File

@@ -118,6 +118,12 @@ LIBS =
OBJDIR = ../src
# This is the universal ctags utility which produces the tags in the
# format that util/readtags requires.
# https://github.com/universal-ctags/ctags.git
#CTAGSCMD = universal-ctags
CTAGSCMD = ctags
# if you change this to 1, feedback while building will omit -Dthis -Wthat
# -Isomewhere so that each file being compiled is listed on one short line;
# it requires support for '$<' in rules with more than one prerequisite
@@ -288,6 +294,166 @@ recover.o: recover.c $(CONFIG_H)
recover-version.o: ../src/version.c $(HACK_H)
$(CC) $(CFLAGS) $(CSTD) -DMINIMAL_FOR_RECOVER -c ../src/version.c -o $@
#
# dependencies for optional sfctool
#
# object files for sfctool utility
SFCTOOLOBJS = $(TARGETPFX)sfctool.o $(TARGETPFX)sf-alloc.o \
$(TARGETPFX)sf-monst.o $(TARGETPFX)sf-objects.o \
$(TARGETPFX)sfbase.o $(TARGETPFX)sfstruct.o \
$(TARGETPFX)sfexpasc.o \
$(TARGETPFX)sfdata.o $(TARGETPFX)sf-nhlua.o \
$(TARGETPFX)panic.o $(TARGETPFX)sf-date.o \
$(TARGETPFX)sf-decl.o $(TARGETPFX)sf-artifact.o \
$(TARGETPFX)sf-dungeon.o $(TARGETPFX)sf-end.o \
$(TARGETPFX)sf-engrave.o $(TARGETPFX)sf-cfgfiles.o \
$(TARGETPFX)sf-files.o $(TARGETPFX)sf-light.o \
$(TARGETPFX)sf-mdlib.o $(TARGETPFX)sf-mkmaze.o \
$(TARGETPFX)sf-mkroom.o $(TARGETPFX)sf-o_init.o \
$(TARGETPFX)sf-region.o $(TARGETPFX)sf-restore.o \
$(TARGETPFX)sf-rumors.o $(TARGETPFX)sf-sys.o \
$(TARGETPFX)sf-timeout.o $(TARGETPFX)sf-track.o \
$(TARGETPFX)sf-version.o $(TARGETPFX)sf-worm.o \
$(TARGETPFX)strutil.o
SFCTOOLBIN = sfctool
SFFLAGS=-DSFCTOOL -DNOPANICTRACE -DNOCRASHREPORT -DNO_CHRONICLE
sfutil: $(SFCTOOLBIN)
@echo '$(SFCTOOLBIN) is up to date.'
$(SFCTOOLBIN): $(SFCTOOLOBJS) $(HACKLIB)
$(TARGET_CLINK) $(TARGET_LFLAGS) -o $@ $(SFCTOOLOBJS) $(HACKLIB) $(TARGET_LIBS)
$(TARGETPFX)sfctool.o: sfctool.c $(HACK_H) ../include/sfprocs.h
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c sfctool.c
$(TARGETPFX)sfdata.o: sfdata.c $(HACK_H) ../include/sfprocs.h ../include/sfproto.h
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c sfdata.c
$(TARGETPFX)sfexpasc.o: sfexpasc.c $(HACK_H) ../include/sfprocs.h ../include/sfproto.h
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c sfexpasc.c
$(TARGETPFX)sf-alloc.o: ../src/alloc.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/alloc.c
$(TARGETPFX)sf-date.o: ../src/date.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/date.c
$(TARGETPFX)sf-decl.o: ../src/decl.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/decl.c
$(TARGETPFX)sf-panic.o: panic.c $(CONFIG_H)
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c panic.c
$(TARGETPFX)sf-monst.o: ../src/monst.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/monst.c
$(TARGETPFX)sf-objects.o: ../src/objects.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/objects.c
$(TARGETPFX)sf-sfbase.o: ../src/sfbase.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/sfbase.c
$(TARGETPFX)sfstruct.o: ../src/sfstruct.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/sfstruct.c
$(TARGETPFX)sf-artifact.o: ../src/artifact.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/artifact.c
$(TARGETPFX)sf-dungeon.o: ../src/dungeon.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/dungeon.c
$(TARGETPFX)sf-end.o: ../src/end.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/end.c
$(TARGETPFX)sf-engrave.o: ../src/engrave.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/engrave.c
$(TARGETPFX)sf-cfgfiles.o: ../src/cfgfiles.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/cfgfiles.c
$(TARGETPFX)sf-files.o: ../src/files.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/files.c
$(TARGETPFX)sf-light.o: ../src/light.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/light.c
$(TARGETPFX)sf-mdlib.o: ../src/mdlib.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/mdlib.c
$(TARGETPFX)sf-mkmaze.o: ../src/mkmaze.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/mkmaze.c
$(TARGETPFX)sf-mkroom.o: ../src/mkroom.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/mkroom.c
$(TARGETPFX)sf-o_init.o: ../src/o_init.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/o_init.c
$(TARGETPFX)sf-region.o: ../src/region.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/region.c
$(TARGETPFX)sf-restore.o: ../src/restore.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/restore.c
$(TARGETPFX)sf-rumors.o: ../src/rumors.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/rumors.c
$(TARGETPFX)sf-sys.o: ../src/sys.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/sys.c
$(TARGETPFX)sf-timeout.o: ../src/timeout.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/timeout.c
$(TARGETPFX)sf-track.o: ../src/track.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/track.c
$(TARGETPFX)sf-version.o: ../src/version.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/version.c
$(TARGETPFX)sf-worm.o: ../src/worm.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/worm.c
$(TARGETPFX)sf-nhlua.o: ../src/nhlua.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/nhlua.c
$(TARGETPFX)sfbase.o: ../src/sfbase.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/sfbase.c
$(TARGETPFX)strutil.o: ../src/strutil.c
$(TARGET_CC) $(TARGET_CFLAGS) $(SFFLAGS) -o $@ -c ../src/strutil.c
sftags: sftags.o
$(CLINK) $(LFLAGS) -o $@ sftags.o $(LIBS)
sftags.o: sftags.c $(HACK_H)
$(CC) $(CFLAGS) -c sftags.c
../include/sfproto.h: sf.tags sftags
./sftags
sfdata.c: sf.tags sftags
./sftags
# dependencies for sftags
# #
CTAGDEP = ../include/align.h ../include/artifact.h ../include/artilist.h \
../include/attrib.h ../include/context.h ../include/coord.h \
../include/decl.h ../include/dungeon.h ../include/engrave.h \
../include/flag.h ../include/func_tab.h ../include/global.h \
../include/hack.h ../include/mextra.h \
../include/mkroom.h ../include/monst.h ../include/defsym.h \
../include/obj.h ../include/objclass.h ../include/prop.h \
../include/quest.h ../include/rect.h ../include/region.h \
../include/rm.h ../include/skills.h ../include/spell.h \
../include/sys.h ../include/timeout.h ../include/trap.h \
../include/you.h ../include/onames.h ../include/wintype.h
# ../include/permonst.h
CTAGSOPT = --language-force=c --sort=no -D"Bitfield(x,n)=unsigned x : n" --excmd=pattern
#
INCL=../include/
SRC=../src/
sf.tags: $(CTAGDEP)
$(CTAGSCMD) $(CTAGSOPT) -f $@ $(INCL)align.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)artifact.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(SRC)artifact.c
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)artilist.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)attrib.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(SRC)bones.c
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)context.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)coord.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)decl.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(SRC)decl.c
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)dungeon.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)engrave.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(SRC)engrave.c
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)flag.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)func_tab.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)global.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)hack.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)mextra.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)mkroom.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)monst.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)defsym.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)obj.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)objclass.h
# $(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)permonst.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)prop.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)quest.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)rect.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)region.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)rm.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)skills.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)spell.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)stairs.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)sys.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)timeout.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)trap.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)you.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)onames.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)wintype.h
# dependencies for dlb
#

View File

@@ -49,6 +49,7 @@ dospkg: dodata dosfonts $(GAMEBIN) $(TARGETPFX)recover.exe ../dat/nhtiles.bmp
mkdir -p $(TARGETPFX)pkg
cp $(GAMEBIN) $(TARGETPFX)pkg/NETHACK.EXE
cp $(TARGETPFX)recover.exe $(TARGETPFX)pkg/RECOVER.EXE
-cp $(SFCTOOLBIN) $(TARGETPFX)pkg/SFCTOOL.EXE
cp ../dat/nhdat $(TARGETPFX)pkg/NHDAT
cp ../dat/license $(TARGETPFX)pkg/LICENSE
cp ../dat/nhtiles.bmp $(TARGETPFX)pkg/NHTILES.BMP

View File

@@ -228,6 +228,7 @@ override LUALIBS=
override TOPLUALIB=
override GAMEBIN = $(TARGETPFX)nethack.exe
override RECOVERBIN = $(TARGETPFX)recover.exe
override SFCTOOLBIN = $(TARGETPFX)sfctool.exe
override PACKAGE = dospkg
override PREGAME += mkdir -p $(TARGETDIR) ; make $(TARGETPFX)exceptn.o ;
override CLEANMORE += rm -f -r $(TARGETDIR) ; rm -f -r $(FONTTARGETS) ;

View File

@@ -866,15 +866,15 @@ COREOBJTTY = \
$(OTTY)quest.o $(OTTY)questpgr.o $(OTTY)read.o $(OTTY)rect.o \
$(OTTY)region.o $(OTTY)report.o $(OTTY)restore.o $(OTTY)rip.o \
$(OTTY)rnd.o $(OTTY)role.o $(OTTY)rumors.o $(OTTY)save.o \
$(OTTY)selvar.o $(OTTY)sfstruct.o $(OTTY)shk.o $(OTTY)shknam.o \
$(OTTY)sit.o $(OTTY)sounds.o $(OTTY)sp_lev.o $(OTTY)spell.o \
$(OTTY)stairs.o $(OTTY)steal.o $(OTTY)steed.o $(OTTY)strutil.o \
$(OTTY)symbols.o $(OTTY)sys.o $(OTTY)teleport.o $(OTTY)timeout.o \
$(OTTY)topten.o $(OTTY)track.o $(OTTY)trap.o $(OTTY)u_init.o \
$(OTTY)uhitm.o $(OTTY)utf8map.o $(OTTY)vault.o $(OTTY)vision.o \
$(OTTY)weapon.o $(OTTY)were.o $(OTTY)wield.o $(OTTY)windows.o \
$(OTTY)wizard.o $(OTTY)wizcmds.o $(OTTY)worm.o $(OTTY)worn.o \
$(OTTY)write.o $(OTTY)zap.o $(OTTY)sfbase.o
$(OTTY)selvar.o $(OTTY)sfbase.o $(OTTY)sfstruct.o $(OTTY)shk.o \
$(OTTY)shknam.o $(OTTY)sit.o $(OTTY)sounds.o $(OTTY)sp_lev.o \
$(OTTY)spell.o $(OTTY)stairs.o $(OTTY)steal.o $(OTTY)steed.o \
$(OTTY)strutil.o $(OTTY)symbols.o $(OTTY)sys.o $(OTTY)teleport.o \
$(OTTY)timeout.o $(OTTY)topten.o $(OTTY)track.o $(OTTY)trap.o \
$(OTTY)u_init.o $(OTTY)uhitm.o $(OTTY)utf8map.o $(OTTY)vault.o \
$(OTTY)vision.o $(OTTY)weapon.o $(OTTY)were.o $(OTTY)wield.o \
$(OTTY)windows.o $(OTTY)wizard.o $(OTTY)wizcmds.o $(OTTY)worm.o \
$(OTTY)worn.o $(OTTY)write.o $(OTTY)zap.o
OBJSTTY = $(MDLIBTTY) $(COREOBJTTY) $(REGEXTTY) $(RANDOMTTY)
@@ -929,15 +929,15 @@ COREOBJGUI = \
$(OGUI)quest.o $(OGUI)questpgr.o $(OGUI)read.o $(OGUI)rect.o \
$(OGUI)region.o $(OGUI)report.o $(OGUI)restore.o $(OGUI)rip.o \
$(OGUI)rnd.o $(OGUI)role.o $(OGUI)rumors.o $(OGUI)save.o \
$(OGUI)selvar.o $(OGUI)sfstruct.o $(OGUI)shk.o $(OGUI)shknam.o \
$(OGUI)sit.o $(OGUI)sounds.o $(OGUI)sp_lev.o $(OGUI)spell.o \
$(OGUI)stairs.o $(OGUI)steal.o $(OGUI)steed.o $(OGUI)strutil.o \
$(OGUI)symbols.o $(OGUI)sys.o $(OGUI)teleport.o $(OGUI)timeout.o \
$(OGUI)topten.o $(OGUI)track.o $(OGUI)trap.o $(OGUI)u_init.o \
$(OGUI)uhitm.o $(OGUI)utf8map.o $(OGUI)vault.o $(OGUI)vision.o \
$(OGUI)weapon.o $(OGUI)were.o $(OGUI)wield.o $(OGUI)windows.o \
$(OGUI)wizard.o $(OGUI)wizcmds.o $(OGUI)worm.o $(OGUI)worn.o \
$(OGUI)write.o $(OGUI)zap.o $(OGUI)sfbase.o
$(OGUI)selvar.o $(OGUI)sfbase.o $(OGUI)sfstruct.o $(OGUI)shk.o \
$(OGUI)shknam.o $(OGUI)sit.o $(OGUI)sounds.o $(OGUI)sp_lev.o \
$(OGUI)spell.o $(OGUI)stairs.o $(OGUI)steal.o $(OGUI)steed.o \
$(OGUI)strutil.o $(OGUI)symbols.o $(OGUI)sys.o $(OGUI)teleport.o \
$(OGUI)timeout.o $(OGUI)topten.o $(OGUI)track.o $(OGUI)trap.o \
$(OGUI)u_init.o $(OGUI)uhitm.o $(OGUI)utf8map.o $(OGUI)vault.o \
$(OGUI)vision.o $(OGUI)weapon.o $(OGUI)were.o $(OGUI)wield.o \
$(OGUI)windows.o $(OGUI)wizard.o $(OGUI)wizcmds.o $(OGUI)worm.o \
$(OGUI)worn.o $(OGUI)write.o $(OGUI)zap.o
OBJSGUI = $(MDLIBGUI) $(COREOBJGUI) $(REGEXGUI) $(RANDOMGUI)
@@ -1155,7 +1155,7 @@ R_CTAGSDIR=$(LIBDIR)ctags
CTAGSDIR=$(R_CTAGSDIR)$(BACKSLASH)
#U_CTAGSDIR=$(CTAGSDIR:\=/)
!ELSE
R_CTAGSDIR=..\..\..\ctags
R_CTAGSDIR=..\lib\ctags
CTAGSDIR=$(R_CTAGSDIR)$(BACKSLASH)
#U_CTAGSDIR=$(CTAGSDIR:\=/)
!ENDIF
@@ -1724,6 +1724,7 @@ binary.tag: $(DAT)data $(DAT)rumors $(DAT)oracles $(DLB) \
if exist $(DAT)symbols copy $(DAT)symbols $(GAMEDIR)symbols
if exist $(DOC)guidebook.txt copy $(DOC)guidebook.txt $(GAMEDIR)Guidebook.txt
if exist $(DOC)nethack.txt copy $(DOC)nethack.txt $(GAMEDIR)NetHack.txt
# if exist $(UTIL)sfctool.pdb copy $(UTIL)sfctool.pdb $(GAMEDIR)sfctool.pdb
@if exist $(GAMEDIR)NetHack.PDB echo NOTE: You may want to remove $(U_GAMEDIR)/NetHack.PDB to conserve space
@if exist $(GAMEDIR)NetHackW.PDB echo NOTE: You may want to remove $(U_GAMEDIR)/NetHackW.PDB to conserve space
-if exist $(MSWSYS)nethackrc.template copy $(MSWSYS)nethackrc.template $(R_GAMEDIR)
@@ -2471,6 +2472,174 @@ $(DAT)epitaph: $(U)makedefs.exe $(DAT)epitaph.txt
$(DAT)bogusmon: $(U)makedefs.exe $(DAT)bogusmon.txt
$(U)makedefs -3
# This is the universal ctags utility which produces the tags in the
# format that util/readtags requires.
# https://github.com/universal-ctags/ctags.git
#===============================================================================
# sfutil
#===============================================================================
SFCTOOLOBJS = $(OUTL)sfctool.o $(OUTL)sf-alloc.o \
$(OUTL)sf-monst.o $(OUTL)sf-objects.o \
$(OUTL)sfbase.o $(OUTL)sf-struct.o \
$(OUTL)sfexpasc.o \
$(OUTL)sfdata.o $(OUTL)sf-nhlua.o \
$(OUTL)panic.o $(OUTL)sf-date.o $(OUTL)sf-decl.o \
$(OUTL)sf-artifact.o $(OUTL)sf-cfgfiles.o \
$(OUTL)sf-dungeon.o $(OUTL)sf-end.o \
$(OUTL)sf-engrave.o $(OUTL)sf-files.o $(OUTL)sf-light.o \
$(OUTL)sf-mdlib.o $(OUTL)sf-mkmaze.o $(OUTL)sf-mkroom.o \
$(OUTL)sf-o_init.o $(OUTL)sf-region.o \
$(OUTL)sf-restore.o $(OUTL)sf-rumors.o \
$(OUTL)sf-sys.o $(OUTL)sf-timeout.o $(OUTL)sf-track.o \
$(OUTL)sf-version.o $(OUTL)sf-worm.o \
$(OUTL)strutil.o $(OUTL)sf-windsys.o
SFCTOOLBIN = $(BinDir)sfctool.exe
SFFLAGS = -DSFCTOOL -DNOPANICTRACE -DNOCRASHREPORT -DNO_CHRONICLE
#CTAGSCMD = $(LIB)\ctags\ctags.exe
#
# dependencies for optional sfctool
#
# $(Q)$(CC) $(CFLAGS) -Fo$@ monst.c
#$(UTIL)sfutil.exe: $(SFCTOOLBIN)
#$(UTIL)sfctool.exe: $(SFCTOOLBIN)
$(SFCTOOLBIN): $(OUTLHACKLIB) $(SFCTOOLOBJS)
$(link) $(lflags) -out:$@ /PDB:$(BinDir)$(@B).PDB $(SFCTOOLOBJS) \
$(LIBS) ole32.lib Shell32.lib userenv.lib advapi32.lib $(OUTLHACKLIB)
@echo '$(SFCTOOLBIN) is up to date.'
$(OUTL)sfctool.o: $(UTIL)sfctool.c $(HACK_H) $(INCL)sfprocs.h
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(UTIL)sfctool.c
$(OUTL)sfdata.o: $(UTIL)sfdata.c $(HACK_H) $(INCL)sfprocs.h $(INCL)sfproto.h
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(UTIL)sfdata.c
$(OUTL)sfexpasc.o: $(UTIL)sfexpasc.c $(HACK_H) $(INCL)sfprocs.h $(INCL)sfproto.h
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(UTIL)sfexpasc.c
$(OUTL)sf-alloc.o: $(SRC)alloc.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)alloc.c
$(OUTL)sf-date.o: $(SRC)date.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)date.c
$(OUTL)sf-decl.o: $(SRC)decl.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)decl.c
$(OUTL)sf-monst.o: $(SRC)monst.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)monst.c
$(OUTL)sf-objects.o: $(SRC)objects.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)objects.c
$(OUTL)sfbase.o: $(SRC)sfbase.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)sfbase.c
$(OUTL)sf-struct.o: $(SRC)sfstruct.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)sfstruct.c
$(OUTL)sf-artifact.o: $(SRC)artifact.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)artifact.c
$(OUTL)sf-cfgfiles.o: $(SRC)cfgfiles.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)cfgfiles.c
$(OUTL)sf-dungeon.o: $(SRC)dungeon.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)dungeon.c
$(OUTL)sf-end.o: $(SRC)end.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)end.c
$(OUTL)sf-engrave.o: $(SRC)engrave.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)engrave.c
$(OUTL)sf-files.o: $(SRC)files.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)files.c
$(OUTL)sf-light.o: $(SRC)light.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)light.c
$(OUTL)sf-mdlib.o: $(SRC)mdlib.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)mdlib.c
$(OUTL)sf-mkmaze.o: $(SRC)mkmaze.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)mkmaze.c
$(OUTL)sf-mkroom.o: $(SRC)mkroom.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)mkroom.c
$(OUTL)sf-o_init.o: $(SRC)o_init.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)o_init.c
$(OUTL)sf-region.o: $(SRC)region.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)region.c
$(OUTL)sf-restore.o: $(SRC)restore.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)restore.c
$(OUTL)sf-rumors.o: $(SRC)\rumors.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)rumors.c
$(OUTL)sf-timeout.o: $(SRC)timeout.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)timeout.c
$(OUTL)sf-version.o: $(SRC)version.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)version.c
$(OUTL)sf-worm.o: $(SRC)worm.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)worm.c
$(OUTL)sf-nhlua.o: $(SRC)nhlua.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)nhlua.c
$(OUTL)sf-track.o: $(SRC)track.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)track.c
$(OUTL)sf-sys.o: $(SRC)sys.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(SRC)sys.c
$(OUTL)sf-windsys.o: $(MSWSYS)windsys.c
$(Q)$(CC) $(CFLAGS) $(SFFLAGS) -Fo$@ -c $(MSWSYS)windsys.c
$(UTIL)sftags.exe: $(OUTL)sftags.o
$(link) $(LFLAGS) /OUT:$@ $(OUTL)sftags.o
$(OUTL)sftags.o: $(UTIL)sftags.c $(HACK_H)
$(Q)$(CC) $(CFLAGS) -Fo$@ -c $(UTIL)sftags.c
$(INCL)sfproto.h: $(UTIL)sftags.exe $(UTIL)sf.tags
$(UTIL)sftags.exe
$(UTIL)sfdata.c: $(UTIL)sftags.exe $(UTIL)sf.tags
$(UTIL)sftags.exe
# dependencies for sftags
# #
CTAGDEP = $(INCL)align.h $(INCL)artifact.h $(INCL)artilist.h \
$(INCL)attrib.h $(INCL)context.h $(INCL)coord.h \
$(INCL)decl.h $(INCL)dungeon.h $(INCL)engrave.h \
$(INCL)flag.h $(INCL)func_tab.h $(INCL)global.h \
$(INCL)hack.h $(INCL)mextra.h \
$(INCL)mkroom.h $(INCL)monst.h \
$(INCL)obj.h $(INCL)objclass.h $(INCL)prop.h \
$(INCL)quest.h $(INCL)rect.h $(INCL)region.h \
$(INCL)rm.h $(INCL)skills.h $(INCL)spell.h \
$(INCL)stairs.h $(INCL)sys.h $(INCL)timeout.h \
$(INCL)trap.h $(INCL)you.h $(INCL)onames.h \
$(INCL)wintype.h
# $(INCL)permonst.h
CTAGSOPT = --language-force=c --sort=no -D"Bitfield(x,n)=unsigned x : n" --excmd=pattern
#
$(UTIL)sf.tags: $(CTAGDEP)
$(CTAGSCMD) $(CTAGSOPT) -f $@ $(INCL)align.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)artifact.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(SRC)artifact.c
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)artilist.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)attrib.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(SRC)bones.c
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)context.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)coord.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)decl.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(SRC)decl.c
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)dungeon.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)engrave.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(SRC)engrave.c
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)flag.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)func_tab.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)global.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)hack.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)mextra.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)mkroom.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)monst.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)defsym.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)obj.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)objclass.h
# $(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)permonst.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)prop.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)quest.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)rect.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)region.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)rm.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)skills.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)spell.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)stairs.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)sys.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)timeout.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)trap.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)you.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)onames.h
$(CTAGSCMD) $(CTAGSOPT) -a -f $@ $(INCL)wintype.h
#===============================================================================
# Integrated sound files
#===============================================================================
@@ -2541,13 +2710,15 @@ $(SndWavDir)sa2_xplevelup.wav: $(SndWavDir)sa2_xplevelup.uu $(U)uudecode.exe
#===============================================================================
PKGFILES = nethackrc.template Guidebook.txt license NetHack.exe NetHack.txt \
NetHackW.exe opthelp nhdat370 record symbols sysconf.template
NetHackW.exe opthelp nhdat370 record symbols sysconf.template \
sfctool.exe
FILESTOZIP = $(BinDir)nethackrc.template $(BinDir)Guidebook.txt $(BinDir)license \
$(BinDir)NetHack.exe $(BinDir)NetHack.txt $(BinDir)NetHackW.exe \
$(BinDir)opthelp $(BinDir)nhdat370 $(BinDir)record \
$(BinDir)symbols $(BinDir)sysconf.template
DBGSYMS = NetHack.PDB NetHackW.PDB
PDBTOZIP = $(BinDir)NetHack.PDB $(BinDir)NetHackW.PDB
$(BinDir)symbols $(BinDir)sysconf.template $(BinDir)sfctool.exe
DBGSYMS = NetHack.PDB NetHackW.PDB sfctool.PDB
PDBTOZIP = $(BinDir)NetHack.PDB $(BinDir)NetHackW.PDB $(BinDir)sfctool.PDB
MAINZIP = $(PkgDir)nethack-$(NHV)-win-$(TARGET_CPU).zip
DBGSYMZIP = $(PkgDir)nethack-$(NHV)-win-$(TARGET_CPU)-debugsymbols.zip
@@ -2568,7 +2739,7 @@ binary: envchk.tag libdir.tag ottydir$(TARGET_CPU).tag \
$(INCL)nhlua.h $(OUTL)utility.tag \
$(DAT)data $(DAT)rumors $(DAT)oracles $(DAT)engrave \
$(DAT)epitaph $(DAT)bogusmon $(GAMEDIR)NetHack.exe \
$(GAMEDIR)NetHackW.exe $(GAMEDIRDLLS) binary.tag
$(GAMEDIR)NetHackW.exe $(GAMEDIR)sfctool.exe $(GAMEDIRDLLS) binary.tag
@echo NetHack is up to date.
#===============================================================================

View File

@@ -317,4 +317,4 @@
<Target Name="AfterRebuild">
<MSBuild Projects="afternethack.proj" Targets="Build" Properties="Configuration=$(Configuration)" />
</Target>
</Project>
</Project>

View File

@@ -379,4 +379,4 @@
<Target Name="AfterRebuild">
<MSBuild Projects="$(vsDir)NetHack\afternethack.proj" Targets="Build" Properties="Configuration=$(Configuration)" />
</Target>
</Project>
</Project>

View File

@@ -29,6 +29,8 @@
<WinCursDir>$(RootDir)win\curses\</WinCursDir>
<SubmodulesDir>$(RootDir)submodules\</SubmodulesDir>
<LuaDir>$(LibDir)lua-$(LUA_VERSION)\src\</LuaDir>
<SftagsDir>$(RootDir)\sys\windows\vs\sftags\</SftagsDir>
<SfctoolDir>$(RootDir)\sys\windows\vs\sfctool\</SfctoolDir>
</PropertyGroup>
<PropertyGroup Condition="'$(PDCURSESMOD)'=='' AND Exists('$(LibDir)pdcursesmod\curses.h')">
<PDCURSESMOD>$(LibDir)pdcursesmod\</PDCURSESMOD>

View File

@@ -0,0 +1,49 @@
# NetHack 3.7 fetchctags.nmake
#==============================================================================
#
# The version of the game this Makefile was designed for
NETHACK_VERSION="3.7.0"
# A brief version for use in macros
NHV=$(NETHACK_VERSION:.=)
NHV=$(NHV:"=)
# The location of the ctags that we want
CTAGS_VERSION=6.1.0
CURLCTAGSSRC=https://github.com/universal-ctags/ctags-win32/releases/download/v$(CTAGS_VERSION)/ctags-v$(CTAGS_VERSION)-x64.zip
CURLCTAGSDST=ctags-v$(CTAGS_VERSION)-x64.zip
#
# relative directories from root of NetHack tree.
#
ROOTDIR=..\..\..\.. # root of NetHack tree relative to project file
LIBDIR=$(ROOTDIR)\lib
CTAGSDIR=$(LIBDIR)\ctags
default: fetchall
fetchall: fetch-ctags
fetch-ctags: $(CTAGSDIR)
cd $(LIBDIR)
curl --insecure -L -R -O $(CURLCTAGSSRC)
# cd ctags
tar zxf $(CURLCTAGSDST) -C ctags
cd ..\sys\windows\vs\fetchctags
@echo ctags.exe has been fetched into $(LIBDIR)\ctags
$(CTAGSDIR): $(LIBDIR)
@if not exist $(CTAGSDIR)\*.* echo creating directory $(CTAGSDIR:\=/)
@if not exist $(CTAGSDIR)\*.* mkdir $(CTAGSDIR)
$(LIBDIR):
@if not exist $(LIBDIR)\*.* echo creating directory $(LIBDIR:\=/)
@if not exist $(LIBDIR)\*.* mkdir $(LIBDIR)
rebuild:
@if exist $(CTAGSDIR)\ctags.exe echo nothing to do for $(CTAGSDIR)\ctags.exe
clean:
if exist $(CURLCTAGSDST) del $(CURLCTAGSDST)

View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<Import Project="..\config.props" />
<Import Project="..\dirs.props" />
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<ProjectGuid>{AAE63AD3-8185-4E19-B6A3-13F4CB891AAD}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="Exists('$(LibDir)ctags') AND Exists('$(LibDir)ctags\ctags.exe')">
<NMakeBuildCommandLine>echo ..\lib\ctags is already present</NMakeBuildCommandLine>
<NMakeCleanCommandLine>pushd $(vsDir)fetchctags %26%26 nmake -F fetchctags.nmake clean %26%26 popd</NMakeCleanCommandLine>
<NMakeReBuildCommandLine>echo rebuilding $(vsDir)fetchctags </NMakeReBuildCommandLine>
<NMakePreprocessorDefinitions>_DEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
</PropertyGroup>
<PropertyGroup Condition="!Exists('$(LibDir)ctags\ctags.exe')">
<NMakeBuildCommandLine>pushd $(vsDir)fetchctags %26%26 nmake -F fetchctags.nmake %26%26 popd</NMakeBuildCommandLine>
<NMakeCleanCommandLine>pushd $(vsDir)fetchctags %26%26 nmake -F fetchctags.nmake clean %26%26 popd</NMakeCleanCommandLine>
<NMakeReBuildCommandLine>pushd $(vsDir)fetchprereq %26%26 nmake -F fetchctags.nmake rebuild %26%26 popd</NMakeReBuildCommandLine>
<NMakePreprocessorDefinitions>_DEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,58 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.13.35913.81
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sfctool", "sfctool\sfctool.vcxproj", "{3BFA3C14-6DA2-4750-B1C6-028B9BCE825E}"
ProjectSection(ProjectDependencies) = postProject
{628C594A-7565-4366-9FCA-41DB67C6B615} = {628C594A-7565-4366-9FCA-41DB67C6B615}
{AAE63AD3-8185-4E19-B6A3-13F4CB891AAD} = {AAE63AD3-8185-4E19-B6A3-13F4CB891AAD}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sftags", "sftags\sftags.vcxproj", "{628C594A-7565-4366-9FCA-41DB67C6B615}"
ProjectSection(ProjectDependencies) = postProject
{AAE63AD3-8185-4E19-B6A3-13F4CB891AAD} = {AAE63AD3-8185-4E19-B6A3-13F4CB891AAD}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fetchctags", "fetchctags\fetchctags.vcxproj", "{AAE63AD3-8185-4E19-B6A3-13F4CB891AAD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3BFA3C14-6DA2-4750-B1C6-028B9BCE825E}.Debug|x64.ActiveCfg = Debug|x64
{3BFA3C14-6DA2-4750-B1C6-028B9BCE825E}.Debug|x64.Build.0 = Debug|x64
{3BFA3C14-6DA2-4750-B1C6-028B9BCE825E}.Debug|x86.ActiveCfg = Debug|Win32
{3BFA3C14-6DA2-4750-B1C6-028B9BCE825E}.Debug|x86.Build.0 = Debug|Win32
{3BFA3C14-6DA2-4750-B1C6-028B9BCE825E}.Release|x64.ActiveCfg = Release|x64
{3BFA3C14-6DA2-4750-B1C6-028B9BCE825E}.Release|x64.Build.0 = Release|x64
{3BFA3C14-6DA2-4750-B1C6-028B9BCE825E}.Release|x86.ActiveCfg = Release|Win32
{3BFA3C14-6DA2-4750-B1C6-028B9BCE825E}.Release|x86.Build.0 = Release|Win32
{628C594A-7565-4366-9FCA-41DB67C6B615}.Debug|x64.ActiveCfg = Debug|x64
{628C594A-7565-4366-9FCA-41DB67C6B615}.Debug|x64.Build.0 = Debug|x64
{628C594A-7565-4366-9FCA-41DB67C6B615}.Debug|x86.ActiveCfg = Debug|Win32
{628C594A-7565-4366-9FCA-41DB67C6B615}.Debug|x86.Build.0 = Debug|Win32
{628C594A-7565-4366-9FCA-41DB67C6B615}.Release|x64.ActiveCfg = Release|x64
{628C594A-7565-4366-9FCA-41DB67C6B615}.Release|x64.Build.0 = Release|x64
{628C594A-7565-4366-9FCA-41DB67C6B615}.Release|x86.ActiveCfg = Release|Win32
{628C594A-7565-4366-9FCA-41DB67C6B615}.Release|x86.Build.0 = Release|Win32
{AAE63AD3-8185-4E19-B6A3-13F4CB891AAD}.Debug|x64.ActiveCfg = Debug|x64
{AAE63AD3-8185-4E19-B6A3-13F4CB891AAD}.Debug|x64.Build.0 = Debug|x64
{AAE63AD3-8185-4E19-B6A3-13F4CB891AAD}.Debug|x86.ActiveCfg = Debug|Win32
{AAE63AD3-8185-4E19-B6A3-13F4CB891AAD}.Debug|x86.Build.0 = Debug|Win32
{AAE63AD3-8185-4E19-B6A3-13F4CB891AAD}.Release|x64.ActiveCfg = Release|x64
{AAE63AD3-8185-4E19-B6A3-13F4CB891AAD}.Release|x64.Build.0 = Release|x64
{AAE63AD3-8185-4E19-B6A3-13F4CB891AAD}.Release|x86.ActiveCfg = Release|Win32
{AAE63AD3-8185-4E19-B6A3-13F4CB891AAD}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1000CD98-D3C0-493F-9EA7-E2D81FA96432}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,193 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\config.props" />
<Import Project="..\dirs.props" />
<Import Project="..\default.props" />
<Import Project="..\NetHackProperties.props" />
<Import Project="..\console.props" />
<Import Project="..\common.props" />
<Import Project="..\files.props" />
<PropertyGroup>
<OutDir>$(BinDir)</OutDir>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="$(SrcDir)alloc.c" />
<ClCompile Include="$(SrcDir)artifact.c" />
<ClCompile Include="$(SrcDir)cfgfiles.c" />
<ClCompile Include="$(SrcDir)decl.c" />
<ClCompile Include="$(SrcDir)dungeon.c" />
<ClCompile Include="$(SrcDir)end.c" />
<ClCompile Include="$(SrcDir)engrave.c" />
<ClCompile Include="$(SrcDir)files.c" />
<ClCompile Include="$(SrcDir)light.c" />
<ClCompile Include="$(SrcDir)mkmaze.c" />
<ClCompile Include="$(SrcDir)mkroom.c" />
<ClCompile Include="$(SrcDir)monst.c" />
<ClCompile Include="$(SrcDir)nhlua.c" />
<ClCompile Include="$(SrcDir)objects.c" />
<ClCompile Include="$(SrcDir)o_init.c" />
<ClCompile Include="$(SrcDir)region.c" />
<ClCompile Include="$(SrcDir)restore.c" />
<ClCompile Include="$(SrcDir)rumors.c" />
<ClCompile Include="$(SrcDir)sfbase.c" />
<ClCompile Include="$(SrcDir)sfstruct.c" />
<ClCompile Include="$(SrcDir)strutil.c" />
<ClCompile Include="$(SrcDir)timeout.c" />
<ClCompile Include="$(SrcDir)track.c" />
<ClCompile Include="$(SrcDir)version.c" />
<ClCompile Include="$(SrcDir)worm.c" />
<ClCompile Include="$(SrcDir)sys.c" />
<ClCompile Include="$(SrcDir)date.c" />
<ClCompile Include="$(SrcDir)mdlib.c" />
<ClCompile Include="$(UtilDir)panic.c" />
<ClCompile Include="$(UtilDir)sfctool.c" />
<ClCompile Include="$(UtilDir)sfexpasc.c" />
<ClCompile Include="$(UtilDir)sfdata.c" />
<ClCompile Include="$(SysWindDir)windsys.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(IncDir)extern.h" />
<ClInclude Include="$(IncDir)sfprocs.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{3bfa3c14-6da2-4750-b1c6-028b9bce825e}</ProjectGuid>
<RootNamespace>sfctool</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(WinWin32Dir);$(IncDir);$(SysWindDir);$(SysShareDir);$(WinShareDir);$(LuaDir);$(UtilDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WIN32CON;NO_TILE_C;DLB;SAFEPROCS;SND_LIB_WINDSOUND;USER_SOUNDS;_LIB;HAS_STDINT_H;SFCTOOL;NOPANICTRACE;NOCRASHREPORT;NO_CHRONICLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(ToolsDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>hacklib.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(WinWin32Dir);$(IncDir);$(SysWindDir);$(SysShareDir);$(WinShareDir);$(LuaDir);$(UtilDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_NDEBUG;_CONSOLE;WIN32CON;NO_TILE_C;DLB;SAFEPROCS;SND_LIB_WINDSOUND;USER_SOUNDS;_LIB;HAS_STDINT_H;SFCTOOL;NOPANICTRACE;NOCRASHREPORT;NO_CHRONICLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(ToolsDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>hacklib.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(WinWin32Dir);$(IncDir);$(SysWindDir);$(SysShareDir);$(WinShareDir);$(LuaDir);$(UtilDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WIN32CON;NO_TILE_C;DLB;SAFEPROCS;SND_LIB_WINDSOUND;USER_SOUNDS;_LIB;HAS_STDINT_H;SFCTOOL;NOPANICTRACE;NOCRASHREPORT;NO_CHRONICLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(ToolsDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>hacklib.lib;userenv.lib;advapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(WinWin32Dir);$(IncDir);$(SysWindDir);$(SysShareDir);$(WinShareDir);$(LuaDir);$(UtilDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_NDEBUG;_CONSOLE;WIN32CON;NO_TILE_C;DLB;SAFEPROCS;SND_LIB_WINDSOUND;USER_SOUNDS;_LIB;HAS_STDINT_H;SFCTOOL;NOPANICTRACE;NOCRASHREPORT;NO_CHRONICLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(ToolsDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>hacklib.lib;userenv.lib;advapi32.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,48 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\dirs.props"/>
<Import Project="$(vsDir)files.props"/>
<Target Name="Build" Outputs="$(IncDir)sfdata.c;$(SrcDir)sfdata.c">
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -f sf.tags $(IncDir)align.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)artifact.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(SRC)artifact.c" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)artilist.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)attrib.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(SRC)bones.c" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)context.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)coord.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)decl.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(SRC)decl.c" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)dungeon.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)engrave.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(SRC)engrave.c" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)flag.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)func_tab.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)global.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)hack.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)mextra.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)mkroom.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)monst.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)defsym.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)obj.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)objclass.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)prop.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)quest.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)rect.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)region.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)rm.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)skills.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)spell.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)stairs.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)sys.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)timeout.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)trap.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)you.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)onames.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="..\lib\ctags\ctags --language-force=c --sort=no -D&quot;Bitfield(x,n)=unsigned x : n&quot; --excmd=pattern -a -f sf.tags $(IncDir)wintype.h" WorkingDirectory="$(UtilDir)"/>
<Exec Command="$(ToolsDir)sftags.exe" WorkingDirectory="$(UtilDir)"/>
</Target>
<Target Name="Clean">
<Delete Files="$(UtilDir)sf.tags"/>
</Target>
</Project>

View File

@@ -0,0 +1,156 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\config.props" />
<Import Project="..\dirs.props" />
<Import Project="..\default.props" />
<Import Project="..\NetHackProperties.props" />
<Import Project="..\console.props" />
<Import Project="..\common.props" />
<Import Project="..\files.props" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="$(UtilDir)sftags.c" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{628c594a-7565-4366-9fca-41db67c6b615}</ProjectGuid>
<RootNamespace>sftags</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(WinWin32Dir);$(IncDir);$(SysWindDir);$(SysShareDir);$(WinShareDir);$(LuaDir);$(UtilDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WIN32CON;NO_TILE_C;DLB;SAFEPROCS;SND_LIB_WINDSOUND;USER_SOUNDS;_LIB;HAS_STDINT_H;SFCTOOL;NOPANICTRACE;NOCRASHREPORT;NO_CHRONICLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(WinWin32Dir);$(IncDir);$(SysWindDir);$(SysShareDir);$(WinShareDir);$(LuaDir);$(UtilDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WIN32CON;NO_TILE_C;DLB;SAFEPROCS;SND_LIB_WINDSOUND;USER_SOUNDS;_LIB;HAS_STDINT_H;SFCTOOL;NOPANICTRACE;NOCRASHREPORT;NO_CHRONICLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(WinWin32Dir);$(IncDir);$(SysWindDir);$(SysShareDir);$(WinShareDir);$(LuaDir);$(UtilDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WIN32CON;NO_TILE_C;DLB;SAFEPROCS;SND_LIB_WINDSOUND;USER_SOUNDS;_LIB;HAS_STDINT_H;SFCTOOL;NOPANICTRACE;NOCRASHREPORT;NO_CHRONICLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(WinWin32Dir);$(IncDir);$(SysWindDir);$(SysShareDir);$(WinShareDir);$(LuaDir);$(UtilDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WIN32CON;NO_TILE_C;DLB;SAFEPROCS;SND_LIB_WINDSOUND;USER_SOUNDS;_LIB;HAS_STDINT_H;SFCTOOL;NOPANICTRACE;NOCRASHREPORT;NO_CHRONICLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<Target Name="AfterBuild">
<MSBuild Projects="aftersftags.proj" Targets="Build" Properties="Configuration=$(Configuration)" />
</Target>
<Target Name="AfterClean">
<MSBuild Projects="aftersftags.proj" Targets="Clean" Properties="Configuration=$(Configuration)" />
</Target>
<Target Name="AfterRebuild">
<MSBuild Projects="aftersftags.proj" Targets="Build" Properties="Configuration=$(Configuration)" />
</Target>
</Project>

View File

@@ -44,6 +44,10 @@
static char portable_device_path[MAX_PATH];
static boolean path_buffer_set = FALSE;
static char path_buffer[MAX_PATH];
#ifndef SFCTOOL
/* runtime cursor display control switch */
boolean win32_cursorblink;
@@ -53,6 +57,9 @@ WIN32_FIND_DATA ffd;
extern int GUILaunched;
extern boolean getreturn_enabled;
int redirect_stdout;
static char *get_executable_path(void);
#ifdef WIN32CON
typedef HWND(WINAPI *GETCONSOLEWINDOW)(void);
@@ -780,7 +787,9 @@ nt_assert_failed(const char *expression, const char *filepath, int line)
impossible("nhassert(%s) failed in file '%s' at line %d",
expression, filename, line);
}
#endif /* SFCTOOL */
/* used by util/sfctool.c as well as files.c */
boolean
get_user_home_folder(char *homebuf, size_t sz)
{
@@ -794,13 +803,12 @@ get_user_home_folder(char *homebuf, size_t sz)
result = GetUserProfileDirectoryA(hToken, szHomeDirBuf, &BufSize);
// Close handle opened via OpenProcessToken
CloseHandle(hToken);
if (result != 0) {
Snprintf(homebuf, sz, "%s", szHomeDirBuf);
}
return (result != 0);
}
static char *get_executable_path(void);
static boolean path_buffer_set = FALSE;
static char path_buffer[MAX_PATH];
char *
get_executable_path(void)
@@ -1019,6 +1027,7 @@ set_default_prefix_locations(const char *programPath UNUSED)
strcpy(executable_path, get_executable_path());
append_slash(executable_path);
#ifndef SFCTOOL
if (test_portable_config(executable_path, portable_device_path,
sizeof portable_device_path)) {
gf.fqn_prefix[SYSCONFPREFIX] = executable_path;
@@ -1032,6 +1041,7 @@ set_default_prefix_locations(const char *programPath UNUSED)
gf.fqn_prefix[TROUBLEPREFIX] = portable_device_path;
gf.fqn_prefix[DATAPREFIX] = executable_path;
} else {
#endif /* SFCTOOL */
if (!build_known_folder_path(&FOLDERID_Profile, profile_path,
sizeof(profile_path), FALSE))
strcpy(profile_path, executable_path);
@@ -1061,7 +1071,9 @@ set_default_prefix_locations(const char *programPath UNUSED)
gf.fqn_prefix[LOCKPREFIX] = versioned_global_data_path;
gf.fqn_prefix[TROUBLEPREFIX] = versioned_profile_path;
gf.fqn_prefix[DATAPREFIX] = executable_path;
#ifndef SFCTOOL
}
#endif /* SFCTOOL */
}
/*
@@ -1138,6 +1150,7 @@ get_portable_device(void)
return (const char *) portable_device_path;
}
#ifndef SFCTOOL
/* Windows helpers for CRASHREPORT etc */
#ifdef CRASHREPORT
struct CRctxt {
@@ -1429,6 +1442,7 @@ win32_cr_shellexecute(const char *url){
return rv;
}
#endif /* CRASHREPORT */
#endif /* SFCTOOL */
#endif /* WIN32 */