Data Structures | Defines | Functions | Variables

objnam.c File Reference

#include "hack.h"
Include dependency graph for objnam.c:

Data Structures

struct  Jitem
struct  o_range
struct  alt_spellings

Defines

#define PREFIX   80
#define SCHAR_LIM   127
#define NUMOBUF   12
#define GemStone(typ)
#define BSTRCMP(base, ptr, string)   ((ptr) < base || strcmp((ptr),string))
#define BSTRCMPI(base, ptr, string)   ((ptr) < base || strcmpi((ptr),string))
#define BSTRNCMP(base, ptr, string, num)   ((ptr)<base || strncmp((ptr),string,num))
#define BSTRNCMPI(base, ptr, string, num)   ((ptr)<base||strncmpi((ptr),string,num))
#define UNDEFINED   0
#define EMPTY   1
#define SPINACH   2

Functions

STATIC_DCL char * FDECL (strprepend,(char *, const char *))
static boolean FDECL (wishymatch,(const char *, const char *, BOOLEAN_P))
static char * NDECL (nextobuf)
static void FDECL (add_erosion_words,(struct obj *, char *))
STATIC_DCL const char * FDECL (Japanese_item_name,(int i))
STATIC_OVL char * strprepend (char *s, const char *pref)
static char * nextobuf ()
char * obj_typename (int otyp)
char * simple_typename (int otyp)
boolean obj_is_pname (struct obj *obj)
char * distant_name (struct obj *obj, func)
char * fruitname (boolean juice)
char * xname (struct obj *obj)
char * mshot_xname (struct obj *obj)
boolean the_unique_obj (struct obj *obj)
static void add_erosion_words (struct obj *obj, char *prefix)
static char * doname_base (struct obj *obj, boolean with_price)
char * doname (struct obj *obj)
char * doname_with_price (struct obj *obj)
boolean not_fully_identified (struct obj *otmp)
char * corpse_xname (struct obj *otmp, boolean ignore_oquan)
char * cxname (struct obj *obj)
char * killer_xname (struct obj *obj)
const char * singular (struct obj *otmp, func)
char * an (const char *str)
char * An (char *str) const
char * the (char *str) const
char * The (char *str) const
char * aobjnam (struct obj *otmp, const char *verb)
char * Tobjnam (struct obj *otmp, const char *verb)
char * otense (struct obj *otmp, const char *verb)
char * vtense (const char *subj, const char *verb)
char * Doname2 (struct obj *obj)
char * yname (struct obj *obj)
char * Yname2 (struct obj *obj)
char * ysimple_name (struct obj *obj)
char * Ysimple_name2 (struct obj *obj)
char * makeplural (char *oldstr) const
char * makesingular (char *oldstr) const
static boolean wishymatch (char *u_str, const char *o_str, boolean retry_inverted) const
struct objreadobjnam (char *bp, struct obj *no_wish, boolean from_user)
int rnd_class (int first, int last)
STATIC_OVL const char * Japanese_item_name (int i)
const char * cloak_simple_name (struct obj *cloak)
const char * mimic_obj_name (struct monst *mtmp)

Variables

STATIC_OVL struct Jitem Japanese_items []
static const char *const special_subjs []
static const char * wrp []
static const char wrpsym []
STATIC_OVL NEARDATA struct o_range o_ranges []
struct alt_spellings spellings []

Define Documentation

#define BSTRCMP (   base,
  ptr,
  string 
)    ((ptr) < base || strcmp((ptr),string))

Referenced by makesingular(), and readobjnam().

#define BSTRCMPI (   base,
  ptr,
  string 
)    ((ptr) < base || strcmpi((ptr),string))

Referenced by makesingular(), and readobjnam().

#define BSTRNCMP (   base,
  ptr,
  string,
  num 
)    ((ptr)<base || strncmp((ptr),string,num))

Referenced by makesingular().

#define BSTRNCMPI (   base,
  ptr,
  string,
  num 
)    ((ptr)<base||strncmpi((ptr),string,num))

