|
|
1.1 ! root 1: /* emacs display definitions */ ! 2: ! 3: ! 4: /* EMACS_MODES: c !fill */ ! 5: ! 6: int wbase = 0; /* line number of base of window */ ! 7: int w1base = 0; /* base of window 1 */ ! 8: ! 9: char osert = 0; /* flag indicating insert char mode */ ! 10: char umode = 0; /* flag indicating overstrike mode */ ! 11: int junked = 0; /* display junky */ ! 12: int keepg = 0; /* amount of stuff to keep between scrolls */ ! 13: ! 14: int acost; /* cost of absolute positioning */ ! 15: int lUP; /* cost of UP */ ! 16: int lDOWN; /* cost of DOWN */ ! 17: int lBAK; /* cost of BACK */ ! 18: int lFOR; /* cost of FORWARD */ ! 19: int lCR; ! 20: int dccost; /* Cost of 1 delete character */ ! 21: int iccost; ! 22: ! 23: /* two window mode stuff */ ! 24: ! 25: int wscrlines; /* window scrlines */ ! 26: int cwind = 0; /* current window */ ! 27: int windb[2]; /* buffer for windows */ ! 28: int disbuf[2] = {-1,-1}; /* buffer number in display */ ! 29: int wmaxln[2]; /* maxln in each buffer */ ! 30: int wminln[2]; /* minln in each buffer */ ! 31: int twowind = 0; /* flag for two window mode */ ! 32: int woff = 0; /* extra lines in winndow 2 */ ! 33: int hcol = 0; /* Horizontal offset (picture mode */ ! 34: int hrem; ! 35: ! 36: int lgripe; /* Flag indicating when it's time to complain about line size */ ! 37: int minln; /* first line of display*/ ! 38: int maxln; /* last line of display */ ! 39: int lastln; /* screen line of maxln */ ! 40: int nln; /* new line screen position */ ! 41: int ncol; /* ditto for col. */ ! 42: int dsize; /* size of area above the cursor */ ! 43: int psx; ! 44: int psy; ! 45: int scrlin; ! 46: int scrcol; ! 47: int scrow; ! 48: int ttywarp; /* tty warp factor (stty speed) */ ! 49: int BLANK; /* space or zero */ ! 50: ! 51: /* character type table (here because it can't be initted everywhere */ ! 52: ! 53: char ctype[128] = { ! 54: CONTRL, CONTRL, CONTRL, CONTRL, CONTRL, CONTRL, CONTRL, CONTRL, ! 55: CONTRL, TAB, CONTRL, CONTRL, CONTRL, CONTRL, CONTRL, CONTRL, ! 56: CONTRL, CONTRL, CONTRL, CONTRL, CONTRL, CONTRL, CONTRL, CONTRL, ! 57: CONTRL, CONTRL, CONTRL, CONTRL, CONTRL, CONTRL, CONTRL, CONTRL, ! 58: PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, ! 59: PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, ! 60: PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, ! 61: PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, ! 62: PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, ! 63: PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, ! 64: PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, ! 65: PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, UL, ! 66: PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, ! 67: PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, ! 68: PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, ! 69: PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, PLAIN, CONTRL, ! 70: }; ! 71: ! 72: int metal = 2; /* Extra Length of meta characters */ ! 73: ! 74: /* display data */ ! 75: ! 76: #define TTYLEN 512 /* total area for tty data strings */ ! 77: char ttystrings[TTYLEN]; ! 78: int ttyptr; /* allocation offset in ttyp */ ! 79: ! 80: ! 81: #ifdef PORTEXT ! 82: ! 83: /* The following should be used if the C compiler does not lay out ! 84: * external declarations in exactly the order declared. This array ! 85: * fixes this by assembling all of the addresses in the right order. ! 86: * It may get some warnings in some implementations. These ! 87: * variables must be in exactly the same order as the capability ! 88: * strings in ttydata. This declaration may produce warnings from ! 89: * some compilers, which can be ignored */ ! 90: ! 91: int *parmptr[] = { ! 92: (int *) &UP, ! 93: (int *) &DOWN, ! 94: (int *) &BACK, ! 95: (int *) &FORWARD, ! 96: (int *) &HOME, ! 97: (int *) &CLEAR, ! 98: (int *) &CLREST, ! 99: (int *) &CLINE, ! 100: (int *) &BELL, ! 101: (int *) &CURAD, ! 102: (int *) &TMAP, ! 103: (int *) &SMAP, ! 104: (int *) &NOP, ! 105: (int *) &LOPEN, ! 106: (int *) &LDEL, ! 107: (int *) &INSERTC, ! 108: (int *) &INSERTM, ! 109: (int *) &OSERTC, ! 110: (int *) &INSERTP, ! 111: (int *) &DELC, ! 112: (int *) &SSCROLL, ! 113: (int *) &RSCROLL, ! 114: (int *) &CR, ! 115: (int *) &SCREG, ! 116: (int *) &ULINE, ! 117: (int *) &UEND, ! 118: (int *) &EOVER, ! 119: (int *) &SCINIT, ! 120: (int *) &VEXIT, ! 121: (int *) &RELUP, ! 122: (int *) &RELDOWN, ! 123: (int *) &RELFORW, ! 124: (int *) &RELBACK, ! 125: (int *) &CLDEL, ! 126: (int *) &CLSCROLL, ! 127: (int *) &CRSCROLL, ! 128: (int *) &CLOPEN, ! 129: (int *) &CMPON, ! 130: (int *) &XBASE, ! 131: (int *) &YBASE, ! 132: (int *) &SCRWID, ! 133: (int *) &SCRNLIN, ! 134: (int *) &SCRWRAP, ! 135: (int *) &VCOST, ! 136: (int *) &SRCADD, ! 137: (int *) &MI, ! 138: (int *) &IN, ! 139: (int *) &DELMODE, ! 140: 0, ! 141: }; ! 142: ! 143: #endif ! 144: ! 145: /* The order in this string must match that in emacs_gb.h. and the above list */ ! 146: ! 147: #ifndef PC ! 148: char *ttydata ="updobcndhoclcdceblcmtmtMpcaldlicimeiipdcsfsrcrcsulueeovsverurdrrrlDLSFSRALCMbxbycoliamvcrcmiindm"; ! 149: #endif ! 150: char *endput = "____________________"; ! 151: ! 152: int REALBOT; /* Real bottom of screen */ ! 153: int REALWID; /* Real width */ ! 154: ! 155: #define SCRCONT '!' ! 156: int TABSTOP = 8; ! 157: ! 158: #ifdef pdp11 ! 159: #define NSCRLIN 25 /* max screen lines */ ! 160: #else ! 161: #define NSCRLIN 72 /* max screen lines */ ! 162: #endif ! 163: #define NSCRCOL 128 /* max screen columns */ ! 164: #ifndef PC ! 165: char cmap[NSCRLIN] [NSCRCOL]; ! 166: #endif ! 167: int scrjnk[NSCRLIN]; /* column of last non-white character */ ! 168: int scrmap[NSCRLIN+1]; /* line number of line in file on screen */ ! 169: int fmap[NSCRLIN]; /* File Status Map */ ! 170: #define LGOOD 1000 /* line is good marker (max length) */ ! 171: ! 172: #define MODHACK -1 /* File Line of Mode Line */ ! 173: #define ECHOHACK -2 /* File Line of Echo Line */ ! 174: ! 175: #ifdef pdp11 ! 176: #define SCRMSK 077777 /* line number filed of scrmap */ ! 177: #define SCRCNL 0100000 /* continuation bit of scrmap */ ! 178: ! 179: /* special paramter to sputl to fix rest of lines */ ! 180: ! 181: #define REST 20000 ! 182: ! 183: #else ! 184: #define SCRMSK 07777777 /* line number filed of scrmap */ ! 185: #define SCRCNL 010000000 /* continuation bit of scrmap */ ! 186: ! 187: /* special paramter to sputl to fix rest of lines */ ! 188: ! 189: #define REST 1000000 ! 190: ! 191: #endif ! 192: /* modes */ ! 193: ! 194: int LNOMOD = 1; ! 195: int LNOWID = 4; ! 196: int NOBEL = 0; ! 197: int NOTABS = 0; ! 198: int PMODE = 0; ! 199: extern int TABMD; ! 200: ! 201: /* display heuristics */ ! 202: ! 203: #define CFILL 30 /* average chars/line */ ! 204: #define PATIENCE 2000 /* number of millisecends of */ ! 205: /* output to buffer before */ ! 206: /* looking for type ahead */ ! 207: ! 208: extern char *myname; ! 209: extern char version[]; ! 210: extern int curbf; ! 211: extern int BACKP; ! 212: int bit8; ! 213: ! 214: /* Insert/delete parameters */ ! 215: ! 216: #ifdef u370 ! 217: ! 218: /* 370's have fast cpu's, slow I/O, thus spend more time looking for ins/del */ ! 219: ! 220: #define ILOOK 11 /* Insert look-ahead */ ! 221: #define DLOOK 11 /* ditto for delete char */ ! 222: #else ! 223: #define ILOOK 9 /* Insert look-ahead */ ! 224: #define DLOOK 9 /* ditto for delete char */ ! 225: #endif ! 226: #define lINSC 5 /* Number of characters that must match for inserting */ ! 227: #define lDELC 5 /* ditto for delc */ ! 228: ! 229: /* Default Terminal Description */ ! 230: ! 231: char *nulltty = "cl=\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\nbs=\nco=80\nli=24\ndo=\\n\ncr= \nbl=\n"; ! 232: ! 233: /* trace stuff */ ! 234: ! 235: ! 236: #define TSIZE 200 ! 237: ! 238: /* int trcbuf[TSIZE]; */ ! 239: ! 240: /* int tnumb;*/ ! 241: ! 242: #define TRACE(event) ! 243: /*#define TRACE(event) if (tnumb<TSIZE) trcbuf[tnumb++] = event; else trcbuf[(tnumb=1)-1] = event;*/ ! 244: ! 245: ! 246: #define VADJUST 1 ! 247: ! 248: /* external declarations */ ! 249: ! 250: extern int OVERW; ! 251: extern curbf; ! 252: extern int LNOMOD; ! 253: extern int fbkno; ! 254: extern int hipt[]; ! 255: extern int lowpt[]; ! 256: extern int timemd; ! 257: extern int numarg; ! 258: extern int DOCOMP; ! 259: extern char *fname(); ! 260: extern char *bname(); ! 261: extern char *mstrcpy(); ! 262: extern char *strcpy(); ! 263: extern char *getname(); ! 264: extern char *expenv(); ! 265: ! 266: #ifdef TERMCAP ! 267: #define PUTS putpad ! 268: #define TPARM(x,y,z) tgoto(x,z,y) ! 269: #define WAIT1 "100" ! 270: char *dumbterm = "dumb"; ! 271: #else ! 272: #ifdef TERMINFO ! 273: #define PUTS putpad ! 274: #define TPARM tparm ! 275: #define WAIT1 "$<100>" ! 276: char *dumbterm = "dumb"; ! 277: #else ! 278: #define PUTS eprintf ! 279: #define WAIT1 "%100p" ! 280: #define TPARM(x,y,z) x,y,z ! 281: #endif ! 282: #endif ! 283: ! 284: /* Blit ioctl's here, since they are harmless and the include file isn't always there */ ! 285: ! 286: struct jwinsize ! 287: { ! 288: char bytesx, bytesy; /* Window size in characters */ ! 289: short bitsx, bitsy; /* Window size in bits */ ! 290: }; ! 291: ! 292: #ifdef bsd ! 293: #define IOCPARM_MASK 0x7f /* parameters must be < 128 bytes */ ! 294: #define IOC_OUT 0x40000000 /* copy out parameters */ ! 295: #define _IOR(x,y,t) (IOC_OUT|((sizeof(t)&IOCPARM_MASK)<<16)|('x'<<8)|y) ! 296: #define JWINSIZE _IOR(j, 5, struct jwinsize) ! 297: #else ! 298: #define JTYPE ('j'<<8) ! 299: #define JWINSIZE (JTYPE|5) ! 300: #endif ! 301: #ifdef PC ! 302: ! 303: /* definitions required to control PC display */ ! 304: ! 305: #define VIDEO 0x10 ! 306: #define REG(HIGH,LOW) (256*HIGH)+LOW ! 307: #define PAGE_0 0 ! 308: #define PC_NULL 0 ! 309: #define BELL 7 ! 310: int NORMATB = 7; ! 311: ! 312: #define POS_CUR 2 ! 313: #define SCRL_UP 6 ! 314: #define WR_ACHR 9 ! 315: #define WR_TTY 14 ! 316: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.