Reading termcap database other than termcap

the main man root at tndsyd.oz
Thu Nov 29 03:09:25 AEST 1990


In article <WAYNE.90Nov26180444 at forchammer.cs.odu.edu>, wayne at 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 at tndsyd.oz       UUCP: uunet!munnari.oz!tndsyd.oz.au!berny |
| INTERNET: berny at tndsyd.oz.au  DOMAIN: goodheart_berny at tandem.com          |
|   PSMAIL: smtpgate @comm(berny at tndsyd.oz@munnari.oz.au)                   |
|  FIDONET: berny at f614.n713.z3.fidonet.org@tndsyd.oz.au  (3:713/614.0)      |
`==========================================================================='
TANDEM Computers Incorporated 76 Berry St, North Sydney, NSW, 2060, Australia



More information about the Comp.unix.programmer mailing list