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

Function optfn_glyph

src/options.c:1814–1849  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1812}
1813
1814staticfn int
1815optfn_glyph(
1816 int optidx UNUSED, int req, boolean negated,
1817 char *opts, char *op)
1818{
1819 int glyph;
1820
1821 if (req == do_init) {
1822 return optn_ok;
1823 }
1824 if (req == do_set) {
1825 /* OPTION=glyph:G_glyph/U+NNNN/r-g-b */
1826 if (negated) {
1827 if (op != empty_optstr) {
1828 bad_negation("glyph", TRUE);
1829 return optn_err;
1830 }
1831 }
1832 if (op == empty_optstr)
1833 return optn_err;
1834 /* strip leading/trailing spaces, condense internal ones (3.6.2) */
1835 mungspaces(op);
1836 if (!glyphrep_to_custom_map_entries(op, &glyph))
1837 return optn_err;
1838 return optn_ok;
1839 }
1840 if (req == get_val) {
1841 Sprintf(opts, "%s", to_be_done);
1842 return optn_ok;
1843 }
1844 if (req == get_cnf_val) {
1845 opts[0] = '\0';
1846 return optn_ok;
1847 }
1848 return optn_ok;
1849}
1850
1851staticfn int
1852optfn_hilite_status(

Callers

nothing calls this directly

Calls 3

bad_negationFunction · 0.85
mungspacesFunction · 0.85

Tested by

no test coverage detected