Home :: International :: Manuals :: Howto :: FAQ :: Man Pages :: Email Login

 
 

  next up previous contents
Next: 8.2.3 Look at a Up: 8.2 The Termcap Library Previous: 8.2.1 Introduction

8.2.2 Find a Terminal Description

  • int tgetent(void *buffer, const char *termtype)  
    On the Linux operating system the current terminal name is contained in the environment variable . So, termtype is the result of a call to (3).

    For buffer, no memory has to be allocated when using the GNU version of termcap. This is what we can assume under Linux! Otherwise, you'll have to allocate 2048 Bytes. (Formerly, buffer only needed to be 1024 Bytes, but the size has doubled).

    tgetent(...) returns 1 on success and 0 when the database is found but has no entry for TERM. Other errors will return different values.

    The following example should explain how to use tgetent(...):

    By, default termcap uses /etc/termcap/ as the database. If the environment variable TERMCAP is set, with $HOME/mytermcap for instance, all functions will use instead of /etc/termcap. With no leading slash in TERMCAP, the defined value is used as a name for a terminal.



Converted on:
Fri Mar 29 14:43:04 EST 1996
 
 
 
 
Google
  Web Linuxinfor   
 

Home :: Copyright :: Privacy :: Credits :: Get a free Linuxinfor Email Account

Document on this page is part of "e". See Index Page for more info about Authorship and Copyright.

1999-2008 Linuxinfor.com. No rights reserved.