FreeBSD Manual Pages
mapchan(8) 06 January 1993 mapchan(8) NAME mapchan - format of tty device mapping files DESCRIPTION mapchan configures the mapping of information input and out- put. Each unique channel map requires a multiple of 1024 bytes (a 1K buffer) for mapping the input and output of characters. No buffers are required if no channels are mapped. If control sequences are speci- fied, an addi- tional 1K buffer is required. A method of sharing maps is implemented for channels that have the same map in place. Each additional, unique map allocates an addi- tional buffer. The maximum number of map buffers available on a system is configured in the kernel, and is adjustable via the link kit NEMAP parame- ter (see con- figure(ADM)). Buffers of maps no longer in use are returned for use by other maps. Example of a map file The internal character set is defined by the right column of the input map, and the first column of the output map in place on that line. The default internal character set is the 8-bit ISO 8859/1 char- acter set, which is also known as dpANS X3.4.2 and ISO/TC97/SC2. It supports the Latin alphabet and can represent most European languages. Any character value not given is assumed to be a straight mapping: only the differences are shown in the mapfile. The left-hand columns must be unique. More than one occurrence of any entry is an error. Right-hand column characters can appear more than once. This is ``many to one'' map- ping. Nulls can be produced with compose sequences or as part of an out- put string. It is recommended that no mapping be enabled on the channel used to cre- ate or modify the mapping files. This prevents any confusion of the actual values being entered due to mapping. It is also recom- mended that numeric rather than character representations be used in most cases, as these are not likely to be subject to mapping. Use comments to identify the characters represented. Refer to the ascii(M) manual page and the hardware reference manual for the device being mapped for the values to assign. # # sharp/pound/cross-hatch is the comment character # however, a quoted # ('#') is 0x23, not a comment # # beep, input, output, dead, compose and # control are special keywords and should appear as shown. # beep # sound the bell when errors occur input 'a' 'b' 'c' 'd' dead 'p' 'q' 'r' # p followed by q yields r 's' 't' # p followed by s yields t dead 'u' 'v' 'w' # u followed by v yields w compose 'x' # x is the compose key (only one al- lowed) 'y' 'z' 'A' # x followed by y and z yields A 'B' 'C' 'D' # x followed by B and C yields D output 'e' 'f' # e is mapped to f 'g' 'h' 'i' 106 # g is mapped to h i j - one to many 'k' 0x6c 0155 'n' # k is mapped to l m n control # the control sections must be last input E 1 # the character E is followed by # 1 more unmapped character output FG 2 # the characters F G are followed by # 2 more unmapped characters All of the single letters above preceding the ``control'' section must be in one of these formats: 'j' # quoted character 106 # decimal value 0x6a # hexadecimal value 0152 # octal value All of the above formats are translated to single byte val- ues. The control sections (which must be the last in the file) contain speci- fications of character sequences which should be passed through to or from the terminal device without going through the normal mapchan pro- cessing. These specifications consist of two parts: a fixed sequence of one or more defined characters indicating the start of a no- map sequence, followed by a number of characters of which the actual values are unspecified. To illustrate this, consider a cursor-control sequence which should be passed directly to the terminal without being mapped. Such a sequence would typically begin with a fixed escape sequence instruct- ing the termi- nal to interpret the following two characters as a cursor po- sition; the values of the following two characters are variable, and de- pend on the cursor position requested. Such a control sequence would be specified as: = 2 # Cursor control: escape = <x> <y> There are two subsections under control: the input section is used to filter data sent from the terminal to UNIX, and the output section is used to filter data sent from UNIX to the terminal. The two fields in each control sequence are separated by white space, that is the Space or Tab characters. Also the ``#'' (number sign) character in- troduces a com- ment, causing the remainder of the line to be ignored. Therefore, if any of these three characters are required in the specification itself, they should be entered using one of alternative means of entering characters, as follows: ^x The character produced by the terminal on pressing the <Ctrl> and <x> keys together. or \ The <Esc> character, octal 033. c Where c is one of b, f, l, n, r or t, produces Backspace, Formfeed, Linefeed, Newline, Carriage Return, or Tab char- acters respectively. Since the NULL character can not be represented, this sequence is stored as the character with octal value 0200, which behaves as a NULL on most terminals. nn or nnn Specifies the octal value of the character di- rectly. followed by any other character is interpreted as that character. This can be used to enter Space, Tab, or Hash characters. DIAGNOSTICS mapchan performs these error checks when processing the map- file: + More than one compose key. + Characters mapped to more than one value. + Syntax errors in the byte values. + Missing input or output keywords. + Dead or compose keys also occurring in the input section. + Extra information on a line. + Mapping a character to null. + Starting an output control sequence with a character that is already mapped. If characters are displayed as the 7-bit value instead of the 8-bit value, use stty -a to verify that -istrip is set. Make sure input is mapping to the 8859 character set, output is mapping from the 8859 to the device display character set. dead and compose sequences are input map- ping and should be going to 8859. WARNING Use of mapping files that specify a different ``internal'' character set per-channel, or a set other than the 8-bit ISO 8859 set sup- plied by default can cause strange side effects. It is especially im- portant to retain the 7-bit ASCII portion of the character set (see ascii(M)). UNIX utilities and applications assume these values. Media trans- ported between machines with different internal code set mappings may not be portable as no mapping is performed on block devices, such as tape and floppy drives. trchan can be used to ``translate'' from one internal character set to another. Do not set ISTRIP (see stty(C)) on channels that have mapping that includes 8-bit characters. LIMITATIONS Some non-U.S. keyboards and display devices do not support characters commonly used by UNIX command shells and the C programming language. Do not attempt to use such devices for system administration tasks. Not all terminals or printers can display all the characters that can be represented using this utility. Refer to the device's hard- ware manual for information on the capabilities of the peripheral device. FILES /usr/local/etc/mapchan/default /usr/local/etc/mapchan/*.map SEE ALSO ascii(7), keyboard(4), lp(1), screen(4), tty(1) STANDARDS mapchan is not part of any currently supported standard; it is an exten- sion of AT&T System V provided by The Santa Cruz Operation, Inc.
Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=mapchan&sektion=8&manpath=FreeBSD+Ports+15.0>
