Data Structures | Defines | Functions | Variables

restore.c File Reference

#include "hack.h"
#include "lev.h"
#include "tcap.h"
#include "quest.h"
Include dependency graph for restore.c:

Data Structures

struct  bucket

Defines

#define N_PER_BUCKET   64
#define Is_IceBox(o)   ((o)->otyp == ICE_BOX ? TRUE : FALSE)

Functions

STATIC_DCL void NDECL (find_lev_obj)
STATIC_DCL void FDECL (restlevchn,(int))
STATIC_DCL void FDECL (restdamage,(int, BOOLEAN_P))
STATIC_DCL struct objFDECL (restobjchn,(int, BOOLEAN_P, BOOLEAN_P))
STATIC_DCL struct monstFDECL (restmonchn,(int, BOOLEAN_P))
STATIC_DCL struct fruitFDECL (loadfruitchn,(int))
STATIC_DCL void FDECL (freefruitchn,(struct fruit *))
STATIC_DCL void FDECL (ghostfruit,(struct obj *))
STATIC_DCL boolean FDECL (restgamestate,(int, unsigned int *, unsigned int *))
STATIC_DCL void FDECL (restlevelstate,(unsigned int, unsigned int))
STATIC_DCL int FDECL (restlevelfile,(int, XCHAR_P))
STATIC_DCL void FDECL (reset_oattached_mids,(BOOLEAN_P))
STATIC_DCL void NDECL (clear_id_mapping)
STATIC_DCL void FDECL (add_id_mapping,(unsigned, unsigned))
STATIC_OVL void find_lev_obj ()
void inven_inuse (boolean quietly)
STATIC_OVL void restlevchn (int fd)
STATIC_OVL void restdamage (int fd, boolean ghostly)
struct lvl_soundsrest_lvl_sounds (int fd)
struct mon_gen_overriderest_mongen_override (int fd)
STATIC_OVL struct objrestobjchn (int fd, boolean ghostly, boolean frozen)
STATIC_OVL struct monstrestmonchn (int fd, boolean ghostly)
STATIC_OVL struct fruitloadfruitchn (int fd)
STATIC_OVL void freefruitchn (struct fruit *flist)
STATIC_OVL void ghostfruit (struct obj *otmp)
STATIC_OVL boolean restgamestate (int fd, unsigned int *stuckid, unsigned int *steedid)
STATIC_OVL void restlevelstate (unsigned int stuckid, unsigned int steedid)
STATIC_OVL int restlevelfile (int fd, xchar ltmp)
int dorecover (int fd)
void trickery (char *reason)
void getlev (int fd, int pid, xchar lev, boolean ghostly)
STATIC_OVL void clear_id_mapping ()
STATIC_OVL void add_id_mapping (unsigned gid, unsigned nid)
boolean lookup_id_mapping (unsigned gid, unsigned *nidp)
STATIC_OVL void reset_oattached_mids (boolean ghostly)
void minit ()
void mread (int fd, genericptr_t buf, unsigned int len)

Variables

static int n_ids_mapped = 0
static struct bucketid_map = 0
boolean restoring = FALSE
static NEARDATA struct fruitoldfruit
static NEARDATA long omoves

Define Documentation

#define Is_IceBox (   o )    ((o)->otyp == ICE_BOX ? TRUE : FALSE)

Referenced by restobjchn().

#define N_PER_BUCKET   64

Function Documentation

STATIC_OVL void add_id_mapping ( unsigned  gid,
unsigned  nid 
)

References bucket::gid, id_map, bucket::map, N_PER_BUCKET, bucket::next, and bucket::nid.

Referenced by restmonchn(), and restobjchn().

Here is the caller graph for this function:

STATIC_OVL void clear_id_mapping (  )

References bucket::next.

Referenced by getlev().

Here is the caller graph for this function:

int dorecover ( int  fd )
STATIC_DCL struct obj* FDECL ( restobjchn  ,
(int, BOOLEAN_P, BOOLEAN_P)   
) [read]
STATIC_DCL void FDECL ( ghostfruit  ,
(struct obj *)   
)
STATIC_DCL boolean FDECL ( restgamestate  ,
(int, unsigned int *, unsigned int *)   
)
STATIC_DCL struct monst* FDECL ( restmonchn  ,
(int, BOOLEAN_P)   
) [read]
STATIC_DCL void FDECL ( restlevelstate  ,
(unsigned int, unsigned int)   
)
STATIC_DCL int FDECL ( restlevelfile  ,
(int, XCHAR_P)   
)
STATIC_DCL void FDECL ( add_id_mapping  ,
(unsigned, unsigned)   
)
STATIC_DCL void FDECL ( restlevchn  ,
(int)   
)
STATIC_DCL struct fruit* FDECL ( loadfruitchn  ,
(int)   
) [read]
STATIC_DCL void FDECL ( reset_oattached_mids  ,
(BOOLEAN_P)   
)
STATIC_DCL void FDECL ( restdamage  ,
(int, BOOLEAN_P)   
)
STATIC_DCL void FDECL ( freefruitchn  ,
(struct fruit *)   
)
STATIC_OVL void find_lev_obj (  )

