|
|
1.1 root 1:
2: /* EMACS_MODES: c !fill */
3:
4:
5: #ifdef uts
6: #define u370
7: #endif
8: #ifdef u370
9: #define PORTEXT
10: #endif
11: #ifdef OWNER
12: #define EXTERN
13: #else
14: #define EXTERN extern
15: #endif
16: #ifdef PC
17: #define pdp11 1
18: EXTERN int errno;
19: #else
20: #define CRYPTO /* Encryption ON */
21: #endif
22: #ifdef ux3
23: #define NDLAY 1
24: #endif
25: #ifdef bsd /* CRC */
26: #define NDLAY 1 /* CRC */
27: #endif /* CRC */
28:
29: EXTERN int curln; /* current line */
30: EXTERN int column; /* collumn */
31: EXTERN char *clptr; /* ptrs[curln,column] */
32: EXTERN int nlines; /* number of lines in buffer */
33: EXTERN int kline; /* line to kill to */
34: EXTERN char *klptr; /* ptrs[kline][kcol] */
35: EXTERN int kcol; /* collumn ... */
36: EXTERN int mklbuf; /* temporary for makeline macro */
37: EXTERN int SREGION; /* Size screen region affected by command */
38: EXTERN int brkflg; /* flag denoting a break received */
39:
40: EXTERN int PICMODE; /* Picture mode */
41: EXTERN int NODEL; /* No deletion (blank overwrite */
42:
43:
44: /* macro arguments */
45:
46: #define NMVAR 10 /* number of local variables */
47: EXTERN int *marg; /* macro argument pointer */
48:
49: /* buffer stuff */
50:
51: #ifdef pdp11
52: #define BLEN 512 /* length of each block */
53: #define BSHIFT 9 /* log2 of block length */
54: #define NBLOCK 17 /* number of buffer blocks */
55: #else
56: #define BLEN 1024 /* length of each block */
57: #ifdef v8
58: #undef BSHIFT
59: #endif
60: #define BSHIFT 10 /* log2 of block length */
61: #ifdef bsd
62: #define NBLOCK 16 /* Large, since it's only virtual memory */
63:
64: #else
65: #define NBLOCK 10 /* number of buffer blocks */
66: #endif
67: #endif
68: EXTERN char bbuf[NBLOCK] [BLEN]; /* storage for buffer */
69:
70: #define MAXEL 512 /* Max line length */
71: #define MAXELSH 9 /* log2(MAXEL) */
72: #define LSMALL 16 /* smallest line size */
73: #define LSSHIFT 4 /* log2(lsmall) */
74:
75: /* Macro Hooks table */
76:
77: /* These definitions must match those in ecomp.c */
78:
79: #define Pre_Read_Hook 1
80: #define Post_Read_Hook 2
81: #define Pre_Write_Hook 3
82: #define Load_Macro_Hook 4
83: #define Read_Name_Hook 5
84: #define Mode_Line_Hook 6
85: #define Exit_Emacs_Hook 7
86: #define Leave_Buffer_Hook 8
87: #define Enter_Buffer_Hook 9
88:
89: #define NHOOKS 10
90: EXTERN int hooks[NHOOKS];
91:
92: #ifdef pdp11
93: #define FNLEN 128
94: #else
95: #define FNLEN 256
96: #endif
97: EXTERN char fnbuf[FNLEN];
98:
99: /* macro definitions */
100:
101: #define EOL '\n'
102: #define INMEM(xnumb) (ptrs[xnumb] &01)
103: #define OUTMEM(xnumb) ((ptrs[xnumb]&01) == 0)
104: #define mkline(lineno) (((lineno<nlines)&&((mklbuf=ptrs[lineno])&01)) ? &(bbuf[0][mklbuf]) : mkl(lineno))
105:
106: EXTERN char *UP;
107: EXTERN char *DOWN;
108: EXTERN char *BACK;
109: EXTERN char *FORWARD;
110: EXTERN char *HOME;
111: EXTERN char *CLEAR;
112: EXTERN char *CLREST;
113: EXTERN char *CLINE;
114: EXTERN char *BELL;
115: EXTERN char *CURAD;
116: EXTERN char *TMAP;
117: EXTERN char *SMAP;
118: EXTERN char *NOP;
119: EXTERN char *LOPEN;
120: EXTERN char *LDEL;
121: EXTERN char *INSERTC;
122: EXTERN char *INSERTM;
123: EXTERN char *OSERTC;
124: EXTERN char *INSERTP;
125: EXTERN char *DELC;
126: EXTERN char *SSCROLL;
127: EXTERN char *RSCROLL;
128: EXTERN char *CR;
129: EXTERN char *SCREG;
130: EXTERN char *ULINE;
131: EXTERN char *UEND;
132: EXTERN int EOVER;
133: EXTERN char *SCINIT;
134: EXTERN char *VEXIT;
135: EXTERN char *RELUP;
136: EXTERN char *RELDOWN;
137: EXTERN char *RELFORW;
138: EXTERN char *RELBACK;
139: EXTERN char *CLDEL;
140: EXTERN char *CLSCROLL;
141: EXTERN char *CRSCROLL;
142: EXTERN char *CLOPEN;
143: EXTERN int CMPON;
144: EXTERN int XBASE;
145: EXTERN int YBASE;
146: EXTERN int SCRWID;
147: EXTERN int SCRNLIN;
148: EXTERN int SCRWRAP;
149: EXTERN int VCOST;
150: EXTERN int SRCADD;
151: EXTERN int MI;
152: EXTERN int IN;
153: EXTERN int DELMODE;
154: EXTERN int TERMIQ;
155:
156: /* character type table */
157:
158: #define PLAIN 0
159: #define CONTRL 1
160: #define TAB 2
161: #define BACKSP 3
162: #define UL 4
163:
164: /* Emacs data directory */
165:
166: EXTERN char em_dir[64]; /* emacs data directory (expanded) */
167:
168: /* global buffer definitions */
169:
170:
171: #ifdef PC
172: #define MPTRS 4096
173: EXTERN unsigned ptrs[MPTRS];
174: #else
175: extern unsigned end[]; /* get types right! */
176: #define ptrs end /* all references to ptrs go to end */
177: /*VARARGS*/ char *execl();
178: #endif PC
179:
180: EXTERN int NPTRS; /* number of pointers */
181:
182: /* character definitions */
183:
184: #define NCHARS 384 /* number of editor characters */
185: #define ISIZE 256 /* Maximum number of builtins */
186:
187: #define META 0200
188: #define CTLX 0400
189:
190: #define CTRLA 01
191: #define CTRLB 02
192: #define CTRLC 03
193: #define CTRLD 04
194: #define CTRLE 05
195: #define CTRLF 06
196: #define CTRLG 07
197: #define CTRLH 010
198: #define CTRLI 011
199: #define CTRLJ 012
200: #define CTRLK 013
201: #define CTRLL 014
202: #define CTRLM 015
203: #define CTRLN 016
204: #define CTRLO 017
205: #define CTRLP 020
206: #define CTRLQ 021
207: #define CTRLR 022
208: #define CTRLS 023
209: #define CTRLT 024
210: #define CTRLU 025
211: #define CTRLV 026
212: #define CTRLW 027
213: #define CTRLX 030
214: #define CTRLY 031
215: #define CTRLZ 032
216: #define CTRLBRAK 035
217: #define CTRLBACK 034
218: #define ESC 033
219: #define NEWLINE 037
220: #define RUBOUT 0177
221: #define MTA(mtach) ('mtach'+0200) /* make meta char */
222: #define CTRL(ch) (ch&037)
223:
224:
225:
226: /* Keyboard key bindings */
227:
228:
229: EXTERN unsigned short map_it[NCHARS];
230:
231: /* The following definitions define the mappings for the characters
232: * in "doit" and map_it */
233:
234: #define CBEEP 0 /* no binding */
235: #define CMETA 1 /* metizing characters */
236: #define CNUMB 2 /* numbers */
237: #define CCTLX 3 /* control -x */
238: #define CEXIT 4 /* control - z */
239: #define CCTLU 5 /* control - u */
240: #define CMARG 6 /* macro argument or variable */
241: #define CLRES 7 /* Last Result */
242: #define CMNUS 8 /* minus */
243: #define NIFUNC 9 /* # of ifunc chars */
244:
245: #define CINSERTC 9 /* self-inserts */
246: #define CBEGIN 10 /* start of line */
247: #define CBACK 11 /* back one character */
248: #define CFDEL 13 /* ^D */
249: #define CENDL 14 /* ^E */
250: #define CFORW 15 /* ^F */
251: #define CEQUIT 16 /* ^G */
252: #define CNEWLINE 19 /* return */
253: #define CEKILL 20 /* ^K */
254: #define CREFRESH 21 /* ^L */
255: #define CQUOTE 25 /* ^Q */
256: #define CRSRCH 26 /* ^R */
257: #define CFSRCH 27 /* ^S */
258: #define CXPOSE 28 /* ^T */
259: #define CYANK 31 /* ^Y */
260: #define CBDEL 50 /* delete back */
261: /* screen display data */
262:
263: EXTERN int mline;
264: EXTERN int mcol;
265: EXTERN int SCRLINES; /* number of lines in window */
266: EXTERN int ECHOL; /* line for prompting */
267: EXTERN int MODLN; /* line for buffer and file data */
268: EXTERN int RARE; /* raw input (overrides all others */
269:
270:
271: /* statistics */
272:
273: EXTERN long nmput; /* calls to mputc */
274: EXTERN long noutc; /* actual characters output */
275: EXTERN int ninch; /* number of characters input */
276: EXTERN int ntwrite; /* number of terminal writes */
277: EXTERN int nbwrite; /* number of buffer writes */
278: EXTERN int nbseek; /* number of seeks of buffer */
279: EXTERN int nbread; /* number of buffer reads */
280: EXTERN int nmkline; /* number of makeline calls */
281: EXTERN unsigned myuid; /* my user ID */
282: EXTERN unsigned mypid; /* my process id */
283: EXTERN unsigned mymask; /* my umask */
284: EXTERN int splfile; /* File number for command splicing */
285:
286: /* mail and time stuff */
287:
288: EXTERN int newmail;
289: EXTERN int mailcnt;
290: EXTERN int disptime;
291:
292:
293: /* error function severity */
294:
295: #define WARN 0 /* warning only */
296: #define NORM 1 /* normal (possibly recoverable) */
297: #define FATAL 2 /* fatal error */
298: extern int errno;
299:
300: /* function definitions */
301:
302: EXTERN char *mkl();
303: EXTERN char *ckline();
304: EXTERN char *fname();
305: EXTERN char *bname();
306: EXTERN char *getname();
307:
308:
309: /* lint definitions */
310:
311: #ifdef lint
312: #define IGNORE(x) if(x);
313: #else
314: #define IGNORE(x) (x)
315: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.