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

Function optfn_align_status

src/options.c:972–1019  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

970}
971
972staticfn int
973optfn_align_status(
974 int optidx, int req, boolean negated,
975 char *opts, char *op)
976{
977 if (req == do_init) {
978 return optn_ok;
979 }
980 if (req == do_set) {
981 /* WINCAP align_status:[left|top|right|bottom] */
982 op = string_for_opt(opts, negated);
983 if ((op != empty_optstr) && !negated) {
984 if (!strncmpi(op, "left", sizeof "left" - 1))
985 iflags.wc_align_status = ALIGN_LEFT;
986 else if (!strncmpi(op, "top", sizeof "top" - 1))
987 iflags.wc_align_status = ALIGN_TOP;
988 else if (!strncmpi(op, "right", sizeof "right" - 1))
989 iflags.wc_align_status = ALIGN_RIGHT;
990 else if (!strncmpi(op, "bottom", sizeof "bottom" - 1))
991 iflags.wc_align_status = ALIGN_BOTTOM;
992 else {
993 config_error_add("Unknown %s parameter '%s'",
994 allopt[optidx].name, op);
995 return optn_err;
996 }
997 } else if (negated) {
998 bad_negation(allopt[optidx].name, TRUE);
999 return optn_err;
1000 }
1001 return optn_ok;
1002 }
1003 if (req == get_val || req == get_cnf_val) {
1004 int which;
1005
1006 which = iflags.wc_align_status;
1007 Sprintf(opts, "%s",
1008 (which == ALIGN_TOP) ? "top"
1009 : (which == ALIGN_LEFT) ? "left"
1010 : (which == ALIGN_BOTTOM) ? "bottom"
1011 : (which == ALIGN_RIGHT) ? "right"
1012 : defopt);
1013 return optn_ok;
1014 }
1015 if (req == do_handler) {
1016 return handler_align_misc(optidx);
1017 }
1018 return optn_ok;
1019}
1020
1021staticfn int
1022optfn_altkeyhandling(

Callers

nothing calls this directly

Calls 5

string_for_optFunction · 0.85
config_error_addFunction · 0.85
bad_negationFunction · 0.85
handler_align_miscFunction · 0.85
strncmpiFunction · 0.70

Tested by

no test coverage detected