-
ctype_charset
-
to_upper_charset
-
to_lower_charset
-
sort_order_charset
For our example, we need to create ctype_elvish,
to_upper_elvish,
to_lower_elvish, and
sort_order_elvish.
If you need string collating functions, you must write your own
custom string collating functions. These functions should be named:
-
my_strnncoll_charset
-
my_strnxfrm_charset
-
my_strcoll_charset
-
my_strxfrm_charset
-
my_like_range_charset
We therefore need to create my_strnncoll_elvish,
my_strnxfrm_elvish,
my_strcoll_elvish,
my_strxfrm_elvish, and
my_like_range_elvish.
Multi-byte support requires the coding of special multi-byte
functions:
We need to create ismbchar_elvish,
ismbhead_elvish, and
mbcharlen_elvish.
With your coding complete, you need to create a comment header for
your ctype file. This header should look like
this:
/*
* This comment is parsed by configure to create ctype.c,
* so don't change it unless you know what you are doing.
*
* .configure. number_charset=[character set index number from Index file]
* .configure. strxfrm_multiply_charset=[max ratio that strings may grow
* during my_strxfrm_charset - a
* positive integer]
* .configure. mbmaxlen_charset=[size in bytes of largest char in set]
*/
For our example, this might look like:
* .configure. number_elvish=32
* .configure. strxfrm_multiply_elvish=1
* .configure. mbmaxlen_elvish=2