Commit Graph

779 Commits

Author SHA1 Message Date
PatR
23a671147f tiles-related build stuff
* Add missing entry for include/tile.h to (top)/Files; also
  add new entry for generated file util/tiletxt.c (Unix only);
* Add several missing entries for tile utility programs that
  can be built by sys/unix/Makefile.utl to util/.gitignore;
* Update sys/unix/Makefile.utl to build 'tilemap' differently so
  that it won't leave behind an unwanted subdirectory tree under OSX:
    util/tilemap.dSYM/
    util/tilemap.dSYM/Contents/
    util/tilemap.dSYM/Contents/Info.plist
    util/tilemap.dSYM/Contents/Resources/
    util/tilemap.dSYM/Contents/Resources/DWARF/
    util/tilemap.dSYM/Contents/Resources/DWARF/tilemap
  It now generates util/tiletxt.c on the fly, to be compiled into
  tiletxt.o, so that tilemap.c can be compiled in the ordinary
  manner and tilemap.o can be kept around for dependency checking.
  (Creating real source file win/share/tiletxt.c would be a little
  bit cleaner, but it's effectively two lines long so seems silly
  to be in the source distribution.)  I looked to see whether I
  could find a linker or compiler option to suppress that stuff but
  failed.  I'm sure something of the sort must exist but didn't
  pursue it.  Someday I might actually learn about how OSX works....
2015-05-03 00:47:10 -07:00
Pasi Kallinen
537acc98dc Update pregenerated levcomp lex and yacc files 2015-05-02 18:33:14 +03:00
PatR
cf74f1cfd8 regex lint
For the POSIX regexp interface, move local declaration to beginning
of block to avoid requiring C99.  Also switch to alloc() from bare
malloc() so that MONITOR_HEAP won't log a free which doesn't match
up to any allocation.  This results in a change in behavior:  if
the allocation fails, nethack will panic rather than report an
option parsing error.  In practice there will be no difference
because nethack is not going to run out of dynamic memory during
initial options processing.
2015-04-13 17:21:59 -07:00
nhmall
5dd00aca54 Makefile bit following merge 2015-04-12 12:16:59 -04:00
Sean Hunt
c7578b7c34 Add POSIX implementation of regex.
This also includes documentation of the regex engine in posixregex.c,
because I couldn't think of anywhere better to put it.
2015-04-12 11:46:56 -04:00
Sean Hunt
302ad5025f Catch regex matching errors to avoid crashing. 2015-04-12 11:46:56 -04:00
Sean Hunt
80aa109855 Use extern.h for regexes.
I was planning to do this anyway, but it created an include loop that
was breaking it on Windows.
2015-04-12 11:46:54 -04:00
Sean Hunt
b86ad06d6b Implement a new system-based matching harness.
The intent is to look for platform-specific facilities for regex
matching, to provide portable MENUCOLORS configuration files.

This is a prototype implementation being committed to see if Windows can
use the POSIX regex implementation provided with the C++11 standard
library. If this works, I will write a harness for POSIX regexes and for
pmatch(), and those can be linked in by platforms as appropriate.

pmatch() should be used only as a very last resort, because it breaks
compatibility between platforms.
2015-04-12 11:46:26 -04:00
nhmall
11560933cc Merge branch 'master' into nhmall-booktribute
Conflicts:
	doc/fixes35.0
	include/extern.h
	src/mkobj.c
	src/mon.c
	src/objnam.c
	win/share/objects.txt
2015-04-12 10:02:17 -04:00
Pasi Kallinen
eb77c57a6c Allow disabling savefile UID checking in sysconf 2015-04-11 21:07:57 +03:00
Derek S. Ray
32619fa8cc Merge branch 'master' into derek-farming
Reverse merge before final reintegration.

* master: (40 commits)
  Fix magic mapped dark room symbols
  Disclose extinct species alongside genocided ones
  ...

Conflicts:
	doc/fixes35.0
	src/do.c
	src/files.c
	src/invent.c
	src/objnam.c
	sys/share/pcmain.c
