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

Function prinv

src/invent.c:2874–2890  ·  view source on GitHub ↗

* Print the indicated quantity of the given object. If quan == 0L then use * the current quantity. */

Source from the content-addressed store, hash-verified

2872 * the current quantity.
2873 */
2874void
2875prinv(const char *prefix, struct obj *obj, long quan)
2876{
2877 boolean total_of = (quan && (quan < obj->quan));
2878 char totalbuf[QBUFSZ];
2879
2880 if (!prefix)
2881 prefix = "";
2882
2883 totalbuf[0] = '\0';
2884 if (total_of)
2885 Snprintf(totalbuf, sizeof totalbuf,
2886 " (%ld in total).", obj->quan);
2887 pline("%s%s%s%s", prefix, *prefix ? " " : "",
2888 xprname(obj, (char *) 0, obj_to_let(obj), !total_of, 0L, quan),
2889 flags.verbose ? totalbuf : "");
2890}
2891
2892DISABLE_WARNING_FORMAT_NONLITERAL
2893

Callers 15

ready_weaponFunction · 0.85
doswapweaponFunction · 0.85
doquiver_coreFunction · 0.85
potion_dipFunction · 0.85
on_msgFunction · 0.85
level_teleFunction · 0.85
engraveFunction · 0.85
dofireFunction · 0.85
hold_another_objectFunction · 0.85
identifyFunction · 0.85
doprwepFunction · 0.85
doorganize_coreFunction · 0.85

Calls 3

xprnameFunction · 0.85
obj_to_letFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected