blob: ccfdd5564bb9cbbfd6dd4ce93a6a0e8c2713c195 [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301.\"***************************************************************************
micky3879b9f5e72025-07-08 18:04:53 -04002.\" Copyright 2020-2023,2024 Thomas E. Dickey *
3.\" Copyright 2005-2016,2017 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05304.\" *
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.\"
micky3879b9f5e72025-07-08 18:04:53 -040032.\" $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 Kachhape6a01f52011-07-20 11:45:59 +053034.SH NAME
micky3879b9f5e72025-07-08 18:04:53 -040035\fB\%use_legacy_coding\fP \-
36override \fIcurses\fR locale encoding checks
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053037.SH SYNOPSIS
micky3879b9f5e72025-07-08 18:04:53 -040038.nf
39\fB#include <curses.h>
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053040.PP
micky3879b9f5e72025-07-08 18:04:53 -040041\fBint use_legacy_coding(int \fIlevel\fP);
42.fi
43.SH DESCRIPTION
44.B \%use_legacy_coding
45is an extension to the
46.I curses
47library.
48It allows the caller to change the result of \fB\%unctrl\fP(3X),
49suppressing \fI\%isprint\fP(3)-based checks within the library that
50would normally cause nonprinting characters to be rendered in visible
51form.
52The alteration affects only eight-bit characters.
53.PP
54The
55.I level
56parameter controls the result.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053057.RS
58.TP 5
micky3879b9f5e72025-07-08 18:04:53 -040059.B 0
60The library functions normally,
61rendering nonprinting characters as described in \fB\%unctrl\fP(3X),
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053062.TP
micky3879b9f5e72025-07-08 18:04:53 -040063.B 1
64the library ignores
65.I \%isprint
66for codes in the range 160-255.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053067.TP
micky3879b9f5e72025-07-08 18:04:53 -040068.B 2
69the library ignores
70.I \%isprint
71for codes in the range 128-255.
72It also modifies the output of \fB\%unctrl\fP(3X),
73showing codes in the range 128-159 as is.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053074.RE
75.SH RETURN VALUE
76If the screen has not been initialized,
micky3879b9f5e72025-07-08 18:04:53 -040077or the
78.I level
79parameter is out of range,
80.B \%use_legacy_coding
81returns
82.BR ERR .
83Otherwise,
84it returns the previous level:
85.BR 0 ,
86.BR 1 ,
87or
88.BR 2 .
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053089.SH PORTABILITY
micky3879b9f5e72025-07-08 18:04:53 -040090.B \%use_legacy_coding
91is specific to
92.IR \%ncurses .
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053093It was not supported on Version 7, BSD or System V implementations.
micky3879b9f5e72025-07-08 18:04:53 -040094Applications employing
95.I \%ncurses
96extensions should condition their use on the visibility of the
97.B \%NCURSES_VERSION
98preprocessor macro.
99.SH AUTHORS
100Thomas Dickey
101(to support \fI\%lynx\fP(1)'s font-switching feature).
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530102.SH SEE ALSO
micky3879b9f5e72025-07-08 18:04:53 -0400103\fB\%unctrl\fP(3X)