Data Structures | Defines | Functions | Variables

topten.c File Reference

#include "hack.h"
#include "dlb.h"
#include "patchlevel.h"
Include dependency graph for topten.c:

Data Structures

struct  toptenentry

Defines

#define done_stopprint   program_state.stopprint
#define newttentry()   (struct toptenentry *) alloc(sizeof(struct toptenentry))
#define dealloc_ttentry(ttent)   free((genericptr_t) (ttent))
#define NAMSZ   10
#define DTHSZ   100
#define ROLESZ   3
#define PERSMAX   3
#define POINTSMIN   1
#define ENTRYMAX   100
#define PERS_IS_UID
#define TTFIELDS   13
#define HUP

Functions

STATIC_DCL void FDECL (topten_print,(const char *))
STATIC_DCL void FDECL (topten_print_bold,(const char *))
STATIC_DCL xchar FDECL (observable_depth,(d_level *))
STATIC_DCL void NDECL (outheader)
STATIC_DCL void FDECL (outentry,(int, struct toptenentry *, BOOLEAN_P))
STATIC_DCL void FDECL (readentry,(FILE *, struct toptenentry *))
STATIC_DCL void FDECL (writeentry,(FILE *, struct toptenentry *))
STATIC_DCL void FDECL (free_ttlist,(struct toptenentry *))
STATIC_DCL int FDECL (classmon,(char *, BOOLEAN_P))
STATIC_DCL int FDECL (score_wanted,(BOOLEAN_P, int, struct toptenentry *, int, const char **, int))
STATIC_OVL void topten_print (char *x) const
STATIC_OVL void topten_print_bold (char *x) const
STATIC_OVL xchar observable_depth (d_level *lev)
STATIC_OVL void readentry (FILE *rfile, struct toptenentry *tt)
STATIC_OVL void writeentry (FILE *rfile, struct toptenentry *tt)
STATIC_OVL void free_ttlist (struct toptenentry *tt)
void topten (int how)
STATIC_OVL void outheader ()
STATIC_OVL void outentry (int rank, struct toptenentry *t1, boolean so)
else if (!strncmp("ascended ", t1->death, 9))
else if (!strncmp("ascended", t1->death, 8))
 if (second_line)
 if (bp<=linebuf+hppos)
 if (so)
else if (!done_stopprint) topten_print(linebuf)
STATIC_OVL int score_wanted (boolean current_ver, int rank, struct toptenentry *t1, int playerct, const char **players, int uid)
void prscore (int argc, char **argv)
STATIC_OVL int classmon (char *plch, boolean fem)
struct objtt_oname (struct obj *otmp)

Variables

struct toptenentrytt_head
NEARDATA const char *const killed_by_prefix []
static winid toptenwin = WIN_ERR
 hppos = COLNO - 7 - (int)strlen(hpbuf)
 bp = eos(linebuf)

Define Documentation

#define dealloc_ttentry (   ttent )    free((genericptr_t) (ttent))

Referenced by free_ttlist(), and topten().

#define done_stopprint   program_state.stopprint

Referenced by if(), outheader(), and topten().

#define DTHSZ   100

Referenced by topten().

#define ENTRYMAX   100

Referenced by topten().

#define HUP
#define NAMSZ   10

Referenced by score_wanted(), and topten().

#define newttentry (  )    (struct toptenentry *) alloc(sizeof(struct toptenentry))

Referenced by prscore(), and topten().

#define PERS_IS_UID

Referenced by topten().

#define PERSMAX   3

Referenced by topten().

#define POINTSMIN   1

Referenced by topten().

#define ROLESZ   3

Referenced by classmon(), and topten().

#define TTFIELDS   13

Referenced by readentry().


Function Documentation

STATIC_OVL int classmon ( char *  plch,
boolean  fem 
)

References Role::femalenum, RoleName::m, Role::malenum, Role::name, NON_PM, PM_HUMAN, PM_HUMAN_MUMMY, PM_RANGER, roles, and ROLESZ.

Referenced by tt_oname().

Here is the caller graph for this function:

STATIC_DCL void FDECL ( topten_print_bold  ,
(const char *)   
)
STATIC_DCL void FDECL ( free_ttlist  ,
(struct toptenentry *)   
)
STATIC_DCL int FDECL ( classmon  ,
(char *, BOOLEAN_P)   
)
STATIC_DCL void FDECL ( outentry  ,
(int, struct toptenentry *, BOOLEAN_P)   
)
STATIC_DCL int FDECL ( score_wanted  ,
(BOOLEAN_P, int, struct toptenentry *, int, const char **, int)   
)
STATIC_DCL void FDECL ( topten_print  ,
(const char *)   
)
STATIC_DCL void FDECL ( readentry  ,
(FILE *, struct toptenentry *)   
)
STATIC_DCL xchar FDECL ( observable_depth  ,
(d_level *)   
)
STATIC_DCL void FDECL ( writeentry  ,
(FILE *, struct toptenentry *)   
)
STATIC_OVL void free_ttlist ( struct toptenentry tt )

References dealloc_ttentry, and toptenentry::tt_next.

Referenced by prscore(), and topten().

Here is the caller graph for this function:

