14a1a9510SRong-En Fan /****************************************************************************
24a1a9510SRong-En Fan  * Copyright 2020 Thomas E. Dickey                                          *
34a1a9510SRong-En Fan  * Copyright 2005,2009 Free Software Foundation, Inc.                       *
44a1a9510SRong-En Fan  *                                                                          *
54a1a9510SRong-En Fan  * Permission is hereby granted, free of charge, to any person obtaining a  *
64a1a9510SRong-En Fan  * copy of this software and associated documentation files (the            *
74a1a9510SRong-En Fan  * "Software"), to deal in the Software without restriction, including      *
84a1a9510SRong-En Fan  * without limitation the rights to use, copy, modify, merge, publish,      *
94a1a9510SRong-En Fan  * distribute, distribute with modifications, sublicense, and/or sell       *
104a1a9510SRong-En Fan  * copies of the Software, and to permit persons to whom the Software is    *
114a1a9510SRong-En Fan  * furnished to do so, subject to the following conditions:                 *
124a1a9510SRong-En Fan  *                                                                          *
134a1a9510SRong-En Fan  * The above copyright notice and this permission notice shall be included  *
144a1a9510SRong-En Fan  * in all copies or substantial portions of the Software.                   *
154a1a9510SRong-En Fan  *                                                                          *
164a1a9510SRong-En Fan  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
174a1a9510SRong-En Fan  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
184a1a9510SRong-En Fan  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
194a1a9510SRong-En Fan  * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
204a1a9510SRong-En Fan  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
214a1a9510SRong-En Fan  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
224a1a9510SRong-En Fan  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
234a1a9510SRong-En Fan  *                                                                          *
244a1a9510SRong-En Fan  * Except as contained in this notice, the name(s) of the above copyright   *
254a1a9510SRong-En Fan  * holders shall not be used in advertising or otherwise to promote the     *
264a1a9510SRong-En Fan  * sale, use or other dealings in this Software without prior written       *
274a1a9510SRong-En Fan  * authorization.                                                           *
284a1a9510SRong-En Fan  ****************************************************************************/
294a1a9510SRong-En Fan 
304a1a9510SRong-En Fan /****************************************************************************
314a1a9510SRong-En Fan  *  Author: Thomas E. Dickey          2005                                  *
324a1a9510SRong-En Fan  *          Juergen Pfeifer           2009                                  *
334a1a9510SRong-En Fan  ****************************************************************************/
344a1a9510SRong-En Fan 
354a1a9510SRong-En Fan #include <curses.priv.h>
364a1a9510SRong-En Fan 
374a1a9510SRong-En Fan MODULE_ID("$Id: legacy_coding.c,v 1.6 2020/02/02 23:34:34 tom Exp $")
384a1a9510SRong-En Fan 
NCURSES_EXPORT(int)394a1a9510SRong-En Fan NCURSES_EXPORT(int)
404a1a9510SRong-En Fan NCURSES_SP_NAME(use_legacy_coding) (NCURSES_SP_DCLx int level)
414a1a9510SRong-En Fan {
424a1a9510SRong-En Fan     int result = ERR;
434a1a9510SRong-En Fan 
444a1a9510SRong-En Fan     T((T_CALLED("use_legacy_coding(%p,%d)"), (void *) SP_PARM, level));
454a1a9510SRong-En Fan     if (level >= 0 && level <= 2 && SP_PARM != 0) {
464a1a9510SRong-En Fan 	result = SP_PARM->_legacy_coding;
474a1a9510SRong-En Fan 	SP_PARM->_legacy_coding = level;
484a1a9510SRong-En Fan     }
49     returnCode(result);
50 }
51 
52 #if NCURSES_SP_FUNCS
53 NCURSES_EXPORT(int)
use_legacy_coding(int level)54 use_legacy_coding(int level)
55 {
56     return NCURSES_SP_NAME(use_legacy_coding) (CURRENT_SCREEN, level);
57 }
58 #endif
59