9 date 92.12.15.00.20.22; author jromine; state Exp;
14 date 92.11.02.22.52.56; author jromine; state Exp;
19 date 92.10.16.21.37.46; author jromine; state Exp;
24 date 90.04.05.14.57.28; author sources; state Exp;
29 date 90.02.05.15.03.14; author sources; state Exp;
34 date 89.11.17.15.58.13; author sources; state Exp;
39 date 89.11.17.15.44.56; author sources; state Exp;
53 @/* trmsbr.c - minor termcap support (load with -ltermlib) */
55 static char ident[] = "@@(#)$Id: trmsbr.c,v 2.4 1992/11/02 22:52:56 jromine Exp jromine $";
62 #if defined(ULTRIX) && !defined(BSD43)
66 #include <sys/types.h>
69 #include <sys/ioctl.h>
89 int tgetent (), tgetnum ();
96 static int initLI = 0;
98 static int initCO = 0;
100 static char *CL = NULL;
101 static char *SE = NULL;
102 static char *SO = NULL;
104 static char termcap[TXTSIZ];
108 static read_termcap () {
118 static int inited = 0;
123 if ((term = getenv ("TERM")) == NULL || tgetent (myterm, term) <= OK)
127 ospeed = ioctl (fileno (stdout), TIOCGETP, (char *) &sg) != NOTOK
130 ospeed = ioctl (fileno (stdout), TCGETA, &sg) != NOTOK
131 ? sg.c_cflag & CBAUD : 0;
134 HC = tgetflag ("hc");
136 if (!initCO && (CO = tgetnum ("co")) <= 0)
138 if (!initLI && (LI = tgetnum ("li")) <= 0)
142 CL = tgetstr ("cl", &cp);
143 if (bp = tgetstr ("pc", &cp))
145 if (tgetnum ("sg") <= 0) {
146 SE = tgetstr ("se", &cp);
147 SO = tgetstr ("so", &cp);
158 if (ioctl (fileno (stderr), TIOCGWINSZ, &win) != NOTOK
159 && (width = win.ws_col) > 0) {
163 #endif /* TIOCGWINSZ */
174 if (ioctl (fileno (stderr), TIOCGWINSZ, &win) != NOTOK
175 && (LI = win.ws_row) > 0)
178 #endif /* TIOCGWINSZ */
193 void clear_screen () {
197 tputs (CL, LI, outc);
204 (void) fflush (stdout);
211 int SOprintf (fmt, a, b, c, d, e, f)
221 if (SO == NULL || SE == NULL)
225 printf (fmt, a, b, c, d, e, f);
243 @delete fflush -- it makes output look jumpy
248 static char ident[] = "@@(#)$Id: trmsbr.c,v 2.3 1992/10/16 21:37:46 jromine Exp jromine $";
293 static char ident[] = "@@(#)$Id: trmsbr.c,v 2.2 1990/04/05 14:57:28 sources Exp jromine $";
295 (void) fflush (stdout);
306 static char ident[] = "@@(#)$Id:$";
313 @*** empty log message ***
322 @changes for SUN40 shared libraries and NNTP under bbc