diff --git a/log/include/logglobals.h b/log/include/logglobals.h
index 4a61de5480ca70b88071765c974e8488bff9d049..7c446464a2b95eccccbe46ed0a7cc549c5295d1b 100644
--- a/log/include/logglobals.h
+++ b/log/include/logglobals.h
@@ -5,7 +5,7 @@
 #include "logstructs.h"
 
 extern char *GetChipmunkPath();
-char *my_strdup();
+extern char *my_strdup();
 #undef strdup
 #define strdup my_strdup
 #define newci_findprocedure2  findprocedure
@@ -39,250 +39,192 @@ extern int findprocedure (char *name, void (**start)());
 /*22*/
 /*23*/
 
-static const rablisttype rablist = {
-        { 0, 0, 1 },
-        { 0, 4, 2 },
-        { 0, 3, 3 },
-        { 0, 2, 4 },
-        { 0, 1, 5 },
-        { 0, 0, 6 },
-        { 1, 0, 7 },
-        { 2, 0, 8 },
-        { 3, 0, 9 },
-        { 4, 0, 10 },
-        { 4, 1, 11 },
-        { 4, 2, -12 },
-        { 3, 2, 13 },
-        { 2, 2, 14 },
-        { 1, 2, 15 },
-        { 2, 2, -18 },
-        { 0, 2, 17 },
-        { 1, 2, 15 },
-        { 3, 2, -20 },
-        { 2, 3, -20 },
-        { 3, 3, 21 },
-        { 4, 3, -23 },
-        { 3, 4, -23 },
-        { 4, 4, 42 }
-};
-
-static const rabmustype discomadness = {
-        { 3, 46 },
-        { 0, 8 },
-        { 4, 10 },
-        { 0, 15 },
-        { 4, 12 },
-        { 0, 2 },
-        { 5, 35 },
-        { 0, 6 },
-        { 4, 35 },
-        { 0, 6 },
-        { 5, 8 },
-        { 0, 17 },
-        { 5, 12 },
-        { 0, 2 },
-        { 6, 35 },
-        { 0, 6 },
-        { 5, 35 },
-        { 0, 6 },
-        { 6, 8 },
-        { 0, 17 },
-        { 6, 12 },
-        { 0, 2 },
-        { 8, 35 },
-        { 0, 6 },
-        { 3, 35 },
-        { 0, 6 },
-        { 4, 8 },
-        { 0, 16 },
-        { 4, 12 },
-        { 0, 3 },
-        { 5, 50 },
-        { 0, 0 }
-};
-
-
-static log_action_t gg;   /* External global variables */
-
-static short cursx, cursy;   /* Current position of cursor */
-static short cursx1, cursy1;   /* Wire starting point */
-static short cursx2, cursy2;   /* Wire ending point */
-static short chairx, chairy;   /* Current position of crosshair */
-
-static int cursorflag;   /* Cursor is displayed */
-static int prevcursorflag;
+extern const rablisttype rablist;
+
+extern const rabmustype discomadness;
+
+
+extern log_action_t gg;   /* External global variables */
+
+extern short cursx, cursy;   /* Current position of cursor */
+extern short cursx1, cursy1;   /* Wire starting point */
+extern short cursx2, cursy2;   /* Wire ending point */
+extern short chairx, chairy;   /* Current position of crosshair */
+
+extern int cursorflag;   /* Cursor is displayed */
+extern int prevcursorflag;
 /* Cursor was displayed before operation began */
-static int chairflag;   /* Crosshair is on screen */
-static int chairflag2;   /* Crosshair will be on screen */
-static int rbandflag;   /* Rubber-band wire is on screen */
-static int rabbits, rabflag;   /* Rabbit mode */
-static int avoidrabbits;
+extern int chairflag;   /* Crosshair is on screen */
+extern int chairflag2;   /* Crosshair will be on screen */
+extern int rbandflag;   /* Rubber-band wire is on screen */
+extern int rabbits, rabflag;   /* Rabbit mode */
+extern int avoidrabbits;
 
