147926Sbostic /*-
2*61370Sbostic * Copyright (c) 1983, 1993
3*61370Sbostic * The Regents of the University of California. All rights reserved.
436499Sbostic *
547926Sbostic * %sccs.include.redist.c%
622069Sdist */
722069Sdist
813297Ssam #ifndef lint
9*61370Sbostic static char copyright[] =
10*61370Sbostic "@(#) Copyright (c) 1983, 1993\n\
11*61370Sbostic The Regents of the University of California. All rights reserved.\n";
1236499Sbostic #endif /* not lint */
1313297Ssam
1436499Sbostic #ifndef lint
15*61370Sbostic static char sccsid[] = "@(#)tc1.c 8.1 (Berkeley) 06/04/93";
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
main(argc,argv)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