References COLNO, fobj, level, obj::nobj, OBJ_FREE, dlevel_t::objects, otmp, obj::ox, obj::oy, place_object(), ROWNO, and obj::where.

Referenced by getlev().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void freefruitchn ( struct fruit flist )

References dealloc_fruit, and fruit::nextf.

Referenced by freedynamicdata(), getlev(), and restgamestate().

Here is the caller graph for this function:

void getlev ( int  fd,
int  pid,
xchar  lev,
boolean  ghostly 
)
STATIC_OVL void ghostfruit ( struct obj otmp )

References fruit::fid, fruit::fname, fruitadd(), and fruit::nextf.

Referenced by restobjchn().

Here is the call graph for this function:

Here is the caller graph for this function:

void inven_inuse ( boolean  quietly )

References COIN_CLASS, dealloc_obj(), extract_nobj(), FALSE, invent, obj::nobj, obj::oclass, otmp, pline(), useup(), and xname().

Referenced by done(), and dorecover().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL struct fruit* loadfruitchn ( int  fd ) [read]

References dealloc_fruit, mread(), newfruit, and fruit::nextf.

Referenced by getlev(), and restgamestate().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean lookup_id_mapping ( unsigned  gid,
unsigned *  nidp 
)

References FALSE, bucket::gid, bucket::map, N_PER_BUCKET, bucket::next, bucket::nid, and TRUE.

Referenced by relink_light_sources(), relink_timers(), reset_oattached_mids(), and reset_region_mids().

Here is the caller graph for this function:

void minit (  )

Referenced by dosave0(), goto_level(), and uptodate().

Here is the caller graph for this function:

void mread ( int  fd,
genericptr_t  buf,
unsigned int  len 
)
STATIC_DCL void NDECL ( find_lev_obj   )
STATIC_DCL void NDECL ( clear_id_mapping   )
STATIC_OVL void reset_oattached_mids ( boolean  ghostly )

References fobj, lookup_id_mapping(), monst::m_id, monst::mtame, obj::nobj, OATTACHED_M_ID, OATTACHED_MONST, OATTACHED_NOTHING, obj::oextra, otmp, and obj::oxlth.

Referenced by getlev().

Here is the call graph for this function:

Here is the caller graph for this function:

struct lvl_sounds* rest_lvl_sounds ( int  fd ) [read]

References mread().

Referenced by getlev().

Here is the call graph for this function:

Here is the caller graph for this function:

struct mon_gen_override* rest_mongen_override ( int  fd ) [read]

References mread(), and mon_gen_tuple::next.

Referenced by getlev().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void restdamage ( int  fd,
boolean  ghostly 
)

References dlevel_t::damagelist, d_level::dlevel, in_rooms(), inhishop(), level, monstermoves, mread(), omoves, repair_damage(), shop_keeper(), SHOPBASE, Strcpy, TRUE, u, and you::uz.

Referenced by getlev().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL boolean restgamestate ( int  fd,
unsigned int *  stuckid,
unsigned int *  steedid 
)
STATIC_OVL void restlevchn ( int  fd )

References mread(), s_level::next, and sp_levchn.

Referenced by restgamestate().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL int restlevelfile ( int  fd,
xchar  ltmp 
)

References allbones, alllevels, bclose(), bufon(), BUFSZ, clearlocks(), close(), COUNT_SAVE, create_levelfile(), dorecover(), EXIT_SUCCESS, FREE_SAVE, levels, lseek(), pline(), ramdisk, savelev(), terminate(), uptodate(), and WRITE_SAVE.

Referenced by dorecover().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void restlevelstate ( unsigned int  stuckid,
unsigned int  steedid 
)

References fmon, monst::m_id, monst::mx, monst::my, monst::nmon, remove_monster(), u, and you::ustuck.

Referenced by dorecover().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL struct monst* restmonchn ( int  fd,
boolean  ghostly 
) [read]

References add_id_mapping(), DEFUNCT_MONSTER, FALSE, flags, flag::ident, MON_NOWEP, mons, monsndx(), mread(), newmonst, monst::nmon, obj::nobj, obj::owornmask, propagate(), restobjchn(), restpriest(), restshk(), TRUE, and W_WEP.

Referenced by getlev(), and restgamestate().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL struct obj* restobjchn ( int  fd,
boolean  ghostly,
boolean  frozen 
) [read]

References add_id_mapping(), age_is_relative, obj::cobj, flags, ghostfruit(), Has_contents, flag::ident, Is_IceBox, monstermoves, mread(), newobj, obj::nobj, otmp, and SLIME_MOLD.

Referenced by getlev(), restgamestate(), and restmonchn().

Here is the call graph for this function:

Here is the caller graph for this function:

void trickery ( char *  reason )

References done(), killer, pline(), and TRICKED.

Referenced by getbones(), and getlev().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

struct bucket* id_map = 0 [static]

Referenced by add_id_mapping().

int n_ids_mapped = 0 [static]
NEARDATA struct fruit* oldfruit [static]
NEARDATA long omoves [static]

Referenced by restdamage().

boolean restoring = FALSE

Referenced by set_artifact_intrinsic().