- * termsbr.c -- termcap support
- *
- * This code is Copyright (c) 2002, by the authors of nmh. See the
- * COPYRIGHT file in the root directory of the nmh distribution for
- * complete copyright information.
- */
+** termsbr.c -- termcap support
+**
+** This code is Copyright (c) 2002, by the authors of nmh. See the
+** COPYRIGHT file in the root directory of the nmh distribution for
+** complete copyright information.
+*/
- * These variables are sometimes defined in,
- * and needed by the termcap library.
- */
+** These variables are sometimes defined in,
+** and needed by the termcap library.
+*/
-static int HC = 0; /* are we on a hardcopy terminal? */
-static int LI = 40; /* number of lines */
-static int CO = 80; /* number of colums */
-static char *CL = NULL; /* termcap string to clear screen */
+static int HC = 0; /* are we on a hardcopy terminal? */
+static int LI = 40; /* number of lines */
+static int CO = 80; /* number of colums */
+static char *CL = NULL; /* termcap string to clear screen */
static char *SE = NULL; /* termcap string to end standout mode */
static char *SO = NULL; /* termcap string to begin standout mode */
static char *SE = NULL; /* termcap string to end standout mode */
static char *SO = NULL; /* termcap string to begin standout mode */
- speedcode = ioctl(fileno(stdout), TCGETA, &tio) != NOTOK ? tio.c_cflag & CBAUD : 0;
+ speedcode = ioctl(fileno(stdout), TCGETA, &tio) != NOTOK ?
+ tio.c_cflag & CBAUD : 0;
- HC = tgetflag ("hc");
-
- if (!initCO && (CO = tgetnum ("co")) <= 0)
- CO = 80;
- if (!initLI && (LI = tgetnum ("li")) <= 0)
- LI = 24;
-
- cp = termcap;
- CL = tgetstr ("cl", &cp);
- if ((bp = tgetstr ("pc", &cp)))
- PC = *bp;
- if (tgetnum ("sg") <= 0) {
- SE = tgetstr ("se", &cp);
- SO = tgetstr ("so", &cp);
- }
+ HC = tgetflag ("hc");
+
+ if (!initCO && (CO = tgetnum ("co")) <= 0)
+ CO = 80;
+ if (!initLI && (LI = tgetnum ("li")) <= 0)
+ LI = 24;
+
+ cp = termcap;
+ CL = tgetstr ("cl", &cp);
+ if ((bp = tgetstr ("pc", &cp)))
+ PC = *bp;
+ if (tgetnum ("sg") <= 0) {
+ SE = tgetstr ("se", &cp);
+ SO = tgetstr ("so", &cp);
+ }
- struct winsize win;
- int width;
-
- if (ioctl (fileno (stderr), TIOCGWINSZ, &win) != NOTOK
- && (width = win.ws_col) > 0) {
- CO = width;
- initCO++;
- } else
+ struct winsize win;
+ int width;
+
+ if (ioctl (fileno (stderr), TIOCGWINSZ, &win) != NOTOK
+ && (width = win.ws_col) > 0) {
+ CO = width;
+ initCO++;
+ } else
- if (ioctl (fileno (stderr), TIOCGWINSZ, &win) != NOTOK
- && (LI = win.ws_row) > 0)
- initLI++;
- else
+ if (ioctl (fileno (stderr), TIOCGWINSZ, &win) != NOTOK
+ && (LI = win.ws_row) > 0)
+ initLI++;
+ else