-static short txacross, txdown, across, down, baseline, line1, line2,
+extern short txacross, txdown, across, down, baseline, line1, line2,
                          kindgroupbase, kindgroupleft, kindgroupright, kindgroupstart,
                          kindgroupsize, histdown;
 
-static int entrycapslock;   /* Capslock status on entry */
-static int oldcapslock;   /* Previous capslock status */
+extern int entrycapslock;   /* Capslock status on entry */
+extern int oldcapslock;   /* Previous capslock status */
 
-static int signalcaps;   /* Capslock flag for signal-name entry */
-static int labelcaps;   /* Capslock flag for label entry */
+extern int signalcaps;   /* Capslock flag for signal-name entry */
+extern int labelcaps;   /* Capslock flag for label entry */
 
-static char (*index_)[9];   /* Index into gate library */
-static short *indexoffset;   /* Offset of each gate */
-static uchar *indexfile;   /* File number of each gate */
-static uchar *indexgroup;   /* Group number of each gate */
-static uchar *loadedgates;   /* Tells whether a gate is in the catalog */
-static log_krec *kind[maxmaxkinds];   /* Kind of gate in each catalog space */
-static kindgrouptype kindgroup;   /* Kind of gate in each menu-area space */
-static kindgrouptype kindsig;
-static kindattrtype kindattr;
-static na_strlist_t *gatefilenames;
-static short maxkinds, catwidth;
-static catboxrec *catboxes;
-static librstrrec *librstrs;
+extern char (*index_)[9];   /* Index into gate library */
+extern short *indexoffset;   /* Offset of each gate */
+extern uchar *indexfile;   /* File number of each gate */
+extern uchar *indexgroup;   /* Group number of each gate */
+extern uchar *loadedgates;   /* Tells whether a gate is in the catalog */
+extern log_krec *kind[maxmaxkinds];   /* Kind of gate in each catalog space */
+extern kindgrouptype kindgroup;   /* Kind of gate in each menu-area space */
+extern kindgrouptype kindsig;
+extern kindattrtype kindattr;
+extern na_strlist_t *gatefilenames;
+extern short maxkinds, catwidth;
+extern catboxrec *catboxes;
+extern librstrrec *librstrs;
 
-static char *gatesname[maxgatesfiles];
-static char *loghelpname, *lognewsname;   /* Names of system files */
+extern char *gatesname[maxgatesfiles];
+extern char *loghelpname, *lognewsname;   /* Names of system files */
 
-static long temp1, temp2, temp3, temp4;   /* For use by main program */
-static char tempch;
+extern long temp1, temp2, temp3, temp4;   /* For use by main program */
+extern char tempch;
 
-static short zoom;   /* Zooming level */
-static int ospointflag;   /* Starting point was touched */
+extern short zoom;   /* Zooming level */
+extern int ospointflag;   /* Starting point was touched */
 
-static long xoff0, yoff0;   /* Old XOFF, YOFF */
+extern long xoff0, yoff0;   /* Old XOFF, YOFF */
 
-static short curwcolor;   /* Current VLSI wire color */
-static char cureditmode;   /* Current editing (gate-tapping) mode */
-static short curlistgroup;   /* Current group in library list */
+extern short curwcolor;   /* Current VLSI wire color */
+extern char cureditmode;   /* Current editing (gate-tapping) mode */
+extern short curlistgroup;   /* Current group in library list */
 
-static int vlsimode[log_maxpages];   /* Page contains VLSI circuits */
-static long xoffp[log_maxpages], yoffp[log_maxpages];
+extern int vlsimode[log_maxpages];   /* Page contains VLSI circuits */
+extern long xoffp[log_maxpages], yoffp[log_maxpages];
 /* XOFF, YOFF for non-current pages */
