00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifdef MAPKEYS
00026
00027 #define KMAP_KEYS (T_OCAPS-T_CAPS)
00028 #define KMAP_AKEYS (T_OCAPS-T_CURSOR)
00029 #define KMAP_EXT 50
00030
00031 #define KMAP_NOTIMEOUT 0x4000
00032
00033 struct kmap_ext
00034 {
00035 char *str;
00036 int fl;
00037 struct action um;
00038 struct action dm;
00039 struct action mm;
00040 };
00041
00042 #endif
00043
00044 struct win;
00045
00046 struct canvas
00047 {
00048 struct canvas *c_next;
00049 struct display *c_display;
00050 struct viewport *c_vplist;
00051 struct layer *c_layer;
00052 struct canvas *c_lnext;
00053 struct layer c_blank;
00054 int c_xoff;
00055 int c_yoff;
00056 int c_xs;
00057 int c_xe;
00058 int c_ys;
00059 int c_ye;
00060 struct event c_captev;
00061 };
00062
00063 struct viewport
00064 {
00065 struct viewport *v_next;
00066 struct canvas *v_canvas;
00067 int v_xoff;
00068 int v_yoff;
00069 int v_xs;
00070 int v_xe;
00071 int v_ys;
00072 int v_ye;
00073 };
00074
00075 struct display
00076 {
00077 struct display *d_next;
00078 struct acluser *d_user;
00079 struct canvas *d_cvlist;
00080 struct canvas *d_forecv;
00081 void (*d_processinput) __P((char *, int));
00082 char *d_processinputdata;
00083 int d_vpxmin, d_vpxmax;
00084 struct win *d_fore;
00085 struct win *d_other;
00086 int d_nonblock;
00087
00088 char d_termname[20 + 1];
00089 char *d_tentry;
00090 char d_tcinited;
00091 int d_width, d_height;
00092 int d_defwidth, d_defheight;
00093 int d_top, d_bot;
00094 int d_x, d_y;
00095 struct mchar d_rend;
00096 int d_col16change;
00097 char d_atyp;
00098 #ifdef DW_CHARS
00099 int d_mbcs;
00100 #endif
00101 #ifdef ENCODINGS
00102 int d_encoding;
00103 int d_decodestate;
00104 int d_realfont;
00105 #endif
00106 int d_insert;
00107 int d_keypad;
00108 int d_cursorkeys;
00109 int d_revvid;
00110 int d_curvis;
00111 int d_has_hstatus;
00112 int d_hstatus;
00113 int d_lp_missing;
00114 int d_mouse;
00115 #ifdef RXVT_OSC
00116 int d_xtermosc[4];
00117 #endif
00118 struct mchar d_lpchar;
00119 struct timeval d_status_time;
00120 int d_status;
00121 char d_status_bell;
00122 int d_status_len;
00123 char *d_status_lastmsg;
00124 int d_status_buflen;
00125 int d_status_lastx;
00126 int d_status_lasty;
00127 int d_status_obuflen;
00128 int d_status_obuffree;
00129 struct event d_statusev;
00130 struct event d_hstatusev;
00131 int d_kaablamm;
00132 struct action *d_ESCseen;
00133 int d_userpid;
00134 char d_usertty[MAXPATHLEN];
00135 int d_userfd;
00136 struct event d_readev;
00137 struct event d_writeev;
00138 struct event d_blockedev;
00139 struct mode d_OldMode;
00140 struct mode d_NewMode;
00141 int d_flow;
00142 int d_intrc;
00143 char *d_obuf;
00144 int d_obuflen;
00145 int d_obufmax;
00146 int d_obuflenmax;
00147 char *d_obufp;
00148 int d_obuffree;
00149 #ifdef AUTO_NUKE
00150 int d_auto_nuke;
00151 #endif
00152 #ifdef MAPKEYS
00153 int d_nseqs;
00154 int d_aseqs;
00155 unsigned char *d_kmaps;
00156 unsigned char *d_seqp;
00157 int d_seql;
00158 unsigned char *d_seqh;
00159 struct event d_mapev;
00160 int d_dontmap;
00161 int d_mapdefault;
00162 #endif
00163 union tcu d_tcs[T_N];
00164 char *d_attrtab[NATTR];
00165 char d_attrtyp[NATTR];
00166 int d_hascolor;
00167 short d_dospeed;
00168 #ifdef FONT
00169 char d_c0_tab[256];
00170 char ***d_xtable;
00171 #endif
00172 int d_UPcost, d_DOcost, d_LEcost, d_NDcost;
00173 int d_CRcost, d_IMcost, d_EIcost, d_NLcost;
00174 int d_printfd;
00175 #ifdef UTMPOK
00176 slot_t d_loginslot;
00177 struct utmp d_utmp_logintty;
00178 int d_loginttymode;
00179 # ifdef _SEQUENT_
00180 char d_loginhost[100+1];
00181 # endif
00182 #endif
00183 int d_blocked;
00184 int d_blocked_fuzz;
00185 struct event d_idleev;
00186 #ifdef BLANKER_PRG
00187 int d_blankerpid;
00188 struct event d_blankerev;
00189 #endif
00190 };
00191
00192 #ifdef MULTI
00193 # define DISPLAY(x) display->x
00194 #else
00195 extern struct display TheDisplay;
00196 # define DISPLAY(x) TheDisplay.x
00197 #endif
00198
00199 #define D_user DISPLAY(d_user)
00200 #define D_username (DISPLAY(d_user) ? DISPLAY(d_user)->u_name : 0)
00201 #define D_cvlist DISPLAY(d_cvlist)
00202 #define D_forecv DISPLAY(d_forecv)
00203 #define D_processinput DISPLAY(d_processinput)
00204 #define D_processinputdata DISPLAY(d_processinputdata)
00205 #define D_vpxmin DISPLAY(d_vpxmin)
00206 #define D_vpxmax DISPLAY(d_vpxmax)
00207 #define D_fore DISPLAY(d_fore)
00208 #define D_other DISPLAY(d_other)
00209 #define D_nonblock DISPLAY(d_nonblock)
00210 #define D_termname DISPLAY(d_termname)
00211 #define D_tentry DISPLAY(d_tentry)
00212 #define D_tcinited DISPLAY(d_tcinited)
00213 #define D_width DISPLAY(d_width)
00214 #define D_height DISPLAY(d_height)
00215 #define D_defwidth DISPLAY(d_defwidth)
00216 #define D_defheight DISPLAY(d_defheight)
00217 #define D_top DISPLAY(d_top)
00218 #define D_bot DISPLAY(d_bot)
00219 #define D_x DISPLAY(d_x)
00220 #define D_y DISPLAY(d_y)
00221 #define D_rend DISPLAY(d_rend)
00222 #define D_col16change DISPLAY(d_col16change)
00223 #define D_atyp DISPLAY(d_atyp)
00224 #define D_mbcs DISPLAY(d_mbcs)
00225 #define D_encoding DISPLAY(d_encoding)
00226 #define D_decodestate DISPLAY(d_decodestate)
00227 #define D_realfont DISPLAY(d_realfont)
00228 #define D_insert DISPLAY(d_insert)
00229 #define D_keypad DISPLAY(d_keypad)
00230 #define D_cursorkeys DISPLAY(d_cursorkeys)
00231 #define D_revvid DISPLAY(d_revvid)
00232 #define D_curvis DISPLAY(d_curvis)
00233 #define D_has_hstatus DISPLAY(d_has_hstatus)
00234 #define D_hstatus DISPLAY(d_hstatus)
00235 #define D_lp_missing DISPLAY(d_lp_missing)
00236 #define D_mouse DISPLAY(d_mouse)
00237 #define D_xtermosc DISPLAY(d_xtermosc)
00238 #define D_lpchar DISPLAY(d_lpchar)
00239 #define D_status DISPLAY(d_status)
00240 #define D_status_time DISPLAY(d_status_time)
00241 #define D_status_bell DISPLAY(d_status_bell)
00242 #define D_status_len DISPLAY(d_status_len)
00243 #define D_status_lastmsg DISPLAY(d_status_lastmsg)
00244 #define D_status_buflen DISPLAY(d_status_buflen)
00245 #define D_status_lastx DISPLAY(d_status_lastx)
00246 #define D_status_lasty DISPLAY(d_status_lasty)
00247 #define D_status_obuflen DISPLAY(d_status_obuflen)
00248 #define D_status_obuffree DISPLAY(d_status_obuffree)
00249 #define D_statusev DISPLAY(d_statusev)
00250 #define D_hstatusev DISPLAY(d_hstatusev)
00251 #define D_kaablamm DISPLAY(d_kaablamm)
00252 #define D_ESCseen DISPLAY(d_ESCseen)
00253 #define D_userpid DISPLAY(d_userpid)
00254 #define D_usertty DISPLAY(d_usertty)
00255 #define D_userfd DISPLAY(d_userfd)
00256 #define D_OldMode DISPLAY(d_OldMode)
00257 #define D_NewMode DISPLAY(d_NewMode)
00258 #define D_flow DISPLAY(d_flow)
00259 #define D_intr DISPLAY(d_intr)
00260 #define D_obuf DISPLAY(d_obuf)
00261 #define D_obuflen DISPLAY(d_obuflen)
00262 #define D_obufmax DISPLAY(d_obufmax)
00263 #define D_obuflenmax DISPLAY(d_obuflenmax)
00264 #define D_obufp DISPLAY(d_obufp)
00265 #define D_obuffree DISPLAY(d_obuffree)
00266 #define D_auto_nuke DISPLAY(d_auto_nuke)
00267 #define D_nseqs DISPLAY(d_nseqs)
00268 #define D_aseqs DISPLAY(d_aseqs)
00269 #define D_seqp DISPLAY(d_seqp)
00270 #define D_seql DISPLAY(d_seql)
00271 #define D_seqh DISPLAY(d_seqh)
00272 #define D_dontmap DISPLAY(d_dontmap)
00273 #define D_mapdefault DISPLAY(d_mapdefault)
00274 #define D_kmaps DISPLAY(d_kmaps)
00275 #define D_tcs DISPLAY(d_tcs)
00276 #define D_attrtab DISPLAY(d_attrtab)
00277 #define D_attrtyp DISPLAY(d_attrtyp)
00278 #define D_hascolor DISPLAY(d_hascolor)
00279 #define D_dospeed DISPLAY(d_dospeed)
00280 #define D_c0_tab DISPLAY(d_c0_tab)
00281 #define D_xtable DISPLAY(d_xtable)
00282 #define D_UPcost DISPLAY(d_UPcost)
00283 #define D_DOcost DISPLAY(d_DOcost)
00284 #define D_LEcost DISPLAY(d_LEcost)
00285 #define D_NDcost DISPLAY(d_NDcost)
00286 #define D_CRcost DISPLAY(d_CRcost)
00287 #define D_IMcost DISPLAY(d_IMcost)
00288 #define D_EIcost DISPLAY(d_EIcost)
00289 #define D_NLcost DISPLAY(d_NLcost)
00290 #define D_printfd DISPLAY(d_printfd)
00291 #define D_loginslot DISPLAY(d_loginslot)
00292 #define D_utmp_logintty DISPLAY(d_utmp_logintty)
00293 #define D_loginttymode DISPLAY(d_loginttymode)
00294 #define D_loginhost DISPLAY(d_loginhost)
00295 #define D_readev DISPLAY(d_readev)
00296 #define D_writeev DISPLAY(d_writeev)
00297 #define D_blockedev DISPLAY(d_blockedev)
00298 #define D_mapev DISPLAY(d_mapev)
00299 #define D_blocked DISPLAY(d_blocked)
00300 #define D_blocked_fuzz DISPLAY(d_blocked_fuzz)
00301 #define D_idleev DISPLAY(d_idleev)
00302 #define D_blankerev DISPLAY(d_blankerev)
00303 #define D_blankerpid DISPLAY(d_blankerpid)
00304
00305
00306 #define GRAIN 4096
00307 #define OBUF_MAX 256
00308
00309 #define OUTPUT_BLOCK_SIZE 256
00310
00311 #define AddChar(c) \
00312 do \
00313 { \
00314 if (--D_obuffree <= 0) \
00315 Resize_obuf(); \
00316 *D_obufp++ = (c); \
00317 } \
00318 while (0)
00319
00320 #define CV_CALL(cv, cmd) \
00321 { \
00322 struct display *olddisplay = display; \
00323 struct layer *oldflayer = flayer; \
00324 struct layer *l = cv->c_layer; \
00325 struct canvas *cvlist = l->l_cvlist; \
00326 struct canvas *cvlnext = cv->c_lnext; \
00327 flayer = l; \
00328 l->l_cvlist = cv; \
00329 cv->c_lnext = 0; \
00330 cmd; \
00331 flayer = oldflayer; \
00332 l->l_cvlist = cvlist; \
00333 cv->c_lnext = cvlnext; \
00334 display = olddisplay; \
00335 }
00336
00337 #define STATUS_OFF 0
00338 #define STATUS_ON_WIN 1
00339 #define STATUS_ON_HS 2
00340
00341 #define HSTATUS_IGNORE 0
00342 #define HSTATUS_LASTLINE 1
00343 #define HSTATUS_MESSAGE 2
00344 #define HSTATUS_HS 3
00345 #define HSTATUS_ALWAYS (1<<2)