Referenced by makesingular().

#define EMPTY   1

Referenced by readobjnam().

#define GemStone (   typ )
Value:
(typ == FLINT ||                                \
                         (objects[typ].oc_material == GEMSTONE &&       \
                          (typ != DILITHIUM_CRYSTAL && typ != RUBY &&   \
                           typ != DIAMOND && typ != SAPPHIRE &&         \
                           typ != BLACK_OPAL &&         \
                           typ != EMERALD && typ != OPAL)))

Referenced by obj_typename(), and xname().

#define NUMOBUF   12

Referenced by nextobuf().

#define PREFIX   80
#define SCHAR_LIM   127

Referenced by readobjnam().

#define SPINACH   2

Referenced by readobjnam().

#define UNDEFINED   0

Referenced by readobjnam().


Function Documentation

static void add_erosion_words ( struct obj obj,
char *  prefix 
) [static]

References CRYSKNIFE, is_corrodeable, is_damageable, is_flammable(), is_rustprone, and Strcat.

Referenced by doname_base().

Here is the call graph for this function:

Here is the caller graph for this function:

char* an ( const char *  str )
char* An ( char *  str ) const

References an(), and highc().

Referenced by angrygods(), burn_floor_paper(), chest_shatter_msg(), convert_line(), create_camera_demon(), dokick(), hmon_hitmon(), melt_ice(), and readobjnam().

Here is the call graph for this function:

Here is the caller graph for this function:

char* aobjnam ( struct obj otmp,
const char *  verb 
)
const char* cloak_simple_name ( struct obj cloak )
char* corpse_xname ( struct obj otmp,
boolean  ignore_oquan 
)

References makeplural(), permonst::mname, mons, nambuf, nextobuf(), and Sprintf.

Referenced by cxname(), eatcorpse(), Gloves_off(), in_container(), kick_object(), out_container(), pickup_object(), revive_corpse(), rot_corpse(), singular(), and unturn_dead().

Here is the call graph for this function:

Here is the caller graph for this function:

char* cxname ( struct obj obj )

References CORPSE, corpse_xname(), FALSE, and xname().

Referenced by aobjnam(), dip(), hmon_hitmon(), sellobj(), steal(), use_whip(), and yname().

Here is the call graph for this function:

Here is the caller graph for this function:

char* distant_name ( struct obj obj,
func   
)
char* doname ( struct obj obj )
char* Doname2 ( struct obj obj )

References doname(), and highc().

Referenced by breakmsg(), doaltarobj(), dopayobj(), hitfloor(), kick_object(), mbag_item_gone(), and toss_up().

Here is the call graph for this function:

Here is the caller graph for this function:

static char* doname_base ( struct obj obj,
boolean  with_price 
) [static]
char* doname_with_price ( struct obj obj )

Name of object including price.

References doname_base(), and TRUE.

Referenced by look_here(), and query_objlist().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_DCL char* FDECL ( strprepend  ,
(char *, const char *)   
)
static void FDECL ( add_erosion_words  ,
(struct obj *, char *)   
) [static]
static boolean FDECL ( wishymatch  ,
(const char *, const char *, BOOLEAN_P)   
) [static]
STATIC_DCL const char* FDECL ( Japanese_item_name  ,
(int i)   
)
char* fruitname ( boolean  juice )

References makesingular(), nextobuf(), pl_fruit, Sprintf, and strstri().

Referenced by drinkfountain(), and peffects().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL const char* Japanese_item_name ( int  i )

References Jitem::item, Japanese_items, and Jitem::name.

Referenced by obj_typename(), and xname().

Here is the caller graph for this function:

char* killer_xname ( struct obj obj )

References an(), obj_is_pname(), objects, objclass::oc_uname, obj::onamelth, the(), and xname().

Referenced by m_throw(), and thitu().

Here is the call graph for this function:

Here is the caller graph for this function:

