The CLIP runtime system on program start check existance of some files, and treat it content as environment variables name/value pairs. (See CLIP environment description)
The first useful file is $CLIPROOT/lang/$LANG, where value of CLIPROOT will be taken from environment, or if there is nothing, from builtin (compiled-in) value, and LANG is a value of environment (also known as locale). If LANG is empty, CLIP check also CHARSET variable.
Example 9-1. Sample $CLIPROOT/lang/ru_RU.KOI8-R file
#CLIP_KEYMAP is used in raw keyborard mode CLIP_KEYMAP=ru-koi8-r
The next file is $CLIPROOT/term/$TERM, where TERM is variable, which identified type of used terminal.
Keymaps are used in raw keyboard mode, it is possible (for now) on Linux console, and on some kind of terminals, which can be switched into scancode mode by escape sequence.
CLIP use the same keymaps as Linux kernel, and scancode processing is borrowed from the kernel sources. That means, you can easy add new keymaps and to modify it as required.
Adding new keymap:
Copy appropriate keymap from /usr/share/keymaps (on any Linux distribution):
# cp /usr/share/keymaps/i386/qwerty/ru1.kmap.gz . # gunzip ru1.kmap.gz
Use $CLIPROOT/keymaps/genmap.sh for generation CLIP-readable keymap:
# $CLIPROOT/keymaps/genmap.sh `pwd`/ru1.kmap >ru-koi8-r
|Absolute path warning|
Parameter of genmap.sh must have absolute pathname.
Copy keymap to $CLIPROOT/keymaps:
# cp ru-koi8-r $CLIPROOT/keymaps/
Charsets are used for recoding terminal input and output, for dealing with terminal pseudographics, to determine the sort order, and for recoding file and database in/out througput.
As with keymaps, CLIP use own format for storing charsets, but have utilite for generation from standard charset-to-unicode mapping.
Adding new charset:
Copy appropriate charset mapping from /usr/share/consoletrans (on any Linux distribution):
# zcat /usr/share/consoletrans/koi8-r.sfm.gz > koi8-r.uni
|Fullness of Unicode mapping|
Some Unicode mapping files provide mapping only for part of full 256 symbols in charset. For such exceptions, you probably must manually append absent characters.
Use the gen_tbl utilite for .tbl file generation:
# zcat $CLIPROOT/charsets/UnicodeData-2.1.8.txt.gz | \ # $CLIPROOT/bin/gen_tbl koi8-r.uni > koi8-r.tbl
Copy .uni and .tbl files to $CLIPROOT/charsets:
# cp koi8-r.uni koi8-r.tbl $CLIPROOT/charsets