MCPcopy Create free account
hub / github.com/NetHack/NetHack / food_xname

Function food_xname

src/eat.c:216–235  ·  view source on GitHub ↗

``[the(] singular(food, xname) [)]'' */

Source from the content-addressed store, hash-verified

214
215/* ``[the(] singular(food, xname) [)]'' */
216staticfn const char *
217food_xname(struct obj *food, boolean the_pfx)
218{
219 const char *result;
220
221 if (food->otyp == CORPSE) {
222 result = corpse_xname(food, (const char *) 0,
223 CXN_SINGULAR | (the_pfx ? CXN_PFX_THE : 0));
224 /* not strictly needed since pname values are capitalized
225 and the() is a no-op for them */
226 if (type_is_pname(&mons[food->corpsenm]))
227 the_pfx = FALSE;
228 } else {
229 /* the ordinary case */
230 result = singular(food, xname);
231 }
232 if (the_pfx)
233 result = the(result);
234 return result;
235}
236
237/* Created by GAN 01/28/87
238 * Amended by AKP 09/22/87: if not hard, don't choke, just vomit.

Callers 5

done_eatingFunction · 0.85
eatcorpseFunction · 0.85
start_eatingFunction · 0.85
doeat_nonfoodFunction · 0.85
doeatFunction · 0.85

Calls 3

corpse_xnameFunction · 0.85
singularFunction · 0.85
theFunction · 0.85

Tested by

no test coverage detected