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

Function s_suffix

src/hacklib.c:344–359  ·  view source on GitHub ↗

return a name converted to possessive */

Source from the content-addressed store, hash-verified

342
343/* return a name converted to possessive */
344char *
345s_suffix(const char *s)
346{
347 static char buf[BUFSZ];
348
349 Strcpy(buf, s);
350 if (!strcmpi(buf, "it")) /* it -> its */
351 Strcat(buf, "s");
352 else if (!strcmpi(buf, "you")) /* you -> your */
353 Strcat(buf, "r");
354 else if (*(eos(buf) - 1) == 's') /* Xs -> Xs' */
355 Strcat(buf, "'");
356 else /* X -> X's */
357 Strcat(buf, "'s");
358 return buf;
359}
360
361/* construct a gerund (a verb formed by appending "ing" to a noun) */
362char *

Callers 15

winmisc.cFile · 0.85
cutwormFunction · 0.85
do_name.cFile · 0.85
convert_lineFunction · 0.85
stealgoldFunction · 0.85
relobjFunction · 0.85
potionhitFunction · 0.85
split_monFunction · 0.85
gold_detectFunction · 0.85
dynamic_multi_reasonFunction · 0.85
hmon_hitmon_weapon_meleeFunction · 0.85
hmon_hitmon_misc_objFunction · 0.85

Calls 1

eosFunction · 0.85

Tested by

no test coverage detected