else if ( done_stopprint )
else if ( strncmp"ascended ", t1->death, 9 )
else if ( strncmp"ascended", t1->death, 8 )
if ( second_line   )
if ( so   )

References COLNO, done_stopprint, eos(), and topten_print_bold().

Here is the call graph for this function:

if ( bp<=linebuf+  hppos )

References eos(), Sprintf, and Strcpy.

Here is the call graph for this function:

STATIC_DCL void NDECL ( outheader   )
STATIC_OVL xchar observable_depth ( d_level lev )

References depth(), In_endgame, Is_airlevel, Is_astralevel, Is_earthlevel, Is_firelevel, and Is_waterlevel.

Referenced by topten().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void outentry ( int  rank,
struct toptenentry t1,
boolean  so 
)

References astral_level, bp, BUFSZ, eos(), FALSE, hppos, index, Sprintf, Strcat, and TRUE.

Referenced by prscore(), and topten().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void outheader (  )

References bp, BUFSZ, COLNO, done_stopprint, dump(), eos(), Strcpy, and topten_print().

Referenced by prscore(), and topten().

Here is the call graph for this function:

Here is the caller graph for this function:

void prscore ( int  argc,
char **  argv 
)
STATIC_OVL void readentry ( FILE *  rfile,
struct toptenentry tt 
)
STATIC_OVL int score_wanted ( boolean  current_ver,
int  rank,
struct toptenentry t1,
int  playerct,
const char **  players,
int  uid 
)

References digit(), index, toptenentry::name, NAMSZ, PATCHLEVEL, toptenentry::patchlevel, toptenentry::plrace, toptenentry::plrole, str2race(), str2role(), toptenentry::uid, toptenentry::ver_major, toptenentry::ver_minor, VERSION_MAJOR, and VERSION_MINOR.

Referenced by prscore().

Here is the call graph for this function:

Here is the caller graph for this function:

void topten ( int  how )

References aligns, an(), toptenentry::birthdate, BUFSZ, create_nhwindow, dealloc_ttentry, toptenentry::death, toptenentry::deathdate, toptenentry::deathdnum, toptenentry::deathlev, toptenentry::deaths, deepest_lev_reached(), destroy_nhwindow, discover, display_nhwindow, d_level::dnum, done_stopprint, DTHSZ, dump(), dump_html(), flag::end_around, flag::end_own, flag::end_top, ENTRYMAX, FALSE, flag::female, Align::filecode, Gender::filecode, Race::filecode, Role::filecode, flags, fopen_datafile(), free_ttlist(), genders, getuid, toptenentry::hp, HUP, KILLED_BY, KILLED_BY_AN, killer, killer_format, lock_file(), LOGFILE, toptenentry::maxhp, toptenentry::maxlvl, toptenentry::name, NAMSZ, newttentry, NHW_TEXT, NO_KILLER_PREFIX, observable_depth(), ordin(), outentry(), outheader(), PANICKED, sinfo::panicking, PATCHLEVEL, toptenentry::patchlevel, pbuf, PERS_IS_UID, PERSMAX, toptenentry::plalign, toptenentry::plgend, plname, toptenentry::plrace, toptenentry::plrole, toptenentry::points, POINTSMIN, program_state, rank(), raw_print(), readentry(), RECORD, ROLESZ, SCOREPREFIX, SEEK_SET, Sprintf, Strcat, Strcpy, topten_print(), flag::toptenwin, TRUE, tt_head, toptenentry::tt_next, align::type, u, you::ualign, you::ubirthday, you::udeathday, you::uhp, you::uhpmax, toptenentry::uid, you::umortality, unlock_file(), urace, urole, you::urscore, you::uz, toptenentry::ver_major, toptenentry::ver_minor, VERSION_MAJOR, VERSION_MINOR, WIN_ERR, wizard, writeentry(), XLOGFILE, and yyyymmdd().

Here is the call graph for this function:

STATIC_OVL void topten_print ( char *  x ) const

References ATR_NONE, putstr, raw_print(), and WIN_ERR.

Referenced by outheader(), and topten().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void topten_print_bold ( char *  x ) const

References ATR_BOLD, putstr, raw_print_bold, and WIN_ERR.

Referenced by if().

Here is the caller graph for this function:

struct obj* tt_oname ( struct obj otmp ) [read]

References classmon(), CORPSE, fopen_datafile(), toptenentry::name, obj_stop_timers(), oname(), otmp, toptenentry::plgend, toptenentry::plrole, toptenentry::points, rank(), readentry(), RECORD, rewind, rnd(), SCOREPREFIX, start_corpse_timeout(), and weight().

Referenced by mk_tt_object().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void writeentry ( FILE *  rfile,
struct toptenentry tt 
)

Variable Documentation

bp = eos(linebuf)
hppos = COLNO - 7 - (int)strlen(hpbuf)

Referenced by outentry().

NEARDATA const char* const killed_by_prefix[]
Initial value:
 {
        "killed by ", "choked on ", "poisoned by ", "died of ", "drowned in ",
        "burned by ", "dissolved in ", "crushed to death by ", "petrified by ",
        "turned to slime by ", "killed by ", 



        "turned to slime by ", "killed by ",



   "", "", "", ""
}
winid toptenwin = WIN_ERR [static]
struct toptenentry * tt_head

Referenced by prscore(), and topten().