1cset(3C) Standard C Library Functions cset(3C)
2
3
4
6 cset, csetlen, csetcol, csetno, wcsetno - get information on EUC code‐
7 sets
8
10 #include <euc.h>
11
12 int csetlen(int codeset);
13
14
15 int csetcol(int codeset);
16
17
18 int csetno(unsigned char c);
19
20
21 #include <widec.h>
22
23 int wcsetno(wchar_t pc);
24
25
27 Both csetlen() and csetcol() take a code set number codeset, which
28 must be 0, 1, 2, or 3. The csetlen() function returns the number of
29 bytes needed to represent a character of the given Extended Unix Code
30 (EUC) code set, excluding the single-shift characters SS2 and SS3 for
31 codesets 2 and 3. The csetcol() function returns the number of columns
32 a character in the given EUC code set would take on the display.
33
34
35 The csetno() function is implemented as a macro that returns a codeset
36 number (0, 1, 2, or 3) for the EUC character whose first byte is c. For
37 example,
38
39 #include<euc.h>
40 ...
41 x+=csetcol(csetno(c));
42
43
44
45 increments a counter "x" (such as the cursor position) by the width of
46 the character whose first byte is c.
47
48
49 The wcsetno() function is implemented as a macro that returns a codeset
50 number (0, 1, 2, or 3) for the given process code character pc. For
51 example,
52
53 #include<euc.h>
54 #include<widec.h>
55 ...
56 x+=csetcol(wcsetno(pc));
57
58
59
60 increments a counter "x" (such as the cursor position) by the width of
61 the Process Code character pc.
62
64 These functions work only for the EUC locales.
65
66
67 The cset(), csetlen(), csetcol(), csetno(), and wcsetno() functions can
68 be used safely in multithreaded applications, as long as setlocale(3C)
69 is not being called to change the locale.
70
72 See attributes(5) for descriptions of the following attributes:
73
74
75
76
77 ┌───────────────────────────────────────────────────────────┐
78 │ ATTRIBUTE TYPE ATTRIBUTE VALUE │
79 │MT-Level MT-Safe with exceptions │
80 └───────────────────────────────────────────────────────────┘
81
83 setlocale(3C) euclen(3C), attributes(5)
84
85
86
87SunOS 5.11 16 Nov 2003 cset(3C)