9103 opengroup acknowledgement should be properly formatted in man pages
[unleashed.git] / usr / src / man / man3c / cset.3c
blob5d6b7f8a39ab18257b5104f4c63c307b12a47e8f
1 '\" te
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"
7 .SH NAME
8 cset, csetlen, csetcol, csetno, wcsetno \- get information on EUC codesets
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <euc.h>
14 \fBint\fR \fBcsetlen\fR(\fBint\fR \fIcodeset\fR);
15 .fi
17 .LP
18 .nf
19 \fBint\fR \fBcsetcol\fR(\fBint\fR \fIcodeset\fR);
20 .fi
22 .LP
23 .nf
24 \fBint\fR \fBcsetno\fR(\fBunsigned char\fR \fIc\fR);
25 .fi
27 .LP
28 .nf
29 #include <widec.h>
31 \fBint\fR \fBwcsetno\fR(\fBwchar_t\fR \fIpc\fR);
32 .fi
34 .SH DESCRIPTION
35 .sp
36 .LP
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.
43 .sp
44 .LP
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.
47 For example,
48 .sp
49 .in +2
50 .nf
51 #include<euc.h>
52 \|.\|.\|.
53 x+=csetcol(csetno(c));
54 .fi
55 .in -2
57 .sp
58 .LP
59 increments a counter "x" (such as the cursor position) by the width of the
60 character whose first byte is \fIc\fR.
61 .sp
62 .LP
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
65 example,
66 .sp
67 .in +2
68 .nf
69 #include<euc.h>
70 #include<widec.h>
71 \|.\|.\|.
72 x+=csetcol(wcsetno(pc));
73 .fi
74 .in -2
76 .sp
77 .LP
78 increments a counter "x" (such as the cursor position) by the width of the
79 Process Code character \fIpc\fR.
80 .SH USAGE
81 .sp
82 .LP
83 These functions work only for the EUC locales.
84 .sp
85 .LP
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.
89 .SH ATTRIBUTES
90 .sp
91 .LP
92 See \fBattributes\fR(5) for descriptions of the following attributes:
93 .sp
95 .sp
96 .TS
97 box;
98 c | c
99 l | l .
100 ATTRIBUTE TYPE  ATTRIBUTE VALUE
102 MT-Level        MT-Safe with exceptions
105 .SH SEE ALSO
108 \fBsetlocale\fR(3C) \fBeuclen\fR(3C), \fBattributes\fR(5)