xref: /csrg-svn/lib/libterm/TEST/tc1.c (revision 22069)
1*22069Sdist /*
2*22069Sdist  * Copyright (c) 1980 Regents of the University of California.
3*22069Sdist  * All rights reserved.  The Berkeley software License Agreement
4*22069Sdist  * specifies the terms and conditions for redistribution.
5*22069Sdist  */
6*22069Sdist 
713297Ssam #ifndef lint
8*22069Sdist static char sccsid[] = "@(#)tc1.c	5.1 (Berkeley) 06/05/85";
9*22069Sdist #endif not lint
1013297Ssam 
1113297Ssam /*
1213297Ssam  * tc1 [term]
1313297Ssam  * dummy program to test termlib.
1413297Ssam  * gets entry, counts it, and prints it.
1513297Ssam  */
1613297Ssam #include <stdio.h>
1713297Ssam char buf[1024];
1813297Ssam char *getenv();
1913297Ssam 
2013297Ssam main(argc, argv) char **argv; {
2113297Ssam 	char *p;
2213297Ssam 	int rc;
2313297Ssam 
2413297Ssam 	if (argc < 2)
2513297Ssam 		p = getenv("TERM");
2613297Ssam 	else
2713297Ssam 		p = argv[1];
2813297Ssam 	rc = tgetent(buf,p);
2913297Ssam 	printf("tgetent returns %d, len=%d, text=\n'%s'\n",rc,strlen(buf),buf);
3013297Ssam }
31