Annotation of 43BSDTahoe/usr.lib/libtermlib/tc1.c, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 1980 Regents of the University of California.
                      3:  * All rights reserved.  The Berkeley software License Agreement
                      4:  * specifies the terms and conditions for redistribution.
                      5:  */
                      6: 
                      7: #ifndef lint
                      8: static char sccsid[] = "@(#)tc1.c      5.1 (Berkeley) 6/5/85";
                      9: #endif not lint
                     10: 
                     11: /*
                     12:  * tc1 [term]
                     13:  * dummy program to test termlib.
                     14:  * gets entry, counts it, and prints it.
                     15:  */
                     16: #include <stdio.h>
                     17: char buf[1024];
                     18: char *getenv();
                     19: 
                     20: main(argc, argv) char **argv; {
                     21:        char *p;
                     22:        int rc;
                     23: 
                     24:        if (argc < 2)
                     25:                p = getenv("TERM");
                     26:        else
                     27:                p = argv[1];
                     28:        rc = tgetent(buf,p);
                     29:        printf("tgetent returns %d, len=%d, text=\n'%s'\n",rc,strlen(buf),buf);
                     30: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.