utility.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include "advent.h"
#include "advdec.h"

Include dependency graph for utility.c:

Go to the source code of this file.

Functions

boolean ajar (int item)
boolean at (int item)
boolean athand (int item)
void bitoff (int obj, int bit)
void biton (int obj, int bit)
boolean bitset (long state, int bit)
boolean blind ()
int burden (int obj)
void carry (int obj, int where)
int confuz ()
boolean dark ()
int dcheck ()
boolean dead (int obj)
void drop (int obj, int where)
void destroy (int obj)
boolean edible (int obj)
boolean enclosed (int item)
void extract (int obj)
int forced (int at_loc)
boolean here (int item)
boolean hinged (int object)
boolean holding (int item)
void insert (int obj, int contnr)
boolean inside (int loc)
void juggle (int obj)
int liq (int item)
int liq2 (int liquid)
int liqloc (int loc)
boolean living (int obj)
boolean locked (int item)
boolean locks (int item)
void lookin (int contnr)
void move (int obj, int where)
int noway ()
boolean opaque (int obj)
boolean outside (int loc)
int pct (int x)
boolean plural (int obj)
boolean portal (int loc)
boolean printed (int obj)
int put (int obj, int where, int pval)
int ranz (int range)
boolean small (int obj)
int toting (int item)
boolean treasr (int obj)
boolean vessel (int obj)
boolean wearng (int item)
boolean worn (int obj)
void bug (unsigned int n)
char * ask (char *prompt, char *buf, int buflen)
void panic (char *msg, boolean save)

Variables

static char * e_msg []


Function Documentation

boolean ajar int  item  ) 
 

Definition at line 17 of file utility.c.

References bitset, g, hinged(), playinfo::obj_state, OPENBT, and vessel().

Referenced by athand(), lookin(), turn(), vclose(), vextract(), vinsert(), vlook(), vopen(), vpour(), and vtake().

char* ask char *  prompt,
char *  buf,
int  buflen
 

Definition at line 714 of file utility.c.

References c, EOF, FALSE, fflush(), fgets(), fputs(), getchar, isspace, panic, stdin, stdout, and strlen().

Referenced by add(), ask_kbuf(), delete(), ed_dorep(), f_kbuffer(), f_retsup(), f_selbuffer(), f_selxbuffer(), getwords(), hack_file(), itverb(), iwritfile(), mediator(), slave(), srch_ask(), u_r_file(), and yes().

boolean at int  item  ) 
 

Definition at line 27 of file utility.c.

References FALSE, playinfo::fixed, g, playinfo::loc, MAXOBJ, and playinfo::place.

Referenced by descitem(), do_hint(), doobj(), dotrav(), english(), itverb(), ivkill(), main(), proxy(), vblow(), vdrop(), vfind(), vhit(), vpour(), vthrow(), vwake(), vwave(), and vyank().

boolean athand int  item  ) 
 

Definition at line 40 of file utility.c.

References ajar(), enclosed(), g, holding(), playinfo::loc, playinfo::place, and toting().

Referenced by blind(), dark(), do_hint(), do_scoop_up(), doobj(), dopirate(), itverb(), ivdrink(), vdrink(), vlock(), vlook(), voff(), von(), vopen(), vtake(), and vunlock().

void bitoff int  obj,
int  bit
 

Definition at line 57 of file utility.c.

References g, L, playinfo::obj_state, and val.

Referenced by death(), ivcombo(), stimer(), vclose(), vdrink(), vdrop(), vinsert(), vlock(), vpour(), vtake(), and vunlock().

void biton int  obj,
int  bit
 

Definition at line 69 of file utility.c.

References g, L, playinfo::obj_state, and val.

Referenced by ivcombo(), stimer(), vkill(), vlock(), vopen(), vplay(), vpour(), vunlock(), vwave(), and vwear().

boolean bitset long  state,
int  bit
 

Definition at line 81 of file utility.c.

boolean blind  ) 
 

Definition at line 91 of file utility.c.

References athand(), dark(), g, LAMP, playinfo::loc, and playinfo::prop.

Referenced by doobj(), ivtake(), turn(), and vread().

void bug unsigned int  n  ) 
 

Definition at line 698 of file utility.c.

References e_msg, fprintf(), panic, stderr, and TRUE.

Referenced by actspk(), carry(), do_hint(), dotrav(), extract(), insert(), itverb(), rdskip(), and trverb().

int burden int  obj  ) 
 

Definition at line 112 of file utility.c.

References BOAT, g, i, MAXOBJ, playinfo::place, sum(), toting(), and playinfo::weight.

Referenced by do_hint(), spcmove(), vextract(), and vtake().

void carry int  obj,
int  where
 

