'\" te .\" Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved. .TH cset 3C "16 Nov 2003" "SunOS 5.11" "Standard C Library Functions" .SH NAME cset, csetlen, csetcol, csetno, wcsetno \- get information on EUC codesets .SH SYNOPSIS .LP .nf #include \fBint\fR \fBcsetlen\fR(\fBint\fR \fIcodeset\fR); .fi .LP .nf \fBint\fR \fBcsetcol\fR(\fBint\fR \fIcodeset\fR); .fi .LP .nf \fBint\fR \fBcsetno\fR(\fBunsigned char\fR \fIc\fR); .fi .LP .nf #include \fBint\fR \fBwcsetno\fR(\fBwchar_t\fR \fIpc\fR); .fi .SH DESCRIPTION .sp .LP Both \fBcsetlen()\fR and \fBcsetcol()\fR take a code set number \fIcodeset\fR, which must be 0, 1, 2, or 3. The \fBcsetlen()\fR function returns the number of bytes needed to represent a character of the given Extended Unix Code (EUC) code set, excluding the single-shift characters SS2 and SS3 for codesets 2 and 3. The \fBcsetcol()\fR function returns the number of columns a character in the given \fBEUC\fR code set would take on the display. .sp .LP The \fBcsetno()\fR function is implemented as a macro that returns a codeset number (0, 1, 2, or 3) for the \fBEUC\fR character whose first byte is \fIc\fR. For example, .sp .in +2 .nf #include \|.\|.\|. x+=csetcol(csetno(c)); .fi .in -2 .sp .LP increments a counter "x" (such as the cursor position) by the width of the character whose first byte is \fIc\fR. .sp .LP The \fBwcsetno()\fR function is implemented as a macro that returns a codeset number (0, 1, 2, or 3) for the given process code character \fIpc\fR. For example, .sp .in +2 .nf #include #include \|.\|.\|. x+=csetcol(wcsetno(pc)); .fi .in -2 .sp .LP increments a counter "x" (such as the cursor position) by the width of the Process Code character \fIpc\fR. .SH USAGE .sp .LP These functions work only for the EUC locales. .sp .LP The \fBcset()\fR, \fBcsetlen()\fR, \fBcsetcol()\fR, \fBcsetno()\fR, and \fBwcsetno()\fR functions can be used safely in multithreaded applications, as long as \fBsetlocale\fR(3C) is not being called to change the locale. .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) cw(2.75i) lw(2.75i) lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE MT-LevelMT-Safe with exceptions .TE .SH SEE ALSO .sp .LP \fBsetlocale\fR(3C) \fBeuclen\fR(3C), \fBattributes\fR(5)