[comp.sources.d] termcap and negative numbers

srp@babar.mmwb.ucsf.edu (Scott R. Presnell) (01/31/91)

Hey ho.
	Is there a standard extention to the termcap source code that
allows the extraction of negative numbers via the tgetnum() call?  Or has
anyone implemented something like this?  I'm just looking for a precedent.

	Thanks.

	- Scott (srp@cgl.ucsf.edu)
--
Scott Presnell				        +1 (415) 476-9890
Pharm. Chem., S-926				Internet: srp@cgl.ucsf.edu
University of California			UUCP: ...ucbvax!ucsfcgl!srp
San Francisco, CA. 94143-0446			Bitnet: srp@ucsfcgl.bitnet

allbery@NCoast.ORG (Brandon S. Allbery KB8JRR) (02/03/91)

As quoted from <17263@cgl.ucsf.EDU> by srp@babar.mmwb.ucsf.edu (Scott R. Presnell):
+---------------
| 	Is there a standard extention to the termcap source code that
| allows the extraction of negative numbers via the tgetnum() call?  Or has
| anyone implemented something like this?  I'm just looking for a precedent.
+---------------

Since -1 from tgetnum() means "capability not present", there's potential for
interpretation problems here.

Note that "not present" is quite different from "0" in some cases; consider
"sg#0" vs. "sg@".  The former is usually interpreted as the terminal has
"field" attributes which don't use visible screen memory, while the latter
means that the terminal has "character" attributes.  (I still argue that the
former is really the "ms@" attribute, but the current behavior is too well
entrenched now to be changed.)  Thus, the value "0" can't be used to say "not
present".

++Brandon
-- 
Me: Brandon S. Allbery			    VHF/UHF: KB8JRR on 220, 2m, 440
Internet: allbery@NCoast.ORG		    Packet: KB8JRR @ WA8BXN
America OnLine: KB8JRR			    AMPR: KB8JRR.AmPR.ORG [44.70.4.88]
uunet!usenet.ins.cwru.edu!ncoast!allbery    Delphi: ALLBERY