Deleted Added
full compact
colldef.1 (95124) colldef.1 (102299)
1.\" Copyright (c) 1995 Alex Tatmanjants <alex@elvisti.kiev.ua>
2.\" at Electronni Visti IA, Kiev, Ukraine.
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 ``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 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.\"
1.\" Copyright (c) 1995 Alex Tatmanjants <alex@elvisti.kiev.ua>
2.\" at Electronni Visti IA, Kiev, Ukraine.
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 ``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 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: head/usr.bin/colldef/colldef.1 95124 2002-04-20 12:18:28Z charnier $
26.\" $FreeBSD: head/usr.bin/colldef/colldef.1 102299 2002-08-23 04:18:26Z ache $
27.\"
28.Dd January 27, 1995
29.Dt COLLDEF 1
30.Os
31.Sh NAME
32.Nm colldef
33.Nd convert collation sequence source definition
34.Sh SYNOPSIS
35.Nm
36.Op Fl I Ar map_dir
37.Op Fl o Ar out_file
38.Op Ar filename
39.Sh DESCRIPTION
40The
41.Nm
42utility converts a collation sequence source definition
43into a format usable by the
44.Fn strxfrm
45and
46.Fn strcoll
47functions.
48It is used to define the many ways in which
49strings can be ordered and collated.
50.Fn strxfrm
51transforms
52its first argument and places the result in its second
53argument.
54The transformed string is such that it can be
55correctly ordered with other transformed strings by using
56.Fn strcmp ,
57.Fn strncmp ,
58or
59.Fn memcmp .
60.Fn strcoll
61transforms its arguments and does a
62comparison.
63.Pp
64The
65.Nm
66utility reads the collation sequence source definition
67from the standard input and stores the converted definition in filename.
68The output file produced contains the
69database with collating sequence information in a form
70usable by system commands and routines.
71.Pp
72Options list:
73.Bl -tag -width 4n
74.It Fl I Ar map_dir
75This option set directory name where
76.Ar charmap
77files can be found, current directory by default.
78.It Fl o Ar out_file
79This option set output file name,
80.Ar LC_COLLATE
81by default.
82.El
83.Pp
84The collation sequence definition specifies a set of collating elements and
85the rules defining how strings containing these should be ordered.
86This is most useful for different language definitions.
87.Pp
88The specification file can consist of three statements:
89.Ar charmap ,
90.Ar substitute
91and
92.Ar order .
93.Pp
94Of these, only the
95.Ar order
96statement is required.
97When
98.Ar charmap
99or
100.Ar substitute
101is
102supplied, these statements must be ordered as above.
103Any
104statements after the order statement are ignored.
105.Pp
106Lines in the specification file beginning with a
107.Ar #
108are
109treated as comments and are ignored.
110Blank lines are also
111ignored.
112.Pp
113.Ar charmap charmapfile
114.Pp
115.Ar charmap
116defines where a mapping of the character
117and collating element symbols to the actual
118character encoding can be found.
119.Pp
120The format of
121.Ar charmapfile
122is shown below.
123Symbol
124names are separated from their values by TAB or
125SPACE characters. symbol-value can be specified in
126a hexadecimal (\ex\fI??\fR) or octal (\e\fI???\fR)
127representation, and can be only one character in length.
128.Bd -literal
129.Ar symbol-name1 symbol-value1
130.Ar symbol-name2 symbol-value2
131.Ar ...
132.Ed
133.Pp
134The
135.Ar charmap
136statement is optional.
137.Pp
138.Ar substitute
139\fIsymbol\fR
140.Ar with
141"\fIrepl_string\fR"
142.Pp
143The
144.Ar substitute
145statement substitutes the character
146.Ar symbol
147with the string
148.Ar repl_string .
149Symbol names cannot be specified in
150.Ar repl_string
151field.
152The
153.Ar substitute
154statement is optional.
155.Pp
156.Ar order order_list
157.Pp
158.Ar order_list
159is a list of symbols, separated by semi colons, that defines the
160collating sequence.
161The
162special symbol
163.Ar ...
164specifies, in a short-hand
165form, symbols that are sequential in machine code
166order.
167.Pp
168An order list element
169can be represented in any one of the following
170ways:
171.Bl -bullet
172.It
173The symbol itself (for example,
174.Ar a
175for the lower-case letter
176.Ar a )
177.It
27.\"
28.Dd January 27, 1995
29.Dt COLLDEF 1
30.Os
31.Sh NAME
32.Nm colldef
33.Nd convert collation sequence source definition
34.Sh SYNOPSIS
35.Nm
36.Op Fl I Ar map_dir
37.Op Fl o Ar out_file
38.Op Ar filename
39.Sh DESCRIPTION
40The
41.Nm
42utility converts a collation sequence source definition
43into a format usable by the
44.Fn strxfrm
45and
46.Fn strcoll
47functions.
48It is used to define the many ways in which
49strings can be ordered and collated.
50.Fn strxfrm
51transforms
52its first argument and places the result in its second
53argument.
54The transformed string is such that it can be
55correctly ordered with other transformed strings by using
56.Fn strcmp ,
57.Fn strncmp ,
58or
59.Fn memcmp .
60.Fn strcoll
61transforms its arguments and does a
62comparison.
63.Pp
64The
65.Nm
66utility reads the collation sequence source definition
67from the standard input and stores the converted definition in filename.
68The output file produced contains the
69database with collating sequence information in a form
70usable by system commands and routines.
71.Pp
72Options list:
73.Bl -tag -width 4n
74.It Fl I Ar map_dir
75This option set directory name where
76.Ar charmap
77files can be found, current directory by default.
78.It Fl o Ar out_file
79This option set output file name,
80.Ar LC_COLLATE
81by default.
82.El
83.Pp
84The collation sequence definition specifies a set of collating elements and
85the rules defining how strings containing these should be ordered.
86This is most useful for different language definitions.
87.Pp
88The specification file can consist of three statements:
89.Ar charmap ,
90.Ar substitute
91and
92.Ar order .
93.Pp
94Of these, only the
95.Ar order
96statement is required.
97When
98.Ar charmap
99or
100.Ar substitute
101is
102supplied, these statements must be ordered as above.
103Any
104statements after the order statement are ignored.
105.Pp
106Lines in the specification file beginning with a
107.Ar #
108are
109treated as comments and are ignored.
110Blank lines are also
111ignored.
112.Pp
113.Ar charmap charmapfile
114.Pp
115.Ar charmap
116defines where a mapping of the character
117and collating element symbols to the actual
118character encoding can be found.
119.Pp
120The format of
121.Ar charmapfile
122is shown below.
123Symbol
124names are separated from their values by TAB or
125SPACE characters. symbol-value can be specified in
126a hexadecimal (\ex\fI??\fR) or octal (\e\fI???\fR)
127representation, and can be only one character in length.
128.Bd -literal
129.Ar symbol-name1 symbol-value1
130.Ar symbol-name2 symbol-value2
131.Ar ...
132.Ed
133.Pp
134The
135.Ar charmap
136statement is optional.
137.Pp
138.Ar substitute
139\fIsymbol\fR
140.Ar with
141"\fIrepl_string\fR"
142.Pp
143The
144.Ar substitute
145statement substitutes the character
146.Ar symbol
147with the string
148.Ar repl_string .
149Symbol names cannot be specified in
150.Ar repl_string
151field.
152The
153.Ar substitute
154statement is optional.
155.Pp
156.Ar order order_list
157.Pp
158.Ar order_list
159is a list of symbols, separated by semi colons, that defines the
160collating sequence.
161The
162special symbol
163.Ar ...
164specifies, in a short-hand
165form, symbols that are sequential in machine code
166order.
167.Pp
168An order list element
169can be represented in any one of the following
170ways:
171.Bl -bullet
172.It
173The symbol itself (for example,
174.Ar a
175for the lower-case letter
176.Ar a )
177.It
178The symbol chain (for example,
179.Ar abc )
180.It
181In octal representation (for example,
178The symbol in octal representation (for example,
182.Ar \e141
183for the letter
184.Ar a )
185.It
179.Ar \e141
180for the letter
181.Ar a )
182.It
186In hexadecimal representation (for example,
183The symbol in hexadecimal representation (for example,
187.Ar \ex61
188for the letter
189.Ar a )
190.It
191The symbol name as defined in the
192.Ar charmap
193file (for example,
184.Ar \ex61
185for the letter
186.Ar a )
187.It
188The symbol name as defined in the
189.Ar charmap
190file (for example,
194.Ar <abc>
191.Ar <letterA>
195for
192for
196.Ar abc \e023
193.Ar letterA \e023
197record in
198.Ar charmapfile ) .
199If character map name have
200.Ar >
201character, it must be escaped as
202.Ar /> ,
203single
204.Ar /
205must be escaped as
206.Ar // .
207.It
208Symbols
209.Ar \ea ,
210.Ar \eb ,
211.Ar \ef ,
212.Ar \en ,
213.Ar \er ,
214.Ar \ev
215are permitted in its usual C-language meaning
216.It
194record in
195.Ar charmapfile ) .
196If character map name have
197.Ar >
198character, it must be escaped as
199.Ar /> ,
200single
201.Ar /
202must be escaped as
203.Ar // .
204.It
205Symbols
206.Ar \ea ,
207.Ar \eb ,
208.Ar \ef ,
209.Ar \en ,
210.Ar \er ,
211.Ar \ev
212are permitted in its usual C-language meaning
213.It
214The symbol chain (for example:
215.Ar abc ,
216.Ar <letterA><letterB> ,
217.Ar \exf1\exf2 )
218.It
217The symbol range (for example,
218.Ar a;...;z )
219.It
220Comma-separated symbols, ranges and chains enclosed in parenthesis (for example
221.Ar \&(
222.Ar sym1 ,
223.Ar sym2 ,
224.Ar ...
225.Ar \&) )
226are assigned the
227same primary ordering but different secondary
228ordering.
229.It
230Comma-separated symbols, ranges and chains enclosed in curly brackets (for example
231.Ar \&{
232.Ar sym1 ,
233.Ar sym2 ,
234.Ar ...
235.Ar \&} )
236are assigned the same primary ordering only.
237.El
238.Pp
239The backslash character
240.Ar \e
241is used for continuation.
242In this case, no characters are permitted
243after the backslash character.
244.Sh DIAGNOSTICS
245The
246.Nm
247utility exits with the following values:
248.Bl -tag -width indent
249.It Li 0
250No errors were found and the output was successfully created.
251.It Li !=0
252Errors were found.
253.El
254.Sh FILES
255.Ar /usr/share/locale/<language>/LC_COLLATE
256standard shared location for collation orders
257under the locale locale
258.Sh SEE ALSO
259.Xr mklocale 1 ,
260.Xr setlocale 3 ,
261.Xr strcoll 3 ,
262.Xr strxfrm 3
219The symbol range (for example,
220.Ar a;...;z )
221.It
222Comma-separated symbols, ranges and chains enclosed in parenthesis (for example
223.Ar \&(
224.Ar sym1 ,
225.Ar sym2 ,
226.Ar ...
227.Ar \&) )
228are assigned the
229same primary ordering but different secondary
230ordering.
231.It
232Comma-separated symbols, ranges and chains enclosed in curly brackets (for example
233.Ar \&{
234.Ar sym1 ,
235.Ar sym2 ,
236.Ar ...
237.Ar \&} )
238are assigned the same primary ordering only.
239.El
240.Pp
241The backslash character
242.Ar \e
243is used for continuation.
244In this case, no characters are permitted
245after the backslash character.
246.Sh DIAGNOSTICS
247The
248.Nm
249utility exits with the following values:
250.Bl -tag -width indent
251.It Li 0
252No errors were found and the output was successfully created.
253.It Li !=0
254Errors were found.
255.El
256.Sh FILES
257.Ar /usr/share/locale/<language>/LC_COLLATE
258standard shared location for collation orders
259under the locale locale
260.Sh SEE ALSO
261.Xr mklocale 1 ,
262.Xr setlocale 3 ,
263.Xr strcoll 3 ,
264.Xr strxfrm 3