home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
-
- char bp[1024];
-
- int InitTerm()
-
- /*
- ---------------------------------------------------------------------------
-
- Last revision -
- 30 March 1984 - GWS
-
-
- NAME
- InitTerm - initialize data area for screen handling routines
-
- SYNOPSIS
- InitTerm()
-
- DESCRIPTION
- Calls getenv to find out what terminal type to use and
- then calls tgetent to initialize the string containing
- the termcap.
-
- SEE ALSO
- termcap(3x), page, gotoxy, underline, stand_out, clear_eol
-
- DIAGNOSTICS
- Returns 0 if successful
- -1 if getenv fails
- -2 if tgetent cannot open termcap file
- -3 if tgetent cannot find entry for terminal
-
- BUGS
- none known
-
- AUTHOR
- George W. Sherouse
- 30 March 1984
-
- ---------------------------------------------------------------------------
- */
-
-
- {
- int tgetent(), ret;
- char *getenv(), *cret;
-
- cret = getenv("TERM");
- if (cret == NULL)
- return(-1);
-
- ret = tgetent(bp, cret);
- switch (ret)
- {
- case -1:
- return(-2);
- case 0:
- return(-3);
- case 1:
- return(0);
- }
- }
-