1*c7ef0cfcSnicm /* $OpenBSD: legacy_coding.c,v 1.2 2023/10/17 09:52:08 nicm Exp $ */
281d8c4e1Snicm
381d8c4e1Snicm /****************************************************************************
4*c7ef0cfcSnicm * Copyright 2020 Thomas E. Dickey *
5*c7ef0cfcSnicm * Copyright 2005,2009 Free Software Foundation, Inc. *
681d8c4e1Snicm * *
781d8c4e1Snicm * Permission is hereby granted, free of charge, to any person obtaining a *
881d8c4e1Snicm * copy of this software and associated documentation files (the *
981d8c4e1Snicm * "Software"), to deal in the Software without restriction, including *
1081d8c4e1Snicm * without limitation the rights to use, copy, modify, merge, publish, *
1181d8c4e1Snicm * distribute, distribute with modifications, sublicense, and/or sell *
1281d8c4e1Snicm * copies of the Software, and to permit persons to whom the Software is *
1381d8c4e1Snicm * furnished to do so, subject to the following conditions: *
1481d8c4e1Snicm * *
1581d8c4e1Snicm * The above copyright notice and this permission notice shall be included *
1681d8c4e1Snicm * in all copies or substantial portions of the Software. *
1781d8c4e1Snicm * *
1881d8c4e1Snicm * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
1981d8c4e1Snicm * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
2081d8c4e1Snicm * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
2181d8c4e1Snicm * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
2281d8c4e1Snicm * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
2381d8c4e1Snicm * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
2481d8c4e1Snicm * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
2581d8c4e1Snicm * *
2681d8c4e1Snicm * Except as contained in this notice, the name(s) of the above copyright *
2781d8c4e1Snicm * holders shall not be used in advertising or otherwise to promote the *
2881d8c4e1Snicm * sale, use or other dealings in this Software without prior written *
2981d8c4e1Snicm * authorization. *
3081d8c4e1Snicm ****************************************************************************/
3181d8c4e1Snicm
3281d8c4e1Snicm /****************************************************************************
33*c7ef0cfcSnicm * Author: Thomas E. Dickey 2005 *
34*c7ef0cfcSnicm * Juergen Pfeifer 2009 *
3581d8c4e1Snicm ****************************************************************************/
3681d8c4e1Snicm
3781d8c4e1Snicm #include <curses.priv.h>
3881d8c4e1Snicm
39*c7ef0cfcSnicm MODULE_ID("$Id: legacy_coding.c,v 1.2 2023/10/17 09:52:08 nicm Exp $")
4081d8c4e1Snicm
NCURSES_EXPORT(int)4181d8c4e1Snicm NCURSES_EXPORT(int)
42*c7ef0cfcSnicm NCURSES_SP_NAME(use_legacy_coding) (NCURSES_SP_DCLx int level)
4381d8c4e1Snicm {
4481d8c4e1Snicm int result = ERR;
4581d8c4e1Snicm
46*c7ef0cfcSnicm T((T_CALLED("use_legacy_coding(%p,%d)"), (void *) SP_PARM, level));
47*c7ef0cfcSnicm if (level >= 0 && level <= 2 && SP_PARM != 0) {
48*c7ef0cfcSnicm result = SP_PARM->_legacy_coding;
49*c7ef0cfcSnicm SP_PARM->_legacy_coding = level;
5081d8c4e1Snicm }
5181d8c4e1Snicm returnCode(result);
5281d8c4e1Snicm }
53*c7ef0cfcSnicm
54*c7ef0cfcSnicm #if NCURSES_SP_FUNCS
55*c7ef0cfcSnicm NCURSES_EXPORT(int)
use_legacy_coding(int level)56*c7ef0cfcSnicm use_legacy_coding(int level)
57*c7ef0cfcSnicm {
58*c7ef0cfcSnicm return NCURSES_SP_NAME(use_legacy_coding) (CURRENT_SCREEN, level);
59*c7ef0cfcSnicm }
60*c7ef0cfcSnicm #endif
61