Definition at line 142 of file utility.c.

References playinfo::atloc, bug(), g, playinfo::link, MAXOBJ, and playinfo::place.

Referenced by _do_add(), _one_mult(), b64_add(), bc_divide(), insert(), move(), vtake(), and vyank().

int confuz  ) 
 

Definition at line 169 of file utility.c.

References msg, and pct().

Referenced by check_next(), english(), vlook(), vpick(), vplay(), vread(), vtake(), and vturn().

boolean dark  ) 
 

Definition at line 188 of file utility.c.

References athand(), g, LAMP, LIGHT, playinfo::loc, playinfo::loc_attrib, and playinfo::prop.

Referenced by blind(), describe(), ivread(), turn(), and voff().

int dcheck  ) 
 

Definition at line 198 of file utility.c.

References playinfo::dloc, DWARFMAX, g, i, playinfo::loc, and return().

Referenced by doobj(), ivkill(), ivtake(), vfind(), and vthrow().

boolean dead int  obj  ) 
 

Definition at line 211 of file utility.c.

References bitset, g, and playinfo::obj_state.

void destroy int  obj  ) 
 

Definition at line 238 of file utility.c.

References move.

Referenced by gz_open(), gzclose(), stimer(), vdrop(), veat(), vinsert(), vkill(), and vopen().

void drop int  obj,
int  where
 

Definition at line 220 of file utility.c.

References playinfo::atloc, playinfo::fixed, g, playinfo::link, MAXOBJ, and playinfo::place.

Referenced by death(), dwarves(), inflate_table(), inflate_table9(), initialize(), move(), spcmove(), vbreak(), vdrink(), vdrop(), vfill(), vhit(), vinsert(), vlock(), vopen(), vtake(), and vwave().

boolean edible int  obj  ) 
 

Definition at line 248 of file utility.c.

References bitset, g, and playinfo::obj_state.

Referenced by iveat(), and vfeed().

boolean enclosed int  item  ) 
 

Definition at line 257 of file utility.c.

References FALSE, g, MAXOBJ, and playinfo::place.

Referenced by athand(), move(), spcmove(), toting(), vbreak(), vdrop(), vextract(), vfill(), vinsert(), vlock(), vlook(), vtake(), and vwear().

void extract int  obj  ) 
 

Definition at line 270 of file utility.c.

References bug(), g, playinfo::hlink, playinfo::holder, and playinfo::place.

int forced int  at_loc  ) 
 

Definition at line 297 of file utility.c.

References g, and playinfo::loc_attrib.

Referenced by dwarves(), goback(), and turn().

boolean here int  item  ) 
 

Definition at line 306 of file utility.c.

References g, playinfo::loc, playinfo::place, and toting().

Referenced by do_hint(), doobj(), dopirate(), extract(), itverb(), iveat(), ivfill(), ivfoo(), ivkill(), ivread(), parsefname(), parseheredoc(), turn(), vdrop(), veat(), vfeed(), vplay(), and vtake().

boolean hinged int  object  ) 
 

Definition at line 315 of file utility.c.

References bitset, g, and playinfo::obj_state.

Referenced by ajar(), english(), ivopen(), vclose(), vlock(), vopen(), and vunlock().

boolean holding int  item  ) 
 

Definition at line 324 of file utility.c.

References FALSE, g, MAXOBJ, and playinfo::place.

Referenced by athand(), doobj(), inventory(), ivpour(), spcmove(), toting(), vbreak(), vdrink(), vdrop(), vfill(), vinsert(), vkill(), vlock(), vopen(), vpour(), vread(), vtake(), vthrow(), vwave(), and vwear().

void insert int  obj,
int  contnr
 

Definition at line 336 of file utility.c.

References bug(), carry(), g, playinfo::hlink, playinfo::holder, playinfo::loc, and playinfo::place.

Referenced by file_insert(), S(), vfill(), vinsert(), and vtake().

boolean inside int  loc  ) 
 

Definition at line 354 of file utility.c.

References outside(), and portal().

Referenced by dwarves(), isSubdirOf(), stimer(), and vlook().

void juggle int  obj  ) 
 

Definition at line 365 of file utility.c.

References playinfo::fixed, g, i, j, MAXOBJ, move, and playinfo::place.

Referenced by spcmove(), stimer(), and vdrop().

int liq int  item  ) 
 

Definition at line 380 of file utility.c.

References BOTTLE, CASK, g, liq2(), and playinfo::prop.

Referenced by doobj(), dopirate(), ivdrink(), ivpour(), vbreak(), vdrink(), vdrop(), vfill(), vfind(), and vpour().

int liq2 int  liquid  ) 
 

Definition at line 396 of file utility.c.

