#ifdef MAPKEYS
#define KMAP_KEYS (T_OCAPS-T_CAPS)
#define KMAP_AKEYS (T_OCAPS-T_CURSOR)
#define KMAP_EXT 50
#define KMAP_NOTIMEOUT 0x4000
struct kmap_ext
{
char *str;
int fl;
struct action um;
struct action dm;
struct action mm;
};
#endif
struct win;
struct canvas
{
struct canvas *c_next;
struct display *c_display;
struct viewport *c_vplist;
struct layer *c_layer;
struct canvas *c_lnext;
struct layer c_blank;
int c_xoff;
int c_yoff;
int c_xs;
int c_xe;
int c_ys;
int c_ye;
struct event c_captev;
};
struct viewport
{
struct viewport *v_next;
struct canvas *v_canvas;
int v_xoff;
int v_yoff;
int v_xs;
int v_xe;
int v_ys;
int v_ye;
};
struct display
{
struct display *d_next;
struct acluser *d_user;
struct canvas *d_cvlist;
struct canvas *d_forecv;
void (*d_processinput) __P((char *, int));
char *d_processinputdata;
int d_vpxmin, d_vpxmax;
struct win *d_fore;
struct win *d_other;
int d_nonblock;
char d_termname[20 + 1];
char *d_tentry;
char d_tcinited;
int d_width, d_height;
int d_defwidth, d_defheight;
int d_top, d_bot;
int d_x, d_y;
struct mchar d_rend;
int d_col16change;
char d_atyp;
#ifdef DW_CHARS
int d_mbcs;
#endif
#ifdef ENCODINGS
int d_encoding;
int d_decodestate;
int d_realfont;
#endif
int d_insert;
int d_keypad;
int d_cursorkeys;
int d_revvid;
int d_curvis;
int d_has_hstatus;
int d_hstatus;
int d_lp_missing;
int d_mouse;
#ifdef RXVT_OSC
int d_xtermosc[4];
#endif
struct mchar d_lpchar;
struct timeval d_status_time;
int d_status;
char d_status_bell;
int d_status_len;
char *d_status_lastmsg;
int d_status_buflen;
int d_status_lastx;
int d_status_lasty;
int d_status_obuflen;
int d_status_obuffree;
struct event d_statusev;
struct event d_hstatusev;
int d_kaablamm;
struct action *d_ESCseen;
int d_userpid;
char d_usertty[MAXPATHLEN];
int d_userfd;
struct event d_readev;
struct event d_writeev;
struct event d_blockedev;
struct mode d_OldMode;
struct mode d_NewMode;
int d_flow;
int d_intrc;
char *d_obuf;
int d_obuflen;
int d_obufmax;
int d_obuflenmax;
char *d_obufp;
int d_obuffree;
#ifdef AUTO_NUKE
int d_auto_nuke;
#endif
#ifdef MAPKEYS
int d_nseqs;
int d_aseqs;
unsigned char *d_kmaps;
unsigned char *d_seqp;
int d_seql;
unsigned char *d_seqh;
struct event d_mapev;
int d_dontmap;
int d_mapdefault;
#endif
union tcu d_tcs[T_N];
char *d_attrtab[NATTR];
char d_attrtyp[NATTR];
int d_hascolor;
short d_dospeed;
#ifdef FONT
char d_c0_tab[256];
char ***d_xtable;
#endif
int d_UPcost, d_DOcost, d_LEcost, d_NDcost;
int d_CRcost, d_IMcost, d_EIcost, d_NLcost;
int d_printfd;
#ifdef UTMPOK
slot_t d_loginslot;
struct utmp d_utmp_logintty;
int d_loginttymode;
# ifdef _SEQUENT_
char d_loginhost[100+1];
# endif
#endif
int d_blocked;
int d_blocked_fuzz;
struct event d_idleev;
#ifdef BLANKER_PRG
int d_blankerpid;
struct event d_blankerev;
#endif
};
#ifdef MULTI
# define DISPLAY(x) display->x
#else
extern struct display TheDisplay;
# define DISPLAY(x) TheDisplay.x
#endif
#define D_user DISPLAY(d_user)
#define D_username (DISPLAY(d_user) ? DISPLAY(d_user)->u_name : 0)
#define D_cvlist DISPLAY(d_cvlist)
#define D_forecv DISPLAY(d_forecv)
#define D_processinput DISPLAY(d_processinput)
#define D_processinputdata DISPLAY(d_processinputdata)
#define D_vpxmin DISPLAY(d_vpxmin)
#define D_vpxmax DISPLAY(d_vpxmax)
#define D_fore DISPLAY(d_fore)
#define D_other DISPLAY(d_other)
#define D_nonblock DISPLAY(d_nonblock)
#define D_termname DISPLAY(d_termname)
#define D_tentry DISPLAY(d_tentry)
#define D_tcinited DISPLAY(d_tcinited)
#define D_width DISPLAY(d_width)
#define D_height DISPLAY(d_height)
#define D_defwidth DISPLAY(d_defwidth)
#define D_defheight DISPLAY(d_defheight)
#define D_top DISPLAY(d_top)
#define D_bot DISPLAY(d_bot)
#define D_x DISPLAY(d_x)
#define D_y DISPLAY(d_y)
#define D_rend DISPLAY(d_rend)
#define D_col16change DISPLAY(d_col16change)
#define D_atyp DISPLAY(d_atyp)
#define D_mbcs DISPLAY(d_mbcs)
#define D_encoding DISPLAY(d_encoding)
#define D_decodestate DISPLAY(d_decodestate)
#define D_realfont DISPLAY(d_realfont)
#define D_insert DISPLAY(d_insert)
#define D_keypad DISPLAY(d_keypad)
#define D_cursorkeys DISPLAY(d_cursorkeys)
#define D_revvid DISPLAY(d_revvid)
#define D_curvis DISPLAY(d_curvis)
#define D_has_hstatus DISPLAY(d_has_hstatus)
#define D_hstatus DISPLAY(d_hstatus)
#define D_lp_missing DISPLAY(d_lp_missing)
#define D_mouse DISPLAY(d_mouse)
#define D_xtermosc DISPLAY(d_xtermosc)
#define D_lpchar DISPLAY(d_lpchar)
#define D_status DISPLAY(d_status)
#define D_status_time DISPLAY(d_status_time)
#define D_status_bell DISPLAY(d_status_bell)
#define D_status_len DISPLAY(d_status_len)
#define D_status_lastmsg DISPLAY(d_status_lastmsg)
#define D_status_buflen DISPLAY(d_status_buflen)
#define D_status_lastx DISPLAY(d_status_lastx)
#define D_status_lasty DISPLAY(d_status_lasty)
#define D_status_obuflen DISPLAY(d_status_obuflen)
#define D_status_obuffree DISPLAY(d_status_obuffree)
#define D_statusev DISPLAY(d_statusev)
#define D_hstatusev DISPLAY(d_hstatusev)
#define D_kaablamm DISPLAY(d_kaablamm)
#define D_ESCseen DISPLAY(d_ESCseen)
#define D_userpid DISPLAY(d_userpid)
#define D_usertty DISPLAY(d_usertty)
#define D_userfd DISPLAY(d_userfd)
#define D_OldMode DISPLAY(d_OldMode)
#define D_NewMode DISPLAY(d_NewMode)
#define D_flow DISPLAY(d_flow)
#define D_intr DISPLAY(d_intr)
#define D_obuf DISPLAY(d_obuf)
#define D_obuflen DISPLAY(d_obuflen)
#define D_obufmax DISPLAY(d_obufmax)
#define D_obuflenmax DISPLAY(d_obuflenmax)
#define D_obufp DISPLAY(d_obufp)
#define D_obuffree DISPLAY(d_obuffree)
#define D_auto_nuke DISPLAY(d_auto_nuke)
#define D_nseqs DISPLAY(d_nseqs)
#define D_aseqs DISPLAY(d_aseqs)
#define D_seqp DISPLAY(d_seqp)
#define D_seql DISPLAY(d_seql)
#define D_seqh DISPLAY(d_seqh)
#define D_dontmap DISPLAY(d_dontmap)
#define D_mapdefault DISPLAY(d_mapdefault)
#define D_kmaps DISPLAY(d_kmaps)
#define D_tcs DISPLAY(d_tcs)
#define D_attrtab DISPLAY(d_attrtab)
#define D_attrtyp DISPLAY(d_attrtyp)
#define D_hascolor DISPLAY(d_hascolor)
#define D_dospeed DISPLAY(d_dospeed)
#define D_c0_tab DISPLAY(d_c0_tab)
#define D_xtable DISPLAY(d_xtable)
#define D_UPcost DISPLAY(d_UPcost)
#define D_DOcost DISPLAY(d_DOcost)
#define D_LEcost DISPLAY(d_LEcost)
#define D_NDcost DISPLAY(d_NDcost)
#define D_CRcost DISPLAY(d_CRcost)
#define D_IMcost DISPLAY(d_IMcost)
#define D_EIcost DISPLAY(d_EIcost)
#define D_NLcost DISPLAY(d_NLcost)
#define D_printfd DISPLAY(d_printfd)
#define D_loginslot DISPLAY(d_loginslot)
#define D_utmp_logintty DISPLAY(d_utmp_logintty)
#define D_loginttymode DISPLAY(d_loginttymode)
#define D_loginhost DISPLAY(d_loginhost)
#define D_readev DISPLAY(d_readev)
#define D_writeev DISPLAY(d_writeev)
#define D_blockedev DISPLAY(d_blockedev)
#define D_mapev DISPLAY(d_mapev)
#define D_blocked DISPLAY(d_blocked)
#define D_blocked_fuzz DISPLAY(d_blocked_fuzz)
#define D_idleev DISPLAY(d_idleev)
#define D_blankerev DISPLAY(d_blankerev)
#define D_blankerpid DISPLAY(d_blankerpid)
#define GRAIN 4096
#define OBUF_MAX 256
#define OUTPUT_BLOCK_SIZE 256
#define AddChar(c) \
do \
{ \
if (--D_obuffree <= 0) \
Resize_obuf(); \
*D_obufp++ = (c); \
} \
while (0)
#define CV_CALL(cv, cmd) \
{ \
struct display *olddisplay = display; \
struct layer *oldflayer = flayer; \
struct layer *l = cv->c_layer; \
struct canvas *cvlist = l->l_cvlist; \
struct canvas *cvlnext = cv->c_lnext; \
flayer = l; \
l->l_cvlist = cv; \
cv->c_lnext = 0; \
cmd; \
flayer = oldflayer; \
l->l_cvlist = cvlist; \
cv->c_lnext = cvlnext; \
display = olddisplay; \
}
#define STATUS_OFF 0
#define STATUS_ON_WIN 1
#define STATUS_ON_HS 2
#define HSTATUS_IGNORE 0
#define HSTATUS_LASTLINE 1
#define HSTATUS_MESSAGE 2
#define HSTATUS_HS 3
#define HSTATUS_ALWAYS (1<<2)