1 #ifndef lint 2 static char sccsid[] = "@(#)tc1.c 4.1 (Berkeley) 06/27/83"; 3 #endif 4 5 /* 6 * tc1 [term] 7 * dummy program to test termlib. 8 * gets entry, counts it, and prints it. 9 */ 10 #include <stdio.h> 11 char buf[1024]; 12 char *getenv(); 13 14 main(argc, argv) char **argv; { 15 char *p; 16 int rc; 17 18 if (argc < 2) 19 p = getenv("TERM"); 20 else 21 p = argv[1]; 22 rc = tgetent(buf,p); 23 printf("tgetent returns %d, len=%d, text=\n'%s'\n",rc,strlen(buf),buf); 24 } 25