10 Portability Problems

This chapter is devoted to the description of the (hopefully very few) problems that could arise when porting ne to other flavors of UN*X.

The fact that only POSIX calls have been used (see Motivations and Design) should guarantee that on POSIX-compliant systems a recompilation should suffice. Unfortunately, terminfo has not been standardized by IEEE, so that different calls could be available. The necessary calls are setupterm(), tparm() and tputs(). The other terminfo functions are never used.

If terminfo is not available, the source files info2cap.c and info2cap.h map terminfo calls on termcap calls. The complete GNU termcap sources are distributed with ne, so no library at all is needed to use them. You just have to compile using one of the options explained in the makefile and in the README. Should you need comprehensive information on GNU termcap, you can find the distribution files on any ftp site that distributes the GNU archives. I should note that the GNU termcap manual is definitely the best manual ever written about terminal databases.

There are, however, some details that are not specified by POSIX, or are specified with insufficient precision. The places of the source where such details come to the light are evidenced by the ‘PORTABILITY PROBLEM’ string, which is followed by a complete explanation of the problem.

For instance, there is no standard way of printing extended ASCII characters (i.e., characters whose code is smaller than 32 or greater than 126). On many system, these characters have to be filtered and replaced with something printable: the default behaviour is to add 64 to all characters under 32 (so that control characters will translate to the respective letter) and to print them in reverse video; moreover, all characters between 127 and 160 are visualized as a reversed question mark (this works particularly well with ISO Latin 1, but Windows users might not like it). This behavior can be easily changed by modifying the out() function in term.c.

Note that it is certainly possible that some system features not standardized by POSIX interfere with ne’s use of the I/O stream. Such problems should be dealt with locally by using the system facilities rather than by horribly #ifdef’ing the source code. An example is given in Hints and Tricks.