Merge branch 'master' into kiconv2
[dragonfly.git] / lib / libkiconv / kiconv.3
1 .\"
2 .\" Copyright (c) 2003 Ryuichiro Imura
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 .\" SUCH DAMAGE.
25 .\"
26 .\" $FreeBSD: src/lib/libkiconv/kiconv.3,v 1.6.28.1 2009/04/15 03:14:26 kensmith Exp $
27 .\"
28 .Dd July 17, 2003
29 .Dt KICONV 3
30 .Os
31 .Sh NAME
32 .Nm kiconv_add_xlat16_cspair ,
33 .Nm kiconv_add_xlat16_cspairs ,
34 .Nm kiconv_add_xlat16_table
35 .Nd kernel side iconv library
36 .Sh LIBRARY
37 .Lb libkiconv
38 .Sh SYNOPSIS
39 .In sys/iconv.h
40 .Ft int
41 .Fo kiconv_add_xlat16_cspair
42 .Fa "const char *tocode"
43 .Fa "const char *fromcode"
44 .Fa "int flag"
45 .Fc
46 .Ft int
47 .Fo kiconv_add_xlat16_cspairs
48 .Fa "const char *foreigncode"
49 .Fa "const char *localcode"
50 .Fc
51 .Ft int
52 .Fo kiconv_add_xlat16_table
53 .Fa "const char *tocode"
54 .Fa "const char *fromcode"
55 .Fa "const void *data"
56 .Fa "int datalen"
57 .Fc
58 .Sh DESCRIPTION
59 The
60 .Nm kiconv
61 library provides multi-byte character conversion tables for kernel side
62 iconv service.
63 .Pp
64 The
65 .Fn kiconv_add_xlat16_cspair
66 function
67 defines a conversion table using
68 .Xr iconv 3
69 between
70 .Fa fromcode
71 charset and
72 .Fa tocode
73 charset.
74 You can specify
75 .Fa flag
76 to determine if
77 .Xr tolower 3
78 /
79 .Xr toupper 3
80 conversion is included in the table.
81 The
82 .Fa flag
83 has following values.
84 .Pp
85 .Bl -tag -width ".Dv KICONV_FROM_LOWER" -compact
86 .It Dv KICONV_LOWER
87 .It Dv KICONV_FROM_LOWER
88 It generates a tolower table in addition to a character conversion table.
89 The difference between two is tolower
90 .Fa tocode
91 or tolower
92 .Fa fromcode .
93 .It Dv KICONV_UPPER
94 .It Dv KICONV_FROM_UPPER
95 It generates a toupper table in addition to a character conversion table.
96 The difference between two is toupper
97 .Fa tocode
98 or toupper
99 .Fa fromcode .
100 .El
101 .Pp
102 A tolower/toupper conversion is limited to single-byte characters.
103 .Pp
104 The
105 .Fn kiconv_add_xlat16_cspairs
106 function
107 defines two conversion tables which are from
108 .Fa localcode
109 to
110 .Fa foreigncode
111 and from
112 .Fa foreigncode
113 to
114 .Fa localcode .
115 These conversion tables also contain both tolower and toupper tables.
116 .Pp
117 The
118 .Fn kiconv_add_xlat16_table
119 function
120 defines a conversion table directly pointed by
121 .Fa data
122 whose length is
123 .Fa datalen ,
124 not using
125 .Xr iconv 3 .
126 .Sh SEE ALSO
127 .Xr iconv 3 ,
128 .Xr tolower 3 ,
129 .Xr toupper 3 ,
130 .Xr iconv 9