Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | .\"*************************************************************************** |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2 | .\" Copyright 2020-2023,2024 Thomas E. Dickey * |
| 3 | .\" Copyright 2005-2016,2017 Free Software Foundation, Inc. * |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 4 | .\" * |
| 5 | .\" Permission is hereby granted, free of charge, to any person obtaining a * |
| 6 | .\" copy of this software and associated documentation files (the * |
| 7 | .\" "Software"), to deal in the Software without restriction, including * |
| 8 | .\" without limitation the rights to use, copy, modify, merge, publish, * |
| 9 | .\" distribute, distribute with modifications, sublicense, and/or sell * |
| 10 | .\" copies of the Software, and to permit persons to whom the Software is * |
| 11 | .\" furnished to do so, subject to the following conditions: * |
| 12 | .\" * |
| 13 | .\" The above copyright notice and this permission notice shall be included * |
| 14 | .\" in all copies or substantial portions of the Software. * |
| 15 | .\" * |
| 16 | .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * |
| 17 | .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * |
| 18 | .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * |
| 19 | .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * |
| 20 | .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * |
| 21 | .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * |
| 22 | .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * |
| 23 | .\" * |
| 24 | .\" Except as contained in this notice, the name(s) of the above copyright * |
| 25 | .\" holders shall not be used in advertising or otherwise to promote the * |
| 26 | .\" sale, use or other dealings in this Software without prior written * |
| 27 | .\" authorization. * |
| 28 | .\"*************************************************************************** |
| 29 | .\" |
| 30 | .\" Author: Thomas E. Dickey |
| 31 | .\" |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 32 | .\" $Id: legacy_coding.3x,v 1.28 2024/04/20 19:13:50 tom Exp $ |
| 33 | .TH legacy_coding 3X 2024-04-20 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls" |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 34 | .SH NAME |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 35 | \fB\%use_legacy_coding\fP \- |
| 36 | override \fIcurses\fR locale encoding checks |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 37 | .SH SYNOPSIS |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 38 | .nf |
| 39 | \fB#include <curses.h> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 40 | .PP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 41 | \fBint use_legacy_coding(int \fIlevel\fP); |
| 42 | .fi |
| 43 | .SH DESCRIPTION |
| 44 | .B \%use_legacy_coding |
| 45 | is an extension to the |
| 46 | .I curses |
| 47 | library. |
| 48 | It allows the caller to change the result of \fB\%unctrl\fP(3X), |
| 49 | suppressing \fI\%isprint\fP(3)-based checks within the library that |
| 50 | would normally cause nonprinting characters to be rendered in visible |
| 51 | form. |
| 52 | The alteration affects only eight-bit characters. |
| 53 | .PP |
| 54 | The |
| 55 | .I level |
| 56 | parameter controls the result. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 57 | .RS |
| 58 | .TP 5 |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 59 | .B 0 |
| 60 | The library functions normally, |
| 61 | rendering nonprinting characters as described in \fB\%unctrl\fP(3X), |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 62 | .TP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 63 | .B 1 |
| 64 | the library ignores |
| 65 | .I \%isprint |
| 66 | for codes in the range 160-255. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 67 | .TP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 68 | .B 2 |
| 69 | the library ignores |
| 70 | .I \%isprint |
| 71 | for codes in the range 128-255. |
| 72 | It also modifies the output of \fB\%unctrl\fP(3X), |
| 73 | showing codes in the range 128-159 as is. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 74 | .RE |
| 75 | .SH RETURN VALUE |
| 76 | If the screen has not been initialized, |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 77 | or the |
| 78 | .I level |
| 79 | parameter is out of range, |
| 80 | .B \%use_legacy_coding |
| 81 | returns |
| 82 | .BR ERR . |
| 83 | Otherwise, |
| 84 | it returns the previous level: |
| 85 | .BR 0 , |
| 86 | .BR 1 , |
| 87 | or |
| 88 | .BR 2 . |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 89 | .SH PORTABILITY |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 90 | .B \%use_legacy_coding |
| 91 | is specific to |
| 92 | .IR \%ncurses . |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 93 | It was not supported on Version 7, BSD or System V implementations. |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 94 | Applications employing |
| 95 | .I \%ncurses |
| 96 | extensions should condition their use on the visibility of the |
| 97 | .B \%NCURSES_VERSION |
| 98 | preprocessor macro. |
| 99 | .SH AUTHORS |
| 100 | Thomas Dickey |
| 101 | (to support \fI\%lynx\fP(1)'s font-switching feature). |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 102 | .SH SEE ALSO |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 103 | \fB\%unctrl\fP(3X) |