char* makeplural ( char *  oldstr ) const
char* makesingular ( char *  oldstr ) const

References bp, BSTRCMP, BSTRCMPI, BSTRNCMP, BSTRNCMPI, eos(), nextobuf(), Strcpy, strstri(), and WIZARD.

Referenced by checkfile(), do_class_genocide(), fruitname(), glibr(), and readobjnam().

Here is the call graph for this function:

Here is the caller graph for this function:

const char* mimic_obj_name ( struct monst mtmp )

References GOLD_PIECE, M_AP_OBJECT, obj_descr, objects, objclass::oc_descr_idx, objdescr::oc_name, and STRANGE_OBJECT.

Referenced by invault(), and mattacku().

Here is the caller graph for this function:

char* mshot_xname ( struct obj obj )

References BUFSZ, multishot::i, m_shot, multishot::n, multishot::o, ordin(), Sprintf, Strcpy, and xname().

Referenced by hmon_hitmon(), ohitmon(), thitu(), and tmiss().

Here is the call graph for this function:

Here is the caller graph for this function:

static char* NDECL ( nextobuf   ) [static]
static char* nextobuf (  ) [static]

References BUFSZ, NEARDATA, and NUMOBUF.

Referenced by an(), corpse_xname(), fruitname(), makeplural(), makesingular(), obj_typename(), otense(), the(), vtense(), xname(), yname(), and ysimple_name().

Here is the caller graph for this function:

boolean not_fully_identified ( struct obj otmp )

References ARMOR_CLASS, BALL_CLASS, COIN_CLASS, FALSE, is_corrodeable, is_flammable(), is_rustprone, is_weptool, MAIL, objects, SCR_MAIL, TRUE, undiscovered_artifact(), and WEAPON_CLASS.

Referenced by allow_category(), askchain(), count_unidentified(), ggetobj(), identify_pack(), and menu_identify().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean obj_is_pname ( struct obj obj )

References objects.

Referenced by doname_base(), killer_xname(), on_msg(), thitu(), throwit(), thrwmu(), and xname().

Here is the caller graph for this function:

char* obj_typename ( int  otyp )
char* otense ( struct obj otmp,
const char *  verb 
)
struct obj* readobjnam ( char *  bp,
struct obj no_wish,
boolean  from_user 
) [read]

true if object has been found by its description name

true if object has been found by its actual name

