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

Function optfn_hilite_status

src/options.c:1851–1894  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1849}
1850
1851staticfn int
1852optfn_hilite_status(
1853 int optidx UNUSED,
1854 int req,
1855 boolean negated,
1856 char *opts,
1857 char *op)
1858{
1859 if (req == do_init) {
1860 return optn_ok;
1861 }
1862 if (req == do_set) {
1863 /* hilite fields in status prompt */
1864#ifdef STATUS_HILITES
1865 op = string_for_opt(opts, TRUE);
1866 if (op != empty_optstr && negated) {
1867 clear_status_hilites();
1868 return optn_ok;
1869 } else if (op == empty_optstr) {
1870 config_error_add("Value is mandatory for hilite_status");
1871 return optn_err;
1872 }
1873 if (!parse_status_hl1(op, go.opt_from_file))
1874 return optn_err;
1875 return optn_ok;
1876#else
1877 nhUse(negated);
1878 nhUse(op);
1879 config_error_add("'%s' is not supported", allopt[optidx].name);
1880 return optn_err;
1881#endif
1882 }
1883 if (req == get_val || req == get_cnf_val) {
1884 opts[0] = '\0';
1885#ifdef STATUS_HILITES
1886 if (req == get_val)
1887 Strcpy(opts, count_status_hilites()
1888 ? "(see \"status highlight rules\" below)"
1889 : "(none)");
1890#endif
1891 return optn_ok;
1892 }
1893 return optn_ok;
1894}
1895
1896staticfn int
1897optfn_horsename(

Callers

nothing calls this directly

Calls 5

string_for_optFunction · 0.85
clear_status_hilitesFunction · 0.85
config_error_addFunction · 0.85
parse_status_hl1Function · 0.85
count_status_hilitesFunction · 0.85

Tested by

no test coverage detected