xref: /csrg-svn/lib/libterm/TEST/tc1.c (revision 47926)
1*47926Sbostic /*-
2*47926Sbostic  * Copyright (c) 1983 The Regents of the University of California.
336499Sbostic  * All rights reserved.
436499Sbostic  *
5*47926Sbostic  * %sccs.include.redist.c%
622069Sdist  */
722069Sdist 
813297Ssam #ifndef lint
936499Sbostic char copyright[] =
10*47926Sbostic "@(#) Copyright (c) 1983 The Regents of the University of California.\n\
1136499Sbostic  All rights reserved.\n";
1236499Sbostic #endif /* not lint */
1313297Ssam 
1436499Sbostic #ifndef lint
15*47926Sbostic static char sccsid[] = "@(#)tc1.c	5.3 (Berkeley) 04/12/91";
1636499Sbostic #endif /* not lint */
1736499Sbostic 
1813297Ssam /*
1913297Ssam  * tc1 [term]
2013297Ssam  * dummy program to test termlib.
2113297Ssam  * gets entry, counts it, and prints it.
2213297Ssam  */
2313297Ssam #include <stdio.h>
2413297Ssam char buf[1024];
2513297Ssam char *getenv();
2613297Ssam 
2713297Ssam main(argc, argv) char **argv; {
2813297Ssam 	char *p;
2913297Ssam 	int rc;
3013297Ssam 
3113297Ssam 	if (argc < 2)
3213297Ssam 		p = getenv("TERM");
3313297Ssam 	else
3413297Ssam 		p = argv[1];
3513297Ssam 	rc = tgetent(buf,p);
3613297Ssam 	printf("tgetent returns %d, len=%d, text=\n'%s'\n",rc,strlen(buf),buf);
3713297Ssam }
38