From bc8c1f8f56b90e1731e6f205a3bf589655f915b4 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 8 Dec 2019 07:27:01 -0500 Subject: [PATCH] remove field-level savefile code --- Cross-compiling | 3 +- include/sfprocs.h | 192 - include/sfproto.h | 201 - src/artifact.c | 20 - src/bones.c | 15 - src/dungeon.c | 75 - src/end.c | 5 - src/engrave.c | 16 - src/files.c | 165 +- src/light.c | 13 - src/mkmaze.c | 20 - src/mkroom.c | 10 - src/o_init.c | 31 - src/options.c | 3 - src/region.c | 92 +- src/restore.c | 184 - src/rumors.c | 14 - src/save.c | 182 - src/sfascii.c | 1233 ---- src/sfbase.c | 646 --- src/sfdata.c | 6055 -------------------- src/sflendian.c | 1339 ----- src/timeout.c | 22 - src/version.c | 40 +- src/worm.c | 22 - sys/msdos/Makefile.GCC | 3 +- sys/msdos/Makefile2.cross | 3 +- sys/share/pcmain.c | 3 - sys/unix/Makefile.src | 70 +- sys/unix/Makefile.utl | 70 - sys/unix/NetHack.xcodeproj/project.pbxproj | 20 - sys/vms/vmsbuild.com | 2 +- sys/winnt/Makefile.gcc | 3 +- sys/winnt/Makefile.msc | 85 +- util/readtags.c | 1677 ------ win/win32/vs2017/NetHack.vcxproj | 4 - win/win32/vs2017/NetHackW.vcxproj | 4 - 37 files changed, 38 insertions(+), 12504 deletions(-) delete mode 100644 include/sfprocs.h delete mode 100644 include/sfproto.h delete mode 100644 src/sfascii.c delete mode 100644 src/sfbase.c delete mode 100644 src/sfdata.c delete mode 100644 src/sflendian.c delete mode 100644 util/readtags.c diff --git a/Cross-compiling b/Cross-compiling index bccd5bce6..b3dbba6f6 100644 --- a/Cross-compiling +++ b/Cross-compiling @@ -378,8 +378,7 @@ Using the cross-compiler, build the following targets: src/priest.c, src/quest.c, src/questpgr.c, src/random.c, src/read.c, src/rect.c, src/region.c, src/restore.c, src/rip.c, src/rnd.c, src/role.c, - src/rumors.c, src/save.c, src/sfbase.c, - src/sfdata.c, src/sflendian.c, src/sfstruct.c, + src/rumors.c, src/save.c, src/sfstruct.c, src/shk.c, src/shknam.c, src/sit.c, src/sounds.c, src/sp_lev.c, src/spell.c, src/steal.c, src/steed.c, src/sys.c, src/teleport.c, src/tile.c, diff --git a/include/sfprocs.h b/include/sfprocs.h deleted file mode 100644 index a3b3f5dd3..000000000 --- a/include/sfprocs.h +++ /dev/null @@ -1,192 +0,0 @@ -/* NetHack 3.6 sfprocs.h Tue Nov 6 19:38:48 2018 */ -/* Copyright (c) NetHack Development Team 2018. */ -/* NetHack may be freely redistributed. See license for details. */ - -#ifndef SFPROCS_H -#define SFPROCS_H - -#include "hack.h" -#include "integer.h" -#include "wintype.h" - -#define E extern - -/* output routines */ -E void FDECL(ascii_sfo_aligntyp, (NHFILE *, aligntyp *, const char *, const char *, int)); -E void FDECL(ascii_sfo_any, (NHFILE *, union any *d_any, const char *, const char *, int)); -E void FDECL(ascii_sfo_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int)); -E void FDECL(ascii_sfo_boolean, (NHFILE *, boolean *, const char *, const char *, int)); -E void FDECL(ascii_sfo_char, (NHFILE *, char *, const char *, const char *, int)); -E void FDECL(ascii_sfo_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int)); -E void FDECL(ascii_sfo_int, (NHFILE *, int *, const char *, const char *, int)); -E void FDECL(ascii_sfo_long, (NHFILE *, long *, const char *, const char *, int)); -E void FDECL(ascii_sfo_schar, (NHFILE *, schar *, const char *, const char *, int)); -E void FDECL(ascii_sfo_short, (NHFILE *, short *, const char *, const char *, int)); -E void FDECL(ascii_sfo_size_t, (NHFILE *, size_t *, const char *, const char *, int)); -E void FDECL(ascii_sfo_time_t, (NHFILE *, time_t *, const char *, const char *, int)); -E void FDECL(ascii_sfo_unsigned, (NHFILE *, unsigned *, const char *, const char *, int)); -E void FDECL(ascii_sfo_uchar, (NHFILE *, unsigned char *, const char *, const char *, int)); -E void FDECL(ascii_sfo_uint, (NHFILE *, unsigned int *, const char *, const char *, int)); -E void FDECL(ascii_sfo_ulong, (NHFILE *, unsigned long *, const char *, const char *, int)); -E void FDECL(ascii_sfo_ushort, (NHFILE *, unsigned short *, const char *, const char *, int)); -E void FDECL(ascii_sfo_xchar, (NHFILE *, xchar *, const char *, const char *, int)); -E void FDECL(ascii_sfo_str, (NHFILE *, char *, const char *, const char *, int)); -E void FDECL(ascii_sfo_addinfo, (NHFILE *, const char *, const char *, const char *, int)); - -/* input routines */ -E void FDECL(ascii_sfi_aligntyp, (NHFILE *, aligntyp *, const char *, const char *, int)); -E void FDECL(ascii_sfi_any, (NHFILE *, union any *d_any, const char *, const char *, int)); -E void FDECL(ascii_sfi_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int)); -E void FDECL(ascii_sfi_boolean, (NHFILE *, boolean *, const char *, const char *, int)); -E void FDECL(ascii_sfi_char, (NHFILE *, char *, const char *, const char *, int)); -E void FDECL(ascii_sfi_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int)); -E void FDECL(ascii_sfi_int, (NHFILE *, int *, const char *, const char *, int)); -E void FDECL(ascii_sfi_long, (NHFILE *, long *, const char *, const char *, int)); -E void FDECL(ascii_sfi_schar, (NHFILE *, schar *, const char *, const char *, int)); -E void FDECL(ascii_sfi_short, (NHFILE *, short *, const char *, const char *, int)); -E void FDECL(ascii_sfi_size_t, (NHFILE *, size_t *, const char *, const char *, int)); -E void FDECL(ascii_sfi_time_t, (NHFILE *, time_t *, const char *, const char *, int)); -E void FDECL(ascii_sfi_unsigned, (NHFILE *, unsigned *, const char *, const char *, int)); -E void FDECL(ascii_sfi_uchar, (NHFILE *, unsigned char *, const char *, const char *, int)); -E void FDECL(ascii_sfi_uint, (NHFILE *, unsigned int *, const char *, const char *, int)); -E void FDECL(ascii_sfi_ulong, (NHFILE *, unsigned long *, const char *, const char *, int)); -E void FDECL(ascii_sfi_ushort, (NHFILE *, unsigned short *, const char *, const char *, int)); -E void FDECL(ascii_sfi_xchar, (NHFILE *, xchar *, const char *, const char *, int)); -E void FDECL(ascii_sfi_str, (NHFILE *, char *, const char *, const char *, int)); -E void FDECL(ascii_sfi_addinfo, (NHFILE *, const char *, const char *, const char *, int)); - -/* output routines */ -E void FDECL(lendian_sfo_aligntyp, (NHFILE *, aligntyp *, const char *, const char *, int)); -E void FDECL(lendian_sfo_any, (NHFILE *, union any *d_any, const char *, const char *, int)); -E void FDECL(lendian_sfo_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int)); -E void FDECL(lendian_sfo_boolean, (NHFILE *, boolean *, const char *, const char *, int)); -E void FDECL(lendian_sfo_char, (NHFILE *, char *, const char *, const char *, int)); -E void FDECL(lendian_sfo_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int)); -E void FDECL(lendian_sfo_int, (NHFILE *, int *, const char *, const char *, int)); -E void FDECL(lendian_sfo_long, (NHFILE *, long *, const char *, const char *, int)); -E void FDECL(lendian_sfo_schar, (NHFILE *, schar *, const char *, const char *, int)); -E void FDECL(lendian_sfo_short, (NHFILE *, short *, const char *, const char *, int)); -E void FDECL(lendian_sfo_size_t, (NHFILE *, size_t *, const char *, const char *, int)); -E void FDECL(lendian_sfo_time_t, (NHFILE *, time_t *, const char *, const char *, int)); -E void FDECL(lendian_sfo_unsigned, (NHFILE *, unsigned *, const char *, const char *, int)); -E void FDECL(lendian_sfo_uchar, (NHFILE *, unsigned char *, const char *, const char *, int)); -E void FDECL(lendian_sfo_uint, (NHFILE *, unsigned int *, const char *, const char *, int)); -E void FDECL(lendian_sfo_ulong, (NHFILE *, unsigned long *, const char *, const char *, int)); -E void FDECL(lendian_sfo_ushort, (NHFILE *, unsigned short *, const char *, const char *, int)); -E void FDECL(lendian_sfo_xchar, (NHFILE *, xchar *, const char *, const char *, int)); -E void FDECL(lendian_sfo_str, (NHFILE *, char *, const char *, const char *, int)); -E void FDECL(lendian_sfo_addinfo, (NHFILE *, const char *, const char *, const char *, int)); - -/* input routines */ -E void FDECL(lendian_sfi_aligntyp, (NHFILE *, aligntyp *, const char *, const char *, int)); -E void FDECL(lendian_sfi_any, (NHFILE *, union any *d_any, const char *, const char *, int)); -E void FDECL(lendian_sfi_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int)); -E void FDECL(lendian_sfi_boolean, (NHFILE *, boolean *, const char *, const char *, int)); -E void FDECL(lendian_sfi_char, (NHFILE *, char *, const char *, const char *, int)); -E void FDECL(lendian_sfi_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int)); -E void FDECL(lendian_sfi_int, (NHFILE *, int *, const char *, const char *, int)); -E void FDECL(lendian_sfi_long, (NHFILE *, long *, const char *, const char *, int)); -E void FDECL(lendian_sfi_schar, (NHFILE *, schar *, const char *, const char *, int)); -E void FDECL(lendian_sfi_short, (NHFILE *, short *, const char *, const char *, int)); -E void FDECL(lendian_sfi_size_t, (NHFILE *, size_t *, const char *, const char *, int)); -E void FDECL(lendian_sfi_time_t, (NHFILE *, time_t *, const char *, const char *, int)); -E void FDECL(lendian_sfi_unsigned, (NHFILE *, unsigned *, const char *, const char *, int)); -E void FDECL(lendian_sfi_uchar, (NHFILE *, unsigned char *, const char *, const char *, int)); -E void FDECL(lendian_sfi_uint, (NHFILE *, unsigned int *, const char *, const char *, int)); -E void FDECL(lendian_sfi_ulong, (NHFILE *, unsigned long *, const char *, const char *, int)); -E void FDECL(lendian_sfi_ushort, (NHFILE *, unsigned short *, const char *, const char *, int)); -E void FDECL(lendian_sfi_xchar, (NHFILE *, xchar *, const char *, const char *, int)); -E void FDECL(lendian_sfi_str, (NHFILE *, char *, const char *, const char *, int)); -E void FDECL(lendian_sfi_addinfo, (NHFILE *, const char *, const char *, const char *, int)); - -#ifdef JSON_SUPPORT -/* output routines */ -E void FDECL(json_sfo_aligntyp, (NHFILE *, aligntype *, const char *, const char *, int)); -E void FDECL(json_sfo_any, (NHFILE *, union any *d_any, const char *, const char *, int)); -E void FDECL(json_sfo_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int)); -E void FDECL(json_sfo_boolean, (NHFILE *, boolean *, const char *, const char *, int)); -E void FDECL(json_sfo_char, (NHFILE *, char *, const char *, const char *, int)); -E void FDECL(json_sfo_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int)); -E void FDECL(json_sfo_int, (NHFILE *, int *, const char *, const char *, int)); -E void FDECL(json_sfo_long, (NHFILE *, long *, const char *, const char *, int)); -E void FDECL(json_sfo_schar, (NHFILE *, schar *, const char *, const char *, int)); -E void FDECL(json_sfo_short, (NHFILE *, short *, const char *, const char *, int)); -E void FDECL(json_sfo_size_t, (NHFILE *, size_t *, const char *, const char *, int)); -E void FDECL(json_sfo_time_t, (NHFILE *, time_t *, const char *, const char *, int)); -E void FDECL(json_sfo_unsigned, (NHFILE *, unsigned *, const char *, const char *, int)); -E void FDECL(json_sfo_uchar, (NHFILE *, unsigned char *, const char *, const char *, int)); -E void FDECL(json_sfo_uint, (NHFILE *, unsigned int *, const char *, const char *, int)); -E void FDECL(json_sfo_ulong, (NHFILE *, unsigned long *, const char *, const char *, int)); -E void FDECL(json_sfo_ushort, (NHFILE *, unsigned short *, const char *, const char *, int)); -E void FDECL(json_sfo_xchar, (NHFILE *, xchar *, const char *, const char *, int)); -E void FDECL(json_sfo_str, (NHFILE *, char *, const char *, const char *, int)); -E void FDECL(json_sfo_addinfo), (NHFILE *, const char *, const char *, const char *, int)); - -/* input routines */ -E void FDECL(json_sfi_aligntyp, (NHFILE *, aligntype *, const char *, const char *, int)); -E void FDECL(json_sfi_any, (NHFILE *, union any *d_any, const char *, const char *, int)); -E void FDECL(json_sfi_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int)); -E void FDECL(json_sfi_boolean, (NHFILE *, boolean *, const char *, const char *, int)); -E void FDECL(json_sfi_char, (NHFILE *, char *, const char *, const char *, int)); -E void FDECL(json_sfi_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int)); -E void FDECL(json_sfi_int, (NHFILE *, int *, const char *, const char *, int)); -E void FDECL(json_sfi_long, (NHFILE *, long *, const char *, const char *, int)); -E void FDECL(json_sfi_schar, (NHFILE *, schar *, const char *, const char *, int)); -E void FDECL(json_sfi_short, (NHFILE *, short *, const char *, const char *, int)); -E void FDECL(json_sfi_size_t, (NHFILE *, size_t *, const char *, const char *, int)); -E void FDECL(json_sfi_time_t, (NHFILE *, time_t *, const char *, const char *, int)); -E void FDECL(json_sfi_unsigned, (NHFILE *, unsigned *, const char *, const char *, int)); -E void FDECL(json_sfi_uchar, (NHFILE *, unsigned char *, const char *, const char *, int)); -E void FDECL(json_sfi_uint, (NHFILE *, unsigned int *, const char *, const char *, int)); -E void FDECL(json_sfi_ulong, (NHFILE *, unsigned long *, const char *, const char *, int)); -E void FDECL(json_sfi_ushort, (NHFILE *, unsigned short *, const char *, const char *, int)); -E void FDECL(json_sfi_xchar, (NHFILE *, xchar *, const char *, const char *, int)); -E void FDECL(json_sfi_str, (NHFILE *, char *, const char *, const char *, int)); -E void FDECL(json_sfi_addinfo), (NHFILE *, const char *, const char *, const char *, int)); -#endif /* JSON_SUPPORT */ - -struct fieldlevel_procs { - void FDECL((*sf_aligntyp), (NHFILE *, aligntyp *, const char *, const char *, int)); - void FDECL((*sf_any), (NHFILE *, union any *d_any, const char *, const char *, int)); - void FDECL((*sf_bitfield), (NHFILE *, uint8_t *, const char *, const char *, int)); - void FDECL((*sf_boolean), (NHFILE *, boolean *, const char *, const char *, int)); - void FDECL((*sf_char), (NHFILE *, char *, const char *, const char *, int)); - void FDECL((*sf_genericptr), (NHFILE *, genericptr_t *, const char *, const char *, int)); - void FDECL((*sf_int), (NHFILE *, int *, const char *, const char *, int)); - void FDECL((*sf_long), (NHFILE *, long *, const char *, const char *, int)); - void FDECL((*sf_schar), (NHFILE *, schar *, const char *, const char *, int)); - void FDECL((*sf_short), (NHFILE *, short *, const char *, const char *, int)); - void FDECL((*sf_size_t), (NHFILE *, size_t *, const char *, const char *, int)); - void FDECL((*sf_time_t), (NHFILE *, time_t *, const char *, const char *, int)); - void FDECL((*sf_unsigned), (NHFILE *, unsigned *, const char *, const char *, int)); - void FDECL((*sf_uchar), (NHFILE *, unsigned char *, const char *, const char *, int)); - void FDECL((*sf_uint), (NHFILE *, unsigned int *, const char *, const char *, int)); - void FDECL((*sf_ulong), (NHFILE *, unsigned long *, const char *, const char *, int)); - void FDECL((*sf_ushort), (NHFILE *, unsigned short *, const char *, const char *, int)); - void FDECL((*sf_xchar), (NHFILE *, xchar *, const char *, const char *, int)); - void FDECL((*sf_str), (NHFILE *, char *, const char *, const char *, int)); - void FDECL((*sf_addinfo), (NHFILE *, const char *, const char *, const char *, int)); -}; - -struct sf_procs { - const char *ext; - struct fieldlevel_procs fn; -}; - -E void NDECL(sf_init); -E struct sf_procs sfoprocs[4], sfiprocs[4]; - -E struct sf_procs ascii_sfo_procs; -E struct sf_procs ascii_sfi_procs; -E struct sf_procs lendian_sfo_procs; -E struct sf_procs lendian_sfi_procs; -E struct sf_procs stub_sfo_procs; -E struct sf_procs stub_sfi_procs; - -#ifdef JSON_SUPPORT -E struct sf_procs json_sfo_procs; -E struct sf_procs json_sfi_procs; -#endif - -#undef E -#endif /* SFPROCS_H */ diff --git a/include/sfproto.h b/include/sfproto.h deleted file mode 100644 index bb30ac4f2..000000000 --- a/include/sfproto.h +++ /dev/null @@ -1,201 +0,0 @@ -/* NetHack 3.7 sfproto.h */ -/* Copyright (c) NetHack Development Team 2019. */ -/* NetHack may be freely redistributed. See license for details. */ - -/* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE! */ - -#ifndef SFPROTO_H -#define SFPROTO_H - -#include "hack.h" -#include "integer.h" -#include "wintype.h" - -#define E extern - -E int NDECL(critical_members_count); -/* sfbase.c output functions */ -E void FDECL(sfo_addinfo, (NHFILE *, const char *, const char *, const char *, int)); -E void FDECL(sfo_aligntyp, (NHFILE *, aligntyp *, const char *, const char *, int)); -E void FDECL(sfo_any, (NHFILE *, anything *, const char *, const char *, int)); -E void FDECL(sfo_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int)); -E void FDECL(sfo_boolean, (NHFILE *, boolean *, const char *, const char *, int)); -E void FDECL(sfo_char, (NHFILE *, const char *, const char *, const char *, int)); -E void FDECL(sfo_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int)); -E void FDECL(sfo_int, (NHFILE *, int *, const char *, const char *, int)); -E void FDECL(sfo_long, (NHFILE *, long *, const char *, const char *, int)); -E void FDECL(sfo_schar, (NHFILE *, schar *, const char *, const char *, int)); -E void FDECL(sfo_short, (NHFILE *, short *, const char *, const char *, int)); -E void FDECL(sfo_size_t, (NHFILE *, size_t *, const char *, const char *, int)); -E void FDECL(sfo_time_t, (NHFILE *, time_t *, const char *, const char *, int)); -E void FDECL(sfo_uchar, (NHFILE *, uchar *, const char *, const char *, int)); -E void FDECL(sfo_unsigned, (NHFILE *, unsigned *, const char *, const char *, int)); -E void FDECL(sfo_uchar, (NHFILE *, unsigned char *, const char *, const char *, int)); -E void FDECL(sfo_uint, (NHFILE *, unsigned int *, const char *, const char *, int)); -E void FDECL(sfo_ulong, (NHFILE *, unsigned long *, const char *, const char *, int)); -E void FDECL(sfo_ushort, (NHFILE *, unsigned short *, const char *, const char *, int)); -E void FDECL(sfo_xchar, (NHFILE *, xchar *, const char *, const char *, int)); -E void FDECL(sfo_str, (NHFILE *, const char *, const char *, const char *, int)); -/* sfbase.c input functions */ -E void FDECL(sfi_addinfo, (NHFILE *, const char *, const char *, const char *, int)); -E void FDECL(sfi_aligntyp, (NHFILE *, aligntyp *, const char *, const char *, int)); -E void FDECL(sfi_any, (NHFILE *, anything *, const char *, const char *, int)); -E void FDECL(sfi_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int)); -E void FDECL(sfi_boolean, (NHFILE *, boolean *, const char *, const char *, int)); -E void FDECL(sfi_char, (NHFILE *, const char *, const char *, const char *, int)); -E void FDECL(sfi_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int)); -E void FDECL(sfi_int, (NHFILE *, int *, const char *, const char *, int)); -E void FDECL(sfi_long, (NHFILE *, long *, const char *, const char *, int)); -E void FDECL(sfi_schar, (NHFILE *, schar *, const char *, const char *, int)); -E void FDECL(sfi_short, (NHFILE *, short *, const char *, const char *, int)); -E void FDECL(sfi_size_t, (NHFILE *, size_t *, const char *, const char *, int)); -E void FDECL(sfi_time_t, (NHFILE *, time_t *, const char *, const char *, int)); -E void FDECL(sfi_uchar, (NHFILE *, uchar *, const char *, const char *, int)); -E void FDECL(sfi_unsigned, (NHFILE *, unsigned *, const char *, const char *, int)); -E void FDECL(sfi_uchar, (NHFILE *, unsigned char *, const char *, const char *, int)); -E void FDECL(sfi_uint, (NHFILE *, unsigned int *, const char *, const char *, int)); -E void FDECL(sfi_ulong, (NHFILE *, unsigned long *, const char *, const char *, int)); -E void FDECL(sfi_ushort, (NHFILE *, unsigned short *, const char *, const char *, int)); -E void FDECL(sfi_xchar, (NHFILE *, xchar *, const char *, const char *, int)); -E void FDECL(sfi_str, (NHFILE *, const char *, const char *, const char *, int)); -/* generated output functions */ -E void FDECL(sfo_align, (NHFILE *, struct align *, const char *, const char *, int)); -E void FDECL(sfo_attribs, (NHFILE *, struct attribs *, const char *, const char *, int)); -E void FDECL(sfo_bill_x, (NHFILE *, struct bill_x *, const char *, const char *, int)); -E void FDECL(sfo_book_info, (NHFILE *, struct book_info *, const char *, const char *, int)); -E void FDECL(sfo_branch, (NHFILE *, struct branch *, const char *, const char *, int)); -E void FDECL(sfo_bubble, (NHFILE *, struct bubble *, const char *, const char *, int)); -E void FDECL(sfo_cemetery, (NHFILE *, struct cemetery *, const char *, const char *, int)); -E void FDECL(sfo_context_info, (NHFILE *, struct context_info *, const char *, const char *, int)); -E void FDECL(sfo_d_flags, (NHFILE *, struct d_flags *, const char *, const char *, int)); -E void FDECL(sfo_d_level, (NHFILE *, struct d_level *, const char *, const char *, int)); -E void FDECL(sfo_damage, (NHFILE *, struct damage *, const char *, const char *, int)); -E void FDECL(sfo_dest_area, (NHFILE *, struct dest_area *, const char *, const char *, int)); -E void FDECL(sfo_dgn_topology, (NHFILE *, struct dgn_topology *, const char *, const char *, int)); -E void FDECL(sfo_dig_info, (NHFILE *, struct dig_info *, const char *, const char *, int)); -E void FDECL(sfo_dungeon, (NHFILE *, struct dungeon *, const char *, const char *, int)); -E void FDECL(sfo_edog, (NHFILE *, struct edog *, const char *, const char *, int)); -E void FDECL(sfo_egd, (NHFILE *, struct egd *, const char *, const char *, int)); -E void FDECL(sfo_emin, (NHFILE *, struct emin *, const char *, const char *, int)); -E void FDECL(sfo_engr, (NHFILE *, struct engr *, const char *, const char *, int)); -E void FDECL(sfo_epri, (NHFILE *, struct epri *, const char *, const char *, int)); -E void FDECL(sfo_eshk, (NHFILE *, struct eshk *, const char *, const char *, int)); -E void FDECL(sfo_fakecorridor, (NHFILE *, struct fakecorridor *, const char *, const char *, int)); -E void FDECL(sfo_fe, (NHFILE *, struct fe *, const char *, const char *, int)); -E void FDECL(sfo_flag, (NHFILE *, struct flag *, const char *, const char *, int)); -E void FDECL(sfo_fruit, (NHFILE *, struct fruit *, const char *, const char *, int)); -E void FDECL(sfo_kinfo, (NHFILE *, struct kinfo *, const char *, const char *, int)); -E void FDECL(sfo_levelflags, (NHFILE *, struct levelflags *, const char *, const char *, int)); -E void FDECL(sfo_linfo, (NHFILE *, struct linfo *, const char *, const char *, int)); -E void FDECL(sfo_ls_t, (NHFILE *, struct ls_t *, const char *, const char *, int)); -E void FDECL(sfo_mapseen_feat, (NHFILE *, struct mapseen_feat *, const char *, const char *, int)); -E void FDECL(sfo_mapseen_flags, (NHFILE *, struct mapseen_flags *, const char *, const char *, int)); -E void FDECL(sfo_mapseen_rooms, (NHFILE *, struct mapseen_rooms *, const char *, const char *, int)); -E void FDECL(sfo_mapseen, (NHFILE *, struct mapseen *, const char *, const char *, int)); -E void FDECL(sfo_mextra, (NHFILE *, struct mextra *, const char *, const char *, int)); -E void FDECL(sfo_mkroom, (NHFILE *, struct mkroom *, const char *, const char *, int)); -E void FDECL(sfo_monst, (NHFILE *, struct monst *, const char *, const char *, int)); -E void FDECL(sfo_mvitals, (NHFILE *, struct mvitals *, const char *, const char *, int)); -E void FDECL(sfo_nhcoord, (NHFILE *, struct nhcoord *, const char *, const char *, int)); -E void FDECL(sfo_nhrect, (NHFILE *, struct nhrect *, const char *, const char *, int)); -E void FDECL(sfo_novel_tracking, (NHFILE *, struct novel_tracking *, const char *, const char *, int)); -E void FDECL(sfo_obj, (NHFILE *, struct obj *, const char *, const char *, int)); -E void FDECL(sfo_objclass, (NHFILE *, struct objclass *, const char *, const char *, int)); -E void FDECL(sfo_obj_split, (NHFILE *, struct obj_split *, const char *, const char *, int)); -E void FDECL(sfo_oextra, (NHFILE *, struct oextra *, const char *, const char *, int)); -E void FDECL(sfo_polearm_info, (NHFILE *, struct polearm_info *, const char *, const char *, int)); -E void FDECL(sfo_prop, (NHFILE *, struct prop *, const char *, const char *, int)); -E void FDECL(sfo_q_score, (NHFILE *, struct q_score *, const char *, const char *, int)); -E void FDECL(sfo_rm, (NHFILE *, struct rm *, const char *, const char *, int)); -E void FDECL(sfo_s_level, (NHFILE *, struct s_level *, const char *, const char *, int)); -E void FDECL(sfo_savefile_info, (NHFILE *, struct savefile_info *, const char *, const char *, int)); -E void FDECL(sfo_skills, (NHFILE *, struct skills *, const char *, const char *, int)); -E void FDECL(sfo_spell, (NHFILE *, struct spell *, const char *, const char *, int)); -E void FDECL(sfo_stairway, (NHFILE *, struct stairway *, const char *, const char *, int)); -E void FDECL(sfo_takeoff_info, (NHFILE *, struct takeoff_info *, const char *, const char *, int)); -E void FDECL(sfo_tin_info, (NHFILE *, struct tin_info *, const char *, const char *, int)); -E void FDECL(sfo_trap, (NHFILE *, struct trap *, const char *, const char *, int)); -E void FDECL(sfo_tribute_info, (NHFILE *, struct tribute_info *, const char *, const char *, int)); -E void FDECL(sfo_u_achieve, (NHFILE *, struct u_achieve *, const char *, const char *, int)); -E void FDECL(sfo_u_conduct, (NHFILE *, struct u_conduct *, const char *, const char *, int)); -E void FDECL(sfo_u_event, (NHFILE *, struct u_event *, const char *, const char *, int)); -E void FDECL(sfo_u_have, (NHFILE *, struct u_have *, const char *, const char *, int)); -E void FDECL(sfo_u_realtime, (NHFILE *, struct u_realtime *, const char *, const char *, int)); -E void FDECL(sfo_u_roleplay, (NHFILE *, struct u_roleplay *, const char *, const char *, int)); -E void FDECL(sfo_version_info, (NHFILE *, struct version_info *, const char *, const char *, int)); -E void FDECL(sfo_victual_info, (NHFILE *, struct victual_info *, const char *, const char *, int)); -E void FDECL(sfo_vlaunchinfo, (NHFILE *, union vlaunchinfo *, const char *, const char *, int)); -E void FDECL(sfo_vptrs, (NHFILE *, union vptrs *, const char *, const char *, int)); -E void FDECL(sfo_warntype_info, (NHFILE *, struct warntype_info *, const char *, const char *, int)); -E void FDECL(sfo_you, (NHFILE *, struct you *, const char *, const char *, int)); -/* generated input functions */ -E void FDECL(sfi_align, (NHFILE *, struct align *, const char *, const char *, int)); -E void FDECL(sfi_attribs, (NHFILE *, struct attribs *, const char *, const char *, int)); -E void FDECL(sfi_bill_x, (NHFILE *, struct bill_x *, const char *, const char *, int)); -E void FDECL(sfi_book_info, (NHFILE *, struct book_info *, const char *, const char *, int)); -E void FDECL(sfi_branch, (NHFILE *, struct branch *, const char *, const char *, int)); -E void FDECL(sfi_bubble, (NHFILE *, struct bubble *, const char *, const char *, int)); -E void FDECL(sfi_cemetery, (NHFILE *, struct cemetery *, const char *, const char *, int)); -E void FDECL(sfi_context_info, (NHFILE *, struct context_info *, const char *, const char *, int)); -E void FDECL(sfi_d_flags, (NHFILE *, struct d_flags *, const char *, const char *, int)); -E void FDECL(sfi_d_level, (NHFILE *, struct d_level *, const char *, const char *, int)); -E void FDECL(sfi_damage, (NHFILE *, struct damage *, const char *, const char *, int)); -E void FDECL(sfi_dest_area, (NHFILE *, struct dest_area *, const char *, const char *, int)); -E void FDECL(sfi_dgn_topology, (NHFILE *, struct dgn_topology *, const char *, const char *, int)); -E void FDECL(sfi_dig_info, (NHFILE *, struct dig_info *, const char *, const char *, int)); -E void FDECL(sfi_dungeon, (NHFILE *, struct dungeon *, const char *, const char *, int)); -E void FDECL(sfi_edog, (NHFILE *, struct edog *, const char *, const char *, int)); -E void FDECL(sfi_egd, (NHFILE *, struct egd *, const char *, const char *, int)); -E void FDECL(sfi_emin, (NHFILE *, struct emin *, const char *, const char *, int)); -E void FDECL(sfi_engr, (NHFILE *, struct engr *, const char *, const char *, int)); -E void FDECL(sfi_epri, (NHFILE *, struct epri *, const char *, const char *, int)); -E void FDECL(sfi_eshk, (NHFILE *, struct eshk *, const char *, const char *, int)); -E void FDECL(sfi_fakecorridor, (NHFILE *, struct fakecorridor *, const char *, const char *, int)); -E void FDECL(sfi_fe, (NHFILE *, struct fe *, const char *, const char *, int)); -E void FDECL(sfi_flag, (NHFILE *, struct flag *, const char *, const char *, int)); -E void FDECL(sfi_fruit, (NHFILE *, struct fruit *, const char *, const char *, int)); -E void FDECL(sfi_kinfo, (NHFILE *, struct kinfo *, const char *, const char *, int)); -E void FDECL(sfi_levelflags, (NHFILE *, struct levelflags *, const char *, const char *, int)); -E void FDECL(sfi_linfo, (NHFILE *, struct linfo *, const char *, const char *, int)); -E void FDECL(sfi_ls_t, (NHFILE *, struct ls_t *, const char *, const char *, int)); -E void FDECL(sfi_mapseen_feat, (NHFILE *, struct mapseen_feat *, const char *, const char *, int)); -E void FDECL(sfi_mapseen_flags, (NHFILE *, struct mapseen_flags *, const char *, const char *, int)); -E void FDECL(sfi_mapseen_rooms, (NHFILE *, struct mapseen_rooms *, const char *, const char *, int)); -E void FDECL(sfi_mapseen, (NHFILE *, struct mapseen *, const char *, const char *, int)); -E void FDECL(sfi_mextra, (NHFILE *, struct mextra *, const char *, const char *, int)); -E void FDECL(sfi_mkroom, (NHFILE *, struct mkroom *, const char *, const char *, int)); -E void FDECL(sfi_monst, (NHFILE *, struct monst *, const char *, const char *, int)); -E void FDECL(sfi_mvitals, (NHFILE *, struct mvitals *, const char *, const char *, int)); -E void FDECL(sfi_nhcoord, (NHFILE *, struct nhcoord *, const char *, const char *, int)); -E void FDECL(sfi_nhrect, (NHFILE *, struct nhrect *, const char *, const char *, int)); -E void FDECL(sfi_novel_tracking, (NHFILE *, struct novel_tracking *, const char *, const char *, int)); -E void FDECL(sfi_obj, (NHFILE *, struct obj *, const char *, const char *, int)); -E void FDECL(sfi_objclass, (NHFILE *, struct objclass *, const char *, const char *, int)); -E void FDECL(sfi_obj_split, (NHFILE *, struct obj_split *, const char *, const char *, int)); -E void FDECL(sfi_oextra, (NHFILE *, struct oextra *, const char *, const char *, int)); -E void FDECL(sfi_polearm_info, (NHFILE *, struct polearm_info *, const char *, const char *, int)); -E void FDECL(sfi_prop, (NHFILE *, struct prop *, const char *, const char *, int)); -E void FDECL(sfi_q_score, (NHFILE *, struct q_score *, const char *, const char *, int)); -E void FDECL(sfi_rm, (NHFILE *, struct rm *, const char *, const char *, int)); -E void FDECL(sfi_s_level, (NHFILE *, struct s_level *, const char *, const char *, int)); -E void FDECL(sfi_savefile_info, (NHFILE *, struct savefile_info *, const char *, const char *, int)); -E void FDECL(sfi_skills, (NHFILE *, struct skills *, const char *, const char *, int)); -E void FDECL(sfi_spell, (NHFILE *, struct spell *, const char *, const char *, int)); -E void FDECL(sfi_stairway, (NHFILE *, struct stairway *, const char *, const char *, int)); -E void FDECL(sfi_takeoff_info, (NHFILE *, struct takeoff_info *, const char *, const char *, int)); -E void FDECL(sfi_tin_info, (NHFILE *, struct tin_info *, const char *, const char *, int)); -E void FDECL(sfi_trap, (NHFILE *, struct trap *, const char *, const char *, int)); -E void FDECL(sfi_tribute_info, (NHFILE *, struct tribute_info *, const char *, const char *, int)); -E void FDECL(sfi_u_achieve, (NHFILE *, struct u_achieve *, const char *, const char *, int)); -E void FDECL(sfi_u_conduct, (NHFILE *, struct u_conduct *, const char *, const char *, int)); -E void FDECL(sfi_u_event, (NHFILE *, struct u_event *, const char *, const char *, int)); -E void FDECL(sfi_u_have, (NHFILE *, struct u_have *, const char *, const char *, int)); -E void FDECL(sfi_u_realtime, (NHFILE *, struct u_realtime *, const char *, const char *, int)); -E void FDECL(sfi_u_roleplay, (NHFILE *, struct u_roleplay *, const char *, const char *, int)); -E void FDECL(sfi_version_info, (NHFILE *, struct version_info *, const char *, const char *, int)); -E void FDECL(sfi_victual_info, (NHFILE *, struct victual_info *, const char *, const char *, int)); -E void FDECL(sfi_vlaunchinfo, (NHFILE *, union vlaunchinfo *, const char *, const char *, int)); -E void FDECL(sfi_vptrs, (NHFILE *, union vptrs *, const char *, const char *, int)); -E void FDECL(sfi_warntype_info, (NHFILE *, struct warntype_info *, const char *, const char *, int)); -E void FDECL(sfi_you, (NHFILE *, struct you *, const char *, const char *, int)); -#endif /* SFPROTO_H */ diff --git a/src/artifact.c b/src/artifact.c index f6ab3065f..e25fedb24 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -6,8 +6,6 @@ #include "hack.h" #include "artifact.h" #include "artilist.h" -#include "sfproto.h" - /* * Note: both artilist[] and artiexist[] have a dummy element #0, @@ -85,15 +83,6 @@ NHFILE *nhfp; bwrite(nhfp->fd, (genericptr_t) g.artiexist, sizeof g.artiexist); bwrite(nhfp->fd, (genericptr_t) g.artidisco, sizeof g.artidisco); } - if (nhfp->fieldlevel) { - int i; - - for (i = 0; i < (1 + NROFARTIFACTS + 1); ++i) - sfo_boolean(nhfp, &g.artiexist[i], "artifacts", "g.artiexist", 1); - - for (i = 0; i < NROFARTIFACTS; ++i) - sfo_xchar(nhfp, &g.artidisco[i], "artifacts", "g.artidisco", 1); - } } void @@ -104,15 +93,6 @@ NHFILE *nhfp; mread(nhfp->fd, (genericptr_t) g.artiexist, sizeof g.artiexist); mread(nhfp->fd, (genericptr_t) g.artidisco, sizeof g.artidisco); } - if (nhfp->fieldlevel) { - int i; - - for (i = 0; i < (1 + NROFARTIFACTS + 1); ++i) - sfi_boolean(nhfp, &g.artiexist[i], "artifacts", "g.artiexist", 1); - - for (i = 0; i < NROFARTIFACTS; ++i) - sfi_xchar(nhfp, &g.artidisco[i], "artifacts", "g.artidisco", 1); - } hack_artifacts(); /* redo non-saved special cases */ } diff --git a/src/bones.c b/src/bones.c index f1ec5a8a3..a9822df61 100644 --- a/src/bones.c +++ b/src/bones.c @@ -5,7 +5,6 @@ #include "hack.h" #include "lev.h" -#include "sfproto.h" #ifdef MFLOPPY @@ -555,10 +554,6 @@ struct obj *corpse; bwrite(nhfp->fd, (genericptr_t) &c, sizeof c); bwrite(nhfp->fd, (genericptr_t) bonesid, (unsigned) c); /* DD.nnn */ } - if (nhfp->fieldlevel) { - sfo_char(nhfp, &c, "bones", "bones_count", 1); - sfo_char(nhfp, bonesid, "bones", "bonesid", (int) c); - } savefruitchn(nhfp); if (nhfp->structlevel) bflush(nhfp->fd); @@ -582,11 +577,6 @@ struct obj *corpse; bwrite(nhfp->fd, (genericptr_t) bonesid, (unsigned) c); /* DD.nnn */ savefruitchn(nhfp); } - if (nhfp->fieldlevel) { - sfo_char(nhfp, &c, "bones", "bones_count", 1); - sfo_char(nhfp, bonesid, "bones", "bonesid", (int) c); /* DD.nnn */ - savefruitchn(nhfp); - } update_mlstmv(); /* update monsters for eventual restoration */ savelev(nhfp, ledger_no(&u.uz)); close_nhfile(nhfp); @@ -640,11 +630,6 @@ getbones() mread(nhfp->fd, (genericptr_t) &c, sizeof c); /* length incl. '\0' */ mread(nhfp->fd, (genericptr_t) oldbonesid, (unsigned) c); /* DD.nnn */ } - if (nhfp->fieldlevel) { - sfi_char(nhfp, &c, "bones", "bones_count", 1); /* length incl. '\0' */ - for (i = 0; i < (int) c; ++i) - sfi_char(nhfp, &oldbonesid[i], "bones", "bonesid", 1); - } if (strcmp(bonesid, oldbonesid) != 0 /* from 3.3.0 through 3.6.0, bones in the quest branch stored a bogus bonesid in the file; 3.6.1 fixed that, but for diff --git a/src/dungeon.c b/src/dungeon.c index 93486b6b4..58d52227a 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -7,8 +7,6 @@ #include "dgn_file.h" #include "dlb.h" #include "lev.h" -#include "sfproto.h" - #define DUNGEON_FILE "dungeon.lua" @@ -149,26 +147,14 @@ boolean perform_write, free_data; bwrite(nhfp->fd, (genericptr_t) &g.dungeon_topology, sizeof g.dungeon_topology); bwrite(nhfp->fd, (genericptr_t) g.tune, sizeof tune); } - if (nhfp->fieldlevel) { - sfo_int(nhfp, &g.n_dgns, "dungeon", "dungeon_count", 1); - for (i = 0; i < g.n_dgns; ++i) - sfo_dungeon(nhfp, &g.dungeons[i], "dungeon", "dungeon", 1); - sfo_dgn_topology(nhfp, &g.dungeon_topology, "dungeon", "g.dungeon_topology", 1); - for (i = 0; i < (int) sizeof tune; ++i) - sfo_char(nhfp, &g.tune[i], "dungeon", "tune", 1); - } for (count = 0, curr = g.branches; curr; curr = curr->next) count++; if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &count, sizeof(count)); - if (nhfp->fieldlevel) - sfo_int(nhfp, &count, "dungeon", "branch_count", 1); for (curr = g.branches; curr; curr = curr->next) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) curr, sizeof(branch)); - if (nhfp->fieldlevel) - sfo_branch(nhfp, curr, "dungeon", "branch", 1); } count = maxledgerno(); if (nhfp->structlevel) { @@ -177,20 +163,12 @@ boolean perform_write, free_data; (unsigned) count * sizeof(struct linfo)); bwrite(nhfp->fd, (genericptr_t) &g.inv_pos, sizeof g.inv_pos); } - if (nhfp->fieldlevel) { - sfo_int(nhfp, &count, "dungeon", "level_info_count", 1); - for (i = 0; i < count; ++i) - sfo_linfo(nhfp, &g.level_info[i], "dungeon", "g.level_info", 1); - sfo_nhcoord(nhfp, &g.inv_pos, "dungeon", "g.inv_pos", 1); - } for (count = 0, curr_ms = g.mapseenchn; curr_ms; curr_ms = curr_ms->next) count++; if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &count, sizeof(count)); - if (nhfp->fieldlevel) - sfo_int(nhfp, &count, "dungeon", "mapseen_count", 1); for (curr_ms = g.mapseenchn; curr_ms; curr_ms = curr_ms->next) { save_mapseen(nhfp, curr_ms); @@ -230,27 +208,15 @@ NHFILE *nhfp; mread(nhfp->fd, (genericptr_t) &g.dungeon_topology, sizeof g.dungeon_topology); mread(nhfp->fd, (genericptr_t) g.tune, sizeof tune); } - if (nhfp->fieldlevel) { - sfi_int(nhfp, &g.n_dgns, "dungeon", "dungeon_count", 1); - for (i = 0; i < g.n_dgns; ++i) - sfi_dungeon(nhfp, &g.dungeons[i], "dungeon", "dungeon", 1); - sfi_dgn_topology(nhfp, &g.dungeon_topology, "dungeon", "g.dungeon_topology", 1); - for (i = 0; i < (int) sizeof tune; ++i) - sfi_char(nhfp, &g.tune[i], "dungeon", "tune", 1); - } last = g.branches = (branch *) 0; if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &count, sizeof(count)); - if (nhfp->fieldlevel) - sfi_int(nhfp, &count, "dungeon", "branch_count", 1); for (i = 0; i < count; i++) { curr = (branch *) alloc(sizeof(branch)); if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) curr, sizeof(branch)); - if (nhfp->fieldlevel) - sfi_branch(nhfp, curr, "dungeon", "branch", 1); curr->next = (branch *) 0; if (last) last->next = curr; @@ -261,8 +227,6 @@ NHFILE *nhfp; if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &count, sizeof(count)); - if (nhfp->fieldlevel) - sfi_int(nhfp, &count, "dungeon", "level_info_count", 1); if (count >= MAXLINFO) panic("level information count larger (%d) than allocated size", @@ -270,18 +234,11 @@ NHFILE *nhfp; if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) g.level_info, (unsigned) count * sizeof(struct linfo)); - if (nhfp->fieldlevel) - for (i = 0; i < count; ++i) - sfi_linfo(nhfp, &g.level_info[i], "dungeon", "g.level_info", 1); if (nhfp->structlevel) { mread(nhfp->fd, (genericptr_t) &g.inv_pos, sizeof g.inv_pos); mread(nhfp->fd, (genericptr_t) &count, sizeof(count)); } - if (nhfp->fieldlevel) { - sfi_nhcoord(nhfp, &g.inv_pos, "dungeon", "inv_pos", 1); - sfi_int(nhfp, &count, "dungeon", "mapseen_count", 1); - } last_ms = (mapseen *) 0; for (i = 0; i < count; i++) { @@ -2446,8 +2403,6 @@ mapseen *mptr; break; if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &brindx, sizeof brindx); - if (nhfp->fieldlevel) - sfo_int(nhfp, &brindx, "mapseen", "branch_index", 1); if (nhfp->structlevel) { bwrite(nhfp->fd, (genericptr_t) &mptr->lev, sizeof mptr->lev); @@ -2455,29 +2410,15 @@ mapseen *mptr; bwrite(nhfp->fd, (genericptr_t) &mptr->flags, sizeof mptr->flags); bwrite(nhfp->fd, (genericptr_t) &mptr->custom_lth, sizeof mptr->custom_lth); } - if (nhfp->fieldlevel) { - sfo_d_level(nhfp, &mptr->lev, "mapseen", "d_level", 1); - sfo_mapseen_feat(nhfp, &mptr->feat, "mapseen", "feat", 1); - sfo_mapseen_flags(nhfp, &mptr->flags, "mapseen", "flags", 1); - sfo_unsigned(nhfp, &mptr->custom_lth, "mapseen", "custom_lth", 1); - } if (mptr->custom_lth) { if (nhfp->structlevel) { bwrite(nhfp->fd, (genericptr_t) mptr->custom, mptr->custom_lth); } - if (nhfp->fieldlevel) { - for (i = 0; i < (int) mptr->custom_lth; ++i) - sfo_char(nhfp, &mptr->custom[i], "mapseen", "custom", 1); - } } if (nhfp->structlevel) { bwrite(nhfp->fd, (genericptr_t) &mptr->msrooms, sizeof mptr->msrooms); } - if (nhfp->fieldlevel) { - for (i = 0; i < ((MAXNROFROOMS + 1) * 2); ++i) - sfo_mapseen_rooms(nhfp, &mptr->msrooms[i], "mapseen", "msrooms", 1); - } savecemetery(nhfp, &mptr->final_resting_place); } @@ -2493,8 +2434,6 @@ NHFILE *nhfp; if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &branchnum, sizeof branchnum); - if (nhfp->fieldlevel) - sfi_int(nhfp, &branchnum, "mapseen", "branch_index", 1); for (brindx = 0, curr = g.branches; curr; curr = curr->next, ++brindx) if (brindx == branchnum) break; @@ -2506,12 +2445,6 @@ NHFILE *nhfp; mread(nhfp->fd, (genericptr_t) &load->flags, sizeof load->flags); mread(nhfp->fd, (genericptr_t) &load->custom_lth, sizeof load->custom_lth); } - if (nhfp->fieldlevel) { - sfi_d_level(nhfp, &load->lev, "mapseen", "d_level", 1); - sfi_mapseen_feat(nhfp, &load->feat, "mapseen", "feat", 1); - sfi_mapseen_flags(nhfp, &load->flags, "mapseen", "flags", 1); - sfi_unsigned(nhfp, &load->custom_lth, "mapseen", "custom_lth", 1); - } if (load->custom_lth) { /* length doesn't include terminator (which isn't saved & restored) */ @@ -2519,20 +2452,12 @@ NHFILE *nhfp; if (nhfp->structlevel) { mread(nhfp->fd, (genericptr_t) load->custom, load->custom_lth); } - if (nhfp->fieldlevel) { - for (i = 0; i < (int) load->custom_lth; ++i) - sfi_char(nhfp, &load->custom[i], "mapseen", "custom", 1); - } load->custom[load->custom_lth] = '\0'; } else load->custom = 0; if (nhfp->structlevel) { mread(nhfp->fd, (genericptr_t) &load->msrooms, sizeof load->msrooms); } - if (nhfp->fieldlevel) { - for (i = 0; i < ((MAXNROFROOMS + 1) * 2); ++i) - sfi_mapseen_rooms(nhfp, &load->msrooms[i], "mapseen", "msrooms", 1); - } restcemetery(nhfp, &load->final_resting_place); return load; } diff --git a/src/end.c b/src/end.c index 381063da4..bc8cc7ead 100644 --- a/src/end.c +++ b/src/end.c @@ -15,7 +15,6 @@ #include #endif #include "dlb.h" -#include "sfproto.h" /* add b to long a, convert wraparound to max value */ @@ -2153,8 +2152,6 @@ NHFILE *nhfp; for (kptr = &g.killer; kptr != (struct kinfo *) 0; kptr = kptr->next) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t)kptr, sizeof(struct kinfo)); - if (nhfp->fieldlevel) - sfo_kinfo(nhfp, kptr, "killers", "kinfo", 1); } } if (release_data(nhfp)) { @@ -2175,8 +2172,6 @@ NHFILE *nhfp; for (kptr = &g.killer; kptr != (struct kinfo *) 0; kptr = kptr->next) { if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t)kptr, sizeof(struct kinfo)); - if (nhfp->fieldlevel) - sfi_kinfo(nhfp, kptr, "killers", "kinfo", 1); if (kptr->next) { kptr->next = (struct kinfo *) alloc(sizeof (struct kinfo)); } diff --git a/src/engrave.c b/src/engrave.c index ca8a1bc1b..35dcb5896 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -5,8 +5,6 @@ #include "hack.h" #include "lev.h" -#include "sfproto.h" - static NEARDATA struct engr *head_engr; static const char *NDECL(blengr); @@ -1194,11 +1192,6 @@ NHFILE *nhfp; bwrite(nhfp->fd, (genericptr_t)&(ep->engr_lth), sizeof(ep->engr_lth)); bwrite(nhfp->fd, (genericptr_t)ep, sizeof(struct engr) + ep->engr_lth); } - if (nhfp->fieldlevel) { - sfo_unsigned(nhfp, &(ep->engr_lth), "engravings", "engr_lth", 1); - sfo_engr(nhfp, ep, "engravings", "engr", 1); - sfo_str(nhfp, ep->engr_txt, "engravings", "engr_txt", ep->engr_lth); - } } if (release_data(nhfp)) dealloc_engr(ep); @@ -1206,8 +1199,6 @@ NHFILE *nhfp; if (perform_bwrite(nhfp)) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t)&no_more_engr, sizeof no_more_engr); - if (nhfp->fieldlevel) - sfo_unsigned(nhfp, &no_more_engr, "engravings", "engr_lth", 1); } if (release_data(nhfp)) head_engr = 0; @@ -1224,8 +1215,6 @@ NHFILE *nhfp; while (1) { if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) <h, sizeof(unsigned)); - if (nhfp->fieldlevel) - sfi_unsigned(nhfp, <h, "engravings", "engr_lth", 1); if (lth == 0) return; @@ -1233,11 +1222,6 @@ NHFILE *nhfp; if (nhfp->structlevel) { mread(nhfp->fd, (genericptr_t) ep, sizeof(struct engr) + lth); } - if (nhfp->fieldlevel) { - sfi_engr(nhfp, ep, "engravings", "engr", 1); - ep->engr_txt = (char *) (ep + 1); - sfi_str(nhfp, ep->engr_txt, "engravings", "engr_txt", lth); - } ep->nxt_engr = head_engr; head_engr = ep; ep->engr_txt = (char *) (ep + 1); /* Andreas Bormann */ diff --git a/src/files.c b/src/files.c index eb8f09756..b24719361 100644 --- a/src/files.c +++ b/src/files.c @@ -8,8 +8,6 @@ #include "hack.h" #include "dlb.h" #include -#include "sfproto.h" -#include "sfprocs.h" #include "lev.h" #ifdef TTY_GRAPHICS @@ -451,18 +449,6 @@ NHFILE *nhfp; if (nhfp) { if (nhfp->structlevel && nhfp->fd != -1) (void) nhclose(nhfp->fd), nhfp->fd = -1; - if (nhfp->fieldlevel) { - if (nhfp->fpdef) { - (void) fclose(nhfp->fpdef); - nhfp->fpdef = (FILE *) 0; - } - } - if (nhfp->fplog) - (void) fprintf(nhfp->fplog, "# closing\n"); - if (nhfp->fplog) - (void) fclose(nhfp->fplog); - if (nhfp->fpdebug) - (void) fclose(nhfp->fpdebug); zero_nhfile(nhfp); free_nhfile(nhfp); } @@ -479,13 +465,6 @@ NHFILE *nhfp; (void) lseek(nhfp->fd, (off_t) 0, 0); #endif } - if (nhfp->fieldlevel) { - if (nhfp->fpdef) { - rewind(nhfp->fpdef); - nhfp->count = 0L; - nhfp->eof = FALSE; - } - } } static @@ -497,25 +476,10 @@ NHFILE *nhfp; the pointer to the nethack file descriptor */ if (nhfp) { /* check for no open file at all, - * not a structlevel legacy file, - * nor a fieldlevel file. + * not a structlevel legacy file */ - if (((nhfp->fd == -1) && !nhfp->fpdef) - || (nhfp->structlevel && nhfp->fd < 0) - || (nhfp->fieldlevel && !nhfp->fpdef)) { + if (nhfp->structlevel && nhfp->fd < 0) { /* not viable, start the cleanup */ - if (nhfp->fieldlevel) { - if (nhfp->fpdef) { - (void) fclose(nhfp->fpdef); - nhfp->fpdef = (FILE *) 0; - } - if (nhfp->fplog) { - (void) fprintf(nhfp->fplog, "# closing, not viable\n"); - (void) fclose(nhfp->fplog); - } - if (nhfp->fpdebug) - (void) fclose(nhfp->fpdebug); - } zero_nhfile(nhfp); free_nhfile(nhfp); nhfp = (NHFILE *) 0; @@ -847,26 +811,6 @@ char errbuf[]; nhfp->fieldlevel = FALSE; nhfp->ftype = NHF_BONESFILE; nhfp->mode = WRITING; -#ifdef SYSCF - if (sysopt.bonesformat[0] > historical && - sysopt.bonesformat[0] <= ascii) { - nhfp->structlevel = FALSE; - nhfp->fieldlevel = TRUE; - nhfp->addinfo = TRUE; - nhfp->style.deflt = TRUE; - nhfp->style.binary = (sysopt.bonesformat[0] != ascii); - nhfp->fnidx = sysopt.bonesformat[0]; - nhfp->fd = -1; - nhfp->fpdef = fopen(file, nhfp->style.binary ? WRBMODE : WRTMODE); - if (nhfp->fpdef) { -#ifdef SAVEFILE_DEBUGGING - nhfp->fpdebug = fopen("create_bonesfile-debug.log", "a"); -#endif - } else { - failed = errno; - } - } -#endif /* SYSCF */ if (nhfp->structlevel) { #if defined(MICRO) || defined(WIN32) /* Use O_TRUNC to force the file to be shortened if it already @@ -962,26 +906,6 @@ char **bonesid; nhfp->fieldlevel = FALSE; nhfp->ftype = NHF_BONESFILE; nhfp->mode = READING; -#ifdef SYSCF - if (sysopt.bonesformat[0] > historical && - sysopt.bonesformat[0] <= ascii) { - nhfp->structlevel = FALSE; - nhfp->fieldlevel = TRUE; - nhfp->addinfo = TRUE; - nhfp->style.deflt = TRUE; - nhfp->style.binary = (sysopt.bonesformat[0] != ascii); - nhfp->fnidx = sysopt.bonesformat[0]; - nhfp->fd = -1; - nhfp->fpdef = fopen(fq_bones, nhfp->style.binary ? RDBMODE : RDTMODE); - if (nhfp->fpdef) { -#ifdef SAVEFILE_DEBUGGING - nhfp->fpdebug = fopen("open_bonesfile-debug.log", "a"); -#endif - } else { - failed = errno; - } - } -#endif /* SYSCF */ if (nhfp->structlevel) { #ifdef MAC nhfp->fd = macopen(fq_bones, O_RDONLY | O_BINARY, BONE_TYPE); @@ -1152,8 +1076,6 @@ NHFILE *nhfp; { if (nhfp->structlevel) (void) write(nhfp->fd, (genericptr_t) g.SAVEF, sizeof(g.SAVEF)); - if (nhfp->fieldlevel) - sfo_str(nhfp, g.SAVEF, "savefile_name", "g.savef", sizeof(g.SAVEF)); } #endif @@ -1212,23 +1134,6 @@ create_savefile() nhfp->fd = -1; nhfp->fpdef = (FILE *) 0; } - if (!do_historical) { - nhfp->structlevel = FALSE; - nhfp->fieldlevel = TRUE; - nhfp->addinfo = TRUE; - nhfp->style.deflt = TRUE; - nhfp->style.binary = (sysopt.saveformat[0] != ascii); - nhfp->fnidx = sysopt.saveformat[0]; - nhfp->fd = -1; - nhfp->fpdef = fopen(fq_save, nhfp->style.binary ? WRBMODE : WRTMODE); - if (nhfp->fpdef) { -#ifdef SAVEFILE_DEBUGGING - nhfp->fpdebug = fopen("create_savefile-debug.log", "a"); -#endif - } else { - failed = errno; - } - } if (nhfp->structlevel) { #if defined(MICRO) || defined(WIN32) nhfp->fd = open(fq_save, O_WRONLY | O_BINARY | O_CREAT | O_TRUNC, FCMASK); @@ -1274,11 +1179,6 @@ open_savefile() nhfp->fieldlevel = FALSE; nhfp->ftype = NHF_SAVEFILE; nhfp->mode = READING; -#ifdef SYSCF - if (sysopt.saveformat[0] > historical && - sysopt.saveformat[0] <= ascii) - do_historical = FALSE; -#endif /* SYSCF */ if (g.program_state.in_self_recover) { do_historical = TRUE; /* force it */ nhfp->structlevel = TRUE; @@ -1290,23 +1190,6 @@ open_savefile() nhfp->fd = -1; nhfp->fpdef = (FILE *) 0; } - if (!do_historical) { - nhfp->structlevel = FALSE; - nhfp->fieldlevel = TRUE; - nhfp->addinfo = TRUE; - nhfp->style.deflt = TRUE; - nhfp->style.binary = (sysopt.saveformat[0] < ascii); - nhfp->fnidx = sysopt.saveformat[0]; - nhfp->fd = -1; - nhfp->fpdef = fopen(fq_save, nhfp->style.binary ? RDBMODE : RDTMODE); - if (nhfp->fpdef) { -#ifdef SAVEFILE_DEBUGGING - nhfp->fpdebug = fopen("open_savefile-debug.log", "a"); -#endif - } else { - failed = errno; - } - } if (nhfp->structlevel) { #ifdef MAC nhfp->fd = macopen(fq_save, O_RDONLY | O_BINARY, SAVE_TYPE); @@ -1345,10 +1228,6 @@ restore_saved_game() nh_uncompress(fq_save); if ((nhfp = open_savefile()) != 0) { - if (nhfp && nhfp->fieldlevel && nhfp->fplog) - (void) fprintf(nhfp->fplog, "# just opened\n"); - if (nhfp->fieldlevel && nhfp->addinfo) - sfi_addinfo(nhfp, "NetHack", "start", "savefile", 0); if (validate(nhfp, fq_save) != 0) { close_nhfile(nhfp); nhfp = (NHFILE *)0; @@ -4051,15 +3930,6 @@ recover_savefile() */ /* - * Things are different now. We could be in a situation - * where the default save file format is not structlevel. - * self-recover is currently written to use copy_bytes() - * to move content from the level files into the savefile. - * Until the code is updated to use something other than - * copy_bytes, what we need to do is force the recovery - * save to be structlevel, finish creating it, then read - * it back in. The save after that can be fieldlevel again. - * * Set a flag for the savefile routines to know the * circumstances and act accordingly: * g.program_state.in_self_recover @@ -4088,29 +3958,11 @@ recover_savefile() */ /*store_formatindicator(snhfp); */ store_version(snhfp); -#if 0 - if (snhfp->structlevel) { - if (write(snhfp->fd, (genericptr_t) &version_data, sizeof version_data) - != sizeof version_data) - savewrite_failure = "version_info"; - } - if (snhfp->fieldlevel) { - sfo_version_info(snhfp, (struct version_info *) &version_data, - "version", "version_info", 1); - savewrite_failure = (const char *) 0; - } - if (savewrite_failure) - goto cleanup; -#endif if (snhfp->structlevel) { if (write(snhfp->fd, (genericptr_t) &sfi, sizeof sfi) != sizeof sfi) savewrite_failure = "savefileinfo"; } - if (snhfp->fieldlevel) { - sfo_savefile_info(snhfp, &sfsaveinfo, "savefileinfo", "savefile_info", 1); - savewrite_failure = (const char *) 0; - } if (savewrite_failure) goto cleanup; @@ -4119,10 +3971,6 @@ recover_savefile() != sizeof pltmpsiz) savewrite_failure = "player name size"; } - if (snhfp->fieldlevel) { - sfo_int(snhfp, &pltmpsiz, "plname", "plname_size", 1); - savewrite_failure = (const char *) 0; - } if (savewrite_failure) goto cleanup; @@ -4130,18 +3978,9 @@ recover_savefile() if (write(snhfp->fd, (genericptr_t) &tmpplbuf, pltmpsiz) != pltmpsiz) savewrite_failure = "player name"; } - if (snhfp->fieldlevel) { - sfo_str(snhfp, tmpplbuf, "plname", "tmpplbuf", pltmpsiz); - savewrite_failure = (const char *) 0; - } if (savewrite_failure) goto cleanup; - /* - * copy_bytes isn't good enough anymore. - * We could be reading from a structlevel file but - * writing into a fieldlevel save file. Yikes! - */ if (!copy_bytes(lnhfp->fd, snhfp->fd)) { close_nhfile(gnhfp); close_nhfile(snhfp); diff --git a/src/light.c b/src/light.c index 4a7551c05..f1341a78d 100644 --- a/src/light.c +++ b/src/light.c @@ -4,8 +4,6 @@ #include "hack.h" #include "lev.h" /* for checking save modes */ -#include "sfproto.h" - /* * Mobile light sources. @@ -326,9 +324,6 @@ int range; if (nhfp->structlevel) { bwrite(nhfp->fd, (genericptr_t) &count, sizeof count); } - if (nhfp->fieldlevel) { - sfo_int(nhfp, &count, "lightsources", "lightsource_count", 1); - } actual = maybe_write_ls(nhfp, range, TRUE); if (actual != count) panic("counted %d light sources, wrote %d! [range=%d]", count, @@ -379,15 +374,11 @@ NHFILE *nhfp; /* restore elements */ if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &count, sizeof count); - if (nhfp->fieldlevel) - sfi_int(nhfp, &count, "lightsources", "lightsource_count", 1); while (count-- > 0) { ls = (light_source *) alloc(sizeof(light_source)); if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) ls, sizeof(light_source)); - if (nhfp->fieldlevel) - sfi_ls_t(nhfp, ls, "lightsources", "lightsource", 1); ls->next = g.light_base; g.light_base = ls; } @@ -529,8 +520,6 @@ light_source *ls; if (ls->flags & LSF_NEEDS_FIXUP) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) ls, sizeof(light_source)); - if (nhfp->fieldlevel) - sfo_ls_t(nhfp, ls, "lightsources", "lightsource", 1); } else { /* replace object pointer with id for write, then put back */ arg_save = ls->id; @@ -552,8 +541,6 @@ light_source *ls; ls->flags |= LSF_NEEDS_FIXUP; if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) ls, sizeof(light_source)); - if (nhfp->fieldlevel) - sfo_ls_t(nhfp, ls, "lightsources", "lightsource", 1); ls->id = arg_save; ls->flags &= ~LSF_NEEDS_FIXUP; } diff --git a/src/mkmaze.c b/src/mkmaze.c index e32bb245f..275836466 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -6,8 +6,6 @@ #include "hack.h" #include "sp_lev.h" #include "lev.h" /* save & restore info */ -#include "sfproto.h" - static int FDECL(iswall, (int, int)); static int FDECL(iswall_or_stone, (int, int)); @@ -1579,18 +1577,9 @@ NHFILE *nhfp; bwrite(nhfp->fd, (genericptr_t) &g.xmax, sizeof(int)); bwrite(nhfp->fd, (genericptr_t) &g.ymax, sizeof(int)); } - if (nhfp->fieldlevel) { - sfo_int(nhfp, &n, "waterlevel", "bubble_count", 1); - sfo_int(nhfp, &g.xmin, "waterlevel", "g.xmin", 1); - sfo_int(nhfp, &g.ymin, "waterlevel", "g.ymin", 1); - sfo_int(nhfp, &g.xmax, "waterlevel", "g.xmax", 1); - sfo_int(nhfp, &g.ymax, "waterlevel", "g.ymax", 1); - } for (b = g.bbubbles; b; b = b->next) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) b, sizeof(struct bubble)); - if (nhfp->fieldlevel) - sfo_bubble(nhfp, b, "waterlevel", "bubble", 1); } } if (release_data(nhfp)) @@ -1623,20 +1612,11 @@ NHFILE *nhfp; mread(nhfp->fd,(genericptr_t)&g.xmax,sizeof(int)); mread(nhfp->fd,(genericptr_t)&g.ymax,sizeof(int)); } - if (nhfp->fieldlevel) { - sfi_int(nhfp, &n, "waterlevel", "bubble_count", 1); - sfi_int(nhfp, &g.xmin, "waterlevel", "g.xmin", 1); - sfi_int(nhfp, &g.ymin, "waterlevel", "g.ymin", 1); - sfi_int(nhfp, &g.xmax, "waterlevel", "g.xmax", 1); - sfi_int(nhfp, &g.ymax, "waterlevel", "g.ymax", 1); - } for (i = 0; i < n; i++) { btmp = b; b = (struct bubble *) alloc(sizeof(struct bubble)); if (nhfp->structlevel) mread(nhfp->fd,(genericptr_t) b, sizeof(struct bubble)); - if (nhfp->fieldlevel) - sfi_bubble(nhfp, b, "waterlevel", "bubble", 1); if (g.bbubbles) { btmp->next = b; b->prev = btmp; diff --git a/src/mkroom.c b/src/mkroom.c index de87a14e2..0a3319289 100644 --- a/src/mkroom.c +++ b/src/mkroom.c @@ -16,8 +16,6 @@ */ #include "hack.h" -#include "sfproto.h" - static boolean FDECL(isbig, (struct mkroom *)); static struct mkroom *FDECL(pick_room, (BOOLEAN_P)); @@ -811,8 +809,6 @@ struct mkroom *r; */ if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) r, sizeof (struct mkroom)); - if (nhfp->fieldlevel) - sfo_mkroom(nhfp, r, "room", "mkroom", 1); for (i = 0; i < r->nsubrooms; i++) { save_room(nhfp, r->sbrooms[i]); } @@ -830,8 +826,6 @@ NHFILE *nhfp; /* First, write the number of rooms */ if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &g.nroom, sizeof(g.nroom)); - if (nhfp->fieldlevel) - sfo_int(nhfp, &g.nroom, "room", "g.nroom", 1); for (i = 0; i < g.nroom; i++) save_room(nhfp, &g.rooms[i]); } @@ -845,8 +839,6 @@ struct mkroom *r; if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) r, sizeof(struct mkroom)); - if (nhfp->fieldlevel) - sfi_mkroom(nhfp, r, "room", "mkroom", 1); for (i = 0; i < r->nsubrooms; i++) { r->sbrooms[i] = &g.subrooms[g.nsubroom]; @@ -867,8 +859,6 @@ NHFILE *nhfp; if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &g.nroom, sizeof(g.nroom)); - if (nhfp->fieldlevel) - sfi_int(nhfp, &g.nroom, "room", "g.nroom", 1); g.nsubroom = 0; for (i = 0; i < g.nroom; i++) { diff --git a/src/o_init.c b/src/o_init.c index 85b39daf9..cc63fd7cc 100644 --- a/src/o_init.c +++ b/src/o_init.c @@ -5,8 +5,6 @@ #include "hack.h" #include "lev.h" /* save & restore info */ -#include "sfproto.h" - static void FDECL(setgemprobs, (d_level *)); static void FDECL(shuffle, (int, int, BOOLEAN_P)); @@ -301,14 +299,6 @@ NHFILE *nhfp; bwrite(nhfp->fd, (genericptr_t)objects, sizeof(struct objclass) * NUM_OBJECTS); } - if (nhfp->fieldlevel) { - for (i = 0; i < MAXOCLASSES; ++i) - sfo_int(nhfp, &g.bases[i], "names", "g.bases", 1); - for (i = 0; i < NUM_OBJECTS; ++i) - sfo_short(nhfp, &g.disco[i], "names", "g.disco", 1); - for (i = 0; i < NUM_OBJECTS; ++i) - sfo_objclass(nhfp, &objects[i], "names", "objclass", 1); - } } /* as long as we use only one version of Hack we need not save oc_name and oc_descr, but we must save @@ -321,11 +311,6 @@ NHFILE *nhfp; bwrite(nhfp->fd, (genericptr_t)&len, sizeof len); bwrite(nhfp->fd, (genericptr_t)objects[i].oc_uname, len); } - if (nhfp->fieldlevel) { - sfo_unsigned(nhfp, &len, "names", "len", 1); - for (j = 0; (unsigned) j < len; ++j) - sfo_char(nhfp, &objects[i].oc_uname[j], "names", "oc_uname", 1); - } } if (release_data(nhfp)) { free((genericptr_t) objects[i].oc_uname); @@ -347,31 +332,15 @@ NHFILE *nhfp; mread(nhfp->fd, (genericptr_t) objects, sizeof(struct objclass) * NUM_OBJECTS); } - if (nhfp->fieldlevel) { - for (i = 0; i < MAXOCLASSES; ++i) - sfi_int(nhfp, &g.bases[i], "names", "g.bases", 1); - for (i = 0; i < NUM_OBJECTS; ++i) - sfi_short(nhfp, &g.disco[i], "names", "g.disco", 1); - for (i = 0; i < NUM_OBJECTS; ++i) - sfi_objclass(nhfp, &objects[i], "names", "objclass", 1); - } for (i = 0; i < NUM_OBJECTS; i++) { if (objects[i].oc_uname) { if (nhfp->structlevel) { mread(nhfp->fd, (genericptr_t) &len, sizeof len); } - if (nhfp->fieldlevel) { - sfi_unsigned(nhfp, &len, "names", "len", 1); - } objects[i].oc_uname = (char *) alloc(len); if (nhfp->structlevel) { mread(nhfp->fd, (genericptr_t)objects[i].oc_uname, len); } - if (nhfp->fieldlevel) { - for (j = 0; (unsigned) j < len; ++j) - sfi_char(nhfp, &objects[i].oc_uname[j], - "names", "oc_uname", 1); - } } } #ifdef USE_TILES diff --git a/src/options.c b/src/options.c index 5cfbc84fd..7281a2aef 100644 --- a/src/options.c +++ b/src/options.c @@ -18,7 +18,6 @@ NEARDATA struct instance_flags iflags; /* provide linkage */ #include "tcap.h" #include #endif -#include "sfprocs.h" #define BACKWARD_COMPAT @@ -698,8 +697,6 @@ initoptions_init() if (boolopt[i].addr) *(boolopt[i].addr) = boolopt[i].initvalue; } - /* initialize the function pointers for fieldlevel saves */ - sf_init(); #ifdef SYSFLAGS Strcpy(sysflags.sysflagsid, "sysflags"); diff --git a/src/region.c b/src/region.c index 548486d82..0432b5d13 100644 --- a/src/region.c +++ b/src/region.c @@ -4,8 +4,6 @@ #include "hack.h" #include "lev.h" -#include "sfproto.h" - /* * This should really go into the level structure, but @@ -641,64 +639,40 @@ NHFILE *nhfp; bwrite(nhfp->fd, (genericptr_t) &g.moves, sizeof (g.moves)); /* timestamp */ bwrite(nhfp->fd, (genericptr_t) &g.n_regions, sizeof (g.n_regions)); } - if (nhfp->fieldlevel) { - sfo_long(nhfp, &g.moves, "regions", "tmstamp", 1); - sfo_int(nhfp, &g.n_regions, "regions", "region_count", 1); - } for (i = 0; i < g.n_regions; i++) { if (nhfp->structlevel) { bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->bounding_box, sizeof (NhRect)); bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->nrects, sizeof (short)); } - if (nhfp->fieldlevel) { - sfo_nhrect(nhfp, &g.regions[i]->bounding_box, "g.regions", "bounding_box", 1); - sfo_short(nhfp, &g.regions[i]->nrects, "g.regions", "nrects", 1); - } for (j = 0; j < g.regions[i]->nrects; j++) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->rects[j], sizeof (NhRect)); - if (nhfp->fieldlevel) - sfo_nhrect(nhfp, &g.regions[i]->rects[j], "g.regions", "rect", 1); } if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->attach_2_u, sizeof (boolean)); - if (nhfp->fieldlevel) - sfo_boolean(nhfp, &g.regions[i]->attach_2_u, "g.regions", "attach_2_u", 1); n = 0; if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->attach_2_m, sizeof (unsigned)); - if (nhfp->fieldlevel) - sfo_unsigned(nhfp, &g.regions[i]->attach_2_m, "g.regions", "attach_2_m", 1); n = g.regions[i]->enter_msg != (const char *)0 ? strlen(g.regions[i]->enter_msg) : 0; if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &n, sizeof n); - if (nhfp->fieldlevel) - sfo_unsigned(nhfp, &n, "g.regions", "enter_msg_length", 1); if (n > 0) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) g.regions[i]->enter_msg, n); - if (nhfp->fieldlevel) - sfo_char(nhfp, g.regions[i]->enter_msg, "g.regions", "enter_msg", 1); } n = g.regions[i]->leave_msg != (const char *)0 ? strlen(g.regions[i]->leave_msg) : 0; if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &n, sizeof n); - if (nhfp->fieldlevel) - sfo_unsigned(nhfp, &n, "g.regions", "leave_msg_length", 1); if (n > 0) { if (nhfp->structlevel) { bwrite(nhfp->fd, (genericptr_t) g.regions[i]->leave_msg, n); } - if (nhfp->fieldlevel) { - for (j = 0; j < (int) n; ++j) - sfo_char(nhfp, &g.regions[i]->leave_msg[j], "g.regions", "leave_msg", 1); - } } if (nhfp->structlevel) { bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->ttl, sizeof (long)); @@ -711,34 +685,16 @@ NHFILE *nhfp; bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->player_flags, sizeof (unsigned int)); bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->n_monst, sizeof (short)); } - if (nhfp->fieldlevel) { - sfo_long(nhfp, &g.regions[i]->ttl, "g.regions", "ttl", 1); - sfo_short(nhfp, &g.regions[i]->expire_f, "g.regions", "expire_f", 1); - sfo_short(nhfp, &g.regions[i]->can_enter_f, "g.regions", "can_enter_f", 1); - sfo_short(nhfp, &g.regions[i]->enter_f, "g.regions", "enter_f", 1); - sfo_short(nhfp, &g.regions[i]->can_leave_f, "g.regions", "can_leave_f", 1); - sfo_short(nhfp, &g.regions[i]->leave_f, "g.regions", "leave_f", 1); - sfo_short(nhfp, &g.regions[i]->inside_f, "g.regions", "inside_f", 1); - sfo_unsigned(nhfp, &g.regions[i]->player_flags, "g.regions", "player_flags", 1); - sfo_short(nhfp, &g.regions[i]->n_monst, "g.regions", "monster_count", 1); - } for (j = 0; j < g.regions[i]->n_monst; j++) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->monsters[j], sizeof (unsigned)); - if (nhfp->fieldlevel) - sfo_unsigned(nhfp, &g.regions[i]->monsters[j], "g.regions", "monster", 1); } if (nhfp->structlevel) { bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->visible, sizeof (boolean)); bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->glyph, sizeof (int)); bwrite(nhfp->fd, (genericptr_t) &g.regions[i]->arg, sizeof (anything)); } - if (nhfp->fieldlevel) { - sfo_boolean(nhfp, &g.regions[i]->visible, "g.regions", "visible", 1); - sfo_int(nhfp, &g.regions[i]->glyph, "g.regions", "glyph", 1); - sfo_any(nhfp, &g.regions[i]->arg, "g.regions", "arg", 1); - } } skip_lots: @@ -759,8 +715,6 @@ boolean ghostly; /* If a bones file restore */ clear_regions(); /* Just for security */ if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &tmstamp, sizeof (tmstamp)); - if (nhfp->fieldlevel) - sfi_long(nhfp, &tmstamp, "regions", "tmstamp", 1); if (ghostly) tmstamp = 0; else @@ -768,8 +722,6 @@ boolean ghostly; /* If a bones file restore */ if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &g.n_regions, sizeof (g.n_regions)); - if (nhfp->fieldlevel) - sfi_int(nhfp, &g.n_regions, "regions", "region_count", 1); g.max_regions = g.n_regions; if (g.n_regions > 0) @@ -780,41 +732,25 @@ boolean ghostly; /* If a bones file restore */ mread(nhfp->fd, (genericptr_t) &g.regions[i]->bounding_box, sizeof (NhRect)); mread(nhfp->fd, (genericptr_t) &g.regions[i]->nrects, sizeof (short)); } - if (nhfp->fieldlevel) { - sfi_nhrect(nhfp, &g.regions[i]->bounding_box, "g.regions", "bounding box", 1); - sfi_short(nhfp, &g.regions[i]->nrects, "g.regions", "nrects", 1); - } if (g.regions[i]->nrects > 0) g.regions[i]->rects = (NhRect *) alloc(sizeof (NhRect) * g.regions[i]->nrects); for (j = 0; j < g.regions[i]->nrects; j++) { if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &g.regions[i]->rects[j], sizeof (NhRect)); - if (nhfp->fieldlevel) - sfi_nhrect(nhfp, &g.regions[i]->rects[j], "g.regions", "rect", 1); } if (nhfp->structlevel) { mread(nhfp->fd, (genericptr_t) &g.regions[i]->attach_2_u, sizeof (boolean)); mread(nhfp->fd, (genericptr_t) &g.regions[i]->attach_2_m, sizeof (unsigned)); } - if (nhfp->fieldlevel) { - sfi_boolean(nhfp, &g.regions[i]->attach_2_u, "g.regions", "attach_2_u", 1); - sfi_unsigned(nhfp, &g.regions[i]->attach_2_m, "g.regions", "attach_2_m", 1); - } if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &n, sizeof n); - if (nhfp->fieldlevel) - sfi_unsigned(nhfp, &n, "g.regions", "enter_msg_length", 1); if (n > 0) { msg_buf = (char *) alloc(n + 1); if (nhfp->structlevel) { mread(nhfp->fd, (genericptr_t) msg_buf, n); } - if (nhfp->fieldlevel) { - for (j = 0; (unsigned) j < n; ++j) - sfi_char(nhfp, &msg_buf[j], "g.regions", "enter_msg", 1); - } msg_buf[n] = '\0'; g.regions[i]->enter_msg = (const char *) msg_buf; } else @@ -822,17 +758,11 @@ boolean ghostly; /* If a bones file restore */ if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &n, sizeof n); - if (nhfp->fieldlevel) - sfi_unsigned(nhfp, &n, "g.regions", "leave_msg_length", 1); - if (n > 0) { + if (n > 0) { msg_buf = (char *) alloc(n + 1); if (nhfp->structlevel) { mread(nhfp->fd, (genericptr_t) msg_buf, n); } - if (nhfp->fieldlevel) { - for (j = 0; (unsigned) j < n; ++j) - sfi_char(nhfp, &msg_buf[j], "g.regions", "leave_msg", 1); - } msg_buf[n] = '\0'; g.regions[i]->leave_msg = (const char *) msg_buf; } else @@ -840,8 +770,6 @@ boolean ghostly; /* If a bones file restore */ if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &g.regions[i]->ttl, sizeof (long)); - if (nhfp->fieldlevel) - sfi_long(nhfp, &g.regions[i]->ttl, "g.regions", "ttl", 1); /* check for expired region */ if (g.regions[i]->ttl >= 0L) g.regions[i]->ttl = @@ -862,23 +790,12 @@ boolean ghostly; /* If a bones file restore */ mread(nhfp->fd, (genericptr_t) &g.regions[i]->player_flags, sizeof (unsigned int)); } - if (nhfp->fieldlevel) { - sfi_short(nhfp, &g.regions[i]->expire_f, "g.regions", "expire_f", 1); - sfi_short(nhfp, &g.regions[i]->can_enter_f, "g.regions", "can_enter_f", 1); - sfi_short(nhfp, &g.regions[i]->enter_f, "g.regions", "enter_f", 1); - sfi_short(nhfp, &g.regions[i]->can_leave_f, "g.regions", "can_leave_f", 1); - sfi_short(nhfp, &g.regions[i]->leave_f, "g.regions", "leave_f", 1); - sfi_short(nhfp, &g.regions[i]->inside_f, "g.regions", "inside_f", 1); - sfi_unsigned(nhfp, &g.regions[i]->player_flags, "g.regions", "player_flags", 1); - } if (ghostly) { /* settings pertained to old player */ clear_hero_inside(g.regions[i]); clear_heros_fault(g.regions[i]); } if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &g.regions[i]->n_monst, sizeof (short)); - if (nhfp->fieldlevel) - sfi_short(nhfp, &g.regions[i]->n_monst, "g.regions", "monster_count", 1); if (g.regions[i]->n_monst > 0) g.regions[i]->monsters = (unsigned *) alloc(sizeof (unsigned) * g.regions[i]->n_monst); @@ -889,19 +806,12 @@ boolean ghostly; /* If a bones file restore */ if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &g.regions[i]->monsters[j], sizeof (unsigned)); - if (nhfp->fieldlevel) - sfi_unsigned(nhfp, &g.regions[i]->monsters[j], "g.regions", "monster", 1); } if (nhfp->structlevel) { mread(nhfp->fd, (genericptr_t) &g.regions[i]->visible, sizeof (boolean)); mread(nhfp->fd, (genericptr_t) &g.regions[i]->glyph, sizeof (int)); mread(nhfp->fd, (genericptr_t) &g.regions[i]->arg, sizeof (anything)); } - if (nhfp->fieldlevel) { - sfi_boolean(nhfp, &g.regions[i]->visible, "g.regions", "visible", 1); - sfi_int(nhfp, &g.regions[i]->glyph, "g.regions", "glyph", 1); - sfi_any(nhfp, &g.regions[i]->arg, "g.regions", "arg", 1); - } } /* remove expired regions, do not trigger the expire_f callback (yet!); also update monster lists if this data is coming from a bones file */ diff --git a/src/restore.c b/src/restore.c index 1cab78c8c..84eef5ee1 100644 --- a/src/restore.c +++ b/src/restore.c @@ -6,9 +6,6 @@ #include "hack.h" #include "lev.h" #include "tcap.h" /* for TERMLIB and ASCIIGRAPH */ -#include "sfproto.h" - - #if defined(MICRO) extern int dotcnt; /* shared with save */ @@ -128,15 +125,11 @@ NHFILE *nhfp; g.sp_levchn = (s_level *) 0; if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &cnt, sizeof(int)); - if (nhfp->fieldlevel) - sfi_int(nhfp, &cnt, "levchn", "lev_count", 1); for (; cnt > 0; cnt--) { tmplev = (s_level *) alloc(sizeof(s_level)); if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) tmplev, sizeof(s_level)); - if (nhfp->fieldlevel) - sfi_s_level(nhfp, tmplev, "levchn", "s_level", 1); if (!g.sp_levchn) g.sp_levchn = tmplev; @@ -160,8 +153,6 @@ boolean ghostly; if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &dmgcount, sizeof(dmgcount)); - if (nhfp->fieldlevel) - sfi_unsigned(nhfp, &dmgcount, "damage", "damage_count", 1); counter = (int) dmgcount; if (!counter) @@ -172,8 +163,6 @@ boolean ghostly; if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) tmp_dam, sizeof(*tmp_dam)); - if (nhfp->fieldlevel) - sfi_damage(nhfp, tmp_dam, "damage", "damage", 1); if (ghostly) tmp_dam->when += (g.monstermoves - g.omoves); @@ -212,8 +201,6 @@ struct obj *otmp; if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) otmp, sizeof(struct obj)); - if (nhfp->fieldlevel) - sfi_obj(nhfp, otmp, "obj", "obj", 1); /* next object pointers are invalid; otmp->cobj needs to be left as is--being non-null is key to restoring container contents */ @@ -225,22 +212,16 @@ struct obj *otmp; /* oname - object's name */ if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); - if (nhfp->fieldlevel) - sfi_int(nhfp, &buflen, "obj", "oname_length", 1); if (buflen > 0) { /* includes terminating '\0' */ new_oname(otmp, buflen); if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) ONAME(otmp), buflen); - if (nhfp->fieldlevel) - sfi_str(nhfp, ONAME(otmp), "obj", "oname", buflen); } /* omonst - corpse or statue might retain full monster details */ if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); - if (nhfp->fieldlevel) - sfi_int(nhfp, &buflen, "obj", "omonst_length", 1); if (buflen > 0) { newomonst(otmp); /* this is actually a monst struct, so we @@ -251,42 +232,30 @@ struct obj *otmp; /* omid - monster id number, connecting corpse to ghost */ if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); - if (nhfp->fieldlevel) - sfi_int(nhfp, &buflen, "obj", "omid_length", 1); if (buflen > 0) { newomid(otmp); if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) OMID(otmp), buflen); - if (nhfp->fieldlevel) - sfi_unsigned(nhfp, OMID(otmp), "obj", "omid", 1); } /* olong - temporary gold */ if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); - if (nhfp->fieldlevel) - sfi_int(nhfp, &buflen, "obj", "olong_length", 1); if (buflen > 0) { newolong(otmp); if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) OLONG(otmp), buflen); - if (nhfp->fieldlevel) - sfi_long(nhfp, OLONG(otmp), "obj", "olong", 1); } /* omailcmd - feedback mechanism for scroll of mail */ if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); - if (nhfp->fieldlevel) - sfi_int(nhfp, &buflen, "obj", "omailcmd_length", 1); if (buflen > 0) { char *omailcmd = (char *) alloc(buflen); if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) omailcmd, buflen); - if (nhfp->fieldlevel) - sfi_str(nhfp, omailcmd, "obj", "omailcmd", buflen); new_omailcmd(otmp, omailcmd); free((genericptr_t) omailcmd); } @@ -305,8 +274,6 @@ boolean ghostly, frozen; while (1) { if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &buflen, sizeof buflen); - if (nhfp->fieldlevel) - sfi_int(nhfp, &buflen, "obj", "obj_length", 1); if (buflen == -1) break; @@ -393,8 +360,6 @@ struct monst *mtmp; if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) mtmp, sizeof(struct monst)); - if (nhfp->fieldlevel) - sfi_monst(nhfp, mtmp, "mon", "monst_length", 1); /* next monster pointer is invalid */ mtmp->nmon = (struct monst *) 0; @@ -405,82 +370,56 @@ struct monst *mtmp; /* mname - monster's name */ if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); - if (nhfp->fieldlevel) - sfi_int(nhfp, &buflen, "mon", "mname_length", 1); if (buflen > 0) { /* includes terminating '\0' */ new_mname(mtmp, buflen); if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) MNAME(mtmp), buflen); - if (nhfp->fieldlevel) - sfi_str(nhfp, MNAME(mtmp), "mon", "mname", buflen); } /* egd - vault guard */ if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); - if (nhfp->fieldlevel) - sfi_int(nhfp, &buflen, "mon", "egd_length", 1); if (buflen > 0) { newegd(mtmp); if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) EGD(mtmp), sizeof(struct egd)); - if (nhfp->fieldlevel) - sfi_egd(nhfp, EGD(mtmp), "mon", "egd", 1); } /* epri - temple priest */ if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); - if (nhfp->fieldlevel) - sfi_int(nhfp, &buflen, "mon", "epri_length", 1); if (buflen > 0) { newepri(mtmp); if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) EPRI(mtmp), sizeof(struct epri)); - if (nhfp->fieldlevel) - sfi_epri(nhfp, EPRI(mtmp), "mon", "epri", 1); } /* eshk - shopkeeper */ if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); - if (nhfp->fieldlevel) - sfi_int(nhfp, &buflen, "mon", "eshk_length", 1); if (buflen > 0) { neweshk(mtmp); if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) ESHK(mtmp), sizeof(struct eshk)); - if (nhfp->fieldlevel) - sfi_eshk(nhfp, ESHK(mtmp), "mon", "eshk", 1); } /* emin - minion */ if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); - if (nhfp->fieldlevel) - sfi_int(nhfp, &buflen, "mon", "emin_length", 1); if (buflen > 0) { newemin(mtmp); if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) EMIN(mtmp), sizeof(struct emin)); - if (nhfp->fieldlevel) - sfi_emin(nhfp, EMIN(mtmp), "mon", "emin", 1); } /* edog - pet */ if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); - if (nhfp->fieldlevel) - sfi_int(nhfp, &buflen, "mon", "edog_length", 1); if (buflen > 0) { newedog(mtmp); if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) EDOG(mtmp), sizeof(struct edog)); - if (nhfp->fieldlevel) - sfi_edog(nhfp, EDOG(mtmp), "mon", "edog", 1); } /* mcorpsenm - obj->corpsenm for mimic posing as corpse or statue (inline int rather than pointer to something) */ if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &MCORPSENM(mtmp), sizeof MCORPSENM(mtmp)); - if (nhfp->fieldlevel) - sfi_int(nhfp, &MCORPSENM(mtmp), "mon", "mcorpsenm", 1); } /* mextra */ } @@ -496,8 +435,6 @@ boolean ghostly; while (1) { if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &buflen, sizeof(buflen)); - if (nhfp->fieldlevel) - sfi_int(nhfp, &buflen, "mon", "monst_length", 1); if (buflen == -1) break; @@ -572,8 +509,6 @@ NHFILE *nhfp; fnext = newfruit(); if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t)fnext, sizeof *fnext); - if (nhfp->fieldlevel) - sfi_fruit(nhfp, fnext, "fruit", "fruit", 1); if (fnext->fid != 0) { fnext->nextf = flist; flist = fnext; @@ -636,13 +571,8 @@ unsigned int *stuckid, *steedid; unsigned long uid = 0; boolean defer_perm_invent; - if (nhfp->fieldlevel && nhfp->addinfo) - sfi_addinfo(nhfp, "gamestate", "start", "", 0); - if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &uid, sizeof uid); - if (nhfp->fieldlevel) - sfi_ulong(nhfp, &uid, "gamestate", "uid", 1); if (SYSOPT_CHECK_SAVE_UID && uid != (unsigned long) getuid()) { /* strange ... */ @@ -656,8 +586,6 @@ unsigned int *stuckid, *steedid; newgamecontext = g.context; /* copy statically init'd context */ if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &g.context, sizeof (struct context_info)); - if (nhfp->fieldlevel) - sfi_context_info(nhfp, &g.context, "gamestate", "g.context", 1); g.context.warntype.species = (g.context.warntype.speciesidx >= LOW_PM) ? &mons[g.context.warntype.speciesidx] : (struct permonst *) 0; @@ -671,8 +599,6 @@ unsigned int *stuckid, *steedid; newgameflags = flags; if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &flags, sizeof (struct flag)); - if (nhfp->fieldlevel) - sfi_flag(nhfp, &flags, "gamestate", "flags", 1); /* avoid keeping permanent inventory window up to date during restore (setworn() calls update_inventory); attempting to include the cost @@ -699,9 +625,6 @@ unsigned int *stuckid, *steedid; newgamesysflags = sysflags; if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &sysflags, sizeof(struct sysflag)); - if (nhfp->fieldlevel) - sfi_sysflag(nhfp, &sysflags, "gamestate", "sysflags", 1); - mread(fd, (genericptr_t) &sysflags, sizeof(struct sysflag)); #endif role_init(); /* Reset the initial role, race, gender, and alignment */ @@ -710,25 +633,17 @@ unsigned int *stuckid, *steedid; #endif if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &u, sizeof(struct you)); - if (nhfp->fieldlevel) - sfi_you(nhfp, &u, "gamestate", "you", 1); g.youmonst.cham = u.mcham; if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) timebuf, 14); - if (nhfp->fieldlevel) - sfi_str(nhfp, timebuf, "gamestate", "ubirthday", 14); timebuf[14] = '\0'; ubirthday = time_from_yyyymmddhhmmss(timebuf); if (nhfp->structlevel) mread(nhfp->fd, &urealtime.realtime, sizeof urealtime.realtime); - if (nhfp->fieldlevel) - sfi_long(nhfp, &urealtime.realtime, "gamestate", "realtime", 1); if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) timebuf, 14); - if (nhfp->fieldlevel) - sfi_str(nhfp, timebuf, "gamestate", "start_timing", 14); timebuf[14] = '\0'; urealtime.start_timing = time_from_yyyymmddhhmmss(timebuf); @@ -767,8 +682,6 @@ unsigned int *stuckid, *steedid; restore_timers(nhfp, RANGE_GLOBAL, FALSE, 0L); restore_light_sources(nhfp); - if (nhfp->fieldlevel && nhfp->addinfo) - sfi_addinfo(nhfp, "objchain", "start", "invent", 0); g.invent = restobjchn(nhfp, FALSE, FALSE); /* restore dangling (not on floor or in inventory) ball and/or chain */ @@ -787,12 +700,6 @@ unsigned int *stuckid, *steedid; if (nhfp->structlevel) { mread(nhfp->fd, (genericptr_t) g.mvitals, sizeof g.mvitals); } - if (nhfp->fieldlevel) { - int i; - - for (i = 0; i < NUMMONS; ++i) - sfi_mvitals(nhfp, &g.mvitals[i], "gamestate", "g.mvitals", 1); - } /* * There are some things after this that can have unintended display @@ -824,41 +731,20 @@ unsigned int *stuckid, *steedid; mread(nhfp->fd, (genericptr_t) &g.quest_status, sizeof (struct q_score)); mread(nhfp->fd, (genericptr_t) g.spl_book, (MAXSPELL + 1) * sizeof (struct spell)); } - if (nhfp->fieldlevel) { - int i; - struct spell *sptmp; - - sfi_long(nhfp, &g.moves, "gamestate", "g.moves", 1); - sfi_long(nhfp, &g.monstermoves, "gamestate", "g.monstermoves", 1); - sfi_q_score(nhfp, &g.quest_status, "gamestate", "g.quest_status", 1); - sptmp = g.spl_book; - for (i = 0; i < (MAXSPELL + 1); ++i) - sfi_spell(nhfp, sptmp++, "gamestate", "g.spl_book", 1); - } restore_artifacts(nhfp); restore_oracles(nhfp); if (u.ustuck) { if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) stuckid, sizeof *stuckid); - if (nhfp->fieldlevel) - sfi_unsigned(nhfp, stuckid, "gamestate", "ustuck_id", 1); } if (u.usteed) { if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) steedid, sizeof *steedid); - if (nhfp->fieldlevel) - sfi_unsigned(nhfp, steedid, "gamestate", "usteed_id", 1); } if (nhfp->structlevel) { mread(nhfp->fd, (genericptr_t) g.pl_character, sizeof g.pl_character); mread(nhfp->fd, (genericptr_t) g.pl_fruit, sizeof g.pl_fruit); } - if (nhfp->fieldlevel) { - sfi_char(nhfp, g.pl_character, "gamestate", "g.pl_character", - sizeof g.pl_character); - sfi_char(nhfp, g.pl_fruit, "gamestate", "g.pl_fruit", - sizeof g.pl_fruit); - } freefruitchn(g.ffruit); /* clean up fruit(s) made by initoptions() */ g.ffruit = loadfruitchn(nhfp); @@ -1039,11 +925,6 @@ NHFILE *nhfp; if (restoreinfo.mread_flags == -1) break; } - if (nhfp->fieldlevel) { - sfi_xchar(nhfp, <mp, "gamestate", "level_number", 1); - if (nhfp->eof) - break; - } getlev(nhfp, 0, ltmp, FALSE); #ifdef MICRO curs(WIN_MAP, 1 + dotcnt++, dotrow); @@ -1061,9 +942,6 @@ NHFILE *nhfp; return rtmp; /* dorecover called recursively */ } restoreinfo.mread_flags = 0; - if (nhfp->fieldlevel && nhfp->addinfo) - sfi_addinfo(nhfp, "NetHack", "end", "savefile", 0); - rewind_nhfile(nhfp); /* return to beginning of file */ (void) validate(nhfp, (char *) 0); get_plname_from_file(nhfp, g.plname); @@ -1130,16 +1008,12 @@ struct cemetery **cemeteryaddr; if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &cflag, sizeof cflag); - if (nhfp->fieldlevel) - sfi_int(nhfp, &cflag, "cemetery", "cemetery_flag", 1); if (cflag == 0) { bonesaddr = cemeteryaddr; do { bonesinfo = (struct cemetery *) alloc(sizeof *bonesinfo); if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) bonesinfo, sizeof *bonesinfo); - if (nhfp->fieldlevel) - sfi_cemetery(nhfp, bonesinfo, "bones", "bonesinfo", 1); *bonesaddr = bonesinfo; bonesaddr = &(*bonesaddr)->next; } while (*bonesaddr); @@ -1175,10 +1049,6 @@ boolean rlecomp; mread(nhfp->fd, (genericptr_t) &len, sizeof(uchar)); mread(nhfp->fd, (genericptr_t) &r, sizeof(struct rm)); } - if (nhfp->fieldlevel) { - sfi_uchar(nhfp, &len, "room", "levl", 1); - sfi_rm(nhfp, &r, "room", "rm", 1); - } } } j = 0; @@ -1192,13 +1062,6 @@ boolean rlecomp; if (nhfp->structlevel) { mread(nhfp->fd, (genericptr_t) levl, sizeof levl); } - if (nhfp->fieldlevel) { - int c, r; - - for (c = 0; c < COLNO; ++c) - for (r = 0; r < ROWNO; ++r) - sfi_rm(nhfp, &levl[c][r], "room", "levl", 1); - } } void @@ -1246,21 +1109,15 @@ boolean ghostly; /* First some sanity checks */ if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &hpid, sizeof(hpid)); - if (nhfp->fieldlevel) - sfi_int(nhfp, &hpid, "gamestate", "g.hackpid", 1); /* CHECK: This may prevent restoration */ #ifdef TOS if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &tlev, sizeof(tlev)); - if (nhfp->fieldlevel) - sfi_short(nhfp, &tlev, "gamestate", "tlev", 1); dlvl = tlev & 0x00ff; #else if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &dlvl, sizeof(dlvl)); - if (nhfp->fieldlevel) - sfi_xchar(nhfp, &dlvl, "gamestate", "dlvl", 1); #endif if ((pid && pid != hpid) || (lev && dlvl != lev)) { char trickbuf[BUFSZ]; @@ -1281,16 +1138,6 @@ boolean ghostly; mread(nhfp->fd, (genericptr_t) g.lastseentyp, sizeof(g.lastseentyp)); mread(nhfp->fd, (genericptr_t) &g.omoves, sizeof(g.omoves)); } - if (nhfp->fieldlevel) { - int c, r; - - for (c = 0; c < COLNO; ++c) - for (r = 0; r < ROWNO; ++r) - sfi_schar(nhfp, &g.lastseentyp[c][r], - "lev", "g.lastseentyp", 1); - - sfi_long(nhfp, &g.omoves, "lev", "timestmp", 1); - } elapsed = g.monstermoves - g.omoves; if (nhfp->structlevel) { @@ -1304,20 +1151,6 @@ boolean ghostly; mread(nhfp->fd, (genericptr_t)&g.level.flags, sizeof(g.level.flags)); mread(nhfp->fd, (genericptr_t)g.doors, sizeof(g.doors)); } - if (nhfp->fieldlevel) { - int i; - - sfi_stairway(nhfp, &g.upstair, "lev", "g.upstair", 1); - sfi_stairway(nhfp, &g.dnstair, "lev", "g.dnstair", 1); - sfi_stairway(nhfp, &g.upladder, "lev", "g.upladder", 1); - sfi_stairway(nhfp, &g.dnladder, "lev", "g.dnladder", 1); - sfi_stairway(nhfp, &g.sstairs, "lev", "g.sstairs", 1); - sfi_dest_area(nhfp, &g.updest, "lev", "g.updest", 1); - sfi_dest_area(nhfp, &g.dndest, "lev", "g.dndest", 1); - sfi_levelflags(nhfp, &g.level.flags, "lev", "g.level.flags", 1); - for (i = 0; i < DOORMAX; ++i) - sfi_nhcoord(nhfp, &g.doors[i], "lev", "g.doors", 1); - } rest_rooms(nhfp); /* No joke :-) */ if (g.nroom) g.doorindex = g.rooms[g.nroom - 1].fdoor + g.rooms[g.nroom - 1].doorct; @@ -1336,8 +1169,6 @@ boolean ghostly; trap = newtrap(); if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t)trap, sizeof(struct trap)); - if (nhfp->fieldlevel) - sfi_trap(nhfp, trap, "trap", "trap", 1); if (trap->tx != 0) { trap->ntrap = g.ftrap; g.ftrap = trap; @@ -1461,10 +1292,6 @@ char *plbuf; (void) read(nhfp->fd, (genericptr_t) &pltmpsiz, sizeof(pltmpsiz)); (void) read(nhfp->fd, (genericptr_t) plbuf, pltmpsiz); } - if (nhfp->fieldlevel) { - sfi_int(nhfp, &pltmpsiz, "plname", "plname_size", 1); - sfi_str(nhfp, plbuf, "plname", "g.plname", pltmpsiz); - } return; } @@ -1478,16 +1305,12 @@ NHFILE *nhfp; while (1) { if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &msgsize, sizeof(msgsize)); - if (nhfp->fieldlevel) - sfi_int(nhfp, &msgsize, "msghistory", "msghistory_length", 1); if (msgsize == -1) break; if (msgsize > (BUFSZ - 1)) panic("restore_msghistory: msg too big (%d)", msgsize); if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) msg, msgsize); - if (nhfp->fieldlevel) - sfi_str(nhfp, msg, "msghistory", "msg", msgsize); msg[msgsize] = '\0'; putmsghistory(msg, TRUE); ++msgcount; @@ -1671,21 +1494,14 @@ const char *name; if (nhfp->structlevel) utdflags |= UTD_CHECKSIZES; - if (nhfp->fieldlevel) - utdflags |= UTD_CHECKFIELDCOUNTS | - UTD_SKIP_SANITY1 | UTD_SKIP_SAVEFILEINFO; if (!(reslt = uptodate(nhfp, name, utdflags))) return 1; if ((nhfp->mode & WRITING) == 0) { if (nhfp->structlevel) rlen = read(nhfp->fd, (genericptr_t) &sfi, sizeof sfi); - if (nhfp->fieldlevel) - sfi_savefile_info(nhfp, &sfi, "savefileinfo", "savefile_info", 1); } else { if (nhfp->structlevel) rlen = read(nhfp->fd, (genericptr_t) &sfi, sizeof sfi); - if (nhfp->fieldlevel) - sfi_savefile_info(nhfp, &sfi, "savefileinfo", "savefile_info", 1); minit(); /* ZEROCOMP */ if (rlen == 0) { if (verbose) { diff --git a/src/rumors.c b/src/rumors.c index b5be74ff4..4b4e7236f 100644 --- a/src/rumors.c +++ b/src/rumors.c @@ -6,8 +6,6 @@ #include "hack.h" #include "lev.h" #include "dlb.h" -#include "sfproto.h" - /* [note: this comment is fairly old, but still accurate for 3.1] * Rumors have been entirely rewritten to speed up the access. This is @@ -393,16 +391,10 @@ NHFILE *nhfp; if (perform_bwrite(nhfp)) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &g.oracle_cnt, sizeof g.oracle_cnt); - if (nhfp->fieldlevel) - sfo_unsigned(nhfp, &g.oracle_cnt, "oracles", "g.oracle_cnt", 1); if (g.oracle_cnt) { if (nhfp->structlevel) { bwrite(nhfp->fd, (genericptr_t)g.oracle_loc, g.oracle_cnt * sizeof (long)); } - if (nhfp->fieldlevel) { - for (i = 0; (unsigned) i < g.oracle_cnt; ++i) - sfo_ulong(nhfp, &g.oracle_loc[i], "oracles", "oracle loc", 1); - } } } if (release_data(nhfp)) { @@ -420,18 +412,12 @@ NHFILE *nhfp; int i; if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &g.oracle_cnt, sizeof g.oracle_cnt); - if (nhfp->fieldlevel) - sfi_unsigned(nhfp, &g.oracle_cnt, "oracles", "g.oracle_cnt", 1); if (g.oracle_cnt) { g.oracle_loc = (unsigned long *) alloc(g.oracle_cnt * sizeof(long)); if (nhfp->structlevel) { mread(nhfp->fd, (genericptr_t) g.oracle_loc, g.oracle_cnt * sizeof (long)); } - if (nhfp->fieldlevel) { - for (i = 0; (unsigned) i < g.oracle_cnt; ++i) - sfi_ulong(nhfp, &g.oracle_loc[i], "oracles", "g.oracle_loc", 1); - } g.oracle_flg = 1; /* no need to call init_oracles() */ } } diff --git a/src/save.c b/src/save.c index 6f6c8c1fc..3cb7e1a8d 100644 --- a/src/save.c +++ b/src/save.c @@ -5,8 +5,6 @@ #include "hack.h" #include "lev.h" -#include "sfproto.h" - #ifndef NO_SIGNAL #include @@ -149,10 +147,6 @@ dosave0() (void) delete_savefile(); /* ab@unido */ return 0; } -#ifdef SAVEFILE_DEBUGGING - if (nhfp && nhfp->fieldlevel && nhfp->fplog) - (void) fprintf(nhfp->fplog, "# just opened\n"); -#endif vision_recalc(2); /* shut down vision to prevent problems in the event of an impossible() call */ @@ -202,9 +196,6 @@ dosave0() } #endif /* MFLOPPY */ - if (nhfp->fieldlevel && nhfp->addinfo && (nhfp->mode & WRITING)) - sfo_addinfo(nhfp, "NetHack", "start", "savefile", 0); - nhfp->mode = WRITING | FREEING; store_version(nhfp); store_savefileinfo(nhfp); @@ -259,8 +250,6 @@ dosave0() close_nhfile(onhfp); if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) <mp, sizeof ltmp); /* level number*/ - if (nhfp->fieldlevel) - sfo_xchar(nhfp, <mp, "gamestate", "level_number", 1); /* xchar */ savelev(nhfp, ltmp); /* actual level*/ delete_levelfile(ltmp); } @@ -294,14 +283,6 @@ NHFILE *nhfp; bwrite(nhfp->fd, (genericptr_t) &flags, sizeof flags); #ifdef SYSFLAGS bwrite(nhfp->fd, (genericptr_t) &sysflags, sysflags); -#endif - } - if (nhfp->fieldlevel) { - sfo_ulong(nhfp, &uid, "gamestate", "uid", 1); - sfo_context_info(nhfp, &g.context, "gamestate", "g.context", 1); - sfo_flag(nhfp, &flags, "gamestate" , "flags", 1); -#ifdef SYSFLAGS - sfo_flag(nhfp, &sysflags, "gamestate" , "sysflags", 1); #endif } urealtime.finish_time = getnow(); @@ -318,12 +299,6 @@ NHFILE *nhfp; sizeof urealtime.realtime); bwrite(nhfp->fd, yyyymmddhhmmss(urealtime.start_timing), 14); } - if (nhfp->fieldlevel) { - sfo_you(nhfp, &u, "gamestate", "you", 1); - sfo_str(nhfp, yyyymmddhhmmss(ubirthday), "gamestate", "ubirthday", 14); - sfo_long(nhfp, &urealtime.realtime, "gamestate", "realtime", 1); - sfo_str(nhfp, yyyymmddhhmmss(urealtime.start_timing), "gamestate", "start_timing", 14); - } /* this is the value to use for the next update of urealtime.realtime */ urealtime.start_timing = urealtime.finish_time; save_killers(nhfp); @@ -355,12 +330,6 @@ NHFILE *nhfp; } if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) g.mvitals, sizeof g.mvitals); - if (nhfp->fieldlevel) { - int i; - - for (i = 0; i < NUMMONS; ++i) - sfo_mvitals(nhfp, &g.mvitals[i], "gamestate", "g.mvitals", 1); - } save_dungeon(nhfp, (boolean) !!perform_bwrite(nhfp), (boolean) !!release_data(nhfp)); savelevchn(nhfp); @@ -371,39 +340,20 @@ NHFILE *nhfp; bwrite(nhfp->fd, (genericptr_t) g.spl_book, sizeof (struct spell) * (MAXSPELL + 1)); } - if (nhfp->fieldlevel) { - int i; - struct spell *sptmp; - - sfo_long(nhfp, &g.moves, "gamestate", "g.moves", 1); - sfo_long(nhfp, &g.monstermoves, "gamestate", "g.monstermoves", 1); - sfo_q_score(nhfp, &g.quest_status, "gamestate", "g.quest_status", 1); - sptmp = g.spl_book; - for (i = 0; i < (MAXSPELL + 1); ++i) - sfo_spell(nhfp, sptmp++, "gamestate", "g.spl_book", 1); - } save_artifacts(nhfp); save_oracles(nhfp); if (g.ustuck_id) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &g.ustuck_id, sizeof g.ustuck_id); - if (nhfp->fieldlevel) - sfo_unsigned(nhfp, &g.ustuck_id, "gamestate", "g.ustuck_id", 1); } if (g.usteed_id) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &g.usteed_id, sizeof g.usteed_id); - if (nhfp->fieldlevel) - sfo_unsigned(nhfp, &g.usteed_id, "gamestate", "g.usteed_id", 1); } if (nhfp->structlevel) { bwrite(nhfp->fd, (genericptr_t) g.pl_character, sizeof g.pl_character); bwrite(nhfp->fd, (genericptr_t) g.pl_fruit, sizeof g.pl_fruit); } - if (nhfp->fieldlevel) { - sfo_char(nhfp, g.pl_character, "gamestate", "g.pl_character", sizeof g.pl_character); - sfo_char(nhfp, g.pl_fruit, "gamestate", "g.pl_fruit", sizeof g.pl_fruit); - } savefruitchn(nhfp); savenames(nhfp); save_waterlevel(nhfp); @@ -478,15 +428,11 @@ savestateinlock() nhfp->mode = WRITING; if (nhfp->structlevel) (void) write(nhfp->fd, (genericptr_t) &g.hackpid, sizeof g.hackpid); - if (nhfp->fieldlevel) - sfo_int(nhfp, &g.hackpid, "gamestate", "g.hackpid", 1); if (flags.ins_chkpt) { int currlev = ledger_no(&u.uz); if (nhfp->structlevel) (void) write(nhfp->fd, (genericptr_t) &currlev, sizeof currlev); - if (nhfp->fieldlevel) - sfo_int(nhfp, &currlev, "gamestate", "savestateinlock", 1); save_savefile_name(nhfp); store_version(nhfp); store_savefileinfo(nhfp); @@ -582,20 +528,14 @@ xchar lev; g.level_info[lev].flags |= VISITED; if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &g.hackpid, sizeof g.hackpid); - if (nhfp->fieldlevel) - sfo_int(nhfp, &g.hackpid, "gamestate", "g.hackpid", 1); #ifdef TOS tlev = lev; tlev &= 0x00ff; if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &tlev, sizeof tlev); - if (nhfp->fieldlevel) - sfo_short(nhfp, &tlev, "gamestate", "tlev", 1); #else if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &lev, sizeof lev); - if (nhfp->fieldlevel) - sfo_xchar(nhfp, &lev, "gamestate", "dlvl", 1); #endif } @@ -623,24 +563,6 @@ xchar lev; bwrite(nhfp->fd, (genericptr_t) &g.level.flags, sizeof g.level.flags); bwrite(nhfp->fd, (genericptr_t) g.doors, sizeof g.doors); } - if (nhfp->fieldlevel) { - int i, c, r; - - for (c = 0; c < COLNO; ++c) - for (r = 0; r < ROWNO; ++r) - sfo_schar(nhfp, &g.lastseentyp[c][r], "lev", "g.lastseentyp", 1); - sfo_long(nhfp, &g.monstermoves, "lev", "timestmp", 1); - sfo_stairway(nhfp, &g.upstair, "lev", "g.upstair", 1); - sfo_stairway(nhfp, &g.dnstair, "lev", "g.dnstair", 1); - sfo_stairway(nhfp, &g.upladder, "lev", "g.upladder", 1); - sfo_stairway(nhfp, &g.dnladder, "lev", "g.dnladder", 1); - sfo_stairway(nhfp, &g.sstairs, "lev", "g.sstairs", 1); - sfo_dest_area(nhfp, &g.updest, "lev", "g.updest", 1); - sfo_dest_area(nhfp, &g.dndest, "lev", "g.dndest", 1); - sfo_levelflags(nhfp, &g.level.flags, "lev", "g.level.flags", 1); - for (i = 0; i < DOORMAX; ++i) - sfo_nhcoord(nhfp, &g.doors[i], "lev", "door", 1); - } save_rooms(nhfp); /* no dynamic memory to reclaim */ /* from here on out, saving also involves allocated memory cleanup */ @@ -719,10 +641,6 @@ boolean rlecomp; bwrite(nhfp->fd, (genericptr_t) &match, sizeof (uchar)); bwrite(nhfp->fd, (genericptr_t) rgrm, sizeof (struct rm)); } - if (nhfp->fieldlevel) { - sfo_uchar(nhfp, &match, "levl", "match", 1); - sfo_rm(nhfp, rgrm, "levl", "rgrm", 1); - } /* start encoding again. we have at least 1 rm in the next run, viz. this one. */ match = 1; @@ -735,10 +653,6 @@ boolean rlecomp; bwrite(nhfp->fd, (genericptr_t) &match, sizeof (uchar)); bwrite(nhfp->fd, (genericptr_t) rgrm, sizeof (struct rm)); } - if (nhfp->fieldlevel) { - sfo_uchar(nhfp, &match, "levl", "match", 1); - sfo_rm(nhfp, rgrm, "levl", "rgrm", 1); - } } return; } @@ -748,13 +662,6 @@ boolean rlecomp; if (nhfp->structlevel) { bwrite(nhfp->fd, (genericptr_t) levl, sizeof levl); } - if (nhfp->fieldlevel) { - int c, r; - - for (c = 0; c < COLNO; ++c) - for (r = 0; r < ROWNO; ++r) - sfo_rm(nhfp, &g.level.locations[c][r], "room", "levl", 1); - } } /* used when saving a level and also when saving dungeon overview data */ @@ -770,8 +677,6 @@ struct cemetery **cemeteryaddr; if (perform_bwrite(nhfp)) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &flag, sizeof flag); - if (nhfp->fieldlevel) - sfo_int(nhfp, &flag, "cemetery", "cemetery_flag", 1); } nextbones = *cemeteryaddr; while ((thisbones = nextbones) != 0) { @@ -779,8 +684,6 @@ struct cemetery **cemeteryaddr; if (perform_bwrite(nhfp)) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) thisbones, sizeof *thisbones); - if (nhfp->fieldlevel) - sfo_cemetery(nhfp, thisbones, "cemetery", "cemetery", 1); } if (release_data(nhfp)) free((genericptr_t) thisbones); @@ -802,15 +705,11 @@ NHFILE *nhfp; if (perform_bwrite(nhfp)) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &xl, sizeof xl); - if (nhfp->fieldlevel) - sfo_unsigned(nhfp, &xl, "damage", "damage_count", 1); } while (xl--) { if (perform_bwrite(nhfp)) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) damageptr, sizeof *damageptr); - if (nhfp->fieldlevel) - sfo_damage(nhfp, damageptr, "damage", "damage", 1); } tmp_dam = damageptr; damageptr = damageptr->next; @@ -833,22 +732,14 @@ struct obj *otmp; bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen); bwrite(nhfp->fd, (genericptr_t) otmp, buflen); } - if (nhfp->fieldlevel) { - sfo_int(nhfp, &buflen, "obj", "obj_length", 1); - sfo_obj(nhfp, otmp, "obj", "obj", 1); - } if (otmp->oextra) { buflen = ONAME(otmp) ? (int) strlen(ONAME(otmp)) + 1 : 0; if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen); - if (nhfp->fieldlevel) - sfo_int(nhfp, &buflen, "obj", "oname_length", 1); if (buflen > 0) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) ONAME(otmp), buflen); - if (nhfp->fieldlevel) - sfo_str(nhfp, ONAME(otmp), "obj", "oname", buflen); } /* defer to savemon() for this one */ if (OMONST(otmp)) { @@ -856,43 +747,29 @@ struct obj *otmp; } else { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &zerobuf, sizeof zerobuf); - if (nhfp->fieldlevel) - sfo_int(nhfp, &zerobuf, "obj", "omonst_length", 1); } buflen = OMID(otmp) ? (int) sizeof (unsigned) : 0; if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen); - if (nhfp->fieldlevel) - sfo_int(nhfp, &buflen, "obj", "omid_length", 1); if (buflen > 0) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) OMID(otmp), buflen); - if (nhfp->fieldlevel) - sfo_int(nhfp, &buflen, "obj", "omid_length", 1); } /* TODO: post 3.6.x, get rid of this */ buflen = OLONG(otmp) ? (int) sizeof (long) : 0; if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen); - if (nhfp->fieldlevel) - sfo_int(nhfp, &buflen, "obj", "olong_length", 1); if (buflen > 0) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) OLONG(otmp), buflen); - if (nhfp->fieldlevel) - sfo_long(nhfp, OLONG(otmp), "obj", "olong", 1); } buflen = OMAILCMD(otmp) ? (int) strlen(OMAILCMD(otmp)) + 1 : 0; if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen); - if (nhfp->fieldlevel) - sfo_int(nhfp, &buflen, "obj", "omailcmd_length", 1); if (buflen > 0) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) OMAILCMD(otmp), buflen); - if (nhfp->fieldlevel) - sfo_str(nhfp, OMAILCMD(otmp), "obj", "omailcmd", buflen); } } } @@ -943,8 +820,6 @@ register struct obj *otmp; if (perform_bwrite(nhfp)) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &minusone, sizeof (int)); - if (nhfp->fieldlevel) - sfo_int(nhfp, &minusone, "obj", "obj_length", 1); } } @@ -962,83 +837,53 @@ struct monst *mtmp; bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen); bwrite(nhfp->fd, (genericptr_t) mtmp, buflen); } - if (nhfp->fieldlevel) { - sfo_int(nhfp, &buflen, "mon", "monst_length", 1); - sfo_monst(nhfp, mtmp, "mon", "monst", 1); - } if (mtmp->mextra) { buflen = MNAME(mtmp) ? (int) strlen(MNAME(mtmp)) + 1 : 0; if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen); - if (nhfp->fieldlevel) - sfo_int(nhfp, &buflen, "mon", "mname_length", 1); if (buflen > 0) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) MNAME(mtmp), buflen); - if (nhfp->fieldlevel) - sfo_str(nhfp, MNAME(mtmp), "mon", "mname", buflen); } buflen = EGD(mtmp) ? (int) sizeof (struct egd) : 0; if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen); - if (nhfp->fieldlevel) - sfo_int(nhfp, &buflen, "mon", "egd_length", 1); if (buflen > 0) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) EGD(mtmp), buflen); - if (nhfp->fieldlevel) - sfo_egd(nhfp, EGD(mtmp), "mon", "egd", 1); } buflen = EPRI(mtmp) ? (int) sizeof (struct epri) : 0; if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof buflen); - if (nhfp->fieldlevel) - sfo_int(nhfp, &buflen, "mon", "epri_length", 1); if (buflen > 0) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) EPRI(mtmp), buflen); - if (nhfp->fieldlevel) - sfo_epri(nhfp, EPRI(mtmp), "mon", "epri", 1); } buflen = ESHK(mtmp) ? (int) sizeof (struct eshk) : 0; if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof (int)); - if (nhfp->fieldlevel) - sfo_int(nhfp, &buflen, "mon", "eshk_length", 1); if (buflen > 0) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) ESHK(mtmp), buflen); - if (nhfp->fieldlevel) - sfo_eshk(nhfp, ESHK(mtmp), "mon", "eshk", 1); } buflen = EMIN(mtmp) ? (int) sizeof (struct emin) : 0; if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof (int)); - if (nhfp->fieldlevel) - sfo_int(nhfp, &buflen, "mon", "emin_length", 1); if (buflen > 0) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) EMIN(mtmp), buflen); - if (nhfp->fieldlevel) - sfo_emin(nhfp, EMIN(mtmp), "mon", "emin", 1); } buflen = EDOG(mtmp) ? (int) sizeof (struct edog) : 0; if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &buflen, sizeof (int)); - if (nhfp->fieldlevel) - sfo_int(nhfp, &buflen, "mon", "edog_length", 1); if (buflen > 0) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) EDOG(mtmp), buflen); - if (nhfp->fieldlevel) - sfo_edog(nhfp, EDOG(mtmp), "mon", "edog", 1); } /* mcorpsenm is inline int rather than pointer to something, so doesn't need to be preceded by a length field */ if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &MCORPSENM(mtmp), sizeof MCORPSENM(mtmp)); - if (nhfp->fieldlevel) - sfo_int(nhfp, &MCORPSENM(mtmp), "mon", "mcorpsenm", 1); } } @@ -1073,8 +918,6 @@ register struct monst *mtmp; if (perform_bwrite(nhfp)) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &minusone, sizeof (int)); - if (nhfp->fieldlevel) - sfo_int(nhfp, &minusone, "mon", "monst_length", 1); } } @@ -1092,8 +935,6 @@ register struct trap *trap; if (perform_bwrite(nhfp)) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) trap, sizeof *trap); - if (nhfp->fieldlevel) - sfo_trap(nhfp, trap, "trap", "trap", 1); } if (release_data(nhfp)) dealloc_trap(trap); @@ -1102,8 +943,6 @@ register struct trap *trap; if (perform_bwrite(nhfp)) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &zerotrap, sizeof zerotrap); - if (nhfp->fieldlevel) - sfo_trap(nhfp, &zerotrap, "trap", "trap", 1); } } @@ -1125,8 +964,6 @@ NHFILE *nhfp; if (f1->fid >= 0 && perform_bwrite(nhfp)) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) f1, sizeof *f1); - if (nhfp->fieldlevel) - sfo_fruit(nhfp, f1, "fruit", "fruit", 1); } if (release_data(nhfp)) dealloc_fruit(f1); @@ -1135,8 +972,6 @@ NHFILE *nhfp; if (perform_bwrite(nhfp)) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &zerofruit, sizeof zerofruit); - if (nhfp->fieldlevel) - sfo_fruit(nhfp, &zerofruit, "fruit", "terminator", 1); } if (release_data(nhfp)) g.ffruit = 0; @@ -1156,16 +991,12 @@ NHFILE *nhfp; if (perform_bwrite(nhfp)) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &cnt, sizeof cnt); - if (nhfp->fieldlevel) - sfo_int(nhfp, &cnt, "levchn", "lev_count", 1); } for (tmplev = g.sp_levchn; tmplev; tmplev = tmplev2) { tmplev2 = tmplev->next; if (perform_bwrite(nhfp)) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) tmplev, sizeof *tmplev); - if (nhfp->fieldlevel) - sfo_s_level(nhfp, tmplev, "levchn", "s_level", 1); } if (release_data(nhfp)) free((genericptr_t) tmplev); @@ -1187,10 +1018,6 @@ NHFILE *nhfp; bwrite(nhfp->fd, (genericptr_t) g.plname, plsiztmp); bufon(nhfp->fd); } - if (nhfp->fieldlevel) { - sfo_int(nhfp, &plsiztmp, "plname", "plname_size", 1); - sfo_str(nhfp, g.plname, "plname", "g.plname", plsiztmp); - } return; } @@ -1218,16 +1045,10 @@ NHFILE *nhfp; bwrite(nhfp->fd, (genericptr_t) &msglen, sizeof msglen); bwrite(nhfp->fd, (genericptr_t) msg, msglen); } - if (nhfp->fieldlevel) { - sfo_int(nhfp, &msglen, "msghistory", "msghistory_length", 1); - sfo_str(nhfp, msg, "msghistory", "msg", msglen); - } ++msgcount; } if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &minusone, sizeof (int)); - if (nhfp->fieldlevel) - sfo_int(nhfp, &minusone, "msghistory", "msghistory_length", 1); } debugpline1("Stored %d messages into savefile.", msgcount); /* note: we don't attempt to handle release_data() here */ @@ -1254,9 +1075,6 @@ NHFILE *nhfp; bwrite(nhfp->fd, (genericptr_t) &sfsaveinfo, (unsigned) sizeof sfsaveinfo); bufon(nhfp->fd); } - if (nhfp->fieldlevel) { - sfo_savefile_info(nhfp, &sfsaveinfo, "savefileinfo", "savefile_info", 1); - } return; } diff --git a/src/sfascii.c b/src/sfascii.c deleted file mode 100644 index 673d47342..000000000 --- a/src/sfascii.c +++ /dev/null @@ -1,1233 +0,0 @@ -/* NetHack 3.7 sfascii.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ -/* Copyright (c) Michael Allison, 2019. */ -/* NetHack may be freely redistributed. See license for details. */ - -/* - * this is a proof-of-concept alternative output format. It doesn't - * offer value over the sflendian approach and is mostly used to test - * and confirm that alternative saveformat operates correctly. - */ - -#include "hack.h" -#include "integer.h" -#include "sfprocs.h" - -#if defined(MACOSX) || defined(VMS) -extern long long FDECL(atoll, (const char *)); -#endif - -static void FDECL(put_savefield, (NHFILE *, char *, size_t)); -char *FDECL(get_savefield, (NHFILE *, char *, size_t)); -#ifdef SAVEFILE_DEBUGGING -void FDECL(report_problem_ascii, (NHFILE *, const char *, const char *, const char *)); -#endif - -struct sf_procs ascii_sfo_procs = { - ".tx", - { - ascii_sfo_aligntyp, - ascii_sfo_any, - ascii_sfo_bitfield, - ascii_sfo_boolean, - ascii_sfo_char, - ascii_sfo_genericptr, - ascii_sfo_int, - ascii_sfo_long, - ascii_sfo_schar, - ascii_sfo_short, - ascii_sfo_size_t, - ascii_sfo_time_t, - ascii_sfo_unsigned, - ascii_sfo_uchar, - ascii_sfo_uint, - ascii_sfo_ulong, - ascii_sfo_ushort, - ascii_sfo_xchar, - ascii_sfo_str, - ascii_sfo_addinfo, - } -}; - -struct sf_procs ascii_sfi_procs = -{ - ".tx", - { - ascii_sfi_aligntyp, - ascii_sfi_any, - ascii_sfi_bitfield, - ascii_sfi_boolean, - ascii_sfi_char, - ascii_sfi_genericptr, - ascii_sfi_int, - ascii_sfi_long, - ascii_sfi_schar, - ascii_sfi_short, - ascii_sfi_size_t, - ascii_sfi_time_t, - ascii_sfi_unsigned, - ascii_sfi_uchar, - ascii_sfi_uint, - ascii_sfi_ulong, - ascii_sfi_ushort, - ascii_sfi_xchar, - ascii_sfi_str, - ascii_sfi_addinfo, - } -}; - -static char linebuf[BUFSZ]; -static char outbuf[BUFSZ]; - -/* - *---------------------------------------------------------------------------- - * sfo_def_ routines - * - * Default output routines. - * - *---------------------------------------------------------------------------- - */ - -void -ascii_sfo_any(nhfp, d_any, myparent, myname, cnt) -NHFILE *nhfp; -union any *d_any; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt UNUSED; -{ - /* const char *parent = "any"; */ - - /* nhUse(parent); */ - Sprintf(outbuf, "%llx", (unsigned long long) d_any->a_void); - put_savefield(nhfp, outbuf, BUFSZ); - - Sprintf(outbuf, "%lu", d_any->a_ulong); - put_savefield(nhfp, outbuf, BUFSZ); - - Sprintf(outbuf, "%ld", d_any->a_long); - put_savefield(nhfp, outbuf, BUFSZ); - - Sprintf(outbuf, "%d", d_any->a_uint); - put_savefield(nhfp, outbuf, BUFSZ); - - Sprintf(outbuf, "%d", d_any->a_int);; - put_savefield(nhfp, outbuf, BUFSZ); - - Sprintf(outbuf, "%hd", (short) d_any->a_char); - put_savefield(nhfp, outbuf, BUFSZ); - -#if 0 - sfo_genericptr(nhfp, d_any->a_void, parent, "a_void", 1); /* (genericptr_t) */ - sfo_genericptr(nhfp, d_any->a_obj, parent, "a_obj", 1); /* (struct obj *) */ - sfo_genericptr(nhfp, d_any->a_monst, parent, "a_monst", 1); /* (struct monst *) */ - sfo_int(nhfp, &d_any->a_int, parent, "a_int", 1); /* (int) */ - sfo_char(nhfp, &d_any->a_char, parent, "a_char", 1); /* (char) */ - sfo_schar(nhfp, &d_any->a_schar, parent, "a_schar", 1); /* (schar) */ - sfo_uchar(nhfp, &d_any->a_uchar, parent, "a_uchar", 1); /* (uchar) */ - sfo_uint(nhfp, &d_any->a_uint, parent, "a_uint", 1); /* (unsigned int) */ - sfo_long(nhfp, &d_any->a_long, parent, "a_long", 1); /* (long) */ - sfo_ulong(nhfp, &d_any->a_ulong, parent, "a_ulong", 1); /* (unsigned long) */ - sfo_genericptr(nhfp, d_any->a_iptr, parent, "a_iptr", 1); /* (int *) */ - sfo_genericptr(nhfp, d_any->a_lptr, parent, "a_lptr", 1); /* (long *) */ - sfo_genericptr(nhfp, d_any->a_ulptr, parent, "a_ulptr", 1); /* (unsigned long *) */ - sfo_genericptr(nhfp, d_any->a_uptr, parent, "a_uptr", 1); /* (unsigned *) */my - sfo_genericptr(nhfp, d_any->a_string, parent, "a_string", 1); /* (const char *) */ - sfo_ulong(nhfp, &d_any->a_mask32, parent, "a_mask32", 1); /* (unsigned long) */ -#endif -} - -void -ascii_sfo_aligntyp(nhfp, d_aligntyp, myparent, myname, cnt) -NHFILE *nhfp; -aligntyp *d_aligntyp; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt UNUSED; -{ - int itmp; -#if 0 - const char *parent = "aligntyp"; - - nhUse(parent); -#endif - itmp = (int) *d_aligntyp; - Sprintf(outbuf, "%d", (short) itmp); - put_savefield(nhfp, outbuf, BUFSZ); -} - -void -ascii_sfo_bitfield(nhfp, d_bitfield, myparent, myname, cnt) -NHFILE *nhfp; -uint8_t *d_bitfield; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt UNUSED; -{ -#if 0 - const char *parent = "bitfield"; - - nhUse(parent); -#endif - /* for bitfields, cnt is the number of bits, not an array */ - Sprintf(outbuf, "%hu", (unsigned short) *d_bitfield); - put_savefield(nhfp, outbuf, BUFSZ); -} - -void -ascii_sfo_boolean(nhfp, d_boolean, myparent, myname, cnt) -NHFILE *nhfp; -boolean *d_boolean; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; -#if 0 - const char *parent = "boolean"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - if (nhfp->fpdebug) - fprintf(nhfp->fpdebug, "(%s)\n", (*d_boolean) ? "TRUE" : "FALSE"); - Sprintf(outbuf, "%s", *d_boolean ? "true" : "false"); - put_savefield(nhfp, outbuf, BUFSZ); - d_boolean++; - } -} - -void -ascii_sfo_char(nhfp, d_char, myparent, myname, cnt) -NHFILE *nhfp; -char *d_char; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i = cnt; -#if 0 - const char *parent = "char"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - if (nhfp->fpdebug) - fprintf(nhfp->fpdebug, "(%s)\n", d_char ? d_char : ""); - Sprintf(outbuf, "%hd", (short) *d_char); - put_savefield(nhfp, outbuf, BUFSZ); - d_char++; - } -} - -void -ascii_sfo_genericptr(nhfp, d_genericptr, myparent, myname, cnt) -NHFILE *nhfp; -genericptr_t *d_genericptr; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - unsigned long tmp; - char *byteptr = (char *) d_genericptr; -#if 0 - const char *parent = "genericptr"; - - nhUse(parent); -#endif - /* - * sbrooms is an array of pointers to mkroom. - * That array dimension is MAX_SUBROOMS. - * Even though the pointers themselves won't - * be valid, we need to account for the existence - * of that array and perhaps zero or non-zero. - */ - for (i = 0; i < cnt; ++i) { - tmp = (*d_genericptr) ? 1UL : 0UL; - Sprintf(outbuf, "%08lu", tmp); - put_savefield(nhfp, outbuf, BUFSZ); - if (cnt > 1) { - byteptr += sizeof(void *); - d_genericptr = (genericptr_t) byteptr; - } - } -} - -void -ascii_sfo_int(nhfp, d_int, myparent, myname, cnt) -NHFILE *nhfp; -int *d_int; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; -#if 0 - const char *parent = "int"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - Sprintf(outbuf, "%d", *d_int); - put_savefield(nhfp, outbuf, BUFSZ); - d_int++; - } -} - -void -ascii_sfo_long(nhfp, d_long, myparent, myname, cnt) -NHFILE *nhfp; -long *d_long; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; -#if 0 - const char *parent = "long"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - Sprintf(outbuf, "%ld", *d_long); - put_savefield(nhfp, outbuf, BUFSZ); - d_long++; - } -} - -void -ascii_sfo_schar(nhfp, d_schar, myparent, myname, cnt) -NHFILE *nhfp; -schar *d_schar; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i, itmp; -#if 0 - const char *parent = "schar"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - itmp = (int) *d_schar; - Sprintf(outbuf, "%d", itmp); - put_savefield(nhfp, outbuf, BUFSZ); - d_schar++; - } -} - -void -ascii_sfo_short(nhfp, d_short, myparent, myname, cnt) -NHFILE *nhfp; -short *d_short; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; -#if 0 - const char *parent = "short"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - Sprintf(outbuf, "%hd", *d_short); - put_savefield(nhfp, outbuf, BUFSZ); - d_short++; - } -} - -void -ascii_sfo_size_t(nhfp, d_size_t, myparent, myname, cnt) -NHFILE *nhfp; -size_t *d_size_t; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; -#if 0 - const char *parent = "size_t"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - unsigned long ul = (unsigned long) *d_size_t; - - Sprintf(outbuf, "%lu", ul); - put_savefield(nhfp, outbuf, BUFSZ); - d_size_t++; - } -} - -void -ascii_sfo_time_t(nhfp, d_time_t, myparent, myname, cnt) -NHFILE *nhfp; -time_t *d_time_t; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt UNUSED; -{ -#if 0 - const char *parent = "time_t"; - - nhUse(parent); -#endif - Sprintf(outbuf, "%s", yyyymmddhhmmss(*d_time_t)); - put_savefield(nhfp, outbuf, BUFSZ); -} - -void -ascii_sfo_unsigned(nhfp, d_unsigned, myparent, myname, cnt) -NHFILE *nhfp; -unsigned *d_unsigned; -const char *myparent; -const char *myname; -int cnt; -{ - ascii_sfo_uint(nhfp, d_unsigned, myparent, myname, cnt); -} - -void -ascii_sfo_uchar(nhfp, d_uchar, myparent, myname, cnt) -NHFILE *nhfp; -unsigned char *d_uchar; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; -#if 0 - const char *parent = "uchar"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - unsigned short us = (unsigned short) *d_uchar; - - Sprintf(outbuf, "%hu", us); - put_savefield(nhfp, outbuf, BUFSZ); - d_uchar++; - } -} - -void -ascii_sfo_uint(nhfp, d_uint, myparent, myname, cnt) -NHFILE *nhfp; -unsigned int *d_uint; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; -#if 0 - const char *parent = "uint"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - Sprintf(outbuf, "%u", *d_uint); - put_savefield(nhfp, outbuf, BUFSZ); - d_uint++; - } -} - -void -ascii_sfo_ulong(nhfp, d_ulong, myparent, myname, cnt) -NHFILE *nhfp; -unsigned long *d_ulong; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; -#if 0 - const char *parent = "ulong"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - Sprintf(outbuf, "%lu", *d_ulong); - put_savefield(nhfp, outbuf, BUFSZ); - d_ulong++; - } -} - -void -ascii_sfo_ushort(nhfp, d_ushort, myparent, myname, cnt) -NHFILE *nhfp; -unsigned short *d_ushort; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; -#if 0 - const char *parent = "ushort"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - Sprintf(outbuf, "%hu", *d_ushort); - put_savefield(nhfp, outbuf, BUFSZ); - d_ushort++; - } -} - -void -ascii_sfo_xchar(nhfp, d_xchar, myparent, myname, cnt) -NHFILE *nhfp; -xchar *d_xchar; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; -#if 0 - const char *parent = "xchar"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - short tmp; - - tmp = (short) *d_xchar; - Sprintf(outbuf, "%hu", tmp); - put_savefield(nhfp, outbuf, BUFSZ); - d_xchar++; - } -} - -static char strbuf[BUFSZ * 4]; - -void -ascii_sfo_str(nhfp, d_str, myparent, myname, cnt) -NHFILE *nhfp; -char *d_str; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i, j, intval; -#if 0 - const char *parent = "str"; -#endif - char sval[QBUFSZ], *src = d_str, *dest = strbuf; - -#if 0 - nhUse(parent); -#endif - /* cnt is the number of characters */ - for (i = 0; i < cnt; ++i) { - if ((*src < 32) || (*src == '\\') || (*src > 127)) { - *dest++ = '\\'; - intval = (int) *src++; - Sprintf(sval, "%03d", intval); - for (j = 0; j < 3; ++j) - *dest++ = sval[j]; - } else { - *dest++ = *src++; - } - } - put_savefield(nhfp, strbuf, BUFSZ * 4); -} - -void -ascii_sfo_addinfo(nhfp, parent, action, myname, indx) -NHFILE *nhfp UNUSED; -const char *parent UNUSED, *action UNUSED, *myname UNUSED; -int indx UNUSED; -{ - /* ignored */ -} - - -static void -put_savefield(nhfp, obuf, outbufsz) -NHFILE *nhfp; -char *obuf; -size_t outbufsz UNUSED; -{ - nhfp->count++; - fprintf(nhfp->fpdef, "%07ld|%s\n", nhfp->count, obuf); -} - -/* - *---------------------------------------------------------------------------- - * ascii_sfi_ routines called from functions in sfi_base.c - *---------------------------------------------------------------------------- - */ - -void -ascii_sfi_any(nhfp, d_any, myparent, myname, cnt) -NHFILE *nhfp; -union any *d_any; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt UNUSED; -{ - char *rstr; - long long tmp; -#if 0 - const char *parent = "any"; - - nhUse(parent); -#endif - rstr = get_savefield(nhfp, linebuf, BUFSZ); - tmp = atoll(rstr); - d_any->a_void = (void *) tmp; - - rstr = get_savefield(nhfp, linebuf, BUFSZ); - tmp = atoll(rstr); - d_any->a_ulong = (unsigned long) tmp; - - rstr = get_savefield(nhfp, linebuf, BUFSZ); - d_any->a_long = atol(rstr); - - rstr = get_savefield(nhfp, linebuf, BUFSZ); - tmp = atoll(rstr); - d_any->a_uint = (unsigned int) tmp; - - rstr = get_savefield(nhfp, linebuf, BUFSZ); - d_any->a_int = atoi(rstr); - - rstr = get_savefield(nhfp, linebuf, BUFSZ); - d_any->a_char = (char) atoi(rstr); - -#if 0 - sfi_genericptr(nhfp, d_any->a_void, parent, "a_void", 1); - sfi_genericptr(nhfp, d_any->a_obj, parent, "a_obj", 1); - sfi_genericptr(nhfp, d_any->a_monst, parent, "a_monst", 1); - sfi_int(nhfp, &d_any->a_int, parent, "a_int", 1); - sfi_char(nhfp, &d_any->a_char, parent, "a_char", 1); - sfi_schar(nhfp, &d_any->a_schar, parent, "a_schar", 1); - sfi_uchar(nhfp, &d_any->a_uchar, parent, "a_uchar", 1); - sfi_uint(nhfp, &d_any->a_uint, parent, "a_uint", 1); - sfi_long(nhfp, &d_any->a_long, parent, "a_long", 1); - sfi_ulong(nhfp, &d_any->a_ulong, parent, "a_ulong", 1); - sfi_genericptr(nhfp, d_any->a_iptr, parent, "a_iptr", 1); - sfi_genericptr(nhfp, d_any->a_lptr, parent, "a_lptr", 1); - sfi_genericptr(nhfp, d_any->a_ulptr, parent, "a_ulptr", 1); - sfi_genericptr(nhfp, d_any->a_uptr, parent, "a_uptr", 1); - sfi_genericptr(nhfp, d_any->a_string, parent, "a_string", 1); - sfi_ulong(nhfp, &d_any->a_mask32, parent, "a_mask32", 1); -#endif -} - -void -ascii_sfi_aligntyp(nhfp, d_aligntyp, myparent, myname, cnt) -NHFILE *nhfp; -aligntyp *d_aligntyp; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt UNUSED; -{ - char *rstr; - aligntyp tmp; - long long lltmp; -#if 0 - const char *parent = "aligntyp"; - - nhUse(parent); -#endif - rstr = get_savefield(nhfp, linebuf, BUFSZ); - lltmp = atoll(rstr); - tmp = (aligntyp) lltmp; -#ifdef SAVEFILE_DEBUGGING - if (nhfp->structlevel && tmp != *d_aligntyp) - report_problem_ascii(nhfp, myparent, myname, parent); - else -#endif - *d_aligntyp = tmp; -} - -void -ascii_sfi_bitfield(nhfp, d_bitfield, myparent, myname, cnt) -NHFILE *nhfp; -uint8_t *d_bitfield; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt UNUSED; -{ - char *rstr; - uint8_t tmp; -#if 0 - const char *parent = "bitfield"; - - nhUse(parent); -#endif - /* cnt is the number of bits in the bitfield, not an array dimension */ - rstr = get_savefield(nhfp, linebuf, BUFSZ); - tmp = (uint8_t) atoi(rstr); -#ifdef SAVEFILE_DEBUGGING - if (nhfp->structlevel && tmp != *d_bitfield) - report_problem_ascii(nhfp, myparent, myname, parent); - else -#endif - *d_bitfield = tmp; -} - -void -ascii_sfi_boolean(nhfp, d_boolean, myparent, myname, cnt) -NHFILE *nhfp; -boolean *d_boolean; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - char *rstr; - int i; -#if 0 - const char *parent = "boolean"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - rstr = get_savefield(nhfp, linebuf, BUFSZ); -#ifdef SAVEFILE_DEBUGGING - if (!strcmpi(rstr, "false") && - !strcmpi(rstr, "true")) - report_problem_ascii(nhfp, myparent, myname, parent); - else -#endif - if (!strcmpi(rstr, "false")) - *d_boolean = FALSE; - else - *d_boolean = TRUE; - d_boolean++; - } -} - -void -ascii_sfi_char(nhfp, d_char, myparent, myname, cnt) -NHFILE *nhfp; -char *d_char; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - char *rstr; - int i; - char tmp; -#if 0 - const char *parent = "char"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - rstr = get_savefield(nhfp, linebuf, BUFSZ); - tmp = (char) atoi(rstr); -#ifdef SAVEFILE_DEBUGGING - if (nhfp->structlevel && tmp != *d_char) - report_problem_ascii(nhfp, myparent, myname, parent); - else -#endif - *d_char = tmp; - d_char++; - } -} - -void -ascii_sfi_genericptr(nhfp, d_genericptr, myparent, myname, cnt) -NHFILE *nhfp; -genericptr_t *d_genericptr; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - long long lltmp; - char *rstr; -#if 0 - const char *parent = "genericptr"; -#endif - static const char *glorkum = "glorkum"; - char *byteptr = (char *) d_genericptr; - -#if 0 - nhUse(parent); -#endif - /* - * sbrooms is an array of pointers to mkroom. - * That array dimension is MAX_SUBROOMS. - * Even though the pointers themselves won't - * be valid, we need to account for the existence - * of that array. - */ - for (i = 0; i < cnt; ++i) { - /* these pointers can't actually be valid */ - byteptr = (char *) d_genericptr; - rstr = get_savefield(nhfp, linebuf, BUFSZ); - lltmp = atoll(rstr); - *d_genericptr = lltmp ? (genericptr_t) glorkum : (genericptr_t) 0; - if (cnt > 1) { - byteptr += sizeof(void *); - d_genericptr = (genericptr_t) byteptr; - } - } -} - -void -ascii_sfi_int(nhfp, d_int, myparent, myname, cnt) -NHFILE *nhfp; -int *d_int; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i, tmp; - char *rstr; - long long lltmp; -#if 0 - const char *parent = "int"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - rstr = get_savefield(nhfp, linebuf, BUFSZ); - lltmp = atoll(rstr); - tmp = (int) lltmp; -#ifdef SAVEFILE_DEBUGGING - if (nhfp->structlevel && tmp != *d_int) - report_problem_ascii(nhfp, myparent, myname, parent); - else -#endif - *d_int = tmp; - d_int++; - } -} - -void -ascii_sfi_long(nhfp, d_long, myparent, myname, cnt) -NHFILE *nhfp; -long *d_long; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - long tmp; - long long lltmp; - char *rstr; -#if 0 - const char *parent = "long"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - rstr = get_savefield(nhfp, linebuf, BUFSZ); - lltmp = atoll(rstr); - tmp = (long) lltmp; -#ifdef SAVEFILE_DEBUGGING - if (nhfp->structlevel && tmp != *d_long) - report_problem_ascii(nhfp, myparent, myname, parent); - else -#endif - *d_long = tmp; - d_long++; - } -} - -void -ascii_sfi_schar(nhfp, d_schar, myparent, myname, cnt) -NHFILE *nhfp; -schar *d_schar; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - schar tmp; - char *rstr; -#if 0 - const char *parent = "schar"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - rstr = get_savefield(nhfp, linebuf, BUFSZ); - tmp = (schar) atoi(rstr); -#ifdef SAVEFILE_DEBUGGING - if (nhfp->structlevel && tmp != *d_schar) - report_problem_ascii(nhfp, myparent, myname, parent); - else -#endif - *d_schar = tmp; - d_schar++; - } -} - -void -ascii_sfi_short(nhfp, d_short, myparent, myname, cnt) -NHFILE *nhfp; -short *d_short; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - short tmp; - char *rstr; -#if 0 - const char *parent = "short"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - rstr = get_savefield(nhfp, linebuf, BUFSZ); - tmp = (short) atoi(rstr); -#ifdef SAVEFILE_DEBUGGING - if (nhfp->structlevel && tmp != *d_short) - report_problem_ascii(nhfp, myparent, myname, parent); - else -#endif - *d_short = tmp; - d_short++; - } -} - -void -ascii_sfi_size_t(nhfp, d_size_t, myparent, myname, cnt) -NHFILE *nhfp; -size_t *d_size_t; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - size_t tmp; - char *rstr; -#if 0 - const char *parent = "size_t"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - rstr = get_savefield(nhfp, linebuf, BUFSZ); - tmp = (size_t) atol(rstr); -#ifdef SAVEFILE_DEBUGGING - if (nhfp->structlevel && tmp != *d_size_t) - report_problem_ascii(nhfp, myparent, myname, parent); - else -#endif - *d_size_t = tmp; - d_size_t++; - } -} - -void -ascii_sfi_time_t(nhfp, d_time_t, myparent, myname, cnt) -NHFILE *nhfp; -time_t *d_time_t; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt UNUSED; -{ - int i; - time_t tmp; - char *rstr; -#if 0 - const char *parent = "time_t"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - rstr = get_savefield(nhfp, linebuf, BUFSZ); - tmp = time_from_yyyymmddhhmmss(rstr); -#ifdef SAVEFILE_DEBUGGING - if (nhfp->structlevel && tmp != *d_time_t) - report_problem_ascii(nhfp, myparent, myname, parent); - else -#endif - *d_time_t = tmp; - d_time_t++; - } -} - -void -ascii_sfi_unsigned(nhfp, d_unsigned, myparent, myname, cnt) -NHFILE *nhfp; -unsigned *d_unsigned; -const char *myparent; -const char *myname; -int cnt; -{ - /* deferal */ - ascii_sfi_uint(nhfp, d_unsigned, myparent, myname, cnt); -} - -void -ascii_sfi_uchar(nhfp, d_uchar, myparent, myname, cnt) -NHFILE *nhfp; -unsigned char *d_uchar; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - uchar tmp; - int i, itmp; - char *rstr; -#if 0 - const char *parent = "uchar"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - rstr = get_savefield(nhfp, linebuf, BUFSZ); - itmp = atoi(rstr); - tmp = (char ) itmp; -#ifdef SAVEFILE_DEBUGGING - if (nhfp->structlevel && tmp != *d_uchar) - report_problem_ascii(nhfp, myparent, myname, parent); - else -#endif - *d_uchar = tmp; - d_uchar++; - } -} - -void -ascii_sfi_uint(nhfp, d_uint, myparent, myname, cnt) -NHFILE *nhfp; -unsigned int *d_uint; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - char *rstr; - unsigned int tmp; - long long lltmp; -#if 0 - const char *parent = "uint"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - rstr = get_savefield(nhfp, linebuf, BUFSZ); - lltmp = atoll(rstr); - tmp = (unsigned int) lltmp; -#ifdef SAVEFILE_DEBUGGING - if (nhfp->structlevel && tmp != *d_uint) - report_problem_ascii(nhfp, myparent, myname, parent); - else -#endif - *d_uint = tmp; - d_uint++; - } -} - -void -ascii_sfi_ulong(nhfp, d_ulong, myparent, myname, cnt) -NHFILE *nhfp; -unsigned long *d_ulong; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - unsigned long tmp; - long long lltmp; - char *rstr; -#if 0 - const char *parent = "ulong"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - rstr = get_savefield(nhfp, linebuf, BUFSZ); - lltmp = atoll(rstr); - tmp = (unsigned long) lltmp; -#ifdef SAVEFILE_DEBUGGING - if (nhfp->structlevel && tmp != *d_ulong) - report_problem_ascii(nhfp, myparent, myname, parent); - else -#endif - *d_ulong = tmp; - d_ulong++; - } -} - -void -ascii_sfi_ushort(nhfp, d_ushort, myparent, myname, cnt) -NHFILE *nhfp; -unsigned short *d_ushort; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - short tmp; - long long lltmp; - char *rstr; -#if 0 - const char *parent = "ushort"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - rstr = get_savefield(nhfp, linebuf, BUFSZ); - lltmp = atoll(rstr); - tmp = (unsigned short) lltmp; -#ifdef SAVEFILE_DEBUGGING - if (nhfp->structlevel && tmp != *d_ushort) - report_problem_ascii(nhfp, myparent, myname, parent); - else -#endif - *d_ushort = tmp; - d_ushort++; - } -} - -void -ascii_sfi_xchar(nhfp, d_xchar, myparent, myname, cnt) -NHFILE *nhfp; -xchar *d_xchar; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - xchar tmp; - int i, itmp; - char *rstr; -#if 0 - const char *parent = "xchar"; - - nhUse(parent); -#endif - for (i = 0; i < cnt; ++i) { - rstr = get_savefield(nhfp, linebuf, BUFSZ); - itmp = atoi(rstr); - tmp = (xchar) itmp; -#ifdef SAVEFILE_DEBUGGING - if (nhfp->structlevel && tmp != *d_xchar) - report_problem_ascii(nhfp, myparent, myname, parent); - else -#endif - *d_xchar = tmp; - d_xchar++; - } -} - -static char strbuf[BUFSZ * 4]; - -void -ascii_sfi_str(nhfp, d_str, myparent, myname, cnt) -NHFILE *nhfp; -char *d_str; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i, j, sval; - char n[4], *rstr; -#if 0 - const char *parent = "str"; -#endif - char *src, *dest; -#ifdef SAVEFILE_DEBUGGING - boolean match; - char testbuf[BUFSZ]; -#endif - -#if 0 - nhUse(parent); -#endif - /* cnt is the length of the string */ - rstr = get_savefield(nhfp, strbuf, BUFSZ * 4); - src = rstr; - dest = -#ifdef SAVEFILE_DEBUGGING - testbuf; -#else - d_str; -#endif - - for (i = 0; i < cnt; ++i) { - if (*src == '\\') { - src++; - for (j = 0; j < 4; ++j) { - if (j < 3) - n[j] = *src++; - else - n[j] = '\0'; - } - sval = atoi(n); - *dest++ = (char) sval; - } else - *dest++ = *src++; - } -#ifdef SAVEFILE_DEBUGGING - if (nhfp->structlevel) { - src = testbuf; - dest = d_str; - match = TRUE; - for (i = 0; i < cnt; ++i) { - if (*src++ != *dest++) - match = FALSE; - } - if (!match) - report_problem_ascii(nhfp, myparent, myname, parent); - else { - src = testbuf; - dest = d_str; - for (i = 0; i < cnt; ++i) - *dest++ = *src++; - } - } -#endif -} - -void -ascii_sfi_addinfo(nhfp, myparent, action, myname, indx) -NHFILE *nhfp UNUSED; -const char *myparent UNUSED, *action UNUSED, *myname UNUSED; -int indx UNUSED; -{ - /* not doing anything here */ -} - -char * -get_savefield(nhfp, inbuf, inbufsz) -NHFILE *nhfp; -char *inbuf; -size_t inbufsz; -{ - char *ep, *sep; - - if (fgets(inbuf, (int) inbufsz, nhfp->fpdef)) { - nhfp->count++; - ep = index(inbuf, '\n'); - if (!ep) { /* newline missing */ - if (strlen(inbuf) < (inbufsz - 2)) { - /* likely the last line of file is just - missing a newline; process it anyway */ - ep = eos(inbuf); - } - } - if (ep) - *ep = '\0'; /* remove newline */ - sep = index(inbuf, '|'); - if (sep) - sep++; - - return sep; - } - inbuf[0] = '\0'; - nhfp->eof = TRUE; - return inbuf; -} - -#ifdef SAVEFILE_DEBUGGING -void -report_problem_ascii(nhfp, s1, s2, s3) -NHFILE *nhfp; -const char *s1, *s2, *s3; -{ - fprintf(nhfp->fpdebug, "faulty value preservation " - "(%ld, %s, %s, %s)\n", nhfp->count, s1, s2, s3); -} -#endif - - diff --git a/src/sfbase.c b/src/sfbase.c deleted file mode 100644 index 396bdd03c..000000000 --- a/src/sfbase.c +++ /dev/null @@ -1,646 +0,0 @@ -/* NetHack 3.7 sf_base.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ -/* Copyright (c) Michael Allison, 2019. */ -/* NetHack may be freely redistributed. See license for details. */ - -#include "hack.h" -#include "integer.h" -#include "sfprocs.h" - -struct sf_procs sfoprocs[4], sfiprocs[4], - zerosfoprocs = {0}, zerosfiprocs = {0}; - -void FDECL(sfi_log, (NHFILE *, const char *, const char *, const char *, int)); - -/* - *---------------------------------------------------------------------------- - * initialize the function pointers. These are called from initoptions_init(). - *---------------------------------------------------------------------------- - */ - -void -sf_init() -{ - sfoprocs[invalid] = zerosfoprocs; - sfiprocs[invalid] = zerosfiprocs; - sfoprocs[historical] = zerosfoprocs; - sfiprocs[historical] = zerosfiprocs; - sfoprocs[lendian] = lendian_sfo_procs; - sfiprocs[lendian] = lendian_sfi_procs; - sfoprocs[ascii] = ascii_sfo_procs; - sfiprocs[ascii] = ascii_sfi_procs; -} - -/* - *---------------------------------------- - * routines called from engine core and - * from functions in generated sfdata.c - *---------------------------------------- - */ - -void -sfo_any(nhfp, d_any, myparent, myname, cnt) - NHFILE *nhfp; -union any *d_any; -const char *myparent; -const char *myname; -int cnt; -{ - (*sfoprocs[nhfp->fnidx].fn.sf_any)(nhfp, d_any, myparent, myname, cnt); -} - -void -sfo_aligntyp(nhfp, d_aligntyp, myparent, myname, cnt) -NHFILE *nhfp; -aligntyp *d_aligntyp; -const char *myparent; -const char *myname; -int cnt; -{ - (*sfoprocs[nhfp->fnidx].fn.sf_aligntyp)(nhfp, d_aligntyp, myparent, myname, cnt); -} - -void -sfo_bitfield(nhfp, d_bitfield, myparent, myname, cnt) -NHFILE *nhfp; -uint8_t *d_bitfield; -const char *myparent; -const char *myname; -int cnt; -{ - (*sfoprocs[nhfp->fnidx].fn.sf_bitfield)(nhfp, d_bitfield, myparent, myname, cnt); -} - -void -sfo_boolean(nhfp, d_boolean, myparent, myname, cnt) -NHFILE *nhfp; -boolean *d_boolean; -const char *myparent; -const char *myname; -int cnt; -{ - (*sfoprocs[nhfp->fnidx].fn.sf_boolean)(nhfp, d_boolean, myparent, myname, cnt); -} - -void -sfo_char(nhfp, d_char, myparent, myname, cnt) -NHFILE *nhfp; -char *d_char; -const char *myparent; -const char *myname; -int cnt; -{ - (*sfoprocs[nhfp->fnidx].fn.sf_char)(nhfp, d_char, myparent, myname, cnt); -} - -void -sfo_genericptr(nhfp, d_genericptr, myparent, myname, cnt) -NHFILE *nhfp; -genericptr_t d_genericptr; -const char *myparent; -const char *myname; -int cnt; -{ - (*sfoprocs[nhfp->fnidx].fn.sf_genericptr)(nhfp, d_genericptr, myparent, myname, cnt); -} - -void -sfo_int(nhfp, d_int, myparent, myname, cnt) -NHFILE *nhfp; -int *d_int; -const char *myparent; -const char *myname; -int cnt; -{ - (*sfoprocs[nhfp->fnidx].fn.sf_int)(nhfp, d_int, myparent, myname, cnt); -} - -void -sfo_long(nhfp, d_long, myparent, myname, cnt) -NHFILE *nhfp; -long *d_long; -const char *myparent; -const char *myname; -int cnt; -{ - (*sfoprocs[nhfp->fnidx].fn.sf_long)(nhfp, d_long, myparent, myname, cnt); -} - -void -sfo_schar(nhfp, d_schar, myparent, myname, cnt) -NHFILE *nhfp; -schar *d_schar; -const char *myparent; -const char *myname; -int cnt; -{ - (*sfoprocs[nhfp->fnidx].fn.sf_schar)(nhfp, d_schar, myparent, myname, cnt); -} - -void -sfo_short(nhfp, d_short, myparent, myname, cnt) -NHFILE *nhfp; -short *d_short; -const char *myparent; -const char *myname; -int cnt; -{ - (*sfoprocs[nhfp->fnidx].fn.sf_short)(nhfp, d_short, myparent, myname, cnt); -} - -void -sfo_size_t(nhfp, d_size_t, myparent, myname, cnt) -NHFILE *nhfp; -size_t *d_size_t; -const char *myparent; -const char *myname; -int cnt; -{ - (*sfoprocs[nhfp->fnidx].fn.sf_size_t)(nhfp, d_size_t, myparent, myname, cnt); -} - -void -sfo_time_t(nhfp, d_time_t, myparent, myname, cnt) -NHFILE *nhfp; -time_t *d_time_t; -const char *myparent; -const char *myname; -int cnt; -{ - (*sfoprocs[nhfp->fnidx].fn.sf_time_t)(nhfp, d_time_t, myparent, myname, cnt); -} - -void -sfo_unsigned(nhfp, d_unsigned, myparent, myname, cnt) -NHFILE *nhfp; -unsigned *d_unsigned; -const char *myparent; -const char *myname; -int cnt; -{ - (*sfoprocs[nhfp->fnidx].fn.sf_unsigned)(nhfp, d_unsigned, myparent, myname, cnt); -} - -void -sfo_uchar(nhfp, d_uchar, myparent, myname, cnt) -NHFILE *nhfp; -unsigned char *d_uchar; -const char *myparent; -const char *myname; -int cnt; -{ - (*sfoprocs[nhfp->fnidx].fn.sf_uchar)(nhfp, d_uchar, myparent, myname, cnt); -} - -void -sfo_uint(nhfp, d_uint, myparent, myname, cnt) -NHFILE *nhfp; -unsigned int *d_uint; -const char *myparent; -const char *myname; -int cnt; -{ - (*sfoprocs[nhfp->fnidx].fn.sf_uint)(nhfp, d_uint, myparent, myname, cnt); -} - -void -sfo_ulong(nhfp, d_ulong, myparent, myname, cnt) -NHFILE *nhfp; -unsigned long *d_ulong; -const char *myparent; -const char *myname; -int cnt; -{ - (*sfoprocs[nhfp->fnidx].fn.sf_ulong)(nhfp, d_ulong, myparent, myname, cnt); -} - -void -sfo_ushort(nhfp, d_ushort, myparent, myname, cnt) -NHFILE *nhfp; -unsigned short *d_ushort; -const char *myparent; -const char *myname; -int cnt; -{ - (*sfoprocs[nhfp->fnidx].fn.sf_ushort)(nhfp, d_ushort, myparent, myname, cnt); -} - -void -sfo_xchar(nhfp, d_xchar, myparent, myname, cnt) -NHFILE *nhfp; -xchar *d_xchar; -const char *myparent; -const char *myname; -int cnt; -{ - (*sfoprocs[nhfp->fnidx].fn.sf_xchar)(nhfp, d_xchar, myparent, myname, cnt); -} - -void -sfo_str(nhfp, d_str, myparent, myname, cnt) -NHFILE *nhfp; -char *d_str; -const char *myparent; -const char *myname; -int cnt; -{ - (*sfoprocs[nhfp->fnidx].fn.sf_str)(nhfp, d_str, myparent, myname, cnt); -} - -void -sfo_addinfo(nhfp, parent, action, myname, index) -NHFILE *nhfp; -const char *parent, *action, *myname; -int index; -{ - (*sfoprocs[nhfp->fnidx].fn.sf_addinfo)(nhfp, parent, action, myname, index); -} - -/* - *---------------------------------------------------------------------------- - * routines called from core and from functions in generated sfi_data.c - *---------------------------------------------------------------------------- - */ - -void -sfi_any(nhfp, d_any, myparent, myname, cnt) -NHFILE *nhfp; -union any *d_any; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "any"; - - sfi_log(nhfp, myparent, myname, parent, cnt); - (*sfiprocs[nhfp->fnidx].fn.sf_any)(nhfp, d_any, myparent, myname, cnt); -#ifdef DO_DEBUG - if (nhfp->fpdebug) - fprintf(nhfp->fpdebug, "(%ld)\n", d_any->a_long); -#endif -} - -void -sfi_aligntyp(nhfp, d_aligntyp, myparent, myname, cnt) -NHFILE *nhfp; -aligntyp *d_aligntyp; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "aligntyp"; - - sfi_log(nhfp, myparent, myname, parent, cnt); - (*sfiprocs[nhfp->fnidx].fn.sf_aligntyp)(nhfp, d_aligntyp, myparent, myname, cnt); -#ifdef DO_DEBUG - if (nhfp->fpdebug) - fprintf(nhfp->fpdebug, "(%d)\n", *d_aligntyp); -#endif -} - -void -sfi_bitfield(nhfp, d_bitfield, myparent, myname, cnt) -NHFILE *nhfp; -uint8_t *d_bitfield; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "bitfield"; - - sfi_log(nhfp, myparent, myname, parent, cnt); - (*sfiprocs[nhfp->fnidx].fn.sf_bitfield)(nhfp, d_bitfield, myparent, myname, cnt); -#ifdef DO_DEBUG - if (nhfp->fpdebug) - fprintf(nhfp->fpdebug, "(%hd)\n", *d_bitfield); -#endif -} - -void -sfi_boolean(nhfp, d_boolean, myparent, myname, cnt) -NHFILE *nhfp; -boolean *d_boolean; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "boolean"; - - sfi_log(nhfp, myparent, myname, parent, cnt); - (*sfiprocs[nhfp->fnidx].fn.sf_boolean)(nhfp, d_boolean, myparent, myname, cnt); -#ifdef DO_DEBUG - if (nhfp->fpdebug) - fprintf(nhfp->fpdebug, "(%s)\n", (*d_boolean) ? "true" : "false"); -#endif -} - -void -sfi_char(nhfp, d_char, myparent, myname, cnt) -NHFILE *nhfp; -char *d_char; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "char"; - - sfi_log(nhfp, myparent, myname, parent, cnt); - (*sfiprocs[nhfp->fnidx].fn.sf_char)(nhfp, d_char, myparent, myname, cnt); -#ifdef DO_DEBUG - if (nhfp->fpdebug) - fprintf(nhfp->fpdebug, "(%s)\n", d_char ? d_char : ""); -#endif -} - -void -sfi_genericptr(nhfp, d_genericptr, myparent, myname, cnt) -NHFILE *nhfp; -genericptr_t d_genericptr; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "genericptr"; - - sfi_log(nhfp, myparent, myname, parent, cnt); - (*sfiprocs[nhfp->fnidx].fn.sf_genericptr)(nhfp, d_genericptr, myparent, myname, cnt); -#ifdef DO_DEBUG - if (nhfp->fpdebug) - fprintf(nhfp->fpdebug, "(%s)\n", (d_genericptr) ? "set" : "null"); -#endif -} - -void -sfi_int(nhfp, d_int, myparent, myname, cnt) -NHFILE *nhfp; -int *d_int; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "int"; - - sfi_log(nhfp, myparent, myname, parent, cnt); - (*sfiprocs[nhfp->fnidx].fn.sf_int)(nhfp, d_int, myparent, myname, cnt); -#ifdef DO_DEBUG - if (nhfp->fpdebug) - fprintf(nhfp->fpdebug, "(%d)\n", *d_int); -#endif -} - -void -sfi_long(nhfp, d_long, myparent, myname, cnt) -NHFILE *nhfp; -long *d_long; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "long"; - - sfi_log(nhfp, myparent, myname, parent, cnt); - (*sfiprocs[nhfp->fnidx].fn.sf_long)(nhfp, d_long, myparent, myname, cnt); -#ifdef DO_DEBUG - if (nhfp->fpdebug) - fprintf(nhfp->fpdebug, "(%ld)\n", *d_long); -#endif -} - -void -sfi_schar(nhfp, d_schar, myparent, myname, cnt) -NHFILE *nhfp; -schar *d_schar; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "schar"; - - sfi_log(nhfp, myparent, myname, parent, cnt); - (*sfiprocs[nhfp->fnidx].fn.sf_schar)(nhfp, d_schar, myparent, myname, cnt); -#ifdef DO_DEBUG - if (nhfp->fpdebug) - fprintf(nhfp->fpdebug, "(%hd)\n", (short) *d_schar); -#endif -} - -void -sfi_short(nhfp, d_short, myparent, myname, cnt) -NHFILE *nhfp; -short *d_short; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "short"; - - sfi_log(nhfp, myparent, myname, parent, cnt); - (*sfiprocs[nhfp->fnidx].fn.sf_short)(nhfp, d_short, myparent, myname, cnt); -#ifdef DO_DEBUG - if (nhfp->fpdebug) - fprintf(nhfp->fpdebug, "(%hd)\n", *d_short); -#endif -} - -void -sfi_size_t(nhfp, d_size_t, myparent, myname, cnt) -NHFILE *nhfp; -size_t *d_size_t; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "size_t"; - - sfi_log(nhfp, myparent, myname, parent, cnt); - (*sfiprocs[nhfp->fnidx].fn.sf_size_t)(nhfp, d_size_t, myparent, myname, cnt); -#ifdef DO_DEBUG - if (nhfp->fpdebug) - fprintf(nhfp->fpdebug, "(%lu)\n", (unsigned long) *d_size_t); -#endif -} - -void -sfi_time_t(nhfp, d_time_t, myparent, myname, cnt) -NHFILE *nhfp; -time_t *d_time_t; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "time_t"; - - sfi_log(nhfp, myparent, myname, parent, cnt); - (*sfiprocs[nhfp->fnidx].fn.sf_time_t)(nhfp, d_time_t, myparent, myname, cnt); -#ifdef DO_DEBUG - if (nhfp->fpdebug) - fprintf(nhfp->fpdebug, "(%s)\n", yyyymmddhhmmss(*d_time_t)); -#endif -} - -void -sfi_unsigned(nhfp, d_unsigned, myparent, myname, cnt) -NHFILE *nhfp; -unsigned *d_unsigned; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "unsigned"; - - sfi_log(nhfp, myparent, myname, parent, cnt); - (*sfiprocs[nhfp->fnidx].fn.sf_unsigned)(nhfp, d_unsigned, myparent, myname, cnt); -#ifdef DO_DEBUG - if (nhfp->fpdebug) - fprintf(nhfp->fpdebug, "(%u)\n", *d_unsigned); -#endif -} - -void -sfi_uchar(nhfp, d_uchar, myparent, myname, cnt) -NHFILE *nhfp; -unsigned char *d_uchar; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "uchar"; - - sfi_log(nhfp, myparent, myname, parent, cnt); - (*sfiprocs[nhfp->fnidx].fn.sf_uchar)(nhfp, d_uchar, myparent, myname, cnt); -#ifdef DO_DEBUG - if (nhfp->fpdebug) - fprintf(nhfp->fpdebug, "(%hu)\n", (unsigned short) *d_uchar); -#endif -} - -void -sfi_uint(nhfp, d_uint, myparent, myname, cnt) -NHFILE *nhfp; -unsigned int *d_uint; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "uint"; - - sfi_log(nhfp, myparent, myname, parent, cnt); - (*sfiprocs[nhfp->fnidx].fn.sf_uint)(nhfp, d_uint, myparent, myname, cnt); -#ifdef DO_DEBUG - if (nhfp->fpdebug) - fprintf(nhfp->fpdebug, "(%u)\n", *d_uint); -#endif -} - -void -sfi_ulong(nhfp, d_ulong, myparent, myname, cnt) -NHFILE *nhfp; -unsigned long *d_ulong; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "ulong"; - - sfi_log(nhfp, myparent, myname, parent, cnt); - (*sfiprocs[nhfp->fnidx].fn.sf_ulong)(nhfp, d_ulong, myparent, myname, cnt); -#ifdef DO_DEBUG - if (nhfp->fpdebug) - fprintf(nhfp->fpdebug, "(%lu)\n", *d_ulong); -#endif -} - -void -sfi_ushort(nhfp, d_ushort, myparent, myname, cnt) -NHFILE *nhfp; -unsigned short *d_ushort; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "ushort"; - - sfi_log(nhfp, myparent, myname, parent, cnt); - (*sfiprocs[nhfp->fnidx].fn.sf_ushort)(nhfp, d_ushort, myparent, myname, cnt); -#ifdef DO_DEBUG - if (nhfp->fpdebug) - fprintf(nhfp->fpdebug, "(%hu)\n", *d_ushort); -#endif -} - -void -sfi_xchar(nhfp, d_xchar, myparent, myname, cnt) -NHFILE *nhfp; -xchar *d_xchar; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "xchar"; - - sfi_log(nhfp, myparent, myname, parent, cnt); - (*sfiprocs[nhfp->fnidx].fn.sf_xchar)(nhfp, d_xchar, myparent, myname, cnt); -#ifdef DO_DEBUG - if (nhfp->fpdebug) - fprintf(nhfp->fpdebug, "(%hd)\n", (short) *d_xchar); -#endif -} - -void -sfi_str(nhfp, d_str, myparent, myname, cnt) -NHFILE *nhfp; -char *d_str; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "str"; - - sfi_log(nhfp, myparent, myname, parent, cnt); - (*sfiprocs[nhfp->fnidx].fn.sf_str)(nhfp, d_str, myparent, myname, cnt); -#ifdef DO_DEBUG - if (nhfp->fpdebug) - fprintf(nhfp->fpdebug, "(\"%s\")\n", d_str); -#endif -} - -void -sfi_addinfo(nhfp, myparent, action, myname, index) -NHFILE *nhfp; -const char *myparent, *action, *myname; -int index; -{ - if (nhfp) { - if (nhfp->fplog) - (void) fprintf(nhfp->fplog, "# %s %s %s %d\n", myparent, action, myname, index); -#ifdef DO_DEBUG - if (nhfp->fpdebug) - (void) fprintf(nhfp->fpdebug, "# %s %s %s %d\n", myparent, action, myname, index); -#endif - } - (*sfiprocs[nhfp->fnidx].fn.sf_addinfo)(nhfp, myparent, action, myname, index); -} - -void -sfi_log(nhfp, t1, t2, t3, cnt) -NHFILE *nhfp; -const char *t1, *t2, *t3; -int cnt; -{ -#ifdef DO_DEBUG -#ifdef SAVEFILE_DEBUGGING - if (nhfp) { - if (nhfp->fplog) - (void) fprintf(nhfp->fplog, "%s %s %s cnt=%d\n", t1, t2, t3, cnt); - if (nhfp->fpdebug) - (void) fprintf(nhfp->fpdebug, "%s %s %s cnt=%d ", t1, t2, t3, cnt); - } -#endif -#else - nhUse(nhfp); - nhUse(t1); - nhUse(t2); - nhUse(t3); - nhUse(cnt); -#endif -} - diff --git a/src/sfdata.c b/src/sfdata.c deleted file mode 100644 index 54c456eb4..000000000 --- a/src/sfdata.c +++ /dev/null @@ -1,6055 +0,0 @@ -/* NetHack 3.7 sfdata.c */ -/* Copyright (c) NetHack Development Team 2019. */ -/* NetHack may be freely redistributed. See license for details. */ - -/* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE! */ - -#include "hack.h" -#include "artifact.h" -#include "func_tab.h" -#include "lev.h" -#include "integer.h" -#include "wintype.h" -#include "sfproto.h" - -#define NHTYPE_SIMPLE 1 -#define NHTYPE_COMPLEX 2 -struct nhdatatypes_t { - unsigned int dtclass; - char *dtype; - size_t dtsize; -}; - -static uint8_t bitfield = 0; - -void -sfo_align(nhfp, d_align, myparent, myname, cnt) -NHFILE *nhfp; -struct align *d_align; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "align"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "align", 1); - - sfo_aligntyp(nhfp, &d_align->type, parent, "type", 1); /* (aligntyp) */ - sfo_int(nhfp, &d_align->record, parent, "record", 1); /* (int) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "align", 1); -} - -void -sfo_attribs(nhfp, d_attribs, myparent, myname, cnt) -NHFILE *nhfp; -struct attribs *d_attribs; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "attribs"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "attribs", 1); - - sfo_schar(nhfp, d_attribs->a, parent, "a", A_MAX); /* (schar) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "attribs", 1); -} - -void -sfo_bill_x(nhfp, d_bill_x, myparent, myname, cnt) -NHFILE *nhfp; -struct bill_x *d_bill_x; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "bill_x"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "bill_x", 1); - - sfo_unsigned(nhfp, &d_bill_x->bo_id, parent, "bo_id", 1); /* (unsigned) */ - sfo_boolean(nhfp, &d_bill_x->useup, parent, "useup", 1); /* (boolean) */ - sfo_long(nhfp, &d_bill_x->price, parent, "price", 1); /* (long) */ - sfo_long(nhfp, &d_bill_x->bquan, parent, "bquan", 1); /* (long) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "bill_x", 1); -} - -void -sfo_book_info(nhfp, d_book_info, myparent, myname, cnt) -NHFILE *nhfp; -struct book_info *d_book_info; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "book_info"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "book_info", 1); - - sfo_genericptr(nhfp, (genericptr_t) &d_book_info->book, parent, "book", 1);/* (struct obj *) */ - sfo_unsigned(nhfp, &d_book_info->o_id, parent, "o_id", 1); /* (unsigned) */ - sfo_schar(nhfp, &d_book_info->delay, parent, "delay", 1); /* (schar) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "book_info", 1); -} - -void -sfo_branch(nhfp, d_branch, myparent, myname, cnt) -NHFILE *nhfp; -struct branch *d_branch; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "branch"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "branch", 1); - - sfo_genericptr(nhfp, (genericptr_t) &d_branch->next, parent, "next", 1);/* (struct branch *) */ - sfo_int(nhfp, &d_branch->id, parent, "id", 1); /* (int) */ - sfo_int(nhfp, &d_branch->type, parent, "type", 1); /* (int) */ - sfo_d_level(nhfp, &d_branch->end1, parent, "end1", 1); /* (d_level) */ - sfo_d_level(nhfp, &d_branch->end2, parent, "end2", 1); /* (d_level) */ - sfo_boolean(nhfp, &d_branch->end1_up, parent, "end1_up", 1); /* (boolean) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "branch", 1); -} - -void -sfo_bubble(nhfp, d_bubble, myparent, myname, cnt) -NHFILE *nhfp; -struct bubble *d_bubble; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "bubble"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "bubble", 1); - - sfo_xchar(nhfp, &d_bubble->x, parent, "x", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_bubble->y, parent, "y", 1); /* (xchar) */ - sfo_schar(nhfp, &d_bubble->dx, parent, "dx", 1); /* (schar) */ - sfo_schar(nhfp, &d_bubble->dy, parent, "dy", 1); /* (schar) */ - sfo_uchar(nhfp, d_bubble->bm, parent, "bm", MAX_BMASK + 2); /* (uchar) */ - sfo_genericptr(nhfp, (genericptr_t) &d_bubble->prev, parent, "prev", 1);/* (struct bubble *) */ - sfo_genericptr(nhfp, (genericptr_t) &d_bubble->next, parent, "next", 1);/* (struct bubble *) */ - sfo_genericptr(nhfp, (genericptr_t) &d_bubble->cons, parent, "cons", 1);/* (struct container *) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "bubble", 1); -} - -void -sfo_cemetery(nhfp, d_cemetery, myparent, myname, cnt) -NHFILE *nhfp; -struct cemetery *d_cemetery; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "cemetery"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "cemetery", 1); - - sfo_genericptr(nhfp, (genericptr_t) &d_cemetery->next, parent, "next", 1);/* (struct cemetery *) */ - sfo_char(nhfp, d_cemetery->who, parent, "who", PL_NSIZ + 4 * (1 + 3) + 1);/* (char) */ - sfo_char(nhfp, d_cemetery->how, parent, "how", 100 + 1); /* (char) */ - sfo_char(nhfp, d_cemetery->when, parent, "when", 4 + 2 + 2 + 2 + 2 + 2 + 1);/* (char) */ - sfo_schar(nhfp, &d_cemetery->frpx, parent, "frpx", 1); /* (schar) */ - sfo_schar(nhfp, &d_cemetery->frpy, parent, "frpy", 1); /* (schar) */ - sfo_boolean(nhfp, &d_cemetery->bonesknown, parent, "bonesknown", 1);/* (boolean) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "cemetery", 1); -} - -void -sfo_context_info(nhfp, d_context_info, myparent, myname, cnt) -NHFILE *nhfp; -struct context_info *d_context_info; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "context_info"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "context_info", 1); - - sfo_unsigned(nhfp, &d_context_info->ident, parent, "ident", 1);/* (unsigned) */ - sfo_unsigned(nhfp, &d_context_info->no_of_wizards, parent, "no_of_wizards", 1);/* (unsigned) */ - sfo_unsigned(nhfp, &d_context_info->run, parent, "run", 1); /* (unsigned) */ - sfo_unsigned(nhfp, &d_context_info->startingpet_mid, parent, "startingpet_mid", 1);/* (unsigned) */ - sfo_int(nhfp, &d_context_info->current_fruit, parent, "current_fruit", 1);/* (int) */ - sfo_int(nhfp, &d_context_info->warnlevel, parent, "warnlevel", 1);/* (int) */ - sfo_int(nhfp, &d_context_info->rndencode, parent, "rndencode", 1);/* (int) */ - sfo_int(nhfp, &d_context_info->mysteryforce, parent, "mysteryforce", 1);/* (int) */ - sfo_long(nhfp, &d_context_info->next_attrib_check, parent, "next_attrib_check", 1);/* (long) */ - sfo_long(nhfp, &d_context_info->stethoscope_move, parent, "stethoscope_move", 1);/* (long) */ - sfo_short(nhfp, &d_context_info->stethoscope_movement, parent, "stethoscope_movement", 1);/* (short) */ - sfo_boolean(nhfp, &d_context_info->travel, parent, "travel", 1);/* (boolean) */ - sfo_boolean(nhfp, &d_context_info->travel1, parent, "travel1", 1);/* (boolean) */ - sfo_boolean(nhfp, &d_context_info->forcefight, parent, "forcefight", 1);/* (boolean) */ - sfo_boolean(nhfp, &d_context_info->nopick, parent, "nopick", 1);/* (boolean) */ - sfo_boolean(nhfp, &d_context_info->made_amulet, parent, "made_amulet", 1);/* (boolean) */ - sfo_boolean(nhfp, &d_context_info->mon_moving, parent, "mon_moving", 1);/* (boolean) */ - sfo_boolean(nhfp, &d_context_info->move, parent, "move", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_context_info->mv, parent, "mv", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_context_info->bypasses, parent, "bypasses", 1);/* (boolean) */ - sfo_boolean(nhfp, &d_context_info->botl, parent, "botl", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_context_info->botlx, parent, "botlx", 1);/* (boolean) */ - sfo_boolean(nhfp, &d_context_info->door_opened, parent, "door_opened", 1);/* (boolean) */ - sfo_dig_info(nhfp, &d_context_info->digging, parent, "digging", 1);/* (dig_info) */ - sfo_victual_info(nhfp, &d_context_info->victual, parent, "victual", 1);/* (victual_info) */ - sfo_tin_info(nhfp, &d_context_info->tin, parent, "tin", 1); /* (tin_info) */ - sfo_book_info(nhfp, &d_context_info->spbook, parent, "spbook", 1);/* (book_info) */ - sfo_takeoff_info(nhfp, &d_context_info->takeoff, parent, "takeoff", 1);/* (takeoff_info) */ - sfo_warntype_info(nhfp, &d_context_info->warntype, parent, "warntype", 1);/* (warntype_info) */ - sfo_polearm_info(nhfp, &d_context_info->polearm, parent, "polearm", 1);/* (polearm_info) */ - sfo_obj_split(nhfp, &d_context_info->objsplit, parent, "objsplit", 1);/* (obj_split) */ - sfo_tribute_info(nhfp, &d_context_info->tribute, parent, "tribute", 1);/* (tribute_info) */ - sfo_novel_tracking(nhfp, &d_context_info->novel, parent, "novel", 1);/* (novel_tracking) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "context_info", 1); -} - -void -sfo_d_flags(nhfp, d_d_flags, myparent, myname, cnt) -NHFILE *nhfp; -struct d_flags *d_d_flags; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "d_flags"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "d_flags", 1); - - bitfield = d_d_flags->town; /* (Bitfield(town, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "town", 1); - bitfield = d_d_flags->hellish; /* (Bitfield(hellish, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "hellish", 1); - bitfield = d_d_flags->maze_like; /* (Bitfield(maze_like, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "maze_like", 1); - bitfield = d_d_flags->rogue_like; /* (Bitfield(rogue_like, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "rogue_like", 1); - bitfield = d_d_flags->align; /* (Bitfield(align, 3)) */ - sfo_bitfield(nhfp, &bitfield, parent, "align", 3); - bitfield = d_d_flags->unused; /* (Bitfield(unused, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "unused", 1); - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "d_flags", 1); -} - -void -sfo_d_level(nhfp, d_d_level, myparent, myname, cnt) -NHFILE *nhfp; -struct d_level *d_d_level; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "d_level"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "d_level", 1); - - sfo_xchar(nhfp, &d_d_level->dnum, parent, "dnum", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_d_level->dlevel, parent, "dlevel", 1); /* (xchar) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "d_level", 1); -} - -void -sfo_damage(nhfp, d_damage, myparent, myname, cnt) -NHFILE *nhfp; -struct damage *d_damage; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "damage"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "damage", 1); - - sfo_genericptr(nhfp, (genericptr_t) &d_damage->next, parent, "next", 1);/* (struct damage *) */ - sfo_long(nhfp, &d_damage->when, parent, "when", 1); /* (long) */ - sfo_long(nhfp, &d_damage->cost, parent, "cost", 1); /* (long) */ - sfo_nhcoord(nhfp, &d_damage->place, parent, "place", 1); /* (nhcoord) */ - sfo_schar(nhfp, &d_damage->typ, parent, "typ", 1); /* (schar) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "damage", 1); -} - -void -sfo_dest_area(nhfp, d_dest_area, myparent, myname, cnt) -NHFILE *nhfp; -struct dest_area *d_dest_area; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "dest_area"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "dest_area", 1); - - sfo_xchar(nhfp, &d_dest_area->lx, parent, "lx", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_dest_area->ly, parent, "ly", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_dest_area->hx, parent, "hx", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_dest_area->hy, parent, "hy", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_dest_area->nlx, parent, "nlx", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_dest_area->nly, parent, "nly", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_dest_area->nhx, parent, "nhx", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_dest_area->nhy, parent, "nhy", 1); /* (xchar) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "dest_area", 1); -} - -void -sfo_dgn_topology(nhfp, d_dgn_topology, myparent, myname, cnt) -NHFILE *nhfp; -struct dgn_topology *d_dgn_topology; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "dgn_topology"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "dgn_topology", 1); - - sfo_d_level(nhfp, &d_dgn_topology->d_oracle_level, parent, "d_oracle_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_bigroom_level, parent, "d_bigroom_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_rogue_level, parent, "d_rogue_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_medusa_level, parent, "d_medusa_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_stronghold_level, parent, "d_stronghold_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_valley_level, parent, "d_valley_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_wiz1_level, parent, "d_wiz1_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_wiz2_level, parent, "d_wiz2_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_wiz3_level, parent, "d_wiz3_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_juiblex_level, parent, "d_juiblex_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_orcus_level, parent, "d_orcus_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_baalzebub_level, parent, "d_baalzebub_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_asmodeus_level, parent, "d_asmodeus_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_portal_level, parent, "d_portal_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_sanctum_level, parent, "d_sanctum_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_earth_level, parent, "d_earth_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_water_level, parent, "d_water_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_fire_level, parent, "d_fire_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_air_level, parent, "d_air_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_astral_level, parent, "d_astral_level", 1);/* (d_level) */ - sfo_xchar(nhfp, &d_dgn_topology->d_tower_dnum, parent, "d_tower_dnum", 1);/* (xchar) */ - sfo_xchar(nhfp, &d_dgn_topology->d_sokoban_dnum, parent, "d_sokoban_dnum", 1);/* (xchar) */ - sfo_xchar(nhfp, &d_dgn_topology->d_mines_dnum, parent, "d_mines_dnum", 1);/* (xchar) */ - sfo_xchar(nhfp, &d_dgn_topology->d_quest_dnum, parent, "d_quest_dnum", 1);/* (xchar) */ - sfo_d_level(nhfp, &d_dgn_topology->d_qstart_level, parent, "d_qstart_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_qlocate_level, parent, "d_qlocate_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_nemesis_level, parent, "d_nemesis_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_knox_level, parent, "d_knox_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_mineend_level, parent, "d_mineend_level", 1);/* (d_level) */ - sfo_d_level(nhfp, &d_dgn_topology->d_sokoend_level, parent, "d_sokoend_level", 1);/* (d_level) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "dgn_topology", 1); -} - -void -sfo_dig_info(nhfp, d_dig_info, myparent, myname, cnt) -NHFILE *nhfp; -struct dig_info *d_dig_info; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "dig_info"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "dig_info", 1); - - sfo_int(nhfp, &d_dig_info->effort, parent, "effort", 1); /* (int) */ - sfo_d_level(nhfp, &d_dig_info->level, parent, "level", 1); /* (d_level) */ - sfo_nhcoord(nhfp, &d_dig_info->pos, parent, "pos", 1); /* (nhcoord) */ - sfo_long(nhfp, &d_dig_info->lastdigtime, parent, "lastdigtime", 1);/* (long) */ - sfo_boolean(nhfp, &d_dig_info->down, parent, "down", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_dig_info->chew, parent, "chew", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_dig_info->warned, parent, "warned", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_dig_info->quiet, parent, "quiet", 1); /* (boolean) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "dig_info", 1); -} - -void -sfo_dungeon(nhfp, d_dungeon, myparent, myname, cnt) -NHFILE *nhfp; -struct dungeon *d_dungeon; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "dungeon"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "dungeon", 1); - - sfo_char(nhfp, d_dungeon->dname, parent, "dname", 24); /* (char) */ - sfo_char(nhfp, d_dungeon->proto, parent, "proto", 15); /* (char) */ - sfo_char(nhfp, &d_dungeon->boneid, parent, "boneid", 1); /* (char) */ - sfo_d_flags(nhfp, &d_dungeon->flags, parent, "flags", 1); /* (d_flags) */ - sfo_xchar(nhfp, &d_dungeon->entry_lev, parent, "entry_lev", 1);/* (xchar) */ - sfo_xchar(nhfp, &d_dungeon->num_dunlevs, parent, "num_dunlevs", 1);/* (xchar) */ - sfo_xchar(nhfp, &d_dungeon->dunlev_ureached, parent, "dunlev_ureached", 1);/* (xchar) */ - sfo_int(nhfp, &d_dungeon->ledger_start, parent, "ledger_start", 1);/* (int) */ - sfo_int(nhfp, &d_dungeon->depth_start, parent, "depth_start", 1);/* (int) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "dungeon", 1); -} - -void -sfo_edog(nhfp, d_edog, myparent, myname, cnt) -NHFILE *nhfp; -struct edog *d_edog; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "edog"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "edog", 1); - - sfo_long(nhfp, &d_edog->droptime, parent, "droptime", 1); /* (long) */ - sfo_unsigned(nhfp, &d_edog->dropdist, parent, "dropdist", 1);/* (unsigned) */ - sfo_int(nhfp, &d_edog->apport, parent, "apport", 1); /* (int) */ - sfo_long(nhfp, &d_edog->whistletime, parent, "whistletime", 1);/* (long) */ - sfo_long(nhfp, &d_edog->hungrytime, parent, "hungrytime", 1);/* (long) */ - sfo_nhcoord(nhfp, &d_edog->ogoal, parent, "ogoal", 1); /* (nhcoord) */ - sfo_int(nhfp, &d_edog->abuse, parent, "abuse", 1); /* (int) */ - sfo_int(nhfp, &d_edog->revivals, parent, "revivals", 1); /* (int) */ - sfo_int(nhfp, &d_edog->mhpmax_penalty, parent, "mhpmax_penalty", 1);/* (int) */ - bitfield = d_edog->killed_by_u; /* (Bitfield(killed_by_u, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "killed_by_u", 1); - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "edog", 1); -} - -void -sfo_egd(nhfp, d_egd, myparent, myname, cnt) -NHFILE *nhfp; -struct egd *d_egd; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "egd"; - int i; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "egd", 1); - - sfo_int(nhfp, &d_egd->fcbeg, parent, "fcbeg", 1); /* (int) */ - sfo_int(nhfp, &d_egd->fcend, parent, "fcend", 1); /* (int) */ - sfo_int(nhfp, &d_egd->vroom, parent, "vroom", 1); /* (int) */ - sfo_xchar(nhfp, &d_egd->gdx, parent, "gdx", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_egd->gdy, parent, "gdy", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_egd->ogx, parent, "ogx", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_egd->ogy, parent, "ogy", 1); /* (xchar) */ - sfo_d_level(nhfp, &d_egd->gdlevel, parent, "gdlevel", 1); /* (d_level) */ - sfo_xchar(nhfp, &d_egd->warncnt, parent, "warncnt", 1); /* (xchar) */ - bitfield = d_egd->gddone; /* (Bitfield(gddone, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "gddone", 1); - bitfield = d_egd->witness; /* (Bitfield(witness, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "witness", 2); - bitfield = d_egd->unused; /* (Bitfield(unused, 5)) */ - sfo_bitfield(nhfp, &bitfield, parent, "unused", 5); - for (i = 0; i < FCSIZ; ++i) - sfo_fakecorridor(nhfp, &d_egd->fakecorr[i], parent, "fakecorr", 1);/* (fakecorridor) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "egd", 1); -} - -void -sfo_emin(nhfp, d_emin, myparent, myname, cnt) -NHFILE *nhfp; -struct emin *d_emin; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "emin"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "emin", 1); - - sfo_aligntyp(nhfp, &d_emin->min_align, parent, "min_align", 1);/* (aligntyp) */ - sfo_boolean(nhfp, &d_emin->renegade, parent, "renegade", 1); /* (boolean) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "emin", 1); -} - -void -sfo_engr(nhfp, d_engr, myparent, myname, cnt) -NHFILE *nhfp; -struct engr *d_engr; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "engr"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "engr", 1); - - sfo_genericptr(nhfp, (genericptr_t) &d_engr->nxt_engr, parent, "nxt_engr", 1);/* (struct engr *) */ - sfo_genericptr(nhfp, (genericptr_t) &d_engr->engr_txt, parent, "engr_txt", 1);/* (char *) */ - sfo_xchar(nhfp, &d_engr->engr_x, parent, "engr_x", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_engr->engr_y, parent, "engr_y", 1); /* (xchar) */ - sfo_unsigned(nhfp, &d_engr->engr_lth, parent, "engr_lth", 1);/* (unsigned) */ - sfo_long(nhfp, &d_engr->engr_time, parent, "engr_time", 1); /* (long) */ - sfo_xchar(nhfp, &d_engr->engr_type, parent, "engr_type", 1); /* (xchar) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "engr", 1); -} - -void -sfo_epri(nhfp, d_epri, myparent, myname, cnt) -NHFILE *nhfp; -struct epri *d_epri; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "epri"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "epri", 1); - - sfo_aligntyp(nhfp, &d_epri->shralign, parent, "shralign", 1);/* (aligntyp) */ - sfo_schar(nhfp, &d_epri->shroom, parent, "shroom", 1); /* (schar) */ - sfo_nhcoord(nhfp, &d_epri->shrpos, parent, "shrpos", 1); /* (nhcoord) */ - sfo_d_level(nhfp, &d_epri->shrlevel, parent, "shrlevel", 1); /* (d_level) */ - sfo_long(nhfp, &d_epri->intone_time, parent, "intone_time", 1);/* (long) */ - sfo_long(nhfp, &d_epri->enter_time, parent, "enter_time", 1);/* (long) */ - sfo_long(nhfp, &d_epri->hostile_time, parent, "hostile_time", 1);/* (long) */ - sfo_long(nhfp, &d_epri->peaceful_time, parent, "peaceful_time", 1);/* (long) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "epri", 1); -} - -void -sfo_eshk(nhfp, d_eshk, myparent, myname, cnt) -NHFILE *nhfp; -struct eshk *d_eshk; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "eshk"; - int i; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "eshk", 1); - - sfo_long(nhfp, &d_eshk->robbed, parent, "robbed", 1); /* (long) */ - sfo_long(nhfp, &d_eshk->credit, parent, "credit", 1); /* (long) */ - sfo_long(nhfp, &d_eshk->debit, parent, "debit", 1); /* (long) */ - sfo_long(nhfp, &d_eshk->loan, parent, "loan", 1); /* (long) */ - sfo_int(nhfp, &d_eshk->shoptype, parent, "shoptype", 1); /* (int) */ - sfo_schar(nhfp, &d_eshk->shoproom, parent, "shoproom", 1); /* (schar) */ - sfo_schar(nhfp, &d_eshk->unused, parent, "unused", 1); /* (schar) */ - sfo_boolean(nhfp, &d_eshk->following, parent, "following", 1);/* (boolean) */ - sfo_boolean(nhfp, &d_eshk->surcharge, parent, "surcharge", 1);/* (boolean) */ - sfo_boolean(nhfp, &d_eshk->dismiss_kops, parent, "dismiss_kops", 1);/* (boolean) */ - sfo_nhcoord(nhfp, &d_eshk->shk, parent, "shk", 1); /* (nhcoord) */ - sfo_nhcoord(nhfp, &d_eshk->shd, parent, "shd", 1); /* (nhcoord) */ - sfo_d_level(nhfp, &d_eshk->shoplevel, parent, "shoplevel", 1);/* (d_level) */ - sfo_int(nhfp, &d_eshk->billct, parent, "billct", 1); /* (int) */ - for (i = 0; i < BILLSZ; ++i) - sfo_bill_x(nhfp, &d_eshk->bill[i], parent, "bill", 1); /* (bill_x) */ - sfo_genericptr(nhfp, (genericptr_t) &d_eshk->bill_p, parent, "bill_p", 1);/* (struct bill_x *) */ - sfo_int(nhfp, &d_eshk->visitct, parent, "visitct", 1); /* (int) */ - sfo_char(nhfp, d_eshk->customer, parent, "customer", PL_NSIZ);/* (char) */ - sfo_char(nhfp, d_eshk->shknam, parent, "shknam", PL_NSIZ); /* (char) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "eshk", 1); -} - -void -sfo_fakecorridor(nhfp, d_fakecorridor, myparent, myname, cnt) -NHFILE *nhfp; -struct fakecorridor *d_fakecorridor; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "fakecorridor"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "fakecorridor", 1); - - sfo_xchar(nhfp, &d_fakecorridor->fx, parent, "fx", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_fakecorridor->fy, parent, "fy", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_fakecorridor->ftyp, parent, "ftyp", 1); /* (xchar) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "fakecorridor", 1); -} - -void -sfo_fe(nhfp, d_fe, myparent, myname, cnt) -NHFILE *nhfp; -struct fe *d_fe; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "fe"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "fe", 1); - - sfo_genericptr(nhfp, (genericptr_t) &d_fe->next, parent, "next", 1);/* (struct fe *) */ - sfo_long(nhfp, &d_fe->timeout, parent, "timeout", 1); /* (long) */ - sfo_ulong(nhfp, &d_fe->tid, parent, "tid", 1); /* (unsigned long) */ - sfo_short(nhfp, &d_fe->kind, parent, "kind", 1); /* (short) */ - sfo_short(nhfp, &d_fe->func_index, parent, "func_index", 1); /* (short) */ - sfo_any(nhfp, &d_fe->arg, parent, "arg", 1); /* (any) */ - bitfield = d_fe->needs_fixup; /* (Bitfield(needs_fixup, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "needs_fixup", 1); - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "fe", 1); -} - -void -sfo_flag(nhfp, d_flag, myparent, myname, cnt) -NHFILE *nhfp; -struct flag *d_flag; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "flag"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "flag", 1); - - sfo_boolean(nhfp, &d_flag->acoustics, parent, "acoustics", 1);/* (boolean) */ - sfo_boolean(nhfp, &d_flag->autodig, parent, "autodig", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->autoquiver, parent, "autoquiver", 1);/* (boolean) */ - sfo_boolean(nhfp, &d_flag->autoopen, parent, "autoopen", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->beginner, parent, "beginner", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->biff, parent, "biff", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->bones, parent, "bones", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->confirm, parent, "confirm", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->dark_room, parent, "dark_room", 1);/* (boolean) */ - sfo_boolean(nhfp, &d_flag->debug, parent, "debug", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->end_own, parent, "end_own", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->explore, parent, "explore", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->female, parent, "female", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->friday13, parent, "friday13", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->goldX, parent, "goldX", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->help, parent, "help", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->ignintr, parent, "ignintr", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->ins_chkpt, parent, "ins_chkpt", 1);/* (boolean) */ - sfo_boolean(nhfp, &d_flag->invlet_constant, parent, "invlet_constant", 1);/* (boolean) */ - sfo_boolean(nhfp, &d_flag->legacy, parent, "legacy", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->lit_corridor, parent, "lit_corridor", 1);/* (boolean) */ - sfo_boolean(nhfp, &d_flag->nap, parent, "nap", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->null, parent, "null", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->pickup, parent, "pickup", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->pickup_thrown, parent, "pickup_thrown", 1);/* (boolean) */ - sfo_boolean(nhfp, &d_flag->pushweapon, parent, "pushweapon", 1);/* (boolean) */ - sfo_boolean(nhfp, &d_flag->rest_on_space, parent, "rest_on_space", 1);/* (boolean) */ - sfo_boolean(nhfp, &d_flag->safe_dog, parent, "safe_dog", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->showexp, parent, "showexp", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->showscore, parent, "showscore", 1);/* (boolean) */ - sfo_boolean(nhfp, &d_flag->silent, parent, "silent", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->sortpack, parent, "sortpack", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->sparkle, parent, "sparkle", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->standout, parent, "standout", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->time, parent, "time", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->tombstone, parent, "tombstone", 1);/* (boolean) */ - sfo_boolean(nhfp, &d_flag->verbose, parent, "verbose", 1); /* (boolean) */ - sfo_int(nhfp, &d_flag->end_top, parent, "end_top", 1); /* (int) */ - sfo_int(nhfp, &d_flag->end_around, parent, "end_around", 1); /* (int) */ - sfo_unsigned(nhfp, &d_flag->moonphase, parent, "moonphase", 1);/* (unsigned) */ - sfo_ulong(nhfp, &d_flag->suppress_alert, parent, "suppress_alert", 1);/* (unsigned long) */ - sfo_unsigned(nhfp, &d_flag->paranoia_bits, parent, "paranoia_bits", 1);/* (unsigned) */ - sfo_int(nhfp, &d_flag->pickup_burden, parent, "pickup_burden", 1);/* (int) */ - sfo_int(nhfp, &d_flag->pile_limit, parent, "pile_limit", 1); /* (int) */ - sfo_char(nhfp, &d_flag->sortloot, parent, "sortloot", 1); /* (char) */ - sfo_char(nhfp, d_flag->inv_order, parent, "inv_order", MAXOCLASSES);/* (char) */ - sfo_char(nhfp, d_flag->pickup_types, parent, "pickup_types", MAXOCLASSES);/* (char) */ - sfo_char(nhfp, d_flag->end_disclose, parent, "end_disclose", NUM_DISCLOSURE_OPTIONS + 1);/* (char) */ - sfo_char(nhfp, &d_flag->menu_style, parent, "menu_style", 1);/* (char) */ - sfo_boolean(nhfp, &d_flag->made_fruit, parent, "made_fruit", 1);/* (boolean) */ - sfo_int(nhfp, &d_flag->initrole, parent, "initrole", 1); /* (int) */ - sfo_int(nhfp, &d_flag->initrace, parent, "initrace", 1); /* (int) */ - sfo_int(nhfp, &d_flag->initgend, parent, "initgend", 1); /* (int) */ - sfo_int(nhfp, &d_flag->initalign, parent, "initalign", 1); /* (int) */ - sfo_int(nhfp, &d_flag->randomall, parent, "randomall", 1); /* (int) */ - sfo_int(nhfp, &d_flag->pantheon, parent, "pantheon", 1); /* (int) */ - sfo_boolean(nhfp, &d_flag->lootabc, parent, "lootabc", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->showrace, parent, "showrace", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_flag->travelcmd, parent, "travelcmd", 1);/* (boolean) */ - sfo_int(nhfp, &d_flag->runmode, parent, "runmode", 1); /* (int) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "flag", 1); -} - -void -sfo_fruit(nhfp, d_fruit, myparent, myname, cnt) -NHFILE *nhfp; -struct fruit *d_fruit; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "fruit"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "fruit", 1); - - sfo_char(nhfp, d_fruit->fname, parent, "fname", PL_FSIZ); /* (char) */ - sfo_int(nhfp, &d_fruit->fid, parent, "fid", 1); /* (int) */ - sfo_genericptr(nhfp, (genericptr_t) &d_fruit->nextf, parent, "nextf", 1);/* (struct fruit *) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "fruit", 1); -} - -void -sfo_kinfo(nhfp, d_kinfo, myparent, myname, cnt) -NHFILE *nhfp; -struct kinfo *d_kinfo; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "kinfo"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "kinfo", 1); - - sfo_genericptr(nhfp, (genericptr_t) &d_kinfo->next, parent, "next", 1);/* (struct kinfo *) */ - sfo_int(nhfp, &d_kinfo->id, parent, "id", 1); /* (int) */ - sfo_int(nhfp, &d_kinfo->format, parent, "format", 1); /* (int) */ - sfo_char(nhfp, d_kinfo->name, parent, "name", BUFSZ); /* (char) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "kinfo", 1); -} - -void -sfo_levelflags(nhfp, d_levelflags, myparent, myname, cnt) -NHFILE *nhfp; -struct levelflags *d_levelflags; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "levelflags"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "levelflags", 1); - - sfo_uchar(nhfp, &d_levelflags->nfountains, parent, "nfountains", 1);/* (uchar) */ - sfo_uchar(nhfp, &d_levelflags->nsinks, parent, "nsinks", 1); /* (uchar) */ - bitfield = d_levelflags->has_shop; /* (Bitfield(has_shop, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "has_shop", 1); - bitfield = d_levelflags->has_vault; /* (Bitfield(has_vault, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "has_vault", 1); - bitfield = d_levelflags->has_zoo; /* (Bitfield(has_zoo, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "has_zoo", 1); - bitfield = d_levelflags->has_court; /* (Bitfield(has_court, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "has_court", 1); - bitfield = d_levelflags->has_morgue; /* (Bitfield(has_morgue, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "has_morgue", 1); - bitfield = d_levelflags->has_beehive; /* (Bitfield(has_beehive, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "has_beehive", 1); - bitfield = d_levelflags->has_barracks; /* (Bitfield(has_barracks, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "has_barracks", 1); - bitfield = d_levelflags->has_temple; /* (Bitfield(has_temple, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "has_temple", 1); - bitfield = d_levelflags->has_swamp; /* (Bitfield(has_swamp, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "has_swamp", 1); - bitfield = d_levelflags->noteleport; /* (Bitfield(noteleport, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "noteleport", 1); - bitfield = d_levelflags->hardfloor; /* (Bitfield(hardfloor, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "hardfloor", 1); - bitfield = d_levelflags->nommap; /* (Bitfield(nommap, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "nommap", 1); - bitfield = d_levelflags->hero_memory; /* (Bitfield(hero_memory, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "hero_memory", 1); - bitfield = d_levelflags->shortsighted; /* (Bitfield(shortsighted, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "shortsighted", 1); - bitfield = d_levelflags->graveyard; /* (Bitfield(graveyard, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "graveyard", 1); - bitfield = d_levelflags->sokoban_rules; /* (Bitfield(sokoban_rules, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "sokoban_rules", 1); - bitfield = d_levelflags->is_maze_lev; /* (Bitfield(is_maze_lev, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "is_maze_lev", 1); - bitfield = d_levelflags->is_cavernous_lev; /* (Bitfield(is_cavernous_lev, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "is_cavernous_lev", 1); - bitfield = d_levelflags->arboreal; /* (Bitfield(arboreal, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "arboreal", 1); - bitfield = d_levelflags->wizard_bones; /* (Bitfield(wizard_bones, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "wizard_bones", 1); - bitfield = d_levelflags->corrmaze; /* (Bitfield(corrmaze, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "corrmaze", 1); - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "levelflags", 1); -} - -void -sfo_linfo(nhfp, d_linfo, myparent, myname, cnt) -NHFILE *nhfp; -struct linfo *d_linfo; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "linfo"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "linfo", 1); - - sfo_uchar(nhfp, &d_linfo->flags, parent, "flags", 1); /* (unsigned char) */ -#ifdef MFLOPPY - sfo_int(nhfp, &d_linfo->where, parent, "where", 1); /* (int) */ - sfo_long(nhfp, &d_linfo->time, parent, "time", 1); /* (long) */ - sfo_long(nhfp, &d_linfo->size, parent, "size", 1); /* (long) */ -#endif /*MFLOPPY*/ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "linfo", 1); -} - -void -sfo_ls_t(nhfp, d_ls_t, myparent, myname, cnt) -NHFILE *nhfp; -struct ls_t *d_ls_t; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "ls_t"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "ls_t", 1); - - sfo_genericptr(nhfp, (genericptr_t) &d_ls_t->next, parent, "next", 1);/* (struct ls_t *) */ - sfo_xchar(nhfp, &d_ls_t->x, parent, "x", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_ls_t->y, parent, "y", 1); /* (xchar) */ - sfo_short(nhfp, &d_ls_t->range, parent, "range", 1); /* (short) */ - sfo_short(nhfp, &d_ls_t->flags, parent, "flags", 1); /* (short) */ - sfo_short(nhfp, &d_ls_t->type, parent, "type", 1); /* (short) */ - sfo_any(nhfp, &d_ls_t->id, parent, "id", 1); /* (any) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "ls_t", 1); -} - -void -sfo_mapseen_feat(nhfp, d_mapseen_feat, myparent, myname, cnt) -NHFILE *nhfp; -struct mapseen_feat *d_mapseen_feat; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "mapseen_feat"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "mapseen_feat", 1); - - bitfield = d_mapseen_feat->nfount; /* (Bitfield(nfount, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "nfount", 2); - bitfield = d_mapseen_feat->nsink; /* (Bitfield(nsink, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "nsink", 2); - bitfield = d_mapseen_feat->naltar; /* (Bitfield(naltar, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "naltar", 2); - bitfield = d_mapseen_feat->nthrone; /* (Bitfield(nthrone, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "nthrone", 2); - bitfield = d_mapseen_feat->ngrave; /* (Bitfield(ngrave, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "ngrave", 2); - bitfield = d_mapseen_feat->ntree; /* (Bitfield(ntree, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "ntree", 2); - bitfield = d_mapseen_feat->water; /* (Bitfield(water, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "water", 2); - bitfield = d_mapseen_feat->lava; /* (Bitfield(lava, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "lava", 2); - bitfield = d_mapseen_feat->ice; /* (Bitfield(ice, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "ice", 2); - bitfield = d_mapseen_feat->nshop; /* (Bitfield(nshop, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "nshop", 2); - bitfield = d_mapseen_feat->ntemple; /* (Bitfield(ntemple, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "ntemple", 2); - bitfield = d_mapseen_feat->msalign; /* (Bitfield(msalign, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "msalign", 2); - bitfield = d_mapseen_feat->shoptype; /* (Bitfield(shoptype, 5)) */ - sfo_bitfield(nhfp, &bitfield, parent, "shoptype", 5); - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "mapseen_feat", 1); -} - -void -sfo_mapseen_flags(nhfp, d_mapseen_flags, myparent, myname, cnt) -NHFILE *nhfp; -struct mapseen_flags *d_mapseen_flags; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "mapseen_flags"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "mapseen_flags", 1); - - bitfield = d_mapseen_flags->unreachable; /* (Bitfield(unreachable, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "unreachable", 1); - bitfield = d_mapseen_flags->forgot; /* (Bitfield(forgot, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "forgot", 1); - bitfield = d_mapseen_flags->knownbones; /* (Bitfield(knownbones, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "knownbones", 1); - bitfield = d_mapseen_flags->oracle; /* (Bitfield(oracle, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "oracle", 1); - bitfield = d_mapseen_flags->sokosolved; /* (Bitfield(sokosolved, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "sokosolved", 1); - bitfield = d_mapseen_flags->bigroom; /* (Bitfield(bigroom, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "bigroom", 1); - bitfield = d_mapseen_flags->castle; /* (Bitfield(castle, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "castle", 1); - bitfield = d_mapseen_flags->castletune; /* (Bitfield(castletune, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "castletune", 1); - bitfield = d_mapseen_flags->valley; /* (Bitfield(valley, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "valley", 1); - bitfield = d_mapseen_flags->msanctum; /* (Bitfield(msanctum, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "msanctum", 1); - bitfield = d_mapseen_flags->ludios; /* (Bitfield(ludios, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "ludios", 1); - bitfield = d_mapseen_flags->roguelevel; /* (Bitfield(roguelevel, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "roguelevel", 1); - bitfield = d_mapseen_flags->quest_summons; /* (Bitfield(quest_summons, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "quest_summons", 1); - bitfield = d_mapseen_flags->questing; /* (Bitfield(questing, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "questing", 1); - bitfield = d_mapseen_flags->vibrating_square; /* (Bitfield(vibrating_square, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "vibrating_square", 1); - bitfield = d_mapseen_flags->spare1; /* (Bitfield(spare1, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "spare1", 1); - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "mapseen_flags", 1); -} - -void -sfo_mapseen_rooms(nhfp, d_mapseen_rooms, myparent, myname, cnt) -NHFILE *nhfp; -struct mapseen_rooms *d_mapseen_rooms; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "mapseen_rooms"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "mapseen_rooms", 1); - - bitfield = d_mapseen_rooms->seen; /* (Bitfield(seen, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "seen", 1); - bitfield = d_mapseen_rooms->untended; /* (Bitfield(untended, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "untended", 1); - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "mapseen_rooms", 1); -} - -void -sfo_mapseen(nhfp, d_mapseen, myparent, myname, cnt) -NHFILE *nhfp; -struct mapseen *d_mapseen; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "mapseen"; - int i; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "mapseen", 1); - - sfo_genericptr(nhfp, (genericptr_t) &d_mapseen->next, parent, "next", 1);/* (struct mapseen *) */ - sfo_branch(nhfp, d_mapseen->br, parent, "br", 1); /* (branch *) */ - sfo_d_level(nhfp, &d_mapseen->lev, parent, "lev", 1); /* (d_level) */ - sfo_mapseen_feat(nhfp, &d_mapseen->feat, parent, "feat", 1); /* (}) */ - sfo_mapseen_flags(nhfp, &d_mapseen->flags, parent, "flags", 1);/* (}) */ - sfo_char(nhfp, d_mapseen->custom, parent, "custom", 1); /* (char *) */ - sfo_unsigned(nhfp, &d_mapseen->custom_lth, parent, "custom_lth", 1);/* (unsigned) */ - for (i = 0; i < (MAXNROFROOMS + 1) * 2; ++i) - sfo_mapseen_rooms(nhfp, &d_mapseen->msrooms[i], parent, "msrooms", 1);/* (}) */ - sfo_genericptr(nhfp, (genericptr_t) &d_mapseen->final_resting_place, parent, "final_resting_place", 1);/* (struct cemetery *) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "mapseen", 1); -} - -void -sfo_mextra(nhfp, d_mextra, myparent, myname, cnt) -NHFILE *nhfp; -struct mextra *d_mextra; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "mextra"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "mextra", 1); - - sfo_char(nhfp, d_mextra->mname, parent, "mname", 1); /* (char *) */ - sfo_egd(nhfp, d_mextra->egd, parent, "egd", 1); /* (struct egd *) */ - sfo_epri(nhfp, d_mextra->epri, parent, "epri", 1); /* (struct epri *) */ - sfo_eshk(nhfp, d_mextra->eshk, parent, "eshk", 1); /* (struct eshk *) */ - sfo_emin(nhfp, d_mextra->emin, parent, "emin", 1); /* (struct emin *) */ - sfo_edog(nhfp, d_mextra->edog, parent, "edog", 1); /* (struct edog *) */ - sfo_int(nhfp, &d_mextra->mcorpsenm, parent, "mcorpsenm", 1); /* (int) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "mextra", 1); -} - -void -sfo_mkroom(nhfp, d_mkroom, myparent, myname, cnt) -NHFILE *nhfp; -struct mkroom *d_mkroom; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "mkroom"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "mkroom", 1); - - sfo_schar(nhfp, &d_mkroom->lx, parent, "lx", 1); /* (schar) */ - sfo_schar(nhfp, &d_mkroom->hx, parent, "hx", 1); /* (schar) */ - sfo_schar(nhfp, &d_mkroom->ly, parent, "ly", 1); /* (schar) */ - sfo_schar(nhfp, &d_mkroom->hy, parent, "hy", 1); /* (schar) */ - sfo_schar(nhfp, &d_mkroom->rtype, parent, "rtype", 1); /* (schar) */ - sfo_schar(nhfp, &d_mkroom->orig_rtype, parent, "orig_rtype", 1);/* (schar) */ - sfo_schar(nhfp, &d_mkroom->rlit, parent, "rlit", 1); /* (schar) */ - sfo_schar(nhfp, &d_mkroom->needfill, parent, "needfill", 1); /* (schar) */ - sfo_schar(nhfp, &d_mkroom->needjoining, parent, "needjoining", 1);/* (schar) */ - sfo_schar(nhfp, &d_mkroom->doorct, parent, "doorct", 1); /* (schar) */ - sfo_schar(nhfp, &d_mkroom->fdoor, parent, "fdoor", 1); /* (schar) */ - sfo_schar(nhfp, &d_mkroom->nsubrooms, parent, "nsubrooms", 1);/* (schar) */ - sfo_boolean(nhfp, &d_mkroom->irregular, parent, "irregular", 1);/* (boolean) */ - sfo_genericptr(nhfp, (genericptr_t) &d_mkroom->sbrooms[0], parent, "sbrooms", MAX_SUBROOMS);/* (struct mkroom *) */ - sfo_genericptr(nhfp, (genericptr_t) &d_mkroom->resident, parent, "resident", 1);/* (struct monst *) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "mkroom", 1); -} - -void -sfo_monst(nhfp, d_monst, myparent, myname, cnt) -NHFILE *nhfp; -struct monst *d_monst; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "monst"; - int i; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "monst", 1); - - sfo_genericptr(nhfp, (genericptr_t) &d_monst->nmon, parent, "nmon", 1);/* (struct monst *) */ - sfo_genericptr(nhfp, (genericptr_t) &d_monst->data, parent, "data", 1);/* (struct permonst *) */ - sfo_unsigned(nhfp, &d_monst->m_id, parent, "m_id", 1); /* (unsigned) */ - sfo_short(nhfp, &d_monst->mnum, parent, "mnum", 1); /* (short) */ - sfo_short(nhfp, &d_monst->cham, parent, "cham", 1); /* (short) */ - sfo_short(nhfp, &d_monst->movement, parent, "movement", 1); /* (short) */ - sfo_uchar(nhfp, &d_monst->m_lev, parent, "m_lev", 1); /* (uchar) */ - sfo_aligntyp(nhfp, &d_monst->malign, parent, "malign", 1); /* (aligntyp) */ - sfo_xchar(nhfp, &d_monst->mx, parent, "mx", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_monst->my, parent, "my", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_monst->mux, parent, "mux", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_monst->muy, parent, "muy", 1); /* (xchar) */ - for (i = 0; i < MTSZ; ++i) - sfo_nhcoord(nhfp, &d_monst->mtrack[i], parent, "mtrack", 1);/* (nhcoord) */ - sfo_int(nhfp, &d_monst->mhp, parent, "mhp", 1); /* (int) */ - sfo_int(nhfp, &d_monst->mhpmax, parent, "mhpmax", 1); /* (int) */ - sfo_unsigned(nhfp, &d_monst->mappearance, parent, "mappearance", 1);/* (unsigned) */ - sfo_uchar(nhfp, &d_monst->m_ap_type, parent, "m_ap_type", 1);/* (uchar) */ - sfo_schar(nhfp, &d_monst->mtame, parent, "mtame", 1); /* (schar) */ - sfo_ushort(nhfp, &d_monst->mextrinsics, parent, "mextrinsics", 1);/* (unsigned short) */ - sfo_int(nhfp, &d_monst->mspec_used, parent, "mspec_used", 1);/* (int) */ - bitfield = d_monst->female; /* (Bitfield(female, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "female", 1); - bitfield = d_monst->minvis; /* (Bitfield(minvis, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "minvis", 1); - bitfield = d_monst->invis_blkd; /* (Bitfield(invis_blkd, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "invis_blkd", 1); - bitfield = d_monst->perminvis; /* (Bitfield(perminvis, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "perminvis", 1); - bitfield = d_monst->mcan; /* (Bitfield(mcan, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "mcan", 1); - bitfield = d_monst->mburied; /* (Bitfield(mburied, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "mburied", 1); - bitfield = d_monst->mundetected; /* (Bitfield(mundetected, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "mundetected", 1); - bitfield = d_monst->mcansee; /* (Bitfield(mcansee, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "mcansee", 1); - bitfield = d_monst->mspeed; /* (Bitfield(mspeed, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "mspeed", 2); - bitfield = d_monst->permspeed; /* (Bitfield(permspeed, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "permspeed", 2); - bitfield = d_monst->mrevived; /* (Bitfield(mrevived, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "mrevived", 1); - bitfield = d_monst->mcloned; /* (Bitfield(mcloned, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "mcloned", 1); - bitfield = d_monst->mavenge; /* (Bitfield(mavenge, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "mavenge", 1); - bitfield = d_monst->mflee; /* (Bitfield(mflee, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "mflee", 1); - bitfield = d_monst->mfleetim; /* (Bitfield(mfleetim, 7)) */ - sfo_bitfield(nhfp, &bitfield, parent, "mfleetim", 7); - bitfield = d_monst->msleeping; /* (Bitfield(msleeping, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "msleeping", 1); - bitfield = d_monst->mblinded; /* (Bitfield(mblinded, 7)) */ - sfo_bitfield(nhfp, &bitfield, parent, "mblinded", 7); - bitfield = d_monst->mstun; /* (Bitfield(mstun, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "mstun", 1); - bitfield = d_monst->mfrozen; /* (Bitfield(mfrozen, 7)) */ - sfo_bitfield(nhfp, &bitfield, parent, "mfrozen", 7); - bitfield = d_monst->mcanmove; /* (Bitfield(mcanmove, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "mcanmove", 1); - bitfield = d_monst->mconf; /* (Bitfield(mconf, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "mconf", 1); - bitfield = d_monst->mpeaceful; /* (Bitfield(mpeaceful, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "mpeaceful", 1); - bitfield = d_monst->mtrapped; /* (Bitfield(mtrapped, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "mtrapped", 1); - bitfield = d_monst->mleashed; /* (Bitfield(mleashed, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "mleashed", 1); - bitfield = d_monst->isshk; /* (Bitfield(isshk, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "isshk", 1); - bitfield = d_monst->isminion; /* (Bitfield(isminion, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "isminion", 1); - bitfield = d_monst->isgd; /* (Bitfield(isgd, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "isgd", 1); - bitfield = d_monst->ispriest; /* (Bitfield(ispriest, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "ispriest", 1); - bitfield = d_monst->iswiz; /* (Bitfield(iswiz, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "iswiz", 1); - bitfield = d_monst->wormno; /* (Bitfield(wormno, 5)) */ - sfo_bitfield(nhfp, &bitfield, parent, "wormno", 5); - bitfield = d_monst->mtemplit; /* (Bitfield(mtemplit, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "mtemplit", 1); - sfo_ulong(nhfp, &d_monst->mstrategy, parent, "mstrategy", 1);/* (unsigned long) */ - sfo_long(nhfp, &d_monst->mtrapseen, parent, "mtrapseen", 1); /* (long) */ - sfo_long(nhfp, &d_monst->mlstmv, parent, "mlstmv", 1); /* (long) */ - sfo_long(nhfp, &d_monst->mstate, parent, "mstate", 1); /* (long) */ - sfo_long(nhfp, &d_monst->migflags, parent, "migflags", 1); /* (long) */ - sfo_long(nhfp, &d_monst->mspare1, parent, "mspare1", 1); /* (long) */ - sfo_genericptr(nhfp, (genericptr_t) &d_monst->minvent, parent, "minvent", 1);/* (struct obj *) */ - sfo_genericptr(nhfp, (genericptr_t) &d_monst->mw, parent, "mw", 1);/* (struct obj *) */ - sfo_long(nhfp, &d_monst->misc_worn_check, parent, "misc_worn_check", 1);/* (long) */ - sfo_xchar(nhfp, &d_monst->weapon_check, parent, "weapon_check", 1);/* (xchar) */ - sfo_int(nhfp, &d_monst->meating, parent, "meating", 1); /* (int) */ - sfo_genericptr(nhfp, (genericptr_t) &d_monst->mextra, parent, "mextra", 1);/* (struct mextra *) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "monst", 1); -} - -void -sfo_mvitals(nhfp, d_mvitals, myparent, myname, cnt) -NHFILE *nhfp; -struct mvitals *d_mvitals; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "mvitals"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "mvitals", 1); - - sfo_uchar(nhfp, &d_mvitals->born, parent, "born", 1); /* (uchar) */ - sfo_uchar(nhfp, &d_mvitals->died, parent, "died", 1); /* (uchar) */ - sfo_uchar(nhfp, &d_mvitals->mvflags, parent, "mvflags", 1); /* (uchar) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "mvitals", 1); -} - -void -sfo_nhcoord(nhfp, d_nhcoord, myparent, myname, cnt) -NHFILE *nhfp; -struct nhcoord *d_nhcoord; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "nhcoord"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "nhcoord", 1); - - sfo_xchar(nhfp, &d_nhcoord->x, parent, "x", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_nhcoord->y, parent, "y", 1); /* (xchar) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "nhcoord", 1); -} - -void -sfo_nhrect(nhfp, d_nhrect, myparent, myname, cnt) -NHFILE *nhfp; -struct nhrect *d_nhrect; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "nhrect"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "nhrect", 1); - - sfo_xchar(nhfp, &d_nhrect->lx, parent, "lx", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_nhrect->ly, parent, "ly", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_nhrect->hx, parent, "hx", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_nhrect->hy, parent, "hy", 1); /* (xchar) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "nhrect", 1); -} - -void -sfo_novel_tracking(nhfp, d_novel_tracking, myparent, myname, cnt) -NHFILE *nhfp; -struct novel_tracking *d_novel_tracking; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "novel_tracking"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "novel_tracking", 1); - - sfo_unsigned(nhfp, &d_novel_tracking->id, parent, "id", 1); /* (unsigned) */ - sfo_int(nhfp, &d_novel_tracking->count, parent, "count", 1); /* (int) */ - sfo_xchar(nhfp, d_novel_tracking->pasg, parent, "pasg", 30); /* (xchar) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "novel_tracking", 1); -} - -void -sfo_obj(nhfp, d_obj, myparent, myname, cnt) -NHFILE *nhfp; -struct obj *d_obj; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "obj"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "obj", 1); - - sfo_genericptr(nhfp, (genericptr_t) &d_obj->nobj, parent, "nobj", 1);/* (struct obj *) */ - sfo_vptrs(nhfp, &d_obj->v, parent, "v", 1); /* (vptrs) */ - sfo_genericptr(nhfp, (genericptr_t) &d_obj->cobj, parent, "cobj", 1);/* (struct obj *) */ - sfo_unsigned(nhfp, &d_obj->o_id, parent, "o_id", 1); /* (unsigned) */ - sfo_xchar(nhfp, &d_obj->ox, parent, "ox", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_obj->oy, parent, "oy", 1); /* (xchar) */ - sfo_short(nhfp, &d_obj->otyp, parent, "otyp", 1); /* (short) */ - sfo_unsigned(nhfp, &d_obj->owt, parent, "owt", 1); /* (unsigned) */ - sfo_long(nhfp, &d_obj->quan, parent, "quan", 1); /* (long) */ - sfo_schar(nhfp, &d_obj->spe, parent, "spe", 1); /* (schar) */ - sfo_char(nhfp, &d_obj->oclass, parent, "oclass", 1); /* (char) */ - sfo_char(nhfp, &d_obj->invlet, parent, "invlet", 1); /* (char) */ - sfo_char(nhfp, &d_obj->oartifact, parent, "oartifact", 1); /* (char) */ - sfo_xchar(nhfp, &d_obj->where, parent, "where", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_obj->timed, parent, "timed", 1); /* (xchar) */ - bitfield = d_obj->cursed; /* (Bitfield(cursed, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "cursed", 1); - bitfield = d_obj->blessed; /* (Bitfield(blessed, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "blessed", 1); - bitfield = d_obj->unpaid; /* (Bitfield(unpaid, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "unpaid", 1); - bitfield = d_obj->no_charge; /* (Bitfield(no_charge, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "no_charge", 1); - bitfield = d_obj->known; /* (Bitfield(known, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "known", 1); - bitfield = d_obj->dknown; /* (Bitfield(dknown, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "dknown", 1); - bitfield = d_obj->bknown; /* (Bitfield(bknown, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "bknown", 1); - bitfield = d_obj->rknown; /* (Bitfield(rknown, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "rknown", 1); - bitfield = d_obj->oeroded; /* (Bitfield(oeroded, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "oeroded", 2); - bitfield = d_obj->oeroded2; /* (Bitfield(oeroded2, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "oeroded2", 2); - bitfield = d_obj->oerodeproof; /* (Bitfield(oerodeproof, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "oerodeproof", 1); - bitfield = d_obj->olocked; /* (Bitfield(olocked, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "olocked", 1); - bitfield = d_obj->obroken; /* (Bitfield(obroken, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "obroken", 1); - bitfield = d_obj->otrapped; /* (Bitfield(otrapped, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "otrapped", 1); - bitfield = d_obj->recharged; /* (Bitfield(recharged, 3)) */ - sfo_bitfield(nhfp, &bitfield, parent, "recharged", 3); - bitfield = d_obj->lamplit; /* (Bitfield(lamplit, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "lamplit", 1); - bitfield = d_obj->globby; /* (Bitfield(globby, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "globby", 1); - bitfield = d_obj->greased; /* (Bitfield(greased, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "greased", 1); - bitfield = d_obj->nomerge; /* (Bitfield(nomerge, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "nomerge", 1); - bitfield = d_obj->was_thrown; /* (Bitfield(was_thrown, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "was_thrown", 1); - bitfield = d_obj->in_use; /* (Bitfield(in_use, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "in_use", 1); - bitfield = d_obj->bypass; /* (Bitfield(bypass, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "bypass", 1); - bitfield = d_obj->cknown; /* (Bitfield(cknown, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "cknown", 1); - bitfield = d_obj->lknown; /* (Bitfield(lknown, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "lknown", 1); - sfo_int(nhfp, &d_obj->corpsenm, parent, "corpsenm", 1); /* (int) */ - sfo_int(nhfp, &d_obj->usecount, parent, "usecount", 1); /* (int) */ - sfo_unsigned(nhfp, &d_obj->oeaten, parent, "oeaten", 1); /* (unsigned) */ - sfo_long(nhfp, &d_obj->age, parent, "age", 1); /* (long) */ - sfo_long(nhfp, &d_obj->owornmask, parent, "owornmask", 1); /* (long) */ - sfo_genericptr(nhfp, (genericptr_t) &d_obj->oextra, parent, "oextra", 1);/* (struct oextra *) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "obj", 1); -} - -void -sfo_objclass(nhfp, d_objclass, myparent, myname, cnt) -NHFILE *nhfp; -struct objclass *d_objclass; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "objclass"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "objclass", 1); - - sfo_short(nhfp, &d_objclass->oc_name_idx, parent, "oc_name_idx", 1);/* (short) */ - sfo_short(nhfp, &d_objclass->oc_descr_idx, parent, "oc_descr_idx", 1);/* (short) */ - sfo_genericptr(nhfp, (genericptr_t) &d_objclass->oc_uname, parent, "oc_uname", 1);/* (char *) */ - bitfield = d_objclass->oc_name_known; /* (Bitfield(oc_name_known, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "oc_name_known", 1); - bitfield = d_objclass->oc_merge; /* (Bitfield(oc_merge, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "oc_merge", 1); - bitfield = d_objclass->oc_uses_known; /* (Bitfield(oc_uses_known, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "oc_uses_known", 1); - bitfield = d_objclass->oc_pre_discovered; /* (Bitfield(oc_pre_discovered, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "oc_pre_discovered", 1); - bitfield = d_objclass->oc_magic; /* (Bitfield(oc_magic, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "oc_magic", 1); - bitfield = d_objclass->oc_charged; /* (Bitfield(oc_charged, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "oc_charged", 1); - bitfield = d_objclass->oc_unique; /* (Bitfield(oc_unique, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "oc_unique", 1); - bitfield = d_objclass->oc_nowish; /* (Bitfield(oc_nowish, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "oc_nowish", 1); - bitfield = d_objclass->oc_big; /* (Bitfield(oc_big, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "oc_big", 1); - bitfield = d_objclass->oc_tough; /* (Bitfield(oc_tough, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "oc_tough", 1); - bitfield = d_objclass->oc_dir; /* (Bitfield(oc_dir, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "oc_dir", 2); - bitfield = d_objclass->oc_material; /* (Bitfield(oc_material, 5)) */ - sfo_bitfield(nhfp, &bitfield, parent, "oc_material", 5); - sfo_schar(nhfp, &d_objclass->oc_subtyp, parent, "oc_subtyp", 1);/* (schar) */ - sfo_uchar(nhfp, &d_objclass->oc_oprop, parent, "oc_oprop", 1);/* (uchar) */ - sfo_char(nhfp, &d_objclass->oc_class, parent, "oc_class", 1);/* (char) */ - sfo_schar(nhfp, &d_objclass->oc_delay, parent, "oc_delay", 1);/* (schar) */ - sfo_uchar(nhfp, &d_objclass->oc_color, parent, "oc_color", 1);/* (uchar) */ - sfo_short(nhfp, &d_objclass->oc_prob, parent, "oc_prob", 1); /* (short) */ - sfo_ushort(nhfp, &d_objclass->oc_weight, parent, "oc_weight", 1);/* (unsigned short) */ - sfo_short(nhfp, &d_objclass->oc_cost, parent, "oc_cost", 1); /* (short) */ - sfo_schar(nhfp, &d_objclass->oc_wsdam, parent, "oc_wsdam", 1);/* (schar) */ - sfo_schar(nhfp, &d_objclass->oc_wldam, parent, "oc_wldam", 1);/* (schar) */ - sfo_schar(nhfp, &d_objclass->oc_oc1, parent, "oc_oc1", 1); /* (schar) */ - sfo_schar(nhfp, &d_objclass->oc_oc2, parent, "oc_oc2", 1); /* (schar) */ - sfo_ushort(nhfp, &d_objclass->oc_nutrition, parent, "oc_nutrition", 1);/* (unsigned short) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "objclass", 1); -} - -void -sfo_obj_split(nhfp, d_obj_split, myparent, myname, cnt) -NHFILE *nhfp; -struct obj_split *d_obj_split; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "obj_split"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "obj_split", 1); - - sfo_unsigned(nhfp, &d_obj_split->parent_oid, parent, "parent_oid", 1);/* (unsigned) */ - sfo_unsigned(nhfp, &d_obj_split->child_oid, parent, "child_oid", 1);/* (unsigned) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "obj_split", 1); -} - -void -sfo_oextra(nhfp, d_oextra, myparent, myname, cnt) -NHFILE *nhfp; -struct oextra *d_oextra; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "oextra"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "oextra", 1); - - sfo_char(nhfp, d_oextra->oname, parent, "oname", 1); /* (char *) */ - sfo_genericptr(nhfp, (genericptr_t) &d_oextra->omonst, parent, "omonst", 1);/* (struct monst *) */ - sfo_unsigned(nhfp, d_oextra->omid, parent, "omid", 1); /* (unsigned *) */ - sfo_long(nhfp, d_oextra->olong, parent, "olong", 1); /* (long *) */ - sfo_char(nhfp, d_oextra->omailcmd, parent, "omailcmd", 1); /* (char *) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "oextra", 1); -} - -void -sfo_polearm_info(nhfp, d_polearm_info, myparent, myname, cnt) -NHFILE *nhfp; -struct polearm_info *d_polearm_info; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "polearm_info"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "polearm_info", 1); - - sfo_genericptr(nhfp, (genericptr_t) &d_polearm_info->hitmon, parent, "hitmon", 1);/* (struct monst *) */ - sfo_unsigned(nhfp, &d_polearm_info->m_id, parent, "m_id", 1);/* (unsigned) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "polearm_info", 1); -} - -void -sfo_prop(nhfp, d_prop, myparent, myname, cnt) -NHFILE *nhfp; -struct prop *d_prop; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "prop"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "prop", 1); - - sfo_long(nhfp, &d_prop->extrinsic, parent, "extrinsic", 1); /* (long) */ - sfo_long(nhfp, &d_prop->blocked, parent, "blocked", 1); /* (long) */ - sfo_long(nhfp, &d_prop->intrinsic, parent, "intrinsic", 1); /* (long) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "prop", 1); -} - -void -sfo_q_score(nhfp, d_q_score, myparent, myname, cnt) -NHFILE *nhfp; -struct q_score *d_q_score; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "q_score"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "q_score", 1); - - bitfield = d_q_score->first_start; /* (Bitfield(first_start, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "first_start", 1); - bitfield = d_q_score->met_leader; /* (Bitfield(met_leader, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "met_leader", 1); - bitfield = d_q_score->not_ready; /* (Bitfield(not_ready, 3)) */ - sfo_bitfield(nhfp, &bitfield, parent, "not_ready", 3); - bitfield = d_q_score->pissed_off; /* (Bitfield(pissed_off, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "pissed_off", 1); - bitfield = d_q_score->got_quest; /* (Bitfield(got_quest, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "got_quest", 1); - bitfield = d_q_score->first_locate; /* (Bitfield(first_locate, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "first_locate", 1); - bitfield = d_q_score->met_intermed; /* (Bitfield(met_intermed, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "met_intermed", 1); - bitfield = d_q_score->got_final; /* (Bitfield(got_final, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "got_final", 1); - bitfield = d_q_score->made_goal; /* (Bitfield(made_goal, 3)) */ - sfo_bitfield(nhfp, &bitfield, parent, "made_goal", 3); - bitfield = d_q_score->met_nemesis; /* (Bitfield(met_nemesis, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "met_nemesis", 1); - bitfield = d_q_score->killed_nemesis; /* (Bitfield(killed_nemesis, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "killed_nemesis", 1); - bitfield = d_q_score->in_battle; /* (Bitfield(in_battle, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "in_battle", 1); - bitfield = d_q_score->cheater; /* (Bitfield(cheater, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "cheater", 1); - bitfield = d_q_score->touched_artifact; /* (Bitfield(touched_artifact, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "touched_artifact", 1); - bitfield = d_q_score->offered_artifact; /* (Bitfield(offered_artifact, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "offered_artifact", 1); - bitfield = d_q_score->got_thanks; /* (Bitfield(got_thanks, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "got_thanks", 1); - bitfield = d_q_score->ldrgend; /* (Bitfield(ldrgend, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "ldrgend", 2); - bitfield = d_q_score->nemgend; /* (Bitfield(nemgend, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "nemgend", 2); - bitfield = d_q_score->godgend; /* (Bitfield(godgend, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "godgend", 2); - bitfield = d_q_score->leader_is_dead; /* (Bitfield(leader_is_dead, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "leader_is_dead", 1); - sfo_unsigned(nhfp, &d_q_score->leader_m_id, parent, "leader_m_id", 1);/* (unsigned) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "q_score", 1); -} - -void -sfo_rm(nhfp, d_rm, myparent, myname, cnt) -NHFILE *nhfp; -struct rm *d_rm; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "rm"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "rm", 1); - - sfo_int(nhfp, &d_rm->glyph, parent, "glyph", 1); /* (int) */ - sfo_schar(nhfp, &d_rm->typ, parent, "typ", 1); /* (schar) */ - sfo_uchar(nhfp, &d_rm->seenv, parent, "seenv", 1); /* (uchar) */ - bitfield = d_rm->flags; /* (Bitfield(flags, 5)) */ - sfo_bitfield(nhfp, &bitfield, parent, "flags", 5); - bitfield = d_rm->horizontal; /* (Bitfield(horizontal, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "horizontal", 1); - bitfield = d_rm->lit; /* (Bitfield(lit, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "lit", 1); - bitfield = d_rm->waslit; /* (Bitfield(waslit, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "waslit", 1); - bitfield = d_rm->roomno; /* (Bitfield(roomno, 6)) */ - sfo_bitfield(nhfp, &bitfield, parent, "roomno", 6); - bitfield = d_rm->edge; /* (Bitfield(edge, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "edge", 1); - bitfield = d_rm->candig; /* (Bitfield(candig, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "candig", 1); - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "rm", 1); -} - -void -sfo_s_level(nhfp, d_s_level, myparent, myname, cnt) -NHFILE *nhfp; -struct s_level *d_s_level; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "s_level"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "s_level", 1); - - sfo_genericptr(nhfp, (genericptr_t) &d_s_level->next, parent, "next", 1);/* (struct s_level *) */ - sfo_d_level(nhfp, &d_s_level->dlevel, parent, "dlevel", 1); /* (d_level) */ - sfo_char(nhfp, d_s_level->proto, parent, "proto", 15); /* (char) */ - sfo_char(nhfp, &d_s_level->boneid, parent, "boneid", 1); /* (char) */ - sfo_uchar(nhfp, &d_s_level->rndlevs, parent, "rndlevs", 1); /* (uchar) */ - sfo_d_flags(nhfp, &d_s_level->flags, parent, "flags", 1); /* (d_flags) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "s_level", 1); -} - -void -sfo_savefile_info(nhfp, d_savefile_info, myparent, myname, cnt) -NHFILE *nhfp; -struct savefile_info *d_savefile_info; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "savefile_info"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "savefile_info", 1); - - sfo_ulong(nhfp, &d_savefile_info->sfi1, parent, "sfi1", 1); /* (unsigned long) */ - sfo_ulong(nhfp, &d_savefile_info->sfi2, parent, "sfi2", 1); /* (unsigned long) */ - sfo_ulong(nhfp, &d_savefile_info->sfi3, parent, "sfi3", 1); /* (unsigned long) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "savefile_info", 1); -} - -void -sfo_skills(nhfp, d_skills, myparent, myname, cnt) -NHFILE *nhfp; -struct skills *d_skills; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "skills"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "skills", 1); - - sfo_xchar(nhfp, &d_skills->skill, parent, "skill", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_skills->max_skill, parent, "max_skill", 1);/* (xchar) */ - sfo_ushort(nhfp, &d_skills->advance, parent, "advance", 1); /* (unsigned short) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "skills", 1); -} - -void -sfo_spell(nhfp, d_spell, myparent, myname, cnt) -NHFILE *nhfp; -struct spell *d_spell; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "spell"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "spell", 1); - - sfo_short(nhfp, &d_spell->sp_id, parent, "sp_id", 1); /* (short) */ - sfo_xchar(nhfp, &d_spell->sp_lev, parent, "sp_lev", 1); /* (xchar) */ - sfo_int(nhfp, &d_spell->sp_know, parent, "sp_know", 1); /* (int) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "spell", 1); -} - -void -sfo_stairway(nhfp, d_stairway, myparent, myname, cnt) -NHFILE *nhfp; -struct stairway *d_stairway; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "stairway"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "stairway", 1); - - sfo_xchar(nhfp, &d_stairway->sx, parent, "sx", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_stairway->sy, parent, "sy", 1); /* (xchar) */ - sfo_d_level(nhfp, &d_stairway->tolev, parent, "tolev", 1); /* (d_level) */ - sfo_char(nhfp, &d_stairway->up, parent, "up", 1); /* (char) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "stairway", 1); -} - -void -sfo_takeoff_info(nhfp, d_takeoff_info, myparent, myname, cnt) -NHFILE *nhfp; -struct takeoff_info *d_takeoff_info; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "takeoff_info"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "takeoff_info", 1); - - sfo_long(nhfp, &d_takeoff_info->mask, parent, "mask", 1); /* (long) */ - sfo_long(nhfp, &d_takeoff_info->what, parent, "what", 1); /* (long) */ - sfo_int(nhfp, &d_takeoff_info->delay, parent, "delay", 1); /* (int) */ - sfo_boolean(nhfp, &d_takeoff_info->cancelled_don, parent, "cancelled_don", 1);/* (boolean) */ - sfo_char(nhfp, d_takeoff_info->disrobing, parent, "disrobing", CONTEXTVERBSZ + 1);/* (char) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "takeoff_info", 1); -} - -void -sfo_tin_info(nhfp, d_tin_info, myparent, myname, cnt) -NHFILE *nhfp; -struct tin_info *d_tin_info; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "tin_info"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "tin_info", 1); - - sfo_genericptr(nhfp, (genericptr_t) &d_tin_info->tin, parent, "tin", 1);/* (struct obj *) */ - sfo_unsigned(nhfp, &d_tin_info->o_id, parent, "o_id", 1); /* (unsigned) */ - sfo_int(nhfp, &d_tin_info->usedtime, parent, "usedtime", 1); /* (int) */ - sfo_int(nhfp, &d_tin_info->reqtime, parent, "reqtime", 1); /* (int) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "tin_info", 1); -} - -void -sfo_trap(nhfp, d_trap, myparent, myname, cnt) -NHFILE *nhfp; -struct trap *d_trap; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "trap"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "trap", 1); - - sfo_genericptr(nhfp, (genericptr_t) &d_trap->ntrap, parent, "ntrap", 1);/* (struct trap *) */ - sfo_xchar(nhfp, &d_trap->tx, parent, "tx", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_trap->ty, parent, "ty", 1); /* (xchar) */ - sfo_d_level(nhfp, &d_trap->dst, parent, "dst", 1); /* (d_level) */ - sfo_nhcoord(nhfp, &d_trap->launch, parent, "launch", 1); /* (nhcoord) */ - bitfield = d_trap->ttyp; /* (Bitfield(ttyp, 5)) */ - sfo_bitfield(nhfp, &bitfield, parent, "ttyp", 5); - bitfield = d_trap->tseen; /* (Bitfield(tseen, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "tseen", 1); - bitfield = d_trap->once; /* (Bitfield(once, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "once", 1); - bitfield = d_trap->madeby_u; /* (Bitfield(madeby_u, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "madeby_u", 1); - sfo_vlaunchinfo(nhfp, &d_trap->vl, parent, "vl", 1); /* (vlaunchinfo) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "trap", 1); -} - -void -sfo_tribute_info(nhfp, d_tribute_info, myparent, myname, cnt) -NHFILE *nhfp; -struct tribute_info *d_tribute_info; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "tribute_info"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "tribute_info", 1); - - sfo_size_t(nhfp, &d_tribute_info->tributesz, parent, "tributesz", 1);/* (size_t) */ - sfo_boolean(nhfp, &d_tribute_info->enabled, parent, "enabled", 1);/* (boolean) */ - bitfield = d_tribute_info->bookstock; /* (Bitfield(bookstock, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "bookstock", 1); - bitfield = d_tribute_info->Deathnotice; /* (Bitfield(Deathnotice,1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "Deathnotice", 1); - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "tribute_info", 1); -} - -void -sfo_u_achieve(nhfp, d_u_achieve, myparent, myname, cnt) -NHFILE *nhfp; -struct u_achieve *d_u_achieve; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "u_achieve"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "u_achieve", 1); - - bitfield = d_u_achieve->amulet; /* (Bitfield(amulet, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "amulet", 1); - bitfield = d_u_achieve->bell; /* (Bitfield(bell, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "bell", 1); - bitfield = d_u_achieve->book; /* (Bitfield(book, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "book", 1); - bitfield = d_u_achieve->menorah; /* (Bitfield(menorah, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "menorah", 1); - bitfield = d_u_achieve->enter_gehennom; /* (Bitfield(enter_gehennom,1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "enter_gehennom", 1); - bitfield = d_u_achieve->ascended; /* (Bitfield(ascended, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "ascended", 1); - bitfield = d_u_achieve->mines_luckstone; /* (Bitfield(mines_luckstone, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "mines_luckstone", 1); - bitfield = d_u_achieve->finish_sokoban; /* (Bitfield(finish_sokoban, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "finish_sokoban", 1); - bitfield = d_u_achieve->killed_medusa; /* (Bitfield(killed_medusa, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "killed_medusa", 1); - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "u_achieve", 1); -} - -void -sfo_u_conduct(nhfp, d_u_conduct, myparent, myname, cnt) -NHFILE *nhfp; -struct u_conduct *d_u_conduct; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "u_conduct"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "u_conduct", 1); - - sfo_long(nhfp, &d_u_conduct->unvegetarian, parent, "unvegetarian", 1);/* (long) */ - sfo_long(nhfp, &d_u_conduct->unvegan, parent, "unvegan", 1); /* (long) */ - sfo_long(nhfp, &d_u_conduct->food, parent, "food", 1); /* (long) */ - sfo_long(nhfp, &d_u_conduct->gnostic, parent, "gnostic", 1); /* (long) */ - sfo_long(nhfp, &d_u_conduct->weaphit, parent, "weaphit", 1); /* (long) */ - sfo_long(nhfp, &d_u_conduct->killer, parent, "killer", 1); /* (long) */ - sfo_long(nhfp, &d_u_conduct->literate, parent, "literate", 1);/* (long) */ - sfo_long(nhfp, &d_u_conduct->polypiles, parent, "polypiles", 1);/* (long) */ - sfo_long(nhfp, &d_u_conduct->polyselfs, parent, "polyselfs", 1);/* (long) */ - sfo_long(nhfp, &d_u_conduct->wishes, parent, "wishes", 1); /* (long) */ - sfo_long(nhfp, &d_u_conduct->wisharti, parent, "wisharti", 1);/* (long) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "u_conduct", 1); -} - -void -sfo_u_event(nhfp, d_u_event, myparent, myname, cnt) -NHFILE *nhfp; -struct u_event *d_u_event; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "u_event"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "u_event", 1); - - bitfield = d_u_event->minor_oracle; /* (Bitfield(minor_oracle, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "minor_oracle", 1); - bitfield = d_u_event->major_oracle; /* (Bitfield(major_oracle, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "major_oracle", 1); - bitfield = d_u_event->read_tribute; /* (Bitfield(read_tribute, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "read_tribute", 1); - bitfield = d_u_event->qcalled; /* (Bitfield(qcalled, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "qcalled", 1); - bitfield = d_u_event->qexpelled; /* (Bitfield(qexpelled, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "qexpelled", 1); - bitfield = d_u_event->qcompleted; /* (Bitfield(qcompleted, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "qcompleted", 1); - bitfield = d_u_event->uheard_tune; /* (Bitfield(uheard_tune, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "uheard_tune", 2); - bitfield = d_u_event->uopened_dbridge; /* (Bitfield(uopened_dbridge, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "uopened_dbridge", 1); - bitfield = d_u_event->invoked; /* (Bitfield(invoked, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "invoked", 1); - bitfield = d_u_event->gehennom_entered; /* (Bitfield(gehennom_entered, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "gehennom_entered", 1); - bitfield = d_u_event->uhand_of_elbereth; /* (Bitfield(uhand_of_elbereth, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "uhand_of_elbereth", 2); - bitfield = d_u_event->udemigod; /* (Bitfield(udemigod, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "udemigod", 1); - bitfield = d_u_event->uvibrated; /* (Bitfield(uvibrated, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "uvibrated", 1); - bitfield = d_u_event->ascended; /* (Bitfield(ascended, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "ascended", 1); - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "u_event", 1); -} - -void -sfo_u_have(nhfp, d_u_have, myparent, myname, cnt) -NHFILE *nhfp; -struct u_have *d_u_have; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "u_have"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "u_have", 1); - - bitfield = d_u_have->amulet; /* (Bitfield(amulet, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "amulet", 1); - bitfield = d_u_have->bell; /* (Bitfield(bell, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "bell", 1); - bitfield = d_u_have->book; /* (Bitfield(book, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "book", 1); - bitfield = d_u_have->menorah; /* (Bitfield(menorah, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "menorah", 1); - bitfield = d_u_have->questart; /* (Bitfield(questart, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "questart", 1); - bitfield = d_u_have->unused; /* (Bitfield(unused, 3)) */ - sfo_bitfield(nhfp, &bitfield, parent, "unused", 3); - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "u_have", 1); -} - -void -sfo_u_realtime(nhfp, d_u_realtime, myparent, myname, cnt) -NHFILE *nhfp; -struct u_realtime *d_u_realtime; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "u_realtime"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "u_realtime", 1); - - sfo_long(nhfp, &d_u_realtime->realtime, parent, "realtime", 1);/* (long) */ - sfo_time_t(nhfp, &d_u_realtime->start_timing, parent, "start_timing", 1);/* (time_t) */ - sfo_time_t(nhfp, &d_u_realtime->finish_time, parent, "finish_time", 1);/* (time_t) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "u_realtime", 1); -} - -void -sfo_u_roleplay(nhfp, d_u_roleplay, myparent, myname, cnt) -NHFILE *nhfp; -struct u_roleplay *d_u_roleplay; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "u_roleplay"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "u_roleplay", 1); - - sfo_boolean(nhfp, &d_u_roleplay->blind, parent, "blind", 1); /* (boolean) */ - sfo_boolean(nhfp, &d_u_roleplay->nudist, parent, "nudist", 1);/* (boolean) */ - sfo_long(nhfp, &d_u_roleplay->numbones, parent, "numbones", 1);/* (long) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "u_roleplay", 1); -} - -void -sfo_version_info(nhfp, d_version_info, myparent, myname, cnt) -NHFILE *nhfp; -struct version_info *d_version_info; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "version_info"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "version_info", 1); - - sfo_ulong(nhfp, &d_version_info->incarnation, parent, "incarnation", 1);/* (unsigned long) */ - sfo_ulong(nhfp, &d_version_info->feature_set, parent, "feature_set", 1);/* (unsigned long) */ - sfo_ulong(nhfp, &d_version_info->entity_count, parent, "entity_count", 1);/* (unsigned long) */ - sfo_ulong(nhfp, &d_version_info->struct_sizes1, parent, "struct_sizes1", 1);/* (unsigned long) */ - sfo_ulong(nhfp, &d_version_info->struct_sizes2, parent, "struct_sizes2", 1);/* (unsigned long) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "version_info", 1); -} - -void -sfo_victual_info(nhfp, d_victual_info, myparent, myname, cnt) -NHFILE *nhfp; -struct victual_info *d_victual_info; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "victual_info"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "victual_info", 1); - - sfo_genericptr(nhfp, (genericptr_t) &d_victual_info->piece, parent, "piece", 1);/* (struct obj *) */ - sfo_unsigned(nhfp, &d_victual_info->o_id, parent, "o_id", 1);/* (unsigned) */ - sfo_int(nhfp, &d_victual_info->usedtime, parent, "usedtime", 1);/* (int) */ - sfo_int(nhfp, &d_victual_info->reqtime, parent, "reqtime", 1);/* (int) */ - sfo_int(nhfp, &d_victual_info->nmod, parent, "nmod", 1); /* (int) */ - bitfield = d_victual_info->canchoke; /* (Bitfield(canchoke, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "canchoke", 1); - bitfield = d_victual_info->fullwarn; /* (Bitfield(fullwarn, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "fullwarn", 1); - bitfield = d_victual_info->eating; /* (Bitfield(eating, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "eating", 1); - bitfield = d_victual_info->doreset; /* (Bitfield(doreset, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "doreset", 1); - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "victual_info", 1); -} - -void -sfo_vlaunchinfo(nhfp, d_vlaunchinfo, myparent, myname, cnt) -NHFILE *nhfp; -union vlaunchinfo *d_vlaunchinfo; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "vlaunchinfo"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "vlaunchinfo", 1); - - sfo_short(nhfp, &d_vlaunchinfo->v_launch_otyp, parent, "v_launch_otyp", 1);/* (short) */ - sfo_nhcoord(nhfp, &d_vlaunchinfo->v_launch2, parent, "v_launch2", 1);/* (nhcoord) */ - sfo_uchar(nhfp, &d_vlaunchinfo->v_conjoined, parent, "v_conjoined", 1);/* (uchar) */ - sfo_short(nhfp, &d_vlaunchinfo->v_tnote, parent, "v_tnote", 1);/* (short) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "vlaunchinfo", 1); -} - -void -sfo_vptrs(nhfp, d_vptrs, myparent, myname, cnt) -NHFILE *nhfp; -union vptrs *d_vptrs; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "vptrs"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "vptrs", 1); - - sfo_genericptr(nhfp, (genericptr_t) &d_vptrs->v_nexthere, parent, "v_nexthere", 1);/* (struct obj *) */ - sfo_genericptr(nhfp, (genericptr_t) &d_vptrs->v_ocontainer, parent, "v_ocontainer", 1);/* (struct obj *) */ - sfo_genericptr(nhfp, (genericptr_t) &d_vptrs->v_ocarry, parent, "v_ocarry", 1);/* (struct monst *) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "vptrs", 1); -} - -void -sfo_warntype_info(nhfp, d_warntype_info, myparent, myname, cnt) -NHFILE *nhfp; -struct warntype_info *d_warntype_info; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "warntype_info"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "warntype_info", 1); - - sfo_ulong(nhfp, &d_warntype_info->obj, parent, "obj", 1); /* (unsigned long) */ - sfo_ulong(nhfp, &d_warntype_info->polyd, parent, "polyd", 1);/* (unsigned long) */ - sfo_genericptr(nhfp, (genericptr_t) &d_warntype_info->species, parent, "species", 1);/* (struct permonst *) */ - sfo_short(nhfp, &d_warntype_info->speciesidx, parent, "speciesidx", 1);/* (short) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "warntype_info", 1); -} - -void -sfo_you(nhfp, d_you, myparent, myname, cnt) -NHFILE *nhfp; -struct you *d_you; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "you"; - int i; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "start", "you", 1); - - sfo_xchar(nhfp, &d_you->ux, parent, "ux", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_you->uy, parent, "uy", 1); /* (xchar) */ - sfo_schar(nhfp, &d_you->dx, parent, "dx", 1); /* (schar) */ - sfo_schar(nhfp, &d_you->dy, parent, "dy", 1); /* (schar) */ - sfo_schar(nhfp, &d_you->dz, parent, "dz", 1); /* (schar) */ - sfo_schar(nhfp, &d_you->di, parent, "di", 1); /* (schar) */ - sfo_xchar(nhfp, &d_you->tx, parent, "tx", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_you->ty, parent, "ty", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_you->ux0, parent, "ux0", 1); /* (xchar) */ - sfo_xchar(nhfp, &d_you->uy0, parent, "uy0", 1); /* (xchar) */ - sfo_d_level(nhfp, &d_you->uz, parent, "uz", 1); /* (d_level) */ - sfo_d_level(nhfp, &d_you->uz0, parent, "uz0", 1); /* (d_level) */ - sfo_d_level(nhfp, &d_you->utolev, parent, "utolev", 1); /* (d_level) */ - sfo_uchar(nhfp, &d_you->utotype, parent, "utotype", 1); /* (uchar) */ - sfo_boolean(nhfp, &d_you->umoved, parent, "umoved", 1); /* (boolean) */ - sfo_int(nhfp, &d_you->last_str_turn, parent, "last_str_turn", 1);/* (int) */ - sfo_int(nhfp, &d_you->ulevel, parent, "ulevel", 1); /* (int) */ - sfo_int(nhfp, &d_you->ulevelmax, parent, "ulevelmax", 1); /* (int) */ - sfo_unsigned(nhfp, &d_you->utrap, parent, "utrap", 1); /* (unsigned) */ - sfo_unsigned(nhfp, &d_you->utraptype, parent, "utraptype", 1);/* (unsigned) */ - sfo_char(nhfp, d_you->urooms, parent, "urooms", 5); /* (char) */ - sfo_char(nhfp, d_you->urooms0, parent, "urooms0", 5); /* (char) */ - sfo_char(nhfp, d_you->uentered, parent, "uentered", 5); /* (char) */ - sfo_char(nhfp, d_you->ushops, parent, "ushops", 5); /* (char) */ - sfo_char(nhfp, d_you->ushops0, parent, "ushops0", 5); /* (char) */ - sfo_char(nhfp, d_you->ushops_entered, parent, "ushops_entered", 5);/* (char) */ - sfo_char(nhfp, d_you->ushops_left, parent, "ushops_left", 5);/* (char) */ - sfo_int(nhfp, &d_you->uhunger, parent, "uhunger", 1); /* (int) */ - sfo_unsigned(nhfp, &d_you->uhs, parent, "uhs", 1); /* (unsigned) */ - sfo_prop(nhfp, d_you->uprops, parent, "uprops", LAST_PROP + 1);/* (prop) */ - sfo_unsigned(nhfp, &d_you->umconf, parent, "umconf", 1); /* (unsigned) */ - bitfield = d_you->usick_type; /* (Bitfield(usick_type, 2)) */ - sfo_bitfield(nhfp, &bitfield, parent, "usick_type", 2); - sfo_int(nhfp, &d_you->nv_range, parent, "nv_range", 1); /* (int) */ - sfo_int(nhfp, &d_you->xray_range, parent, "xray_range", 1); /* (int) */ - sfo_int(nhfp, &d_you->bglyph, parent, "bglyph", 1); /* (int) */ - sfo_int(nhfp, &d_you->cglyph, parent, "cglyph", 1); /* (int) */ - sfo_int(nhfp, &d_you->bc_order, parent, "bc_order", 1); /* (int) */ - sfo_int(nhfp, &d_you->bc_felt, parent, "bc_felt", 1); /* (int) */ - sfo_int(nhfp, &d_you->umonster, parent, "umonster", 1); /* (int) */ - sfo_int(nhfp, &d_you->umonnum, parent, "umonnum", 1); /* (int) */ - sfo_int(nhfp, &d_you->mh, parent, "mh", 1); /* (int) */ - sfo_int(nhfp, &d_you->mhmax, parent, "mhmax", 1); /* (int) */ - sfo_int(nhfp, &d_you->mtimedone, parent, "mtimedone", 1); /* (int) */ - sfo_attribs(nhfp, &d_you->macurr, parent, "macurr", 1); /* (attribs) */ - sfo_attribs(nhfp, &d_you->mamax, parent, "mamax", 1); /* (attribs) */ - sfo_int(nhfp, &d_you->ulycn, parent, "ulycn", 1); /* (int) */ - sfo_unsigned(nhfp, &d_you->ucreamed, parent, "ucreamed", 1); /* (unsigned) */ - sfo_unsigned(nhfp, &d_you->uswldtim, parent, "uswldtim", 1); /* (unsigned) */ - bitfield = d_you->uswallow; /* (Bitfield(uswallow, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "uswallow", 1); - bitfield = d_you->uinwater; /* (Bitfield(uinwater, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "uinwater", 1); - bitfield = d_you->uundetected; /* (Bitfield(uundetected, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "uundetected", 1); - bitfield = d_you->mfemale; /* (Bitfield(mfemale, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "mfemale", 1); - bitfield = d_you->uinvulnerable; /* (Bitfield(uinvulnerable, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "uinvulnerable", 1); - bitfield = d_you->uburied; /* (Bitfield(uburied, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "uburied", 1); - bitfield = d_you->uedibility; /* (Bitfield(uedibility, 1)) */ - sfo_bitfield(nhfp, &bitfield, parent, "uedibility", 1); - sfo_unsigned(nhfp, &d_you->udg_cnt, parent, "udg_cnt", 1); /* (unsigned) */ - sfo_u_achieve(nhfp, &d_you->uachieve, parent, "uachieve", 1);/* (u_achieve) */ - sfo_u_event(nhfp, &d_you->uevent, parent, "uevent", 1); /* (u_event) */ - sfo_u_have(nhfp, &d_you->uhave, parent, "uhave", 1); /* (u_have) */ - sfo_u_conduct(nhfp, &d_you->uconduct, parent, "uconduct", 1);/* (u_conduct) */ - sfo_u_roleplay(nhfp, &d_you->uroleplay, parent, "uroleplay", 1);/* (u_roleplay) */ - sfo_attribs(nhfp, &d_you->acurr, parent, "acurr", 1); /* (attribs) */ - sfo_attribs(nhfp, &d_you->aexe, parent, "aexe", 1); /* (attribs) */ - sfo_attribs(nhfp, &d_you->abon, parent, "abon", 1); /* (attribs) */ - sfo_attribs(nhfp, &d_you->amax, parent, "amax", 1); /* (attribs) */ - sfo_attribs(nhfp, &d_you->atemp, parent, "atemp", 1); /* (attribs) */ - sfo_attribs(nhfp, &d_you->atime, parent, "atime", 1); /* (attribs) */ - sfo_align(nhfp, &d_you->ualign, parent, "ualign", 1); /* (align) */ - for (i = 0; i < CONVERT; ++i) - sfo_aligntyp(nhfp, &d_you->ualignbase[i], parent, "ualignbase", 1);/* (aligntyp) */ - sfo_schar(nhfp, &d_you->uluck, parent, "uluck", 1); /* (schar) */ - sfo_schar(nhfp, &d_you->moreluck, parent, "moreluck", 1); /* (schar) */ - sfo_schar(nhfp, &d_you->uhitinc, parent, "uhitinc", 1); /* (schar) */ - sfo_schar(nhfp, &d_you->udaminc, parent, "udaminc", 1); /* (schar) */ - sfo_schar(nhfp, &d_you->uac, parent, "uac", 1); /* (schar) */ - sfo_uchar(nhfp, &d_you->uspellprot, parent, "uspellprot", 1);/* (uchar) */ - sfo_uchar(nhfp, &d_you->usptime, parent, "usptime", 1); /* (uchar) */ - sfo_uchar(nhfp, &d_you->uspmtime, parent, "uspmtime", 1); /* (uchar) */ - sfo_int(nhfp, &d_you->uhp, parent, "uhp", 1); /* (int) */ - sfo_int(nhfp, &d_you->uhpmax, parent, "uhpmax", 1); /* (int) */ - sfo_int(nhfp, &d_you->uen, parent, "uen", 1); /* (int) */ - sfo_int(nhfp, &d_you->uenmax, parent, "uenmax", 1); /* (int) */ - sfo_xchar(nhfp, d_you->uhpinc, parent, "uhpinc", MAXULEV); /* (xchar) */ - sfo_xchar(nhfp, d_you->ueninc, parent, "ueninc", MAXULEV); /* (xchar) */ - sfo_int(nhfp, &d_you->ugangr, parent, "ugangr", 1); /* (int) */ - sfo_int(nhfp, &d_you->ugifts, parent, "ugifts", 1); /* (int) */ - sfo_int(nhfp, &d_you->ublessed, parent, "ublessed", 1); /* (int) */ - sfo_int(nhfp, &d_you->ublesscnt, parent, "ublesscnt", 1); /* (int) */ - sfo_long(nhfp, &d_you->umoney0, parent, "umoney0", 1); /* (long) */ - sfo_long(nhfp, &d_you->uspare1, parent, "uspare1", 1); /* (long) */ - sfo_long(nhfp, &d_you->uexp, parent, "uexp", 1); /* (long) */ - sfo_long(nhfp, &d_you->urexp, parent, "urexp", 1); /* (long) */ - sfo_long(nhfp, &d_you->ucleansed, parent, "ucleansed", 1); /* (long) */ - sfo_long(nhfp, &d_you->usleep, parent, "usleep", 1); /* (long) */ - sfo_int(nhfp, &d_you->uinvault, parent, "uinvault", 1); /* (int) */ - sfo_genericptr(nhfp, (genericptr_t) &d_you->ustuck, parent, "ustuck", 1);/* (struct monst *) */ - sfo_genericptr(nhfp, (genericptr_t) &d_you->usteed, parent, "usteed", 1);/* (struct monst *) */ - sfo_long(nhfp, &d_you->ugallop, parent, "ugallop", 1); /* (long) */ - sfo_int(nhfp, &d_you->urideturns, parent, "urideturns", 1); /* (int) */ - sfo_int(nhfp, &d_you->umortality, parent, "umortality", 1); /* (int) */ - sfo_int(nhfp, &d_you->ugrave_arise, parent, "ugrave_arise", 1);/* (int) */ - sfo_int(nhfp, &d_you->weapon_slots, parent, "weapon_slots", 1);/* (int) */ - sfo_int(nhfp, &d_you->skills_advanced, parent, "skills_advanced", 1);/* (int) */ - sfo_xchar(nhfp, d_you->skill_record, parent, "skill_record", P_SKILL_LIMIT);/* (xchar) */ - for (i = 0; i < P_NUM_SKILLS; ++i) - sfo_skills(nhfp, &d_you->weapon_skills[i], parent, "weapon_skills", 1);/* (skills) */ - sfo_boolean(nhfp, &d_you->twoweap, parent, "twoweap", 1); /* (boolean) */ - sfo_short(nhfp, &d_you->mcham, parent, "mcham", 1); /* (short) */ - - if (nhfp->addinfo) - sfo_addinfo(nhfp, myparent, "end", "you", 1); -} - -void -sfi_align(nhfp, d_align, myparent, myname, cnt) -NHFILE *nhfp; -struct align *d_align; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "align"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "align", 1); - - sfi_aligntyp(nhfp, &d_align->type, parent, "type", 1); - sfi_int(nhfp, &d_align->record, parent, "record", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "align", 1); -} - -void -sfi_attribs(nhfp, d_attribs, myparent, myname, cnt) -NHFILE *nhfp; -struct attribs *d_attribs; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "attribs"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "attribs", 1); - - sfi_schar(nhfp, d_attribs->a, parent, "a", A_MAX); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "attribs", 1); -} - -void -sfi_bill_x(nhfp, d_bill_x, myparent, myname, cnt) -NHFILE *nhfp; -struct bill_x *d_bill_x; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "bill_x"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "bill_x", 1); - - sfi_unsigned(nhfp, &d_bill_x->bo_id, parent, "bo_id", 1); - sfi_boolean(nhfp, &d_bill_x->useup, parent, "useup", 1); - sfi_long(nhfp, &d_bill_x->price, parent, "price", 1); - sfi_long(nhfp, &d_bill_x->bquan, parent, "bquan", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "bill_x", 1); -} - -void -sfi_book_info(nhfp, d_book_info, myparent, myname, cnt) -NHFILE *nhfp; -struct book_info *d_book_info; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "book_info"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "book_info", 1); - - sfi_genericptr(nhfp, (genericptr_t) &d_book_info->book, parent, "book", 1); - sfi_unsigned(nhfp, &d_book_info->o_id, parent, "o_id", 1); - sfi_schar(nhfp, &d_book_info->delay, parent, "delay", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "book_info", 1); -} - -void -sfi_branch(nhfp, d_branch, myparent, myname, cnt) -NHFILE *nhfp; -struct branch *d_branch; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "branch"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "branch", 1); - - sfi_genericptr(nhfp, (genericptr_t) &d_branch->next, parent, "next", 1); - sfi_int(nhfp, &d_branch->id, parent, "id", 1); - sfi_int(nhfp, &d_branch->type, parent, "type", 1); - sfi_d_level(nhfp, &d_branch->end1, parent, "end1", 1); - sfi_d_level(nhfp, &d_branch->end2, parent, "end2", 1); - sfi_boolean(nhfp, &d_branch->end1_up, parent, "end1_up", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "branch", 1); -} - -void -sfi_bubble(nhfp, d_bubble, myparent, myname, cnt) -NHFILE *nhfp; -struct bubble *d_bubble; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "bubble"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "bubble", 1); - - sfi_xchar(nhfp, &d_bubble->x, parent, "x", 1); - sfi_xchar(nhfp, &d_bubble->y, parent, "y", 1); - sfi_schar(nhfp, &d_bubble->dx, parent, "dx", 1); - sfi_schar(nhfp, &d_bubble->dy, parent, "dy", 1); - sfi_uchar(nhfp, d_bubble->bm, parent, "bm", MAX_BMASK + 2); - sfi_genericptr(nhfp, (genericptr_t) &d_bubble->prev, parent, "prev", 1); - sfi_genericptr(nhfp, (genericptr_t) &d_bubble->next, parent, "next", 1); - sfi_genericptr(nhfp, (genericptr_t) &d_bubble->cons, parent, "cons", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "bubble", 1); -} - -void -sfi_cemetery(nhfp, d_cemetery, myparent, myname, cnt) -NHFILE *nhfp; -struct cemetery *d_cemetery; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "cemetery"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "cemetery", 1); - - sfi_genericptr(nhfp, (genericptr_t) &d_cemetery->next, parent, "next", 1); - sfi_char(nhfp, d_cemetery->who, parent, "who", PL_NSIZ + 4 * (1 + 3) + 1); - sfi_char(nhfp, d_cemetery->how, parent, "how", 100 + 1); - sfi_char(nhfp, d_cemetery->when, parent, "when", 4 + 2 + 2 + 2 + 2 + 2 + 1); - sfi_schar(nhfp, &d_cemetery->frpx, parent, "frpx", 1); - sfi_schar(nhfp, &d_cemetery->frpy, parent, "frpy", 1); - sfi_boolean(nhfp, &d_cemetery->bonesknown, parent, "bonesknown", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "cemetery", 1); -} - -void -sfi_context_info(nhfp, d_context_info, myparent, myname, cnt) -NHFILE *nhfp; -struct context_info *d_context_info; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "context_info"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "context_info", 1); - - sfi_unsigned(nhfp, &d_context_info->ident, parent, "ident", 1); - sfi_unsigned(nhfp, &d_context_info->no_of_wizards, parent, "no_of_wizards", 1); - sfi_unsigned(nhfp, &d_context_info->run, parent, "run", 1); - sfi_unsigned(nhfp, &d_context_info->startingpet_mid, parent, "startingpet_mid", 1); - sfi_int(nhfp, &d_context_info->current_fruit, parent, "current_fruit", 1); - sfi_int(nhfp, &d_context_info->warnlevel, parent, "warnlevel", 1); - sfi_int(nhfp, &d_context_info->rndencode, parent, "rndencode", 1); - sfi_int(nhfp, &d_context_info->mysteryforce, parent, "mysteryforce", 1); - sfi_long(nhfp, &d_context_info->next_attrib_check, parent, "next_attrib_check", 1); - sfi_long(nhfp, &d_context_info->stethoscope_move, parent, "stethoscope_move", 1); - sfi_short(nhfp, &d_context_info->stethoscope_movement, parent, "stethoscope_movement", 1); - sfi_boolean(nhfp, &d_context_info->travel, parent, "travel", 1); - sfi_boolean(nhfp, &d_context_info->travel1, parent, "travel1", 1); - sfi_boolean(nhfp, &d_context_info->forcefight, parent, "forcefight", 1); - sfi_boolean(nhfp, &d_context_info->nopick, parent, "nopick", 1); - sfi_boolean(nhfp, &d_context_info->made_amulet, parent, "made_amulet", 1); - sfi_boolean(nhfp, &d_context_info->mon_moving, parent, "mon_moving", 1); - sfi_boolean(nhfp, &d_context_info->move, parent, "move", 1); - sfi_boolean(nhfp, &d_context_info->mv, parent, "mv", 1); - sfi_boolean(nhfp, &d_context_info->bypasses, parent, "bypasses", 1); - sfi_boolean(nhfp, &d_context_info->botl, parent, "botl", 1); - sfi_boolean(nhfp, &d_context_info->botlx, parent, "botlx", 1); - sfi_boolean(nhfp, &d_context_info->door_opened, parent, "door_opened", 1); - sfi_dig_info(nhfp, &d_context_info->digging, parent, "digging", 1); - sfi_victual_info(nhfp, &d_context_info->victual, parent, "victual", 1); - sfi_tin_info(nhfp, &d_context_info->tin, parent, "tin", 1); - sfi_book_info(nhfp, &d_context_info->spbook, parent, "spbook", 1); - sfi_takeoff_info(nhfp, &d_context_info->takeoff, parent, "takeoff", 1); - sfi_warntype_info(nhfp, &d_context_info->warntype, parent, "warntype", 1); - sfi_polearm_info(nhfp, &d_context_info->polearm, parent, "polearm", 1); - sfi_obj_split(nhfp, &d_context_info->objsplit, parent, "objsplit", 1); - sfi_tribute_info(nhfp, &d_context_info->tribute, parent, "tribute", 1); - sfi_novel_tracking(nhfp, &d_context_info->novel, parent, "novel", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "context_info", 1); -} - -void -sfi_d_flags(nhfp, d_d_flags, myparent, myname, cnt) -NHFILE *nhfp; -struct d_flags *d_d_flags; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "d_flags"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "d_flags", 1); - - bitfield = d_d_flags->town; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "town", 1); - d_d_flags->town = bitfield; - - bitfield = d_d_flags->hellish; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "hellish", 1); - d_d_flags->hellish = bitfield; - - bitfield = d_d_flags->maze_like; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "maze_like", 1); - d_d_flags->maze_like = bitfield; - - bitfield = d_d_flags->rogue_like; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "rogue_like", 1); - d_d_flags->rogue_like = bitfield; - - bitfield = d_d_flags->align; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "align", 3); - d_d_flags->align = bitfield; - - bitfield = d_d_flags->unused; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "unused", 1); - d_d_flags->unused = bitfield; - - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "d_flags", 1); -} - -void -sfi_d_level(nhfp, d_d_level, myparent, myname, cnt) -NHFILE *nhfp; -struct d_level *d_d_level; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "d_level"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "d_level", 1); - - sfi_xchar(nhfp, &d_d_level->dnum, parent, "dnum", 1); - sfi_xchar(nhfp, &d_d_level->dlevel, parent, "dlevel", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "d_level", 1); -} - -void -sfi_damage(nhfp, d_damage, myparent, myname, cnt) -NHFILE *nhfp; -struct damage *d_damage; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "damage"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "damage", 1); - - sfi_genericptr(nhfp, (genericptr_t) &d_damage->next, parent, "next", 1); - sfi_long(nhfp, &d_damage->when, parent, "when", 1); - sfi_long(nhfp, &d_damage->cost, parent, "cost", 1); - sfi_nhcoord(nhfp, &d_damage->place, parent, "place", 1); - sfi_schar(nhfp, &d_damage->typ, parent, "typ", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "damage", 1); -} - -void -sfi_dest_area(nhfp, d_dest_area, myparent, myname, cnt) -NHFILE *nhfp; -struct dest_area *d_dest_area; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "dest_area"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "dest_area", 1); - - sfi_xchar(nhfp, &d_dest_area->lx, parent, "lx", 1); - sfi_xchar(nhfp, &d_dest_area->ly, parent, "ly", 1); - sfi_xchar(nhfp, &d_dest_area->hx, parent, "hx", 1); - sfi_xchar(nhfp, &d_dest_area->hy, parent, "hy", 1); - sfi_xchar(nhfp, &d_dest_area->nlx, parent, "nlx", 1); - sfi_xchar(nhfp, &d_dest_area->nly, parent, "nly", 1); - sfi_xchar(nhfp, &d_dest_area->nhx, parent, "nhx", 1); - sfi_xchar(nhfp, &d_dest_area->nhy, parent, "nhy", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "dest_area", 1); -} - -void -sfi_dgn_topology(nhfp, d_dgn_topology, myparent, myname, cnt) -NHFILE *nhfp; -struct dgn_topology *d_dgn_topology; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "dgn_topology"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "dgn_topology", 1); - - sfi_d_level(nhfp, &d_dgn_topology->d_oracle_level, parent, "d_oracle_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_bigroom_level, parent, "d_bigroom_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_rogue_level, parent, "d_rogue_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_medusa_level, parent, "d_medusa_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_stronghold_level, parent, "d_stronghold_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_valley_level, parent, "d_valley_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_wiz1_level, parent, "d_wiz1_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_wiz2_level, parent, "d_wiz2_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_wiz3_level, parent, "d_wiz3_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_juiblex_level, parent, "d_juiblex_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_orcus_level, parent, "d_orcus_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_baalzebub_level, parent, "d_baalzebub_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_asmodeus_level, parent, "d_asmodeus_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_portal_level, parent, "d_portal_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_sanctum_level, parent, "d_sanctum_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_earth_level, parent, "d_earth_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_water_level, parent, "d_water_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_fire_level, parent, "d_fire_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_air_level, parent, "d_air_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_astral_level, parent, "d_astral_level", 1); - sfi_xchar(nhfp, &d_dgn_topology->d_tower_dnum, parent, "d_tower_dnum", 1); - sfi_xchar(nhfp, &d_dgn_topology->d_sokoban_dnum, parent, "d_sokoban_dnum", 1); - sfi_xchar(nhfp, &d_dgn_topology->d_mines_dnum, parent, "d_mines_dnum", 1); - sfi_xchar(nhfp, &d_dgn_topology->d_quest_dnum, parent, "d_quest_dnum", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_qstart_level, parent, "d_qstart_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_qlocate_level, parent, "d_qlocate_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_nemesis_level, parent, "d_nemesis_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_knox_level, parent, "d_knox_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_mineend_level, parent, "d_mineend_level", 1); - sfi_d_level(nhfp, &d_dgn_topology->d_sokoend_level, parent, "d_sokoend_level", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "dgn_topology", 1); -} - -void -sfi_dig_info(nhfp, d_dig_info, myparent, myname, cnt) -NHFILE *nhfp; -struct dig_info *d_dig_info; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "dig_info"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "dig_info", 1); - - sfi_int(nhfp, &d_dig_info->effort, parent, "effort", 1); - sfi_d_level(nhfp, &d_dig_info->level, parent, "level", 1); - sfi_nhcoord(nhfp, &d_dig_info->pos, parent, "pos", 1); - sfi_long(nhfp, &d_dig_info->lastdigtime, parent, "lastdigtime", 1); - sfi_boolean(nhfp, &d_dig_info->down, parent, "down", 1); - sfi_boolean(nhfp, &d_dig_info->chew, parent, "chew", 1); - sfi_boolean(nhfp, &d_dig_info->warned, parent, "warned", 1); - sfi_boolean(nhfp, &d_dig_info->quiet, parent, "quiet", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "dig_info", 1); -} - -void -sfi_dungeon(nhfp, d_dungeon, myparent, myname, cnt) -NHFILE *nhfp; -struct dungeon *d_dungeon; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "dungeon"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "dungeon", 1); - - sfi_char(nhfp, d_dungeon->dname, parent, "dname", 24); - sfi_char(nhfp, d_dungeon->proto, parent, "proto", 15); - sfi_char(nhfp, &d_dungeon->boneid, parent, "boneid", 1); - sfi_d_flags(nhfp, &d_dungeon->flags, parent, "flags", 1); - sfi_xchar(nhfp, &d_dungeon->entry_lev, parent, "entry_lev", 1); - sfi_xchar(nhfp, &d_dungeon->num_dunlevs, parent, "num_dunlevs", 1); - sfi_xchar(nhfp, &d_dungeon->dunlev_ureached, parent, "dunlev_ureached", 1); - sfi_int(nhfp, &d_dungeon->ledger_start, parent, "ledger_start", 1); - sfi_int(nhfp, &d_dungeon->depth_start, parent, "depth_start", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "dungeon", 1); -} - -void -sfi_edog(nhfp, d_edog, myparent, myname, cnt) -NHFILE *nhfp; -struct edog *d_edog; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "edog"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "edog", 1); - - sfi_long(nhfp, &d_edog->droptime, parent, "droptime", 1); - sfi_unsigned(nhfp, &d_edog->dropdist, parent, "dropdist", 1); - sfi_int(nhfp, &d_edog->apport, parent, "apport", 1); - sfi_long(nhfp, &d_edog->whistletime, parent, "whistletime", 1); - sfi_long(nhfp, &d_edog->hungrytime, parent, "hungrytime", 1); - sfi_nhcoord(nhfp, &d_edog->ogoal, parent, "ogoal", 1); - sfi_int(nhfp, &d_edog->abuse, parent, "abuse", 1); - sfi_int(nhfp, &d_edog->revivals, parent, "revivals", 1); - sfi_int(nhfp, &d_edog->mhpmax_penalty, parent, "mhpmax_penalty", 1); - bitfield = d_edog->killed_by_u; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "killed_by_u", 1); - d_edog->killed_by_u = bitfield; - - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "edog", 1); -} - -void -sfi_egd(nhfp, d_egd, myparent, myname, cnt) -NHFILE *nhfp; -struct egd *d_egd; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "egd"; - int i; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "egd", 1); - - sfi_int(nhfp, &d_egd->fcbeg, parent, "fcbeg", 1); - sfi_int(nhfp, &d_egd->fcend, parent, "fcend", 1); - sfi_int(nhfp, &d_egd->vroom, parent, "vroom", 1); - sfi_xchar(nhfp, &d_egd->gdx, parent, "gdx", 1); - sfi_xchar(nhfp, &d_egd->gdy, parent, "gdy", 1); - sfi_xchar(nhfp, &d_egd->ogx, parent, "ogx", 1); - sfi_xchar(nhfp, &d_egd->ogy, parent, "ogy", 1); - sfi_d_level(nhfp, &d_egd->gdlevel, parent, "gdlevel", 1); - sfi_xchar(nhfp, &d_egd->warncnt, parent, "warncnt", 1); - bitfield = d_egd->gddone; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "gddone", 1); - d_egd->gddone = bitfield; - - bitfield = d_egd->witness; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "witness", 2); - d_egd->witness = bitfield; - - bitfield = d_egd->unused; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "unused", 5); - d_egd->unused = bitfield; - - for (i = 0; i < FCSIZ; ++i) - sfi_fakecorridor(nhfp, &d_egd->fakecorr[i], parent, "fakecorr", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "egd", 1); -} - -void -sfi_emin(nhfp, d_emin, myparent, myname, cnt) -NHFILE *nhfp; -struct emin *d_emin; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "emin"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "emin", 1); - - sfi_aligntyp(nhfp, &d_emin->min_align, parent, "min_align", 1); - sfi_boolean(nhfp, &d_emin->renegade, parent, "renegade", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "emin", 1); -} - -void -sfi_engr(nhfp, d_engr, myparent, myname, cnt) -NHFILE *nhfp; -struct engr *d_engr; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "engr"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "engr", 1); - - sfi_genericptr(nhfp, (genericptr_t) &d_engr->nxt_engr, parent, "nxt_engr", 1); - sfi_genericptr(nhfp, (genericptr_t) &d_engr->engr_txt, parent, "engr_txt", 1); - sfi_xchar(nhfp, &d_engr->engr_x, parent, "engr_x", 1); - sfi_xchar(nhfp, &d_engr->engr_y, parent, "engr_y", 1); - sfi_unsigned(nhfp, &d_engr->engr_lth, parent, "engr_lth", 1); - sfi_long(nhfp, &d_engr->engr_time, parent, "engr_time", 1); - sfi_xchar(nhfp, &d_engr->engr_type, parent, "engr_type", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "engr", 1); -} - -void -sfi_epri(nhfp, d_epri, myparent, myname, cnt) -NHFILE *nhfp; -struct epri *d_epri; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "epri"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "epri", 1); - - sfi_aligntyp(nhfp, &d_epri->shralign, parent, "shralign", 1); - sfi_schar(nhfp, &d_epri->shroom, parent, "shroom", 1); - sfi_nhcoord(nhfp, &d_epri->shrpos, parent, "shrpos", 1); - sfi_d_level(nhfp, &d_epri->shrlevel, parent, "shrlevel", 1); - sfi_long(nhfp, &d_epri->intone_time, parent, "intone_time", 1); - sfi_long(nhfp, &d_epri->enter_time, parent, "enter_time", 1); - sfi_long(nhfp, &d_epri->hostile_time, parent, "hostile_time", 1); - sfi_long(nhfp, &d_epri->peaceful_time, parent, "peaceful_time", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "epri", 1); -} - -void -sfi_eshk(nhfp, d_eshk, myparent, myname, cnt) -NHFILE *nhfp; -struct eshk *d_eshk; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "eshk"; - int i; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "eshk", 1); - - sfi_long(nhfp, &d_eshk->robbed, parent, "robbed", 1); - sfi_long(nhfp, &d_eshk->credit, parent, "credit", 1); - sfi_long(nhfp, &d_eshk->debit, parent, "debit", 1); - sfi_long(nhfp, &d_eshk->loan, parent, "loan", 1); - sfi_int(nhfp, &d_eshk->shoptype, parent, "shoptype", 1); - sfi_schar(nhfp, &d_eshk->shoproom, parent, "shoproom", 1); - sfi_schar(nhfp, &d_eshk->unused, parent, "unused", 1); - sfi_boolean(nhfp, &d_eshk->following, parent, "following", 1); - sfi_boolean(nhfp, &d_eshk->surcharge, parent, "surcharge", 1); - sfi_boolean(nhfp, &d_eshk->dismiss_kops, parent, "dismiss_kops", 1); - sfi_nhcoord(nhfp, &d_eshk->shk, parent, "shk", 1); - sfi_nhcoord(nhfp, &d_eshk->shd, parent, "shd", 1); - sfi_d_level(nhfp, &d_eshk->shoplevel, parent, "shoplevel", 1); - sfi_int(nhfp, &d_eshk->billct, parent, "billct", 1); - for (i = 0; i < BILLSZ; ++i) - sfi_bill_x(nhfp, &d_eshk->bill[i], parent, "bill", 1); - sfi_genericptr(nhfp, (genericptr_t) &d_eshk->bill_p, parent, "bill_p", 1); - sfi_int(nhfp, &d_eshk->visitct, parent, "visitct", 1); - sfi_char(nhfp, d_eshk->customer, parent, "customer", PL_NSIZ); - sfi_char(nhfp, d_eshk->shknam, parent, "shknam", PL_NSIZ); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "eshk", 1); -} - -void -sfi_fakecorridor(nhfp, d_fakecorridor, myparent, myname, cnt) -NHFILE *nhfp; -struct fakecorridor *d_fakecorridor; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "fakecorridor"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "fakecorridor", 1); - - sfi_xchar(nhfp, &d_fakecorridor->fx, parent, "fx", 1); - sfi_xchar(nhfp, &d_fakecorridor->fy, parent, "fy", 1); - sfi_xchar(nhfp, &d_fakecorridor->ftyp, parent, "ftyp", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "fakecorridor", 1); -} - -void -sfi_fe(nhfp, d_fe, myparent, myname, cnt) -NHFILE *nhfp; -struct fe *d_fe; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "fe"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "fe", 1); - - sfi_genericptr(nhfp, (genericptr_t) &d_fe->next, parent, "next", 1); - sfi_long(nhfp, &d_fe->timeout, parent, "timeout", 1); - sfi_ulong(nhfp, &d_fe->tid, parent, "tid", 1); - sfi_short(nhfp, &d_fe->kind, parent, "kind", 1); - sfi_short(nhfp, &d_fe->func_index, parent, "func_index", 1); - sfi_any(nhfp, &d_fe->arg, parent, "arg", 1); - bitfield = d_fe->needs_fixup; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "needs_fixup", 1); - d_fe->needs_fixup = bitfield; - - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "fe", 1); -} - -void -sfi_flag(nhfp, d_flag, myparent, myname, cnt) -NHFILE *nhfp; -struct flag *d_flag; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "flag"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "flag", 1); - - sfi_boolean(nhfp, &d_flag->acoustics, parent, "acoustics", 1); - sfi_boolean(nhfp, &d_flag->autodig, parent, "autodig", 1); - sfi_boolean(nhfp, &d_flag->autoquiver, parent, "autoquiver", 1); - sfi_boolean(nhfp, &d_flag->autoopen, parent, "autoopen", 1); - sfi_boolean(nhfp, &d_flag->beginner, parent, "beginner", 1); - sfi_boolean(nhfp, &d_flag->biff, parent, "biff", 1); - sfi_boolean(nhfp, &d_flag->bones, parent, "bones", 1); - sfi_boolean(nhfp, &d_flag->confirm, parent, "confirm", 1); - sfi_boolean(nhfp, &d_flag->dark_room, parent, "dark_room", 1); - sfi_boolean(nhfp, &d_flag->debug, parent, "debug", 1); - sfi_boolean(nhfp, &d_flag->end_own, parent, "end_own", 1); - sfi_boolean(nhfp, &d_flag->explore, parent, "explore", 1); - sfi_boolean(nhfp, &d_flag->female, parent, "female", 1); - sfi_boolean(nhfp, &d_flag->friday13, parent, "friday13", 1); - sfi_boolean(nhfp, &d_flag->goldX, parent, "goldX", 1); - sfi_boolean(nhfp, &d_flag->help, parent, "help", 1); - sfi_boolean(nhfp, &d_flag->ignintr, parent, "ignintr", 1); - sfi_boolean(nhfp, &d_flag->ins_chkpt, parent, "ins_chkpt", 1); - sfi_boolean(nhfp, &d_flag->invlet_constant, parent, "invlet_constant", 1); - sfi_boolean(nhfp, &d_flag->legacy, parent, "legacy", 1); - sfi_boolean(nhfp, &d_flag->lit_corridor, parent, "lit_corridor", 1); - sfi_boolean(nhfp, &d_flag->nap, parent, "nap", 1); - sfi_boolean(nhfp, &d_flag->null, parent, "null", 1); - sfi_boolean(nhfp, &d_flag->pickup, parent, "pickup", 1); - sfi_boolean(nhfp, &d_flag->pickup_thrown, parent, "pickup_thrown", 1); - sfi_boolean(nhfp, &d_flag->pushweapon, parent, "pushweapon", 1); - sfi_boolean(nhfp, &d_flag->rest_on_space, parent, "rest_on_space", 1); - sfi_boolean(nhfp, &d_flag->safe_dog, parent, "safe_dog", 1); - sfi_boolean(nhfp, &d_flag->showexp, parent, "showexp", 1); - sfi_boolean(nhfp, &d_flag->showscore, parent, "showscore", 1); - sfi_boolean(nhfp, &d_flag->silent, parent, "silent", 1); - sfi_boolean(nhfp, &d_flag->sortpack, parent, "sortpack", 1); - sfi_boolean(nhfp, &d_flag->sparkle, parent, "sparkle", 1); - sfi_boolean(nhfp, &d_flag->standout, parent, "standout", 1); - sfi_boolean(nhfp, &d_flag->time, parent, "time", 1); - sfi_boolean(nhfp, &d_flag->tombstone, parent, "tombstone", 1); - sfi_boolean(nhfp, &d_flag->verbose, parent, "verbose", 1); - sfi_int(nhfp, &d_flag->end_top, parent, "end_top", 1); - sfi_int(nhfp, &d_flag->end_around, parent, "end_around", 1); - sfi_unsigned(nhfp, &d_flag->moonphase, parent, "moonphase", 1); - sfi_ulong(nhfp, &d_flag->suppress_alert, parent, "suppress_alert", 1); - sfi_unsigned(nhfp, &d_flag->paranoia_bits, parent, "paranoia_bits", 1); - sfi_int(nhfp, &d_flag->pickup_burden, parent, "pickup_burden", 1); - sfi_int(nhfp, &d_flag->pile_limit, parent, "pile_limit", 1); - sfi_char(nhfp, &d_flag->sortloot, parent, "sortloot", 1); - sfi_char(nhfp, d_flag->inv_order, parent, "inv_order", MAXOCLASSES); - sfi_char(nhfp, d_flag->pickup_types, parent, "pickup_types", MAXOCLASSES); - sfi_char(nhfp, d_flag->end_disclose, parent, "end_disclose", NUM_DISCLOSURE_OPTIONS + 1); - sfi_char(nhfp, &d_flag->menu_style, parent, "menu_style", 1); - sfi_boolean(nhfp, &d_flag->made_fruit, parent, "made_fruit", 1); - sfi_int(nhfp, &d_flag->initrole, parent, "initrole", 1); - sfi_int(nhfp, &d_flag->initrace, parent, "initrace", 1); - sfi_int(nhfp, &d_flag->initgend, parent, "initgend", 1); - sfi_int(nhfp, &d_flag->initalign, parent, "initalign", 1); - sfi_int(nhfp, &d_flag->randomall, parent, "randomall", 1); - sfi_int(nhfp, &d_flag->pantheon, parent, "pantheon", 1); - sfi_boolean(nhfp, &d_flag->lootabc, parent, "lootabc", 1); - sfi_boolean(nhfp, &d_flag->showrace, parent, "showrace", 1); - sfi_boolean(nhfp, &d_flag->travelcmd, parent, "travelcmd", 1); - sfi_int(nhfp, &d_flag->runmode, parent, "runmode", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "flag", 1); -} - -void -sfi_fruit(nhfp, d_fruit, myparent, myname, cnt) -NHFILE *nhfp; -struct fruit *d_fruit; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "fruit"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "fruit", 1); - - sfi_char(nhfp, d_fruit->fname, parent, "fname", PL_FSIZ); - sfi_int(nhfp, &d_fruit->fid, parent, "fid", 1); - sfi_genericptr(nhfp, (genericptr_t) &d_fruit->nextf, parent, "nextf", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "fruit", 1); -} - -void -sfi_kinfo(nhfp, d_kinfo, myparent, myname, cnt) -NHFILE *nhfp; -struct kinfo *d_kinfo; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "kinfo"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "kinfo", 1); - - sfi_genericptr(nhfp, (genericptr_t) &d_kinfo->next, parent, "next", 1); - sfi_int(nhfp, &d_kinfo->id, parent, "id", 1); - sfi_int(nhfp, &d_kinfo->format, parent, "format", 1); - sfi_char(nhfp, d_kinfo->name, parent, "name", BUFSZ); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "kinfo", 1); -} - -void -sfi_levelflags(nhfp, d_levelflags, myparent, myname, cnt) -NHFILE *nhfp; -struct levelflags *d_levelflags; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "levelflags"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "levelflags", 1); - - sfi_uchar(nhfp, &d_levelflags->nfountains, parent, "nfountains", 1); - sfi_uchar(nhfp, &d_levelflags->nsinks, parent, "nsinks", 1); - bitfield = d_levelflags->has_shop; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "has_shop", 1); - d_levelflags->has_shop = bitfield; - - bitfield = d_levelflags->has_vault; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "has_vault", 1); - d_levelflags->has_vault = bitfield; - - bitfield = d_levelflags->has_zoo; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "has_zoo", 1); - d_levelflags->has_zoo = bitfield; - - bitfield = d_levelflags->has_court; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "has_court", 1); - d_levelflags->has_court = bitfield; - - bitfield = d_levelflags->has_morgue; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "has_morgue", 1); - d_levelflags->has_morgue = bitfield; - - bitfield = d_levelflags->has_beehive; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "has_beehive", 1); - d_levelflags->has_beehive = bitfield; - - bitfield = d_levelflags->has_barracks; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "has_barracks", 1); - d_levelflags->has_barracks = bitfield; - - bitfield = d_levelflags->has_temple; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "has_temple", 1); - d_levelflags->has_temple = bitfield; - - bitfield = d_levelflags->has_swamp; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "has_swamp", 1); - d_levelflags->has_swamp = bitfield; - - bitfield = d_levelflags->noteleport; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "noteleport", 1); - d_levelflags->noteleport = bitfield; - - bitfield = d_levelflags->hardfloor; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "hardfloor", 1); - d_levelflags->hardfloor = bitfield; - - bitfield = d_levelflags->nommap; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "nommap", 1); - d_levelflags->nommap = bitfield; - - bitfield = d_levelflags->hero_memory; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "hero_memory", 1); - d_levelflags->hero_memory = bitfield; - - bitfield = d_levelflags->shortsighted; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "shortsighted", 1); - d_levelflags->shortsighted = bitfield; - - bitfield = d_levelflags->graveyard; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "graveyard", 1); - d_levelflags->graveyard = bitfield; - - bitfield = d_levelflags->sokoban_rules; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "sokoban_rules", 1); - d_levelflags->sokoban_rules = bitfield; - - bitfield = d_levelflags->is_maze_lev; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "is_maze_lev", 1); - d_levelflags->is_maze_lev = bitfield; - - bitfield = d_levelflags->is_cavernous_lev; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "is_cavernous_lev", 1); - d_levelflags->is_cavernous_lev = bitfield; - - bitfield = d_levelflags->arboreal; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "arboreal", 1); - d_levelflags->arboreal = bitfield; - - bitfield = d_levelflags->wizard_bones; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "wizard_bones", 1); - d_levelflags->wizard_bones = bitfield; - - bitfield = d_levelflags->corrmaze; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "corrmaze", 1); - d_levelflags->corrmaze = bitfield; - - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "levelflags", 1); -} - -void -sfi_linfo(nhfp, d_linfo, myparent, myname, cnt) -NHFILE *nhfp; -struct linfo *d_linfo; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "linfo"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "linfo", 1); - - sfi_uchar(nhfp, &d_linfo->flags, parent, "flags", 1); -#ifdef MFLOPPY - sfi_int(nhfp, &d_linfo->where, parent, "where", 1); - sfi_long(nhfp, &d_linfo->time, parent, "time", 1); - sfi_long(nhfp, &d_linfo->size, parent, "size", 1); -#endif /*MFLOPPY*/ - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "linfo", 1); -} - -void -sfi_ls_t(nhfp, d_ls_t, myparent, myname, cnt) -NHFILE *nhfp; -struct ls_t *d_ls_t; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "ls_t"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "ls_t", 1); - - sfi_genericptr(nhfp, (genericptr_t) &d_ls_t->next, parent, "next", 1); - sfi_xchar(nhfp, &d_ls_t->x, parent, "x", 1); - sfi_xchar(nhfp, &d_ls_t->y, parent, "y", 1); - sfi_short(nhfp, &d_ls_t->range, parent, "range", 1); - sfi_short(nhfp, &d_ls_t->flags, parent, "flags", 1); - sfi_short(nhfp, &d_ls_t->type, parent, "type", 1); - sfi_any(nhfp, &d_ls_t->id, parent, "id", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "ls_t", 1); -} - -void -sfi_mapseen_feat(nhfp, d_mapseen_feat, myparent, myname, cnt) -NHFILE *nhfp; -struct mapseen_feat *d_mapseen_feat; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "mapseen_feat"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "mapseen_feat", 1); - - bitfield = d_mapseen_feat->nfount; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "nfount", 2); - d_mapseen_feat->nfount = bitfield; - - bitfield = d_mapseen_feat->nsink; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "nsink", 2); - d_mapseen_feat->nsink = bitfield; - - bitfield = d_mapseen_feat->naltar; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "naltar", 2); - d_mapseen_feat->naltar = bitfield; - - bitfield = d_mapseen_feat->nthrone; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "nthrone", 2); - d_mapseen_feat->nthrone = bitfield; - - bitfield = d_mapseen_feat->ngrave; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "ngrave", 2); - d_mapseen_feat->ngrave = bitfield; - - bitfield = d_mapseen_feat->ntree; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "ntree", 2); - d_mapseen_feat->ntree = bitfield; - - bitfield = d_mapseen_feat->water; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "water", 2); - d_mapseen_feat->water = bitfield; - - bitfield = d_mapseen_feat->lava; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "lava", 2); - d_mapseen_feat->lava = bitfield; - - bitfield = d_mapseen_feat->ice; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "ice", 2); - d_mapseen_feat->ice = bitfield; - - bitfield = d_mapseen_feat->nshop; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "nshop", 2); - d_mapseen_feat->nshop = bitfield; - - bitfield = d_mapseen_feat->ntemple; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "ntemple", 2); - d_mapseen_feat->ntemple = bitfield; - - bitfield = d_mapseen_feat->msalign; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "msalign", 2); - d_mapseen_feat->msalign = bitfield; - - bitfield = d_mapseen_feat->shoptype; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "shoptype", 5); - d_mapseen_feat->shoptype = bitfield; - - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "mapseen_feat", 1); -} - -void -sfi_mapseen_flags(nhfp, d_mapseen_flags, myparent, myname, cnt) -NHFILE *nhfp; -struct mapseen_flags *d_mapseen_flags; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "mapseen_flags"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "mapseen_flags", 1); - - bitfield = d_mapseen_flags->unreachable; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "unreachable", 1); - d_mapseen_flags->unreachable = bitfield; - - bitfield = d_mapseen_flags->forgot; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "forgot", 1); - d_mapseen_flags->forgot = bitfield; - - bitfield = d_mapseen_flags->knownbones; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "knownbones", 1); - d_mapseen_flags->knownbones = bitfield; - - bitfield = d_mapseen_flags->oracle; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "oracle", 1); - d_mapseen_flags->oracle = bitfield; - - bitfield = d_mapseen_flags->sokosolved; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "sokosolved", 1); - d_mapseen_flags->sokosolved = bitfield; - - bitfield = d_mapseen_flags->bigroom; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "bigroom", 1); - d_mapseen_flags->bigroom = bitfield; - - bitfield = d_mapseen_flags->castle; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "castle", 1); - d_mapseen_flags->castle = bitfield; - - bitfield = d_mapseen_flags->castletune; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "castletune", 1); - d_mapseen_flags->castletune = bitfield; - - bitfield = d_mapseen_flags->valley; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "valley", 1); - d_mapseen_flags->valley = bitfield; - - bitfield = d_mapseen_flags->msanctum; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "msanctum", 1); - d_mapseen_flags->msanctum = bitfield; - - bitfield = d_mapseen_flags->ludios; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "ludios", 1); - d_mapseen_flags->ludios = bitfield; - - bitfield = d_mapseen_flags->roguelevel; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "roguelevel", 1); - d_mapseen_flags->roguelevel = bitfield; - - bitfield = d_mapseen_flags->quest_summons; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "quest_summons", 1); - d_mapseen_flags->quest_summons = bitfield; - - bitfield = d_mapseen_flags->questing; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "questing", 1); - d_mapseen_flags->questing = bitfield; - - bitfield = d_mapseen_flags->vibrating_square; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "vibrating_square", 1); - d_mapseen_flags->vibrating_square = bitfield; - - bitfield = d_mapseen_flags->spare1; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "spare1", 1); - d_mapseen_flags->spare1 = bitfield; - - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "mapseen_flags", 1); -} - -void -sfi_mapseen_rooms(nhfp, d_mapseen_rooms, myparent, myname, cnt) -NHFILE *nhfp; -struct mapseen_rooms *d_mapseen_rooms; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "mapseen_rooms"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "mapseen_rooms", 1); - - bitfield = d_mapseen_rooms->seen; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "seen", 1); - d_mapseen_rooms->seen = bitfield; - - bitfield = d_mapseen_rooms->untended; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "untended", 1); - d_mapseen_rooms->untended = bitfield; - - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "mapseen_rooms", 1); -} - -void -sfi_mapseen(nhfp, d_mapseen, myparent, myname, cnt) -NHFILE *nhfp; -struct mapseen *d_mapseen; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "mapseen"; - int i; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "mapseen", 1); - - sfi_genericptr(nhfp, (genericptr_t) &d_mapseen->next, parent, "next", 1); - sfi_branch(nhfp, d_mapseen->br, parent, "br", 1); - sfi_d_level(nhfp, &d_mapseen->lev, parent, "lev", 1); - sfi_mapseen_feat(nhfp, &d_mapseen->feat, parent, "feat", 1); - sfi_mapseen_flags(nhfp, &d_mapseen->flags, parent, "flags", 1); - sfi_char(nhfp, d_mapseen->custom, parent, "custom", 1); - sfi_unsigned(nhfp, &d_mapseen->custom_lth, parent, "custom_lth", 1); - for (i = 0; i < (MAXNROFROOMS + 1) * 2; ++i) - sfi_mapseen_rooms(nhfp, &d_mapseen->msrooms[i], parent, "msrooms", 1); - sfi_genericptr(nhfp, (genericptr_t) &d_mapseen->final_resting_place, parent, "final_resting_place", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "mapseen", 1); -} - -void -sfi_mextra(nhfp, d_mextra, myparent, myname, cnt) -NHFILE *nhfp; -struct mextra *d_mextra; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "mextra"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "mextra", 1); - - sfi_char(nhfp, d_mextra->mname, parent, "mname", 1); - sfi_egd(nhfp, d_mextra->egd, parent, "egd", 1); - sfi_epri(nhfp, d_mextra->epri, parent, "epri", 1); - sfi_eshk(nhfp, d_mextra->eshk, parent, "eshk", 1); - sfi_emin(nhfp, d_mextra->emin, parent, "emin", 1); - sfi_edog(nhfp, d_mextra->edog, parent, "edog", 1); - sfi_int(nhfp, &d_mextra->mcorpsenm, parent, "mcorpsenm", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "mextra", 1); -} - -void -sfi_mkroom(nhfp, d_mkroom, myparent, myname, cnt) -NHFILE *nhfp; -struct mkroom *d_mkroom; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "mkroom"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "mkroom", 1); - - sfi_schar(nhfp, &d_mkroom->lx, parent, "lx", 1); - sfi_schar(nhfp, &d_mkroom->hx, parent, "hx", 1); - sfi_schar(nhfp, &d_mkroom->ly, parent, "ly", 1); - sfi_schar(nhfp, &d_mkroom->hy, parent, "hy", 1); - sfi_schar(nhfp, &d_mkroom->rtype, parent, "rtype", 1); - sfi_schar(nhfp, &d_mkroom->orig_rtype, parent, "orig_rtype", 1); - sfi_schar(nhfp, &d_mkroom->rlit, parent, "rlit", 1); - sfi_schar(nhfp, &d_mkroom->needfill, parent, "needfill", 1); - sfi_schar(nhfp, &d_mkroom->needjoining, parent, "needjoining", 1); - sfi_schar(nhfp, &d_mkroom->doorct, parent, "doorct", 1); - sfi_schar(nhfp, &d_mkroom->fdoor, parent, "fdoor", 1); - sfi_schar(nhfp, &d_mkroom->nsubrooms, parent, "nsubrooms", 1); - sfi_boolean(nhfp, &d_mkroom->irregular, parent, "irregular", 1); - sfi_genericptr(nhfp, (genericptr_t) &d_mkroom->sbrooms[0], parent, "sbrooms", MAX_SUBROOMS); - sfi_genericptr(nhfp, (genericptr_t) &d_mkroom->resident, parent, "resident", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "mkroom", 1); -} - -void -sfi_monst(nhfp, d_monst, myparent, myname, cnt) -NHFILE *nhfp; -struct monst *d_monst; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "monst"; - int i; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "monst", 1); - - sfi_genericptr(nhfp, (genericptr_t) &d_monst->nmon, parent, "nmon", 1); - sfi_genericptr(nhfp, (genericptr_t) &d_monst->data, parent, "data", 1); - sfi_unsigned(nhfp, &d_monst->m_id, parent, "m_id", 1); - sfi_short(nhfp, &d_monst->mnum, parent, "mnum", 1); - sfi_short(nhfp, &d_monst->cham, parent, "cham", 1); - sfi_short(nhfp, &d_monst->movement, parent, "movement", 1); - sfi_uchar(nhfp, &d_monst->m_lev, parent, "m_lev", 1); - sfi_aligntyp(nhfp, &d_monst->malign, parent, "malign", 1); - sfi_xchar(nhfp, &d_monst->mx, parent, "mx", 1); - sfi_xchar(nhfp, &d_monst->my, parent, "my", 1); - sfi_xchar(nhfp, &d_monst->mux, parent, "mux", 1); - sfi_xchar(nhfp, &d_monst->muy, parent, "muy", 1); - for (i = 0; i < MTSZ; ++i) - sfi_nhcoord(nhfp, &d_monst->mtrack[i], parent, "mtrack", 1); - sfi_int(nhfp, &d_monst->mhp, parent, "mhp", 1); - sfi_int(nhfp, &d_monst->mhpmax, parent, "mhpmax", 1); - sfi_unsigned(nhfp, &d_monst->mappearance, parent, "mappearance", 1); - sfi_uchar(nhfp, &d_monst->m_ap_type, parent, "m_ap_type", 1); - sfi_schar(nhfp, &d_monst->mtame, parent, "mtame", 1); - sfi_ushort(nhfp, &d_monst->mextrinsics, parent, "mextrinsics", 1); - sfi_int(nhfp, &d_monst->mspec_used, parent, "mspec_used", 1); - bitfield = d_monst->female; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "female", 1); - d_monst->female = bitfield; - - bitfield = d_monst->minvis; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "minvis", 1); - d_monst->minvis = bitfield; - - bitfield = d_monst->invis_blkd; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "invis_blkd", 1); - d_monst->invis_blkd = bitfield; - - bitfield = d_monst->perminvis; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "perminvis", 1); - d_monst->perminvis = bitfield; - - bitfield = d_monst->mcan; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "mcan", 1); - d_monst->mcan = bitfield; - - bitfield = d_monst->mburied; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "mburied", 1); - d_monst->mburied = bitfield; - - bitfield = d_monst->mundetected; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "mundetected", 1); - d_monst->mundetected = bitfield; - - bitfield = d_monst->mcansee; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "mcansee", 1); - d_monst->mcansee = bitfield; - - bitfield = d_monst->mspeed; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "mspeed", 2); - d_monst->mspeed = bitfield; - - bitfield = d_monst->permspeed; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "permspeed", 2); - d_monst->permspeed = bitfield; - - bitfield = d_monst->mrevived; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "mrevived", 1); - d_monst->mrevived = bitfield; - - bitfield = d_monst->mcloned; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "mcloned", 1); - d_monst->mcloned = bitfield; - - bitfield = d_monst->mavenge; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "mavenge", 1); - d_monst->mavenge = bitfield; - - bitfield = d_monst->mflee; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "mflee", 1); - d_monst->mflee = bitfield; - - bitfield = d_monst->mfleetim; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "mfleetim", 7); - d_monst->mfleetim = bitfield; - - bitfield = d_monst->msleeping; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "msleeping", 1); - d_monst->msleeping = bitfield; - - bitfield = d_monst->mblinded; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "mblinded", 7); - d_monst->mblinded = bitfield; - - bitfield = d_monst->mstun; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "mstun", 1); - d_monst->mstun = bitfield; - - bitfield = d_monst->mfrozen; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "mfrozen", 7); - d_monst->mfrozen = bitfield; - - bitfield = d_monst->mcanmove; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "mcanmove", 1); - d_monst->mcanmove = bitfield; - - bitfield = d_monst->mconf; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "mconf", 1); - d_monst->mconf = bitfield; - - bitfield = d_monst->mpeaceful; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "mpeaceful", 1); - d_monst->mpeaceful = bitfield; - - bitfield = d_monst->mtrapped; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "mtrapped", 1); - d_monst->mtrapped = bitfield; - - bitfield = d_monst->mleashed; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "mleashed", 1); - d_monst->mleashed = bitfield; - - bitfield = d_monst->isshk; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "isshk", 1); - d_monst->isshk = bitfield; - - bitfield = d_monst->isminion; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "isminion", 1); - d_monst->isminion = bitfield; - - bitfield = d_monst->isgd; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "isgd", 1); - d_monst->isgd = bitfield; - - bitfield = d_monst->ispriest; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "ispriest", 1); - d_monst->ispriest = bitfield; - - bitfield = d_monst->iswiz; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "iswiz", 1); - d_monst->iswiz = bitfield; - - bitfield = d_monst->wormno; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "wormno", 5); - d_monst->wormno = bitfield; - - bitfield = d_monst->mtemplit; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "mtemplit", 1); - d_monst->mtemplit = bitfield; - - sfi_ulong(nhfp, &d_monst->mstrategy, parent, "mstrategy", 1); - sfi_long(nhfp, &d_monst->mtrapseen, parent, "mtrapseen", 1); - sfi_long(nhfp, &d_monst->mlstmv, parent, "mlstmv", 1); - sfi_long(nhfp, &d_monst->mstate, parent, "mstate", 1); - sfi_long(nhfp, &d_monst->migflags, parent, "migflags", 1); - sfi_long(nhfp, &d_monst->mspare1, parent, "mspare1", 1); - sfi_genericptr(nhfp, (genericptr_t) &d_monst->minvent, parent, "minvent", 1); - sfi_genericptr(nhfp, (genericptr_t) &d_monst->mw, parent, "mw", 1); - sfi_long(nhfp, &d_monst->misc_worn_check, parent, "misc_worn_check", 1); - sfi_xchar(nhfp, &d_monst->weapon_check, parent, "weapon_check", 1); - sfi_int(nhfp, &d_monst->meating, parent, "meating", 1); - sfi_genericptr(nhfp, (genericptr_t) &d_monst->mextra, parent, "mextra", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "monst", 1); -} - -void -sfi_mvitals(nhfp, d_mvitals, myparent, myname, cnt) -NHFILE *nhfp; -struct mvitals *d_mvitals; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "mvitals"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "mvitals", 1); - - sfi_uchar(nhfp, &d_mvitals->born, parent, "born", 1); - sfi_uchar(nhfp, &d_mvitals->died, parent, "died", 1); - sfi_uchar(nhfp, &d_mvitals->mvflags, parent, "mvflags", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "mvitals", 1); -} - -void -sfi_nhcoord(nhfp, d_nhcoord, myparent, myname, cnt) -NHFILE *nhfp; -struct nhcoord *d_nhcoord; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "nhcoord"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "nhcoord", 1); - - sfi_xchar(nhfp, &d_nhcoord->x, parent, "x", 1); - sfi_xchar(nhfp, &d_nhcoord->y, parent, "y", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "nhcoord", 1); -} - -void -sfi_nhrect(nhfp, d_nhrect, myparent, myname, cnt) -NHFILE *nhfp; -struct nhrect *d_nhrect; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "nhrect"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "nhrect", 1); - - sfi_xchar(nhfp, &d_nhrect->lx, parent, "lx", 1); - sfi_xchar(nhfp, &d_nhrect->ly, parent, "ly", 1); - sfi_xchar(nhfp, &d_nhrect->hx, parent, "hx", 1); - sfi_xchar(nhfp, &d_nhrect->hy, parent, "hy", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "nhrect", 1); -} - -void -sfi_novel_tracking(nhfp, d_novel_tracking, myparent, myname, cnt) -NHFILE *nhfp; -struct novel_tracking *d_novel_tracking; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "novel_tracking"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "novel_tracking", 1); - - sfi_unsigned(nhfp, &d_novel_tracking->id, parent, "id", 1); - sfi_int(nhfp, &d_novel_tracking->count, parent, "count", 1); - sfi_xchar(nhfp, d_novel_tracking->pasg, parent, "pasg", 30); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "novel_tracking", 1); -} - -void -sfi_obj(nhfp, d_obj, myparent, myname, cnt) -NHFILE *nhfp; -struct obj *d_obj; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "obj"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "obj", 1); - - sfi_genericptr(nhfp, (genericptr_t) &d_obj->nobj, parent, "nobj", 1); - sfi_vptrs(nhfp, &d_obj->v, parent, "v", 1); - sfi_genericptr(nhfp, (genericptr_t) &d_obj->cobj, parent, "cobj", 1); - sfi_unsigned(nhfp, &d_obj->o_id, parent, "o_id", 1); - sfi_xchar(nhfp, &d_obj->ox, parent, "ox", 1); - sfi_xchar(nhfp, &d_obj->oy, parent, "oy", 1); - sfi_short(nhfp, &d_obj->otyp, parent, "otyp", 1); - sfi_unsigned(nhfp, &d_obj->owt, parent, "owt", 1); - sfi_long(nhfp, &d_obj->quan, parent, "quan", 1); - sfi_schar(nhfp, &d_obj->spe, parent, "spe", 1); - sfi_char(nhfp, &d_obj->oclass, parent, "oclass", 1); - sfi_char(nhfp, &d_obj->invlet, parent, "invlet", 1); - sfi_char(nhfp, &d_obj->oartifact, parent, "oartifact", 1); - sfi_xchar(nhfp, &d_obj->where, parent, "where", 1); - sfi_xchar(nhfp, &d_obj->timed, parent, "timed", 1); - bitfield = d_obj->cursed; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "cursed", 1); - d_obj->cursed = bitfield; - - bitfield = d_obj->blessed; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "blessed", 1); - d_obj->blessed = bitfield; - - bitfield = d_obj->unpaid; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "unpaid", 1); - d_obj->unpaid = bitfield; - - bitfield = d_obj->no_charge; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "no_charge", 1); - d_obj->no_charge = bitfield; - - bitfield = d_obj->known; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "known", 1); - d_obj->known = bitfield; - - bitfield = d_obj->dknown; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "dknown", 1); - d_obj->dknown = bitfield; - - bitfield = d_obj->bknown; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "bknown", 1); - d_obj->bknown = bitfield; - - bitfield = d_obj->rknown; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "rknown", 1); - d_obj->rknown = bitfield; - - bitfield = d_obj->oeroded; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "oeroded", 2); - d_obj->oeroded = bitfield; - - bitfield = d_obj->oeroded2; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "oeroded2", 2); - d_obj->oeroded2 = bitfield; - - bitfield = d_obj->oerodeproof; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "oerodeproof", 1); - d_obj->oerodeproof = bitfield; - - bitfield = d_obj->olocked; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "olocked", 1); - d_obj->olocked = bitfield; - - bitfield = d_obj->obroken; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "obroken", 1); - d_obj->obroken = bitfield; - - bitfield = d_obj->otrapped; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "otrapped", 1); - d_obj->otrapped = bitfield; - - bitfield = d_obj->recharged; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "recharged", 3); - d_obj->recharged = bitfield; - - bitfield = d_obj->lamplit; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "lamplit", 1); - d_obj->lamplit = bitfield; - - bitfield = d_obj->globby; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "globby", 1); - d_obj->globby = bitfield; - - bitfield = d_obj->greased; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "greased", 1); - d_obj->greased = bitfield; - - bitfield = d_obj->nomerge; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "nomerge", 1); - d_obj->nomerge = bitfield; - - bitfield = d_obj->was_thrown; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "was_thrown", 1); - d_obj->was_thrown = bitfield; - - bitfield = d_obj->in_use; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "in_use", 1); - d_obj->in_use = bitfield; - - bitfield = d_obj->bypass; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "bypass", 1); - d_obj->bypass = bitfield; - - bitfield = d_obj->cknown; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "cknown", 1); - d_obj->cknown = bitfield; - - bitfield = d_obj->lknown; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "lknown", 1); - d_obj->lknown = bitfield; - - sfi_int(nhfp, &d_obj->corpsenm, parent, "corpsenm", 1); - sfi_int(nhfp, &d_obj->usecount, parent, "usecount", 1); - sfi_unsigned(nhfp, &d_obj->oeaten, parent, "oeaten", 1); - sfi_long(nhfp, &d_obj->age, parent, "age", 1); - sfi_long(nhfp, &d_obj->owornmask, parent, "owornmask", 1); - sfi_genericptr(nhfp, (genericptr_t) &d_obj->oextra, parent, "oextra", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "obj", 1); -} - -void -sfi_objclass(nhfp, d_objclass, myparent, myname, cnt) -NHFILE *nhfp; -struct objclass *d_objclass; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "objclass"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "objclass", 1); - - sfi_short(nhfp, &d_objclass->oc_name_idx, parent, "oc_name_idx", 1); - sfi_short(nhfp, &d_objclass->oc_descr_idx, parent, "oc_descr_idx", 1); - sfi_genericptr(nhfp, (genericptr_t) &d_objclass->oc_uname, parent, "oc_uname", 1); - bitfield = d_objclass->oc_name_known; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "oc_name_known", 1); - d_objclass->oc_name_known = bitfield; - - bitfield = d_objclass->oc_merge; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "oc_merge", 1); - d_objclass->oc_merge = bitfield; - - bitfield = d_objclass->oc_uses_known; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "oc_uses_known", 1); - d_objclass->oc_uses_known = bitfield; - - bitfield = d_objclass->oc_pre_discovered; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "oc_pre_discovered", 1); - d_objclass->oc_pre_discovered = bitfield; - - bitfield = d_objclass->oc_magic; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "oc_magic", 1); - d_objclass->oc_magic = bitfield; - - bitfield = d_objclass->oc_charged; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "oc_charged", 1); - d_objclass->oc_charged = bitfield; - - bitfield = d_objclass->oc_unique; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "oc_unique", 1); - d_objclass->oc_unique = bitfield; - - bitfield = d_objclass->oc_nowish; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "oc_nowish", 1); - d_objclass->oc_nowish = bitfield; - - bitfield = d_objclass->oc_big; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "oc_big", 1); - d_objclass->oc_big = bitfield; - - bitfield = d_objclass->oc_tough; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "oc_tough", 1); - d_objclass->oc_tough = bitfield; - - bitfield = d_objclass->oc_dir; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "oc_dir", 2); - d_objclass->oc_dir = bitfield; - - bitfield = d_objclass->oc_material; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "oc_material", 5); - d_objclass->oc_material = bitfield; - - sfi_schar(nhfp, &d_objclass->oc_subtyp, parent, "oc_subtyp", 1); - sfi_uchar(nhfp, &d_objclass->oc_oprop, parent, "oc_oprop", 1); - sfi_char(nhfp, &d_objclass->oc_class, parent, "oc_class", 1); - sfi_schar(nhfp, &d_objclass->oc_delay, parent, "oc_delay", 1); - sfi_uchar(nhfp, &d_objclass->oc_color, parent, "oc_color", 1); - sfi_short(nhfp, &d_objclass->oc_prob, parent, "oc_prob", 1); - sfi_ushort(nhfp, &d_objclass->oc_weight, parent, "oc_weight", 1); - sfi_short(nhfp, &d_objclass->oc_cost, parent, "oc_cost", 1); - sfi_schar(nhfp, &d_objclass->oc_wsdam, parent, "oc_wsdam", 1); - sfi_schar(nhfp, &d_objclass->oc_wldam, parent, "oc_wldam", 1); - sfi_schar(nhfp, &d_objclass->oc_oc1, parent, "oc_oc1", 1); - sfi_schar(nhfp, &d_objclass->oc_oc2, parent, "oc_oc2", 1); - sfi_ushort(nhfp, &d_objclass->oc_nutrition, parent, "oc_nutrition", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "objclass", 1); -} - -void -sfi_obj_split(nhfp, d_obj_split, myparent, myname, cnt) -NHFILE *nhfp; -struct obj_split *d_obj_split; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "obj_split"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "obj_split", 1); - - sfi_unsigned(nhfp, &d_obj_split->parent_oid, parent, "parent_oid", 1); - sfi_unsigned(nhfp, &d_obj_split->child_oid, parent, "child_oid", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "obj_split", 1); -} - -void -sfi_oextra(nhfp, d_oextra, myparent, myname, cnt) -NHFILE *nhfp; -struct oextra *d_oextra; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "oextra"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "oextra", 1); - - sfi_char(nhfp, d_oextra->oname, parent, "oname", 1); - sfi_genericptr(nhfp, (genericptr_t) &d_oextra->omonst, parent, "omonst", 1); - sfi_unsigned(nhfp, d_oextra->omid, parent, "omid", 1); - sfi_long(nhfp, d_oextra->olong, parent, "olong", 1); - sfi_char(nhfp, d_oextra->omailcmd, parent, "omailcmd", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "oextra", 1); -} - -void -sfi_polearm_info(nhfp, d_polearm_info, myparent, myname, cnt) -NHFILE *nhfp; -struct polearm_info *d_polearm_info; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "polearm_info"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "polearm_info", 1); - - sfi_genericptr(nhfp, (genericptr_t) &d_polearm_info->hitmon, parent, "hitmon", 1); - sfi_unsigned(nhfp, &d_polearm_info->m_id, parent, "m_id", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "polearm_info", 1); -} - -void -sfi_prop(nhfp, d_prop, myparent, myname, cnt) -NHFILE *nhfp; -struct prop *d_prop; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "prop"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "prop", 1); - - sfi_long(nhfp, &d_prop->extrinsic, parent, "extrinsic", 1); - sfi_long(nhfp, &d_prop->blocked, parent, "blocked", 1); - sfi_long(nhfp, &d_prop->intrinsic, parent, "intrinsic", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "prop", 1); -} - -void -sfi_q_score(nhfp, d_q_score, myparent, myname, cnt) -NHFILE *nhfp; -struct q_score *d_q_score; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "q_score"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "q_score", 1); - - bitfield = d_q_score->first_start; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "first_start", 1); - d_q_score->first_start = bitfield; - - bitfield = d_q_score->met_leader; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "met_leader", 1); - d_q_score->met_leader = bitfield; - - bitfield = d_q_score->not_ready; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "not_ready", 3); - d_q_score->not_ready = bitfield; - - bitfield = d_q_score->pissed_off; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "pissed_off", 1); - d_q_score->pissed_off = bitfield; - - bitfield = d_q_score->got_quest; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "got_quest", 1); - d_q_score->got_quest = bitfield; - - bitfield = d_q_score->first_locate; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "first_locate", 1); - d_q_score->first_locate = bitfield; - - bitfield = d_q_score->met_intermed; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "met_intermed", 1); - d_q_score->met_intermed = bitfield; - - bitfield = d_q_score->got_final; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "got_final", 1); - d_q_score->got_final = bitfield; - - bitfield = d_q_score->made_goal; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "made_goal", 3); - d_q_score->made_goal = bitfield; - - bitfield = d_q_score->met_nemesis; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "met_nemesis", 1); - d_q_score->met_nemesis = bitfield; - - bitfield = d_q_score->killed_nemesis; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "killed_nemesis", 1); - d_q_score->killed_nemesis = bitfield; - - bitfield = d_q_score->in_battle; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "in_battle", 1); - d_q_score->in_battle = bitfield; - - bitfield = d_q_score->cheater; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "cheater", 1); - d_q_score->cheater = bitfield; - - bitfield = d_q_score->touched_artifact; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "touched_artifact", 1); - d_q_score->touched_artifact = bitfield; - - bitfield = d_q_score->offered_artifact; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "offered_artifact", 1); - d_q_score->offered_artifact = bitfield; - - bitfield = d_q_score->got_thanks; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "got_thanks", 1); - d_q_score->got_thanks = bitfield; - - bitfield = d_q_score->ldrgend; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "ldrgend", 2); - d_q_score->ldrgend = bitfield; - - bitfield = d_q_score->nemgend; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "nemgend", 2); - d_q_score->nemgend = bitfield; - - bitfield = d_q_score->godgend; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "godgend", 2); - d_q_score->godgend = bitfield; - - bitfield = d_q_score->leader_is_dead; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "leader_is_dead", 1); - d_q_score->leader_is_dead = bitfield; - - sfi_unsigned(nhfp, &d_q_score->leader_m_id, parent, "leader_m_id", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "q_score", 1); -} - -void -sfi_rm(nhfp, d_rm, myparent, myname, cnt) -NHFILE *nhfp; -struct rm *d_rm; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "rm"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "rm", 1); - - sfi_int(nhfp, &d_rm->glyph, parent, "glyph", 1); - sfi_schar(nhfp, &d_rm->typ, parent, "typ", 1); - sfi_uchar(nhfp, &d_rm->seenv, parent, "seenv", 1); - bitfield = d_rm->flags; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "flags", 5); - d_rm->flags = bitfield; - - bitfield = d_rm->horizontal; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "horizontal", 1); - d_rm->horizontal = bitfield; - - bitfield = d_rm->lit; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "lit", 1); - d_rm->lit = bitfield; - - bitfield = d_rm->waslit; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "waslit", 1); - d_rm->waslit = bitfield; - - bitfield = d_rm->roomno; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "roomno", 6); - d_rm->roomno = bitfield; - - bitfield = d_rm->edge; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "edge", 1); - d_rm->edge = bitfield; - - bitfield = d_rm->candig; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "candig", 1); - d_rm->candig = bitfield; - - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "rm", 1); -} - -void -sfi_s_level(nhfp, d_s_level, myparent, myname, cnt) -NHFILE *nhfp; -struct s_level *d_s_level; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "s_level"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "s_level", 1); - - sfi_genericptr(nhfp, (genericptr_t) &d_s_level->next, parent, "next", 1); - sfi_d_level(nhfp, &d_s_level->dlevel, parent, "dlevel", 1); - sfi_char(nhfp, d_s_level->proto, parent, "proto", 15); - sfi_char(nhfp, &d_s_level->boneid, parent, "boneid", 1); - sfi_uchar(nhfp, &d_s_level->rndlevs, parent, "rndlevs", 1); - sfi_d_flags(nhfp, &d_s_level->flags, parent, "flags", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "s_level", 1); -} - -void -sfi_savefile_info(nhfp, d_savefile_info, myparent, myname, cnt) -NHFILE *nhfp; -struct savefile_info *d_savefile_info; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "savefile_info"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "savefile_info", 1); - - sfi_ulong(nhfp, &d_savefile_info->sfi1, parent, "sfi1", 1); - sfi_ulong(nhfp, &d_savefile_info->sfi2, parent, "sfi2", 1); - sfi_ulong(nhfp, &d_savefile_info->sfi3, parent, "sfi3", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "savefile_info", 1); -} - -void -sfi_skills(nhfp, d_skills, myparent, myname, cnt) -NHFILE *nhfp; -struct skills *d_skills; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "skills"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "skills", 1); - - sfi_xchar(nhfp, &d_skills->skill, parent, "skill", 1); - sfi_xchar(nhfp, &d_skills->max_skill, parent, "max_skill", 1); - sfi_ushort(nhfp, &d_skills->advance, parent, "advance", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "skills", 1); -} - -void -sfi_spell(nhfp, d_spell, myparent, myname, cnt) -NHFILE *nhfp; -struct spell *d_spell; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "spell"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "spell", 1); - - sfi_short(nhfp, &d_spell->sp_id, parent, "sp_id", 1); - sfi_xchar(nhfp, &d_spell->sp_lev, parent, "sp_lev", 1); - sfi_int(nhfp, &d_spell->sp_know, parent, "sp_know", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "spell", 1); -} - -void -sfi_stairway(nhfp, d_stairway, myparent, myname, cnt) -NHFILE *nhfp; -struct stairway *d_stairway; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "stairway"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "stairway", 1); - - sfi_xchar(nhfp, &d_stairway->sx, parent, "sx", 1); - sfi_xchar(nhfp, &d_stairway->sy, parent, "sy", 1); - sfi_d_level(nhfp, &d_stairway->tolev, parent, "tolev", 1); - sfi_char(nhfp, &d_stairway->up, parent, "up", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "stairway", 1); -} - -void -sfi_takeoff_info(nhfp, d_takeoff_info, myparent, myname, cnt) -NHFILE *nhfp; -struct takeoff_info *d_takeoff_info; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "takeoff_info"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "takeoff_info", 1); - - sfi_long(nhfp, &d_takeoff_info->mask, parent, "mask", 1); - sfi_long(nhfp, &d_takeoff_info->what, parent, "what", 1); - sfi_int(nhfp, &d_takeoff_info->delay, parent, "delay", 1); - sfi_boolean(nhfp, &d_takeoff_info->cancelled_don, parent, "cancelled_don", 1); - sfi_char(nhfp, d_takeoff_info->disrobing, parent, "disrobing", CONTEXTVERBSZ + 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "takeoff_info", 1); -} - -void -sfi_tin_info(nhfp, d_tin_info, myparent, myname, cnt) -NHFILE *nhfp; -struct tin_info *d_tin_info; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "tin_info"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "tin_info", 1); - - sfi_genericptr(nhfp, (genericptr_t) &d_tin_info->tin, parent, "tin", 1); - sfi_unsigned(nhfp, &d_tin_info->o_id, parent, "o_id", 1); - sfi_int(nhfp, &d_tin_info->usedtime, parent, "usedtime", 1); - sfi_int(nhfp, &d_tin_info->reqtime, parent, "reqtime", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "tin_info", 1); -} - -void -sfi_trap(nhfp, d_trap, myparent, myname, cnt) -NHFILE *nhfp; -struct trap *d_trap; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "trap"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "trap", 1); - - sfi_genericptr(nhfp, (genericptr_t) &d_trap->ntrap, parent, "ntrap", 1); - sfi_xchar(nhfp, &d_trap->tx, parent, "tx", 1); - sfi_xchar(nhfp, &d_trap->ty, parent, "ty", 1); - sfi_d_level(nhfp, &d_trap->dst, parent, "dst", 1); - sfi_nhcoord(nhfp, &d_trap->launch, parent, "launch", 1); - bitfield = d_trap->ttyp; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "ttyp", 5); - d_trap->ttyp = bitfield; - - bitfield = d_trap->tseen; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "tseen", 1); - d_trap->tseen = bitfield; - - bitfield = d_trap->once; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "once", 1); - d_trap->once = bitfield; - - bitfield = d_trap->madeby_u; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "madeby_u", 1); - d_trap->madeby_u = bitfield; - - sfi_vlaunchinfo(nhfp, &d_trap->vl, parent, "vl", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "trap", 1); -} - -void -sfi_tribute_info(nhfp, d_tribute_info, myparent, myname, cnt) -NHFILE *nhfp; -struct tribute_info *d_tribute_info; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "tribute_info"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "tribute_info", 1); - - sfi_size_t(nhfp, &d_tribute_info->tributesz, parent, "tributesz", 1); - sfi_boolean(nhfp, &d_tribute_info->enabled, parent, "enabled", 1); - bitfield = d_tribute_info->bookstock; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "bookstock", 1); - d_tribute_info->bookstock = bitfield; - - bitfield = d_tribute_info->Deathnotice; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "Deathnotice", 1); - d_tribute_info->Deathnotice = bitfield; - - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "tribute_info", 1); -} - -void -sfi_u_achieve(nhfp, d_u_achieve, myparent, myname, cnt) -NHFILE *nhfp; -struct u_achieve *d_u_achieve; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "u_achieve"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "u_achieve", 1); - - bitfield = d_u_achieve->amulet; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "amulet", 1); - d_u_achieve->amulet = bitfield; - - bitfield = d_u_achieve->bell; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "bell", 1); - d_u_achieve->bell = bitfield; - - bitfield = d_u_achieve->book; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "book", 1); - d_u_achieve->book = bitfield; - - bitfield = d_u_achieve->menorah; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "menorah", 1); - d_u_achieve->menorah = bitfield; - - bitfield = d_u_achieve->enter_gehennom; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "enter_gehennom", 1); - d_u_achieve->enter_gehennom = bitfield; - - bitfield = d_u_achieve->ascended; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "ascended", 1); - d_u_achieve->ascended = bitfield; - - bitfield = d_u_achieve->mines_luckstone; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "mines_luckstone", 1); - d_u_achieve->mines_luckstone = bitfield; - - bitfield = d_u_achieve->finish_sokoban; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "finish_sokoban", 1); - d_u_achieve->finish_sokoban = bitfield; - - bitfield = d_u_achieve->killed_medusa; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "killed_medusa", 1); - d_u_achieve->killed_medusa = bitfield; - - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "u_achieve", 1); -} - -void -sfi_u_conduct(nhfp, d_u_conduct, myparent, myname, cnt) -NHFILE *nhfp; -struct u_conduct *d_u_conduct; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "u_conduct"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "u_conduct", 1); - - sfi_long(nhfp, &d_u_conduct->unvegetarian, parent, "unvegetarian", 1); - sfi_long(nhfp, &d_u_conduct->unvegan, parent, "unvegan", 1); - sfi_long(nhfp, &d_u_conduct->food, parent, "food", 1); - sfi_long(nhfp, &d_u_conduct->gnostic, parent, "gnostic", 1); - sfi_long(nhfp, &d_u_conduct->weaphit, parent, "weaphit", 1); - sfi_long(nhfp, &d_u_conduct->killer, parent, "killer", 1); - sfi_long(nhfp, &d_u_conduct->literate, parent, "literate", 1); - sfi_long(nhfp, &d_u_conduct->polypiles, parent, "polypiles", 1); - sfi_long(nhfp, &d_u_conduct->polyselfs, parent, "polyselfs", 1); - sfi_long(nhfp, &d_u_conduct->wishes, parent, "wishes", 1); - sfi_long(nhfp, &d_u_conduct->wisharti, parent, "wisharti", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "u_conduct", 1); -} - -void -sfi_u_event(nhfp, d_u_event, myparent, myname, cnt) -NHFILE *nhfp; -struct u_event *d_u_event; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "u_event"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "u_event", 1); - - bitfield = d_u_event->minor_oracle; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "minor_oracle", 1); - d_u_event->minor_oracle = bitfield; - - bitfield = d_u_event->major_oracle; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "major_oracle", 1); - d_u_event->major_oracle = bitfield; - - bitfield = d_u_event->read_tribute; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "read_tribute", 1); - d_u_event->read_tribute = bitfield; - - bitfield = d_u_event->qcalled; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "qcalled", 1); - d_u_event->qcalled = bitfield; - - bitfield = d_u_event->qexpelled; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "qexpelled", 1); - d_u_event->qexpelled = bitfield; - - bitfield = d_u_event->qcompleted; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "qcompleted", 1); - d_u_event->qcompleted = bitfield; - - bitfield = d_u_event->uheard_tune; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "uheard_tune", 2); - d_u_event->uheard_tune = bitfield; - - bitfield = d_u_event->uopened_dbridge; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "uopened_dbridge", 1); - d_u_event->uopened_dbridge = bitfield; - - bitfield = d_u_event->invoked; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "invoked", 1); - d_u_event->invoked = bitfield; - - bitfield = d_u_event->gehennom_entered; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "gehennom_entered", 1); - d_u_event->gehennom_entered = bitfield; - - bitfield = d_u_event->uhand_of_elbereth; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "uhand_of_elbereth", 2); - d_u_event->uhand_of_elbereth = bitfield; - - bitfield = d_u_event->udemigod; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "udemigod", 1); - d_u_event->udemigod = bitfield; - - bitfield = d_u_event->uvibrated; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "uvibrated", 1); - d_u_event->uvibrated = bitfield; - - bitfield = d_u_event->ascended; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "ascended", 1); - d_u_event->ascended = bitfield; - - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "u_event", 1); -} - -void -sfi_u_have(nhfp, d_u_have, myparent, myname, cnt) -NHFILE *nhfp; -struct u_have *d_u_have; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "u_have"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "u_have", 1); - - bitfield = d_u_have->amulet; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "amulet", 1); - d_u_have->amulet = bitfield; - - bitfield = d_u_have->bell; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "bell", 1); - d_u_have->bell = bitfield; - - bitfield = d_u_have->book; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "book", 1); - d_u_have->book = bitfield; - - bitfield = d_u_have->menorah; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "menorah", 1); - d_u_have->menorah = bitfield; - - bitfield = d_u_have->questart; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "questart", 1); - d_u_have->questart = bitfield; - - bitfield = d_u_have->unused; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "unused", 3); - d_u_have->unused = bitfield; - - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "u_have", 1); -} - -void -sfi_u_realtime(nhfp, d_u_realtime, myparent, myname, cnt) -NHFILE *nhfp; -struct u_realtime *d_u_realtime; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "u_realtime"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "u_realtime", 1); - - sfi_long(nhfp, &d_u_realtime->realtime, parent, "realtime", 1); - sfi_time_t(nhfp, &d_u_realtime->start_timing, parent, "start_timing", 1); - sfi_time_t(nhfp, &d_u_realtime->finish_time, parent, "finish_time", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "u_realtime", 1); -} - -void -sfi_u_roleplay(nhfp, d_u_roleplay, myparent, myname, cnt) -NHFILE *nhfp; -struct u_roleplay *d_u_roleplay; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "u_roleplay"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "u_roleplay", 1); - - sfi_boolean(nhfp, &d_u_roleplay->blind, parent, "blind", 1); - sfi_boolean(nhfp, &d_u_roleplay->nudist, parent, "nudist", 1); - sfi_long(nhfp, &d_u_roleplay->numbones, parent, "numbones", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "u_roleplay", 1); -} - -void -sfi_version_info(nhfp, d_version_info, myparent, myname, cnt) -NHFILE *nhfp; -struct version_info *d_version_info; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "version_info"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "version_info", 1); - - sfi_ulong(nhfp, &d_version_info->incarnation, parent, "incarnation", 1); - sfi_ulong(nhfp, &d_version_info->feature_set, parent, "feature_set", 1); - sfi_ulong(nhfp, &d_version_info->entity_count, parent, "entity_count", 1); - sfi_ulong(nhfp, &d_version_info->struct_sizes1, parent, "struct_sizes1", 1); - sfi_ulong(nhfp, &d_version_info->struct_sizes2, parent, "struct_sizes2", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "version_info", 1); -} - -void -sfi_victual_info(nhfp, d_victual_info, myparent, myname, cnt) -NHFILE *nhfp; -struct victual_info *d_victual_info; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "victual_info"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "victual_info", 1); - - sfi_genericptr(nhfp, (genericptr_t) &d_victual_info->piece, parent, "piece", 1); - sfi_unsigned(nhfp, &d_victual_info->o_id, parent, "o_id", 1); - sfi_int(nhfp, &d_victual_info->usedtime, parent, "usedtime", 1); - sfi_int(nhfp, &d_victual_info->reqtime, parent, "reqtime", 1); - sfi_int(nhfp, &d_victual_info->nmod, parent, "nmod", 1); - bitfield = d_victual_info->canchoke; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "canchoke", 1); - d_victual_info->canchoke = bitfield; - - bitfield = d_victual_info->fullwarn; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "fullwarn", 1); - d_victual_info->fullwarn = bitfield; - - bitfield = d_victual_info->eating; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "eating", 1); - d_victual_info->eating = bitfield; - - bitfield = d_victual_info->doreset; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "doreset", 1); - d_victual_info->doreset = bitfield; - - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "victual_info", 1); -} - -void -sfi_vlaunchinfo(nhfp, d_vlaunchinfo, myparent, myname, cnt) -NHFILE *nhfp; -union vlaunchinfo *d_vlaunchinfo; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "vlaunchinfo"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "vlaunchinfo", 1); - - sfi_short(nhfp, &d_vlaunchinfo->v_launch_otyp, parent, "v_launch_otyp", 1); - sfi_nhcoord(nhfp, &d_vlaunchinfo->v_launch2, parent, "v_launch2", 1); - sfi_uchar(nhfp, &d_vlaunchinfo->v_conjoined, parent, "v_conjoined", 1); - sfi_short(nhfp, &d_vlaunchinfo->v_tnote, parent, "v_tnote", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "vlaunchinfo", 1); -} - -void -sfi_vptrs(nhfp, d_vptrs, myparent, myname, cnt) -NHFILE *nhfp; -union vptrs *d_vptrs; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "vptrs"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "vptrs", 1); - - sfi_genericptr(nhfp, (genericptr_t) &d_vptrs->v_nexthere, parent, "v_nexthere", 1); - sfi_genericptr(nhfp, (genericptr_t) &d_vptrs->v_ocontainer, parent, "v_ocontainer", 1); - sfi_genericptr(nhfp, (genericptr_t) &d_vptrs->v_ocarry, parent, "v_ocarry", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "vptrs", 1); -} - -void -sfi_warntype_info(nhfp, d_warntype_info, myparent, myname, cnt) -NHFILE *nhfp; -struct warntype_info *d_warntype_info; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "warntype_info"; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "warntype_info", 1); - - sfi_ulong(nhfp, &d_warntype_info->obj, parent, "obj", 1); - sfi_ulong(nhfp, &d_warntype_info->polyd, parent, "polyd", 1); - sfi_genericptr(nhfp, (genericptr_t) &d_warntype_info->species, parent, "species", 1); - sfi_short(nhfp, &d_warntype_info->speciesidx, parent, "speciesidx", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "warntype_info", 1); -} - -void -sfi_you(nhfp, d_you, myparent, myname, cnt) -NHFILE *nhfp; -struct you *d_you; -const char *myparent; -const char *myname; -int cnt; -{ - const char *parent = "you"; - int i; - - nhUse(myname); - nhUse(cnt); - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "start", "you", 1); - - sfi_xchar(nhfp, &d_you->ux, parent, "ux", 1); - sfi_xchar(nhfp, &d_you->uy, parent, "uy", 1); - sfi_schar(nhfp, &d_you->dx, parent, "dx", 1); - sfi_schar(nhfp, &d_you->dy, parent, "dy", 1); - sfi_schar(nhfp, &d_you->dz, parent, "dz", 1); - sfi_schar(nhfp, &d_you->di, parent, "di", 1); - sfi_xchar(nhfp, &d_you->tx, parent, "tx", 1); - sfi_xchar(nhfp, &d_you->ty, parent, "ty", 1); - sfi_xchar(nhfp, &d_you->ux0, parent, "ux0", 1); - sfi_xchar(nhfp, &d_you->uy0, parent, "uy0", 1); - sfi_d_level(nhfp, &d_you->uz, parent, "uz", 1); - sfi_d_level(nhfp, &d_you->uz0, parent, "uz0", 1); - sfi_d_level(nhfp, &d_you->utolev, parent, "utolev", 1); - sfi_uchar(nhfp, &d_you->utotype, parent, "utotype", 1); - sfi_boolean(nhfp, &d_you->umoved, parent, "umoved", 1); - sfi_int(nhfp, &d_you->last_str_turn, parent, "last_str_turn", 1); - sfi_int(nhfp, &d_you->ulevel, parent, "ulevel", 1); - sfi_int(nhfp, &d_you->ulevelmax, parent, "ulevelmax", 1); - sfi_unsigned(nhfp, &d_you->utrap, parent, "utrap", 1); - sfi_unsigned(nhfp, &d_you->utraptype, parent, "utraptype", 1); - sfi_char(nhfp, d_you->urooms, parent, "urooms", 5); - sfi_char(nhfp, d_you->urooms0, parent, "urooms0", 5); - sfi_char(nhfp, d_you->uentered, parent, "uentered", 5); - sfi_char(nhfp, d_you->ushops, parent, "ushops", 5); - sfi_char(nhfp, d_you->ushops0, parent, "ushops0", 5); - sfi_char(nhfp, d_you->ushops_entered, parent, "ushops_entered", 5); - sfi_char(nhfp, d_you->ushops_left, parent, "ushops_left", 5); - sfi_int(nhfp, &d_you->uhunger, parent, "uhunger", 1); - sfi_unsigned(nhfp, &d_you->uhs, parent, "uhs", 1); - sfi_prop(nhfp, d_you->uprops, parent, "uprops", LAST_PROP + 1); - sfi_unsigned(nhfp, &d_you->umconf, parent, "umconf", 1); - bitfield = d_you->usick_type; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "usick_type", 2); - d_you->usick_type = bitfield; - - sfi_int(nhfp, &d_you->nv_range, parent, "nv_range", 1); - sfi_int(nhfp, &d_you->xray_range, parent, "xray_range", 1); - sfi_int(nhfp, &d_you->bglyph, parent, "bglyph", 1); - sfi_int(nhfp, &d_you->cglyph, parent, "cglyph", 1); - sfi_int(nhfp, &d_you->bc_order, parent, "bc_order", 1); - sfi_int(nhfp, &d_you->bc_felt, parent, "bc_felt", 1); - sfi_int(nhfp, &d_you->umonster, parent, "umonster", 1); - sfi_int(nhfp, &d_you->umonnum, parent, "umonnum", 1); - sfi_int(nhfp, &d_you->mh, parent, "mh", 1); - sfi_int(nhfp, &d_you->mhmax, parent, "mhmax", 1); - sfi_int(nhfp, &d_you->mtimedone, parent, "mtimedone", 1); - sfi_attribs(nhfp, &d_you->macurr, parent, "macurr", 1); - sfi_attribs(nhfp, &d_you->mamax, parent, "mamax", 1); - sfi_int(nhfp, &d_you->ulycn, parent, "ulycn", 1); - sfi_unsigned(nhfp, &d_you->ucreamed, parent, "ucreamed", 1); - sfi_unsigned(nhfp, &d_you->uswldtim, parent, "uswldtim", 1); - bitfield = d_you->uswallow; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "uswallow", 1); - d_you->uswallow = bitfield; - - bitfield = d_you->uinwater; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "uinwater", 1); - d_you->uinwater = bitfield; - - bitfield = d_you->uundetected; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "uundetected", 1); - d_you->uundetected = bitfield; - - bitfield = d_you->mfemale; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "mfemale", 1); - d_you->mfemale = bitfield; - - bitfield = d_you->uinvulnerable; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "uinvulnerable", 1); - d_you->uinvulnerable = bitfield; - - bitfield = d_you->uburied; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "uburied", 1); - d_you->uburied = bitfield; - - bitfield = d_you->uedibility; /* set it to current value for testing */ - sfi_bitfield(nhfp, &bitfield, parent, "uedibility", 1); - d_you->uedibility = bitfield; - - sfi_unsigned(nhfp, &d_you->udg_cnt, parent, "udg_cnt", 1); - sfi_u_achieve(nhfp, &d_you->uachieve, parent, "uachieve", 1); - sfi_u_event(nhfp, &d_you->uevent, parent, "uevent", 1); - sfi_u_have(nhfp, &d_you->uhave, parent, "uhave", 1); - sfi_u_conduct(nhfp, &d_you->uconduct, parent, "uconduct", 1); - sfi_u_roleplay(nhfp, &d_you->uroleplay, parent, "uroleplay", 1); - sfi_attribs(nhfp, &d_you->acurr, parent, "acurr", 1); - sfi_attribs(nhfp, &d_you->aexe, parent, "aexe", 1); - sfi_attribs(nhfp, &d_you->abon, parent, "abon", 1); - sfi_attribs(nhfp, &d_you->amax, parent, "amax", 1); - sfi_attribs(nhfp, &d_you->atemp, parent, "atemp", 1); - sfi_attribs(nhfp, &d_you->atime, parent, "atime", 1); - sfi_align(nhfp, &d_you->ualign, parent, "ualign", 1); - for (i = 0; i < CONVERT; ++i) - sfi_aligntyp(nhfp, &d_you->ualignbase[i], parent, "ualignbase", 1); - sfi_schar(nhfp, &d_you->uluck, parent, "uluck", 1); - sfi_schar(nhfp, &d_you->moreluck, parent, "moreluck", 1); - sfi_schar(nhfp, &d_you->uhitinc, parent, "uhitinc", 1); - sfi_schar(nhfp, &d_you->udaminc, parent, "udaminc", 1); - sfi_schar(nhfp, &d_you->uac, parent, "uac", 1); - sfi_uchar(nhfp, &d_you->uspellprot, parent, "uspellprot", 1); - sfi_uchar(nhfp, &d_you->usptime, parent, "usptime", 1); - sfi_uchar(nhfp, &d_you->uspmtime, parent, "uspmtime", 1); - sfi_int(nhfp, &d_you->uhp, parent, "uhp", 1); - sfi_int(nhfp, &d_you->uhpmax, parent, "uhpmax", 1); - sfi_int(nhfp, &d_you->uen, parent, "uen", 1); - sfi_int(nhfp, &d_you->uenmax, parent, "uenmax", 1); - sfi_xchar(nhfp, d_you->uhpinc, parent, "uhpinc", MAXULEV); - sfi_xchar(nhfp, d_you->ueninc, parent, "ueninc", MAXULEV); - sfi_int(nhfp, &d_you->ugangr, parent, "ugangr", 1); - sfi_int(nhfp, &d_you->ugifts, parent, "ugifts", 1); - sfi_int(nhfp, &d_you->ublessed, parent, "ublessed", 1); - sfi_int(nhfp, &d_you->ublesscnt, parent, "ublesscnt", 1); - sfi_long(nhfp, &d_you->umoney0, parent, "umoney0", 1); - sfi_long(nhfp, &d_you->uspare1, parent, "uspare1", 1); - sfi_long(nhfp, &d_you->uexp, parent, "uexp", 1); - sfi_long(nhfp, &d_you->urexp, parent, "urexp", 1); - sfi_long(nhfp, &d_you->ucleansed, parent, "ucleansed", 1); - sfi_long(nhfp, &d_you->usleep, parent, "usleep", 1); - sfi_int(nhfp, &d_you->uinvault, parent, "uinvault", 1); - sfi_genericptr(nhfp, (genericptr_t) &d_you->ustuck, parent, "ustuck", 1); - sfi_genericptr(nhfp, (genericptr_t) &d_you->usteed, parent, "usteed", 1); - sfi_long(nhfp, &d_you->ugallop, parent, "ugallop", 1); - sfi_int(nhfp, &d_you->urideturns, parent, "urideturns", 1); - sfi_int(nhfp, &d_you->umortality, parent, "umortality", 1); - sfi_int(nhfp, &d_you->ugrave_arise, parent, "ugrave_arise", 1); - sfi_int(nhfp, &d_you->weapon_slots, parent, "weapon_slots", 1); - sfi_int(nhfp, &d_you->skills_advanced, parent, "skills_advanced", 1); - sfi_xchar(nhfp, d_you->skill_record, parent, "skill_record", P_SKILL_LIMIT); - for (i = 0; i < P_NUM_SKILLS; ++i) - sfi_skills(nhfp, &d_you->weapon_skills[i], parent, "weapon_skills", 1); - sfi_boolean(nhfp, &d_you->twoweap, parent, "twoweap", 1); - sfi_short(nhfp, &d_you->mcham, parent, "mcham", 1); - - if (nhfp->addinfo) - sfi_addinfo(nhfp, myparent, "end", "you", 1); -} -struct nhdatatypes_t nhdatatypes[] = { - {NHTYPE_SIMPLE, (char *) "any", sizeof(anything)}, - {NHTYPE_SIMPLE, (char *) "genericptr_t", sizeof(genericptr_t)}, - {NHTYPE_SIMPLE, (char *) "aligntyp", sizeof(aligntyp)}, - {NHTYPE_SIMPLE, (char *) "Bitfield", sizeof(uint8_t)}, - {NHTYPE_SIMPLE, (char *) "boolean", sizeof(boolean)}, - {NHTYPE_SIMPLE, (char *) "char", sizeof(char)}, - {NHTYPE_SIMPLE, (char *) "int", sizeof(int)}, - {NHTYPE_SIMPLE, (char *) "long", sizeof(long)}, - {NHTYPE_SIMPLE, (char *) "schar", sizeof(schar)}, - {NHTYPE_SIMPLE, (char *) "short", sizeof(short)}, - {NHTYPE_SIMPLE, (char *) "size_t", sizeof(size_t)}, - {NHTYPE_SIMPLE, (char *) "string", sizeof(uchar)}, - {NHTYPE_SIMPLE, (char *) "time_t", sizeof(time_t)}, - {NHTYPE_SIMPLE, (char *) "uchar", sizeof(uchar)}, - {NHTYPE_SIMPLE, (char *) "unsigned char", sizeof(unsigned char)}, - {NHTYPE_SIMPLE, (char *) "unsigned int", sizeof(unsigned int)}, - {NHTYPE_SIMPLE, (char *) "unsigned long", sizeof(unsigned long)}, - {NHTYPE_SIMPLE, (char *) "unsigned short", sizeof(unsigned short)}, - {NHTYPE_SIMPLE, (char *) "unsigned", sizeof(unsigned)}, - {NHTYPE_SIMPLE, (char *) "xchar", sizeof(xchar)}, - {NHTYPE_COMPLEX, (char *) "align", sizeof(struct align)}, - {NHTYPE_COMPLEX, (char *) "attribs", sizeof(struct attribs)}, - {NHTYPE_COMPLEX, (char *) "dig_info", sizeof(struct dig_info)}, - {NHTYPE_COMPLEX, (char *) "tin_info", sizeof(struct tin_info)}, - {NHTYPE_COMPLEX, (char *) "book_info", sizeof(struct book_info)}, - {NHTYPE_COMPLEX, (char *) "takeoff_info", sizeof(struct takeoff_info)}, - {NHTYPE_COMPLEX, (char *) "victual_info", sizeof(struct victual_info)}, - {NHTYPE_COMPLEX, (char *) "warntype_info", sizeof(struct warntype_info)}, - {NHTYPE_COMPLEX, (char *) "polearm_info", sizeof(struct polearm_info)}, - {NHTYPE_COMPLEX, (char *) "obj_split", sizeof(struct obj_split)}, - {NHTYPE_COMPLEX, (char *) "tribute_info", sizeof(struct tribute_info)}, - {NHTYPE_COMPLEX, (char *) "novel_tracking", sizeof(struct novel_tracking)}, - {NHTYPE_COMPLEX, (char *) "context_info", sizeof(struct context_info)}, - {NHTYPE_COMPLEX, (char *) "nhcoord", sizeof(struct nhcoord)}, - {NHTYPE_COMPLEX, (char *) "dgn_topology", sizeof(struct dgn_topology)}, - {NHTYPE_COMPLEX, (char *) "kinfo", sizeof(struct kinfo)}, - {NHTYPE_COMPLEX, (char *) "mvitals", sizeof(struct mvitals)}, - {NHTYPE_COMPLEX, (char *) "ls_t", sizeof(struct ls_t)}, - {NHTYPE_COMPLEX, (char *) "bubble", sizeof(struct bubble)}, - {NHTYPE_COMPLEX, (char *) "d_flags", sizeof(struct d_flags)}, - {NHTYPE_COMPLEX, (char *) "d_level", sizeof(struct d_level)}, - {NHTYPE_COMPLEX, (char *) "s_level", sizeof(struct s_level)}, - {NHTYPE_COMPLEX, (char *) "stairway", sizeof(struct stairway)}, - {NHTYPE_COMPLEX, (char *) "dest_area", sizeof(struct dest_area)}, - {NHTYPE_COMPLEX, (char *) "dungeon", sizeof(struct dungeon)}, - {NHTYPE_COMPLEX, (char *) "branch", sizeof(struct branch)}, - {NHTYPE_COMPLEX, (char *) "linfo", sizeof(struct linfo)}, - {NHTYPE_COMPLEX, (char *) "mapseen", sizeof(struct mapseen)}, - {NHTYPE_COMPLEX, (char *) "mapseen_feat", sizeof(struct mapseen_feat)}, - {NHTYPE_COMPLEX, (char *) "mapseen_flags", sizeof(struct mapseen_flags)}, - {NHTYPE_COMPLEX, (char *) "mapseen_rooms", sizeof(struct mapseen_rooms)}, - {NHTYPE_COMPLEX, (char *) "engr", sizeof(struct engr)}, - {NHTYPE_COMPLEX, (char *) "flag", sizeof(struct flag)}, - {NHTYPE_COMPLEX, (char *) "version_info", sizeof(struct version_info)}, - {NHTYPE_COMPLEX, (char *) "savefile_info", sizeof(struct savefile_info)}, - {NHTYPE_COMPLEX, (char *) "fakecorridor", sizeof(struct fakecorridor)}, - {NHTYPE_COMPLEX, (char *) "egd", sizeof(struct egd)}, - {NHTYPE_COMPLEX, (char *) "epri", sizeof(struct epri)}, - {NHTYPE_COMPLEX, (char *) "bill_x", sizeof(struct bill_x)}, - {NHTYPE_COMPLEX, (char *) "eshk", sizeof(struct eshk)}, - {NHTYPE_COMPLEX, (char *) "emin", sizeof(struct emin)}, - {NHTYPE_COMPLEX, (char *) "edog", sizeof(struct edog)}, - {NHTYPE_COMPLEX, (char *) "mextra", sizeof(struct mextra)}, - {NHTYPE_COMPLEX, (char *) "mkroom", sizeof(struct mkroom)}, - {NHTYPE_COMPLEX, (char *) "monst", sizeof(struct monst)}, - {NHTYPE_COMPLEX, (char *) "vptrs", sizeof(union vptrs)}, - {NHTYPE_COMPLEX, (char *) "oextra", sizeof(struct oextra)}, - {NHTYPE_COMPLEX, (char *) "obj", sizeof(struct obj)}, - {NHTYPE_COMPLEX, (char *) "objclass", sizeof(struct objclass)}, - {NHTYPE_COMPLEX, (char *) "fruit", sizeof(struct fruit)}, - {NHTYPE_COMPLEX, (char *) "prop", sizeof(struct prop)}, - {NHTYPE_COMPLEX, (char *) "q_score", sizeof(struct q_score)}, - {NHTYPE_COMPLEX, (char *) "nhrect", sizeof(struct nhrect)}, - {NHTYPE_COMPLEX, (char *) "rm", sizeof(struct rm)}, - {NHTYPE_COMPLEX, (char *) "damage", sizeof(struct damage)}, - {NHTYPE_COMPLEX, (char *) "cemetery", sizeof(struct cemetery)}, - {NHTYPE_COMPLEX, (char *) "levelflags", sizeof(struct levelflags)}, - {NHTYPE_COMPLEX, (char *) "skills", sizeof(struct skills)}, - {NHTYPE_COMPLEX, (char *) "spell", sizeof(struct spell)}, - {NHTYPE_COMPLEX, (char *) "fe", sizeof(struct fe)}, - {NHTYPE_COMPLEX, (char *) "vlaunchinfo", sizeof(union vlaunchinfo)}, - {NHTYPE_COMPLEX, (char *) "trap", sizeof(struct trap)}, - {NHTYPE_COMPLEX, (char *) "u_have", sizeof(struct u_have)}, - {NHTYPE_COMPLEX, (char *) "u_event", sizeof(struct u_event)}, - {NHTYPE_COMPLEX, (char *) "u_achieve", sizeof(struct u_achieve)}, - {NHTYPE_COMPLEX, (char *) "u_realtime", sizeof(struct u_realtime)}, - {NHTYPE_COMPLEX, (char *) "u_conduct", sizeof(struct u_conduct)}, - {NHTYPE_COMPLEX, (char *) "u_roleplay", sizeof(struct u_roleplay)}, - {NHTYPE_COMPLEX, (char *) "you", sizeof(struct you)} -}; - -int nhdatatypes_size() -{ - return SIZE(nhdatatypes); -} - -const char *critical_members[] = { - "struct align:type:aligntyp", - "struct align:record:int", - "struct attribs:a:schar", - "struct bill_x:bo_id:unsigned", - "struct bill_x:useup:boolean", - "struct bill_x:price:long", - "struct bill_x:bquan:long", - "struct book_info:book:struct obj *", - "struct book_info:o_id:unsigned", - "struct book_info:delay:schar", - "struct branch:next:struct branch *", - "struct branch:id:int", - "struct branch:type:int", - "struct branch:end1:d_level", - "struct branch:end2:d_level", - "struct branch:end1_up:boolean", - "struct bubble:x:xchar", - "struct bubble:y:xchar", - "struct bubble:dx:schar", - "struct bubble:dy:schar", - "struct bubble:bm:uchar", - "struct bubble:prev:struct bubble *", - "struct bubble:next:struct bubble *", - "struct bubble:cons:struct container *", - "struct cemetery:next:struct cemetery *", - "struct cemetery:who:char", - "struct cemetery:how:char", - "struct cemetery:when:char", - "struct cemetery:frpx:schar", - "struct cemetery:frpy:schar", - "struct cemetery:bonesknown:boolean", - "struct context_info:ident:unsigned", - "struct context_info:no_of_wizards:unsigned", - "struct context_info:run:unsigned", - "struct context_info:startingpet_mid:unsigned", - "struct context_info:current_fruit:int", - "struct context_info:warnlevel:int", - "struct context_info:rndencode:int", - "struct context_info:mysteryforce:int", - "struct context_info:next_attrib_check:long", - "struct context_info:stethoscope_move:long", - "struct context_info:stethoscope_movement:short", - "struct context_info:travel:boolean", - "struct context_info:travel1:boolean", - "struct context_info:forcefight:boolean", - "struct context_info:nopick:boolean", - "struct context_info:made_amulet:boolean", - "struct context_info:mon_moving:boolean", - "struct context_info:move:boolean", - "struct context_info:mv:boolean", - "struct context_info:bypasses:boolean", - "struct context_info:botl:boolean", - "struct context_info:botlx:boolean", - "struct context_info:door_opened:boolean", - "struct context_info:digging:dig_info", - "struct context_info:victual:victual_info", - "struct context_info:tin:tin_info", - "struct context_info:spbook:book_info", - "struct context_info:takeoff:takeoff_info", - "struct context_info:warntype:warntype_info", - "struct context_info:polearm:polearm_info", - "struct context_info:objsplit:obj_split", - "struct context_info:tribute:tribute_info", - "struct context_info:novel:novel_tracking", - "struct d_flags:town:Bitfield(town, 1)", - "struct d_flags:hellish:Bitfield(hellish, 1)", - "struct d_flags:maze_like:Bitfield(maze_like, 1)", - "struct d_flags:rogue_like:Bitfield(rogue_like, 1)", - "struct d_flags:align:Bitfield(align, 3)", - "struct d_flags:unused:Bitfield(unused, 1)", - "struct d_level:dnum:xchar", - "struct d_level:dlevel:xchar", - "struct damage:next:struct damage *", - "struct damage:when:long", - "struct damage:cost:long", - "struct damage:place:nhcoord", - "struct damage:typ:schar", - "struct dest_area:lx:xchar", - "struct dest_area:ly:xchar", - "struct dest_area:hx:xchar", - "struct dest_area:hy:xchar", - "struct dest_area:nlx:xchar", - "struct dest_area:nly:xchar", - "struct dest_area:nhx:xchar", - "struct dest_area:nhy:xchar", - "struct dgn_topology:d_oracle_level:d_level", - "struct dgn_topology:d_bigroom_level:d_level", - "struct dgn_topology:d_rogue_level:d_level", - "struct dgn_topology:d_medusa_level:d_level", - "struct dgn_topology:d_stronghold_level:d_level", - "struct dgn_topology:d_valley_level:d_level", - "struct dgn_topology:d_wiz1_level:d_level", - "struct dgn_topology:d_wiz2_level:d_level", - "struct dgn_topology:d_wiz3_level:d_level", - "struct dgn_topology:d_juiblex_level:d_level", - "struct dgn_topology:d_orcus_level:d_level", - "struct dgn_topology:d_baalzebub_level:d_level", - "struct dgn_topology:d_asmodeus_level:d_level", - "struct dgn_topology:d_portal_level:d_level", - "struct dgn_topology:d_sanctum_level:d_level", - "struct dgn_topology:d_earth_level:d_level", - "struct dgn_topology:d_water_level:d_level", - "struct dgn_topology:d_fire_level:d_level", - "struct dgn_topology:d_air_level:d_level", - "struct dgn_topology:d_astral_level:d_level", - "struct dgn_topology:d_tower_dnum:xchar", - "struct dgn_topology:d_sokoban_dnum:xchar", - "struct dgn_topology:d_mines_dnum:xchar", - "struct dgn_topology:d_quest_dnum:xchar", - "struct dgn_topology:d_qstart_level:d_level", - "struct dgn_topology:d_qlocate_level:d_level", - "struct dgn_topology:d_nemesis_level:d_level", - "struct dgn_topology:d_knox_level:d_level", - "struct dgn_topology:d_mineend_level:d_level", - "struct dgn_topology:d_sokoend_level:d_level", - "struct dig_info:effort:int", - "struct dig_info:level:d_level", - "struct dig_info:pos:nhcoord", - "struct dig_info:lastdigtime:long", - "struct dig_info:down:boolean", - "struct dig_info:chew:boolean", - "struct dig_info:warned:boolean", - "struct dig_info:quiet:boolean", - "struct dungeon:dname:char", - "struct dungeon:proto:char", - "struct dungeon:boneid:char", - "struct dungeon:flags:d_flags", - "struct dungeon:entry_lev:xchar", - "struct dungeon:num_dunlevs:xchar", - "struct dungeon:dunlev_ureached:xchar", - "struct dungeon:ledger_start:int", - "struct dungeon:depth_start:int", - "struct edog:droptime:long", - "struct edog:dropdist:unsigned", - "struct edog:apport:int", - "struct edog:whistletime:long", - "struct edog:hungrytime:long", - "struct edog:ogoal:nhcoord", - "struct edog:abuse:int", - "struct edog:revivals:int", - "struct edog:mhpmax_penalty:int", - "struct edog:killed_by_u:Bitfield(killed_by_u, 1)", - "struct egd:fcbeg:int", - "struct egd:fcend:int", - "struct egd:vroom:int", - "struct egd:gdx:xchar", - "struct egd:gdy:xchar", - "struct egd:ogx:xchar", - "struct egd:ogy:xchar", - "struct egd:gdlevel:d_level", - "struct egd:warncnt:xchar", - "struct egd:gddone:Bitfield(gddone, 1)", - "struct egd:witness:Bitfield(witness, 2)", - "struct egd:unused:Bitfield(unused, 5)", - "struct egd:fakecorr:fakecorridor", - "struct emin:min_align:aligntyp", - "struct emin:renegade:boolean", - "struct engr:nxt_engr:struct engr *", - "struct engr:engr_txt:char *", - "struct engr:engr_x:xchar", - "struct engr:engr_y:xchar", - "struct engr:engr_lth:unsigned", - "struct engr:engr_time:long", - "struct engr:engr_type:xchar", - "struct epri:shralign:aligntyp", - "struct epri:shroom:schar", - "struct epri:shrpos:nhcoord", - "struct epri:shrlevel:d_level", - "struct epri:intone_time:long", - "struct epri:enter_time:long", - "struct epri:hostile_time:long", - "struct epri:peaceful_time:long", - "struct eshk:robbed:long", - "struct eshk:credit:long", - "struct eshk:debit:long", - "struct eshk:loan:long", - "struct eshk:shoptype:int", - "struct eshk:shoproom:schar", - "struct eshk:unused:schar", - "struct eshk:following:boolean", - "struct eshk:surcharge:boolean", - "struct eshk:dismiss_kops:boolean", - "struct eshk:shk:nhcoord", - "struct eshk:shd:nhcoord", - "struct eshk:shoplevel:d_level", - "struct eshk:billct:int", - "struct eshk:bill:bill_x", - "struct eshk:bill_p:struct bill_x *", - "struct eshk:visitct:int", - "struct eshk:customer:char", - "struct eshk:shknam:char", - "struct fakecorridor:fx:xchar", - "struct fakecorridor:fy:xchar", - "struct fakecorridor:ftyp:xchar", - "struct fe:next:struct fe *", - "struct fe:timeout:long", - "struct fe:tid:unsigned long", - "struct fe:kind:short", - "struct fe:func_index:short", - "struct fe:arg:any", - "struct fe:needs_fixup:Bitfield(needs_fixup, 1)", - "struct flag:acoustics:boolean", - "struct flag:autodig:boolean", - "struct flag:autoquiver:boolean", - "struct flag:autoopen:boolean", - "struct flag:beginner:boolean", - "struct flag:biff:boolean", - "struct flag:bones:boolean", - "struct flag:confirm:boolean", - "struct flag:dark_room:boolean", - "struct flag:debug:boolean", - "struct flag:end_own:boolean", - "struct flag:explore:boolean", - "struct flag:female:boolean", - "struct flag:friday13:boolean", - "struct flag:goldX:boolean", - "struct flag:help:boolean", - "struct flag:ignintr:boolean", - "struct flag:ins_chkpt:boolean", - "struct flag:invlet_constant:boolean", - "struct flag:legacy:boolean", - "struct flag:lit_corridor:boolean", - "struct flag:nap:boolean", - "struct flag:null:boolean", - "struct flag:pickup:boolean", - "struct flag:pickup_thrown:boolean", - "struct flag:pushweapon:boolean", - "struct flag:rest_on_space:boolean", - "struct flag:safe_dog:boolean", - "struct flag:showexp:boolean", - "struct flag:showscore:boolean", - "struct flag:silent:boolean", - "struct flag:sortpack:boolean", - "struct flag:sparkle:boolean", - "struct flag:standout:boolean", - "struct flag:time:boolean", - "struct flag:tombstone:boolean", - "struct flag:verbose:boolean", - "struct flag:end_top:int", - "struct flag:end_around:int", - "struct flag:moonphase:unsigned", - "struct flag:suppress_alert:unsigned long", - "struct flag:paranoia_bits:unsigned", - "struct flag:pickup_burden:int", - "struct flag:pile_limit:int", - "struct flag:sortloot:char", - "struct flag:inv_order:char", - "struct flag:pickup_types:char", - "struct flag:end_disclose:char", - "struct flag:menu_style:char", - "struct flag:made_fruit:boolean", - "struct flag:initrole:int", - "struct flag:initrace:int", - "struct flag:initgend:int", - "struct flag:initalign:int", - "struct flag:randomall:int", - "struct flag:pantheon:int", - "struct flag:lootabc:boolean", - "struct flag:showrace:boolean", - "struct flag:travelcmd:boolean", - "struct flag:runmode:int", - "struct fruit:fname:char", - "struct fruit:fid:int", - "struct fruit:nextf:struct fruit *", - "struct kinfo:next:struct kinfo *", - "struct kinfo:id:int", - "struct kinfo:format:int", - "struct kinfo:name:char", - "struct levelflags:nfountains:uchar", - "struct levelflags:nsinks:uchar", - "struct levelflags:has_shop:Bitfield(has_shop, 1)", - "struct levelflags:has_vault:Bitfield(has_vault, 1)", - "struct levelflags:has_zoo:Bitfield(has_zoo, 1)", - "struct levelflags:has_court:Bitfield(has_court, 1)", - "struct levelflags:has_morgue:Bitfield(has_morgue, 1)", - "struct levelflags:has_beehive:Bitfield(has_beehive, 1)", - "struct levelflags:has_barracks:Bitfield(has_barracks, 1)", - "struct levelflags:has_temple:Bitfield(has_temple, 1)", - "struct levelflags:has_swamp:Bitfield(has_swamp, 1)", - "struct levelflags:noteleport:Bitfield(noteleport, 1)", - "struct levelflags:hardfloor:Bitfield(hardfloor, 1)", - "struct levelflags:nommap:Bitfield(nommap, 1)", - "struct levelflags:hero_memory:Bitfield(hero_memory, 1)", - "struct levelflags:shortsighted:Bitfield(shortsighted, 1)", - "struct levelflags:graveyard:Bitfield(graveyard, 1)", - "struct levelflags:sokoban_rules:Bitfield(sokoban_rules, 1)", - "struct levelflags:is_maze_lev:Bitfield(is_maze_lev, 1)", - "struct levelflags:is_cavernous_lev:Bitfield(is_cavernous_lev, 1)", - "struct levelflags:arboreal:Bitfield(arboreal, 1)", - "struct levelflags:wizard_bones:Bitfield(wizard_bones, 1)", - "struct levelflags:corrmaze:Bitfield(corrmaze, 1)", - "struct linfo:flags:unsigned char", -#ifdef MFLOPPY - "struct linfo:where:int", - "struct linfo:time:long", - "struct linfo:size:long", -#endif /*MFLOPPY*/ - "struct ls_t:next:struct ls_t *", - "struct ls_t:x:xchar", - "struct ls_t:y:xchar", - "struct ls_t:range:short", - "struct ls_t:flags:short", - "struct ls_t:type:short", - "struct ls_t:id:any", - "struct mapseen_feat:nfount:Bitfield(nfount, 2)", - "struct mapseen_feat:nsink:Bitfield(nsink, 2)", - "struct mapseen_feat:naltar:Bitfield(naltar, 2)", - "struct mapseen_feat:nthrone:Bitfield(nthrone, 2)", - "struct mapseen_feat:ngrave:Bitfield(ngrave, 2)", - "struct mapseen_feat:ntree:Bitfield(ntree, 2)", - "struct mapseen_feat:water:Bitfield(water, 2)", - "struct mapseen_feat:lava:Bitfield(lava, 2)", - "struct mapseen_feat:ice:Bitfield(ice, 2)", - "struct mapseen_feat:nshop:Bitfield(nshop, 2)", - "struct mapseen_feat:ntemple:Bitfield(ntemple, 2)", - "struct mapseen_feat:msalign:Bitfield(msalign, 2)", - "struct mapseen_feat:shoptype:Bitfield(shoptype, 5)", - "struct mapseen_flags:unreachable:Bitfield(unreachable, 1)", - "struct mapseen_flags:forgot:Bitfield(forgot, 1)", - "struct mapseen_flags:knownbones:Bitfield(knownbones, 1)", - "struct mapseen_flags:oracle:Bitfield(oracle, 1)", - "struct mapseen_flags:sokosolved:Bitfield(sokosolved, 1)", - "struct mapseen_flags:bigroom:Bitfield(bigroom, 1)", - "struct mapseen_flags:castle:Bitfield(castle, 1)", - "struct mapseen_flags:castletune:Bitfield(castletune, 1)", - "struct mapseen_flags:valley:Bitfield(valley, 1)", - "struct mapseen_flags:msanctum:Bitfield(msanctum, 1)", - "struct mapseen_flags:ludios:Bitfield(ludios, 1)", - "struct mapseen_flags:roguelevel:Bitfield(roguelevel, 1)", - "struct mapseen_flags:quest_summons:Bitfield(quest_summons, 1)", - "struct mapseen_flags:questing:Bitfield(questing, 1)", - "struct mapseen_flags:vibrating_square:Bitfield(vibrating_square, 1)", - "struct mapseen_flags:spare1:Bitfield(spare1, 1)", - "struct mapseen_rooms:seen:Bitfield(seen, 1)", - "struct mapseen_rooms:untended:Bitfield(untended, 1)", - "struct mapseen:next:struct mapseen *", - "struct mapseen:br:branch *", - "struct mapseen:lev:d_level", - "struct mapseen:feat:mapseen_feat", - "struct mapseen:flags:mapseen_flags", - "struct mapseen:custom:char *", - "struct mapseen:custom_lth:unsigned", - "struct mapseen:msrooms:mapseen_rooms", - "struct mapseen:final_resting_place:struct cemetery *", - "struct mextra:mname:char *", - "struct mextra:egd:struct egd *", - "struct mextra:epri:struct epri *", - "struct mextra:eshk:struct eshk *", - "struct mextra:emin:struct emin *", - "struct mextra:edog:struct edog *", - "struct mextra:mcorpsenm:int", - "struct mkroom:lx:schar", - "struct mkroom:hx:schar", - "struct mkroom:ly:schar", - "struct mkroom:hy:schar", - "struct mkroom:rtype:schar", - "struct mkroom:orig_rtype:schar", - "struct mkroom:rlit:schar", - "struct mkroom:needfill:schar", - "struct mkroom:needjoining:schar", - "struct mkroom:doorct:schar", - "struct mkroom:fdoor:schar", - "struct mkroom:nsubrooms:schar", - "struct mkroom:irregular:boolean", - "struct mkroom:sbrooms:struct mkroom *", - "struct mkroom:resident:struct monst *", - "struct monst:nmon:struct monst *", - "struct monst:data:struct permonst *", - "struct monst:m_id:unsigned", - "struct monst:mnum:short", - "struct monst:cham:short", - "struct monst:movement:short", - "struct monst:m_lev:uchar", - "struct monst:malign:aligntyp", - "struct monst:mx:xchar", - "struct monst:my:xchar", - "struct monst:mux:xchar", - "struct monst:muy:xchar", - "struct monst:mtrack:nhcoord", - "struct monst:mhp:int", - "struct monst:mhpmax:int", - "struct monst:mappearance:unsigned", - "struct monst:m_ap_type:uchar", - "struct monst:mtame:schar", - "struct monst:mextrinsics:unsigned short", - "struct monst:mspec_used:int", - "struct monst:female:Bitfield(female, 1)", - "struct monst:minvis:Bitfield(minvis, 1)", - "struct monst:invis_blkd:Bitfield(invis_blkd, 1)", - "struct monst:perminvis:Bitfield(perminvis, 1)", - "struct monst:mcan:Bitfield(mcan, 1)", - "struct monst:mburied:Bitfield(mburied, 1)", - "struct monst:mundetected:Bitfield(mundetected, 1)", - "struct monst:mcansee:Bitfield(mcansee, 1)", - "struct monst:mspeed:Bitfield(mspeed, 2)", - "struct monst:permspeed:Bitfield(permspeed, 2)", - "struct monst:mrevived:Bitfield(mrevived, 1)", - "struct monst:mcloned:Bitfield(mcloned, 1)", - "struct monst:mavenge:Bitfield(mavenge, 1)", - "struct monst:mflee:Bitfield(mflee, 1)", - "struct monst:mfleetim:Bitfield(mfleetim, 7)", - "struct monst:msleeping:Bitfield(msleeping, 1)", - "struct monst:mblinded:Bitfield(mblinded, 7)", - "struct monst:mstun:Bitfield(mstun, 1)", - "struct monst:mfrozen:Bitfield(mfrozen, 7)", - "struct monst:mcanmove:Bitfield(mcanmove, 1)", - "struct monst:mconf:Bitfield(mconf, 1)", - "struct monst:mpeaceful:Bitfield(mpeaceful, 1)", - "struct monst:mtrapped:Bitfield(mtrapped, 1)", - "struct monst:mleashed:Bitfield(mleashed, 1)", - "struct monst:isshk:Bitfield(isshk, 1)", - "struct monst:isminion:Bitfield(isminion, 1)", - "struct monst:isgd:Bitfield(isgd, 1)", - "struct monst:ispriest:Bitfield(ispriest, 1)", - "struct monst:iswiz:Bitfield(iswiz, 1)", - "struct monst:wormno:Bitfield(wormno, 5)", - "struct monst:mtemplit:Bitfield(mtemplit, 1)", - "struct monst:mstrategy:unsigned long", - "struct monst:mtrapseen:long", - "struct monst:mlstmv:long", - "struct monst:mstate:long", - "struct monst:migflags:long", - "struct monst:mspare1:long", - "struct monst:minvent:struct obj *", - "struct monst:mw:struct obj *", - "struct monst:misc_worn_check:long", - "struct monst:weapon_check:xchar", - "struct monst:meating:int", - "struct monst:mextra:struct mextra *", - "struct mvitals:born:uchar", - "struct mvitals:died:uchar", - "struct mvitals:mvflags:uchar", - "struct nhcoord:x:xchar", - "struct nhcoord:y:xchar", - "struct nhrect:lx:xchar", - "struct nhrect:ly:xchar", - "struct nhrect:hx:xchar", - "struct nhrect:hy:xchar", - "struct novel_tracking:id:unsigned", - "struct novel_tracking:count:int", - "struct novel_tracking:pasg:xchar", - "struct obj:nobj:struct obj *", - "struct obj:v:vptrs", - "struct obj:cobj:struct obj *", - "struct obj:o_id:unsigned", - "struct obj:ox:xchar", - "struct obj:oy:xchar", - "struct obj:otyp:short", - "struct obj:owt:unsigned", - "struct obj:quan:long", - "struct obj:spe:schar", - "struct obj:oclass:char", - "struct obj:invlet:char", - "struct obj:oartifact:char", - "struct obj:where:xchar", - "struct obj:timed:xchar", - "struct obj:cursed:Bitfield(cursed, 1)", - "struct obj:blessed:Bitfield(blessed, 1)", - "struct obj:unpaid:Bitfield(unpaid, 1)", - "struct obj:no_charge:Bitfield(no_charge, 1)", - "struct obj:known:Bitfield(known, 1)", - "struct obj:dknown:Bitfield(dknown, 1)", - "struct obj:bknown:Bitfield(bknown, 1)", - "struct obj:rknown:Bitfield(rknown, 1)", - "struct obj:oeroded:Bitfield(oeroded, 2)", - "struct obj:oeroded2:Bitfield(oeroded2, 2)", - "struct obj:oerodeproof:Bitfield(oerodeproof, 1)", - "struct obj:olocked:Bitfield(olocked, 1)", - "struct obj:obroken:Bitfield(obroken, 1)", - "struct obj:otrapped:Bitfield(otrapped, 1)", - "struct obj:recharged:Bitfield(recharged, 3)", - "struct obj:lamplit:Bitfield(lamplit, 1)", - "struct obj:globby:Bitfield(globby, 1)", - "struct obj:greased:Bitfield(greased, 1)", - "struct obj:nomerge:Bitfield(nomerge, 1)", - "struct obj:was_thrown:Bitfield(was_thrown, 1)", - "struct obj:in_use:Bitfield(in_use, 1)", - "struct obj:bypass:Bitfield(bypass, 1)", - "struct obj:cknown:Bitfield(cknown, 1)", - "struct obj:lknown:Bitfield(lknown, 1)", - "struct obj:corpsenm:int", - "struct obj:usecount:int", - "struct obj:oeaten:unsigned", - "struct obj:age:long", - "struct obj:owornmask:long", - "struct obj:oextra:struct oextra *", - "struct objclass:oc_name_idx:short", - "struct objclass:oc_descr_idx:short", - "struct objclass:oc_uname:char *", - "struct objclass:oc_name_known:Bitfield(oc_name_known, 1)", - "struct objclass:oc_merge:Bitfield(oc_merge, 1)", - "struct objclass:oc_uses_known:Bitfield(oc_uses_known, 1)", - "struct objclass:oc_pre_discovered:Bitfield(oc_pre_discovered, 1)", - "struct objclass:oc_magic:Bitfield(oc_magic, 1)", - "struct objclass:oc_charged:Bitfield(oc_charged, 1)", - "struct objclass:oc_unique:Bitfield(oc_unique, 1)", - "struct objclass:oc_nowish:Bitfield(oc_nowish, 1)", - "struct objclass:oc_big:Bitfield(oc_big, 1)", - "struct objclass:oc_tough:Bitfield(oc_tough, 1)", - "struct objclass:oc_dir:Bitfield(oc_dir, 2)", - "struct objclass:oc_material:Bitfield(oc_material, 5)", - "struct objclass:oc_subtyp:schar", - "struct objclass:oc_oprop:uchar", - "struct objclass:oc_class:char", - "struct objclass:oc_delay:schar", - "struct objclass:oc_color:uchar", - "struct objclass:oc_prob:short", - "struct objclass:oc_weight:unsigned short", - "struct objclass:oc_cost:short", - "struct objclass:oc_wsdam:schar", - "struct objclass:oc_wldam:schar", - "struct objclass:oc_oc1:schar", - "struct objclass:oc_oc2:schar", - "struct objclass:oc_nutrition:unsigned short", - "struct obj_split:parent_oid:unsigned", - "struct obj_split:child_oid:unsigned", - "struct oextra:oname:char *", - "struct oextra:omonst:struct monst *", - "struct oextra:omid:unsigned *", - "struct oextra:olong:long *", - "struct oextra:omailcmd:char *", - "struct polearm_info:hitmon:struct monst *", - "struct polearm_info:m_id:unsigned", - "struct prop:extrinsic:long", - "struct prop:blocked:long", - "struct prop:intrinsic:long", - "struct q_score:first_start:Bitfield(first_start, 1)", - "struct q_score:met_leader:Bitfield(met_leader, 1)", - "struct q_score:not_ready:Bitfield(not_ready, 3)", - "struct q_score:pissed_off:Bitfield(pissed_off, 1)", - "struct q_score:got_quest:Bitfield(got_quest, 1)", - "struct q_score:first_locate:Bitfield(first_locate, 1)", - "struct q_score:met_intermed:Bitfield(met_intermed, 1)", - "struct q_score:got_final:Bitfield(got_final, 1)", - "struct q_score:made_goal:Bitfield(made_goal, 3)", - "struct q_score:met_nemesis:Bitfield(met_nemesis, 1)", - "struct q_score:killed_nemesis:Bitfield(killed_nemesis, 1)", - "struct q_score:in_battle:Bitfield(in_battle, 1)", - "struct q_score:cheater:Bitfield(cheater, 1)", - "struct q_score:touched_artifact:Bitfield(touched_artifact, 1)", - "struct q_score:offered_artifact:Bitfield(offered_artifact, 1)", - "struct q_score:got_thanks:Bitfield(got_thanks, 1)", - "struct q_score:ldrgend:Bitfield(ldrgend, 2)", - "struct q_score:nemgend:Bitfield(nemgend, 2)", - "struct q_score:godgend:Bitfield(godgend, 2)", - "struct q_score:leader_is_dead:Bitfield(leader_is_dead, 1)", - "struct q_score:leader_m_id:unsigned", - "struct rm:glyph:int", - "struct rm:typ:schar", - "struct rm:seenv:uchar", - "struct rm:flags:Bitfield(flags, 5)", - "struct rm:horizontal:Bitfield(horizontal, 1)", - "struct rm:lit:Bitfield(lit, 1)", - "struct rm:waslit:Bitfield(waslit, 1)", - "struct rm:roomno:Bitfield(roomno, 6)", - "struct rm:edge:Bitfield(edge, 1)", - "struct rm:candig:Bitfield(candig, 1)", - "struct s_level:next:struct s_level *", - "struct s_level:dlevel:d_level", - "struct s_level:proto:char", - "struct s_level:boneid:char", - "struct s_level:rndlevs:uchar", - "struct s_level:flags:d_flags", - "struct savefile_info:sfi1:unsigned long", - "struct savefile_info:sfi2:unsigned long", - "struct savefile_info:sfi3:unsigned long", - "struct skills:skill:xchar", - "struct skills:max_skill:xchar", - "struct skills:advance:unsigned short", - "struct spell:sp_id:short", - "struct spell:sp_lev:xchar", - "struct spell:sp_know:int", - "struct stairway:sx:xchar", - "struct stairway:sy:xchar", - "struct stairway:tolev:d_level", - "struct stairway:up:char", - "struct takeoff_info:mask:long", - "struct takeoff_info:what:long", - "struct takeoff_info:delay:int", - "struct takeoff_info:cancelled_don:boolean", - "struct takeoff_info:disrobing:char", - "struct tin_info:tin:struct obj *", - "struct tin_info:o_id:unsigned", - "struct tin_info:usedtime:int", - "struct tin_info:reqtime:int", - "struct trap:ntrap:struct trap *", - "struct trap:tx:xchar", - "struct trap:ty:xchar", - "struct trap:dst:d_level", - "struct trap:launch:nhcoord", - "struct trap:ttyp:Bitfield(ttyp, 5)", - "struct trap:tseen:Bitfield(tseen, 1)", - "struct trap:once:Bitfield(once, 1)", - "struct trap:madeby_u:Bitfield(madeby_u, 1)", - "struct trap:vl:vlaunchinfo", - "struct tribute_info:tributesz:size_t", - "struct tribute_info:enabled:boolean", - "struct tribute_info:bookstock:Bitfield(bookstock, 1)", - "struct tribute_info:Deathnotice:Bitfield(Deathnotice,1)", - "struct u_achieve:amulet:Bitfield(amulet, 1)", - "struct u_achieve:bell:Bitfield(bell, 1)", - "struct u_achieve:book:Bitfield(book, 1)", - "struct u_achieve:menorah:Bitfield(menorah, 1)", - "struct u_achieve:enter_gehennom:Bitfield(enter_gehennom,1)", - "struct u_achieve:ascended:Bitfield(ascended, 1)", - "struct u_achieve:mines_luckstone:Bitfield(mines_luckstone, 1)", - "struct u_achieve:finish_sokoban:Bitfield(finish_sokoban, 1)", - "struct u_achieve:killed_medusa:Bitfield(killed_medusa, 1)", - "struct u_conduct:unvegetarian:long", - "struct u_conduct:unvegan:long", - "struct u_conduct:food:long", - "struct u_conduct:gnostic:long", - "struct u_conduct:weaphit:long", - "struct u_conduct:killer:long", - "struct u_conduct:literate:long", - "struct u_conduct:polypiles:long", - "struct u_conduct:polyselfs:long", - "struct u_conduct:wishes:long", - "struct u_conduct:wisharti:long", - "struct u_event:minor_oracle:Bitfield(minor_oracle, 1)", - "struct u_event:major_oracle:Bitfield(major_oracle, 1)", - "struct u_event:read_tribute:Bitfield(read_tribute, 1)", - "struct u_event:qcalled:Bitfield(qcalled, 1)", - "struct u_event:qexpelled:Bitfield(qexpelled, 1)", - "struct u_event:qcompleted:Bitfield(qcompleted, 1)", - "struct u_event:uheard_tune:Bitfield(uheard_tune, 2)", - "struct u_event:uopened_dbridge:Bitfield(uopened_dbridge, 1)", - "struct u_event:invoked:Bitfield(invoked, 1)", - "struct u_event:gehennom_entered:Bitfield(gehennom_entered, 1)", - "struct u_event:uhand_of_elbereth:Bitfield(uhand_of_elbereth, 2)", - "struct u_event:udemigod:Bitfield(udemigod, 1)", - "struct u_event:uvibrated:Bitfield(uvibrated, 1)", - "struct u_event:ascended:Bitfield(ascended, 1)", - "struct u_have:amulet:Bitfield(amulet, 1)", - "struct u_have:bell:Bitfield(bell, 1)", - "struct u_have:book:Bitfield(book, 1)", - "struct u_have:menorah:Bitfield(menorah, 1)", - "struct u_have:questart:Bitfield(questart, 1)", - "struct u_have:unused:Bitfield(unused, 3)", - "struct u_realtime:realtime:long", - "struct u_realtime:start_timing:time_t", - "struct u_realtime:finish_time:time_t", - "struct u_roleplay:blind:boolean", - "struct u_roleplay:nudist:boolean", - "struct u_roleplay:numbones:long", - "struct version_info:incarnation:unsigned long", - "struct version_info:feature_set:unsigned long", - "struct version_info:entity_count:unsigned long", - "struct version_info:struct_sizes1:unsigned long", - "struct version_info:struct_sizes2:unsigned long", - "struct victual_info:piece:struct obj *", - "struct victual_info:o_id:unsigned", - "struct victual_info:usedtime:int", - "struct victual_info:reqtime:int", - "struct victual_info:nmod:int", - "struct victual_info:canchoke:Bitfield(canchoke, 1)", - "struct victual_info:fullwarn:Bitfield(fullwarn, 1)", - "struct victual_info:eating:Bitfield(eating, 1)", - "struct victual_info:doreset:Bitfield(doreset, 1)", - "union vlaunchinfo:v_launch_otyp:short", - "union vlaunchinfo:v_launch2:nhcoord", - "union vlaunchinfo:v_conjoined:uchar", - "union vlaunchinfo:v_tnote:short", - "union vptrs:v_nexthere:struct obj *", - "union vptrs:v_ocontainer:struct obj *", - "union vptrs:v_ocarry:struct monst *", - "struct warntype_info:obj:unsigned long", - "struct warntype_info:polyd:unsigned long", - "struct warntype_info:species:struct permonst *", - "struct warntype_info:speciesidx:short", - "struct you:ux:xchar", - "struct you:uy:xchar", - "struct you:dx:schar", - "struct you:dy:schar", - "struct you:dz:schar", - "struct you:di:schar", - "struct you:tx:xchar", - "struct you:ty:xchar", - "struct you:ux0:xchar", - "struct you:uy0:xchar", - "struct you:uz:d_level", - "struct you:uz0:d_level", - "struct you:utolev:d_level", - "struct you:utotype:uchar", - "struct you:umoved:boolean", - "struct you:last_str_turn:int", - "struct you:ulevel:int", - "struct you:ulevelmax:int", - "struct you:utrap:unsigned", - "struct you:utraptype:unsigned", - "struct you:urooms:char", - "struct you:urooms0:char", - "struct you:uentered:char", - "struct you:ushops:char", - "struct you:ushops0:char", - "struct you:ushops_entered:char", - "struct you:ushops_left:char", - "struct you:uhunger:int", - "struct you:uhs:unsigned", - "struct you:uprops:prop", - "struct you:umconf:unsigned", - "struct you:usick_type:Bitfield(usick_type, 2)", - "struct you:nv_range:int", - "struct you:xray_range:int", - "struct you:bglyph:int", - "struct you:cglyph:int", - "struct you:bc_order:int", - "struct you:bc_felt:int", - "struct you:umonster:int", - "struct you:umonnum:int", - "struct you:mh:int", - "struct you:mhmax:int", - "struct you:mtimedone:int", - "struct you:macurr:attribs", - "struct you:mamax:attribs", - "struct you:ulycn:int", - "struct you:ucreamed:unsigned", - "struct you:uswldtim:unsigned", - "struct you:uswallow:Bitfield(uswallow, 1)", - "struct you:uinwater:Bitfield(uinwater, 1)", - "struct you:uundetected:Bitfield(uundetected, 1)", - "struct you:mfemale:Bitfield(mfemale, 1)", - "struct you:uinvulnerable:Bitfield(uinvulnerable, 1)", - "struct you:uburied:Bitfield(uburied, 1)", - "struct you:uedibility:Bitfield(uedibility, 1)", - "struct you:udg_cnt:unsigned", - "struct you:uachieve:u_achieve", - "struct you:uevent:u_event", - "struct you:uhave:u_have", - "struct you:uconduct:u_conduct", - "struct you:uroleplay:u_roleplay", - "struct you:acurr:attribs", - "struct you:aexe:attribs", - "struct you:abon:attribs", - "struct you:amax:attribs", - "struct you:atemp:attribs", - "struct you:atime:attribs", - "struct you:ualign:align", - "struct you:ualignbase:aligntyp", - "struct you:uluck:schar", - "struct you:moreluck:schar", - "struct you:uhitinc:schar", - "struct you:udaminc:schar", - "struct you:uac:schar", - "struct you:uspellprot:uchar", - "struct you:usptime:uchar", - "struct you:uspmtime:uchar", - "struct you:uhp:int", - "struct you:uhpmax:int", - "struct you:uen:int", - "struct you:uenmax:int", - "struct you:uhpinc:xchar", - "struct you:ueninc:xchar", - "struct you:ugangr:int", - "struct you:ugifts:int", - "struct you:ublessed:int", - "struct you:ublesscnt:int", - "struct you:umoney0:long", - "struct you:uspare1:long", - "struct you:uexp:long", - "struct you:urexp:long", - "struct you:ucleansed:long", - "struct you:usleep:long", - "struct you:uinvault:int", - "struct you:ustuck:struct monst *", - "struct you:usteed:struct monst *", - "struct you:ugallop:long", - "struct you:urideturns:int", - "struct you:umortality:int", - "struct you:ugrave_arise:int", - "struct you:weapon_slots:int", - "struct you:skills_advanced:int", - "struct you:skill_record:xchar", - "struct you:weapon_skills:skills", - "struct you:twoweap:boolean", - "struct you:mcham:short", -}; - -int critical_members_count() -{ - return SIZE(critical_members); -} - -/*sfdata.c*/ diff --git a/src/sflendian.c b/src/sflendian.c deleted file mode 100644 index 3953a371e..000000000 --- a/src/sflendian.c +++ /dev/null @@ -1,1339 +0,0 @@ -/* NetHack 3.7 sflendian.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ -/* Copyright (c) M. Allison, 2019. */ -/* NetHack may be freely redistributed. See license for details. */ - -/* fieldlevel little-endian binary file */ - -#include "hack.h" -#include "integer.h" -#include "sfprocs.h" - -/* -+------------+--------+------+-------+-----------+--------+-----------+ -| Data model | short | int | long | long long | pointer| OS | -+------------+--------+------+-------+-----------+--------+-----------+ -| LLP64 | 16 | 32 | 32 | 64 | 64 | Windows | -+------------+--------+------+-------+-----------+--------+-----------+ -| LP64 | 16 | 32 | 64 | 64 | 64 | Most Unix | -+------------+--------+------+-------+-----------+--------+-----------+ -| ILP64 | 16 | 64 | 64 | 64 | 64 |HAL,SPARC64| -+------------+--------+------+-------+-----------+--------+-----------+ - - We're using this for NetHack's little-endian binary fieldlevel format - because it involves the fewest compromises (sorry SPARC64, - you'll have to use one of the text file formats instead): - - Data model | short | int | long | long long | pointer| OS | - LP64 | 16 | 32 | 64 | 64 | 64 | Most Unix | -*/ - -#if defined(_MSC_VER) -#include -#define bswap16(x) _byteswap_ushort(x) -#define bswap32(x) _byteswap_ulong(x) -#define bswap64(x) _byteswap_uint64(x) -#elif defined(__GNUC__) -#define bswap16(x) __builtin_bswap16(x) -#define bswap32(x) __builtin_bswap32(x) -#define bswap64(x) __builtin_bswap64(x) -#else -/* else use ais523 approach */ -# define bswap16(x) ((((x) & 0x00ffU) << 8) | \ - (((x) & 0xff00U) >> 8)) - -# define bswap32(x) ((((x) & 0x000000ffLU) << 24) | \ - (((x) & 0x0000ff00LU) << 8) | \ - (((x) & 0x00ff0000LU) >> 8) | \ - (((x) & 0xff000000LU) >> 24)) - -# define bswap64(x) ((((x) & 0x00000000000000ffLLU) << 56) | \ - (((x) & 0x000000000000ff00LLU) << 40) | \ - (((x) & 0x0000000000ff0000LLU) << 24) | \ - (((x) & 0x00000000ff000000LLU) << 8) | \ - (((x) & 0x000000ff00000000LLU) << 8) | \ - (((x) & 0x0000ff0000000000LLU) << 24) | \ - (((x) & 0x00ff000000000000LLU) << 40) | \ - (((x) & 0xff00000000000000LLU) << 56)) -#endif - -#ifdef SAVEFILE_DEBUGGING -#if defined(__GNUC__) -#define DEBUGFORMATSTR64 "%s %s %ld %ld %d\n" -#elif defined(_MSC_VER) -#define DEBUGFORMATSTR64 "%s %s %lld %ld %d\n" -#endif -#endif - -struct sf_procs lendian_sfo_procs = { - ".le", - { - lendian_sfo_aligntyp, - lendian_sfo_any, - lendian_sfo_bitfield, - lendian_sfo_boolean, - lendian_sfo_char, - lendian_sfo_genericptr, - lendian_sfo_int, - lendian_sfo_long, - lendian_sfo_schar, - lendian_sfo_short, - lendian_sfo_size_t, - lendian_sfo_time_t, - lendian_sfo_unsigned, - lendian_sfo_uchar, - lendian_sfo_uint, - lendian_sfo_ulong, - lendian_sfo_ushort, - lendian_sfo_xchar, - lendian_sfo_str, - lendian_sfo_addinfo, - } -}; - -struct sf_procs lendian_sfi_procs = -{ - ".le", - { - lendian_sfi_aligntyp, - lendian_sfi_any, - lendian_sfi_bitfield, - lendian_sfi_boolean, - lendian_sfi_char, - lendian_sfi_genericptr, - lendian_sfi_int, - lendian_sfi_long, - lendian_sfi_schar, - lendian_sfi_short, - lendian_sfi_size_t, - lendian_sfi_time_t, - lendian_sfi_unsigned, - lendian_sfi_uchar, - lendian_sfi_uint, - lendian_sfi_ulong, - lendian_sfi_ushort, - lendian_sfi_xchar, - lendian_sfi_str, - lendian_sfi_addinfo, - } -}; - -#ifdef SAVEFILE_DEBUGGING -static long floc = 0L; -#endif - -/* - *---------------------------------------------------------------------------- - * sfo_lendian_ routines - * - * Default output routines. - * - *---------------------------------------------------------------------------- - */ - -void -lendian_sfo_any(nhfp, d_any, myparent, myname, cnt) -NHFILE *nhfp; -union any *d_any; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ -/* const char *parent = "any"; */ - int i; - uint64_t ui64; - int64_t i64; - uint32_t ui32; - int32_t i32; - int8_t i8; - - /* nhUse(parent); */ - for (i = 0; i < cnt; ++i) { - ui64 = (uint64_t) d_any->a_void; - fwrite(&ui64, sizeof ui64, 1, nhfp->fpdef); - i64 = (int64_t) d_any->a_ulong; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %ld %ld %d\n", myname, - "any", - d_any->a_ulong, ftell(nhfp->fpdef), cnt); -#endif - fwrite(&i64, sizeof i64, 1, nhfp->fpdef); - ui32 = (uint32_t) d_any->a_uint; - fwrite(&ui32, sizeof ui32, 1, nhfp->fpdef); - i32 = (int32_t) d_any->a_int; - fwrite(&i32, sizeof i32, 1, nhfp->fpdef); - i8 = (int8_t) d_any->a_char; - fwrite(&i8, sizeof i8, 1, nhfp->fpdef); - d_any++; - } -#if 0 - sfo_genericptr(nhfp, d_any->a_void, parent, "a_void", 1); /* (genericptr_t) */ - sfo_genericptr(nhfp, d_any->a_obj, parent, "a_obj", 1); /* (struct obj *) */ - sfo_genericptr(nhfp, d_any->a_monst, parent, "a_monst", 1); /* (struct monst *) */ - sfo_int(nhfp, &d_any->a_int, parent, "a_int", 1); /* (int) */ - sfo_char(nhfp, &d_any->a_char, parent, "a_char", 1); /* (char) */ - sfo_schar(nhfp, &d_any->a_schar, parent, "a_schar", 1); /* (schar) */ - sfo_uchar(nhfp, &d_any->a_uchar, parent, "a_uchar", 1); /* (uchar) */ - sfo_uint(nhfp, &d_any->a_uint, parent, "a_uint", 1); /* (unsigned int) */ - sfo_long(nhfp, &d_any->a_long, parent, "a_long", 1); /* (long) */ - sfo_ulong(nhfp, &d_any->a_ulong, parent, "a_ulong", 1); /* (unsigned long) */ - sfo_genericptr(nhfp, d_any->a_iptr, parent, "a_iptr", 1); /* (int *) */ - sfo_genericptr(nhfp, d_any->a_lptr, parent, "a_lptr", 1); /* (long *) */ - sfo_genericptr(nhfp, d_any->a_ulptr, parent, "a_ulptr", 1); /* (unsigned long *) */ - sfo_genericptr(nhfp, d_any->a_uptr, parent, "a_uptr", 1); /* (unsigned *) */my - sfo_genericptr(nhfp, d_any->a_string, parent, "a_string", 1); /* (const char *) */ - sfo_ulong(nhfp, &d_any->a_mask32, parent, "a_mask32", 1); /* (unsigned long) */ -#endif -} - -void -lendian_sfo_aligntyp(nhfp, d_aligntyp, myparent, myname, cnt) -NHFILE *nhfp; -aligntyp *d_aligntyp; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ -/* const char *parent = "aligntyp"; */ - int i; - int16_t val; - - /* nhUse(parent); */ - for (i = 0; i < cnt; ++i) { - val = nhfp->bendian ? bswap16(*d_aligntyp) : *d_aligntyp; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %hd %ld %d\n", myname, - "aligntyp", - val, ftell(nhfp->fpdef), cnt); -#endif - fwrite(&val, sizeof val, 1, nhfp->fpdef); - d_aligntyp++; - } -} - -void -lendian_sfo_bitfield(nhfp, d_bitfield, myparent, myname, cnt) -NHFILE *nhfp; -uint8_t *d_bitfield; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt UNUSED; -{ -/* const char *parent = "bitfield"; */ - - /* nhUse(parent); */ - /* for bitfields, cnt is the number of bits, not an array */ -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %d %ld %d\n", myname, - "bitfield", - (int) *d_bitfield, ftell(nhfp->fpdef), cnt); -#endif - fwrite(d_bitfield, sizeof *d_bitfield, 1, nhfp->fpdef); -} - -void -lendian_sfo_boolean(nhfp, d_boolean, myparent, myname, cnt) -NHFILE *nhfp; -boolean *d_boolean; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ -/* const char *parent = "boolean"; */ - int i; - int8_t val; - - /* nhUse(parent); */ - for (i = 0; i < cnt; ++i) { - val = *d_boolean; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %d %ld %d\n", myname, - "boolean", - (int) val, ftell(nhfp->fpdef), cnt); -#endif - fwrite(&val, sizeof val, 1, nhfp->fpdef); - d_boolean++; - } -} - -void -lendian_sfo_char(nhfp, d_char, myparent, myname, cnt) -NHFILE *nhfp; -char *d_char; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; -/* const char *parent = "char"; */ - int8_t val; - - /* nhUse(parent); */ - for (i = 0; i < cnt; ++i) { - val = *d_char; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %d %ld %d\n", myname, - "char", - (int) val, ftell(nhfp->fpdef), cnt); -#endif - fwrite(&val, sizeof val, 1, nhfp->fpdef); - d_char++; - } -} - -void -lendian_sfo_genericptr(nhfp, d_genericptr, myparent, myname, cnt) -NHFILE *nhfp; -genericptr_t *d_genericptr; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - int8_t p; - - /* - * sbrooms is an array of pointers to mkroom. - * That array dimension is MAX_SUBROOMS. - * Even though the pointers themselves won't - * be valid, we need to account for the existence - * of the elements of that array, and whether each - * is zero or non-zero. - * - * We only consume a single byte in the file for that - * and we expand it back to pointer size later when - * we read it back in, again preserving zero or non-zero. - */ - - for (i = 0; i < cnt; ++i) { - p = (*d_genericptr) ? 1 : 0; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %d %ld %d\n", myname, - "genericptr", - (int) p, ftell(nhfp->fpdef), cnt); -#endif - fwrite(&p, sizeof p, 1, nhfp->fpdef); - d_genericptr++; - } -} - -void -lendian_sfo_int(nhfp, d_int, myparent, myname, cnt) -NHFILE *nhfp; -int *d_int; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; -/* const char *parent = "int"; */ - int32_t i32, val; - - /* nhUse(parent); */ - for (i = 0; i < cnt; ++i) { - i32 = (int32_t) *d_int; - val = nhfp->bendian ? bswap32(i32) : i32; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %d %ld %d\n", myname, - "int", - val, ftell(nhfp->fpdef), cnt); -#endif - fwrite(&val, sizeof val, 1, nhfp->fpdef); - d_int++; - } -} - -void -lendian_sfo_long(nhfp, d_long, myparent, myname, cnt) -NHFILE *nhfp; -long *d_long; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; -/* const char *parent = "long"; */ - int64_t i64, val64; - - /* nhUse(parent); */ - for (i = 0; i < cnt; ++i) { - i64 = (int64_t) *d_long; - val64 = nhfp->bendian ? bswap64(i64) : i64; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug, DEBUGFORMATSTR64, myname, - "long", - val64, ftell(nhfp->fpdef), cnt); -#endif - fwrite(&val64, sizeof val64, 1, nhfp->fpdef); - d_long++; - } -} - -void -lendian_sfo_schar(nhfp, d_schar, myparent, myname, cnt) -NHFILE *nhfp; -schar *d_schar; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - int8_t itmp; -/* const char *parent = "schar"; */ - - /* nhUse(parent); */ - for (i = 0; i < cnt; ++i) { - itmp = (int8_t) *d_schar; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %d %ld %d\n", myname, - "schar", - (int) itmp, ftell(nhfp->fpdef), cnt); -#endif - fwrite(&itmp, sizeof itmp, 1, nhfp->fpdef); - d_schar++; - } -} - -void -lendian_sfo_short(nhfp, d_short, myparent, myname, cnt) -NHFILE *nhfp; -short *d_short; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - int16_t itmp; -/* const char *parent = "short"; */ - - /* nhUse(parent); */ - for (i = 0; i < cnt; ++i) { - itmp = (int16_t) *d_short; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %hd %ld %d\n", myname, - "short", - itmp, ftell(nhfp->fpdef), cnt); -#endif - fwrite(&itmp, sizeof itmp, 1, nhfp->fpdef); - d_short++; - } -} - -void -lendian_sfo_size_t(nhfp, d_size_t, myparent, myname, cnt) -NHFILE *nhfp; -size_t *d_size_t; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - uint64_t ui64, val; -/* const char *parent = "size_t"; */ - - /* nhUse(parent); */ - for (i = 0; i < cnt; ++i) { - ui64 = (uint64_t) *d_size_t; - val = nhfp->bendian ? bswap64(ui64) : ui64; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug, DEBUGFORMATSTR64, myname, - "size_t", - val, ftell(nhfp->fpdef), cnt); -#endif - fwrite(&val, sizeof val, 1, nhfp->fpdef); - d_size_t++; - } -} - -void -lendian_sfo_time_t(nhfp, d_time_t, myparent, myname, cnt) -NHFILE *nhfp; -time_t *d_time_t; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt UNUSED; -{ - char buf[BUFSZ]; -/* const char *parent = "time_t"; */ - - /* nhUse(parent); */ - Sprintf(buf, "%s", yyyymmddhhmmss(*d_time_t)); -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %s %ld %d\n", myname, - "time", - buf, ftell(nhfp->fpdef), cnt); -#endif - fwrite(buf, sizeof (char), 15, nhfp->fpdef); -} - -void -lendian_sfo_unsigned(nhfp, d_unsigned, myparent, myname, cnt) -NHFILE *nhfp; -unsigned *d_unsigned; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - lendian_sfo_uint(nhfp, d_unsigned, myparent, myname, cnt); -} - -void -lendian_sfo_uchar(nhfp, d_uchar, myparent, myname, cnt) -NHFILE *nhfp; -unsigned char *d_uchar; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; -/* const char *parent = "uchar"; */ - uint8_t ui8; - - /* nhUse(parent); */ - for (i = 0; i < cnt; ++i) { - ui8 = (uint8_t) *d_uchar; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %u %ld %d\n", myname, - "uchar", - (unsigned int) ui8, ftell(nhfp->fpdef), cnt); -#endif - fwrite(&ui8, sizeof ui8, 1, nhfp->fpdef); - d_uchar++; - } -} - -void -lendian_sfo_uint(nhfp, d_uint, myparent, myname, cnt) -NHFILE *nhfp; -unsigned int *d_uint; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; -/* const char *parent = "uint"; */ - uint32_t ui32, val; - - /* nhUse(parent); */ - for (i = 0; i < cnt; ++i) { - ui32 = (uint32_t) *d_uint; - val = nhfp->bendian ? bswap32(ui32) : ui32; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %u %ld %d\n", myname, - "uint", - val, ftell(nhfp->fpdef), cnt); -#endif - fwrite(&val, sizeof val, 1, nhfp->fpdef); - d_uint++; - } -} - -void -lendian_sfo_ulong(nhfp, d_ulong, myparent, myname, cnt) -NHFILE *nhfp; -unsigned long *d_ulong; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; -/* const char *parent = "ulong"; */ - uint64_t ul64, val64; - - /* nhUse(parent); */ - for (i = 0; i < cnt; ++i) { - ul64 = (uint64_t) *d_ulong; - val64 = nhfp->bendian ? bswap64(ul64) : ul64; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug, DEBUGFORMATSTR64, myname, - "ulong", - val64, ftell(nhfp->fpdef), cnt); -#endif - fwrite(&val64, sizeof val64, 1, nhfp->fpdef); - d_ulong++; - } -} - -void -lendian_sfo_ushort(nhfp, d_ushort, myparent, myname, cnt) -NHFILE *nhfp; -unsigned short *d_ushort; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; -/* const char *parent = "ushort"; */ - uint16_t ui16, val16; - - /* nhUse(parent); */ - for (i = 0; i < cnt; ++i) { - ui16 = (uint16_t) *d_ushort; - val16 = nhfp->bendian ? bswap16(ui16) : ui16; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %hd %ld %d\n", myname, - "ushort", - val16, ftell(nhfp->fpdef), cnt); -#endif - fwrite(&val16, sizeof val16, 1, nhfp->fpdef); - d_ushort++; - } -} - -void -lendian_sfo_xchar(nhfp, d_xchar, myparent, myname, cnt) -NHFILE *nhfp; -xchar *d_xchar; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; -/* const char *parent = "xchar"; */ - int16_t i16, val16; - - /* nhUse(parent); */ - for (i = 0; i < cnt; ++i) { - i16 = (int16_t) *d_xchar; - val16 = nhfp->bendian ? bswap16(i16) : i16; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %hd %ld %d\n", myname, - "xchar", - val16, ftell(nhfp->fpdef), cnt); -#endif - fwrite(&val16, sizeof val16, 1, nhfp->fpdef); - d_xchar++; - } -} - -static char strbuf[BUFSZ * 4]; - -void -lendian_sfo_str(nhfp, d_str, myparent, myname, cnt) -NHFILE *nhfp; -char *d_str; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i, j, intval; - int16_t i16, outcount = 0; -/* const char *parent = "str"; */ - char sval[QBUFSZ], *src = d_str, *dest = strbuf; - - /* nhUse(parent); */ - /* cnt is the number of characters */ - for (i = 0; i < cnt; ++i) { - if ((*src < 32) || (*src == '\\') || (*src > 127)) { - *dest++ = '\\'; - outcount++; - intval = (int) *src++; - Sprintf(sval, "%03d", intval); - for (j = 0; j < 3; ++j) { - *dest++ = sval[j]; - outcount++; - } - } else { - *dest++ = *src++; - outcount++; - } - } - *dest = '\0'; - i16 = nhfp->bendian ? bswap16(outcount) : outcount; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %hd %ld %d\n", myname, - "str-count", - i16, ftell(nhfp->fpdef), cnt); -#endif - fwrite(&i16, sizeof i16, 1, nhfp->fpdef); -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %s %ld %d\n", myname, - "str", - strbuf, ftell(nhfp->fpdef), cnt); -#endif - fwrite(strbuf, sizeof (char), outcount, nhfp->fpdef); -} - -void -lendian_sfo_addinfo(nhfp, parent, action, myname, indx) -NHFILE *nhfp UNUSED; -const char *parent UNUSED, *action UNUSED, *myname UNUSED; -int indx UNUSED; -{ - /* ignored */ -} - - -/* - *---------------------------------------------------------------------------- - * lendian_sfi_ routines called from functions in sfi_base.c - *---------------------------------------------------------------------------- - */ - -void -lendian_sfi_any(nhfp, d_any, myparent, myname, cnt) -NHFILE *nhfp; -union any *d_any; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ -/* const char *parent = "any"; */ - int i; - uint64_t ui64; - int64_t i64; - uint32_t ui32; - int32_t i32; - int8_t i8; - - /* nhUse(parent); */ - for (i = 0; i < cnt; ++i) { - fread(&ui64, sizeof ui64, 1, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } -#ifdef SAVEFILE_DEBUGGING - floc = ftell(nhfp->fpdef); -#endif - fread(&i64, sizeof i64, 1, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug, DEBUGFORMATSTR64, myname, - "any", - ui64, floc, cnt); -#endif - fread(&ui32, sizeof ui32, 1, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } - fread(&i32, sizeof i32, 1, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } - fread(&i8, sizeof i8, 1, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } - d_any->a_void = (genericptr_t) ui64; - d_any->a_ulong = (unsigned long) i64; - d_any->a_uint = (unsigned int) ui32; - d_any->a_int = (int) i32; - d_any->a_char = (char) i8; - d_any++; - } -#if 0 - sfi_genericptr(nhfp, d_any->a_void, parent, "a_void", 1); - sfi_genericptr(nhfp, d_any->a_obj, parent, "a_obj", 1); - sfi_genericptr(nhfp, d_any->a_monst, parent, "a_monst", 1); - sfi_int(nhfp, &d_any->a_int, parent, "a_int", 1); - sfi_char(nhfp, &d_any->a_char, parent, "a_char", 1); - sfi_schar(nhfp, &d_any->a_schar, parent, "a_schar", 1); - sfi_uchar(nhfp, &d_any->a_uchar, parent, "a_uchar", 1); - sfi_uint(nhfp, &d_any->a_uint, parent, "a_uint", 1); - sfi_long(nhfp, &d_any->a_long, parent, "a_long", 1); - sfi_ulong(nhfp, &d_any->a_ulong, parent, "a_ulong", 1); - sfi_genericptr(nhfp, d_any->a_iptr, parent, "a_iptr", 1); - sfi_genericptr(nhfp, d_any->a_lptr, parent, "a_lptr", 1); - sfi_genericptr(nhfp, d_any->a_ulptr, parent, "a_ulptr", 1); - sfi_genericptr(nhfp, d_any->a_uptr, parent, "a_uptr", 1); - sfi_genericptr(nhfp, d_any->a_string, parent, "a_string", 1); - sfi_ulong(nhfp, &d_any->a_mask32, parent, "a_mask32", 1); -#endif -} - -void -lendian_sfi_aligntyp(nhfp, d_aligntyp, myparent, myname, cnt) -NHFILE *nhfp; -aligntyp *d_aligntyp; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ -/* const char *parent = "aligntyp"; */ - int i; - int16_t val, i16; - - /* nhUse(parent); */ - for (i = 0; i < cnt; ++i) { -#ifdef SAVEFILE_DEBUGGING - floc = ftell(nhfp->fpdef); -#endif - fread(&val, sizeof val, 1, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } - i16 = nhfp->bendian ? bswap16(val) : val; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %hd %ld %d\n", myname, - "aligntyp", - i16, floc, cnt); -#endif - *d_aligntyp = (aligntyp) i16; - d_aligntyp++; - } -} - -void -lendian_sfi_bitfield(nhfp, d_bitfield, myparent, myname, cnt) -NHFILE *nhfp; -uint8_t *d_bitfield; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt UNUSED; -{ -/* const char *parent = "bitfield"; */ - - /* nhUse(parent); */ -#ifdef SAVEFILE_DEBUGGING - floc = ftell(nhfp->fpdef); -#endif - fread(d_bitfield, sizeof *d_bitfield, 1, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %d %ld %d\n", myname, - "bitfield", - (int) *d_bitfield, floc, cnt); -#endif -} - -void -lendian_sfi_boolean(nhfp, d_boolean, myparent, myname, cnt) -NHFILE *nhfp; -boolean *d_boolean; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; -/* const char *parent = "boolean"; */ - int8_t i8; - - /* nhUse(parent); */ - for (i = 0; i < cnt; ++i) { -#ifdef SAVEFILE_DEBUGGING - floc = ftell(nhfp->fpdef); -#endif - fread(&i8, sizeof i8, 1, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %d %ld %d\n", myname, - "boolean", - (int) i8, floc, cnt); -#endif - *d_boolean = (boolean) i8; - d_boolean++; - } -} - -void -lendian_sfi_char(nhfp, d_char, myparent, myname, cnt) -NHFILE *nhfp; -char *d_char; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - int8_t i8; - - for (i = 0; i < cnt; ++i) { -#ifdef SAVEFILE_DEBUGGING - floc = ftell(nhfp->fpdef); -#endif - fread(&i8, sizeof i8, 1, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %d %ld %d\n", myname, - "char", - (int) i8, floc, cnt); -#endif - *d_char = (char) i8; - d_char++; - } -} - -void -lendian_sfi_genericptr(nhfp, d_genericptr, myparent, myname, cnt) -NHFILE *nhfp; -genericptr_t *d_genericptr; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - static const char *glorkum = "glorkum"; - int8_t p; - - for (i = 0; i < cnt; ++i) { -#ifdef SAVEFILE_DEBUGGING - floc = ftell(nhfp->fpdef); -#endif - fread(&p, sizeof p, 1, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %d %ld %d\n", myname, - "genericptr", - (int) p, floc, cnt); -#endif - *d_genericptr = p ? (genericptr_t) glorkum : (genericptr_t) 0; - d_genericptr++; - } -} - -void -lendian_sfi_int(nhfp, d_int, myparent, myname, cnt) -NHFILE *nhfp; -int *d_int; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - int32_t val, i32; - - for (i = 0; i < cnt; ++i) { -#ifdef SAVEFILE_DEBUGGING - floc = ftell(nhfp->fpdef); -#endif - fread(&val, sizeof val, 1, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } - i32 = nhfp->bendian ? bswap32(val) : val; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %d %ld %d\n", myname, - "int", - i32, floc, cnt); -#endif - *d_int = (int) i32; - d_int++; - } -} - -void -lendian_sfi_long(nhfp, d_long, myparent, myname, cnt) -NHFILE *nhfp; -long *d_long; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - int64_t val64, i64; - - for (i = 0; i < cnt; ++i) { -#ifdef SAVEFILE_DEBUGGING - floc = ftell(nhfp->fpdef); -#endif - fread(&val64, sizeof val64, 1, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } - i64 = nhfp->bendian ? bswap64(val64) : val64; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug, DEBUGFORMATSTR64, myname, - "long", - i64, floc, cnt); -#endif - *d_long = (long) i64; - d_long++; - } -} - -void -lendian_sfi_schar(nhfp, d_schar, myparent, myname, cnt) -NHFILE *nhfp; -schar *d_schar; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - int8_t i8; - - for (i = 0; i < cnt; ++i) { -#ifdef SAVEFILE_DEBUGGING - floc = ftell(nhfp->fpdef); -#endif - fread(&i8, sizeof i8, 1, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %d %ld %d\n", myname, - "schar", - (int) i8, floc, cnt); -#endif - *d_schar = (schar) i8; - d_schar++; - } -} - -void -lendian_sfi_short(nhfp, d_short, myparent, myname, cnt) -NHFILE *nhfp; -short *d_short; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - int16_t val16, i16; - - for (i = 0; i < cnt; ++i) { -#ifdef SAVEFILE_DEBUGGING - floc = ftell(nhfp->fpdef); -#endif - fread(&val16, sizeof val16, 1, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } - i16 = nhfp->bendian ? bswap16(val16) : val16; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %hd %ld %d\n", myname, - "short", - i16, floc, cnt); -#endif - *d_short = (short) i16; - d_short++; - } -} - -void -lendian_sfi_size_t(nhfp, d_size_t, myparent, myname, cnt) -NHFILE *nhfp; -size_t *d_size_t; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - uint64_t ui64, val; -/* const char *parent = "size_t"; */ - - /* nhUse(parent); */ - for (i = 0; i < cnt; ++i) { -#ifdef SAVEFILE_DEBUGGING - floc = ftell(nhfp->fpdef); -#endif - fread(&val, sizeof val, 1, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } - ui64 = nhfp->bendian ? bswap64(val) : val; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug, DEBUGFORMATSTR64, myname, - "size_t", - ui64, floc, cnt); -#endif - *d_size_t = (size_t) ui64; - d_size_t++; - } -} - -void -lendian_sfi_time_t(nhfp, d_time_t, myparent, myname, cnt) -NHFILE *nhfp; -time_t *d_time_t; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt UNUSED; -{ - time_t tmp; - char buf[BUFSZ]; -/* const char *parent = "time_t"; */ - - /* nhUse(parent); */ -#ifdef SAVEFILE_DEBUGGING - floc = ftell(nhfp->fpdef); -#endif - fread(buf, 1, 15, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %s %ld %d\n", myname, - "time", - buf, floc, cnt); -#endif - tmp = time_from_yyyymmddhhmmss(buf); - *d_time_t = tmp; -} - -void -lendian_sfi_unsigned(nhfp, d_unsigned, myparent, myname, cnt) -NHFILE *nhfp; -unsigned *d_unsigned; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - /* deferal */ - lendian_sfi_uint(nhfp, d_unsigned, myparent, myname, cnt); -} - -void -lendian_sfi_uchar(nhfp, d_uchar, myparent, myname, cnt) -NHFILE *nhfp; -unsigned char *d_uchar; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - uint8_t ui8; - - for (i = 0; i < cnt; ++i) { -#ifdef SAVEFILE_DEBUGGING - floc = ftell(nhfp->fpdef); -#endif - fread(&ui8, sizeof ui8, 1, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %hu %ld %d\n", myname, - "uchar", - (unsigned short) ui8, floc, cnt); -#endif - *d_uchar = (uchar) ui8; - d_uchar++; - } -} - -void -lendian_sfi_uint(nhfp, d_uint, myparent, myname, cnt) -NHFILE *nhfp; -unsigned int *d_uint; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - uint32_t val, ui32; - - for (i = 0; i < cnt; ++i) { -#ifdef SAVEFILE_DEBUGGING - floc = ftell(nhfp->fpdef); -#endif - fread(&val, sizeof val, 1, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } - ui32 = nhfp->bendian ? bswap32(val) : val; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %u %ld %d\n", myname, - "uint", - ui32, floc, cnt); -#endif - *d_uint = (unsigned int) ui32; - d_uint++; - } -} - -void -lendian_sfi_ulong(nhfp, d_ulong, myparent, myname, cnt) -NHFILE *nhfp; -unsigned long *d_ulong; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - uint64_t val64, ui64; - - for (i = 0; i < cnt; ++i) { -#ifdef SAVEFILE_DEBUGGING - floc = ftell(nhfp->fpdef); -#endif - fread(&val64, sizeof val64, 1, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } - ui64 = nhfp->bendian ? bswap64(val64) : val64; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug, DEBUGFORMATSTR64, myname, - "ulong", - ui64, floc, cnt); -#endif - *d_ulong = (unsigned long) ui64; - d_ulong++; - } -} - -void -lendian_sfi_ushort(nhfp, d_ushort, myparent, myname, cnt) -NHFILE *nhfp; -unsigned short *d_ushort; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - uint16_t val16, ui16; - - for (i = 0; i < cnt; ++i) { -#ifdef SAVEFILE_DEBUGGING - floc = ftell(nhfp->fpdef); -#endif - fread(&val16, sizeof val16, 1, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } - ui16 = nhfp->bendian ? bswap16(val16) : val16; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %hu %ld %d\n", myname, - "ushort", - ui16, floc, cnt); -#endif - *d_ushort = (unsigned short) ui16; - d_ushort++; - } -} - -void -lendian_sfi_xchar(nhfp, d_xchar, myparent, myname, cnt) -NHFILE *nhfp; -xchar *d_xchar; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ - int i; - int16_t val16, i16; - - for (i = 0; i < cnt; ++i) { -#ifdef SAVEFILE_DEBUGGING - floc = ftell(nhfp->fpdef); -#endif - fread(&val16, sizeof val16, 1, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } - i16 = nhfp->bendian ? bswap16(val16) : val16; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %hd %ld %d\n", myname, - "xchar", - i16, floc, cnt); -#endif - *d_xchar = (xchar) i16; - d_xchar++; - } -} - -static char strbuf[BUFSZ * 4]; - -void -lendian_sfi_str(nhfp, d_str, myparent, myname, cnt) -NHFILE *nhfp; -char *d_str; -const char *myparent UNUSED; -const char *myname UNUSED; -int cnt; -{ -#ifdef SAVEFILE_DEBUGGING - char testbuf[BUFSZ]; -#endif - int i, j, sval; -/* const char *parent = "str"; */ - char n[4]; - char *src, *dest; - int16_t i16, incount = 0; - - /* nhUse(parent); */ -#ifdef SAVEFILE_DEBUGGING - floc = ftell(nhfp->fpdef); -#endif - fread(&i16, sizeof i16, 1, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } - incount = nhfp->bendian ? bswap16(i16) : i16; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %hd %ld %d\n", myname, - "str-count", - incount, floc, cnt); -#endif - if (incount >= (BUFSZ * 4) - 1) - panic("overflow on sflendian string read %d %d", - incount, cnt); -#ifdef SAVEFILE_DEBUGGING - floc = ftell(nhfp->fpdef); -#endif - fread(strbuf, sizeof (char), incount, nhfp->fpdef); - if (feof(nhfp->fpdef)) { - nhfp->eof = TRUE; - return; - } - strbuf[incount] = '\0'; -#ifdef SAVEFILE_DEBUGGING - fprintf(nhfp->fpdebug,"%s %s %s %ld %d\n", myname, - "str", - strbuf, floc, cnt); -#endif - src = strbuf; - dest = -#ifdef SAVEFILE_DEBUGGING - testbuf; -#else - d_str; -#endif - - for (i = 0; i < cnt; ++i) { - if (*src == '\\') { - src++; - for (j = 0; j < 4; ++j) { - if (j < 3) - n[j] = *src++; - else - n[j] = '\0'; - } - sval = atoi(n); - *dest++ = (char) sval; - } else - *dest++ = *src++; - } -} - -void -lendian_sfi_addinfo(nhfp, myparent, action, myname, indx) -NHFILE *nhfp UNUSED; -const char *myparent UNUSED, *action UNUSED, *myname UNUSED; -int indx UNUSED; -{ - /* not doing anything here */ -} - - - diff --git a/src/timeout.c b/src/timeout.c index 894167da1..82c44330e 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -5,8 +5,6 @@ #include "hack.h" #include "lev.h" /* for checking save modes */ -#include "sfproto.h" - static void NDECL(stoned_dialogue); static void NDECL(vomiting_dialogue); @@ -2165,16 +2163,12 @@ timer_element *timer; /* assume no pointers in arg */ if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) timer, sizeof(timer_element)); - if (nhfp->fieldlevel) - sfo_fe(nhfp, timer, "timers", "timer", 1); break; case TIMER_OBJECT: if (timer->needs_fixup) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t)timer, sizeof(timer_element)); - if (nhfp->fieldlevel) - sfo_fe(nhfp, timer, "timers", "timer", 1); } else { /* replace object pointer with id */ arg_save.a_obj = timer->arg.a_obj; @@ -2183,8 +2177,6 @@ timer_element *timer; timer->needs_fixup = 1; if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t)timer, sizeof(timer_element)); - if (nhfp->fieldlevel) - sfo_fe(nhfp, timer, "timers", "timer", 1); timer->arg.a_obj = arg_save.a_obj; timer->needs_fixup = 0; } @@ -2194,8 +2186,6 @@ timer_element *timer; if (timer->needs_fixup) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t)timer, sizeof(timer_element)); - if (nhfp->fieldlevel) - sfo_fe(nhfp, timer, "timers", "timer", 1); } else { /* replace monster pointer with id */ arg_save.a_monst = timer->arg.a_monst; @@ -2204,8 +2194,6 @@ timer_element *timer; timer->needs_fixup = 1; if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t)timer, sizeof(timer_element)); - if (nhfp->fieldlevel) - sfo_fe(nhfp, timer, "timers", "timer", 1); timer->arg.a_monst = arg_save.a_monst; timer->needs_fixup = 0; } @@ -2343,14 +2331,10 @@ int range; if (range == RANGE_GLOBAL) { if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &g.timer_id, sizeof(g.timer_id)); - if (nhfp->fieldlevel) - sfo_ulong(nhfp, &g.timer_id, "timers", "g.timer_id", 1); } count = maybe_write_timer(nhfp, range, FALSE); if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &count, sizeof count); - if (nhfp->fieldlevel) - sfo_int(nhfp, &count, "timers", "timer_count", 1); (void) maybe_write_timer(nhfp, range, TRUE); } @@ -2389,22 +2373,16 @@ long adjust; /* how much to adjust timeout */ if (range == RANGE_GLOBAL) { if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &g.timer_id, sizeof g.timer_id); - if (nhfp->fieldlevel) - sfi_ulong(nhfp, &g.timer_id, "timers", "g.timer_id", 1); } /* restore elements */ if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &count, sizeof count); - if (nhfp->fieldlevel) - sfi_int(nhfp, &count, "timers", "timer_count", 1); while (count-- > 0) { curr = (timer_element *) alloc(sizeof(timer_element)); if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) curr, sizeof(timer_element)); - if (nhfp->fieldlevel) - sfi_fe(nhfp, curr, "timers", "timer", 1); if (ghostly) curr->timeout += adjust; insert_timer(curr); diff --git a/src/version.c b/src/version.c index 03ebbb60d..8af580ec4 100644 --- a/src/version.c +++ b/src/version.c @@ -7,7 +7,6 @@ #include "dlb.h" #include "date.h" #include "lev.h" -#include "sfproto.h" /* * All the references to the contents of patchlevel.h have been moved @@ -399,26 +398,17 @@ unsigned long utdflags; if (rlen == 0) return FALSE; } - if (nhfp->fieldlevel) { - sfi_char(nhfp, &indicator, "indicate", "format", 1); - sfi_int(nhfp, &filecmc, "validate", "critical_members_count", 1); - cmc = critical_members_count(); - } if (cmc != filecmc) return FALSE; - if (nhfp->fieldlevel && (nhfp->fnidx > historical)) { - sfi_version_info(nhfp, &vers_info, "version", "version_info", 1); - } else { - rlen = read(nhfp->fd, (genericptr_t) &vers_info, sizeof vers_info); - minit(); /* ZEROCOMP */ - if (rlen == 0) { - if (verbose) { - pline("File \"%s\" is empty?", name); - wait_synch(); - } - return FALSE; + rlen = read(nhfp->fd, (genericptr_t) &vers_info, sizeof vers_info); + minit(); /* ZEROCOMP */ + if (rlen == 0) { + if (verbose) { + pline("File \"%s\" is empty?", name); + wait_synch(); } + return FALSE; } if (!check_version(&vers_info, name, verbose, utdflags)) { @@ -437,17 +427,6 @@ NHFILE *nhfp; int cmc = 0; if (nhfp->mode & WRITING) { - if (nhfp->fieldlevel) { - indicate = (nhfp->fnidx == ascii) ? 'a' : 'l'; - sfo_char(nhfp, &indicate, "indicate", "format", 1); - cmc = critical_members_count(); - { -#if 0 - pline("critical-members=%d.", cmc); -#endif - } - sfo_int(nhfp, &cmc, "validate", "critical_members_count", 1); - } if (nhfp->structlevel) { indicate = 'h'; /* historical */ bwrite(nhfp->fd, (genericptr_t) &indicate, sizeof indicate); @@ -485,11 +464,6 @@ NHFILE *nhfp; (unsigned) (sizeof version_data)); bufon(nhfp->fd); } - if (nhfp->fieldlevel) { - store_formatindicator(nhfp); - sfo_version_info(nhfp, (struct version_info *) &version_data, - "version", "version_info", 1); - } return; } diff --git a/src/worm.c b/src/worm.c index 7c338bb43..6c139581f 100644 --- a/src/worm.c +++ b/src/worm.c @@ -5,8 +5,6 @@ #include "hack.h" #include "lev.h" -#include "sfproto.h" - #define newseg() (struct wseg *) alloc(sizeof (struct wseg)) #define dealloc_seg(wseg) free((genericptr_t) (wseg)) @@ -493,8 +491,6 @@ NHFILE *nhfp; /* Save number of segments */ if (nhfp->structlevel) bwrite(nhfp->fd, (genericptr_t) &count, sizeof(int)); - if (nhfp->fieldlevel) - sfo_int(nhfp, &count, "worm", "segment_count", 1); /* Save segment locations of the monster. */ if (count) { for (curr = wtails[i]; curr; curr = curr->nseg) { @@ -502,20 +498,12 @@ NHFILE *nhfp; bwrite(nhfp->fd, (genericptr_t) &(curr->wx), sizeof(xchar)); bwrite(nhfp->fd, (genericptr_t) &(curr->wy), sizeof(xchar)); } - if (nhfp->fieldlevel) { - sfo_xchar(nhfp, &(curr->wx), "worm", "wx", 1); - sfo_xchar(nhfp, &(curr->wy), "worm", "wy", 1); - } } } } if (nhfp->structlevel) { bwrite(nhfp->fd, (genericptr_t) wgrowtime, sizeof(wgrowtime)); } - if (nhfp->fieldlevel) { - for (i = 0; i < MAX_NUM_WORMS; ++i) - sfo_long(nhfp, &wgrowtime[i], "worm", "wgrowtime", 1); - } } if (release_data(nhfp)) { @@ -550,8 +538,6 @@ NHFILE *nhfp; for (i = 1; i < MAX_NUM_WORMS; i++) { if (nhfp->structlevel) mread(nhfp->fd, (genericptr_t) &count, sizeof(int)); - if (nhfp->fieldlevel) - sfi_int(nhfp, &count, "worm", "segment_count", 1); /* Get the segments. */ for (curr = (struct wseg *) 0, j = 0; j < count; j++) { @@ -561,10 +547,6 @@ NHFILE *nhfp; mread(nhfp->fd, (genericptr_t) &(temp->wx), sizeof(xchar)); mread(nhfp->fd, (genericptr_t) &(temp->wy), sizeof(xchar)); } - if (nhfp->fieldlevel) { - sfi_xchar(nhfp, &(temp->wx), "worm", "wx", 1); - sfi_xchar(nhfp, &(temp->wy), "worm", "wy", 1); - } if (curr) curr->nseg = temp; else @@ -576,10 +558,6 @@ NHFILE *nhfp; if (nhfp->structlevel) { mread(nhfp->fd, (genericptr_t) wgrowtime, sizeof(wgrowtime)); } - if (nhfp->fieldlevel) { - for (i = 0; i < MAX_NUM_WORMS; ++i) - sfi_long(nhfp, &wgrowtime[i], "worm", "wgrowtime", 1); - } } /* diff --git a/sys/msdos/Makefile.GCC b/sys/msdos/Makefile.GCC index 3d0a4a729..253f05490 100644 --- a/sys/msdos/Makefile.GCC +++ b/sys/msdos/Makefile.GCC @@ -308,8 +308,7 @@ VOBJ20 = $(O)vis_tab.o $(O)weapon.o $(O)were.o $(O)wield.o $(O)windows. VOBJ21 = $(O)wintty.o $(O)wizard.o $(O)worm.o $(O)worn.o $(O)write.o VOBJ22 = $(O)zap.o $(O)light.o $(O)dlb.o $(O)dig.o $(O)teleport.o VOBJ23 = $(O)region.o $(O)sys.o $(REGEX) $(O)isaac64.o -VOBJ24 = $(O)sfbase.o $(O)sfdata.o -VOBJ25 = $(O)sfstruct.o $(O)sfascii.o $(O)sflendian.o +VOBJ24 = $(O)sfstruct.o SOBJ = $(O)msdos.o $(O)pcsys.o $(O)tty.o $(O)unix.o \ $(O)video.o $(O)vidtxt.o $(O)pckeys.o diff --git a/sys/msdos/Makefile2.cross b/sys/msdos/Makefile2.cross index 9a88c16f9..530cefe42 100644 --- a/sys/msdos/Makefile2.cross +++ b/sys/msdos/Makefile2.cross @@ -310,8 +310,7 @@ VOBJ20 = $(O)vis_tab.o $(O)weapon.o $(O)were.o $(O)wield.o $(O)windows. VOBJ21 = $(O)wintty.o $(O)wizard.o $(O)worm.o $(O)worn.o $(O)write.o VOBJ22 = $(O)zap.o $(O)light.o $(O)dlb.o $(O)dig.o $(O)teleport.o VOBJ23 = $(O)region.o $(O)sys.o $(REGEX) $(O)isaac64.o $(VIDEO_OBJ) -VOBJ24 = $(O)sfbase.o $(O)sfdata.o -VOBJ25 = $(O)sfstruct.o $(O)sfascii.o $(O)sflendian.o +VOBJ24 = $(O)sfstruct.o SOBJ = $(O)msdos.o $(O)pcsys.o $(O)tty.o $(O)unix.o \ $(O)video.o $(O)vidtxt.o $(O)pckeys.o diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index 477ce34a3..55ca1cc98 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -7,7 +7,6 @@ #include "hack.h" #include "dlb.h" -#include "sfproto.h" #ifndef NO_SIGNAL #include @@ -450,8 +449,6 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ g.hackpid = 1; if (nhfp->structlevel) write(nhfp->fd, (genericptr_t) &g.hackpid, sizeof(g.hackpid)); - if (nhfp->fieldlevel) - sfi_int(nhfp, &g.hackpid, "locking", "g.hackpid", 1); close_nhfile(nhfp); } #ifdef MFLOPPY diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src index 521fc0bc7..3d54976ea 100644 --- a/sys/unix/Makefile.src +++ b/sys/unix/Makefile.src @@ -452,7 +452,6 @@ HACKCSRC = allmain.c alloc.c apply.c artifact.c attrib.c ball.c bones.c \ options.c pager.c pickup.c pline.c polyself.c potion.c pray.c \ priest.c quest.c questpgr.c read.c rect.c region.c restore.c \ rip.c rnd.c role.c rumors.c save.c sfstruct.c \ - sfbase.c sfdata.c sfascii.c sflendian.c \ shk.c shknam.c sit.c sounds.c \ sp_lev.c spell.c steal.c steed.c sys.c teleport.c timeout.c \ topten.c track.c trap.c u_init.c \ @@ -469,7 +468,7 @@ SYSCSRC = ../sys/atari/tos.c ../sys/share/pcmain.c ../sys/share/pcsys.c \ SYSCXXSRC = ../sys/share/cppregex.cpp # generated source files (tile.c is handled separately via WINxxxSRC) -GENCSRC = vis_tab.c sfdata.c #tile.c +GENCSRC = vis_tab.c #tile.c # all windowing-system-dependent .c (for dependencies and such) WINCSRC = $(WINTTYSRC) $(WINCURSESSRC) $(WINX11SRC) $(WINGNOMESRC) $(WINGEMSRC) @@ -520,7 +519,6 @@ HOBJ = $(FIRSTOBJ) allmain.o alloc.o apply.o artifact.o attrib.o ball.o \ pager.o pickup.o pline.o polyself.o potion.o pray.o priest.o \ quest.o questpgr.o read.o rect.o region.o restore.o rip.o rnd.o \ role.o rumors.o save.o sfstruct.o \ - sfbase.o sfdata.o sfascii.o sflendian.o \ shk.o shknam.o sit.o sounds.o sp_lev.o spell.o sys.o \ steal.o steed.o teleport.o timeout.o topten.o track.o trap.o u_init.o \ uhitm.o vault.o vision.o vis_tab.o weapon.o were.o wield.o windows.o \ @@ -666,26 +664,7 @@ tile.c: ../win/share/tilemap.c $(HACK_H) ../win/gnome/gn_rip.h: ../win/X11/rip.xpm cp ../win/X11/rip.xpm ../win/gnome/gn_rip.h -# readtags dependencies -# -# sfstruct.o: sfstruct.c $(HACK_H) -sfbase.o: sfbase.c $(HACK_H) ../include/sfproto.h ../include/sfprocs.h -sfascii.o: sfascii.c $(HACK_H) ../include/sfprocs.h -sflendian.o: sflendian.c $(HACK_H) ../include/sfprocs.h -sfdata.o: sfdata.c $(HACK_H) ../include/sfprocs.h - -#../util/readtags: -# @( cd ../util ; $(MAKE) readtags ) -# -#../util/nethack.tags: -# @( cd ../util ; $(MAKE) nethack.tags ) -# -#sfdata.c: ../util/readtags ../util/nethack.tags -# @( cd ../util ; ./readtags ) -# -#../include/sfproto.h: ../util/readtags ../util/nethack.tags -# @( cd ../util ; ./readtags ) # date.h should be remade any time any of the source or include code # is modified. Unfortunately, this would make the contents of this @@ -777,7 +756,7 @@ $(HACK_H): ../include/hack.h $(CONFIG_H) ../include/lint.h ../include/align.h \ tos.o: ../sys/atari/tos.c $(HACK_H) ../include/tcap.h $(CC) $(CFLAGS) -c -o $@ ../sys/atari/tos.c pcmain.o: ../sys/share/pcmain.c $(HACK_H) ../include/dlb.h \ - ../include/sfproto.h ../include/integer.h + ../include/integer.h $(CC) $(CFLAGS) -c -o $@ ../sys/share/pcmain.c pcsys.o: ../sys/share/pcsys.c $(HACK_H) $(CC) $(CFLAGS) -c -o $@ ../sys/share/pcsys.c @@ -1001,16 +980,14 @@ wc_chainout.o: ../win/chain/wc_chainout.c $(HACK_H) wc_trace.o: ../win/chain/wc_trace.c $(HACK_H) ../include/func_tab.h $(CC) $(CFLAGS) -c -o $@ ../win/chain/wc_trace.c vis_tab.o: vis_tab.c $(CONFIG_H) ../include/vis_tab.h -sfdata.o: sfdata.c $(HACK_H) ../include/artifact.h ../include/func_tab.h \ - ../include/lev.h ../include/integer.h ../include/sfproto.h allmain.o: allmain.c $(HACK_H) alloc.o: alloc.c $(CONFIG_H) apply.o: apply.c $(HACK_H) artifact.o: artifact.c $(HACK_H) ../include/artifact.h ../include/artilist.h \ - ../include/sfproto.h ../include/integer.h + ../include/integer.h attrib.o: attrib.c $(HACK_H) ball.o: ball.c $(HACK_H) -bones.o: bones.c $(HACK_H) ../include/lev.h ../include/sfproto.h \ +bones.o: bones.c $(HACK_H) ../include/lev.h \ ../include/integer.h botl.o: botl.c $(HACK_H) cmd.o: cmd.c $(HACK_H) ../include/lev.h ../include/func_tab.h @@ -1029,24 +1006,24 @@ dokick.o: dokick.c $(HACK_H) dothrow.o: dothrow.c $(HACK_H) drawing.o: drawing.c $(HACK_H) ../include/tcap.h dungeon.o: dungeon.c $(HACK_H) ../include/dgn_file.h ../include/dlb.h \ - ../include/lev.h ../include/sfproto.h ../include/integer.h + ../include/lev.h ../include/integer.h eat.o: eat.c $(HACK_H) -end.o: end.c $(HACK_H) ../include/lev.h ../include/dlb.h ../include/sfproto.h \ +end.o: end.c $(HACK_H) ../include/lev.h ../include/dlb.h \ ../include/integer.h -engrave.o: engrave.c $(HACK_H) ../include/lev.h ../include/sfproto.h \ +engrave.o: engrave.c $(HACK_H) ../include/lev.h \ ../include/integer.h exper.o: exper.c $(HACK_H) explode.o: explode.c $(HACK_H) extralev.o: extralev.c $(HACK_H) -files.o: files.c $(HACK_H) ../include/dlb.h ../include/sfproto.h \ - ../include/integer.h ../include/sfprocs.h ../include/lev.h \ +files.o: files.c $(HACK_H) ../include/dlb.h \ + ../include/integer.h ../include/lev.h \ #zlib.h fountain.o: fountain.c $(HACK_H) hack.o: hack.c $(HACK_H) hacklib.o: hacklib.c $(HACK_H) invent.o: invent.c $(HACK_H) isaac64.o: isaac64.c $(CONFIG_H) ../include/isaac64.h -light.o: light.c $(HACK_H) ../include/lev.h ../include/sfproto.h \ +light.o: light.c $(HACK_H) ../include/lev.h \ ../include/integer.h lock.o: lock.c $(HACK_H) mail.o: mail.c $(HACK_H) ../include/mail.h @@ -1067,9 +1044,9 @@ minion.o: minion.c $(HACK_H) mklev.o: mklev.c $(HACK_H) mkmap.o: mkmap.c $(HACK_H) ../include/sp_lev.h mkmaze.o: mkmaze.c $(HACK_H) ../include/sp_lev.h ../include/lev.h \ - ../include/sfproto.h ../include/integer.h + ../include/integer.h mkobj.o: mkobj.c $(HACK_H) -mkroom.o: mkroom.c $(HACK_H) ../include/sfproto.h ../include/integer.h +mkroom.o: mkroom.c $(HACK_H) ../include/integer.h mon.o: mon.c $(HACK_H) ../include/mfndpos.h mondata.o: mondata.c $(HACK_H) monmove.o: monmove.c $(HACK_H) ../include/mfndpos.h ../include/artifact.h @@ -1082,13 +1059,13 @@ muse.o: muse.c $(HACK_H) music.o: music.c $(HACK_H) nhlua.o: nhlua.c $(HACK_H) ../include/dlb.h nhlsel.o: nhlsel.c $(HACK_H) ../include/sp_lev.h -o_init.o: o_init.c $(HACK_H) ../include/lev.h ../include/sfproto.h \ +o_init.o: o_init.c $(HACK_H) ../include/lev.h \ ../include/integer.h objects.o: objects.c $(CONFIG_H) ../include/obj.h ../include/objclass.h \ ../include/prop.h ../include/skills.h ../include/color.h objnam.o: objnam.c $(HACK_H) options.o: options.c $(CONFIG_H) ../include/objclass.h ../include/flag.h \ - $(HACK_H) ../include/tcap.h ../include/sfprocs.h \ + $(HACK_H) ../include/tcap.h \ ../include/integer.h pager.o: pager.c $(HACK_H) ../include/dlb.h pickup.o: pickup.c $(HACK_H) @@ -1101,23 +1078,18 @@ quest.o: quest.c $(HACK_H) questpgr.o: questpgr.c $(HACK_H) ../include/dlb.h read.o: read.c $(HACK_H) rect.o: rect.c $(HACK_H) -region.o: region.c $(HACK_H) ../include/lev.h ../include/sfproto.h \ +region.o: region.c $(HACK_H) ../include/lev.h \ ../include/integer.h restore.o: restore.c $(HACK_H) ../include/lev.h ../include/tcap.h \ - ../include/sfproto.h ../include/integer.h + ../include/integer.h rip.o: rip.c $(HACK_H) rnd.o: rnd.c $(HACK_H) ../include/isaac64.h role.o: role.c $(HACK_H) rumors.o: rumors.c $(HACK_H) ../include/lev.h ../include/dlb.h \ - ../include/sfproto.h ../include/integer.h -save.o: save.c $(HACK_H) ../include/lev.h ../include/sfproto.h \ + ../include/integer.h +save.o: save.c $(HACK_H) ../include/lev.h \ ../include/integer.h sfstruct.o: sfstruct.c $(HACK_H) -sfbase.o: sfbase.c $(HACK_H) ../include/integer.h ../include/sfprocs.h -sfdata.o: sfdata.c $(HACK_H) ../include/artifact.h ../include/func_tab.h \ - ../include/lev.h ../include/integer.h ../include/sfproto.h -sfascii.o: sfascii.c $(HACK_H) ../include/integer.h ../include/sfprocs.h -sflendian.o: sflendian.c $(HACK_H) ../include/integer.h ../include/sfprocs.h shk.o: shk.c $(HACK_H) shknam.o: shknam.c $(HACK_H) sit.o: sit.c $(HACK_H) ../include/artifact.h @@ -1128,7 +1100,7 @@ steal.o: steal.c $(HACK_H) steed.o: steed.c $(HACK_H) sys.o: sys.c $(HACK_H) teleport.o: teleport.c $(HACK_H) -timeout.o: timeout.c $(HACK_H) ../include/lev.h ../include/sfproto.h \ +timeout.o: timeout.c $(HACK_H) ../include/lev.h \ ../include/integer.h topten.o: topten.c $(HACK_H) ../include/dlb.h ../include/patchlevel.h track.o: track.c $(HACK_H) @@ -1137,7 +1109,7 @@ u_init.o: u_init.c $(HACK_H) uhitm.o: uhitm.c $(HACK_H) vault.o: vault.c $(HACK_H) version.o: version.c $(HACK_H) ../include/dlb.h ../include/date.h \ - ../include/lev.h ../include/sfproto.h ../include/integer.h \ + ../include/lev.h ../include/integer.h \ ../include/patchlevel.h vision.o: vision.c $(HACK_H) ../include/vis_tab.h weapon.o: weapon.c $(HACK_H) @@ -1145,7 +1117,7 @@ were.o: were.c $(HACK_H) wield.o: wield.c $(HACK_H) windows.o: windows.c $(HACK_H) ../include/wingem.h ../include/winGnome.h wizard.o: wizard.c $(HACK_H) -worm.o: worm.c $(HACK_H) ../include/lev.h ../include/sfproto.h \ +worm.o: worm.c $(HACK_H) ../include/lev.h \ ../include/integer.h worn.o: worn.c $(HACK_H) write.o: write.c $(HACK_H) diff --git a/sys/unix/Makefile.utl b/sys/unix/Makefile.utl index be6299298..b27e91ded 100644 --- a/sys/unix/Makefile.utl +++ b/sys/unix/Makefile.utl @@ -129,11 +129,6 @@ LEXYYC = lex.yy.c # YTABH = y_tab.h # LEXYYC = lexyy.c -# 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 - # 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 @@ -189,7 +184,6 @@ MAKESRC = makedefs.c ../src/mdlib.c RECOVSRC = recover.c DLBSRC = dlb_main.c UTILSRCS = $(MAKESRC) panic.c $(DGNCOMPSRC) $(RECOVSRC) $(DLBSRC) -READTAGSSRC = readtags.c # files that define all monsters and objects CMONOBJ = ../src/monst.c ../src/objects.c @@ -210,9 +204,6 @@ RECOVOBJS = recover.o # object files for the data librarian DLBOBJS = dlb_main.o $(OBJDIR)/dlb.o $(OALLOC) -# object files for readtags -READTAGSOBJS = readtags.o - # flags for creating distribution versions of sys/share/*_lex.c, using # a more portable flex skeleton, which is not included in the distribution. # hopefully keeping this out of the section to be edited will keep too @@ -369,67 +360,6 @@ tileedit: tileedit.cpp $(TEXT_IO) $(CC) -o tileedit -I../include -I$(QTDIR)/include -L$(QTDIR)/lib \ tileedit.cpp $(TEXT_IO) -lqt -# dependencies for readtags -# -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/lev.h ../include/mextra.h \ - ../include/mkroom.h ../include/monst.h ../include/monsym.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 - -readtags: $(READTAGSOBJS) - $(CC) $(LFLAGS) -o readtags $(READTAGSOBJS) $(LIBS) - -readtags.o: readtags.c $(HACK_H) - $(CC) $(CFLAGS) -c readtags.c - -nethack.tags: $(CTAGDEP) -# -# tested with universal ctags from https://github.com/universal-ctags/ctags.git -# - $(CTAGSCMD) $(CTAGSOPT) -f nethack.tags ../include/align.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/artifact.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/artilist.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/attrib.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/context.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/coord.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/decl.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/dungeon.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/engrave.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/flag.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/func_tab.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/global.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/hack.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/lev.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/mextra.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/mkroom.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/monst.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/monsym.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/obj.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/objclass.h -# $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/permonst.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/prop.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/quest.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/rect.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/region.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/rm.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/skills.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/spell.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/sys.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/timeout.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/trap.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/you.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/onames.h - $(CTAGSCMD) $(CTAGSOPT) -a -f nethack.tags ../include/wintype.h - # using dependencies like # ../src/foo:: # @( cd ../src ; $(MAKE) foo ) diff --git a/sys/unix/NetHack.xcodeproj/project.pbxproj b/sys/unix/NetHack.xcodeproj/project.pbxproj index bd3b7cbbf..ee85f2590 100644 --- a/sys/unix/NetHack.xcodeproj/project.pbxproj +++ b/sys/unix/NetHack.xcodeproj/project.pbxproj @@ -142,10 +142,6 @@ 31B8A46021A26AE70055BD01 /* dlb_main.c in Sources */ = {isa = PBXBuildFile; fileRef = 31B8A45F21A26AE70055BD01 /* dlb_main.c */; }; 31B8A46121A26AF60055BD01 /* panic.c in Sources */ = {isa = PBXBuildFile; fileRef = 31B8A42721A267E60055BD01 /* panic.c */; }; 31B8A46221A26B020055BD01 /* alloc.c in Sources */ = {isa = PBXBuildFile; fileRef = 31B8A36521A238040055BD01 /* alloc.c */; }; - 544768A323994965004B9739 /* sfascii.c in Sources */ = {isa = PBXBuildFile; fileRef = 544768A223994965004B9739 /* sfascii.c */; }; - 544768A5239949A8004B9739 /* sfbase.c in Sources */ = {isa = PBXBuildFile; fileRef = 544768A4239949A8004B9739 /* sfbase.c */; }; - 544768A9239949FA004B9739 /* sfdata.c in Sources */ = {isa = PBXBuildFile; fileRef = 544768A6239949FA004B9739 /* sfdata.c */; }; - 544768AA239949FA004B9739 /* sflendian.c in Sources */ = {isa = PBXBuildFile; fileRef = 544768A7239949FA004B9739 /* sflendian.c */; }; 544768AB239949FA004B9739 /* sfstruct.c in Sources */ = {isa = PBXBuildFile; fileRef = 544768A8239949FA004B9739 /* sfstruct.c */; }; 544768AE23994A17004B9739 /* nhlsel.c in Sources */ = {isa = PBXBuildFile; fileRef = 544768AC23994A17004B9739 /* nhlsel.c */; }; 544768AF23994A17004B9739 /* nhlua.c in Sources */ = {isa = PBXBuildFile; fileRef = 544768AD23994A17004B9739 /* nhlua.c */; }; @@ -486,18 +482,12 @@ 31B8A45F21A26AE70055BD01 /* dlb_main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = dlb_main.c; path = ../../util/dlb_main.c; sourceTree = ""; }; 31B8A46421A278AC0055BD01 /* dgn_comp.y */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.yacc; name = dgn_comp.y; path = ../../util/dgn_comp.y; sourceTree = ""; }; 31B8A46821A288770055BD01 /* dgn_comp.l */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.lex; name = dgn_comp.l; path = ../../util/dgn_comp.l; sourceTree = ""; }; - 544768A223994965004B9739 /* sfascii.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sfascii.c; path = ../../src/sfascii.c; sourceTree = ""; }; - 544768A4239949A8004B9739 /* sfbase.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sfbase.c; path = ../../src/sfbase.c; sourceTree = ""; }; - 544768A6239949FA004B9739 /* sfdata.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sfdata.c; path = ../../src/sfdata.c; sourceTree = ""; }; - 544768A7239949FA004B9739 /* sflendian.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sflendian.c; path = ../../src/sflendian.c; sourceTree = ""; }; 544768A8239949FA004B9739 /* sfstruct.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sfstruct.c; path = ../../src/sfstruct.c; sourceTree = ""; }; 544768AC23994A17004B9739 /* nhlsel.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = nhlsel.c; path = ../../src/nhlsel.c; sourceTree = ""; }; 544768AD23994A17004B9739 /* nhlua.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = nhlua.c; path = ../../src/nhlua.c; sourceTree = ""; }; 544768B023994A2C004B9739 /* mdlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mdlib.c; path = ../../src/mdlib.c; sourceTree = ""; }; 544768B423995447004B9739 /* isaac64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = isaac64.h; path = ../../include/isaac64.h; sourceTree = ""; }; 544768B523995488004B9739 /* nhlua.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = nhlua.h; path = ../../include/nhlua.h; sourceTree = ""; }; - 544768B623995488004B9739 /* sfprocs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sfprocs.h; path = ../../include/sfprocs.h; sourceTree = ""; }; - 544768B723995488004B9739 /* sfproto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sfproto.h; path = ../../include/sfproto.h; sourceTree = ""; }; 544768B923995BB7004B9739 /* liblua.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblua.a; path = ../../lib/lua/liblua.a; sourceTree = ""; }; 54FCE8282223261F00F393C8 /* isaac64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = isaac64.c; path = ../../src/isaac64.c; sourceTree = ""; }; /* End PBXFileReference section */ @@ -567,11 +557,7 @@ 544768B023994A2C004B9739 /* mdlib.c */, 544768AC23994A17004B9739 /* nhlsel.c */, 544768AD23994A17004B9739 /* nhlua.c */, - 544768A6239949FA004B9739 /* sfdata.c */, - 544768A7239949FA004B9739 /* sflendian.c */, 544768A8239949FA004B9739 /* sfstruct.c */, - 544768A4239949A8004B9739 /* sfbase.c */, - 544768A223994965004B9739 /* sfascii.c */, 31B8A35521A238030055BD01 /* allmain.c */, 31B8A36521A238040055BD01 /* alloc.c */, 31B8A35E21A238040055BD01 /* apply.c */, @@ -710,8 +696,6 @@ isa = PBXGroup; children = ( 544768B523995488004B9739 /* nhlua.h */, - 544768B623995488004B9739 /* sfprocs.h */, - 544768B723995488004B9739 /* sfproto.h */, 544768B423995447004B9739 /* isaac64.h */, 3186A3B721A4B0FD0052BF02 /* align.h */, 3186A38021A4B0FB0052BF02 /* amiconf.h */, @@ -1460,7 +1444,6 @@ files = ( 31B8A3BC21A238060055BD01 /* eat.c in Sources */, 31B8A3A921A238060055BD01 /* music.c in Sources */, - 544768A9239949FA004B9739 /* sfdata.c in Sources */, 544768B123994A2C004B9739 /* mdlib.c in Sources */, 31B8A3D221A238060055BD01 /* engrave.c in Sources */, 31B8A3A021A238060055BD01 /* exper.c in Sources */, @@ -1479,7 +1462,6 @@ 31B8A41921A244940055BD01 /* objects.c in Sources */, 31B8A3AA21A238060055BD01 /* wizard.c in Sources */, 31B8A3D021A238060055BD01 /* explode.c in Sources */, - 544768A5239949A8004B9739 /* sfbase.c in Sources */, 31B8A3DE21A238060055BD01 /* sys.c in Sources */, 31B8A38021A238060055BD01 /* sit.c in Sources */, 31B8A3AF21A238060055BD01 /* lock.c in Sources */, @@ -1580,7 +1562,6 @@ 31B8A38E21A238060055BD01 /* quest.c in Sources */, 31B8A3D621A238060055BD01 /* region.c in Sources */, 31B8A3D421A238060055BD01 /* worm.c in Sources */, - 544768AA239949FA004B9739 /* sflendian.c in Sources */, 31B8A3C921A238060055BD01 /* sounds.c in Sources */, 31B8A37C21A238060055BD01 /* pager.c in Sources */, 31B8A39F21A238060055BD01 /* fountain.c in Sources */, @@ -1589,7 +1570,6 @@ 31B8A3D321A238060055BD01 /* cmd.c in Sources */, 31B8A3AB21A238060055BD01 /* mplayer.c in Sources */, 31B8A3CC21A238060055BD01 /* pickup.c in Sources */, - 544768A323994965004B9739 /* sfascii.c in Sources */, 31B8A39721A238060055BD01 /* invent.c in Sources */, 31B8A40021A23E6E0055BD01 /* getline.c in Sources */, 31B8A3B521A238060055BD01 /* rect.c in Sources */, diff --git a/sys/vms/vmsbuild.com b/sys/vms/vmsbuild.com index cacf60126..0ab402d1a 100755 --- a/sys/vms/vmsbuild.com +++ b/sys/vms/vmsbuild.com @@ -320,7 +320,7 @@ $ gosub compile_list $! $! Files added in 3.7 $! -$ c_list = "sfbase,sfdata,sfstruct,sflendian,sfascii,nhlua,nhlsel" +$ c_list = "sfstruct,nhlua,nhlsel" $ gosub compile_list $! $! 3.7 runtime LUA level parser/loader diff --git a/sys/winnt/Makefile.gcc b/sys/winnt/Makefile.gcc index 58cf34eb6..9b292d737 100644 --- a/sys/winnt/Makefile.gcc +++ b/sys/winnt/Makefile.gcc @@ -323,8 +323,7 @@ VOBJ24 = $(O)track.o $(O)trap.o $(O)u_init.o $(O)uhitm.o VOBJ25 = $(O)vault.o $(O)vis_tab.o $(O)vision.o $(O)weapon.o VOBJ26 = $(O)were.o $(O)wield.o $(O)windows.o $(O)wizard.o VOBJ27 = $(O)worm.o $(O)worn.o $(O)write.o $(O)zap.o -VOBJ28 = $(O)sfbase.o $(O)sfdata.o -VOBJ29 = $(O)sfstruct.o $(O)sfascii.o $(O)sflendian.o +VOBJ28 = $(O)sfstruct.o #VOBJ31 = $(O)win10.o ifeq "$(ADD_LUA)" "Y" diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index 614b32533..08aa27ff5 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -325,8 +325,7 @@ VOBJ24 = $(O)track.o $(O)trap.o $(O)u_init.o $(O)uhitm.o VOBJ25 = $(O)vault.o $(O)vis_tab.o $(O)vision.o $(O)weapon.o VOBJ26 = $(O)were.o $(O)wield.o $(O)windows.o $(O)wizard.o VOBJ27 = $(O)worm.o $(O)worn.o $(O)write.o $(O)zap.o -VOBJ28 = $(O)sfbase.o $(O)sfdata.o -VOBJ29 = $(O)sfstruct.o $(O)sfascii.o $(O)sflendian.o +VOBJ28 = $(O)sfstruct.o LUAOBJ = $(O)nhlua.o $(O)nhlsel.o LUA_QTEXT_FILE = "quest.lua" @@ -1604,92 +1603,12 @@ $(O)ttystub.o: $(HACK_H) $(MSWSYS)\stubs.c # #============================================ -# fieldlevel save dependencies +# save dependencies #============================================ -$(O)sfbase.o: $(HACK_H) $(INCL)\sfproto.h $(INCL)\sfprocs.h \ - $(SRC)\sfbase.c -# @$(cc) $(cflagsBuild) -Fo$@ $(SRC)\sfbase.c - -$(O)sfdata.o: $(HACK_H) $(INCL)\sfprocs.h $(SRC)\sfdata.c -# @$(cc) $(cflagsBuild) -Fo$@ $(SRC)\sfdata.c - $(O)sfstruct.o: $(HACK_H) $(SRC)\sfstruct.c # @$(cc) $(cflagsBuild) -Fo$@ $(SRC)\sfstruct.c -$(O)sfascii.o: $(HACK_H) $(INCL)\sfprocs.h $(SRC)\sfascii.c -# @$(cc) $(cflagsBuild) -Fo$@ $(SRC)\sfascii.c - -$(O)sflendian.o: $(HACK_H) $(INCL)\sfprocs.h $(SRC)\sflendian.c -# @$(cc) $(cflagsBuild) -Fo$@ $(SRC)\sflendian.c - -$(SRC)\sfdata.c: $(U)readtags.exe $(U)nethack.tags - $(U)readtags.exe - -$(INCL)\sfproto.h: $(U)readtags.exe $(U)nethack.tags - $(U)readtags.exe - -$(U)readtags.exe: $(O)readtags$(HOST).o - @$(link) $(lflagsBuild) -out:$@ $(O)readtags$(HOST).o - -$(O)readtags$(HOST).o: $(U)readtags.c $(U)nethack.tags $(CONFIG_H) $(PATCHLEVEL_H) - @$(cc) $(cflagsBuild) $(CROSSCOMPILE) $(CROSSCOMPILE_HOST) $(TEMPL) -Fo$@ $(U)readtags.c - -# -#tested only with exuberant ctags from http://ctags.sourceforge.net -# -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\lev.h ..\include\mextra.h \ - ..\include\mkroom.h ..\include\monst.h ..\include\monsym.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 - -$(U)nethack.tags: $(CTAGDEP) - $(CTAGSCMD) $(CTAGSOPT) -f $(U)nethack.tags $(TINC)/align.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/artifact.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TSRC)/artifact.c - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/artilist.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/attrib.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TSRC)/bones.c - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/context.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/coord.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/decl.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TSRC)/decl.c - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/dungeon.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/engrave.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TSRC)/engrave.c - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/flag.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/func_tab.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/global.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/hack.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/lev.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/mextra.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/mkroom.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/monst.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/monsym.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/obj.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/objclass.h -# $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/permonst.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/prop.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/quest.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/rect.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/region.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/rm.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/skills.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/spell.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/sys.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/timeout.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/trap.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/you.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/onames.h - $(CTAGSCMD) $(CTAGSOPT) -a -f $(U)nethack.tags $(TINC)/wintype.h - # # util dependencies # These have dual-roles and need to be build for host and targt platforms. diff --git a/util/readtags.c b/util/readtags.c deleted file mode 100644 index d74298303..000000000 --- a/util/readtags.c +++ /dev/null @@ -1,1677 +0,0 @@ -/* NetHack 3.6 readtags.c $Date$ $Revision$ */ -/* Copyright (c) Michael Allison, 2018 */ -/* NetHack may be freely redistributed. See license for details. */ - -/* - * Read the given ctags file and generate: - * Intermediate temp files: - * include/sfo_proto.tmp - * include/sfi_proto.tmp - * src/sfi_data.tmp - * src/sfo_data.tmp - * Final files: - * sfdata.c - * sfproto.h - * - */ - -#include "hack.h" -#include "lev.h" -#include "integer.h" -#include "wintype.h" -#include -#include -#include - -#ifdef __GNUC__ -#define strncmpi strncasecmp -#endif - -/* version information */ -#ifdef SHORT_FILENAMES -#include "patchlev.h" -#else -#include "patchlevel.h" -#endif - -#define NHTYPE_SIMPLE 1 -#define NHTYPE_COMPLEX 2 -struct nhdatatypes_t { - unsigned int dtclass; - char *dtype; - size_t dtsize; -}; - -struct tagstruct { - int linenum; - char ptr[128]; - char tag[100]; - char filename[128]; - char searchtext[255]; - char tagtype; - char parent[100]; - char parenttype[100]; - char arraysize1[100]; - char arraysize2[100]; - struct tagstruct *next; -}; - -struct needs_array_handling { - const char *nm; - const char *parent; -}; - -#define SFO_DATA c_sfodata -#define SFI_DATA c_sfidata -#define SFDATATMP c_sfdatatmp -#define SFO_PROTO c_sfoproto -#define SFI_PROTO c_sfiproto -#define SFDATA c_sfdata -#define SFPROTO c_sfproto -#define SFPROTO_NAME "../include/sfproto.h" -#define SFDATA_NAME "../src/sfdata.c" - -static char *fgetline(FILE*); -static void quit(void); -static void out_of_memory(void); -static void doline(char *); -static void chain(struct tagstruct *); -#if 0 -static void showthem(void); -static char *stripspecial(char *); -#endif -static char *deblank(char *); -static char *deeol(char *); -static void generate_c_files(); -static char *findtype(char *, char *); -#if 0 -static boolean FDECL(is_prim, (char *)); -#endif -static void taglineparse(char *, struct tagstruct *); -static void parseExtensionFields(struct tagstruct *, char *); -static void set_member_array_size(struct tagstruct *); -#if 0 -static char *member_array_dims(struct tagstruct *, char *); -static char *member_array_size(struct tagstruct *, char *); -#endif -static void output_types(FILE *); -#if 0 -static char *FDECL(dtmacro,(const char *,int)); -#endif -static char *FDECL(dtfn,(const char *,int, boolean *)); -static char *FDECL(bfsize,(const char *)); -static char *FDECL(fieldfix,(char *,char *)); - -#ifdef VMS -static FILE *vms_fopen(name, mode) const char *name, *mode; -{ - return fopen(name, mode, "mbc=64", "shr=nil"); -} -# define fopen(f,m) vms_fopen(f,m) -#endif - -#define Fprintf (void) fprintf -#ifndef __GO32__ -#define DEFAULTTAGNAME "../util/nethack.tags" -#else -#define DEFAULTTAGNAME "../util/nhtags.tag" -#endif -#ifndef _MAX_PATH -#define _MAX_PATH 120 -#endif - -#define TAB '\t' -#define SPACE ' ' - -struct tagstruct *first; -struct tagstruct zerotag; - -static int tagcount; -static const char *infilenm; -static FILE *infile; -static char line[255]; -static long lineno; -static char ssdef[BUFSZ]; -static char fieldfixbuf[BUFSZ]; - -#define NHTYPE_SIMPLE 1 -#define NHTYPE_COMPLEX 2 - -struct nhdatatypes_t readtagstypes[] = { - {NHTYPE_SIMPLE, (char *) "any", sizeof(anything)}, - {NHTYPE_SIMPLE, (char *) "genericptr_t", sizeof(genericptr_t)}, - {NHTYPE_SIMPLE, (char *) "aligntyp", sizeof(aligntyp)}, - {NHTYPE_SIMPLE, (char *) "Bitfield", sizeof(uint8_t)}, - {NHTYPE_SIMPLE, (char *) "boolean", sizeof(boolean)}, - {NHTYPE_SIMPLE, (char *) "char", sizeof(char)}, - {NHTYPE_SIMPLE, (char *) "int", sizeof(int)}, - {NHTYPE_SIMPLE, (char *) "long", sizeof(long)}, - {NHTYPE_SIMPLE, (char *) "schar", sizeof(schar)}, - {NHTYPE_SIMPLE, (char *) "short", sizeof(short)}, - {NHTYPE_SIMPLE, (char *) "size_t", sizeof(size_t)}, - {NHTYPE_SIMPLE, (char *) "string", 1}, - {NHTYPE_SIMPLE, (char *) "time_t", sizeof(time_t)}, - {NHTYPE_SIMPLE, (char *) "uchar", sizeof(uchar)}, - {NHTYPE_SIMPLE, (char *) "unsigned char", sizeof(unsigned char)}, - {NHTYPE_SIMPLE, (char *) "unsigned int", sizeof(unsigned int)}, - {NHTYPE_SIMPLE, (char *) "unsigned long", sizeof(unsigned long)}, - {NHTYPE_SIMPLE, (char *) "unsigned short", sizeof(unsigned short)}, - {NHTYPE_SIMPLE, (char *) "unsigned", sizeof(unsigned)}, - {NHTYPE_SIMPLE, (char *) "xchar", sizeof(xchar)}, - {NHTYPE_COMPLEX, (char *) "align", sizeof(struct align)}, -/* {NHTYPE_COMPLEX, (char *) "attack", sizeof(struct attack)}, */ /* permonst affil */ - {NHTYPE_COMPLEX, (char *) "attribs", sizeof(struct attribs)}, - {NHTYPE_COMPLEX, (char *) "bill_x", sizeof(struct bill_x)}, - {NHTYPE_COMPLEX, (char *) "book_info", sizeof(struct book_info)}, - {NHTYPE_COMPLEX, (char *) "branch", sizeof(struct branch)}, - {NHTYPE_COMPLEX, (char *) "bubble", sizeof(struct bubble)}, - {NHTYPE_COMPLEX, (char *) "cemetery", sizeof(struct cemetery)}, -/* {NHTYPE_COMPLEX, (char *) "container", sizeof(struct container)}, */ - {NHTYPE_COMPLEX, (char *) "context_info", sizeof(struct context_info)}, - {NHTYPE_COMPLEX, (char *) "d_flags", sizeof(struct d_flags)}, - {NHTYPE_COMPLEX, (char *) "d_level", sizeof(struct d_level)}, - {NHTYPE_COMPLEX, (char *) "damage", sizeof(struct damage)}, - {NHTYPE_COMPLEX, (char *) "dest_area", sizeof(struct dest_area)}, - {NHTYPE_COMPLEX, (char *) "dgn_topology", sizeof(struct dgn_topology)}, - {NHTYPE_COMPLEX, (char *) "dig_info", sizeof(struct dig_info)}, - {NHTYPE_COMPLEX, (char *) "dungeon", sizeof(struct dungeon)}, - {NHTYPE_COMPLEX, (char *) "edog", sizeof(struct edog)}, - {NHTYPE_COMPLEX, (char *) "egd", sizeof(struct egd)}, - {NHTYPE_COMPLEX, (char *) "emin", sizeof(struct emin)}, - {NHTYPE_COMPLEX, (char *) "engr", sizeof(struct engr)}, - {NHTYPE_COMPLEX, (char *) "epri", sizeof(struct epri)}, - {NHTYPE_COMPLEX, (char *) "eshk", sizeof(struct eshk)}, - {NHTYPE_COMPLEX, (char *) "fakecorridor", sizeof(struct fakecorridor)}, - {NHTYPE_COMPLEX, (char *) "fe", sizeof(struct fe)}, - {NHTYPE_COMPLEX, (char *) "flag", sizeof(struct flag)}, - {NHTYPE_COMPLEX, (char *) "fruit", sizeof(struct fruit)}, - {NHTYPE_COMPLEX, (char *) "kinfo", sizeof(struct kinfo)}, - {NHTYPE_COMPLEX, (char *) "levelflags", sizeof(struct levelflags)}, - {NHTYPE_COMPLEX, (char *) "linfo", sizeof(struct linfo)}, - {NHTYPE_COMPLEX, (char *) "ls_t", sizeof(struct ls_t)}, - {NHTYPE_COMPLEX, (char *) "mapseen_feat", sizeof(struct mapseen_feat)}, - {NHTYPE_COMPLEX, (char *) "mapseen_flags", sizeof(struct mapseen_flags)}, - {NHTYPE_COMPLEX, (char *) "mapseen_rooms", sizeof(struct mapseen_rooms)}, - {NHTYPE_COMPLEX, (char *) "mapseen", sizeof(struct mapseen)}, - {NHTYPE_COMPLEX, (char *) "mextra", sizeof(struct mextra)}, - {NHTYPE_COMPLEX, (char *) "mkroom", sizeof(struct mkroom)}, - {NHTYPE_COMPLEX, (char *) "monst", sizeof(struct monst)}, - {NHTYPE_COMPLEX, (char *) "mvitals", sizeof(struct mvitals)}, - {NHTYPE_COMPLEX, (char *) "nhcoord", sizeof(struct nhcoord)}, - {NHTYPE_COMPLEX, (char *) "nhrect", sizeof(struct nhrect)}, - {NHTYPE_COMPLEX, (char *) "novel_tracking", sizeof(struct novel_tracking)}, - {NHTYPE_COMPLEX, (char *) "obj", sizeof(struct obj)}, - {NHTYPE_COMPLEX, (char *) "objclass", sizeof(struct objclass)}, - {NHTYPE_COMPLEX, (char *) "obj_split", sizeof(struct obj_split)}, - {NHTYPE_COMPLEX, (char *) "oextra", sizeof(struct oextra)}, -/* {NHTYPE_COMPLEX, (char *) "permonst", sizeof(struct permonst)}, */ - {NHTYPE_COMPLEX, (char *) "polearm_info", sizeof(struct polearm_info)}, - {NHTYPE_COMPLEX, (char *) "prop", sizeof(struct prop)}, - {NHTYPE_COMPLEX, (char *) "q_score", sizeof(struct q_score)}, - {NHTYPE_COMPLEX, (char *) "rm", sizeof(struct rm)}, - {NHTYPE_COMPLEX, (char *) "s_level", sizeof(struct s_level)}, - {NHTYPE_COMPLEX, (char *) "savefile_info", sizeof(struct savefile_info)}, - {NHTYPE_COMPLEX, (char *) "skills", sizeof(struct skills)}, - {NHTYPE_COMPLEX, (char *) "spell", sizeof(struct spell)}, - {NHTYPE_COMPLEX, (char *) "stairway", sizeof(struct stairway)}, -#ifdef SYSFLAGS - {NHTYPE_COMPLEX, (char *) "sysflag", sizeof(struct sysflag)}, -#endif - {NHTYPE_COMPLEX, (char *) "takeoff_info", sizeof(struct takeoff_info)}, - {NHTYPE_COMPLEX, (char *) "tin_info", sizeof(struct tin_info)}, - {NHTYPE_COMPLEX, (char *) "trap", sizeof(struct trap)}, - {NHTYPE_COMPLEX, (char *) "tribute_info", sizeof(struct tribute_info)}, - {NHTYPE_COMPLEX, (char *) "u_achieve", sizeof(struct u_achieve)}, - {NHTYPE_COMPLEX, (char *) "u_conduct", sizeof(struct u_conduct)}, - {NHTYPE_COMPLEX, (char *) "u_event", sizeof(struct u_event)}, - {NHTYPE_COMPLEX, (char *) "u_have", sizeof(struct u_have)}, - {NHTYPE_COMPLEX, (char *) "u_realtime", sizeof(struct u_realtime)}, - {NHTYPE_COMPLEX, (char *) "u_roleplay", sizeof(struct u_roleplay)}, - {NHTYPE_COMPLEX, (char *) "version_info", sizeof(struct version_info)}, - {NHTYPE_COMPLEX, (char *) "victual_info", sizeof(struct victual_info)}, - {NHTYPE_COMPLEX, (char *) "vlaunchinfo", sizeof(union vlaunchinfo)}, - {NHTYPE_COMPLEX, (char *) "vptrs", sizeof(union vptrs)}, - {NHTYPE_COMPLEX, (char *) "warntype_info", sizeof(struct warntype_info)}, - {NHTYPE_COMPLEX, (char *) "you", sizeof(struct you)} -}; - -/* - * These have arrays of other structs, not just arrays of - * simple types. We need to put array handling right into - * the code for these ones. - */ -struct needs_array_handling nah[] = { - {"fakecorr", (char *) "egd"}, - {"bill", "eshk"}, - {"msrooms", "mapseen"}, - {"mtrack", "monst"}, - {"ualignbase", "you"}, - {"weapon_skills", "you"}, -}; - -/* conditional code tags - eecch */ -const char *condtag[] = { -#ifdef SYSFLAGS - "sysflag","altmeta","#ifdef AMIFLUSH", "", - "sysflag","amiflush","","#endif /*AMIFLUSH*/", - "sysflag","numcols", "#ifdef AMII_GRAPHICS", "", - "sysflag","amii_dripens","","", - "sysflag","amii_curmap","","#endif", - "sysflag","fast_map", "#ifdef OPT_DISMAP", "#endif", - "sysflag","asksavedisk","#ifdef MFLOPPY","#endif", - "sysflag","page_wait", "#ifdef MAC", "#endif", -#endif - "linfo","where","#ifdef MFLOPPY","", - "linfo","time","","", - "linfo","size","","#endif /*MFLOPPY*/", - "obj","oinvis","#ifdef INVISIBLE_OBJECTS", "#endif", - (char *)0,(char *)0,(char *)0, (char *)0 -}; - - - -int main(argc, argv) -int argc; -char *argv[]; -{ - tagcount = 0; - - if (argc > 1) infilenm = argv[1]; - if (!infilenm || !*infilenm) infilenm = DEFAULTTAGNAME; - - infile = fopen(infilenm,"r"); - if (!infile) { - printf("%s not found or unavailable\n",infilenm); - quit(); - } - - while (fgets(line, sizeof line, infile)) { - ++lineno; -/* if (lineno == 868) DebugBreak(); */ - doline(line); - } - - fclose(infile); - printf("\nRead in %ld lines and stored %d tags.\n", lineno, tagcount); -#if 0 - showthem(); -#endif - generate_c_files(); - printf("Created %s\n", SFDATA_NAME); - printf("Created %s\n", SFPROTO_NAME); - exit(EXIT_SUCCESS); - /*NOTREACHED*/ - return 0; -} - -static void doline(aline) -char *aline; -{ - char buf[255]; - struct tagstruct *tmptag = malloc(sizeof(struct tagstruct)); - - if (!tmptag) { - out_of_memory(); - } - *tmptag = zerotag; - - if (!aline || (aline && *aline == '!')) { - free(tmptag); - return; - } - - strncpy(buf, deeol(aline), 254); - taglineparse(buf,tmptag); - chain(tmptag); - return; -} - -static void chain(tag) -struct tagstruct *tag; -{ - static struct tagstruct *prev = (struct tagstruct *)0; - if (!first) { - tag->next = (struct tagstruct *)0; - first = tag; - } else { - tag->next = (struct tagstruct *)0; - if (prev) { - prev->next = tag; - } else { - printf("Error - No previous tag at %s\n", tag->tag); - } - } - prev = tag; - ++tagcount; -} -static void quit() -{ - exit(EXIT_FAILURE); -} - -static void out_of_memory() -{ - printf("maketags: out of memory at line %ld of %s\n", - lineno, infilenm); - quit(); -} - -#if 0 -static char empt[] = {0, 0, 0, 0, 0, 0, 0, 0}; -#endif - -#if 0 -static char *member_array_dims(struct tagstruct *tmptag, char *buf) -{ - if (buf && tmptag) { - if (tmptag->arraysize1[0]) - Sprintf(buf, "[%s]", tmptag->arraysize1); - if (tmptag->arraysize2[0]) - Sprintf(eos(buf), "[%s]", tmptag->arraysize2); - return buf; - } - return empt; -} - -static char *member_array_size(struct tagstruct *tmptag, char *buf) -{ - if (buf && tmptag) { - if (tmptag->arraysize1[0]) - strcpy(buf, tmptag->arraysize1); - if (tmptag->arraysize2[0]) - Sprintf(eos(buf), " * %s", tmptag->arraysize2); - return buf; - } - return empt; -} -#endif - -void set_member_array_size(struct tagstruct *tmptag) -{ - char buf[BUFSZ]; - /* static char result[49]; */ - char *arr1 = (char *)0, *arr2 = (char *)0, *tmp; - int cnt = 0; - - if (!tmptag) return; - strcpy(buf, tmptag->searchtext); - - tmptag->arraysize1[0] = '\0'; - tmptag->arraysize2[0] = '\0'; - - /* find left-open square bracket */ - tmp = strchr(buf, '['); - if (tmp) { - arr1 = tmp; - *tmp = '\0'; - --tmp; - /* backup and make sure the [] are on the right tag */ - while (!(*tmp == SPACE || *tmp == TAB || *tmp ==',' || cnt > 50)) { - --tmp; - cnt++; - } - if (cnt > 50) return; - tmp++; - if (strcmp(tmp, tmptag->tag) == 0) { - ++arr1; - tmp = strchr(arr1, ']'); - if (tmp) { - arr2 = tmp; - ++arr2; - *tmp = '\0'; - if (*arr2 == '[') { /* two-dimensional array */ - ++arr2; - tmp = strchr(arr2, ']'); - if (tmp) *tmp = '\0'; - } else { - arr2 = (char *)0; - } - } - } else { - arr1 = (char *)0; - } - } - if (arr1) (void)strcpy(tmptag->arraysize1, arr1); - if (arr2) (void)strcpy(tmptag->arraysize2, arr2); -} - -static void parseExtensionFields (tmptag, buf) -struct tagstruct *tmptag; -char *buf; -{ - char *p = buf; - while (p != (char *)0 && *p != '\0') { - while (*p == TAB) - *p++ = '\0'; - if (*p != '\0') { - char *colon; - char *field = p; - - p = strchr (p, TAB); - if (p != (char *)0) - *p++ = '\0'; - colon = strchr (field, ':'); - if (colon == (char *)0) { - tmptag->tagtype = *field; - } else { - const char *key = field; - const char *value = colon + 1; - *colon = '\0'; - if ((strcmp (key, "struct") == 0) || - (strcmp (key, "union") == 0)) { - colon = strstr(value,"::"); - if (colon) - value = colon +2; - strcpy(tmptag->parenttype, key); - strcpy(tmptag->parent, value); - } - } - } - } -} - -void -taglineparse(p,tmptag) -char *p; -struct tagstruct *tmptag; -{ - int fieldsPresent = 0; - char *filenm = 0, *pattern = 0, *tmp1 = 0; - int linenumber = 0; - char *tab = strchr (p, TAB); - - if (tab != NULL) { - *tab = '\0'; - strcpy(tmptag->tag,p); - p = tab + 1; - filenm = p; - tab = strchr (p, TAB); - if (tab != NULL) { - *tab = '\0'; - p = tab + 1; - if (*p == '/' || *p == '?') { - /* parse pattern */ - int delimiter = *(unsigned char *) p; - linenumber = 0; - pattern = p; - do { - p = strchr (p + 1, delimiter); - } while (p != (char *)0 && *(p - 1) == '\\'); - - if (p == (char *)0) { - /* invalid pattern */ - } else - ++p; - } else if (isdigit ((int) *(unsigned char *) p)) { - /* parse line number */ - pattern = p; - linenumber = atol(p); - while (isdigit((int) *(unsigned char *) p)) - ++p; - } else { - /* invalid pattern */ - } - fieldsPresent = (strncmp (p, ";\"", 2) == 0); - *p = '\0'; - - if (fieldsPresent) - parseExtensionFields (tmptag, p + 2); - } - } - - strcpy(tmptag->searchtext, pattern); - tmptag->linenum = linenumber; - - /* add the array dimensions */ - set_member_array_size(tmptag); - - /* determine if this is a pointer and mark it as such */ - if (tmptag->searchtext[0] && - (tmptag->tagtype == 'm' || tmptag->tagtype == 's')) { - char ptrbuf[BUFSZ], searchbuf[BUFSZ]; - - (void) strcpy(ptrbuf, tmptag->searchtext); - Sprintf(searchbuf,"*%s", tmptag->tag); - tmp1 = strstr(ptrbuf, searchbuf); - if (!tmp1) { - Sprintf(searchbuf,"* %s", tmptag->tag); - tmp1 = strstr(ptrbuf, searchbuf); - } - if (tmp1) { - while ((tmp1 > ptrbuf) && (*tmp1 != SPACE) && - (*tmp1 != TAB) && (*tmp1 != ',')) - tmp1--; - tmp1++; - while (*tmp1 == '*') - tmp1++; - *tmp1 = '\0'; - /* now find the first * before this in case multiple things - are declared on this line */ - tmp1 = strchr(ptrbuf+2, '*'); - if (tmp1) { - tmp1++; - *tmp1 = '\0'; - tmp1 = ptrbuf + 2; - while (*tmp1 == SPACE || *tmp1 == TAB || *tmp1 == ',') - ++tmp1; - (void)strcpy(tmptag->ptr, tmp1); - } - } - } -} - -/* eos() is copied from hacklib.c */ -/* return the end of a string (pointing at '\0') */ -char * -eos(s) -char *s; -{ - while (*s) s++; /* s += strlen(s); */ - return s; -} - -static char stripbuf[255]; - -#if 0 -static char *stripspecial(char *st) -{ - char *out = stripbuf; - *out = '\0'; - if (!st) return st; - while(*st) { - if (*st >= SPACE) - *out++ = *st++; - else - st++; - } - *out = '\0'; - return stripbuf; -} -#endif - -static char *deblank(char *st) -{ - char *out = stripbuf; - *out = '\0'; - if (!st) return st; - while(*st) { - if (*st == SPACE) { - *out++ = '_'; - st++; - } else - *out++ = *st++; - } - *out = '\0'; - return stripbuf; -} - -static char *deeol(char *st) -{ - char *out = stripbuf; - *out = '\0'; - if (!st) return st; - while(*st) { - if ((*st == '\r') || (*st == '\n')) { - st++; - } else - *out++ = *st++; - } - *out = '\0'; - return stripbuf; -} - -#if 0 -static void showthem() -{ - char buf[BUFSZ], *tmp; - struct tagstruct *t = first; - while(t) { - printf("%-28s %c, %-16s %-10s", t->tag, t->tagtype, - t->parent, t->parenttype); -#if 0 - t->parent[0] ? t->searchtext : ""); -#endif - buf[0] = '\0'; - tmp = member_array_dims(t,buf); - if (tmp) printf("%s", tmp); - printf("%s","\n"); - t = t->next; - } -} -#endif - -#if 0 -static boolean -is_prim(sdt) -char *sdt; -{ - int k = 0; - if (sdt) { - /* special case where we don't match entire thing */ - if (!strncmpi(sdt, "Bitfield",8)) - return TRUE; - for (k = 0; k < SIZE(readtagstypes); ++k) { - if (!strcmpi(readtagstypes[k].dtype, sdt)) { - if (readtagstypes[k].dtclass == NHTYPE_SIMPLE) - return TRUE; - else - return FALSE; - } - } - } - return FALSE; -} -#endif - -char * -findtype(st, tag) -char *st; -char *tag; -{ - static char ftbuf[512]; - static char prevbuf[512]; - char *tmp1, *tmp2, *tmp3, *tmp4; - const char *r; - - if (!st) return (char *)0; - if (st[0] == '/' && st[1] == '^') { - tmp2 = tmp3 = tmp4 = (char *)0; - tmp1 = &st[3]; - while (*tmp1) { - if (isspace(*tmp1)) - ; /* skip it */ - else - break; - ++tmp1; - } - if (!strncmp(tmp1, tag, strlen(tag))) { - if(strlen(tag) == 1) { - char *sc = tmp1; - /* Kludge: single char match is too iffy, - check to make sure its a complete - token that we're comparing to. */ - ++sc; - if (!(*sc == '_' || (*sc > 'a' && *sc < 'z') || - (*sc > 'A' && *sc < 'Z') || (*sc > '0' && *sc < '9'))) - return (char *)0; - } else { - return (char *)0; - } - } - if (*tmp1) { - if (!strncmp(tmp1, "Bitfield", 8)) { - strcpy(ftbuf, tmp1); - tmp1 = ftbuf; - tmp3 = strchr(tmp1, ')'); - if (tmp3) { - tmp3++; - *tmp3 = '\0'; - return ftbuf; - } - return (char *)0; - } - } - if (*tmp1) { - int prevchar = 0; - strcpy(ftbuf, tmp1); - tmp1 = ftbuf; - /* find space separating first word with second */ - while (!isspace(*tmp1)) { - prevchar = *tmp1; - ++tmp1; - } - - /* some oddball cases */ - if (prevchar == ',' || prevchar == ';') { - tmp3 = strchr(ftbuf, ','); - tmp2 = strstr(ftbuf, tag); - return prevbuf; - } else { - /* a comma means that more than one thing declared on ine */ - tmp3 = strchr(tmp1, ','); - tmp2 = strstr(tmp1, tag); - } - /* make sure we're matching a complete token */ - if (tmp2) { - tmp4 = tmp2 + strlen(tag); - if ((*tmp4 == '_') || (*tmp4 >= 'a' && *tmp4 <= 'z') || - (*tmp4 >= 'A' && *tmp4 <= 'Z') || (*tmp4 >= '0' && *tmp4 <= '9')) - /* jump to next occurence then */ - tmp2 = strstr(tmp4, tag); - } - /* tag w/o comma OR tag found w comma and tag before comma */ - if ((tmp2 && !tmp3) || ((tmp2 && tmp3) && (tmp2 < tmp3))) { - *tmp2 = '\0'; - --tmp2; - while (isspace(*tmp2)) - --tmp2; - tmp2++; - *tmp2 = '\0'; - } - /* comma and no tag OR tag w comma and comma before tag */ - else if ((tmp3 && !tmp2) || ((tmp2 && tmp3) && (tmp3 < tmp2))) { - --tmp3; - if (isspace(*tmp3)) { - while (isspace(*tmp3)) - --tmp3; - } - while (!isspace(*tmp3) && (*tmp3 != '*')) - --tmp3; - while (isspace(*tmp3)) - --tmp3; - tmp3++; - *tmp3 = '\0'; - } - /* comma or semicolon immediately following tag */ - else { - volatile int y; - y = 1; - } - if (strncmpi(ftbuf, "struct ", 7) == 0) - r = (const char *) (ftbuf + 7); - else if (strncmpi(ftbuf, "union ", 6) == 0) - r = (const char *) (ftbuf + 6); - /* a couple of kludges follow unfortunately */ - else if (strncmpi(ftbuf, "coord", 5) == 0) - r = "nhcoord"; - else if (strncmpi(ftbuf, "anything", 8) == 0) - r = "any"; - else if (strncmpi(ftbuf, "const char", 10) == 0) - r = "char"; - else - r = (const char *) ftbuf; - strcpy(prevbuf, r); - return prevbuf; - } - } - prevbuf[0] = '\0'; - return (char *)0; -} - -boolean -listed(t) -struct tagstruct *t; -{ - int k; - - if ((strncmpi(t->tag, "Bitfield", 8) == 0) || - (strcmpi(t->tag, "string") == 0)) - return TRUE; - for (k = 0; k < SIZE(readtagstypes); ++k) { - /* This needs to be case-sensitive to avoid generating collision - * between 'align' and 'Align'. - */ - if (strcmp(readtagstypes[k].dtype, t->tag) == 0) - return TRUE; - } - return FALSE; -} - -/* TIME_type: type of the argument to time(); we actually use &(time_t) */ -#if defined(BSD) && !defined(POSIX_TYPES) -#define TIME_type long * -#else -#define TIME_type time_t * -#endif -/* LOCALTIME_type: type of the argument to localtime() */ -#if (defined(ULTRIX) && !(defined(ULTRIX_PROTO) || defined(NHSTDC))) \ - || (defined(BSD) && !defined(POSIX_TYPES)) -#define LOCALTIME_type long * -#else -#define LOCALTIME_type time_t * -#endif - -const char *preamble[] = { - "/* Copyright (c) NetHack Development Team %d. */\n", - "/* NetHack may be freely redistributed. See license for details. */\n\n", - "/* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE! */\n\n", - "#include \"hack.h\"\n", - "#include \"artifact.h\"\n", - "#include \"func_tab.h\"\n", - "#include \"lev.h\"\n", - "#include \"integer.h\"\n", - "#include \"wintype.h\"\n", - (char *)0 -}; -char crbuf[BUFSZ]; - -static const char *get_preamble(n) -int n; -{ - const char *r = preamble[n]; - - if (!n) { - time_t datetime = 0; - struct tm *lt; - - (void) time((TIME_type) &datetime); - lt = localtime((LOCALTIME_type) &datetime); - Sprintf(crbuf, preamble[0], (1900 + lt->tm_year)); - r = crbuf; - } - return r; -} - -static void output_types(fp1) -FILE *fp1; -{ - int k, cnt /*, hcnt = 1 */; - struct tagstruct *t = first; - - Fprintf(fp1, "%s", - "struct nhdatatypes_t nhdatatypes[] = {\n"); - - for (k = 0; k < SIZE(readtagstypes); ++k) { - if (readtagstypes[k].dtclass == NHTYPE_SIMPLE) { - Fprintf(fp1,"\t{NHTYPE_SIMPLE, (char *) \"%s\", sizeof(%s)},\n", - readtagstypes[k].dtype, - (strncmpi(readtagstypes[k].dtype, "Bitfield", 8) == 0) ? - "uint8_t" : - (strcmpi(readtagstypes[k].dtype, "string") == 0) ? - "uchar" : - (strcmpi(readtagstypes[k].dtype, "any") == 0) ? - "anything" : readtagstypes[k].dtype); -/* dtmacro(readtagstypes[k].dtype,0)); */ -#if 0 - Fprintf(fp2, "#define %s\t%s%d\n", dtmacro(readtagstypes[k].dtype,1), - (strlen(readtagstypes[k].dtype) > 12) ? "" : - (strlen(readtagstypes[k].dtype) < 5) ? "\t\t" : - "\t", hcnt++); -#endif - } - } - cnt = 0; - while(t) { - if (listed(t) && ((t->tagtype == 's') || (t->tagtype == 'u'))) { - if (!strcmp(t->tag, "any")) { - t = t->next; - continue; - } - if (cnt > 0) - Fprintf(fp1, "%s", ",\n"); - Fprintf(fp1, "\t{NHTYPE_COMPLEX, (char *) \"%s\", sizeof(%s %s)}", - t->tag, - (t->tagtype == 's') ? "struct" : "union", t->tag); - cnt += 1; - } - t = t->next; - } - Fprintf(fp1, "%s", "\n};\n\n"); - Fprintf(fp1, "int nhdatatypes_size()\n{\n\treturn SIZE(nhdatatypes);\n}\n\n"); -} - -static void generate_c_files() -{ - struct tagstruct *t = first; -#ifdef KR1ED - long clocktim = 0; -#else - time_t clocktim = 0; -#endif - char *c, cbuf[60], sfparent[BUFSZ], *substruct, *gline; - FILE *SFO_DATA, *SFI_DATA, *SFDATATMP, *SFO_PROTO, *SFI_PROTO, - *SFDATA, *SFPROTO; - int k = 0, j, opening /*, closetag = 0 */; - const char *pt; - char *ft, *layout, *last_ft = (char *)0; - int okeydokey, x, a; - boolean did_i; - - SFDATA = fopen(SFDATA_NAME, "w"); - if (!SFDATA) return; - - SFPROTO = fopen(SFPROTO_NAME, "w"); - if (!SFPROTO) return; - - SFO_DATA = fopen("../src/sfo_data.tmp", "w"); - if (!SFO_DATA) return; - - SFO_PROTO = fopen("../include/sfo_proto.tmp", "w"); - if (!SFO_PROTO) return; - - SFI_PROTO = fopen("../include/sfi_proto.tmp", "w"); - if (!SFI_PROTO) return; - - SFI_DATA = fopen("../src/sfi_data.tmp", "w"); - if (!SFI_DATA) return; - - SFDATATMP = fopen("../src/sfdata.tmp", "w"); - if (!SFDATATMP) return; - - (void) time(&clocktim); - Strcpy(cbuf, ctime(&clocktim)); - - for (c = cbuf; *c; c++) - if (*c == '\n') - break; - *c = '\0'; /* strip off the '\n' */ - - /* begin sfproto.h */ - Fprintf(SFPROTO,"/* NetHack %d.%d sfproto.h */\n", - VERSION_MAJOR, VERSION_MINOR); - for (j = 0; j < 3; ++j) - Fprintf(SFPROTO, "%s", get_preamble(j)); - Fprintf(SFPROTO, "#ifndef SFPROTO_H\n#define SFPROTO_H\n\n"); - Fprintf(SFPROTO, "#include \"hack.h\"\n#include \"integer.h\"\n#include \"wintype.h\"\n\n" - "#define E extern\n\n"); - - /* sfbase.c function prototypes */ - Fprintf(SFPROTO,"%s\n", "E int NDECL(critical_members_count);"); - Fprintf(SFPROTO,"/* sfbase.c output functions */\n"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfo_addinfo, (NHFILE *, const char *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfo_aligntyp, (NHFILE *, aligntyp *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfo_any, (NHFILE *, anything *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfo_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfo_boolean, (NHFILE *, boolean *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfo_char, (NHFILE *, const char *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfo_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfo_int, (NHFILE *, int *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfo_long, (NHFILE *, long *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfo_schar, (NHFILE *, schar *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfo_short, (NHFILE *, short *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfo_size_t, (NHFILE *, size_t *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfo_time_t, (NHFILE *, time_t *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfo_uchar, (NHFILE *, uchar *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfo_unsigned, (NHFILE *, unsigned *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfo_uchar, (NHFILE *, unsigned char *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfo_uint, (NHFILE *, unsigned int *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfo_ulong, (NHFILE *, unsigned long *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfo_ushort, (NHFILE *, unsigned short *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfo_xchar, (NHFILE *, xchar *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfo_str, (NHFILE *, const char *, const char *, const char *, int));"); - Fprintf(SFPROTO,"/* sfbase.c input functions */\n"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfi_addinfo, (NHFILE *, const char *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfi_aligntyp, (NHFILE *, aligntyp *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfi_any, (NHFILE *, anything *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfi_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfi_boolean, (NHFILE *, boolean *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfi_char, (NHFILE *, const char *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfi_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfi_int, (NHFILE *, int *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfi_long, (NHFILE *, long *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfi_schar, (NHFILE *, schar *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfi_short, (NHFILE *, short *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfi_size_t, (NHFILE *, size_t *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfi_time_t, (NHFILE *, time_t *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfi_uchar, (NHFILE *, uchar *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfi_unsigned, (NHFILE *, unsigned *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfi_uchar, (NHFILE *, unsigned char *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfi_uint, (NHFILE *, unsigned int *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfi_ulong, (NHFILE *, unsigned long *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfi_ushort, (NHFILE *, unsigned short *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfi_xchar, (NHFILE *, xchar *, const char *, const char *, int));"); - Fprintf(SFPROTO,"%s\n", "E void FDECL(sfi_str, (NHFILE *, const char *, const char *, const char *, int));"); - Fprintf(SFO_PROTO, "/* generated output functions */\n"); - Fprintf(SFI_PROTO, "/* generated input functions */\n"); - - /* begin sfdata.c */ - Fprintf(SFDATA,"/* NetHack %d.%d sfdata.c */\n", - VERSION_MAJOR, VERSION_MINOR); - for (j = 0; preamble[j]; ++j) - Fprintf(SFDATA, "%s", get_preamble(j)); - Fprintf(SFDATA, "#include \"sfproto.h\"\n\n"); - Fprintf(SFDATA, "#define NHTYPE_SIMPLE 1\n"); - Fprintf(SFDATA, "#define NHTYPE_COMPLEX 2\n"); - Fprintf(SFDATA, "struct nhdatatypes_t {\n"); - Fprintf(SFDATA, " unsigned int dtclass;\n"); - Fprintf(SFDATA, " char *dtype;\n"); - Fprintf(SFDATA, " size_t dtsize;\n};\n\n"); - Fprintf(SFDATA,"static uint8_t bitfield = 0;\n"); - - output_types(SFDATATMP); - Fprintf(SFDATATMP,"const char *critical_members[] = {\n"); - - k = 0; - opening = 1; - did_i = FALSE; - while(k < SIZE(readtagstypes)) { - boolean insert_const = FALSE; - - if (readtagstypes[k].dtclass == NHTYPE_COMPLEX) { - - if (!strncmpi(readtagstypes[k].dtype,"Bitfield",8)) { - Fprintf(SFO_DATA, - "\nvoid\nsfo_bitfield(nhfp, d_bitfield, myparent, myname, cnt)\n" - "NHFILE *nhfp;\n" - "uint8_t *d_bitfield;\n" - "const char *myparent;\n" - "const char *myname;\n" - "int cnt;\n" - "{\n"); - - Fprintf(SFI_DATA, - "\nvoid\nsfi_bitfield(nhfp, d_bitfield, myparent, myname, cnt)\n" - "NHFILE *nhfp;\n" - "uint8_t *d_bitfield;\n" - "const char *myparent;\n" - "const char *myname;\n" - "int cnt;\n" - "{\n"); - } - -#if 0 - if (!strncmpi(readtagstypes[k].dtype,"version_info",8)) - insert_const = TRUE; -#endif - - pt = (const char *) 0; - layout = (char *) 0; - t = first; - while(t) { - if (t->tagtype == 'u' && !strcmp(t->tag, readtagstypes[k].dtype)) { - pt = "union"; - break; - } - t = t->next; - } - - if (!pt) { - pt = "struct"; - } - Fprintf(SFO_PROTO, - "E void FDECL(sfo_%s, (NHFILE *, %s%s %s *, const char *, const char *, int));\n", - readtagstypes[k].dtype, - insert_const ? "const " : "", - pt, readtagstypes[k].dtype); - - Fprintf(SFO_DATA, - "\nvoid\nsfo_%s(nhfp, d_%s, myparent, myname, cnt)\n" - "NHFILE *nhfp;\n" - "%s%s %s *d_%s;\n" - "const char *myparent;\n" - "const char *myname;\n" - "int cnt;\n" - "{\n", - readtagstypes[k].dtype, - deblank(readtagstypes[k].dtype), - insert_const ? "const " : "", - pt, readtagstypes[k].dtype, - deblank(readtagstypes[k].dtype)); - - Fprintf(SFO_DATA, - " const char *parent = \"%s\";\n", - readtagstypes[k].dtype); - - Fprintf(SFI_PROTO, - "E void FDECL(sfi_%s, (NHFILE *, %s%s %s *, const char *, const char *, int));\n", - readtagstypes[k].dtype, - insert_const ? "const " : "", - pt, readtagstypes[k].dtype); - - Fprintf(SFI_DATA, - "\nvoid\nsfi_%s(nhfp, d_%s, myparent, myname, cnt)\n" - "NHFILE *nhfp;\n" - "%s%s %s *d_%s;\n" - "const char *myparent;\n" - "const char *myname;\n" - "int cnt;\n" - "{\n", - readtagstypes[k].dtype, - deblank(readtagstypes[k].dtype), - insert_const ? "const " : "", - pt, readtagstypes[k].dtype, - deblank(readtagstypes[k].dtype)); - - Fprintf(SFI_DATA, - " const char *parent = \"%s\";\n", - readtagstypes[k].dtype); - - Sprintf(sfparent, "%s %s", pt, readtagstypes[k].dtype); - - for (a = 0; a < SIZE(nah); ++a) { - if (!strcmp(nah[a].parent, readtagstypes[k].dtype)) { - if (!did_i) { - Fprintf(SFO_DATA, " int i;\n"); - Fprintf(SFI_DATA, " int i;\n"); - did_i = TRUE; - } - } - } - - Fprintf(SFO_DATA, "\n"); - Fprintf(SFI_DATA, "\n"); - - Fprintf(SFO_DATA, " nhUse(myname);\n nhUse(cnt);\n"); - Fprintf(SFO_DATA, - " if (nhfp->addinfo)\n" - " sfo_addinfo(nhfp, myparent, \"start\", \"%s\", 1);\n", - readtagstypes[k].dtype); - - Fprintf(SFI_DATA, " nhUse(myname);\n nhUse(cnt);\n"); - Fprintf(SFI_DATA, - " if (nhfp->addinfo)\n" - " sfi_addinfo(nhfp, myparent, \"start\", \"%s\", 1);\n", - readtagstypes[k].dtype); - - Fprintf(SFO_DATA, "\n"); - Fprintf(SFI_DATA, "\n"); - - /******************************************************** - * cycle through all the tags and find every tag with * - * a parent matching readtagstypes[k].dtype * - ********************************************************/ - - t = first; - - while(t) { - x = 0; - okeydokey = 0; - - if (t->tagtype == 's') { - char *ss = strstr(t->searchtext,"{$/"); - - if (ss) { - strcpy(ssdef, t->tag); - } - t = t->next; - continue; - } - - /************insert opening conditional if needed ********/ - while(condtag[x]) { - if (!strcmp(condtag[x],readtagstypes[k].dtype) && - !strcmp(condtag[x+1],t->tag)) { - okeydokey = 1; - break; - } - x = x + 4; - } - - /* some structs are entirely defined within another struct declaration. - * Legal, but unfortunate for us here. - */ - substruct = strstr(t->parent, "::"); - if (substruct) { - substruct += 2; - } - - if ((strcmp(readtagstypes[k].dtype, t->parent) == 0) || - (substruct && strcmp(readtagstypes[k].dtype, substruct) == 0)) { - ft = (char *)0; - if (t->ptr[0]) - ft = &t->ptr[0]; - else - ft = findtype(t->searchtext, t->tag); - if (ft) { - last_ft = ft; - if (okeydokey && condtag[x+2] && strlen(condtag[x+2]) > 0) { - Fprintf(SFO_DATA,"%s\n", condtag[x+2]); - Fprintf(SFI_DATA,"%s\n", condtag[x+2]); - Fprintf(SFDATATMP,"%s\n", condtag[x+2]); - } - } else { - /* use the last found one as last resort then */ - ft = last_ft; - } - - /***************** Bitfield *******************/ - if (!strncmpi(ft, "Bitfield", 8)) { - char lbuf[BUFSZ]; - int j2, z; - - Sprintf(lbuf, - " " - "bitfield = d_%s->%s;", - readtagstypes[k].dtype, t->tag); - z = (int) strlen(lbuf); - for (j2 = 0; j2 < (65 - z); ++j2) - Strcat(lbuf, " "); - Sprintf(eos(lbuf), "/* (%s) */\n", ft); - Fprintf(SFO_DATA, "%s", lbuf); - Fprintf(SFO_DATA, - " " - "sfo_bitfield(nhfp, &bitfield, parent, \"%s\", %s);\n", - t->tag, bfsize(ft)); -#if 0 - Fprintf(SFI_DATA, - " " - "bitfield = 0;\n"); -#else - Fprintf(SFI_DATA, - " " - "bitfield = d_%s->%s; /* set it to current value for testing */\n", - readtagstypes[k].dtype, t->tag); -#endif - Fprintf(SFI_DATA, - " " - "sfi_bitfield(nhfp, &bitfield, parent, \"%s\", %s);\n", - t->tag, bfsize(ft)); - - Fprintf(SFI_DATA, - " " - "d_%s->%s = bitfield;\n\n", - readtagstypes[k].dtype, t->tag); - Fprintf(SFDATATMP, - "\t\"%s:%s:%s\",\n", - sfparent, t->tag, ft); - } else { - /**************** not a bitfield ****************/ - char arrbuf[BUFSZ]; - char lbuf[BUFSZ * 2]; /* sprintf target for others, gcc complaint */ - char fnbuf[BUFSZ]; - char altbuf[BUFSZ]; - boolean isptr = FALSE, kludge_sbrooms = FALSE; - boolean insert_loop = FALSE; - int j2, z; - - /*************** kludge for sbrooms *************/ - if (!strcmp(t->tag, "sbrooms")) { - kludge_sbrooms = TRUE; - (void) strcpy(t->arraysize1,"MAX_SUBROOMS"); - } - - if (t->arraysize2[0]) { - Sprintf(arrbuf, "(%s * %s)", - t->arraysize1, t->arraysize2); - isptr = TRUE; /* suppress the & in function args */ - } else if (t->arraysize1[0]) { - Sprintf(arrbuf, "%s", t->arraysize1); - isptr = TRUE; /* suppress the & in function args */ - } else { - Strcpy(arrbuf, "1"); - } - Strcpy(fnbuf, dtfn(ft,0,&isptr)); - /* - * determine if this is one of the special cases - * where there's an array of structs instead of - * an array of simple types. We need to insert - * a for loop in those cases. - */ - for (a = 0; a < SIZE(nah); ++a) { - if (!strcmp(nah[a].parent, t->parent)) - if (!strcmp(nah[a].nm, t->tag)) - insert_loop = TRUE; - } - - if (isptr && !strcmp(fnbuf, readtagstypes[k].dtype)) { - Strcpy(altbuf, "genericptr"); - } else if (isptr && - (!strcmp(t->ptr, "struct permonst *") || - !strcmp(t->ptr, "struct monst *") || - !strcmp(t->ptr, "struct obj *") || - !strcmp(t->ptr, "struct cemetery *") || - !strcmp(t->ptr, "struct container *") || - !strcmp(t->ptr, "struct mextra *") || - !strcmp(t->ptr, "struct oextra *") || - !strcmp(t->ptr, "struct s_level *") || - !strcmp(t->ptr, "struct bill_x *") || - !strcmp(t->ptr, "struct trap *"))) { - Strcpy(altbuf, "genericptr"); - } else if (isptr && - (!strcmp(t->parent, "engr") && - !strcmp(t->tag, "engr_txt"))) { - Strcpy(altbuf, "genericptr"); - } else if (isptr && !strcmp(t->tag, "oc_uname")) { - Strcpy(altbuf, "genericptr"); - } else { - Strcpy(altbuf, fnbuf); - } - - if (insert_loop) { - Fprintf(SFO_DATA, - " for (i = 0; i < %s; ++i)\n", - arrbuf); - Fprintf(SFI_DATA, - " for (i = 0; i < %s; ++i)\n", - arrbuf); - arrbuf[0] = '1'; - arrbuf[1] = '\0'; - } - - Sprintf(lbuf, - " " - "%ssfo_%s(nhfp, %s%sd_%s->%s%s, parent, \"%s\", %s);", - insert_loop ? " " : "", - altbuf, - (isptr && !strcmp(altbuf, "genericptr")) ? "(genericptr_t) " : "", - (isptr && !insert_loop && !kludge_sbrooms - && strcmp(altbuf, "genericptr")) ? "" : "&", - readtagstypes[k].dtype, - t->tag, - kludge_sbrooms ? "[0]" : insert_loop ? "[i]" : "", - t->tag, - arrbuf); - /* align comments */ - z = (int) strlen(lbuf); - for (j2 = 0; j2 < (65 - z); ++j2) - Strcat(lbuf, " "); - Sprintf(eos(lbuf), "/* (%s) */\n", ft); - Fprintf(SFO_DATA, "%s", lbuf); - - Sprintf(lbuf, - " " - "%ssfi_%s(nhfp, %s%sd_%s->%s%s, parent, \"%s\", %s);\n", - insert_loop ? " " : "", - altbuf, - (isptr && !strcmp(altbuf, "genericptr")) ? "(genericptr_t) " : "", - (isptr && !insert_loop && !kludge_sbrooms - && strcmp(altbuf, "genericptr")) ? "" : "&", - readtagstypes[k].dtype, - t->tag, - kludge_sbrooms ? "[0]" : insert_loop ? "[i]" : "", - t->tag, - arrbuf); - Fprintf(SFI_DATA, "%s", lbuf); - Fprintf(SFDATATMP, - "\t\"%s:%s:%s\",\n", - sfparent, t->tag,fieldfix(ft,ssdef)); - kludge_sbrooms = FALSE; - } - - /************insert closing conditional if needed ********/ - if (okeydokey && condtag[x+3] && strlen(condtag[x+3]) > 0) { - Fprintf(SFO_DATA,"%s\n", condtag[x+3]); - Fprintf(SFI_DATA,"%s\n", condtag[x+3]); - Fprintf(SFDATATMP,"%s\n", condtag[x+3]); - } - } - t = t->next; - } - - Fprintf(SFO_DATA, "\n"); - Fprintf(SFI_DATA, "\n"); - - Fprintf(SFO_DATA, - " if (nhfp->addinfo)\n" - " sfo_addinfo(nhfp, myparent, \"end\", \"%s\", 1);\n", - readtagstypes[k].dtype); - - Fprintf(SFI_DATA, - " if (nhfp->addinfo)\n" - " sfi_addinfo(nhfp, myparent, \"end\", \"%s\", 1);\n", - readtagstypes[k].dtype); - - Fprintf(SFO_DATA, "}\n"); - Fprintf(SFI_DATA, "}\n"); - opening = 0; - } - ++k; - did_i = FALSE; - } - - Fprintf(SFDATATMP,"};\n\n"); - Fprintf(SFDATATMP, "int critical_members_count()\n{\n\treturn SIZE(critical_members);\n}\n\n"); - - fclose(SFO_DATA); - fclose(SFI_DATA); - fclose(SFO_PROTO); - fclose(SFI_PROTO); - fclose(SFDATATMP); - - /* Consolidate SFO_* and SFI_* into single files */ - - SFO_DATA = fopen("../src/sfo_data.tmp", "r"); - if (!SFO_DATA) return; - while ((gline = fgetline(SFO_DATA)) != 0) { - (void) fputs(gline, SFDATA); - free(gline); - } - (void) fclose(SFO_DATA); - (void) remove("../src/sfo_data.tmp"); - - SFI_DATA = fopen("../src/sfi_data.tmp", "r"); - if (!SFI_DATA) return; - while ((gline = fgetline(SFI_DATA)) != 0) { - (void) fputs(gline, SFDATA); - free(gline); - } - (void) fclose(SFI_DATA); - (void) remove("../src/sfi_data.tmp"); - - SFO_PROTO = fopen("../include/sfo_proto.tmp", "r"); - if (!SFO_PROTO) return; - while ((gline = fgetline(SFO_PROTO)) != 0) { - (void) fputs(gline, SFPROTO); - free(gline); - } - (void) fclose(SFO_PROTO); - (void) remove("../include/sfo_proto.tmp"); - - SFI_PROTO = fopen("../include/sfi_proto.tmp", "r"); - if (!SFI_PROTO) return; - while ((gline = fgetline(SFI_PROTO)) != 0) { - (void) fputs(gline, SFPROTO); - free(gline); - } - (void) fclose(SFI_PROTO); - (void) remove("../include/sfi_proto.tmp"); - - SFDATATMP = fopen("../src/sfdata.tmp", "r"); - if (!SFDATATMP) return; - while ((gline = fgetline(SFDATATMP)) != 0) { - (void) fputs(gline, SFDATA); - free(gline); - } - (void) fclose(SFDATATMP); - (void) remove("../src/sfdata.tmp"); - - Fprintf(SFDATA, "/*sfdata.c*/\n"); - Fprintf(SFPROTO,"#endif /* SFPROTO_H */\n"); - (void) fclose(SFDATA); - (void) fclose(SFPROTO); -} - -#if 0 -static char * -dtmacro(str,n) -const char *str; -int n; /* 1 = supress appending |SF_PTRMASK */ -{ - static char buf[128], buf2[128]; - char *nam, *c; - int ispointer = 0; - - if (!str) - return (char *)0; - (void)strncpy(buf, str, 127); - - c = buf; - while (*c) - c++; /* eos */ - - c--; - if (*c == '*') { - ispointer = 1; - *c = '\0'; - c--; - } - while(isspace(*c)) { - c--; - } - *(c+1) = '\0'; - c = buf; - - if (strncmpi(c, "Bitfield", 8) == 0) { - *(c+8) = '\0'; - } else if (strcmpi(c, "genericptr_t") == 0) { - ispointer = 1; - } else if (strncmpi(c, "const ", 6) == 0) { - c = buf + 6; - } else if ((strncmpi(c, "struct ", 7) == 0) || - (strncmpi(c, "struct\t", 7) == 0)) { - c = buf + 7; - } else if (strncmpi(c, "union ", 6) == 0) { - c = buf + 6; - } - - /* end of substruct within struct definition */ - if (strcmp(buf,"}") == 0 && strlen(ssdef) > 0) { - strcpy(buf,ssdef); - c = buf; - } - - for (nam = c; *c; c++) { - if (*c >= 'a' && *c <= 'z') - *c -= (char)('a' - 'A'); - else if (*c < 'A' || *c > 'Z') - *c = '_'; - } - (void)sprintf(buf2, "SF_%s%s", nam, - (ispointer && (n == 0)) ? " | SF_PTRMASK" : ""); - return buf2; -} -#endif - -static char * -dtfn(str,n, isptr) -const char *str; -int n; /* 1 = supress appending |SF_PTRMASK */ -boolean *isptr; -{ - static char buf[128], buf2[128]; - const char *nam; - char *c; - int ispointer = 0; - - if (!str) - return (char *)0; - (void)strncpy(buf, str, 127); - - c = buf; - while (*c) c++; /* eos */ - - c--; - if (*c == '*') { - ispointer = 1; - *c = '\0'; - c--; - } - while(isspace(*c)) { - c--; - } - *(c+1) = '\0'; - c = buf; - - if (strncmpi(c, "Bitfield", 8) == 0) { - *(c+8) = '\0'; - } else if (strcmpi(c, "genericptr_t") == 0) { - ispointer = 1; - } else if (strncmpi(c, "const ", 6) == 0) { - c = buf + 6; - } else if ((strncmpi(c, "struct ", 7) == 0) || - (strncmpi(c, "struct\t", 7) == 0)) { - c = buf + 7; - } else if (strncmpi(c, "union ", 6) == 0) { - c = buf + 6; - } - - /* end of substruct within struct definition */ - if (strcmp(buf,"}") == 0 && strlen(ssdef) > 0) { - strcpy(buf,ssdef); - c = buf; - } - - for (nam = (const char *) c; *c; c++) { - if (*c >= 'A' && *c <= 'Z') - *c = tolower(*c); - else if (*c == ' ') - *c = '_'; - } - /* some fix-ups */ - if (!strcmp(nam, "genericptr_t")) - nam = "genericptr"; - else if (!strcmp(nam, "unsigned_int")) - nam = "uint"; - else if (!strcmp(nam, "unsigned_long")) - nam = "ulong"; - else if (!strcmp(nam, "unsigned_char")) - nam = "uchar"; - else if (!strcmp(nam, "unsigned_short")) - nam = "ushort"; - - if (ispointer && isptr && n == 0) - *isptr = TRUE; - (void)sprintf(buf2, "%s%s", nam, ""); - return buf2; -} - -static char * -fieldfix(f,ss) -char *f, *ss; -{ - char *c /*, *dest = fieldfixbuf */; - - if (strcmp(f,"}") == 0 && strlen(ss) > 0 && strlen(ss) < BUFSZ - 1) { - /* (void)sprintf(fieldfixbuf,"struct %s", ss); */ - strcpy(fieldfixbuf,ss); - } else { - if (strlen(f) < BUFSZ - 1) strcpy(fieldfixbuf,f); - } - - /* converting any tabs to space */ - for (c = fieldfixbuf; *c; c++) - if (*c == TAB) *c = SPACE; - - return fieldfixbuf; -} - -static char * -bfsize(str) -const char *str; -{ - static char buf[128]; - const char *c1; - char *c2, *subst; - - if (!str) - return (char *)0; - - /* kludge */ - subst = strstr(str, ",$/"); - if (subst != 0) { - subst++; - *subst++ = ' '; - *subst++ = '1'; - } - - c2 = buf; - c1 = str; - while (*c1) { - if (*c1 == ',') - break; - c1++; - } - - if (*c1 == ',') { - c1++; - while (*c1 && *c1 != ')') { - *c2++ = *c1++; - } - *c2 = '\0'; - } else { - return (char *)0; - } - return buf; -} - -/* Read one line from input, up to and including the next newline - * character. Returns a pointer to the heap-allocated string, or a - * null pointer if no characters were read. - */ -static char * -fgetline(fd) -FILE *fd; -{ - static const int inc = 256; - int len = inc; - char *c = malloc(len), *ret; - - for (;;) { - ret = fgets(c + len - inc, inc, fd); - if (!ret) { - free(c); - c = NULL; - break; - } else if (index(c, '\n')) { - /* normal case: we have a full line */ - break; - } - len += inc; - c = realloc(c, len); - } - return c; -} - -/*readtags2.c*/ - - diff --git a/win/win32/vs2017/NetHack.vcxproj b/win/win32/vs2017/NetHack.vcxproj index 565e21794..5f539114f 100644 --- a/win/win32/vs2017/NetHack.vcxproj +++ b/win/win32/vs2017/NetHack.vcxproj @@ -169,10 +169,6 @@ - - - - diff --git a/win/win32/vs2017/NetHackW.vcxproj b/win/win32/vs2017/NetHackW.vcxproj index 12b4dbd62..1ea3ce9e5 100644 --- a/win/win32/vs2017/NetHackW.vcxproj +++ b/win/win32/vs2017/NetHackW.vcxproj @@ -163,10 +163,6 @@ - - - -