2015-04-10 16:56:30 -04:00
Pasi Kallinen
c6e9838615 Update precompiled lex and yacc files 2015-04-10 19:45:04 +03:00
nhmall
7e098c0c4e Merge branch 'master' into nhmall-booktribute 2015-04-10 12:15:14 -04:00
Pasi Kallinen
ea084680ac Add 10 new bigroom variants 2015-04-08 18:31:32 +03:00
Sean Hunt
951de70b36 Do not clean tribute file on Unix. 2015-04-07 20:44:54 -04:00
nhmall
684e507143 attempt to fix Makefile issue with tribute 2015-04-06 23:16:14 -04:00
nhmall
06227ec0d3 Merge branch 'master' into nhmall-booktribute 2015-04-06 17:47:11 -04:00
nhmall
3d6fabf730 nhclose
Changes to be committed:
	modified:   include/extern.h
	modified:   src/bones.c
	modified:   src/do.c
	modified:   src/files.c
	modified:   src/music.c
	modified:   src/restore.c
	modified:   src/save.c
	modified:   sys/share/pcmain.c
	modified:   sys/share/pcsys.c
	modified:   sys/share/pcunix.c

In order to get level file locking correctly again post 3.4.3
with the newer compilers for windows, I had to funnel close()
calls to an intercepting routine.

I had two choices:

1. Surround every close() in at least 9 source files with messy:
	#ifdef WIN32
		nhclose(fd);
	#else
		close(fd);
	#endif

OR

2. Replace every close() with nhclose() and
   deal with the special code in the nhclose()
   version for windows, while just calling
   close() for other platforms (in files.c).

   It is also possible, although not done in this commit,
   to
	#define nhclose(fd) close(fd)
   in a header file for non-windows, rather than funnel
   though a real nhclose() function in files.c.
2015-04-06 10:12:10 -04:00
nhmall
660534389e a warning bout lc_error
lev_comp.l(310) : warning C4013: 'lc_error' undefined; assuming extern returning int
2015-04-05 09:26:01 -04:00
nhmall
fff3b12de0 Merge branch 'nhmall-booktribute' of https://rodney.nethack.org:20040/git/NHsource into nhmall-booktribute 2015-04-04 08:22:05 -04:00
Sean Hunt
d5a2dcf8c7 Fix the Unix build. 2015-04-04 00:39:11 -04:00
nhmall
c43e8f9d31 Merge branch 'master' into nhmall-booktribute
Conflicts:
	include/context.h
2015-04-02 19:19:50 -04:00
Pasi Kallinen
c8e781c418 Add menucolors
-Add a boolean option menucolors to toggle menu color
-Add MENUCOLOR -config file option

TODO:
-Better support for win32
-Support more windowports
-Update Guidebook
-Allow changing menucolor lines in-game
2015-04-02 20:16:25 +03:00
Derek S. Ray
af5ed436b8 Merge branch 'master' into derek-farming
* master: (160 commits)
  Add doors correctly
  bug fixes for nhsub
  Generate oracle monsters after subroom
  Generate minetown guards after subrooms
  ...

Conflicts:
	src/do.c
	src/files.c
	src/hack.c
	src/mon.c
	src/vision.c
2015-04-01 17:40:25 -04:00
Pasi Kallinen
323b8b4038 Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource into paxed-new_lev_comp
Conflicts:
	src/trap.c
	sys/winnt/Makefile.msc
2015-04-01 16:09:53 +03:00
Pasi Kallinen
3f885ef583 Remove EXPLORERS from winnt sysconf
Stupidly added this to the winnt sysconf, when it should've
been *nix only.
2015-04-01 08:29:12 +03:00
Pasi Kallinen
ca80675d59 Allow admin to disable explore mode
Some public servers want to disable explore mode, so
make it configurable in sysconf.
2015-03-31 18:14:16 +03:00
keni
8ee2d5976e NHDT substitution version 2.
Re-run nhgitset.pl to install.
"perldoc DEVEL/hooksdir/nhsub" for details.  General docs still to come.
Quick notes:
- "git nhsub" lets you apply substitutions to a file without involving any
  version control.
- When doing nhadd/nhcommit, the working directory WILL reflect the results
  of the substitutions.
Let's see what this breaks.
2015-03-31 09:50:02 -04:00
nhmall
6ab783b05b cmdline Makefile updates 2015-03-29 21:00:50 -04:00
nhmall
0751842083 clean up cmdline Makefile for VS2010,VS2013,...
VS2010 tested ok.
VS2013 tested ok.
VS2015 generated a _lot_ of linker warnings building NetHack, but it built.
2015-03-29 20:28:38 -04:00
Derek S. Ray
ca60cac105 Merge branch 'master' into derek-farming
* master: (41 commits)
  Add more explicit helpless reasons
  add data.base suggestion for whistle
  Use existing function to count containers
  ...

Conflicts:
	src/do.c
	src/hack.c
	src/invent.c
	src/mon.c
	src/objnam.c
