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

Function parse_cond_option

src/botl.c:1353–1371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1351}
1352
1353int
1354parse_cond_option(boolean negated, char *opts)
1355{
1356 int i, sl;
1357 const char *compareto, *uniqpart, prefix[] = "cond_";
1358
1359 if (!opts || strlen(opts) <= sizeof prefix - 1)
1360 return 2;
1361 uniqpart = opts + (sizeof prefix - 1);
1362 for (i = 0; i < CONDITION_COUNT; ++i) {
1363 compareto = condtests[i].useroption;
1364 sl = Strlen(compareto);
1365 if (match_optname(uniqpart, compareto, (sl >= 4) ? 4 : sl, FALSE)) {
1366 condopt(i, &condtests[i].choice, negated);
1367 return 0;
1368 }
1369 }
1370 return 1; /* !0 indicates error */
1371}
1372
1373/* display a menu of all available status condition options and let player
1374 toggled them on or off; returns True iff any changes are made */

Callers 1

pfxfn_cond_Function · 0.85

Calls 2

condoptFunction · 0.85
match_optnameFunction · 0.70

Tested by

no test coverage detected