+ /* the window structure */
+struct ww {
+ /* general flags and states */
+ char ww_state; /* state of window */
+ char ww_oflags; /* wwopen flags */
+
+ /* information for overlap */
+ struct ww *ww_forw; /* doubly linked list, for overlapping info */
+ struct ww *ww_back;
+ char ww_index; /* the window index, for wwindex[] */
+ char ww_order; /* the overlapping order */
+
+ /* sizes and positions */
+ struct ww_dim ww_w; /* window size and pos */
+ struct ww_dim ww_b; /* buffer size and pos */
+ struct ww_dim ww_i; /* the part inside the screen */
+ struct ww_pos ww_cur; /* the cursor position, relative to ww_w */
+
+ /* arrays */
+ char **ww_win; /* the window */
+ union ww_char **ww_buf; /* the buffer */
+ char **ww_fmap; /* map for frame and box windows */
+ short *ww_nvis; /* how many ww_buf chars are visible per row */
+
+ /* information for wwwrite() and company */
+ char ww_wstate; /* state for outputting characters */
+ char ww_modes; /* current display modes */
+ char ww_insert; /* insert mode */
+ char ww_mapnl; /* map \n to \r\n */
+ char ww_noupdate; /* don't do updates in wwwrite() */
+ char ww_unctrl; /* expand control characters */
+ char ww_nointr; /* wwwrite() not interruptable */
+ char ww_hascursor; /* has fake cursor */
+
+ /* things for the window process and io */
+ char ww_ispty; /* ww_pty is really a pty, not socket pair */
+ char ww_stopped; /* output stopped */
+ int ww_pty; /* file descriptor of pty or socket pair */
+ int ww_socket; /* other end of socket pair */
+ int ww_pid; /* pid of process, if WWS_HASPROC true */
+ char ww_ttyname[11]; /* "/dev/ttyp?" */
+ char *ww_ob; /* output buffer */
+ char *ww_obe; /* end of ww_ob */
+ char *ww_obp; /* current read position in ww_ob */
+ char *ww_obq; /* current write position in ww_ob */
+
+ /* things for the user, they really don't belong here */
+ char ww_id; /* the user window id */
+ char ww_center; /* center the label */
+ char ww_hasframe; /* frame it */
+ char *ww_label; /* the user supplied label */
+ struct ww_dim ww_alt; /* alternate position and size */
+};
+
+ /* state of a tty */
+struct ww_tty {
+ struct sgttyb ww_sgttyb;
+ struct tchars ww_tchars;
+ struct ltchars ww_ltchars;
+ int ww_lmode;
+ int ww_ldisc;
+ int ww_fflags;
+};
+