date and time created 83/06/27 13:56:59 by sam
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Tue, 28 Jun 1983 04:56:59 +0000 (20:56 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Tue, 28 Jun 1983 04:56:59 +0000 (20:56 -0800)
SCCS-vsn: lib/libterm/TEST/tc1.c 4.1

usr/src/lib/libterm/TEST/tc1.c [new file with mode: 0644]

diff --git a/usr/src/lib/libterm/TEST/tc1.c b/usr/src/lib/libterm/TEST/tc1.c
new file mode 100644 (file)
index 0000000..6c6365f
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef lint
+static char sccsid[] = "@(#)tc1.c      4.1 (Berkeley) %G%";
+#endif
+
+/*
+ * tc1 [term]
+ * dummy program to test termlib.
+ * gets entry, counts it, and prints it.
+ */
+#include <stdio.h>
+char buf[1024];
+char *getenv();
+
+main(argc, argv) char **argv; {
+       char *p;
+       int rc;
+
+       if (argc < 2)
+               p = getenv("TERM");
+       else
+               p = argv[1];
+       rc = tgetent(buf,p);
+       printf("tgetent returns %d, len=%d, text=\n'%s'\n",rc,strlen(buf),buf);
+}