WC_COLLATE(2,L) AIX Technical Reference WC_COLLATE(2,L)
-------------------------------------------------------------------------------
wc_collate, wc_coluniq, wc_eqvmap, _wcxcol, _mbxcol, _wcxcolu, _mbxcolu
PURPOSE
Collates characters for international character support.
LIBRARY
Standard C Library (libc.a)
SYNTAX
#include <NLchar.h>
long wc_collate (xc) long wc_coluniq (xc)
wchar_t xc; wchar_t xc;
int_ wcxcol (index, src, xstr) long wc_eqvmap (ucval)
long index; long ucval;
wchar_t **src, **xstr;
int_ mbxcol (index, src, xstr)
long index
wchar_t **xstr;
int_ wcxcolu (index, src, xstr)
long index;
wchar_t **src, **xstr;
int_ mbxcolu (index, src, xstr)
long index;
unsigned char **src;
wchar_t **xstr;
DESCRIPTION
AIX supports a user-configurable collating order per process, using the
environment variables LANG or LC_COLLATE (see "setlocale"). Collating values
increment from 1. The wc_collate subroutine, called with a wide character as
its argument, returns the collating value. If extended collation applies to
the wide character, wc_collate returns a negative value and the wide character
is either translated to a different character or string of characters before
collation (1-to-n collation), or it collates as a unit with one or more
characters following a wide character (n-to-1 collation). For example, the
wide character for the code point representing "o" might translate to the
Processed November 7, 1990 WC_COLLATE(2,L) 1
WC_COLLATE(2,L) AIX Technical Reference WC_COLLATE(2,L)
string "oe" before (1-to-n) collation, or two code points representing "Pi"
might translate to a unit "pi" before (n-to-1) collation.
When wc_collate determines that extended collation is required, _wcxcol or
_mbxcol should be called.
Like wc_collate, wc_coluniq may return a negative value which indicates that
extended collation is required and that _wcxcolu or _mbxcolu should be called.
The _wcxcol subroutine performs extended collation on the following:
index The negative value returned from the wide character which indicates
that extended collation is needed.
src A pointer to a wide character string, starting with the wide
character following the one that was passed to the wc_collate
subroutine.
xstr A pointer to a replacement text string.
o For 1-to-n collation, _wcxcol writes the address to xstr of a
replacement string that is interpolated into the collating
operation ahead of the remaining text of src.
o For n-to-1 collation, a NULL value is written into the pointer.
The _wcxcol subroutine returns -1 if 1-to-n collation is required (xstr is not
NULL). If n-to-1 collation is required, _wcxcol returns the collating value of
the extended collation.
The wc_coluniq subroutine disables extended collation by assigning each wchar_t
a unique value and treating it as a unit. wc_coluniq returns its unique
collating value, a non-negative integer that does not require special
interpretation. The wc_coluniq subroutine might be used, for example, within
character ranges in regular expressions.
The _wcxcolu subroutine performs extended collation on the following:
index The negative value returned from wc_coluniq, which indicates that
extended collation is needed.
src A pointer to a wide character string, starting with the wide
character following the one that was passed to the wc_coluniq
subroutine.
xstr A pointer to a replacement text string.
o For 1-to-n collation, _wcxcolu writes the address to xstr of a
replacement string that is interpolated into the collating
operation ahead of the remaining text of src.
o For n-to-1 collation, a NULL value is written to the pointer.
Processed November 7, 1990 WC_COLLATE(2,L) 2
WC_COLLATE(2,L) AIX Technical Reference WC_COLLATE(2,L)
The _wcxcolu subroutine returns -1 if 1-to-n collation is required (xstr is not
NULL). If n-to-1 collation is required, _wcxcolu returns the collating value of
the extended collation.
The wc_eqvmap macro is a predicate that returns a non-zero value if the
corresponding wide character begins an equivalence class, or a set of wide
characters that can be treated as identical in some collating contexts. For
example, if any character of an equivalence class is used as the beginning or
ending point of a character range, all of the characters in that class are
included in the range.
RELATED INFORMATION
In this book: "NCcollate, NCcoluniq, NCeqvmap, _NCxcol, _NLxcol"
Processed November 7, 1990 WC_COLLATE(2,L) 3