Online Documentation Server
 ПОИСК
ods.com.ua Web
 КАТЕГОРИИ
Home
Programming
Net technology
Unixes
Security
RFC, HOWTO
Web technology
Data bases
Other docs

 


 ПОДПИСКА

 О КОПИРАЙТАХ
Вся предоставленная на этом сервере информация собрана нами из разных источников. Если Вам кажется, что публикация каких-то документов нарушает чьи-либо авторские права, сообщите нам об этом.




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


With any suggestions or questions please feel free to contact us