Subject: Re: [Summer of Code] WiFi Browser
To: Thomas Dickey <dickey@radix.net>
From: Thor Lancelot Simon <tls@rek.tjls.com>
List: tech-net
Date: 06/07/2005 13:49:57
On Tue, Jun 07, 2005 at 01:23:56PM -0400, Thomas Dickey wrote:
> On Tue, Jun 07, 2005 at 08:03:26AM -0400, Thor Lancelot Simon wrote:
> >
> > I can't see why. The curses library supports full modern curses
> > functionality and is part of NetBSD. If you want ncurses, you have to
> > install it from pkgsrc.
> >
> > Since ncurses is (supposed to be) a superset of curses, code written
> > to work with our curses library should work with ncurses just fine.
>
> Not exactly. NetBSD's curses is a subset of X/Open curses (with some
> additional non-portable functions added). ncurses is a (much more complete)
> subset of X/Open curses (again with some functions added).
Yes, and a portable program ought to be able to be compiled, and work
correctly, with either; both provide a significant increase in features
beyond those of the original BSD or System V curses libraries.
Portability does not mean "pick the most convenient superset of the
standard functionality and assume it will be available everywhere"; it
means, "adhere to the standard, or, if you can, to the subset of the
standard that everyone implements consistently, so your application
will work everywhere without dragging many megabytes of support code
along with it".
For a curses application, writing to that subset of the X/Open interface
common to the BSD curses and ncurses is both easy and obvious.
> As an example of how not to write portable code, consider NetBSD's fork
> of libcdk.
As an example of how not to write portable code, consider a curses-using
library that will compile only with ncurses out of the box; not, mind
you, that I approve of putting it into a state in which it will compile
only with the NetBSD curses instead, but I am not actually sure that that
is what happened (if it did, it should be fixed).
--
Thor Lancelot Simon tls@rek.tjls.com
"The inconsistency is startling, though admittedly, if consistency is to be
abandoned or transcended, there is no problem." - Noam Chomsky