xref: /titanic_44/usr/src/man/man3c/getwidth.3c (revision 430b4c467020edf2445feb0c21db01c88b86243a)
te
Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved
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.
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.
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]
getwidth 3C "20 Dec 1996" "SunOS 5.11" "Standard C Library Functions"
NAME
getwidth - get codeset information
SYNOPSIS

#include <euc.h>
#include <getwidth.h>

void getwidth(eucwidth_t *ptr);
DESCRIPTION

The getwidth() function reads the character class table for the current locale to get information on the supplementary codesets. getwidth() sets this information into the struct eucwidth_t. This struct is defined in <euc.h> and has the following members:

short int _eucw1,_eucw2,_eucw3;
short int _scrw1,_scrw2,_scrw3;
short int _pcw;
char _multibyte;

Codeset width values for supplementary codesets 1, 2, and 3 are set in _eucw1, _eucw2, and _eucw3, respectively. Screen width values for supplementary codesets 1, 2, and 3 are set in _scrw1, _scrw2, and _scrw3, respectively.

The width of Extended Unix Code (EUC) Process Code is set in _pcw. The _multibyte entry is set to 1 if multibyte characters are used, and set to 0 if only single-byte characters are used.

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
MT-LevelMT-Safe with exceptions
SEE ALSO

euclen(3C), setlocale(3C), attributes(5)

NOTES

The getwidth() function can be used safely in a multithreaded application, as long as setlocale(3C) is not being called to change the locale.

The getwidth() function will only work with EUC locales.