Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ chrtbl(M) — OpenDesktop 1.0.0y

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ascii(M)

conv(S)

ctype(S)

locale(M)

setlocale(S)


     CHRTBL(M)                                  UNIX System V



     Name
          chrtbl - create a ctype locale table


     Syntax
          chrtbl [ specfile ]


     Description
          The utility chrtbl is provided to allow new LC_CTYPE locales
          to  be  defined;  It  reads a specification file, containing
          definitions of the attributes of characters in a  particular
          character  set, and produces a binary table file, to be read
          by  setlocale(S),  which  determines  the  behavior  of  the
          ctype(S) and conv(S) routines.

          The information supplied in the specification file  consists
          of lines in the following format:

               char    type    conv

          The three fields,  which  are  separated  by  space  or  tab
          characters, have the following meanings and syntax:

          char    This is the character which is  being  defined.   It
                  may  be  specified in one of six different ways (the
                  following examples all specify the  ASCII  character
                  ``A''):

                       65       decimal
                       0101     octal
                       0x41     hexadecimal
                       'A'      quoted character
                       '\101'   quoted octal
                       '\x41'   quoted hexadecimal


          type    This specifies the classification of the  character,
                  as  reported  by the ctype(S) routines.  There are 7
                  basic classifications:

                       C   iscntrl
                       D   sdigit
                       L   islower
                       P   ispunct
                       S   isspace
                       U   isupper
                       X   isxdigit


                  Other ctype macros use combinations of these 7 basic
                  classifications.    Zero,   one  or  more  of  these
                  classification letters  can  be  specified,  in  any
                  order,   although   only  certain  combinations  are
                  logically reasonable, as follows:

                       C       control character
                       CS      spacing control character
                       U       uppercase alphabetic
                       UX      uppercase alphabetic hex digit
                       UL      dual case character
                       L       lowercase alphabetic
                       LX      lowercase alphabetic hex digit
                       DX      decimal and hex digit
                       S       spacing character
                       P       punctuation (all other printing chars)
                       blank   undefined (all classifications false)

          conv    This  optional  field  specifies  the  corresponding
                  upper  case character for a lower case character, or
                  the corresponding lower case character for an  upper
                  case  character.   Dual  case characters should have
                  their own values repeated in this field.

                  The syntax is as for the char field.

          All characters following a hash (#) are treated as a comment
          and  ignored  up  to the end of the line, unless the hash is
          within a quoted character.

          The initial LC_CTYPE table used is  that  for  the  ascii(M)
          character   set,   with  the  entries  for  the  higher  128
          characters  (0x80  -   0xff)   set   to   zero   (i.e.   all
          classifications  false).   Thus  an empty specification file
          will result in a table for US ASCII  .   Any  specifications
          found   in   the   input   to   chrtbl  will  overwrite  the
          specifications for that character only, thus  additions  and
          modifications  to  the  ASCII  table  can  be  made  without
          respecifying those characters which are unchanged.

          The binary table output is placed in  a  file  named  ctype,
          within the current directory.  This file should be copied or
          linked to the correct place in the setlocale file tree  (see
          locale(M)).   To prevent accidental corruption of the output
          data, the file is created with no write permission;  if  the
          chrtbl  utility  is  run  in a directory containing a write-
          protected ``ctype''  file,  the  utility  will  ask  if  the
          existing  file  should  be replaced; any response other than
          ``yes'' or ``y'' will  cause  chrtbl  to  terminate  without
          overwriting the existing file.

          If the  specfile  argument  is  missing,  the  specification
          information is read from the standard input.


     Diagnostics
          If the input  table  file  cannot  be  opened  for  reading,
          processing  will  terminate with the error message, ``Cannot
          open specification file''.

          Any lines in the specification file which are  syntactically
          incorrect  will  cause  an error message to be issued to the
          standard error output, specifying the line number  on  which
          the  error  was  detected.   The  line  will be ignored, and
          processing will continue.

          If the output file, ``ctype'', cannot be opened for writing,
          processing  will  terminate with the error message, ``Cannot
          create table file.''

          Any error conditions encountered will cause the  program  to
          exit  with  a non-zero return code; successful completion is
          indicated with a zero return code.


     Specification File Format
          The chrtbl specification file has the following format  (the
          order of the specifications is not significant):

          #
          # chrtbl file for TVI 7-bit Spanish character set
          # Note that only non-ASCII characters need be specified
          #
          '@'    P         # inverted ?
          '['    L   ']'   # n tilde
          '\\'   P         # inverted !
          ']'    U   '['   # N tilde
          '~'    P         # degree sign

     Files
          /usr/include/ctype.h


     See Also
          ascii(M), conv(S), ctype(S), locale(M), setlocale(S)


     Value Added
          chrtbl is an extension of AT&T  System  V  provided  by  the
          Santa Cruz Operation.


     (printed 8/23/89)                                  CHRTBL(M)

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