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

Function convert_arg

src/questpgr.c:235–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235staticfn void
236convert_arg(char c)
237{
238 const char *str;
239
240 switch (c) {
241 case 'p':
242 str = svp.plname;
243 break;
244 case 'c':
245 str = (flags.female && gu.urole.name.f) ? gu.urole.name.f
246 : gu.urole.name.m;
247 break;
248 case 'r':
249 str = rank_of(u.ulevel, Role_switch, flags.female);
250 break;
251 case 'R':
252 str = rank_of(MIN_QUEST_LEVEL, Role_switch, flags.female);
253 break;
254 case 's':
255 str = (flags.female) ? "sister" : "brother";
256 break;
257 case 'S':
258 str = (flags.female) ? "daughter" : "son";
259 break;
260 case 'l':
261 str = ldrname();
262 break;
263 case 'i':
264 str = intermed();
265 break;
266 case 'O':
267 case 'o':
268 str = the(artiname(gu.urole.questarti));
269 if (c == 'O') {
270 /* shorten "the Foo of Bar" to "the Foo"
271 (buffer returned by the() is modifiable) */
272 char *p = strstri(str, " of ");
273
274 if (p)
275 *p = '\0';
276 }
277 break;
278 case 'n':
279 str = neminame();
280 break;
281 case 'g':
282 str = guardname();
283 break;
284 case 'G':
285 str = align_gtitle(u.ualignbase[A_ORIGINAL]);
286 break;
287 case 'H':
288 str = homebase();
289 break;
290 case 'a':
291 str = align_str(u.ualignbase[A_ORIGINAL]);
292 break;

Callers 1

convert_lineFunction · 0.85

Calls 12

rank_ofFunction · 0.85
ldrnameFunction · 0.85
intermedFunction · 0.85
theFunction · 0.85
artinameFunction · 0.85
strstriFunction · 0.85
neminameFunction · 0.85
guardnameFunction · 0.85
align_gtitleFunction · 0.85
homebaseFunction · 0.85
align_strFunction · 0.85
align_gnameFunction · 0.85

Tested by

no test coverage detected