References OIL, WATER, and WINE.

Referenced by liq(), and liqloc().

int liqloc int  loc  ) 
 

Definition at line 414 of file utility.c.

References g, liq2(), and playinfo::loc_attrib.

Referenced by doobj(), english(), ivdrink(), vdrink(), vfill(), and vfind().

boolean living int  obj  ) 
 

Definition at line 423 of file utility.c.

References bitset, g, and playinfo::obj_state.

Referenced by vfeed(), and vthrow().

boolean locked int  item  ) 
 

Definition at line 432 of file utility.c.

References bitset, g, and playinfo::obj_state.

Referenced by test7d(), vlock(), vopen(), and vunlock().

boolean locks int  item  ) 
 

Definition at line 441 of file utility.c.

References bitset, g, and playinfo::obj_state.

void lookin int  contnr  ) 
 

Definition at line 450 of file utility.c.

References ajar(), FALSE, g, playinfo::hlink, playinfo::holder, opaque(), printf, pspeak(), rspeak(), TRUE, and vessel().

Referenced by inventory(), and vlook().

void move int  obj,
int  where
 

Definition at line 474 of file utility.c.

References carry(), drop(), enclosed(), extract(), playinfo::fixed, g, MAXOBJ, and playinfo::place.

int noway  ) 
 

Definition at line 495 of file utility.c.

References msg, and pct().

Referenced by ck_obj(), vclose(), vfeed(), vinsert(), vopen(), vput(), vtake(), vthrow(), and vturn().

boolean opaque int  obj  ) 
 

Definition at line 520 of file utility.c.

References bitset, g, and playinfo::obj_state.

Referenced by lookin(), and vlook().

boolean outside int  loc  ) 
 

Definition at line 529 of file utility.c.

References bitset, g, and playinfo::loc_attrib.

Referenced by domove(), inside(), isSubdirOf(), turn(), vblow(), and vdrink().

void panic char *  msg,
boolean  save
 

Definition at line 740 of file utility.c.

References exit(), EXIT_FAILURE, fprintf(), saveadv(), and stderr.

int pct int  x  ) 
 

Definition at line 538 of file utility.c.

References ranz().

Referenced by check_next(), confuz(), describe(), do_battle(), dwarves(), itverb(), noway(), spcmove(), turn(), and vdrink().

boolean plural int  obj  ) 
 

Definition at line 547 of file utility.c.

References bitset, g, and playinfo::obj_state.

Referenced by doobj(), vdrop(), and vtake().

boolean portal int  loc  ) 
 

Definition at line 556 of file utility.c.

References bitset, g, and playinfo::loc_attrib.

Referenced by inside().

boolean printed int  obj  ) 
 

Definition at line 565 of file utility.c.

References bitset, g, and playinfo::obj_state.

Referenced by timing_dmp(), and vlook().

int put int  obj,
int  where,
int  pval
 

Definition at line 576 of file utility.c.

References move.

Referenced by check(), inflate(), inflateBack(), inflateBack9(), and print().

int ranz int  range  ) 
 

Definition at line 586 of file utility.c.

References rand().

Referenced by dotrav(), dwarves(), pct(), and vdrink().

boolean small int  obj  ) 
 

Definition at line 595 of file utility.c.

References bitset, g, and playinfo::obj_state.

int toting int  item  ) 
 

Definition at line 604 of file utility.c.

References enclosed(), g, holding(), and playinfo::place.

Referenced by athand(), burden(), death(), descitem(), describe(), do_hint(), do_scoop_up(), dopirate(), dotrav(), here(), ivfoo(), spcmove(), vdrop(), vextract(), vlock(), vtake(), and vyank().

boolean treasr int  obj  ) 
 

Definition at line 624 of file utility.c.

References bitset, g, and playinfo::obj_state.

Referenced by dopirate(), and score().

boolean vessel int  obj  ) 
 

Definition at line 633 of file utility.c.

References bitset, g, and playinfo::obj_state.

Referenced by ajar(), lookin(), vfill(), vinsert(), and vlook().

boolean wearng int  item  ) 
 

Definition at line 642 of file utility.c.

References bitset, g, playinfo::obj_state, and WEARBT.

Referenced by death(), inventory(), vdrink(), vinsert(), vtake(), and vwear().

boolean worn int  obj  ) 
 

Definition at line 651 of file utility.c.

References bitset, g, and playinfo::obj_state.

Referenced by vdrop(), vinsert(), vput(), and vwear().


Variable Documentation

char* e_msg[] [static]
 

Definition at line 657 of file utility.c.

Referenced by bug().


Generated on Fri Apr 14 22:58:14 2006 for minix by  doxygen 1.4.6