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

Function optfn_soundlib

src/options.c:3823–3860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3821}
3822
3823staticfn int
3824optfn_soundlib(
3825 int optidx, int req, boolean negated UNUSED,
3826 char *opts, char *op)
3827{
3828 char soundlibbuf[WINTYPELEN];
3829
3830 if (req == do_init) {
3831 return optn_ok;
3832 }
3833 if (req == do_set) {
3834 /*
3835 * soundlib: option to choose the interface for binaries built
3836 * with support for more than the default interface (nosound).
3837 *
3838 * Option processing sets gc.chosen_soundlib. A later call
3839 * to activate_chosen_soundlib() actually activates it, and
3840 * sets gc.active_soundlib.
3841 */
3842 if ((op = string_for_env_opt(allopt[optidx].name, opts, FALSE))
3843 != empty_optstr) {
3844 enum soundlib_ids option_id;
3845
3846 get_soundlib_name(soundlibbuf, WINTYPELEN);
3847 option_id = soundlib_id_from_opt(op);
3848 gc.chosen_soundlib = option_id;
3849 assign_soundlib(gc.chosen_soundlib);
3850 } else
3851 return optn_err;
3852 return optn_ok;
3853 }
3854 if (req == get_val || req == get_cnf_val) {
3855 get_soundlib_name(soundlibbuf, WINTYPELEN);
3856 Sprintf(opts, "%s", soundlibbuf);
3857 return optn_ok;
3858 }
3859 return optn_ok;
3860}
3861
3862staticfn int
3863optfn_sortdiscoveries(

Callers

nothing calls this directly

Calls 4

string_for_env_optFunction · 0.85
get_soundlib_nameFunction · 0.85
soundlib_id_from_optFunction · 0.85
assign_soundlibFunction · 0.85

Tested by

no test coverage detected