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

Function saveoptstr

src/options.c:757–772  ·  view source on GitHub ↗

to track some unparsed option settings in case #saveoptions needs them */

Source from the content-addressed store, hash-verified

755
756/* to track some unparsed option settings in case #saveoptions needs them */
757staticfn void
758saveoptstr(int optidx, const char *optstr)
759{
760 int phase = go.opt_phase, roleoptindx = opt2roleopt(optidx);
761 const char *p = strchr(optstr, ':'), *q = strchr(optstr, '=');
762
763 /* strip away "optname:" from optname:optstr */
764 if (!p || (q && q < p))
765 p = q;
766 if (p)
767 optstr = p + 1;
768
769 if (roleoptvals[roleoptindx][phase])
770 free((genericptr_t) roleoptvals[roleoptindx][phase]);
771 roleoptvals[roleoptindx][phase] = dupstr(optstr);
772}
773
774/* discard specific saved option string */
775staticfn void

Callers 5

optfn_alignmentFunction · 0.85
optfn_genderFunction · 0.85
optfn_raceFunction · 0.85
optfn_roleFunction · 0.85
parse_role_optFunction · 0.85

Calls 2

opt2roleoptFunction · 0.85
dupstrFunction · 0.85

Tested by

no test coverage detected