1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
<html lang="en">
<head>
<title>Portability Problems - ne's manual</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="ne's manual">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="prev" href="History.html#History" title="History">
<link rel="next" href="Acknowledgments.html#Acknowledgments" title="Acknowledgments">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="Portability-Problems"></a>
<p>
Next: <a rel="next" accesskey="n" href="Acknowledgments.html#Acknowledgments">Acknowledgments</a>,
Previous: <a rel="previous" accesskey="p" href="History.html#History">History</a>,
Up: <a rel="up" accesskey="u" href="index.html#Top">Top</a>
<hr>
</div>
<h2 class="chapter">10 Portability Problems</h2>
<p><a name="index-Portability-239"></a><a name="index-POSIX-240"></a><a name="index-terminfo-241"></a><a name="index-termcap-242"></a><a name="index-Printable-characters-243"></a>
This chapter is devoted to the description of the (hopefully very few) problems
that could arise when porting <code>ne</code> to other flavors of <span class="sc">un*x</span>.
<p>The fact that only <span class="sc">posix</span> calls have been used (see <a href="Motivations-and-Design.html#Motivations-and-Design">Motivations and Design</a>) should guarantee that on <span class="sc">posix</span>-compliant systems a
recompilation should suffice. Unfortunately, <code>terminfo</code> has not
been standardized by <span class="sc">ieee</span>, so that different calls could be
available. The necessary calls are <code>setupterm()</code>, <code>tparm()</code>
and <code>tputs()</code>. The other <code>terminfo</code> functions are never used.
<p>If <code>terminfo</code> is not available, the source files <samp><span class="file">info2cap.c</span></samp>
and <samp><span class="file">info2cap.h</span></samp> map <code>terminfo</code> calls on <code>termcap</code>
calls. The complete GNU <code>termcap</code> sources are distributed with
<code>ne</code>, so no library at all is needed to use them. You just have to
compile using one of the options explained in the <samp><span class="file">makefile</span></samp> and in
the <samp><span class="file">README</span></samp>. Should you need comprehensive information on GNU
<code>termcap</code>, you can find the distribution files on any <code>ftp</code>
site that distributes the GNU archives. I should note that the GNU
<code>termcap</code> manual is definitely the best manual ever written about
terminal databases.
<p>There are, however, some details that are not specified by <span class="sc">posix</span>, or are
specified with insufficient precision. The places of the source where such
details come to the light are evidenced by the ‘<samp><span class="samp">PORTABILITY PROBLEM</span></samp>’
string, which is followed by a complete explanation of the problem.
<p>For instance, there is no standard way of printing extended <span class="sc">ascii</span>
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 <code>out()</code> function in <samp><span class="file">term.c</span></samp>.
<p>Note that it is certainly possible that some system features not standardized
by <span class="sc">posix</span> interfere with <code>ne</code>'s use of the I/O stream. Such problems
should be dealt with locally by using the system facilities rather than by
horribly <code>#ifdef</code>'ing the source code. An example is given in <a href="Hints-and-Tricks.html#Hints-and-Tricks">Hints and Tricks</a>.
</body></html>
|