COLLDEF(1)

NAME
colldef - convert collation sequence source definition

SYNOPSIS
colldef [-o out_file] [filename]

DESCRIPTION
colldef converts a collation sequence source definition into a format usable by the strxfrm() and strcoll() functions. It is used to define the many ways in which strings can be ordered and collated. strxfrm() transforms its first argument and places the result in its second argument. The transformed string is such that it can be correctly ordered with other transformed strings by using strcmp(), strncmp(), or memcmp(). strcoll() transforms its arguments and does a comparison.

colldef reads the collation sequence source definition from the standard input and stores the converted definition in filename. The output file produced contains the database with collating sequence information in a form usable by system commands and routines.

The collation sequence definition specifies a set of collating elements and the rules defining how strings containing these should be ordered. This is most useful for different language definitions.

The specification file can consist of three statements: charmap , substitute , and order statement is required. When charmap or substitute is supplied, these statements must be ordered as above. Any statements after the order statement are ignored.

Lines in the specification file beginning with a # are treated as comments and are ignored. Blank lines are also ignored.

charmap charmapfile charmap defines where a mapping of the character and collating element symbols to the actual character encoding can be found.

The format of charmapfile is shown below. Symbol names are separated from their values by TAB or SPACE characters. symbol-value can be specified in a hexadecimal (\x??) or octal (\???) representation, and can be only one character in length.

symbol-name1 symbol-value1 symbol-name2 symbol-value2 ...

Symbol names cannot be specified in substitute fields. Symbol names also cannot be combined with any other representation, such as, <c>h, c<h>, <c>\x68, or <c><h>. Symbol names can be used with primary and secondary ordering as in the following example.

The charmap statement is optional.

substitute char with repl The substitute statement substitutes the character char with the string repl

The substitute statement is optional.

order order_list order_list is a list of symbols, separated by semi colons, that defines the collating sequence. The special symbol, ... , specifies, in a short-hand form, symbols that are sequential in machine code order.

A symbol can be up to two characters in length and can be represented in any one of the following ways:

o The symbol itself (for example,
    a for the lower-case letter a ).

o The symbol chain (for example,
    abc )

o <octal> representation (for example,
    \141 for the letter a ).

o <hexadecimal> representation (for example,
    \x61 for the letter a ).

o The symbol name as defined in the charmap file (for example,
    <abc> for \023 abc record in charmapfile ).

o Symbols
    \a, \b, \f, \n, \r, \v are permitted in its usual C-language meaning.

The backslash character, \ , is used for continuation. In this case, no characters are permitted after the backslash character. And as a quotation mark.

Symbols enclosed in parentheses are assigned the same primary ordering but different secondary ordering. Symbols enclosed in curly brackets are assigned only the same primary ordering and different secondary ordering.

EXIT STATUS
colldef exits with the following values: 0 No errors were found and the output was successfully created. !=0 Errors were found.

FILES
/usr/share/locale/<language>/LC_COLLATE standard shared location for collation orders under the locale locale

SEE ALSO
mklocale(1), strcoll(3), strxfrm(3)