References A_CHAOTIC, A_LAWFUL, A_NEUTRAL, A_NONE, obj::age, Align2amask, align_str(), ALTAR, AMULET_CLASS, AMULET_OF_YENDOR, An(), ARMOR_CLASS, ART_THIEFBANE, artifact_exists(), artifact_name(), attach_egg_hatch_timeout(), bases, begin_burn(), BELL, BELL_OF_OPENING, block_point(), body_part(), flag::botl, bp, BRASS_LANTERN, BSTRCMP, BSTRCMPI, BUFSZ, can_be_hatched(), Can_fall_thru(), CANDELABRUM_OF_INVOCATION, CHEST, permonst::cnutrit, consume_oeaten(), CORPSE, obj::corpsenm, CRYSKNIFE, current_fruit, curse(), dead_species(), def_char_to_objclass(), defsyms, del_engr_at(), delete_contents(), digit(), drainlevel, EGG, EMPTY, eos(), symdef::explanation, FAKE_AMULET_OF_YENDOR, FALSE, ffruit, fruit::fid, FIGURINE, dlevel_t::flags, flags, Flying, fruit::fname, FOOD_CLASS, FOUNTAIN, fuzzymatch(), G_NOCORPSE, G_UNIQ, GEM_CLASS, genus(), GOLD_PIECE, GOLD_SYM, GRAY_DRAGON_SCALE_MAIL, GRAY_DRAGON_SCALES, HAND, Has_contents, HEAVY_IRON_BALL, HOLE, if(), ILLOBJ_CLASS, IRON_CHAIN, IRON_SAFE, IRONBARS, is_ammo, Is_box, Is_candle, is_corrodeable, is_damageable, Is_dragon_armor, Is_dragon_scales, is_flammable(), is_human, is_missile, is_poisonable, is_quest_artifact(), is_rottable(), is_rustprone, is_weptool, Jitem::item, Japanese_items, kill_egg(), LARGE_BOX, LAST_GEM, lava_effects(), LAVAPOOL, level, Levitation, levl, LOW_PM, Luck, MAGIC_LAMP, MAIL, make_grave(), makeplural(), makesingular(), maketrap(), MAXOCLASSES, mkobj(), mksobj(), mons, MS_GUARDIAN, mungspaces(), mvitals::mvflags, Jitem::name, name, name_to_mon(), nartifact_exist(), newsym(), fruit::nextf, levelflags::nfountains, NO_TRAP, NON_PM, levelflags::nsinks, NUM_OBJECTS, obj::oartifact, alt_spellings::ob, obfree(), OBJ_DESCR, obj_extract_self(), OBJ_NAME, obj_stop_timers(), dlevel_t::objects, objects, objclass::oc_class, objclass::oc_nutrition, obj::oclass, o_range::oclass, obj::oeaten, OIL_LAMP, ONAME, oname(), otmp, obj::otyp, obj::owt, place_object(), pline(), plur, PM_GRAY_DRAGON, PM_LONG_WORM, PM_LONG_WORM_TAIL, PM_MAIL_DAEMON, PM_YELLOW_DRAGON, POOL, POT_OIL, POT_WATER, POTION_CLASS, obj::quan, rindex, RING_CLASS, rn2(), rnd(), rnd_class(), ROCK, ROCKTRAP, SCALE_MAIL, SCHAR_LIM, SCR_BLANK_PAPER, SCR_MAIL, SINK, SIZE, SKELETON_KEY, SLIME_MOLD, something, alt_spellings::sp, SPBOOK_CLASS, obj::spe, SPE_BLANK_PAPER, SPE_BOOK_OF_THE_DEAD, spellings, SPINACH, start_corpse_timeout(), STATUE, STATUE_HISTORIC, Strcat, strcmpi, Strcpy, strncmpi(), strstri(), TALLOW_CANDLE, THRONE, obj::timed, TIN, title_to_mon(), trap_to_defsym, TRAPDOOR, TRAPNUM, TREE, TRUE, u, you::uconduct, you::ugold, UNDEFINED, you::ux, you::uy, you::uz, VENOM_CLASS, verysmall, WAN_WISHING, WAND_CLASS, water_damage(), WAX_CANDLE, WEAPON_CLASS, weight(), u_conduct::wisharti, wishymatch(), wizard, WIZARD, YELLOW_DRAGON_SCALES, and zeroobj.

Referenced by makewish().

Here is the call graph for this function:

Here is the caller graph for this function:

int rnd_class ( int  first,
int  last 
)

References objects, rn2(), and rnd().

Referenced by doapply(), dofindgem(), dokick(), m_initinv(), mk_mplayer(), mkbox_cnts(), pleased(), poly_obj(), and readobjnam().

Here is the call graph for this function:

Here is the caller graph for this function:

char* simple_typename ( int  otyp )

References obj_typename(), objects, objclass::oc_uname, and strstri().

Referenced by askchain(), disp_artifact_discoveries(), do_oname(), dodip(), doforce(), doloot(), lift_object(), mimic_hit_msg(), pick_lock(), pickup(), untrap(), use_candle(), and ysimple_name().

Here is the call graph for this function:

Here is the caller graph for this function:

const char* singular ( struct obj otmp,
func   
)

References CORPSE, corpse_xname(), otmp, TRUE, and xname().

Referenced by chest_shatter_msg(), doeat(), dog_eat(), doread(), food_xname(), fprefx(), hmon_hitmon(), mquaffmsg(), mreadmsg(), mswings(), mswingsm(), throw_obj(), thrwmu(), use_offensive(), and use_whip().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL char* strprepend ( char *  s,
const char *  pref 
)

