2 .\" Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH CSET 3C "Nov 16, 2003"
8 cset, csetlen, csetcol, csetno, wcsetno \- get information on EUC codesets
14 \fBint\fR \fBcsetlen\fR(\fBint\fR \fIcodeset\fR);
19 \fBint\fR \fBcsetcol\fR(\fBint\fR \fIcodeset\fR);
24 \fBint\fR \fBcsetno\fR(\fBunsigned char\fR \fIc\fR);
31 \fBint\fR \fBwcsetno\fR(\fBwchar_t\fR \fIpc\fR);
37 Both \fBcsetlen()\fR and \fBcsetcol()\fR take a code set number \fIcodeset\fR,
38 which must be 0, 1, 2, or 3. The \fBcsetlen()\fR function returns the number of
39 bytes needed to represent a character of the given Extended Unix Code (EUC)
40 code set, excluding the single-shift characters SS2 and SS3 for codesets 2 and
41 3. The \fBcsetcol()\fR function returns the number of columns a character in
42 the given \fBEUC\fR code set would take on the display.
45 The \fBcsetno()\fR function is implemented as a macro that returns a codeset
46 number (0, 1, 2, or 3) for the \fBEUC\fR character whose first byte is \fIc\fR.
53 x+=csetcol(csetno(c));
59 increments a counter "x" (such as the cursor position) by the width of the
60 character whose first byte is \fIc\fR.
63 The \fBwcsetno()\fR function is implemented as a macro that returns a codeset
64 number (0, 1, 2, or 3) for the given process code character \fIpc\fR. For
72 x+=csetcol(wcsetno(pc));
78 increments a counter "x" (such as the cursor position) by the width of the
79 Process Code character \fIpc\fR.
83 These functions work only for the EUC locales.
86 The \fBcset()\fR, \fBcsetlen()\fR, \fBcsetcol()\fR, \fBcsetno()\fR, and
87 \fBwcsetno()\fR functions can be used safely in multithreaded applications, as
88 long as \fBsetlocale\fR(3C) is not being called to change the locale.
92 See \fBattributes\fR(5) for descriptions of the following attributes:
100 ATTRIBUTE TYPE ATTRIBUTE VALUE
102 MT-Level MT-Safe with exceptions
108 \fBsetlocale\fR(3C) \fBeuclen\fR(3C), \fBattributes\fR(5)