Make some progress on a couple of next minor release checklist
items, hopefully without introducing too many new bugs. This
is just the initial commit, and work continues.
Checklist items:
Savefiles compatible between Windows versions, whether 64-bit
or 32-bit in little-endian field format.
Selection of file formats:
historical (structlevel saves),
lendian (little-endian, fieldlevel saves),
and just for proof-of-concept, ascii fieldlevel saves
(the ascii is huge! 10x bigger than little-endian).
For the fieldlevel save, all complex data structures recursively
get broken down until until it is one of the simple types that
can't be broken down any further, and that gets when it gets
written to the output file.
New files needed for this build:
hand-coded:
include/sfprocs.h
src/sfbase.c - really a dispatcher to one of the
output/input format routines.
src/sflendian.c - little-endian output writer/reader.
src/sfascii.c - ascii text output writer/reader.
auto-coded (generated):
include/sfproto.h
src/sfdata.c
This is just one approach. I'm sure there are countless others
and they have different pros and cons.
For producing the auto-coded files a utility called
universal-ctags, that is actively maintained and evolving,
was used to do all the heavy-lifting of parsing the
NetHack C sources to tabulate the data fields, and store
them in an intermediate file called util/nethack.tags
(not required for building NetHack if you already have a
generated include/sfproto.h and src/sfdata.c)
util/readtags (also not required for building NetHack
itself) will decipher the nethack.tags file and produce
the functions that can deal with the NetHack struct data
fields.
You can obtain the source for universal-ctags by cloning it
from here:
https://github.com/universal-ctags/ctags.git
The combination universal-ctags + util/readtags has been
tried and tested under both Windows and Linux, so it is
not tied to a particular platform.
Note: util/readtags will work only with universal-ctags
output, so other ctags are unlikely to work as-is.
Universal-ctags can be build from source very easily
under Linux, or under Windows using visual studio.
55 lines
2.0 KiB
C
55 lines
2.0 KiB
C
/* NetHack 3.6 sys.h $NHDT-Date: 1449296291 2015/12/05 06:18:11 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.27 $ */
|
|
/* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */
|
|
/* NetHack may be freely redistributed. See license for details. */
|
|
|
|
#ifndef SYS_H
|
|
#define SYS_H
|
|
|
|
struct sysopt {
|
|
char *support; /* local support contact */
|
|
char *recover; /* how to run recover - may be overridden by win port */
|
|
char *wizards; /* space-separated list of usernames */
|
|
char *fmtd_wizard_list; /* formatted version of wizards; null or "one"
|
|
or "one or two" or "one, two, or three", &c */
|
|
char *explorers; /* like wizards, but for access to explore mode */
|
|
char *shellers; /* like wizards, for ! command (-DSHELL); also ^Z */
|
|
char *genericusers; /* usernames that prompt for user name */
|
|
char *debugfiles; /* files to show debugplines in. '*' is all. */
|
|
#ifdef DUMPLOG
|
|
char *dumplogfile; /* where the dump file is saved */
|
|
#endif
|
|
int env_dbgfl; /* 1: debugfiles comes from getenv("DEBUGFILES")
|
|
* so sysconf's DEBUGFILES shouldn't override it;
|
|
* 0: getenv() hasn't been attempted yet;
|
|
* -1: getenv() didn't find a value for DEBUGFILES.
|
|
*/
|
|
int maxplayers;
|
|
int seduce;
|
|
int check_save_uid; /* restoring savefile checks UID? */
|
|
int check_plname; /* use plname for checking wizards/explorers/shellers */
|
|
int bones_pools;
|
|
|
|
/* record file */
|
|
int persmax;
|
|
int pers_is_uid;
|
|
int entrymax;
|
|
int pointsmin;
|
|
int tt_oname_maxrank;
|
|
|
|
/* panic options */
|
|
char *gdbpath;
|
|
char *greppath;
|
|
int panictrace_gdb;
|
|
int panictrace_libc;
|
|
|
|
/* save and bones format */
|
|
int saveformat[2]; /* primary and onetime conversion */
|
|
int bonesformat[2]; /* primary and onetime conversion */
|
|
};
|
|
|
|
extern struct sysopt sysopt;
|
|
|
|
#define SYSOPT_SEDUCE sysopt.seduce
|
|
|
|
#endif /* SYS_H */
|