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

Function match_optname

src/options.c:6759–6770  ·  view source on GitHub ↗

check whether a user-supplied option string is a proper leading substring of a particular option name; option string might have a colon or equals sign and arbitrary value appended to it */

Source from the content-addressed store, hash-verified

6757 substring of a particular option name; option string might have
6758 a colon or equals sign and arbitrary value appended to it */
6759boolean
6760match_optname(const char *user_string, const char *optn_name,
6761 int min_length, boolean val_allowed)
6762{
6763 int len = (int) strlen(user_string);
6764
6765 if (val_allowed)
6766 len = length_without_val(user_string, len);
6767
6768 return (boolean) (len >= min_length
6769 && !strncmpi(optn_name, user_string, len));
6770}
6771
6772void
6773reset_duplicate_opt_detection(void)

Callers 8

parseoptionsFunction · 0.70
check_misc_menu_commandFunction · 0.70
optfn_paletteFunction · 0.70
argcheckFunction · 0.70
debug_fieldsFunction · 0.70
parse_cond_optionFunction · 0.70
windows_early_optionsFunction · 0.50

Calls 2

length_without_valFunction · 0.70
strncmpiFunction · 0.70

Tested by

no test coverage detected