Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ NCcollate(3) — AIX/RT 2.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ctab

NCcollate, NCcoluniq, NCeqvmap, _NCxcol, _NLxcol

Purpose

     Collates characters for international character support.

Syntax

     #include <NLchar.h>

     int NCcollate (xc)                 |      int NCcoluniq (xc)
     NLchar xc;                         |      NLchar xc;
                                        |
     int _NCxcol (index, src, xstr)     |      int NCeqvmap (ucval)
     int index;                         |      int ucval;
     NLchar **src, **xstr;              |
                                        |
     int _NLxcol (index, src, xstr)     |
     int index;                         |
     char **src;                        |
     NLchar **xstr;                     |
     Description

     The xc value is that of an extended character (NLchar).

     AIX  supports  a  user-configurable collating  order  per
     process,  using the  table file  indicated by  the NLCTAB
     environment variable.  Collating values increment from 0.
     The NLcollate  macro, called with an  NLchar, returns the
     collating value.   NCcollate returns a negative  value if
     extended collation  applies to  the NLchar.   If extended
     collation applies,  either the NLchar is  translated to a
     different character  or string of characters  before col-
     lation (1-to-n collation), or the NLchar is to collate as
     a unit  with one or  more following NLchars  (n-to-1 col-
     lation).   For example,  the  NLchar for  the code  point
     representing  "é"  might  translate to  the  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  NCcollate  determines  that extended  collation  is
     required, _NCxcol or _NLxcol should be called.

     The _NCxcol subroutine performs extended collation on the
     following:

     index    The negative value  returned from NCcollate that
              indicates that extended collation is needed.

     src      A pointer  to a string of  NLchar type, starting
              with  the  NLchar  following the  one  that  was
              passed to the NCcollate subroutine.

     xstr     A pointer to a replacement text string.

              o   For  1-to-n  collation, _NCxcol  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.

     _NCxcol returns -1 if  1-to-n collation is required (xstr
     is not  null).  If n-to-1 collation  is required, _NCxcol
     returns the collating value of the extended collation.

     The _NLxcol subroutine performs extended collation on the
     following:

     index    The negative value  returned from NCcollate that
              indicates that extended collation is needed.

     src      A  pointer to  a string  of char  type, starting
              with the  character following  the one  that was
              passed to NCcollate.

     xstr     A pointer to a replacement text string.

              o   For  1-to-n  collation, _NLxcol  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.

     _NLxcol returns -1 if  1-to-n collation is required (xstr
     is not  null).  If n-to-1 collation  is required, _NLxcol
     returns the collating value of the extended collation.

     The NCcoluniq  macro disables extended  collation, simply
     assigning each NLchar a unique value and treating it as a
     unit.  NCcoluniq  returns its  unique collating  value, a
     nonnegative  integer  that  does not  receive  a  special
     interpretation.  A  context in  which NCcoluniq  might be
     used is within character ranges in regular expressions.

     The NCeqvmap  macro is a  predicate that returns  a non-0
     value if  the corresponding NLchar begins  an equivalence
     class, a set of NLchars  that can be treated as identical
     in some  collating contexts.   For example, if  any char-
     acter 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

     The ctab command in  AIX Operating System Commands Refer-
     ence.

     "Overview of International Character Support" in Managing
     the AIX Operating System.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026