-static short gatecount[log_maxpages];   /* Highest used gate-ID number */
-static char *curfilename[log_maxpages];   /* Name of last-loaded file */
-static long realcurpage;
-
-static log_nrec *freenode;   /* Node "free" list */
-static log_grec *freegate;   /* Gate "free" list */
-
-static baseptrs copybuf;   /* Del/Copy/Paste buffer */
-
-static long htcount;   /* Number of timesteps in list */
-static short hncount;   /* Number of names in list */
-static short hnocount;   /* Old number of names in list */
-static short histtrig;   /* Number of signal which triggers history */
-static na_strlist_t *histlbl;
-static short histnumattrs;
-static log_kattrrec *histkattr;
-static log_gattrrec *histgattr;
-static short histgridmode, histgridwhich;
-static log_hnrec *histgridhn;
-static double histvalrange, histdivsacross;
-static int histonscreen;   /* Leading edge of trace is visible */
-static int histreset;   /* Clear the history memory */
-static double histtime;   /* Current time for history mode */
-
-static int probeflag;   /* Has the probe been checked? */
-
-static log_nrec *nodeconflictbase;   /* Node conflict list */
-static log_grec *gateconflictbase;   /* Gate conflict list */
-
-static cnfrec *cnfbase;   /* List of tool configuration lines */
-static na_strlist_t *colorbase;   /* List of configured colors */
-static macrorec *macrobase;   /* List of macro keys */
-static na_strlist_t *thingstodo, *nexttodo;   /* List of delayed commands */
-static na_strlist_t *messages;   /* List of delayed messages */
-static na_strlist_t *commandlist;   /* List of tool-activation commands */
-
-static char modename[9];   /* Word in 'mode' area of menu */
-static int modeflag;   /* Mode area contains a word */
-static long modetime;   /* Time (in minutes) in mode display */
-static log_krec *modeprobekind;
-
-static nk_keytransinfo *curkeytrans;   /* Current keyboard definitions */
-
-static enum {
+extern short gatecount[log_maxpages];   /* Highest used gate-ID number */
+extern char *curfilename[log_maxpages];   /* Name of last-loaded file */
+extern long realcurpage;
+
+extern log_nrec *freenode;   /* Node "free" list */
+extern log_grec *freegate;   /* Gate "free" list */
+
+extern baseptrs copybuf;   /* Del/Copy/Paste buffer */
+
+extern long htcount;   /* Number of timesteps in list */
+extern short hncount;   /* Number of names in list */
+extern short hnocount;   /* Old number of names in list */
+extern short histtrig;   /* Number of signal which triggers history */
+extern na_strlist_t *histlbl;
+extern short histnumattrs;
+extern log_kattrrec *histkattr;
+extern log_gattrrec *histgattr;
+extern short histgridmode, histgridwhich;
+extern log_hnrec *histgridhn;
+extern double histvalrange, histdivsacross;
+extern int histonscreen;   /* Leading edge of trace is visible */
+extern int histreset;   /* Clear the history memory */
+extern double histtime;   /* Current time for history mode */
+
+extern int probeflag;   /* Has the probe been checked? */
+
+extern log_nrec *nodeconflictbase;   /* Node conflict list */
+extern log_grec *gateconflictbase;   /* Gate conflict list */
+
+extern cnfrec *cnfbase;   /* List of tool configuration lines */
+extern na_strlist_t *colorbase;   /* List of configured colors */
+extern macrorec *macrobase;   /* List of macro keys */
+extern na_strlist_t *thingstodo, *nexttodo;   /* List of delayed commands */
+extern na_strlist_t *messages;   /* List of delayed messages */
+extern na_strlist_t *commandlist;   /* List of tool-activation commands */
+
+extern char modename[9];   /* Word in 'mode' area of menu */
+extern int modeflag;   /* Mode area contains a word */
+extern long modetime;   /* Time (in minutes) in mode display */
+extern log_krec *modeprobekind;
+
+extern nk_keytransinfo *curkeytrans;   /* Current keyboard definitions */
+
+extern enum {
         normal, grid, delete__, copy_, paste, boxcursor
 } cursortype, oldcursortype;
 /* Type of cursor */
 
 /*  menupicture, errorpicture : m_picturevar;              { Various saved images */
-static short bottomcount;   /* How many nested BEGINBOTTOMs */
+extern short bottomcount;   /* How many nested BEGINBOTTOMs */
 
-static uchar rcolormap[16], gcolormap[16], bcolormap[16];
+extern uchar rcolormap[16], gcolormap[16], bcolormap[16];
 
-static short gategreen, gateyellow, gatered, gateorange, gateblack, gatewhite;
+extern short gategreen, gateyellow, gatered, gateorange, gateblack, gatewhite;
 
-static short defineboxcolor, definebackcolor, definetextcolor, catboxcolor;
+extern short defineboxcolor, definebackcolor, definetextcolor, catboxcolor;
 
-static short messagepos;   /* Position of next message */
-static short messageright;   /* Maximum width of messages */
+extern short messagepos;   /* Position of next message */
+extern short messageright;   /* Maximum width of messages */
 
-static long fastsavetime;
+extern long fastsavetime;
 
-static long watchdog, rabtime;   /* Miscellaneous timers */
+extern long watchdog, rabtime;   /* Miscellaneous timers */
 
-static log_tool *simtype_ignore;   /* Non-simulated type */
-static log_tool *simtype_common;   /* Common-pin type */
+extern log_tool *simtype_ignore;   /* Non-simulated type */
+extern log_tool *simtype_common;   /* Common-pin type */
 
-static double status_oldtime, status_oldtstep;
-static long status_oldmem;
+extern double status_oldtime, status_oldtstep;
+extern long status_oldmem;
 
-static rablistrec rabtable[rabtabsize];   /* Positions of rabbits */
-static short rabstate;   /* Rabbit recognizer state */
+extern rablistrec rabtable[rabtabsize];   /* Positions of rabbits */
+extern short rabstate;   /* Rabbit recognizer state */
 
-static long helpptr;   /* Help descriptor */
+extern long helpptr;   /* Help descriptor */
 
-static int popup_grid;   /* Pop-up menus */
-static logmenurec *popupmenus[4];
+extern int popup_grid;   /* Pop-up menus */
+extern logmenurec *popupmenus[4];
 
-static filerecfilerec *libf1[maxgatesfiles];   /* Library files */
-static short libfstart[maxgatesfiles];
+extern filerecfilerec *libf1[maxgatesfiles];   /* Library files */
+extern short libfstart[maxgatesfiles];
 /* First descriptor record in LIBF1 */
-static short libptr;   /* Most recently replaced catalog item */
-static short idxsize;   /* Number of gates in library */
-static char *librgroupnames[9];
+extern short libptr;   /* Most recently replaced catalog item */
+extern short idxsize;   /* Number of gates in library */
+extern char *librgroupnames[9];
 
-static short refrtimer, refrtimer0;   /* Time until screen is refreshed */
+extern short refrtimer, refrtimer0;   /* Time until screen is refreshed */
 
-static long tabletaddr;
+extern long tabletaddr;
 
-static char *dumpfname, *tracefname;
-static FILE *dumpfile, *tracefile;
+extern char *dumpfname, *tracefname;
+extern FILE *dumpfile, *tracefile;
 
-static long programmark;
+extern long programmark;
 
-static char pushedbackkey, realkey;
+extern char pushedbackkey, realkey;
 
 extern long EXCP_LINE;   /* Line number of last error */
-static long excpline;
-
-static short conflictdelay;
-
-static int eightcolors;   /* Has only 8 colors */
-static int onescreen;   /* Has only one screen */
-static int doingcnffunction;   /* This is an ACT_CNF, not an ACT_FUNC */
-static int justonecommand;   /* LOG -R mode, so exit after first cmd */
-static int displaynews;   /* LOGNEWS has not yet been displayed */
-static int immedscroll;   /* Don't need to defer 'REFR' function */
-static int tempverbose;   /* Verbose mode temporarily on */
-static int commandfound;   /* Function name was acknowledged */
-static int cursorhide;   /* Cursor is hidden */
-static int reportnowait;   /* Don't wait for key on bug reports */
-static int firsttraining;   /* Training used for first time */
-static int training;   /* Training mode for Help command */
-static int snapflag;   /* Snap-to-grid cursor */
-static int showsolder;   /* Display solder points */
-static int briefprobe;   /* Temporary probe mode */
-static int conflictenbl;   /* Conflict checking enabled */
-static int conflictstop;   /* Conflict stopping mode */
-static int anyconflicts;   /* Any active, reported conflicts? */
-static int steppingoff;   /* Single-step is turning simulation off */
-static int suppressdots;   /* Temporarily suppressing red dots */
-static int glowsolder;   /* Display solder dots in Glow mode */
-static int vlsi;   /* Current page is VLSI mode */
+extern long excpline;
+
+extern short conflictdelay;
+
+extern int eightcolors;   /* Has only 8 colors */
+extern int onescreen;   /* Has only one screen */
+extern int doingcnffunction;   /* This is an ACT_CNF, not an ACT_FUNC */
+extern int justonecommand;   /* LOG -R mode, so exit after first cmd */
+extern int displaynews;   /* LOGNEWS has not yet been displayed */
+extern int immedscroll;   /* Don't need to defer 'REFR' function */
+extern int tempverbose;   /* Verbose mode temporarily on */
+extern int commandfound;   /* Function name was acknowledged */
+extern int cursorhide;   /* Cursor is hidden */
+extern int reportnowait;   /* Don't wait for key on bug reports */
+extern int firsttraining;   /* Training used for first time */
+extern int training;   /* Training mode for Help command */
+extern int snapflag;   /* Snap-to-grid cursor */
+extern int showsolder;   /* Display solder points */
+extern int briefprobe;   /* Temporary probe mode */
+extern int conflictenbl;   /* Conflict checking enabled */
+extern int conflictstop;   /* Conflict stopping mode */
+extern int anyconflicts;   /* Any active, reported conflicts? */
+extern int steppingoff;   /* Single-step is turning simulation off */
+extern int suppressdots;   /* Temporarily suppressing red dots */
+extern int glowsolder;   /* Display solder dots in Glow mode */
+extern int vlsi;   /* Current page is VLSI mode */
 
 
 extern void m_saveclip ();
diff --git a/log/src/log.c b/log/src/log.c
index 5f4c5fb17181977bc8fc5306823fcacbbc006330..44f6aa78df814f6cfafb4594b6263a6059b7d617 100644
--- a/log/src/log.c
+++ b/log/src/log.c
@@ -76,6 +76,289 @@
 #include "node.h"
 #include "page.h"
 
+char *GetChipmunkPath();
+char *my_strdup();
+int findprocedure (char *name, void (**start)());
+
+
+/* 0*/
+/* If the pen is in "this" sector, */
+/* 1*/
+/*   switch to "this" state.       */
+/* 2*/
+/* 3*/
+/* 4*/
+/* 5*/
+/* 6*/
+/* 7*/
+/* 8*/
+/* 9*/
+/*10*/
+/*11*/
+/*12*/
+/*13*/
+/*14*/
+/*15*/
+/*16*/
+/*17*/
+/*18*/
+/*19*/
+/*20*/
+/*21*/
+/*22*/
+/*23*/
+
+const rablisttype rablist = {
+			     { 0, 0, 1 },
+			     { 0, 4, 2 },
+			     { 0, 3, 3 },
+			     { 0, 2, 4 },
+			     { 0, 1, 5 },
+			     { 0, 0, 6 },
+			     { 1, 0, 7 },
+			     { 2, 0, 8 },
+			     { 3, 0, 9 },
+			     { 4, 0, 10 },
+			     { 4, 1, 11 },
+			     { 4, 2, -12 },
+			     { 3, 2, 13 },
+			     { 2, 2, 14 },
+			     { 1, 2, 15 },
+			     { 2, 2, -18 },
+			     { 0, 2, 17 },
+			     { 1, 2, 15 },
+			     { 3, 2, -20 },
+			     { 2, 3, -20 },
+			     { 3, 3, 21 },
+			     { 4, 3, -23 },
+			     { 3, 4, -23 },
+			     { 4, 4, 42 }
+};
+
+const rabmustype discomadness = {
+				 { 3, 46 },
+				 { 0, 8 },
+				 { 4, 10 },
+				 { 0, 15 },
+				 { 4, 12 },
+				 { 0, 2 },
+				 { 5, 35 },
+				 { 0, 6 },
+				 { 4, 35 },
+				 { 0, 6 },
+				 { 5, 8 },
+				 { 0, 17 },
+				 { 5, 12 },
+				 { 0, 2 },
+				 { 6, 35 },
+				 { 0, 6 },
+				 { 5, 35 },
+				 { 0, 6 },
+				 { 6, 8 },
+				 { 0, 17 },
+				 { 6, 12 },
+				 { 0, 2 },
+				 { 8, 35 },
+				 { 0, 6 },
+				 { 3, 35 },
+				 { 0, 6 },
+				 { 4, 8 },
+				 { 0, 16 },
+				 { 4, 12 },
+				 { 0, 3 },
+				 { 5, 50 },
+				 { 0, 0 }
+};
+
+
+log_action_t gg;   /* External global variables */
+
+short cursx, cursy;   /* Current position of cursor */
+short cursx1, cursy1;   /* Wire starting point */
+short cursx2, cursy2;   /* Wire ending point */
+short chairx, chairy;   /* Current position of crosshair */
+
+int cursorflag;   /* Cursor is displayed */
+int prevcursorflag;
+/* Cursor was displayed before operation began */
+int chairflag;   /* Crosshair is on screen */
+int chairflag2;   /* Crosshair will be on screen */
+int rbandflag;   /* Rubber-band wire is on screen */
+int rabbits, rabflag;   /* Rabbit mode */
+int avoidrabbits;
+
+short txacross, txdown, across, down, baseline, line1, line2,
+	kindgroupbase, kindgroupleft, kindgroupright, kindgroupstart,
+	kindgroupsize, histdown;
+
+int entrycapslock;   /* Capslock status on entry */
+int oldcapslock;   /* Previous capslock status */
+
+int signalcaps;   /* Capslock flag for signal-name entry */
+int labelcaps;   /* Capslock flag for label entry */
+
+char (*index_)[9];   /* Index into gate library */
+short *indexoffset;   /* Offset of each gate */
+uchar *indexfile;   /* File number of each gate */
+uchar *indexgroup;   /* Group number of each gate */
+uchar *loadedgates;   /* Tells whether a gate is in the catalog */
+log_krec *kind[maxmaxkinds];   /* Kind of gate in each catalog space */
+kindgrouptype kindgroup;   /* Kind of gate in each menu-area space */
+kindgrouptype kindsig;
+kindattrtype kindattr;
+na_strlist_t *gatefilenames;
+short maxkinds, catwidth;
+catboxrec *catboxes;
+librstrrec *librstrs;
+
+char *gatesname[maxgatesfiles];
+char *loghelpname, *lognewsname;   /* Names of system files */
+
+long temp1, temp2, temp3, temp4;   /* For use by main program */
+char tempch;
+
+short zoom;   /* Zooming level */
+int ospointflag;   /* Starting point was touched */
+
+long xoff0, yoff0;   /* Old XOFF, YOFF */
+
+short curwcolor;   /* Current VLSI wire color */
+char cureditmode;   /* Current editing (gate-tapping) mode */
+short curlistgroup;   /* Current group in library list */
+
+int vlsimode[log_maxpages];   /* Page contains VLSI circuits */
+long xoffp[log_maxpages], yoffp[log_maxpages];
+/* XOFF, YOFF for non-current pages */
+short gatecount[log_maxpages];   /* Highest used gate-ID number */
+char *curfilename[log_maxpages];   /* Name of last-loaded file */
+long realcurpage;
+
+log_nrec *freenode;   /* Node "free" list */
+log_grec *freegate;   /* Gate "free" list */
+
+baseptrs copybuf;   /* Del/Copy/Paste buffer */
+
+long htcount;   /* Number of timesteps in list */
+short hncount;   /* Number of names in list */
+short hnocount;   /* Old number of names in list */
+short histtrig;   /* Number of signal which triggers history */
+na_strlist_t *histlbl;
+short histnumattrs;
+log_kattrrec *histkattr;
+log_gattrrec *histgattr;
+short histgridmode, histgridwhich;
+log_hnrec *histgridhn;
+double histvalrange, histdivsacross;
+int histonscreen;   /* Leading edge of trace is visible */
+int histreset;   /* Clear the history memory */
+double histtime;   /* Current time for history mode */
+
+int probeflag;   /* Has the probe been checked? */
+
+log_nrec *nodeconflictbase;   /* Node conflict list */
+log_grec *gateconflictbase;   /* Gate conflict list */
+
+cnfrec *cnfbase;   /* List of tool configuration lines */
+na_strlist_t *colorbase;   /* List of configured colors */
+macrorec *macrobase;   /* List of macro keys */
+na_strlist_t *thingstodo, *nexttodo;   /* List of delayed commands */
+na_strlist_t *messages;   /* List of delayed messages */
+na_strlist_t *commandlist;   /* List of tool-activation commands */
+
+char modename[9];   /* Word in 'mode' area of menu */
+int modeflag;   /* Mode area contains a word */
+long modetime;   /* Time (in minutes) in mode display */
+log_krec *modeprobekind;
+
+nk_keytransinfo *curkeytrans;   /* Current keyboard definitions */
+
+
+/*  menupicture, errorpicture : m_picturevar;              { Various saved images */
+short bottomcount;   /* How many nested BEGINBOTTOMs */
+
+uchar rcolormap[16], gcolormap[16], bcolormap[16];
+
+short gategreen, gateyellow, gatered, gateorange, gateblack, gatewhite;
+
+short defineboxcolor, definebackcolor, definetextcolor, catboxcolor;
+
+short messagepos;   /* Position of next message */
+short messageright;   /* Maximum width of messages */
+
+long fastsavetime;
+
+long watchdog, rabtime;   /* Miscellaneous timers */
+
+log_tool *simtype_ignore;   /* Non-simulated type */
+log_tool *simtype_common;   /* Common-pin type */
+
+double status_oldtime, status_oldtstep;
+long status_oldmem;
+
+rablistrec rabtable[rabtabsize];   /* Positions of rabbits */
+short rabstate;   /* Rabbit recognizer state */
+
+long helpptr;   /* Help descriptor */
+
+int popup_grid;   /* Pop-up menus */
+logmenurec *popupmenus[4];
+
+filerecfilerec *libf1[maxgatesfiles];   /* Library files */
+short libfstart[maxgatesfiles];
+/* First descriptor record in LIBF1 */
+short libptr;   /* Most recently replaced catalog item */
+short idxsize;   /* Number of gates in library */
+char *librgroupnames[9];
+
+short refrtimer, refrtimer0;   /* Time until screen is refreshed */
+
+long tabletaddr;
+
+char *dumpfname, *tracefname;
+FILE *dumpfile, *tracefile;
+
+long programmark;
+
+char pushedbackkey, realkey;
+
+long EXCP_LINE;   /* Line number of last error */
+long excpline;
+
+short conflictdelay;
+
+int eightcolors;   /* Has only 8 colors */
+int onescreen;   /* Has only one screen */
+int doingcnffunction;   /* This is an ACT_CNF, not an ACT_FUNC */
+int justonecommand;   /* LOG -R mode, so exit after first cmd */
+int displaynews;   /* LOGNEWS has not yet been displayed */
+int immedscroll;   /* Don't need to defer 'REFR' function */
+int tempverbose;   /* Verbose mode temporarily on */
+int commandfound;   /* Function name was acknowledged */
+int cursorhide;   /* Cursor is hidden */
+int reportnowait;   /* Don't wait for key on bug reports */
+int firsttraining;   /* Training used for first time */
+int training;   /* Training mode for Help command */
+int snapflag;   /* Snap-to-grid cursor */
+int showsolder;   /* Display solder points */
+int briefprobe;   /* Temporary probe mode */
+int conflictenbl;   /* Conflict checking enabled */
+int conflictstop;   /* Conflict stopping mode */
+int anyconflicts;   /* Any active, reported conflicts? */
+int steppingoff;   /* Single-step is turning simulation off */
+int suppressdots;   /* Temporarily suppressing red dots */
+int glowsolder;   /* Display solder dots in Glow mode */
+int vlsi;   /* Current page is VLSI mode */
+
+
+void m_saveclip ();
+
+void nc_cursor_on ();
+
+void nc_cursor_off ();
+
+
+
+
 
 static char *ioresult_message(char *Result, long iores)
 {