#include #include #include #include int main(void) { char *term; char buf[1024]; char *ti_str, *te_str, *cl_str; if (!(term = getenv("TERM"))) { fprintf(stderr, "getenv"); return (EXIT_FAILURE); } if (tgetent(buf, term) != 1) { fprintf(stderr, "tgetent"); return (EXIT_FAILURE); } ti_str = tgetstr("ti", &buf); te_str = tgetstr("te", &buf); cl_str = tgetstr("cl", &buf); printf("ti: %s\nte: %s\ncl: %s\n", ti_str, te_str, cl_str); return (EXIT_SUCCESS); }