Article View: comp.unix.programmer
Article #1295Re: Reading termcap database other than termcap
From: the main man
Date: Wed, 28 Nov 1990 16:09
Date: Wed, 28 Nov 1990 16:09
27 lines
1959 bytes
1959 bytes
In article <WAYNE.90Nov26180444@forchammer.cs.odu.edu>, wayne@cs.odu.edu (C Wayne Huling) writes:
>
> I have written a small program to accept the name of a printer and search
> the printcap for the hostmachine. I use the termcap routines supplied in the
> Unix PRM. Unfortunatly it reads from a environment set variable. My problem
> is if I set this variable "TERM" to be /etc/printcap and then run another
> program that needs "TERM" to be /etc/termcap then it will bomb. Is there any
> way of setting the file to be read from internally?
You could do a:
putenv("TERMCAP=/etc/printcap");
within your program before using terminfo or curses routines but
remember that if the program spawns a new process it will have this
in its environment.
By the way I assume you mean the TERMCAP environment variable and not
TERM since TERM specifies the terminal type and not the database location.
.===========================================================================.
| ACSnet: berny@tndsyd.oz UUCP: uunet!munnari.oz!tndsyd.oz.au!berny |
| INTERNET: berny@tndsyd.oz.au DOMAIN: goodheart_berny@tandem.com |
| PSMAIL: smtpgate @comm(berny@tndsyd.oz@munnari.oz.au) |
| FIDONET: berny@f614.n713.z3.fidonet.org@tndsyd.oz.au (3:713/614.0) |
`==========================================================================='
TANDEM Computers Incorporated 76 Berry St, North Sydney, NSW, 2060, Australia
Technical Details
Message-ID:
<533@tndsyd.oz>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!mel.dit.csiro.au!yarra!pta!tndsyd!rootReferences:
<WAYNE.90Nov26180444@forchammer.cs.odu.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!mel.dit.csiro.au!yarra!pta!tndsyd!root From: root@tndsyd.oz (the main man) Newsgroups: comp.unix.programmer Subject: Re: Reading termcap database other than termcap Message-ID: <533@tndsyd.oz> Date: 28 Nov 90 16:09:25 GMT References: <WAYNE.90Nov26180444@forchammer.cs.odu.edu> Organization: TANDEM Computers Incorporated, Sydney, NSW, Australia Lines: 27