MCPcopy Index your code
hub / github.com/NetHack/NetHack / simpleonames

Function simpleonames

src/objnam.c:2427–2442  ·  view source on GitHub ↗

"scroll" or "scrolls" */

Source from the content-addressed store, hash-verified

2425
2426/* "scroll" or "scrolls" */
2427char *
2428simpleonames(struct obj *obj)
2429{
2430 char *obufp, *simpleoname = minimal_xname(obj);
2431
2432 if (obj->quan != 1L) {
2433 /* 'simpleoname' points to an obuf; makeplural() will allocate
2434 another one and only that one can be explicitly released for
2435 re-use, so this is slightly convoluted to cope with that;
2436 makeplural() will be fully evaluated and done with its input
2437 argument before strcpy() touches its output argument */
2438 Strcpy(simpleoname, obufp = makeplural(simpleoname));
2439 releaseobuf(obufp);
2440 }
2441 return simpleoname;
2442}
2443
2444/* "a scroll" or "scrolls"; "a silver bell" or "the Bell of Opening" */
2445char *

Callers 15

dowieldFunction · 0.85
doquiver_coreFunction · 0.85
chweponFunction · 0.85
namefloorobjFunction · 0.85
remove_worn_itemFunction · 0.85
mpickobjFunction · 0.85
potion_dipFunction · 0.85
itemactionsFunction · 0.85
wielding_corpseFunction · 0.85
first_weapon_hitFunction · 0.85

Calls 3

minimal_xnameFunction · 0.85
makepluralFunction · 0.85
releaseobufFunction · 0.85

Tested by

no test coverage detected