remove field-level savefile code

This commit is contained in:
nhmall
2019-12-08 07:27:01 -05:00
parent 2cb46c4153
commit bc8c1f8f56
37 changed files with 38 additions and 12504 deletions

View File

@@ -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,

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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 */
}

View File

@@ -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

View File

@@ -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;
}

View File

@@ -15,7 +15,6 @@
#include <limits.h>
#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));
}

View File

@@ -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) &lth, sizeof(unsigned));
if (nhfp->fieldlevel)
sfi_unsigned(nhfp, &lth, "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 */

View File

@@ -8,8 +8,6 @@
#include "hack.h"
#include "dlb.h"
#include <ctype.h>
#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);

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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++) {

View File

@@ -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

View File

@@ -18,7 +18,6 @@ NEARDATA struct instance_flags iflags; /* provide linkage */
#include "tcap.h"
#include <ctype.h>
#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");

View File

@@ -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 */

View File

@@ -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, &ltmp, "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) {

View File

@@ -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() */
}
}

View File

@@ -5,8 +5,6 @@
#include "hack.h"
#include "lev.h"
#include "sfproto.h"
#ifndef NO_SIGNAL
#include <signal.h>
@@ -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) &ltmp, sizeof ltmp); /* level number*/
if (nhfp->fieldlevel)
sfo_xchar(nhfp, &ltmp, "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;
}

File diff suppressed because it is too large Load Diff

View File

@@ -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
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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);
}
}
/*

View File

@@ -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

View File

@@ -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

View File

@@ -7,7 +7,6 @@
#include "hack.h"
#include "dlb.h"
#include "sfproto.h"
#ifndef NO_SIGNAL
#include <signal.h>
@@ -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

View File

@@ -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)

View File

@@ -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 )

View File

@@ -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 = "<group>"; };
31B8A46421A278AC0055BD01 /* dgn_comp.y */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.yacc; name = dgn_comp.y; path = ../../util/dgn_comp.y; sourceTree = "<group>"; };
31B8A46821A288770055BD01 /* dgn_comp.l */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.lex; name = dgn_comp.l; path = ../../util/dgn_comp.l; sourceTree = "<group>"; };
544768A223994965004B9739 /* sfascii.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sfascii.c; path = ../../src/sfascii.c; sourceTree = "<group>"; };
544768A4239949A8004B9739 /* sfbase.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sfbase.c; path = ../../src/sfbase.c; sourceTree = "<group>"; };
544768A6239949FA004B9739 /* sfdata.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sfdata.c; path = ../../src/sfdata.c; sourceTree = "<group>"; };
544768A7239949FA004B9739 /* sflendian.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sflendian.c; path = ../../src/sflendian.c; sourceTree = "<group>"; };
544768A8239949FA004B9739 /* sfstruct.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sfstruct.c; path = ../../src/sfstruct.c; sourceTree = "<group>"; };
544768AC23994A17004B9739 /* nhlsel.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = nhlsel.c; path = ../../src/nhlsel.c; sourceTree = "<group>"; };
544768AD23994A17004B9739 /* nhlua.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = nhlua.c; path = ../../src/nhlua.c; sourceTree = "<group>"; };
544768B023994A2C004B9739 /* mdlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mdlib.c; path = ../../src/mdlib.c; sourceTree = "<group>"; };
544768B423995447004B9739 /* isaac64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = isaac64.h; path = ../../include/isaac64.h; sourceTree = "<group>"; };
544768B523995488004B9739 /* nhlua.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = nhlua.h; path = ../../include/nhlua.h; sourceTree = "<group>"; };
544768B623995488004B9739 /* sfprocs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sfprocs.h; path = ../../include/sfprocs.h; sourceTree = "<group>"; };
544768B723995488004B9739 /* sfproto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sfproto.h; path = ../../include/sfproto.h; sourceTree = "<group>"; };
544768B923995BB7004B9739 /* liblua.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblua.a; path = ../../lib/lua/liblua.a; sourceTree = "<group>"; };
54FCE8282223261F00F393C8 /* isaac64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = isaac64.c; path = ../../src/isaac64.c; sourceTree = "<group>"; };
/* 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 */,

View File

@@ -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

View File

@@ -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"

View File

@@ -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.

File diff suppressed because it is too large Load Diff

View File

@@ -169,10 +169,6 @@
<ClCompile Include="$(SrcDir)rumors.c" />
<ClCompile Include="$(SrcDir)save.c" />
<ClCompile Include="$(SrcDir)sfstruct.c" />
<ClCompile Include="$(SrcDir)sfbase.c" />
<ClCompile Include="$(SrcDir)sflendian.c" />
<ClCompile Include="$(SrcDir)sfascii.c" />
<ClCompile Include="$(SrcDir)sfdata.c" />
<ClCompile Include="$(SrcDir)shk.c" />
<ClCompile Include="$(SrcDir)shknam.c" />
<ClCompile Include="$(SrcDir)sit.c" />

View File

@@ -163,10 +163,6 @@
<ClCompile Include="$(SrcDir)rumors.c" />
<ClCompile Include="$(SrcDir)save.c" />
<ClCompile Include="$(SrcDir)sfstruct.c" />
<ClCompile Include="$(SrcDir)sfbase.c" />
<ClCompile Include="$(SrcDir)sflendian.c" />
<ClCompile Include="$(SrcDir)sfascii.c" />
<ClCompile Include="$(SrcDir)sfdata.c" />
<ClCompile Include="$(SrcDir)shk.c" />
<ClCompile Include="$(SrcDir)shknam.c" />
<ClCompile Include="$(SrcDir)sit.c" />