2015-03-29 17:32:12 -04:00
Pasi Kallinen
c6faa08b8f Add sysconf for linux-X11 2015-03-28 10:00:44 +02:00
Derek S. Ray
6fcfa55f36 Win32 should use USERPROFILE and COMMONPROGRAMFILES
more standard locations for each of these, plus supports multi-user
Windows machines a bit better
2015-03-25 22:35:24 -04:00
Pasi Kallinen
2d6f9686a7 Merge branch 'paxed-new_lev_comp' of https://rodney.nethack.org:20040/git/NHsource into paxed-new_lev_comp
Conflicts:
	include/obj.h
	include/patchlevel.h
	src/topten.c
	src/trap.c
	sys/winnt/Makefile.msc
2015-03-24 19:59:40 +02:00
nhmall
3fa52686d8 A couple of Makefile updates
Include the tribute file.

Windows Makefile
Unix Makefile.top
2015-03-22 22:06:13 -04:00
PatR
97ffd73add {DEC,IBM,MAC}graphics (2 of 2: unixmain)
Unix command line processing required that the initial 'd' of
"-DECgraphics" be lowercase so that it wouldn't conflict with -D for
wizard mode.  This retains -D for wizard mode and now also recognizes
"-debug" (case insensitive, but full 5 letters necessary) for the same
thing, and allows "-DECgraphics" to be capitalized as it is throughout
the rest of the program (actual matching is case-insensitive, so "-dec"
and "-decgraphics" still work.  It now requires that anything  after
"DEC" match the rest of that string instead of accepting "-DECanthing"
as a synonym for "-DECgraphics".  Likewise for "-IBMgraphics":  when
more than 3 letters are supplied, the extra ones must be an initial
substring of "graphics" rather than arbitrary characters.

The raw_printf() warnings don't actually work as intended, but that
isn't a change from the old behavior so I've left them in for now.
2015-03-22 18:29:37 -07:00
nhmall
d792f7625d Merge branch 'master' into nhmall-booktribute
Conflicts:
	sys/winnt/Makefile.msc
2015-03-22 15:22:17 -04:00
nhmall
b8515fb5fd throw in a windows sysconf skeleton 2015-03-21 15:54:30 -04:00
nhmall
734d118d39 a sys/winnt/Makefile.msc update 2015-03-21 15:50:03 -04:00
nhmall
41ac4aef92 fix SYSCF so that things build when first defined
Things won't build for ports that first
define SYSCF.

This moves assure_syscf_file() from unixmain.c
to files.c and adjusts extern.h to get it
out from under #ifdef UNIX.

The call to assure_syscf_file() in options.c was
only #ifdef SYSCF, SYSCF_FILE and not UNIX,
so new ports #defining SYSCF would get an erro.

assure_syscf_file() will be utilized by mswin
when SYSCF is defined.
2015-03-21 15:38:31 -04:00
Pasi Kallinen
e554cba0ac Update precompiled lex/yacc files 2015-03-21 20:37:44 +02:00
Pasi Kallinen
2649cb385c Merge branch 'master' into paxed-new_lev_comp
Conflicts:
	.gitignore
	doc/fixes35.0
	include/obj.h
	include/patchlevel.h
	src/dig.c
	src/mklev.c
	src/rumors.c
	src/save.c
	src/topten.c
	src/trap.c
	sys/winnt/Makefile.msc
	util/makedefs.c
	win/win32/levstuff.mak
2015-03-21 19:39:48 +02:00
nhmall
a0d3224834 Merge branch 'master' into nhmall-booktribute
Conflicts:
	sys/winnt/Makefile.msc
2015-03-21 10:59:49 -04:00
nhmall
d7ff451301 More book tribute integration 2015-03-21 10:33:59 -04:00
nhmall
66d642fad9 more mswin cmdline Makefile tweaks 2015-03-20 22:06:28 -04:00
Derek S. Ray
7f03ee4216 Changes for Win32; update precompiled files
Also fix Orctown probabilities; fixed support for snprintf;
update Win32 makefile to allow level compiler use

Conflicts:
	win/win32/levstuff.mak
2015-03-20 15:14:31 +02:00
nhmall
0a8d24d87d more updates to the bookstore tribute 2015-03-20 00:58:29 -04:00
nhmall
d182920655 update cmdline Makefile 2015-03-18 23:00:46 -04:00
Pasi Kallinen
debdf7ca48 Move some hard-coded string arrays into data files.
Random epitaphs, engravings and hallucinatory monsters now
live in text data files.
2015-03-18 22:05:10 +02:00
Pasi Kallinen
36995448fb Add MAX_STATUENAME_RANK sysconf setting
MAX_STATUENAME_RANK tells how many score file entries to use
for random statue names.
2015-03-17 18:47:24 +02:00