+ /* flags to wwopen() */
+#define WWO_PTY 0x01 /* want pty */
+#define WWO_REVERSE 0x02 /* make it all reverse video */
+#define WWO_GLASS 0x04 /* make it all glass */
+#define WWO_FRAME 0x08 /* this is a frame window */
+
+ /* special ww_index value */
+#define WWX_NOBODY NWW
+
+#define WWE_NOERR 0
+#define WWE_SYS 1 /* system error */
+#define WWE_NOMEM 2 /* out of memory */
+#define WWE_TOOMANY 3 /* too many windows */
+#define WWE_NOPTY 4 /* no more ptys */
+#define WWE_SIZE 5 /* bad window size */
+#define WWE_BADTERM 6 /* bad terminal type */
+#define WWE_CANTDO 7 /* dumb terminal */
+
+struct ww wwhead;
+struct ww *wwindex[NWW + 1]; /* last location is for wwnobody */
+struct ww wwnobody;
+
+struct ww_tty wwoldtty; /* the old (saved) terminal settings */
+struct ww_tty wwnewtty; /* the new (current) terminal settings */
+struct ww_tty wwwintty; /* the terminal settings for windows */
+char *wwterm; /* the terminal name */
+char wwtermcap[1024]; /* place for the termcap */
+char wwkeys[512]; /* termcap fields for the function keys */
+
+int wwnrow, wwncol; /* the screen size */
+char wwavailmodes; /* actually supported modes */
+char wwcursormodes; /* the modes for the fake cursor */
+char wwwrap; /* terminal has auto wrap around */
+int wwdtablesize; /* result of getdtablesize() call */
+char **wwsmap; /* the screen map */
+union ww_char **wwos; /* the old (current) screen */
+union ww_char **wwns; /* the new (desired) screen */
+char *wwtouched; /* wwns changed flags */
+int wwbaudmap[]; /* maps stty() baud rate code into number */
+int wwbaud; /* wwbaudmap[wwoldtty.ww_sgttyb.sg_ospeed] */
+int wwcursorrow, wwcursorcol; /* where we want the cursor to be */
+int wwerrno; /* error number */
+
+ /* statistics */
+int wwnwrite, wwnwritec;
+int wwnupdate, wwntouched, wwnmiss;