You are not logged in.

#1 2007-12-28 13:48:34

centipede
Member
Registered: 2007-12-28
Posts: 3

Is /etc/tempcap not needed?

Hello folks.

Working with the source code of festival, I've found a problem with my terminal setup. I reduced to problem to the code below which should shed light on the issue.

I figure that this simple C program should print a lot of TERM info, but it breaks on my system ("Could not get term caps"). If I make en empty file /etc/termcap, it doesn't break, but doesn't print any info either ("Terminfo: ")

I've compared with my Debian Stable, which prints ("Terminfo: "), i.e. it works, but doesn't have any info either.

Is this a fault in the way ncurses tries to be backwards compatible with termcap?
(I believe it is is ncurses that provides the old termcap function tgetent)

#include <stdio.h>
#include <stdlib.h>
#include <termcap.h>

int main(int c,char* v[])
{
    int i;
    char* buff = malloc(16384);
    
    i = tgetent (0, getenv("TERM"));
    if (i < 0)
    {
        printf("Could not get term caps\n");
    }
    else
    {
        printf("Terminfo: %s\n", buff);
    }
}

Compile using:

gcc -o termcap_test termcap_test.c -ltermcap

ncurses:  ncurses 5.6-6 (base)
gcc: /gcc 4.2.2-4 (base-devel)
$TERM: xterm-color
Desktop-environment: enlightenment - e17 (from Reverie's packages at takhis.net)

Should the /etc directory not contain at least a /etc/termcap file? This looks like a problem with legacy behaviour of the termcap-library which has not kept track of the newer /usr/share/terminfo system?

Regards, Rene Jensen (centipede)

Offline

Board footer

Powered by FluxBB