date and time created 83/07/22 17:07:04 by edward
[unix-history] / usr / src / usr.bin / window / ww.h
CommitLineData
b4be6cd6 1/* @(#)ww.h 1.4 83/07/19 */
0edb449f 2
4711df8b 3#include <stdio.h>
0edb449f 4#include <sgtty.h>
4711df8b 5#include "window.h"
0edb449f
EW
6
7struct ww {
2b44d852
EW
8 char ww_state; /* state of window creation */
9 char ww_mode; /* mode used to open this window */
10 char ww_wstate; /* state for printing charcters */
11 int ww_insert :1; /* insert mode, for printing */
12 int ww_refresh :1; /* force refresh after \n and others */
13 char ww_ident;
4711df8b 14 Win *ww_win;
2b44d852 15 int ww_row; /* outside dimensions */
0edb449f
EW
16 int ww_col;
17 int ww_nrow;
18 int ww_ncol;
2b44d852
EW
19 int ww_irow; /* inside dimensions */
20 int ww_icol;
21 int ww_inrow;
22 int ww_incol;
23 int ww_pty; /* pty or socket pair */
4711df8b
EW
24 int ww_tty;
25 int ww_pid;
4711df8b
EW
26 struct ww *ww_next;
27};
28
29struct ww_tty {
0edb449f
EW
30 struct sgttyb ww_sgttyb;
31 struct tchars ww_tchars;
32 struct ltchars ww_ltchars;
33 int ww_lmode;
34 int ww_ldisc;
35 int ww_pgrp;
0edb449f
EW
36};
37
2b44d852 38 /* ww_state values */
0edb449f
EW
39#define WW_INITIAL 0
40#define WW_HASPROC 1
41#define WW_INCHILD 2
42#define WW_DEAD 3
43
2b44d852
EW
44 /* ww_mode values */
45#define WW_PTY 0 /* has pty */
46#define WW_SOCKET 1 /* has socket pair */
47#define WW_NONE 2 /* has nothing */
48
0edb449f
EW
49#ifndef CTRL
50#define CTRL(c) ('c'&0x1f)
51#endif
52
4711df8b
EW
53extern struct ww *wwhead, *curwin;
54extern struct ww_tty wwoldtty, wwnewtty;
55extern int wwnwrite;
0edb449f 56
4711df8b
EW
57#define wwputchar(c) wwputc((c), curwin)
58#define wwputstr(s) wwputs((s), curwin)
2b44d852
EW
59#define wwsetcursor(r,c) (WRCurRow = (r), WRCurCol = (c))
60#define wwflush() Wrefresh(1)
61
62struct ww *wwopen();
63struct ww *wwfind();
64int wwchild();