References PREFIX.

Referenced by aobjnam(), and doname_base().

Here is the caller graph for this function:

char* The ( char *  str ) const
char* the ( char *  str ) const
boolean the_unique_obj ( struct obj obj )

References AMULET_OF_YENDOR, FAKE_AMULET_OF_YENDOR, FALSE, objects, and TRUE.

Referenced by artifact_score(), and doname_base().

Here is the caller graph for this function:

char* Tobjnam ( struct obj otmp,
const char *  verb 
)
char* vtense ( const char *  subj,
const char *  verb 
)

References index, nextobuf(), Strcat, strcmpi, Strcpy, strncmpi(), and vowels.

Referenced by at_your_feet(), break_armor(), E_phrase(), flooreffects(), ghitm(), grease_protect(), growl(), gulpmu(), hit(), hmon_hitmon(), Mb_hit(), miss(), otense(), rust_dmg(), use_candelabrum(), use_candle(), whimper(), and yelp().

Here is the call graph for this function:

Here is the caller graph for this function:

static boolean wishymatch ( char *  u_str,
const char *  o_str,
boolean  retry_inverted 
) const [static]

References BUFSZ, eos(), FALSE, fuzzymatch(), strcmpi, Strcpy, strncmpi(), strstri(), TRUE, and wizard.

Referenced by readobjnam().

Here is the call graph for this function:

Here is the caller graph for this function:

char* xname ( struct obj obj )

References AMULET_CLASS, AMULET_OF_YENDOR, ARMOR_CLASS, BALL_CLASS, Blind, cansee, CHAIN_CLASS, COIN_CLASS, CREAM_PIE, ELVEN_SHIELD, eos(), FAKE_AMULET_OF_YENDOR, ffruit, fruit::fid, FIGURINE, fruit::fname, FOOD_CLASS, G_UNIQ, GEM_CLASS, GemStone, permonst::geno, index, is_boots, is_cloak, Is_dragon_scales, is_gloves, is_helmet, is_poisonable, is_shield, Is_sokoprize, Japanese_item_name(), LENSES, makeplural(), MINERAL, permonst::mname, mons, fruit::nextf, nextobuf(), NON_PM, OBJ_DESCR, obj_is_pname(), OBJ_NAME, objects, objclass::oc_uname, objclass::oc_weight, ONAME, ORCISH_SHIELD, obj::otyp, piday(), PM_ARCHEOLOGIST, PM_PRIEST, PM_SAMURAI, POT_WATER, POTION_CLASS, PREFIX, RING_CLASS, ROCK_CLASS, Role_if, SCROLL_CLASS, SHIELD_OF_REFLECTION, SLIME_MOLD, SPBOOK_CLASS, SPE_BOOK_OF_THE_DEAD, Sprintf, STATUE, STATUE_HISTORIC, Strcat, Strcpy, strncmpi(), TIN, TOOL_CLASS, TRUE, type_is_pname, u, you::ux, you::uy, vegetarian, VENOM_CLASS, vowels, WAND_CLASS, and WEAPON_CLASS.

