9103 opengroup acknowledgement should be properly formatted in man pages
[unleashed.git] / usr / src / man / man3c / wcswidth.3c
blobcc10360b7cd291d941db1c4a3233571c5f8fc1ed
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
30 .\"
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
35 .\"
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 .\"
42 .\"
43 .\" Copyright (c) 1992, X/Open Company Limited.  All Rights Reserved.
44 .\" Portions Copyright (c) 2002, Sun Microsystems, Inc.  All Rights Reserved
45 .\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
46 .\"
47 .TH WCSWIDTH 3C "Jul 11, 2014"
48 .SH NAME
49 wcswidth, wcswidth_l \- number of column positions of a wide-character string
50 .SH SYNOPSIS
51 .LP
52 .nf
53 #include <wchar.h>
55 \fBint\fR \fBwcswidth\fR(\fBconst wchar_t *\fR\fIpwcs\fR, \fBsize_t\fR \fIn\fR);
56 .fi
57 .LP
58 .nf
59 #include <wchar.h>
60 #include <xlocale.h>
62 \fBint\fR \fBwcswidth_l\fR(\fBconst wchar_t *\fR\fIpwcs\fR, \fBsize_t\fR \fIn\fR, \fBlocale_t\fR \fIloc\fR);
63 .fi
65 .SH DESCRIPTION
66 .sp
67 .LP
68 The \fBwcswidth()\fR function determines the number of column positions
69 required for \fIn\fR wide-character codes (or fewer than \fIn\fR wide-character
70 codes if a null wide-character code is encountered before \fIn\fR
71 wide-character codes are exhausted) in the string pointed to by \fIpwcs\fR.
72 .SH RETURN VALUES
73 .LP
74 The \fBwcswidth()\fR function either returns \fB0\fR (if \fIpwcs\fR points to a
75 null wide-character code), or returns the number of column positions to be
76 occupied by the wide-character string pointed to by \fIpwcs\fR, or returns
77 \fB\(mi1\fR (if any of the first \fIn\fR wide-character codes in the
78 wide-character string pointed to by \fIpwcs\fR is not a printing wide-character
79 code).
80 .LP
81 The function \fBwcwidth_l()\fR behaves identically to \fBwcwidth()\fR, except
82 instead of operating in the current environemtn, it operates in the environment
83 specified by \fIloc\fR.
84 .SH ERRORS
85 .LP
86 No errors are defined.
87 .SH ATTRIBUTES
88 .LP
89 See \fBattributes\fR(5) for descriptions of the following attributes:
90 .TS
91 box;
92 c | c
93 l | l .
94 ATTRIBUTE TYPE  ATTRIBUTE VALUE
96 CSI     Enabled
98 Interface Stability     Standard
100 MT-Level        MT-Safe with exceptions
103 .SH SEE ALSO
105 \fBnewlocale\fR(3C), \fBsetlocale\fR(3C), \fBuselocale\fR(3C),
106 \fBwcwidth\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)