The classification table is created with one or more entries of the form:
ctype[character1 - character2] =
ctype_classification |
ctype_classification | ...
ctype[character] = ctype_classification |
ctype_classification | ...
where character, character1 and character2 are characters represented according to the rules for Strings and Characters in Locale Data Files. The characters may appear as normal characters:
ctype[a - z] ctype['a' - 'z']
or as octal, hexadecimal or universal:
ctype['\101'] ctype['\x41'] ctype['\u41']
The usual escape sequences are also recognized: \n, \t, \a, \\, \' and so on.
On the right hand side of the equal sign, ctype_classification is one of:
An | can be used to assign a character, or range of characters, more than one classification. These keywords correspond to the names of the enum ctype_base::mask, except that alnum is not present. To get alnum simply specifiy "alpha | digit". The keyword blank is introduced, motivated by C99's isblank function.
Each of these keywords represent one bit in the ctype_base::mask. Thus for each entry into the ctype table, one must specify all attributes that apply. For example, in the "C" locale a-z are represented as:
ctype['a' - 'z'] =
xdigit | lower | alpha | graph | print