995
|
1 /*
|
|
2 * This program is in public domain; written by Dave G. Conroy.
|
|
3 * This file contains the main driving routine, and some keyboard processing
|
|
4 * code, for the MicroEMACS screen editor.
|
|
5 *
|
|
6 * REVISION HISTORY:
|
|
7 *
|
|
8 * 1.0 Steve Wilhite, 30-Nov-85
|
|
9 * - Removed the old LK201 and VT100 logic. Added code to support the
|
|
10 * DEC Rainbow keyboard (which is a LK201 layout) using the the Level
|
|
11 * 1 Console In ROM INT. See "rainbow.h" for the function key definitions
|
|
12 *
|
|
13 * 2.0 George Jones, 12-Dec-85
|
|
14 * - Ported to Amiga.
|
|
15 */
|
|
16 #include <stdio.h>
|
|
17 #include "ueed.h"
|
|
18 #ifdef VMS
|
|
19 #include <ssdef.h>
|
|
20 #define GOOD (SS$_NORMAL)
|
|
21 #endif
|
|
22
|
|
23 #ifndef GOOD
|
|
24 #define GOOD 0
|
|
25 #endif
|
|
26
|
|
27 #define MAIN1 1
|
|
28 #include "uemain.h"
|
|
29
|
|
30 /*
|
|
31 * Initialize all of the buffers and windows. The buffer name is passed down
|
|
32 * as an argument, because the main routine may have been told to read in a
|
|
33 * file by default, and we want the buffer name to be right.
|
|
34 */
|
|
35 edinit(bname)
|
|
36 char bname[];
|
|
37 {
|
|
38 register BUFFER *bp;
|
|
39 register WINDOW *wp;
|
|
40
|
|
41 bp = bfind(bname, TRUE, 0); /* First buffer */
|
|
42 blistp = bfind("[List]", TRUE, BFTEMP); /* Buffer list buffer */
|
|
43 wp = (WINDOW *) malloc(sizeof(WINDOW)); /* First window */
|
|
44 if (bp==NULL || wp==NULL || blistp==NULL)
|
|
45 exit(1);
|
|
46 curbp = bp; /* Make this current */
|
|
47 wheadp = wp;
|
|
48 curwp = wp;
|
|
49 wp->w_bufp = bp;
|
|
50 bp->b_nwnd = 1; /* Displayed. */
|
|
51 wp->w_linep = bp->b_linep;
|
|
52 wp->w_dotp = bp->b_linep;
|
|
53 wp->w_wndp = /* Initialize window */
|
|
54 wp->w_doto =
|
|
55 wp->w_markp =
|
|
56 wp->w_marko =
|
|
57 wp->w_toprow =
|
|
58 wp->w_force = 0;
|
|
59 wp->w_ntrows = term.t_nrow-1; /* "-1" for mode line. */
|
|
60 wp->w_flag = WFMODE|WFHARD; /* Full. */
|
|
61 }
|
|
62
|
|
63
|