Referenced by addtobill(), animate_statue(), arti_invoke(), artifact_hit(), artifact_score(), backfire(), bagotricks(), ballfall(), begin_burn(), bhit(), boulder_hits_pool(), break_armor(), burn_floor_paper(), burn_object(), burnarmor(), bury_an_obj(), buzz(), cancel_item(), carry_count(), chest_shatter_msg(), chest_trap(), cleanup_burn(), container_contents(), cxname(), ddocall(), del_sokoprize(), destroy_item(), destroy_mitem(), dig(), dip(), do_improvisation(), do_oname(), do_play_instrument(), docall(), dodip(), doeat(), dofiretrap(), doforce(), dokick(), doloot(), doname_base(), done(), dopayobj(), doread(), dosit(), dotrap(), dozap(), drag_ball(), drop_boulder_on_monster(), drop_boulder_on_player(), end_burn(), engrave(), fire_damage(), fix_attributes_and_properties(), flooreffects(), food_xname(), forcelock(), fprefx(), get_wet(), ghitm(), hmon_hitmon(), hurtarmor(), hurtle_step(), hurtmarmor(), in_container(), in_or_out_menu(), inven_inuse(), invocation_message(), kick_object(), killer_xname(), lava_effects(), lift_object(), litroom(), lookat(), m_slips_free(), m_throw(), mdamagem(), melt_ice(), mon_wield_item(), monstone(), moverock(), mshot_xname(), mswings(), mswingsm(), mzapmsg(), obj_timer_checks(), ohitmon(), on_msg(), otransit_msg(), p_glow1(), p_glow2(), passive(), peffects(), pick_lock(), pleased(), precheck(), ready_weapon(), recharge(), revive_corpse(), see_lamp_flicker(), seffects(), select_off(), setmnotwielded(), shkcatch(), singular(), stripspe(), tamedog(), thitmonst(), throw_obj(), throwit(), thrwmu(), Tobjnam(), toss_up(), touch_artifact(), u_slip_free(), untrap(), update_mon_intrinsics(), use_bell(), use_candelabrum(), use_candle(), use_container(), use_cream_pie(), use_crystal_ball(), use_grease(), use_lamp(), use_misc(), use_offensive(), use_stone(), use_whip(), wand_explode(), water_damage(), weldmsg(), wield_tool(), zap_dig(), zap_updown(), and zapyourself().

Here is the call graph for this function:

Here is the caller graph for this function:

char* yname ( struct obj obj )

References BUFSZ, cxname(), nextobuf(), and shk_your().

Referenced by bagotricks(), cast_wizard_spell(), dip(), do_break_wand(), dochug(), domindblast(), goto_level(), recharge(), steal(), use_container(), use_grease(), use_lamp(), use_pick_axe2(), and Yname2().

Here is the call graph for this function:

Here is the caller graph for this function:

char* Yname2 ( struct obj obj )

References highc(), and yname().

Referenced by can_twoweapon(), catch_lit(), dip(), fire_damage(), see_lamp_flicker(), snuff_lit(), use_container(), and use_lamp().

Here is the call graph for this function:

Here is the caller graph for this function:

char* ysimple_name ( struct obj obj )

References BUFSZ, nextobuf(), shk_your(), and simple_typename().

Referenced by do_break_wand(), use_container(), and Ysimple_name2().

Here is the call graph for this function:

Here is the caller graph for this function:

char* Ysimple_name2 ( struct obj obj )

References highc(), and ysimple_name().

Referenced by destroy_arm().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

STATIC_OVL struct Jitem Japanese_items[]
Initial value:
 {
        { SHORT_SWORD, "wakizashi" },
        { BROADSWORD, "ninja-to" },
        { FLAIL, "nunchaku" },
        { GLAIVE, "naginata" },
        { LOCK_PICK, "osaku" },
        { WOODEN_HARP, "koto" },
        { KNIFE, "shito" },
        { PLATE_MAIL, "tanko" },
        { HELMET, "kabuto" },
        { LEATHER_GLOVES, "yugake" },
        { FOOD_RATION, "gunyoki" },
        { POT_BOOZE, "sake" },
        {0, "" }
}

Referenced by Japanese_item_name(), and readobjnam().

STATIC_OVL NEARDATA struct o_range o_ranges[]
const char* const special_subjs[] [static]
Initial value:
 {
        "erinys",
        "manes",                
        "Cyclops",
        "Hippocrates",
        "Pelias",
        "aklys",
        "amnesia",
        "paralysis",
        0
}

Referenced by readobjnam().

const char* wrp[] [static]
Initial value:
 {
        "wand", "ring", "potion", "scroll", "gem", "amulet",
        "spellbook", "spell book",
        
        "weapon", "armor", "armour", "tool", "food", "comestible",
}
const char wrpsym[] [static]