- if (SP != 0 && SP->_slk != 0 &&
- color_pair_number >= 0 && color_pair_number < COLOR_PAIRS) {
- TR(TRACE_ATTRS, ("... current is %s", _tracech_t(CHREF(SP->_slk->attr))));
- SetPair(SP->_slk->attr, color_pair_number);
- TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP->_slk->attr))));
- returnCode(OK);
- } else
- returnCode(ERR);
+ T((T_CALLED("slk_color(%p,%d)"), (void *) SP_PARM, (int) color_pair_number));
+
+ if (SP_PARM != 0
+ && SP_PARM->_slk != 0
+ && color_pair_number >= 0
+ && color_pair_number < SP_PARM->_pair_limit) {
+ TR(TRACE_ATTRS, ("... current is %s", _tracech_t(CHREF(SP_PARM->_slk->attr))));
+ SetPair(SP_PARM->_slk->attr, color_pair_number);
+ TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP_PARM->_slk->attr))));
+ code = OK;
+ }
+ returnCode(code);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_color(NCURSES_PAIRS_T color_pair_number)
+{
+ return NCURSES_SP_NAME(slk_color) (CURRENT_SCREEN, color_pair_number);