From ebb49cd07e200827f92db26dc26e9e00949d97a1 Mon Sep 17 00:00:00 2001
From: Etienne Brateau <etienne.brateau@ensiie.fr>
Date: Wed, 4 Jul 2018 21:39:36 +0200
Subject: [PATCH] Begin reformat code and remove os2 support

---
 log/src/Makefile                 |    8 +-
 log/src/Makefile.os2             |  215 -
 log/src/ana/Makefile             |   22 +-
 log/src/ana/Makefile.os2         |   89 -
 log/src/ana/capfloat.c           |  107 +-
 log/src/ana/capfloat.h           |   44 +-
 log/src/ana/devtechn.c           |   33 +-
 log/src/ana/devtechn.h           |   45 +-
 log/src/ana/devtechp.c           |   33 +-
 log/src/ana/devtechp.h           |   44 +-
 log/src/ana/diode1.c             |  118 +-
 log/src/ana/diode1.h             |   42 +-
 log/src/ana/ganglion.c           |  111 +-
 log/src/ana/ganglion.h           |   44 +-
 log/src/ana/globals.c            |  156 +-
 log/src/ana/globals.h            |  266 +-
 log/src/ana/hres.c               |  109 +-
 log/src/ana/hres.h               |   44 +-
 log/src/ana/idiff.c              |  136 +-
 log/src/ana/idiff.h              |   42 +-
 log/src/ana/inter.c              |  138 +-
 log/src/ana/inter.h              |   52 +-
 log/src/ana/iscope.c             |  120 +-
 log/src/ana/iscope.h             |   43 +-
 log/src/ana/iswitch1.c           |  138 +-
 log/src/ana/iswitch1.h           |   42 +-
 log/src/ana/iswitch2.c           |  132 +-
 log/src/ana/iswitch2.h           |   43 +-
 log/src/ana/log_action.h         |  351 ++
 log/src/ana/main.c               |  163 +-
 log/src/ana/main.h               |   67 +-
 log/src/ana/mmeter.c             |  120 +-
 log/src/ana/mmeter.h             |   41 +-
 log/src/ana/moscap.c             |   85 +-
 log/src/ana/moscap.h             |   41 +-
 log/src/ana/nfet4.c              |   86 +-
 log/src/ana/nfet4.h              |   45 +-
 log/src/ana/nfet5.c              |   83 +-
 log/src/ana/nfet5.h              |   43 +-
 log/src/ana/nfet7f.c             |   87 +-
 log/src/ana/nfet7f.h             |   44 +-
 log/src/ana/nfet7t.c             |   87 +-
 log/src/ana/nfet7t.h             |   44 +-
 log/src/ana/npn1.c               |  111 +-
 log/src/ana/npn1.h               |   41 +-
 log/src/ana/npn2.c               |  114 +-
 log/src/ana/npn2.h               |   41 +-
 log/src/ana/nsolver.c            |   11 +-
 log/src/ana/nsolver.h            |   31 +-
 log/src/ana/nspc1.c              |   98 +-
 log/src/ana/nspc1.h              |   44 +-
 log/src/ana/numbers.c            |   87 +-
 log/src/ana/numbers.h            |   43 +-
 log/src/ana/pfet4.c              |   85 +-
 log/src/ana/pfet4.h              |   45 +-
 log/src/ana/pfet5.c              |   85 +-
 log/src/ana/pfet5.h              |   43 +-
 log/src/ana/pfet6.c              |   85 +-
 log/src/ana/pfet6.h              |   43 +-
 log/src/ana/pfet7f.c             |   88 +-
 log/src/ana/pfet7f.h             |   44 +-
 log/src/ana/pfet7t.c             |   87 +-
 log/src/ana/pfet7t.h             |   44 +-
 log/src/ana/physical.c           |   35 +-
 log/src/ana/physical.h           |   45 +-
 log/src/ana/pnp1.c               |  116 +-
 log/src/ana/pnp1.h               |   41 +-
 log/src/ana/pnp2.c               |  116 +-
 log/src/ana/pnp2.h               |   40 +-
 log/src/ana/pspc1.c              |   93 +-
 log/src/ana/pspc1.h              |   43 +-
 log/src/ana/pwl.c                |  116 +-
 log/src/ana/pwl.h                |   44 +-
 log/src/ana/resfloat.c           |   84 +-
 log/src/ana/resfloat.h           |   41 +-
 log/src/ana/rtd.c                |   83 +-
 log/src/ana/rtd.h                |   44 +-
 log/src/ana/runspec.c            |   39 +-
 log/src/ana/runspec.h            |   45 +-
 log/src/ana/stairs.c             |  133 +-
 log/src/ana/stairs.h             |   36 +-
 log/src/ana/tc.c                 |  166 +-
 log/src/ana/tc.h                 |   49 +-
 log/src/ana/thermal.c            |   65 +-
 log/src/ana/thermal.h            |   45 +-
 log/src/ana/vdiff.c              |  141 +-
 log/src/ana/vdiff.h              |   35 +-
 log/src/ana/vswitch.c            |  137 +-
 log/src/ana/vswitch.h            |   42 +-
 log/src/diggates.c               |   98 +-
 log/src/fixfet7                  |    2 -
 log/src/log.c                    | 2354 ++++----
 log/src/log_action.h             |  351 ++
 log/src/logcom.c                 |  193 +-
 log/src/logcom.h                 |   44 +-
 log/src/logcurs_arr.h            |    1 +
 log/src/logcurs_box.h            |    1 +
 log/src/logcurs_cpy.h            |    1 +
 log/src/logcurs_del.h            |    1 +
 log/src/logcurs_prb.h            |    1 +
 log/src/logdef.c                 |   28 +-
 log/src/logdef.h                 |  361 +-
 log/src/logdig.c                 |    8 +-
 log/src/logdig.h                 |   42 +-
 log/src/loged.c                  |  373 +-
 log/src/loged.safe.c             | 7046 ------------------------
 log/src/loghier.c                |   74 +-
 log/src/loghier.h                |   58 +-
 log/src/logntk.c                 |  373 +-
 log/src/logntk.h                 |   44 +-
 log/src/logsim.c                 |  184 +-
 log/src/logsim.h                 |   69 +-
 log/src/logsima.h                |   50 +-
 log/src/logsimasm.c              |   60 +-
 log/src/logsimed.c               |  195 +-
 log/src/logsimed.h               |   48 +-
 log/src/logsimh.c                |  424 +-
 log/src/logsimh.h                |   50 +-
 log/src/logspc.c                 |  488 +-
 log/src/logspc.h                 |   44 +-
 log/src/logstuff.c               |    4 +-
 log/src/logstuff.h               |    3 +-
 log/src/lplot.c                  |  396 +-
 log/src/lplot.h                  |   47 +-
 log/src/munch                    |    2 +-
 log/src/munch.coff               |   30 -
 log/src/munch.default            |   24 -
 log/src/munch.hp800              |   23 -
 log/src/munch.rs6000             |   25 -
 log/src/munch.solaris2           |   24 -
 log/src/munch.temp               | 8552 ++++++++++++++++--------------
 log/src/mygates.h                |   35 +-
 log/src/simdir.c                 |   16 +-
 log/src/simdir.os2               |   26 -
 log/src/swap.c                   |   76 +-
 log/src/swap.h                   |   10 -
 log/src/tooldir.c                |  138 +-
 log/src/tooldir.os2              |  142 -
 psys/include/p2c/asm.h           |   60 -
 psys/include/p2c/citinfomod.h    |   17 +-
 psys/include/p2c/filepack.h      |   97 +-
 psys/include/p2c/fs.h            |  171 +-
 psys/include/p2c/general_0.h     |   29 +-
 psys/include/p2c/general_1.h     |   29 +-
 psys/include/p2c/general_2.h     |   34 +-
 psys/include/p2c/general_3.h     |   17 +-
 psys/include/p2c/hpib_0.h        |   20 +-
 psys/include/p2c/hpib_1.h        |   29 +-
 psys/include/p2c/hpib_2.h        |   40 +-
 psys/include/p2c/hpib_3.h        |   29 +-
 psys/include/p2c/iodecl.h        |   56 +-
 psys/include/p2c/loader.h        |   11 -
 psys/include/p2c/lunix_pas.h     |   56 +-
 psys/include/p2c/markrelease.h   |   10 -
 psys/include/p2c/math.h          |  280 +-
 psys/include/p2c/misc.h          |   41 +-
 psys/include/p2c/mylib.h         |  145 +-
 psys/include/p2c/newasm.h        |  412 +-
 psys/include/p2c/newci.h         |  194 +-
 psys/include/p2c/newcrt.h        |  183 +-
 psys/include/p2c/newkbd.h        |  112 +-
 psys/include/p2c/newtablet.h     |   37 +-
 psys/include/p2c/numex.h         |  166 +-
 psys/include/p2c/p2c.h           |  299 +-
 psys/include/p2c/passmod.h       |  123 +-
 psys/include/p2c/plot.h          |  186 +-
 psys/include/p2c/plot_routines.h |  183 +-
 psys/include/p2c/regex.h         |   38 +-
 psys/include/p2c/rnd.h           |    9 -
 psys/include/p2c/strings.h       |  108 +-
 psys/include/p2c/sysdevs.h       |  108 +-
 psys/include/p2c/sysglobals.h    |   47 +-
 psys/src/Makefile                |   14 +-
 psys/src/Makefile.os2            |  170 -
 psys/src/asm.c                   |   12 -
 psys/src/filepack.c              |   29 +-
 psys/src/fs.c                    |    8 +-
 psys/src/general_1.c             |    4 +-
 psys/src/general_2.c             |   12 +-
 psys/src/general_3.c             |    4 +-
 psys/src/hpib_2.c                |    3 +-
 psys/src/loader.c                |    3 +-
 psys/src/loc.p2clib.c            |   38 -
 psys/src/lunix_pas.c             |    2 +-
 psys/src/mamplot.c               |  671 +--
 psys/src/markrelease.c           |   23 +-
 psys/src/math.c                  |  215 +-
 psys/src/misc.c                  |  134 +-
 psys/src/mylib.c                 |   85 +-
 psys/src/newasmlib.c             |  833 +--
 psys/src/newci.c                 |   62 +-
 psys/src/newcrt.c                |  100 +-
 psys/src/newtablet.c             |    4 +-
 psys/src/numex.c                 |  500 +-
 psys/src/p2clib.c                |  194 +-
 psys/src/plot.c                  |  587 +-
 psys/src/regex.c                 |  204 +-
 psys/src/rnd.c                   |    9 +-
 psys/src/strings.c               |  535 ++
 psys/src/sysdevs.c               |   54 +-
 200 files changed, 13148 insertions(+), 24323 deletions(-)
 delete mode 100644 log/src/Makefile.os2
 delete mode 100644 log/src/ana/Makefile.os2
 create mode 100644 log/src/ana/log_action.h
 create mode 100644 log/src/log_action.h
 delete mode 100644 log/src/loged.safe.c
 delete mode 100755 log/src/munch.coff
 delete mode 100755 log/src/munch.default
 delete mode 100755 log/src/munch.hp800
 delete mode 100755 log/src/munch.rs6000
 delete mode 100755 log/src/munch.solaris2
 delete mode 100644 log/src/simdir.os2
 delete mode 100644 log/src/tooldir.os2
 delete mode 100644 psys/include/p2c/asm.h
 delete mode 100644 psys/src/Makefile.os2
 delete mode 100644 psys/src/asm.c
 create mode 100644 psys/src/strings.c

diff --git a/log/src/Makefile b/log/src/Makefile
index 93f9e99..43b56b7 100644
--- a/log/src/Makefile
+++ b/log/src/Makefile
@@ -232,7 +232,7 @@ makeana:
 	($(CD) ana; make $(MFLAGS) grab all)
 
 
-LOGOBJ = log.o $(TOOLOBJ) logstuff.o logdef.o
+LOGOBJ = log.o $(TOOLOBJ) logstuff.o log_action.o logdef.o
 
 log: $(LOGOBJ) tooldir.o $(LIBP2C) makeana
 	$(CC) $(CFLAGS) tooldir.o $(LOGOBJ) $(LIBP2C) $(LIBX11)  \
@@ -341,9 +341,3 @@ tardist:
 
 create: dist tardist 
 
-
-
-
-
-
-
diff --git a/log/src/Makefile.os2 b/log/src/Makefile.os2
deleted file mode 100644
index f6621d2..0000000
--- a/log/src/Makefile.os2
+++ /dev/null
@@ -1,215 +0,0 @@
-
-#  "LOG", the circuit editing and simulation system, 5.66
-#  "DigLOG", the digital simulator for LOG.
-#  Copyright (C) 1985, 1990 David Gillespie.
-#  Author's address: daveg@synaptics.edu
-
-#  "AnaLOG", the analog simulator for LOG, 5.66
-#  Copyright (C) 1985, 1990 John Lazzaro.
-#  Author's address: lazzaro@cs.berkeley.edu; 
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation (any version).
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; see the file COPYING.  If not, write to
-# the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-##
-## OS Makefile changes made by Michael Godfrey, godfrey@isl.stanford.edu
-##
-##
-## Comment blocks in this Makefile point to possible changes that need
-## to be made for different OS installations. Its a good idea to look it
-## over first before starting your compilation
-## comment blocks in this Makefile point to possible changes that need
-## to be made for different systems. Its a good idea to look over each
-## block and make necessary changes before doing a "make install"
-
-## if your OS/2 doesn't have these common Unix commands installed, you'l
-## need to change these definitions.
-
-MV = mv
-CD = cd
-CP = copy
-CPR = xcopy
-RM = rm
-RMF = rm -f
-
-# replace these definitions with absolute paths
-
-LOGLIBDIR = E:\log\lib
-LIBDIR = E:\lib
-BINDIR = ..\..\bin
-
-# 
-
-LOCINC = ../../psys/include
-XINCLUDEDIR = .
-
-LIBP2C = ..\..\psys\src\libp2c.a.lib
-LIBX11 = e:\tcpip\lib\xlibi.lib  e:\tcpip\lib\tcp32dll.lib \
-	 e:\tcpip\lib\so32dll.lib
-OBJX11 = Xlib_Globals.obj Xext_Globals.obj
-OTHERLIBS=
-
-##
-##  (1) Choosing your compiler
-##  ---------------------------
-##
-##
-## The original OS/2 port was done with the icc compiler; while we expect
-## only changes for the differences in compiler flags, it might be possible
-## source or Makefile changes will be needed as well. Please let us know of
-## any such changes if you are using a different compiler, so we can update
-## the release.
-
-
-CHIPMUNKCC = icc
-
-CC = $(CHIPMUNKCC) 
-
-OBJ = obj
-
-##
-## (2) Adding appropriate flags
-## -----------------------------
-##
-## The CFLAGS below should be correct for compilation with the icc compiler.
-## Note the function of these two special flags:
-##
-##  -Ti   for symbolic debug. It is OK to leave it in CFLAGS, but
-##        only use it in LFLAGS if symbolic debug to be used.
-##  -O+   for optimizer
-##
-
-
-CFLAGS = -O+ -Wpro- -Ti -Sa -Ms -Ss -Gm -DOS2 -I$(LOCINC) -I$(XINCLUDEDIR) -DLOGLIB="\"$(LOGLIBDIR)\"" -DF_OK=0 -Se -Fd- -q -Fo$@
-LFLAGS = -B/NOE -B/NOI -B/st:0x100000 -B/nologo -B/map -Fm$@.map
-DIGOBJ = logsim.$(OBJ) logdig.$(OBJ) logsimasm.$(OBJ) logsimed.$(OBJ) diggates.$(OBJ) \
-         loghier.$(OBJ) logsimh.$(OBJ) swap.$(OBJ)
-ANAOBJ = ana\globals.$(OBJ) ana\nsolver.$(OBJ) ana\main.$(OBJ) ana\inter.$(OBJ) \
-         ana\numbers.$(OBJ) ana\mmeter.$(OBJ) ana\iscope.$(OBJ) \
-	 ana\vdiff.$(OBJ) ana\vswitch.$(OBJ) ana\stairs.$(OBJ) \
-	 ana\idiff.$(OBJ) ana\iswitch1.$(OBJ) ana\iswitch2.$(OBJ) \
-	 ana\pfet7t.$(OBJ) ana\pfet7f.$(OBJ) ana\nfet7t.$(OBJ) ana\nfet7f.$(OBJ) \
-	 ana\devtechp.$(OBJ) ana\devtechn.$(OBJ)  ana\physical.$(OBJ)\
-	 ana\runspec.$(OBJ) ana\thermal.$(OBJ)\
-	 ana\resfloat.$(OBJ) ana\capfloat.$(OBJ) ana\nfet4.$(OBJ) ana\pfet4.$(OBJ) \
-	 ana\nfet5.$(OBJ) ana\pfet5.$(OBJ) ana\pfet6.$(OBJ) ana\pspc1.$(OBJ) ana\nspc1.$(OBJ)\
-	 ana\tc.$(OBJ) ana\moscap.$(OBJ) ana\ganglion.$(OBJ) ana\hres.$(OBJ) \
-	 ana\npn1.$(OBJ) ana\pnp1.$(OBJ) ana\npn2.$(OBJ) ana\pnp2.$(OBJ) ana\diode1.$(OBJ) ana\pwl.$(OBJ) ana\rtd.$(OBJ)
-
-SIMOBJ = logcom.$(OBJ) $(DIGOBJ) $(ANAOBJ)
-TOOLOBJ = $(SIMOBJ) lplot.$(OBJ) logspc.$(OBJ) logntk.$(OBJ)
-
-main: log
-
-##
-## (3) Saving space during linking
-## -------------------------------
-##
-##  The hard links made by the line:
-##
-##  -ln $(BINDIR)/diglog $(BINDIR)/analog
-##
-##  can be changed to make symbolic links; on some systems (Linux)
-##  this can save lots of disk space, although caution is necessary
-##  when using symbolic links, see the man page for "ln" for details.
-##
-
-install: makeana all
-	$(CP) log.exe $(BINDIR)\diglog.exe
-	$(CP) $(BINDIR)\diglog.exe $(BINDIR)\analog.exe
-	$(CP) loged.exe $(BINDIR)\loged.exe
-	$(CP) fixfet7 $(BINDIR)\fixfet7
-
-clean:
-	-$(RMF) *.$(OBJ) ana\*.$(OBJ) ana\logdef.h log.exe loged.exe
-
-all:  log  loged
-
-makeana:
-	($(CD) ana; make $(MFLAGS) grab all)
-
-LOGOBJ = log.$(OBJ) $(TOOLOBJ) logstuff.$(OBJ) logdef.$(OBJ)
-
-log: $(LOGOBJ) tooldir.$(OBJ) $(LIBP2C) makeana 
-	$(CC) $(LFLAGS) $(LIBP2C) tooldir.$(OBJ) $(LOGOBJ) $(OBJX11) $(LIBX11)  \
-	$(OTHERLIBS) -Fe $@.exe
-
-# The following, if it works on your system, will enable the "linklog"
-# script to work.
-
-#log: log.a tooldir.$(OBJ) $(LIBP2C)
-#	$(CC) $(CFLAGS) tooldir.$(OBJ) log.a $(LIBP2C) -lX11 -lm -o log
-#
-#log.a: $(LOGOBJ)
-#	ar r log.a $(LOGOBJ)
-
-LOGEDOBJ = loged.$(OBJ) simdir.$(OBJ) $(SIMOBJ) logstuff.$(OBJ)
-
-loged: $(LOGEDOBJ) simdir.$(OBJ) $(LIBP2C)
-	$(CC) $(LFLAGS) $(LIBP2C) $(LOGEDOBJ) $(OBJX11) $(LIBX11) \
-	$(OTHERLIBS) -Fe $@.exe
-
-tooldir.$(OBJ): tooldir.c
-
-tooldir.c: $(TOOLOBJ)
-	$(CP) tooldir.os2 tooldir.c
-
-simdir.$(OBJ): simdir.c
-
-simdir.c: $(SIMOBJ)
-	$(CP) simdir.os2 simdir.c
-
- 
-## The following part of the Makefile is for making a tar file of the
-## original parts of the log distribution. Most users have no need for it.
-
-
-VERSION = 5.20
-
-dist: distrib
-distrib:
-	-rm -rf dist
-	mkdir dist
-	mkdir dist/src
-	mkdir dist/src/ana
-	$(CP) log.cnf log.gate COPYING LNOTES dist/src
-	$(CP) munch* fixfet7 dist/src
-	sed -e "s;5.10;$(VERSION);" Makefile > dist/src/Makefile
-	sed -e "s;5.10;$(VERSION);" ana/Makefile > dist/src/ana/Makefile
-	sed -e "s;5.10;$(VERSION);" dist.INSTALL > dist/README
-	$(CP) *.c *.h dist/src
-	sed -e "s;5.10;$(VERSION);"  logdef.h > dist/src/logdef.h
-	$(CP) ana/*.c ana/*.h dist/src/ana
-	$(CPR) $(LOGLIBDIR) dist/lib
-	echo >dist/lib/stupid~
-	-rm dist/lib/*~ dist/lib/*.ogte
-	sed -e "s;5.10;$(VERSION);" ../lib/log.doc > dist/lib/log.doc
-
-
-tardist:
-	-rm -rf logdist
-	mkdir logdist
-	mv dist logdist/log
-	tar cvf log.tar -C logdist log
-	mv logdist/log dist
-	-rm -f log.tar.Z
-	compress log.tar
-	
-create: dist tardist 
-
-
-
-
-
-
-
diff --git a/log/src/ana/Makefile b/log/src/ana/Makefile
index 34a6884..bfaaeea 100644
--- a/log/src/ana/Makefile
+++ b/log/src/ana/Makefile
@@ -108,7 +108,10 @@ CC = $(CHIPMUNKCC)
 
 CHIPMUNKFLAGS = -m32 -DBSD -Dlinux -DF_OK=0 
 
-CFLAGS =  $(CHIPMUNKFLAGS) -I$(LOCINC) -I$(XINCLUDEDIR)
+OPTIONS = -Wall -Wextra
+
+CFLAGS =  $(CHIPMUNKFLAGS) $(OPTIONS) -I$(LOCINC) -I$(XINCLUDEDIR)
+
 
 ANAOBJ = globals.o nsolver.o main.o inter.o $(GATESOBJ)
 GATESOBJ = numbers.o mmeter.o iscope.o \
@@ -121,23 +124,16 @@ GATESOBJ = numbers.o mmeter.o iscope.o \
 
 # Note:  The above list is also present in ../Makefile.
 
-
-
 all: grab $(ANAOBJ)
 
-
-grab: logdef.h
+grab: logdef.h log_action.h
 
 logdef.h: ../logdef.h
 	cp ../logdef.h .
 
+log_action.h : ../log_action.h
+	cp ../log_action.h .
 
-
-
-
-
-
-
-
-
+clean:
+	rm -rf *.o
 
diff --git a/log/src/ana/Makefile.os2 b/log/src/ana/Makefile.os2
deleted file mode 100644
index 4d3bd0b..0000000
--- a/log/src/ana/Makefile.os2
+++ /dev/null
@@ -1,89 +0,0 @@
-
-#  "LOG", the circuit editing and simulation system, Version 5.66
-#  "DigLOG", the digital simulator for LOG.
-#  Copyright (C) 1985, 1990, 1993 David Gillespie.
-#  Author's address: daveg@synaptics
-
-#  "AnaLOG", the analog simulator for LOG,  Version 5.66.
-#  Copyright (C) 1985, 1990, 1993 John Lazzaro.
-#  Author's address: lazzaro@cs.berkeley.edu;
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation (any version).
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; see the file COPYING.  If not, write to
-# the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-
-# Makefile for analog's "ana" directory.  Version 5.66..
-
-##
-## OS Makefile changes made by Michael Godfrey, godfrey@isl.stanford.edu
-##
-##
-## Comment blocks in this Makefile point to possible changes that need
-## to be made for different OS installations. Its a good idea to look it
-## over first before starting your compilation
-
-
-
-LOCINC = ../../../psys/include
-XINCLUDEDIR = .
-
-##
-##  (1) Choosing your compiler
-##  ---------------------------
-##
-## The original OS/2 port was done with the icc compiler; while we expect
-## only changes for the differences in compiler flags, it might be possible
-## source or Makefile changes will be needed as well. Please let us know of
-## any such changes if you are using a different compiler, so we can update
-## the release.
-
-CHIPMUNKCC = icc
-
-CC = $(CHIPMUNKCC) 
-
-##
-## (3) Adding appropriate flags
-## -----------------------------
-##
-## The CFLAGS below should be correct for compilation with the icc compiler.
-## Note the function of these two special flags:
-##
-##  -Ti   for symbolic debug
-##  -O+   for optimizer
-##
-
-OBJ = obj
-
-CFLAGS =   -I$(LOCINC) -I$(XINCLUDEDIR)
-
-ANAOBJ = globals.$(OBJ) nsolver.$(OBJ) main.$(OBJ) inter.$(OBJ) $(GATESOBJ)
-GATESOBJ = numbers.$(OBJ) mmeter.$(OBJ) iscope.$(OBJ) \
-	   vdiff.$(OBJ) vswitch.$(OBJ) idiff.$(OBJ) iswitch1.$(OBJ) iswitch2.$(OBJ) stairs.$(OBJ) \
-	   resfloat.$(OBJ) capfloat.$(OBJ) nfet4.$(OBJ) pfet4.$(OBJ) \
-	   nfet5.$(OBJ) pfet5.$(OBJ) pfet6.$(OBJ) pspc1.$(OBJ) nspc1.$(OBJ)\
-	   tc.$(OBJ) moscap.$(OBJ) ganglion.$(OBJ) hres.$(OBJ) \
-	   npn1.$(OBJ) pnp1.$(OBJ) npn2.$(OBJ) pnp2.$(OBJ) diode1.$(OBJ) pwl.$(OBJ) rtd.$(OBJ)
-
-# Note:  The above list is also present in ../Makefile.
-
-
-
-all: grab $(ANAOBJ)
-
-
-grab: logdef.h
-
-logdef.h: ../logdef.h
-	cp ../logdef.h .
-
-
diff --git a/log/src/ana/capfloat.c b/log/src/ana/capfloat.c
index 7b0b7ed..65f8e9c 100644
--- a/log/src/ana/capfloat.c
+++ b/log/src/ana/capfloat.c
@@ -23,19 +23,9 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /* Output from p2c, the Pascal-to-C translator */
 /* From input file "gates.text" */
 
-
-
-
 #include <p2c/p2c.h>
-
-
-
-
-
-#define CAPFLOAT_G
 #include "capfloat.h"
 
-
 #define N_Cap           1
 #define Cstart          2
 
@@ -53,14 +43,12 @@ typedef struct ICCapfloat {
 
 
 
-
 /****************************************************************************/
 /*            Procedure To Simulate Cell In Algorithm                        */
 /****************************************************************************/
 
 
-Local Void Ex_Capfloat(act)
-Analog_32_action *act;
+void Ex_Capfloat(Analog_32_action *act)
 {
   double MinI1, MinI2, dI1dV1, dI1dV2, dI2dV1, dI2dV2;
   AnaExt_rec *Pin1Ptr;
@@ -117,8 +105,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Iin_Capfloat(act)
-Analog_32_action *act;
+void Iin_Capfloat(Analog_32_action *act)
 {
   AnaExt_rec *Pin1Ptr;
   double VPin1, VMem1;
@@ -159,14 +146,13 @@ Analog_32_action *act;
 }  /*Iin_Capfloat*/
 
 
-Local Void GetCnf_Capfloat(NewIC)
-ICCapfloat *NewIC;
+void GetCnf_Capfloat(ICCapfloat *NewIC)
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICCapfloat *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -190,8 +176,7 @@ ICCapfloat *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_Capfloat(act)
-Analog_32_action *act;
+void initlib_Capfloat(Analog_32_action *act)
 {
   AnaCell_rec *NewCell;
   ICCapfloat *NewIC;
@@ -209,17 +194,15 @@ Analog_32_action *act;
   NewIC = (ICCapfloat *)Malloc(sizeof(ICCapfloat));
   NewIC->ICCap = 1e-12;
   GetCnf_Capfloat(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*Capfloat_Initlib*/
 
 
 
-Local boolean Capfloatcheck(Inst, Attrnum)
-log_grec *Inst;
-long Attrnum;
+int Capfloatcheck(log_grec *Inst, long Attrnum)
 {
-  boolean Result;
+  int Result;
   CapfloatConst *CapfloatVar;
   Anainstlist *A_Gate;
 
@@ -240,8 +223,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_Capfloat(act)
-Analog_32_action *act;
+void Attr_Capfloat(Analog_32_action *act)
 {
   long Attrnum;
 
@@ -253,8 +235,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Capfloat(act)
-Analog_32_action *act;
+void Newgate_Capfloat(Analog_32_action *act)
 {
   CapfloatConst *CapfloatVar;
   Anainstlist *A_Gate;
@@ -267,7 +248,7 @@ Analog_32_action *act;
   CapfloatVar = (CapfloatConst *)Malloc(sizeof(CapfloatConst));
   /*Give all internal variables values derived from initial attribute values*/
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)CapfloatVar;
+  A_Gate->InstVar = (void *)CapfloatVar;
   AnaCapInit(act->inst);
   WITH = act->inst;
   WITH->attr[N_Cap - 1].UU.r = ICptr->ICCap;
@@ -275,8 +256,7 @@ Analog_32_action *act;
   WITH->attr[N_Cap - 1].changed = true;
 }
 
-Local Void Copygate_Capfloat(act)
-Analog_32_action *act;
+void Copygate_Capfloat(Analog_32_action *act)
 {
   CapfloatConst *CapfloatVar, *Old_Capfloatvar;
   Anainstlist *A_Gate, *A_Oldgate;
@@ -287,13 +267,12 @@ Analog_32_action *act;
   CapfloatVar = (CapfloatConst *)Malloc(sizeof(CapfloatConst));
   *CapfloatVar = *Old_Capfloatvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)CapfloatVar;
+  A_Gate->InstVar = (void *)CapfloatVar;
   /*Always Do*/
   AnaCapCopy(act->inst);
 }
 
-Local Void Dispose_Capfloat(act)
-Analog_32_action *act;
+void Dispose_Capfloat(Analog_32_action *act)
 {
   CapfloatConst *CapfloatVar;
   Anainstlist *A_Gate;
@@ -304,8 +283,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_Capfloat(act)
-Analog_32_action *act;
+void Readgate_Capfloat(Analog_32_action *act)
 {
   CapfloatConst *CapfloatVar;
   Anainstlist *A_Gate;
@@ -318,17 +296,16 @@ Analog_32_action *act;
   WITH1 = act->inst;
 }
 
-Local Void Probe_Capfloat(act)
-Analog_32_action *act;
+void Probe_Capfloat(Analog_32_action *act)
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr;
   double Node1, Node2, Pin1, Pin2, d;
-  Char Name1[256], Name2[256];
+  char Name1[256], Name2[256];
   log_grec *WITH;
-  Char STR1[22];
-  Char STR2[256];
-  Char STR3[256];
+  char STR1[22];
+  char STR2[256];
+  char STR3[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -379,71 +356,68 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Void Log_capfloat_initlib_32(act)
-Analog_32_action *act;
+void Log_capfloat_initlib_32(Analog_32_action *act)
 {
   /*Main Procedure*/
-
-
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_Capfloat(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_Capfloat(act);
     break;
 
-  case Analog_act_update:   /*8*/
+  case ANALOG_ACT_UPDATE:   /*8*/
     AnaCapUpdate(act->inst);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Capfloat(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     AnaCapReset(act->inst);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Capfloat(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Capfloat(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Capfloat(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Capfloat(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_Capfloat(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Capfloat(act);
     break;
 
@@ -456,7 +430,4 @@ Analog_32_action *act;
 #undef Cstart
 #undef GateName
 
-
-
-
 /* End. */
diff --git a/log/src/ana/capfloat.h b/log/src/ana/capfloat.h
index 4957b9a..05196da 100644
--- a/log/src/ana/capfloat.h
+++ b/log/src/ana/capfloat.h
@@ -1,57 +1,15 @@
-/* Header for module Capfloat, generated by p2c */
 #ifndef CAPFLOAT_H
 #define CAPFLOAT_H
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef CAPFLOAT_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_capfloat_initlib_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+void Log_capfloat_initlib_32 (Analog_32_action *act);
 
 #endif /*CAPFLOAT_H*/
 
diff --git a/log/src/ana/devtechn.c b/log/src/ana/devtechn.c
index 0943773..f4b5254 100644
--- a/log/src/ana/devtechn.c
+++ b/log/src/ana/devtechn.c
@@ -26,9 +26,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-#define DEVTECHN_G
 #include "devtechn.h"
 
 #define N_process      1
@@ -65,7 +62,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /****************************************************************************/
 
 
-Local Void initlib_Devtechn(act)
+void initlib_Devtechn(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -76,11 +73,11 @@ Analog_32_action *act;
   NewCell->intr_cell = 0;
   NewCell->plist_cell = NULL;
   NewCell->phase = Anasimple;
-  act->kind->info = (Anyptr)NewCell;
+  act->kind->info = (void *)NewCell;
 }  /*NFET4_Initlib*/
 
 
-Local Void Reload_Devtechn(act)
+void Reload_Devtechn(act)
 Analog_32_action *act;
 {
   log_grec *WITH;
@@ -159,7 +156,7 @@ Analog_32_action *act;
 
 }
 
-Local Void Attr_Devtechn(act)
+void Attr_Devtechn(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -389,7 +386,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Openconfig_Devtechn(act)
+void Openconfig_Devtechn(act)
 Analog_32_action *act;
 {
   long Index;
@@ -401,11 +398,11 @@ Analog_32_action *act;
   Reload_Devtechn(act);
 }
 
-Local Void Readgate_Devtechn(act)
+void Readgate_Devtechn(act)
 Analog_32_action *act;
 {
   log_grec *WITH;
-  Char STR1[256];
+  char STR1[256];
 
   WITH = act->inst;
   if (AnaOldmodel && !WITH->attr[0].blnk) {
@@ -432,11 +429,11 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Devtechn(act)
+void Newgate_Devtechn(act)
 Analog_32_action *act;
 {
   Analog_32_action Newact;
-  Char Newout[256];
+  char Newout[256];
 
   Newact.inst = act->inst;
   Newact.ok = true;
@@ -450,7 +447,7 @@ Analog_32_action *act;
 /*                 Library Listing For Cell Devtechn                        */
 /*==========================================================================*/
 
-Void Log_DEVTECHN_initlib_32(act)
+void Log_DEVTECHN_initlib_32(act)
 Analog_32_action *act;
 {
   /*Body of procedure*/
@@ -458,23 +455,23 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_Devtechn(act);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Devtechn(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     Openconfig_Devtechn(act);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Devtechn(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Devtechn(act);
     break;
 
diff --git a/log/src/ana/devtechn.h b/log/src/ana/devtechn.h
index bf5233d..fb04b89 100644
--- a/log/src/ana/devtechn.h
+++ b/log/src/ana/devtechn.h
@@ -1,58 +1,15 @@
-/* Header for module DEVTECHN, generated by p2c */
 #ifndef DEVTECHN_H
 #define DEVTECHN_H
 
-
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef DEVTECHN_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_DEVTECHN_initlib_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_DEVTECHN_initlib_32 (Analog_32_action *act);
 
 #endif /*DEVTECHN_H*/
 
diff --git a/log/src/ana/devtechp.c b/log/src/ana/devtechp.c
index 59a7d9c..396a113 100644
--- a/log/src/ana/devtechp.c
+++ b/log/src/ana/devtechp.c
@@ -26,9 +26,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-#define DEVTECHP_G
 #include "devtechp.h"
 
 #define N_process      1
@@ -64,7 +61,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /****************************************************************************/
 
 
-Local Void initlib_Devtechp(act)
+void initlib_Devtechp(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -75,11 +72,11 @@ Analog_32_action *act;
   NewCell->intr_cell = 0;
   NewCell->plist_cell = NULL;
   NewCell->phase = Anasimple;
-  act->kind->info = (Anyptr)NewCell;
+  act->kind->info = (void *)NewCell;
 }  /*NFET4_Initlib*/
 
 
-Local Void Reload_Devtechp(act)
+void Reload_Devtechp(act)
 Analog_32_action *act;
 {
   log_grec *WITH;
@@ -158,7 +155,7 @@ Analog_32_action *act;
 
 }
 
-Local Void Attr_Devtechp(act)
+void Attr_Devtechp(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -388,7 +385,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Openconfig_Devtechp(act)
+void Openconfig_Devtechp(act)
 Analog_32_action *act;
 {
   long Index;
@@ -400,11 +397,11 @@ Analog_32_action *act;
   Reload_Devtechp(act);
 }
 
-Local Void Readgate_Devtechp(act)
+void Readgate_Devtechp(act)
 Analog_32_action *act;
 {
   log_grec *WITH;
-  Char STR1[256];
+  char STR1[256];
 
   WITH = act->inst;
   if (AnaOldmodel && !WITH->attr[0].blnk) {
@@ -431,11 +428,11 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Devtechp(act)
+void Newgate_Devtechp(act)
 Analog_32_action *act;
 {
   Analog_32_action Newact;
-  Char Newout[256];
+  char Newout[256];
 
   Newact.inst = act->inst;
   Newact.ok = true;
@@ -449,7 +446,7 @@ Analog_32_action *act;
 /*                 Library Listing For Cell Devtechp                        */
 /*==========================================================================*/
 
-Void Log_DEVTECHP_initlib_32(act)
+void Log_DEVTECHP_initlib_32(act)
 Analog_32_action *act;
 {
   /*Body of procedure*/
@@ -457,23 +454,23 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_Devtechp(act);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Devtechp(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     Openconfig_Devtechp(act);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Devtechp(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Devtechp(act);
     break;
 
diff --git a/log/src/ana/devtechp.h b/log/src/ana/devtechp.h
index 1550037..a728195 100644
--- a/log/src/ana/devtechp.h
+++ b/log/src/ana/devtechp.h
@@ -1,58 +1,16 @@
-/* Header for module DEVTECHP, generated by p2c */
 #ifndef DEVTECHP_H
 #define DEVTECHP_H
 
-
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef DEVTECHP_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_DEVTECHP_initlib_32 PP((Analog_32_action *act));
 
+extern void Log_DEVTECHP_initlib_32 (Analog_32_action *act);
 
-#undef vextern
 
 #endif /*DEVTECHP_H*/
 
diff --git a/log/src/ana/diode1.c b/log/src/ana/diode1.c
index 0447ddb..6761db2 100644
--- a/log/src/ana/diode1.c
+++ b/log/src/ana/diode1.c
@@ -23,15 +23,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /* Output from p2c, the Pascal-to-C translator */
 /* From input file "scott.text" */
 
-
-
-
 #include <p2c/p2c.h>
-
-
-
-
-#define DIODE1_G
 #include "diode1.h"
 
 
@@ -46,7 +38,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 typedef struct Diode1Const {
   double Is, lam, K1, K2;
 
-  boolean Limit, OldLimit, NewLimit;
+  int Limit, OldLimit, NewLimit;
 } Diode1Const;
 
 
@@ -60,9 +52,9 @@ typedef struct ICDiode1 {
 /****************************************************************************/
 
 
-Local Void Limitfill(Inst, Limitflag, Erase)
+void Limitfill(Inst, Limitflag, Erase)
 log_grec *Inst;
-boolean Limitflag, Erase;
+int Limitflag, Erase;
 {
   short LLx, LLy, URx, URy;
 
@@ -91,7 +83,7 @@ boolean Limitflag, Erase;
 /*            Procedure To Simulate Cell In Algorithm                        */
 /****************************************************************************/
 
-Local Void Ex_Diode1(act)
+void Ex_Diode1(act)
 Analog_32_action *act;
 {
   double MinI1, MinI2, dI1dV1, dI1dV2, dI2dV1, dI2dV2;
@@ -168,7 +160,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Iin_Diode1(act)
+void Iin_Diode1(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr;
@@ -218,14 +210,14 @@ Analog_32_action *act;
   }
 }  /*Iin_Diode1*/
 
-Local Void GetCnf_Diode1(NewIC)
+void GetCnf_Diode1(NewIC)
 ICDiode1 *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICDiode1 *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -281,7 +273,7 @@ ICDiode1 *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_Diode1(act)
+void initlib_Diode1(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -304,17 +296,17 @@ Analog_32_action *act;
   NewIC->InitCab = 10e-15;
   NewIC->InitCcb = 10e-15;
   GetCnf_Diode1(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*Diode1_Initlib*/
 
 
 
-Local boolean Diode1check(Inst, Attrnum)
+int Diode1check(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   Diode1Const *Diode1Var;
   Anainstlist *A_Gate;
 
@@ -364,7 +356,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_Diode1(act)
+void Attr_Diode1(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -377,7 +369,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Diode1(act)
+void Newgate_Diode1(act)
 Analog_32_action *act;
 {
   Diode1Const *Diode1Var;
@@ -398,7 +390,7 @@ Analog_32_action *act;
   Diode1Var->OldLimit = false;
   Diode1Var->NewLimit = false;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)Diode1Var;
+  A_Gate->InstVar = (void *)Diode1Var;
   AnaCapInit(act->inst);
   A_Gate->Pininfo[0].Cap = ICptr->InitCcb;
   A_Gate->Pininfo[1].Cap = ICptr->InitCab;
@@ -414,7 +406,7 @@ Analog_32_action *act;
   WITH->attr[N_Vcrow - 1].changed = true;
 }
 
-Local Void Copygate_Diode1(act)
+void Copygate_Diode1(act)
 Analog_32_action *act;
 {
   Diode1Const *Diode1Var, *Old_Diode1var;
@@ -426,12 +418,12 @@ Analog_32_action *act;
   Diode1Var = (Diode1Const *)Malloc(sizeof(Diode1Const));
   *Diode1Var = *Old_Diode1var;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)Diode1Var;
+  A_Gate->InstVar = (void *)Diode1Var;
   /*Always Do*/
   AnaCapCopy(act->inst);
 }
 
-Local Void Dispose_Diode1(act)
+void Dispose_Diode1(act)
 Analog_32_action *act;
 {
   Diode1Const *Diode1Var;
@@ -443,7 +435,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_Diode1(act)
+void Readgate_Diode1(act)
 Analog_32_action *act;
 {
   Diode1Const *Diode1Var;
@@ -480,17 +472,17 @@ Analog_32_action *act;
   Diode1Var->K2 = AnaExpo(-Diode1Var->lam * WITH->attr[N_Vcrow - 1].UU.r);
 }
 
-Local Void Probe_Diode1(act)
+void Probe_Diode1(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr;
   double Node1, Node2, Pin1, Pin2, d;
-  Char Name1[256], Name2[256];
+  char Name1[256], Name2[256];
   log_grec *WITH;
-  Char STR1[20];
-  Char STR2[256];
-  Char STR3[256];
+  char STR1[20];
+  char STR2[256];
+  char STR3[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -535,7 +527,7 @@ Analog_32_action *act;
     AnaScoreboard("$", (long)AnaMessGate3);
 }
 
-Local Void Reset_Diode1(act)
+void Reset_Diode1(act)
 Analog_32_action *act;
 {
   Diode1Const *Diode1Var;
@@ -551,7 +543,7 @@ Analog_32_action *act;
     Limitfill(act->inst, Diode1Var->Limit, false);
 }
 
-Local Void PreUpdate_Diode1(act)
+void PreUpdate_Diode1(act)
 Analog_32_action *act;
 {
   Diode1Const *Diode1Var;
@@ -570,7 +562,7 @@ Analog_32_action *act;
   Diode1Var->NewLimit = (VPin1 - Vpin2 >= WITH1->attr[N_Vcrow - 1].UU.r);
 }
 
-Local Void Update_Diode1(act)
+void Update_Diode1(act)
 Analog_32_action *act;
 {
   Diode1Const *Diode1Var;
@@ -583,7 +575,7 @@ Analog_32_action *act;
   Diode1Var->Limit = Diode1Var->NewLimit;
 }
 
-Local Void Display_Diode1(act)
+void Display_Diode1(act)
 Analog_32_action *act;
 {
   Diode1Const *Diode1Var;
@@ -600,7 +592,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Refresh_Diode1(act)
+void Refresh_Diode1(act)
 Analog_32_action *act;
 {
   Diode1Const *Diode1Var;
@@ -611,7 +603,7 @@ Analog_32_action *act;
   Limitfill(act->inst, Diode1Var->Limit, false);
 }
 
-Local Void Erase_Diode1(act)
+void Erase_Diode1(act)
 Analog_32_action *act;
 {
   Diode1Const *Diode1Var;
@@ -628,7 +620,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Void Log_Diode1_INITLIB_32(act)
+void Log_Diode1_INITLIB_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -636,79 +628,79 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_Diode1(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_Diode1(act);
     break;
 
-  case Analog_act_preupdate:
+  case ANALOG_ACT_PREUPDATE:
     PreUpdate_Diode1(act);
     break;
 
-  case Analog_act_update:   /*For complex gates - see IDIFF*/
+  case ANALOG_ACT_UPDATE:   /*For complex gates - see IDIFF*/
     Update_Diode1(act);
     break;
 
-  case Analog_act_display:
+  case ANALOG_ACT_DISPLAY:
     Display_Diode1(act);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Diode1(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     Reset_Diode1(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Diode1(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Diode1(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Diode1(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Diode1(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_Diode1(act);
     break;
 
-  case Analog_act_erase:
+  case ANALOG_ACT_ERASE:
     Erase_Diode1(act);
     break;
 
-  case Analog_act_refresh:
+  case ANALOG_ACT_REFRESH:
     Refresh_Diode1(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Diode1(act);
     break;
 
@@ -723,10 +715,4 @@ Analog_32_action *act;
 #undef Cstart
 #undef Gatename
 
-
-
-
-
-
-
 /* End. */
diff --git a/log/src/ana/diode1.h b/log/src/ana/diode1.h
index cf68d93..132915e 100644
--- a/log/src/ana/diode1.h
+++ b/log/src/ana/diode1.h
@@ -1,54 +1,14 @@
-/* Header for module Diode1, generated by p2c */
 #ifndef DIODE1_H
 #define DIODE1_H
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NSOLVER_H
-#include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef DIODE1_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-/*$If Float$
-  $float_hdw on$
-  $End$*/
-
-
-
-extern Void Log_Diode1_INITLIB_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_Diode1_INITLIB_32 (Analog_32_action *act);
 
 #endif /*DIODE1_H*/
 
diff --git a/log/src/ana/ganglion.c b/log/src/ana/ganglion.c
index 3eacbe4..0351c38 100644
--- a/log/src/ana/ganglion.c
+++ b/log/src/ana/ganglion.c
@@ -27,16 +27,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /*When its time to add subthreshold light, look at IDIFF for new update,
   write procedures*/
 
-
-
-
-
 #include <p2c/p2c.h>
-
-
-
-
-#define GANGLION_G
 #include "ganglion.h"
 
 
@@ -83,7 +74,7 @@ typedef struct GanglionConst {
   double TauVinVout, TauVin, TauVleak, Conductance;
 
 
-  boolean Limit, OldLimit, NewLimit;
+  int Limit, OldLimit, NewLimit;
 
   /*For every 'state variable'*/
   /*OldState:Statetype;*/
@@ -111,9 +102,9 @@ typedef enum {
 /****************************************************************************/
 
 
-Local Void Limitfill(Inst, Limitflag, Erase)
+void Limitfill(Inst, Limitflag, Erase)
 log_grec *Inst;
-boolean Limitflag, Erase;
+int Limitflag, Erase;
 {
   short LLx, LLy, URx, URy;
 
@@ -141,14 +132,14 @@ boolean Limitflag, Erase;
 /*                   Cell Installation Procedures                           */
 /****************************************************************************/
 
-Local Void GetCnf_Ganglion(NewIC)
+void GetCnf_Ganglion(NewIC)
 ICGanglion *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICGanglion *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -264,7 +255,7 @@ ICGanglion *NewIC;
 }
 
 
-Local Void INITLIB_GANGLION(act)
+void INITLIB_GANGLION(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -297,8 +288,8 @@ Analog_32_action *act;
   NewIC->InitCbVout = 10e-15;
   NewIC->InitCbVleak = 10e-15;
   GetCnf_Ganglion(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*Ganglion_Initlib*/
 
 
@@ -319,11 +310,11 @@ Analog_32_action *act;
 
 
 
-Local boolean Ganglioncheck(Inst, Attrnum)
+int Ganglioncheck(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   GanglionConst *GanglionVar;
   Anainstlist *A_Gate;
 
@@ -418,7 +409,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_Ganglion(act)
+void Attr_Ganglion(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -437,7 +428,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Ganglion(act)
+void Newgate_Ganglion(act)
 Analog_32_action *act;
 {
   GanglionConst *GanglionVar;
@@ -471,7 +462,7 @@ Analog_32_action *act;
   GanglionVar->NewLimit = false;
   /*Give internal variables values derived from initial attribute values*/
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)GanglionVar;
+  A_Gate->InstVar = (void *)GanglionVar;
   AnaCapInit(act->inst);   /*Initialize attributes of Cstart*/
   A_Gate->Pininfo[G_Vin - 1].Cap = ICptr->InitCbVin;
   A_Gate->Pininfo[G_Vout - 1].Cap = ICptr->InitCbVout;
@@ -509,7 +500,7 @@ Analog_32_action *act;
   WITH->attr[N_Ktqn - 1].changed = true;
 }
 
-Local Void Copygate_Ganglion(act)
+void Copygate_Ganglion(act)
 Analog_32_action *act;
 {
   GanglionConst *GanglionVar, *Old_Ganglionvar;
@@ -520,12 +511,12 @@ Analog_32_action *act;
   GanglionVar = (GanglionConst *)Malloc(sizeof(GanglionConst));
   *GanglionVar = *Old_Ganglionvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)GanglionVar;
+  A_Gate->InstVar = (void *)GanglionVar;
   AnaCapCopy(act->inst);
 }
 
 
-Local Void Dispose_Ganglion(act)
+void Dispose_Ganglion(act)
 Analog_32_action *act;
 {
   GanglionConst *GanglionVar;
@@ -538,7 +529,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Readgate_Ganglion(act)
+void Readgate_Ganglion(act)
 Analog_32_action *act;
 {
   GanglionConst *GanglionVar;
@@ -611,7 +602,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Reset_Ganglion(act)
+void Reset_Ganglion(act)
 Analog_32_action *act;
 {
   GanglionConst *GanglionVar;
@@ -627,7 +618,7 @@ Analog_32_action *act;
     Limitfill(act->inst, GanglionVar->Limit, false);
 }
 
-Local Void PreUpdate_Ganglion(act)
+void PreUpdate_Ganglion(act)
 Analog_32_action *act;
 {
   GanglionConst *GanglionVar;
@@ -653,7 +644,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Update_Ganglion(act)
+void Update_Ganglion(act)
 Analog_32_action *act;
 {
   GanglionConst *GanglionVar;
@@ -667,7 +658,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Display_Ganglion(act)
+void Display_Ganglion(act)
 Analog_32_action *act;
 {
   GanglionConst *GanglionVar;
@@ -684,7 +675,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Refresh_Ganglion(act)
+void Refresh_Ganglion(act)
 Analog_32_action *act;
 {
   GanglionConst *GanglionVar;
@@ -697,7 +688,7 @@ Analog_32_action *act;
 
 
 
-Local Void Erase_Ganglion(act)
+void Erase_Ganglion(act)
 Analog_32_action *act;
 {
   GanglionConst *GanglionVar;
@@ -714,7 +705,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Ex_Ganglion(act)
+void Ex_Ganglion(act)
 Analog_32_action *act;
 {
   double MinIin, dIindVin, dIindVout, dIindVleak, MinIout, dIoutdVin,
@@ -890,7 +881,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Iin_Ganglion(act)
+void Iin_Ganglion(act)
 Analog_32_action *act;
 {
   AnaExt_rec *PinInPtr;
@@ -987,7 +978,7 @@ Analog_32_action *act;
 }  /*Iin_Ganglion*/
 
 
-Local Void Probe_Ganglion(act)
+void Probe_Ganglion(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
@@ -996,9 +987,9 @@ Analog_32_action *act;
   GanglionConst *GanglionVar;
   double ExpoVleak, BlendVleak, Ileak;
   log_grec *WITH;
-  Char STR1[22];
-  Char STR2[256];
-  Char STR3[256];
+  char STR1[22];
+  char STR2[256];
+  char STR3[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -1034,7 +1025,7 @@ Analog_32_action *act;
 
 
 
-Void Log_ganglion_initlib_32(act)
+void Log_ganglion_initlib_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -1042,79 +1033,79 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     INITLIB_GANGLION(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_Ganglion(act);
     break;
 
-  case Analog_act_preupdate:
+  case ANALOG_ACT_PREUPDATE:
     PreUpdate_Ganglion(act);
     break;
 
-  case Analog_act_update:   /*For complex gates - see IDIFF*/
+  case ANALOG_ACT_UPDATE:   /*For complex gates - see IDIFF*/
     Update_Ganglion(act);
     break;
 
-  case Analog_act_display:
+  case ANALOG_ACT_DISPLAY:
     Display_Ganglion(act);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Ganglion(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     Reset_Ganglion(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Ganglion(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Ganglion(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Ganglion(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Ganglion(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_Ganglion(act);
     break;
 
-  case Analog_act_erase:
+  case ANALOG_ACT_ERASE:
     Erase_Ganglion(act);
     break;
 
-  case Analog_act_refresh:
+  case ANALOG_ACT_REFRESH:
     Refresh_Ganglion(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Ganglion(act);
     break;
 
diff --git a/log/src/ana/ganglion.h b/log/src/ana/ganglion.h
index f14570c..43a7c3d 100644
--- a/log/src/ana/ganglion.h
+++ b/log/src/ana/ganglion.h
@@ -1,57 +1,15 @@
-/* Header for module Ganglion, generated by p2c */
 #ifndef GANGLION_H
 #define GANGLION_H
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef GANGLION_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-/*$If Float$
-  $float_hdw on$
-  $End$*/
-/*$If Debugflag$
-  $Debug$
-  $End$*/
-
-
-
-extern Void Log_ganglion_initlib_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_ganglion_initlib_32 (Analog_32_action *act);
 
 #endif /*GANGLION_H*/
 
diff --git a/log/src/ana/globals.c b/log/src/ana/globals.c
index 3dac2b5..8c7d527 100644
--- a/log/src/ana/globals.c
+++ b/log/src/ana/globals.c
@@ -41,11 +41,11 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 #endif
 
 
-Char *AnaProbeVoltStr(AnaResult, Val)
-Char *AnaResult;
+char *AnaProbeVoltStr(AnaResult, Val)
+char *AnaResult;
 double Val;
 {
-  Char Outstr[256];
+  char Outstr[256];
 
   if (fabs(Val) < AnaVardone_Epsilon)
     (*AnaLogglobals->hook.realunit)(0.0, (int)AnaProbeprec, "V", Outstr);
@@ -55,11 +55,11 @@ double Val;
 }
 
 
-Char *AnaProbeAmpStr(AnaResult, Val)
-Char *AnaResult;
+char *AnaProbeAmpStr(AnaResult, Val)
+char *AnaResult;
 double Val;
 {
-  Char Outstr[256];
+  char Outstr[256];
 
   if (fabs(Val) < 1e-15)
     (*AnaLogglobals->hook.realunit)(0.0, (int)AnaProbeprec, "A", Outstr);
@@ -95,7 +95,7 @@ long Intensity;
 
 
 
-Void AnaTimeReset()
+void AnaTimeReset()
 {
 
   /*Should be called whenever: 1)Resetting simulation.
@@ -123,24 +123,24 @@ Void AnaTimeReset()
 /*Execution procedure for analog gates that cannot presently simulate*/
 
 
-Void AnaDummyGate(act)
+void AnaDummyGate(act)
 Analog_32_action *act;
 {
   switch (act->action) {
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     AnaCapInit(act->inst);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     AnaCapCopy(act->inst);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     AnaCapDispose(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     act->ok = false;
     break;
 
@@ -150,7 +150,7 @@ Analog_32_action *act;
 }
 
 
-Void AnaDummyInit(dummykindptr)
+void AnaDummyInit(dummykindptr)
 log_krec *dummykindptr;
 {
   AnaCell_rec *NewCell;
@@ -170,15 +170,15 @@ log_krec *dummykindptr;
     NewCell->plist_cell[Index].active = true;
   }
   NewCell->Ainfo = NULL;
-  dummykindptr->info = (Anyptr)NewCell;
+  dummykindptr->info = (void*)NewCell;
 }
 
 
 /********************************************************************************/
 /*                   Procedure to set/clear reset memory                        */
 
-Void AnaAnalog_ChangeReset(Erase)
-boolean Erase;
+void AnaAnalog_ChangeReset(Erase)
+int Erase;
 {
 
   /********************************************************************************/
@@ -193,9 +193,9 @@ boolean Erase;
   AnaInstpinrec *WITH1;
 
   if (Erase)
-    Act.action = Analog_act_clear;
+    Act.action = ANALOG_ACT_CLEAR;
   else
-    Act.action = Analog_act_set;
+    Act.action = ANALOG_ACT_SET;
   FORLIM = AnaLogglobals->numpages;
   for (Pages = 0; Pages < FORLIM; Pages++) {
     Count = AnaLogglobals->gbase[Pages];
@@ -229,13 +229,13 @@ boolean Erase;
 /*******************************************************************************/
 /*            Procedure For Changing Scoreboard Message                        */
 
-Void AnaScoreboard(Newmessage_, purpose)
-Char *Newmessage_;
+void AnaScoreboard(Newmessage_, purpose)
+char *Newmessage_;
 long purpose;
 {
 
   /*******************************************************************************/
-  Char Newmessage[256];
+  char Newmessage[256];
   Analog_32_action Act;
   AnaCell_rec *A_Kind;
   log_grec *GCount;
@@ -250,7 +250,7 @@ long purpose;
     while (GCount != NULL) {
       WITH = GCount;
       if (WITH->kind->simtype->simtype == 32) {
-	Act.action = Analog_act_message;
+	Act.action = ANALOG_ACT_MESSAGE;
 	Act.page = Pages;
 	Act.inst = GCount;
 	strcpy(Act.message, Newmessage);
@@ -268,10 +268,10 @@ long purpose;
 /********************************************************************************/
 /*     Procedure for handling LOG.CNF calls                                     */
 
-Void AnaGetcommand(Keyword, Arg, Found)
-Char *Keyword;
-Char *Arg;
-boolean *Found;
+void AnaGetcommand(Keyword, Arg, Found)
+char *Keyword;
+char *Arg;
+int *Found;
 {
   /*Key to search under*/
   /*command if found*/
@@ -298,9 +298,9 @@ boolean *Found;
 }
 
 
-Void AnaAddcommand(Keyword, Arg)
-Char *Keyword;
-Char *Arg;
+void AnaAddcommand(Keyword, Arg)
+char *Keyword;
+char *Arg;
 {
   /*Key to search under*/
   /*command if found*/
@@ -315,7 +315,7 @@ Char *Arg;
 }
 
 
-Void AnaPopcommand()
+void AnaPopcommand()
 {
   AnaCommand_rec *Temp;
 
@@ -331,14 +331,14 @@ Void AnaPopcommand()
 /*         Utility procedure for data input                                   */
 /******************************************************************************/
 
-Void AnaGetvar(Varname, Value)
-Char *Varname;
+void AnaGetvar(Varname, Value)
+char *Varname;
 double *Value;
 {
   long Temp;
-  Char Name[256];
+  char Name[256];
   double Newval;
-  Char *STR3;
+  char *STR3;
 
   m_alpha_on();
   m_graphics_on();
@@ -441,11 +441,11 @@ double V;
 /*     General purpose procedures for attribute range checking                */
 /*=============================================================================*/
 
-boolean AnaVrange(Inst, Attrnum)
+int AnaVrange(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean AnaResult;
+  int AnaResult;
 
   AnaResult = true;
   if (!Inst->attr[Attrnum - 1].blnk) {
@@ -457,12 +457,12 @@ long Attrnum;
 }
 
 
-boolean AnaCrange(Inst, Attrnum, OkZero)
+int AnaCrange(Inst, Attrnum, OkZero)
 log_grec *Inst;
 long Attrnum;
-boolean OkZero;
+int OkZero;
 {
-  boolean AnaResult;
+  int AnaResult;
 
   AnaResult = true;
   if (OkZero) {
@@ -478,11 +478,11 @@ boolean OkZero;
 }
 
 
-boolean AnaDisplayrange(Inst, Attrnum)
+int AnaDisplayrange(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean AnaResult;
+  int AnaResult;
 
   AnaResult = true;
   if (!Inst->attr[Attrnum - 1].blnk && (Inst->attr[Attrnum - 1].UU.U73.i1 < 1 ||
@@ -493,13 +493,13 @@ long Attrnum;
 
 
 
-boolean AnaGate_On_Display(Inst)
+int AnaGate_On_Display(Inst)
 log_grec *Inst;
 {
-  boolean AnaResult;
+  int AnaResult;
   log_grec *GCount;
   long Showpage;
-  boolean Found;
+  int Found;
 
   AnaResult = false;
   Showpage = AnaLogglobals->showpage;
@@ -522,7 +522,7 @@ log_grec *Inst;
 /*        General purpose library to handle pin to ground capacitance          */
 /*=============================================================================*/
 
-Void AnaCapInit(inst)
+void AnaCapInit(inst)
 log_grec *inst;
 {
   Anainstlist *A_Gate;
@@ -543,7 +543,7 @@ log_grec *inst;
 
 
 
-Void AnaCapCopy(inst)
+void AnaCapCopy(inst)
 log_grec *inst;
 {
   Anainstlist *A_Gate, *A_Oldgate;
@@ -564,7 +564,7 @@ log_grec *inst;
 }
 
 
-Void AnaCapDispose(inst)
+void AnaCapDispose(inst)
 log_grec *inst;
 {
   Anainstlist *A_Gate;
@@ -576,7 +576,7 @@ log_grec *inst;
 }
 
 
-Void AnaCapReset(inst)
+void AnaCapReset(inst)
 log_grec *inst;
 {
   Anainstlist *A_Gate;
@@ -592,7 +592,7 @@ log_grec *inst;
 }
 
 
-Void AnaCappass1(inst)
+void AnaCappass1(inst)
 log_grec *inst;
 {
   Anainstlist *A_Gate;
@@ -613,7 +613,7 @@ log_grec *inst;
 }
 
 
-Void AnaCappass2(inst)
+void AnaCappass2(inst)
 log_grec *inst;
 {
   Anainstlist *A_Gate;
@@ -641,7 +641,7 @@ log_grec *inst;
 }
 
 
-Void AnaCapUpdate(inst)
+void AnaCapUpdate(inst)
 log_grec *inst;
 {
   Anainstlist *A_Gate;
@@ -657,7 +657,7 @@ log_grec *inst;
 }
 
 
-Void AnaCapex(inst)
+void AnaCapex(inst)
 log_grec *inst;
 {
   Anainstlist *A_Gate;
@@ -687,7 +687,7 @@ log_grec *inst;
 }
 
 
-Void AnaCapIin(act)
+void AnaCapIin(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
@@ -701,10 +701,10 @@ Analog_32_action *act;
 }
 
 
-Void AnaCapattrload(base, inst, first)
+void AnaCapattrload(base, inst, first)
 long base;
 log_grec *inst;
-boolean first;
+int first;
 {
   Anainstlist *A_Gate;
   long Index, Address, Numpins;
@@ -735,7 +735,7 @@ boolean first;
 }
 
 
-Void AnaCapattrwrite(base, inst)
+void AnaCapattrwrite(base, inst)
 long base;
 log_grec *inst;
 {
@@ -754,7 +754,7 @@ log_grec *inst;
 }
 
 
-Void AnaCapattrread(base, inst)
+void AnaCapattrread(base, inst)
 long base;
 log_grec *inst;
 {
@@ -776,17 +776,17 @@ log_grec *inst;
 }
 
 
-Static Void NodevalSet(Setnode, Value, ResetVal)
+static void NodevalSet(Setnode, Value, ResetVal)
 log_nrec *Setnode;
 double Value;
-boolean ResetVal;
+int ResetVal;
 {
   AnaCell_rec *A_Kind;
   Anainstlist *A_Gate;
   long Index;
   log_grec *Count;
   long Pages, Numpages;
-  boolean Erased;
+  int Erased;
   log_grec *WITH;
   long FORLIM1;
 
@@ -825,10 +825,10 @@ boolean ResetVal;
 
 
 
-Void AnaCapattrinsert(base, attrnum, inst, Ok)
+void AnaCapattrinsert(base, attrnum, inst, Ok)
 long base, attrnum;
 log_grec *inst;
-boolean *Ok;
+int *Ok;
 {
   Anainstlist *A_Gate;
   long Nodenum, Param;
@@ -892,33 +892,33 @@ boolean *Ok;
 }
 
 
-Static Void Dataout(data)
-Char *data;
+static void Dataout(data)
+char *data;
 {
   if (AnaLogglobals->traceflag)
     fputs(data, *AnaLogglobals->tracefile);
 }
 
 
-Static Void Linefeed()
+static void Linefeed()
 {
   if (AnaLogglobals->traceflag)
     putc('\n', *AnaLogglobals->tracefile);
 }
 
 
-Static Void Openfiles()
+static void Openfiles()
 {
   if (!AnaLogglobals->traceopen)
     (*AnaLogglobals->hook.trace)("anaLOG opening tracefile");
 }
 
 
-Void AnaMatdump()
+void AnaMatdump()
 {
   long Row, Col, Dump;
-  Char Newdata[256];
-  Char STR3[256];
+  char Newdata[256];
+  char STR3[256];
   long FORLIM, FORLIM1;
   AnaMatRec *WITH;
 
@@ -970,15 +970,15 @@ Void AnaMatdump()
 }
 
 
-Static Void PrintResult(Rownum)
+static void PrintResult(Rownum)
 long Rownum;
 {
   log_nrec *Ext_Count;
   AnaExt_rec *A_Node;
   AnaInt_rec *Int_Count;
-  boolean Found;
+  int Found;
   long Dump;
-  Char Newdata[256];
+  char Newdata[256];
   AnaMatRec *WITH1;
 
   Ext_Count = AnaLogglobals->nbase;
@@ -1030,10 +1030,10 @@ long Rownum;
 }
 
 
-Void AnaDiffdump()
+void AnaDiffdump()
 {
   long Row, Col, Dump;
-  Char Newdata[256];
+  char Newdata[256];
   long FORLIM, FORLIM1;
   AnaMatRec *WITH;
 
@@ -1106,9 +1106,9 @@ Void AnaDiffdump()
 int stepcount = 0;
 
 
-boolean AnaQuit()
+int AnaQuit()
 {
-  boolean AnaResult;
+  int AnaResult;
 
   AnaResult = false;
   stepcount++;
@@ -1127,7 +1127,7 @@ boolean AnaQuit()
 /********************************************************************************/
 
 
-Void AnaTimeinit()
+void AnaTimeinit()
 {
   AnaLogglobals->acttool->nexttstep = 0.0;
   AnaStoptime = timers_sysclock() + AnaLogglobals->fastspeed;
@@ -1138,7 +1138,7 @@ Void AnaTimeinit()
 /*         Updates calculated parameters after changes                          */
 /********************************************************************************/
 
-Void AnaParamUpdate()
+void AnaParamUpdate()
 {
   AnaPhysical.Ut = (AnaPhysical.k*AnaPhysical.T)/AnaPhysical.q;
 
diff --git a/log/src/ana/globals.h b/log/src/ana/globals.h
index 753f609..72de9f6 100644
--- a/log/src/ana/globals.h
+++ b/log/src/ana/globals.h
@@ -3,22 +3,10 @@
 #define GLOBALS_H
 
 
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
 
 #ifdef GLOBALS_G
 # define vextern
@@ -38,17 +26,6 @@
 #define AnaFloat        false
 #define AnaDebugflag    false
 
-/*Initialize floating point*/
-
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-
-/*$If Debugflag$
-$Debug$
-$End$*/
-
 /*Things nobody would ever change*/
 
 
@@ -195,58 +172,48 @@ $End$*/
    by program at runtime                                                      */
 /*============================================================================*/
 
-
-
-/*Initialize a new kind*/
-/*Contribute to matrix*/
-/*Calculations before updating*/
-/*Update memory elements*/
-/*Update display*/
-/*Relate current of a pin*/
-/*First pass of guess*/
-/*Second pass of guess*/
-/*Checks attribute changes*/
-/*Resets memory elements*/
-/*Sets state at reset*/
-/*Clears state at reset*/
-/*Refresh display*/
-/*Erase display*/
-/*Touch a gate*/
-/*Twiddle meters*/
-/*Make a new instance*/
-/*Copy an instance*/
-/*To load in config values*/
-/*to read in a gate description*/
-/*to write out a gate description*/
-/*display a message*/
-/*contribute to probe display*/
-/*Dispose an old instance*/
 typedef enum {
-  Analog_act_newkind, Analog_act_ex, Analog_act_preupdate, Analog_act_update,
-  Analog_act_display, Analog_act_Iin, Analog_act_pass1, Analog_act_pass2,
-  Analog_act_attrchange, Analog_act_reset, Analog_act_set, Analog_act_clear,
-  Analog_act_refresh, Analog_act_erase, Analog_act_touch,
-  Analog_act_disconnect, Analog_act_newgate, Analog_act_copygate,
-  Analog_act_openconfig, Analog_act_readgate, Analog_act_writegate,
-  Analog_act_message, Analog_act_probe, Analog_act_disposegate
+	ANALOG_ACT_NEWKIND,    /**< Initialize a new kind */
+	ANALOG_ACT_EX,         /**< Contribute to matrix */
+	ANALOG_ACT_PREUPDATE,  /**< Calculations before updating */
+	ANALOG_ACT_UPDATE,     /**< Update memory elements */
+	ANALOG_ACT_DISPLAY,    /**< Update display */
+	ANALOG_ACT_IIN,        /**< Relate current of a pin */
+	ANALOG_ACT_PASS1,      /**< First pass of guess */
+	ANALOG_ACT_PASS2,      /**< econd pass of guess */
+	ANALOG_ACT_ATTRCHANGE, /**< Checks attribute changes */
+	ANALOG_ACT_RESET,      /**< Resets memory elements */
+	ANALOG_ACT_SET,        /**< Sets state at reset */
+	ANALOG_ACT_CLEAR,      /**< Clears state at reset */
+    ANALOG_ACT_REFRESH,    /**< Refresh display */
+	ANALOG_ACT_ERASE,      /**< Erase display */
+	ANALOG_ACT_TOUCH,      /**< Touch a gate*/
+	ANALOG_ACT_DISCONNECT, /**< Twiddle meters*/
+	ANALOG_ACT_NEWGATE,    /**< Make a new instance*/
+	ANALOG_ACT_COPYGATE,   /**< Copy an instance*/
+	ANALOG_ACT_OPENCONFIG, /**< To load in config values*/
+	ANALOG_ACT_READGATE,   /**< to read in a gate description*/
+	ANALOG_ACT_WRITEGATE,  /**< to write out a gate description*/
+	ANALOG_ACT_MESSAGE,    /**< display a message*/
+	ANALOG_ACT_PROBE,      /**< contribute to probe display*/
+	ANALOG_ACT_DISPOSEGATE /**< Dispose an old instance*/
 } Analog_32_actionkinds;
 
 
 typedef struct Analog_32_action {
-  Analog_32_actionkinds action;   /*Desired Action*/
-  log_krec *kind;   /*Kind of interest*/
-  log_grec *inst;   /*Gate of interest*/
-  long pin;   /*Pin of interest*/
-  long page;   /*Page of interest*/
-  double Iin;   /*Current of pin of interest*/
-  boolean ok;   /*An error flag*/
-  boolean accepted;   /*Another error flag*/
-  Char message[256];   /*A scoreboard message*/
-  long messagenum;   /*purpose of message*/
+  Analog_32_actionkinds action;   /**< Desired Action */
+  log_krec *kind;                 /**< Kind of interest */
+  log_grec *inst;                 /**< Gate of interest */
+  long pin;                       /**< Pin of interest */
+  long page;                      /**< Page of interest */
+  double Iin;                     /**< Current of pin of interest */
+  int ok;                         /**< An error flag */
+  int accepted;                   /**< Another error flag */
+  char message[256];              /**< A scoreboard message */
+  long messagenum;                /**< purpose of message */
 } Analog_32_action;
 
 
-
 /******************************************************************************/
 /* Each pin of a standard cell will have pin-specific information which will
    involve initital guessing, syntax checking, and simulation. The plist_cell
@@ -269,7 +236,8 @@ typedef struct Analog_32_action {
  {*****************************************************************************/
 
 typedef struct Anapinrec {
-  boolean standalone, active;
+  int standalone;
+  int active;
 } Anapinrec;
 
 typedef Anapinrec Anaparray[AnaLarge];
@@ -303,13 +271,13 @@ typedef enum {
 
 
 typedef struct AnaCell_rec {
-  boolean simulatable;   /*Can this gate be simulated?*/
-  Void (*proc_cell) PP((Analog_32_action *act));
+  int simulatable;   /*Can this gate be simulated?*/
+  void (*proc_cell) (Analog_32_action *act);
       /*Procedure for cell execution*/
   long intr_cell;   /*Number of internal variables in cell*/
   Anaupdate_phase phase;   /*Phase of update*/
   Anapinrec *plist_cell;   /*Pin description array of length:pins_cell*/
-  Anyptr Ainfo;
+  void *Ainfo;
 } AnaCell_rec;
 
 /******************************************************************************/
@@ -344,14 +312,14 @@ typedef struct AnaInt_rec {
 typedef struct AnaExt_rec {
   /*External Nodes*/
   long refcnt;   /*Marker for syntax checking*/
-  boolean Ok_Alone;   /*Marker for syntax checking*/
+  int Ok_Alone;   /*Marker for syntax checking*/
   double ltimestep;   /*Value of last simulation*/
   double last;   /*last value of a simulation*/
   double now;   /*present value of a simulation*/
   long nodenum;   /*Node number for array indexing*/
   long col_now;   /*color for glow mode*/
   long col_ltimestep;   /*color for glow mode*/
-  boolean changed_now;   /*changed flag for glowmode*/
+  int changed_now;   /*changed flag for glowmode*/
 } AnaExt_rec;
 
 /* Each gate also has analog-specific information. */
@@ -382,9 +350,9 @@ typedef AnaInstpinrec Anapininstarray[AnaLarge];
 
 typedef struct Anainstlist {
   AnaGate_intnoderec *Gate_nodelist;
-  Anyptr InstVar;
+  void *InstVar;
   AnaInstpinrec *Pininfo;
-  boolean NotReady;
+  int NotReady;
 } Anainstlist;
 
 /* **************************************************************************/
@@ -437,8 +405,8 @@ typedef AnaLimcheck AnaCheckarray[AnaParamnum][2];
 
 
 typedef struct AnaCommand_rec {
-  Char Command[17];
-  Char Arguments[256];
+  char Command[17];
+  char Arguments[256];
   struct AnaCommand_rec *Next;
 } AnaCommand_rec;
 
@@ -446,7 +414,7 @@ typedef struct AnaCommand_rec {
 /*Array position 0 is a 'bit-bucket' for vdd & gnd only*/
 
 typedef double AnaMatArray[AnaRowbound + 1][AnaColbound + 1];
-typedef boolean AnaMatFlags[AnaRowbound + 1][AnaColbound + 1];
+typedef int AnaMatFlags[AnaRowbound + 1][AnaColbound + 1];
 
 typedef struct AnaMatRec {
   AnaMatArray Mat;
@@ -488,7 +456,7 @@ vextern log_nrec *AnaVddnode, *Anagndnode;
 
 
 /*******************************************************************************/
-vextern Char AnaCh;   /*Used for 'press any key' debugging*/
+vextern char AnaCh;   /*Used for 'press any key' debugging*/
 /*******************************************************************************/
 
 
@@ -497,47 +465,47 @@ vextern Char AnaCh;   /*Used for 'press any key' debugging*/
 
 /*Holds state of entire pass procedure*/
 
-vextern boolean AnaReady;   /*Says That a circuit is ready to simulate*/
-vextern boolean AnaChanged;   /*Says That a change has been made*/
+vextern int AnaReady;   /*Says That a circuit is ready to simulate*/
+vextern int AnaChanged;   /*Says That a change has been made*/
 
 /*Holds state of simulation proper*/
 
-vextern boolean AnaStart;   /*Indicates whether this is initial timestep*/
-vextern boolean AnaError;   /*Simulation flag*/
-vextern boolean AnaDone, AnaOverflow;   /*Simulation flags*/
-vextern boolean AnaToobig;   /*Simulation flag*/
-vextern boolean AnaToosmall;   /*Simulation flag*/
-vextern boolean AnaSuccess;   /*Simulation flag*/
+vextern int AnaStart;   /*Indicates whether this is initial timestep*/
+vextern int AnaError;   /*Simulation flag*/
+vextern int AnaDone, AnaOverflow;   /*Simulation flags*/
+vextern int AnaToobig;   /*Simulation flag*/
+vextern int AnaToosmall;   /*Simulation flag*/
+vextern int AnaSuccess;   /*Simulation flag*/
 vextern long AnaItercount, AnaItermax;
     /*Variables for adaptive iteration watchdog*/
 vextern double AnaAccum;   /*Total accumulated timed*/
 vextern double AnaDt, AnaDtlast;   /*Present and last timestep of system*/
-vextern boolean AnaChangedDt;   /*A new dt has happened*/
-vextern boolean AnaChangedP;   /*A transistor parameter has changed*/
-vextern boolean AnaInuse;   /*At least one analog gate exists*/
+vextern int AnaChangedDt;   /*A new dt has happened*/
+vextern int AnaChangedP;   /*A transistor parameter has changed*/
+vextern int AnaInuse;   /*At least one analog gate exists*/
 vextern long AnaDtcount;   /*Counting variable to prevent roundoff*/
 vextern long AnaRelaxcount;
     /*Comparison variable for Dtcount for relaxation*/
-vextern boolean AnaExact;   /*Flag for doing accuracy checking*/
-vextern boolean AnaDifficult;   /*Flag for a difficult simulation*/
-vextern boolean AnaToomany;   /*Flag for too many iterations*/
-vextern boolean AnaErase;   /*State of reset memory*/
-vextern boolean AnaOldmodel;   /*Model selection when loading in gates*/
-vextern boolean AnaDebugset;   /*Flag used in debugging mode*/
+vextern int AnaExact;   /*Flag for doing accuracy checking*/
+vextern int AnaDifficult;   /*Flag for a difficult simulation*/
+vextern int AnaToomany;   /*Flag for too many iterations*/
+vextern int AnaErase;   /*State of reset memory*/
+vextern int AnaOldmodel;   /*Model selection when loading in gates*/
+vextern int AnaDebugset;   /*Flag used in debugging mode*/
 vextern long AnaDebugsize;   /*Number of significant digits for debug mode*/
-vextern boolean AnaTimermode;   /*Mode selection for benchmarking*/
-vextern boolean AnaTimerstate;   /*State bit for timer state machine*/
+vextern int AnaTimermode;   /*Mode selection for benchmarking*/
+vextern int AnaTimerstate;   /*State bit for timer state machine*/
 vextern long AnaTimerval;   /*Benchmark memory location*/
 vextern double AnaVshift;   /*Smallest voltage not requiring a gearshift*/
-vextern boolean AnaDimgate;   /*Switch for dimming unconnected gates*/
+vextern int AnaDimgate;   /*Switch for dimming unconnected gates*/
 
-vextern boolean AnaProbeOn;   /*State of probe mode*/
-vextern Char AnaLastnodeStr[256];   /*last node voltage displayed*/
-vextern Char AnaLastGate1Str[256];   /*last gate1 message displayed*/
-vextern Char AnaLastGate2Str[256];   /*last gate2 message displayed*/
-vextern Char AnaLastGate3Str[256];   /*last gate3 message displayed*/
-vextern Char AnaLastGate4Str[256];   /*last gate3 message displayed*/
-vextern Char AnaLastGate5Str[256];   /*last gate3 message displayed*/
+vextern int AnaProbeOn;   /*State of probe mode*/
+vextern char AnaLastnodeStr[256];   /*last node voltage displayed*/
+vextern char AnaLastGate1Str[256];   /*last gate1 message displayed*/
+vextern char AnaLastGate2Str[256];   /*last gate2 message displayed*/
+vextern char AnaLastGate3Str[256];   /*last gate3 message displayed*/
+vextern char AnaLastGate4Str[256];   /*last gate3 message displayed*/
+vextern char AnaLastGate5Str[256];   /*last gate3 message displayed*/
 
 vextern long AnaGateHystercount;   /*Hysteresis counter for probemode*/
 vextern long AnaNodeHystercount;   /*Hysteresis counter for probemode*/
@@ -608,47 +576,47 @@ vextern long AnaLastJ;
 
 
 
-extern Void AnaAddcommand PP((Char *Keyword, Char *Arg));
-extern Void AnaAnalog_ChangeReset PP((int Erase));
-extern Void AnaCapattrinsert PP((long base, long attrnum, log_grec *inst,
-				 boolean *Ok));
-extern Void AnaCapattrload PP((long base, log_grec *inst, int first));
-extern Void AnaCapattrread PP((long base, log_grec *inst));
-extern Void AnaCapattrwrite PP((long base, log_grec *inst));
-extern Void AnaCapCopy PP((log_grec *inst));
-extern Void AnaCapDispose PP((log_grec *inst));
-extern Void AnaCapex PP((log_grec *inst));
-extern Void AnaCapIin PP((Analog_32_action *act));
-extern Void AnaCapInit PP((log_grec *inst));
-extern Void AnaCappass1 PP((log_grec *inst));
-extern Void AnaCappass2 PP((log_grec *inst));
-extern Void AnaCapReset PP((log_grec *inst));
-extern Void AnaCapUpdate PP((log_grec *inst));
-extern Void AnaDiffdump PV();
-extern Void AnaDummyGate PP((Analog_32_action *act));
-extern Void AnaDummyInit PP((log_krec *dummykindptr));
-extern Void AnaGetcommand PP((Char *Keyword, Char *Arg, boolean *Found));
-extern Void AnaGetvar PP((Char *Varname, double *Value));
-extern Void AnaMatdump PV();
-extern Void AnaPopcommand PV();
-extern Void AnaTimeinit PV();
-extern Void AnaTimeReset PV();
-extern Void AnaParamUpdate PV();
-
-extern Void AnaScoreboard PP((Char *Newmessage, long purpose));
-extern boolean AnaCrange PP((log_grec *Inst, long Attrnum, int OkZero));
-extern boolean AnaDisplayrange PP((log_grec *Inst, long Attrnum));
-extern double AnaExpo PP((double V));
-extern double AnaSqrt PP((double V));
-extern boolean AnaGate_On_Display PP((log_grec *Inst));
-extern long AnaGlowVal PP((long Intensity));
-extern boolean AnaQuit PV();
-extern Char *AnaProbeAmpStr PP((Char *AnaResult, double Val));
-extern Char *AnaProbeVoltStr PP((Char *AnaResult, double Val));
-extern double AnaTanch PP((double V));
-
-
-extern boolean AnaVrange PP((log_grec *Inst, long Attrnum));
+extern void AnaAddcommand (char *Keyword, char *Arg);
+extern void AnaAnalog_ChangeReset (int Erase);
+extern void AnaCapattrinsert (long base, long attrnum, log_grec *inst,
+				 int *Ok);
+extern void AnaCapattrload (long base, log_grec *inst, int first);
+extern void AnaCapattrread (long base, log_grec *inst);
+extern void AnaCapattrwrite (long base, log_grec *inst);
+extern void AnaCapCopy (log_grec *inst);
+extern void AnaCapDispose (log_grec *inst);
+extern void AnaCapex (log_grec *inst);
+extern void AnaCapIin (Analog_32_action *act);
+extern void AnaCapInit (log_grec *inst);
+extern void AnaCappass1 (log_grec *inst);
+extern void AnaCappass2 (log_grec *inst);
+extern void AnaCapReset (log_grec *inst);
+extern void AnaCapUpdate (log_grec *inst);
+extern void AnaDiffdump ();
+extern void AnaDummyGate (Analog_32_action *act);
+extern void AnaDummyInit (log_krec *dummykindptr);
+extern void AnaGetcommand (char *Keyword, char *Arg, int *Found);
+extern void AnaGetvar (char *Varname, double *Value);
+extern void AnaMatdump ();
+extern void AnaPopcommand ();
+extern void AnaTimeinit ();
+extern void AnaTimeReset ();
+extern void AnaParamUpdate ();
+
+extern void AnaScoreboard (char *Newmessage, long purpose);
+extern int AnaCrange (log_grec *Inst, long Attrnum, int OkZero);
+extern int AnaDisplayrange (log_grec *Inst, long Attrnum);
+extern double AnaExpo (double V);
+extern double AnaSqrt (double V);
+extern int AnaGate_On_Display (log_grec *Inst);
+extern long AnaGlowVal (long Intensity);
+extern int AnaQuit ();
+extern char *AnaProbeAmpStr (char *AnaResult, double Val);
+extern char *AnaProbeVoltStr (char *AnaResult, double Val);
+extern double AnaTanch (double V);
+
+
+extern int AnaVrange (log_grec *Inst, long Attrnum);
 
 /*=========================================================================*/
 /* These structures, and variables, hold physical and fab constants for    */
@@ -675,8 +643,8 @@ typedef struct AnaFabParameters {
   double     Eg;     /* Bandgap voltage, temperature-dependent  */
   double     ni;     /* ni, temperature-dependent               */
   double lambda;     /* lithography scaling factor              */
-  Char fabrun[256];  /* name of fabrication run                 */
-  Char process[256]; /* name of fabrication process             */
+  char fabrun[256];  /* name of fabrication run                 */
+  char process[256]; /* name of fabrication process             */
 
 }AnaFabParameters;
 
diff --git a/log/src/ana/hres.c b/log/src/ana/hres.c
index cf28d53..ab1f049 100644
--- a/log/src/ana/hres.c
+++ b/log/src/ana/hres.c
@@ -27,16 +27,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /*When its time to add subthreshold light, look at IDIFF for new update,
   write procedures*/
 
-
-
-
-
 #include <p2c/p2c.h>
-
-
-
-
-#define HRES_G
 #include "hres.h"
 
 
@@ -91,7 +82,7 @@ typedef struct HresConst {
 
   double TauVlow, TauVhigh, TauVdiff;
 
-  boolean Limit, OldLimit, NewLimit;
+  int Limit, OldLimit, NewLimit;
 
   /*For every 'state variable'*/
   /*OldState:Statetype;*/
@@ -120,9 +111,9 @@ typedef enum {
 /****************************************************************************/
 
 
-Local Void Limitfill(Inst, Limitflag, Erase)
+void Limitfill(Inst, Limitflag, Erase)
 log_grec *Inst;
-boolean Limitflag, Erase;
+int Limitflag, Erase;
 {
   short LLx, LLy, URx, URy;
 
@@ -149,14 +140,14 @@ boolean Limitflag, Erase;
 /*                   Cell Installation Procedures                           */
 /****************************************************************************/
 
-Local Void GetCnf_Hres(NewIC)
+void GetCnf_Hres(NewIC)
 ICHres *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICHres *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -288,7 +279,7 @@ ICHres *NewIC;
 }
 
 
-Local Void INITLIB_Hres(act)
+void INITLIB_Hres(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -325,8 +316,8 @@ Analog_32_action *act;
   NewIC->InitCdbVlow = 10e-15;
   NewIC->InitCgbVhigh = 10e-15;
   GetCnf_Hres(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*Hres_Initlib*/
 
 
@@ -345,11 +336,11 @@ Analog_32_action *act;
       TimeTooSmall=1e-60;*/
 
 
-Local boolean Hrescheck(Inst, Attrnum)
+int Hrescheck(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   HresConst *HresVar;
   Anainstlist *A_Gate;
 
@@ -452,7 +443,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_Hres(act)
+void Attr_Hres(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -470,7 +461,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Hres(act)
+void Newgate_Hres(act)
 Analog_32_action *act;
 {
   HresConst *HresVar;
@@ -506,7 +497,7 @@ Analog_32_action *act;
   HresVar->NewLimit = false;
   /*Give internal variables values derived from initial attribute values*/
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)HresVar;
+  A_Gate->InstVar = (void *)HresVar;
   AnaCapInit(act->inst);   /*Initialize attributes of Cstart*/
   A_Gate->Pininfo[H_Vin - 1].Cap = ICptr->InitCgbVin;
   A_Gate->Pininfo[H_Vout - 1].Cap = ICptr->InitCgbVout;
@@ -548,7 +539,7 @@ Analog_32_action *act;
   WITH->attr[N_CapVdiff - 1].changed = true;
 }
 
-Local Void Copygate_Hres(act)
+void Copygate_Hres(act)
 Analog_32_action *act;
 {
   HresConst *HresVar, *Old_Hresvar;
@@ -559,12 +550,12 @@ Analog_32_action *act;
   HresVar = (HresConst *)Malloc(sizeof(HresConst));
   *HresVar = *Old_Hresvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)HresVar;
+  A_Gate->InstVar = (void *)HresVar;
   AnaCapCopy(act->inst);
 }
 
 
-Local Void Dispose_Hres(act)
+void Dispose_Hres(act)
 Analog_32_action *act;
 {
   HresConst *HresVar;
@@ -577,7 +568,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Readgate_Hres(act)
+void Readgate_Hres(act)
 Analog_32_action *act;
 {
   HresConst *HresVar;
@@ -656,7 +647,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Reset_Hres(act)
+void Reset_Hres(act)
 Analog_32_action *act;
 {
   HresConst *HresVar;
@@ -672,7 +663,7 @@ Analog_32_action *act;
     Limitfill(act->inst, HresVar->Limit, false);
 }
 
-Local Void PreUpdate_Hres(act)
+void PreUpdate_Hres(act)
 Analog_32_action *act;
 {
   HresConst *HresVar;
@@ -703,7 +694,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Update_Hres(act)
+void Update_Hres(act)
 Analog_32_action *act;
 {
   HresConst *HresVar;
@@ -717,7 +708,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Display_Hres(act)
+void Display_Hres(act)
 Analog_32_action *act;
 {
   HresConst *HresVar;
@@ -734,7 +725,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Refresh_Hres(act)
+void Refresh_Hres(act)
 Analog_32_action *act;
 {
   HresConst *HresVar;
@@ -747,7 +738,7 @@ Analog_32_action *act;
 
 
 
-Local Void Erase_Hres(act)
+void Erase_Hres(act)
 Analog_32_action *act;
 {
   HresConst *HresVar;
@@ -764,7 +755,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Ex_Hres(act)
+void Ex_Hres(act)
 Analog_32_action *act;
 {
   double MinIin, dIindVin, dIindVout, dIindVlow, dIindVhigh, MinIout,
@@ -1116,7 +1107,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Iin_Hres(act)
+void Iin_Hres(act)
 Analog_32_action *act;
 {
   AnaExt_rec *PinInPtr;
@@ -1287,7 +1278,7 @@ Analog_32_action *act;
 
 
 
-Local Void Probe_Hres(act)
+void Probe_Hres(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
@@ -1296,8 +1287,8 @@ Analog_32_action *act;
   HresConst *HresVar;
   double ExpoVhigh, BlendVhigh, Ihigh, pVhigh, ExpoVlow, BlendVlow, Ilow;
   log_grec *WITH;
-  Char STR1[256];
-  Char STR2[256];
+  char STR1[256];
+  char STR2[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -1360,7 +1351,7 @@ Analog_32_action *act;
 
 
 
-Void Log_hres_initlib_32(act)
+void Log_hres_initlib_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -1368,79 +1359,79 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     INITLIB_Hres(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_Hres(act);
     break;
 
-  case Analog_act_preupdate:
+  case ANALOG_ACT_PREUPDATE:
     PreUpdate_Hres(act);
     break;
 
-  case Analog_act_update:   /*For complex gates - see IDIFF*/
+  case ANALOG_ACT_UPDATE:   /*For complex gates - see IDIFF*/
     Update_Hres(act);
     break;
 
-  case Analog_act_display:
+  case ANALOG_ACT_DISPLAY:
     Display_Hres(act);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Hres(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     Reset_Hres(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Hres(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Hres(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Hres(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Hres(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_Hres(act);
     break;
 
-  case Analog_act_erase:
+  case ANALOG_ACT_ERASE:
     Erase_Hres(act);
     break;
 
-  case Analog_act_refresh:
+  case ANALOG_ACT_REFRESH:
     Refresh_Hres(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Hres(act);
     break;
 
diff --git a/log/src/ana/hres.h b/log/src/ana/hres.h
index d0a4354..0036cde 100644
--- a/log/src/ana/hres.h
+++ b/log/src/ana/hres.h
@@ -1,57 +1,15 @@
-/* Header for module HRES, generated by p2c */
 #ifndef HRES_H
 #define HRES_H
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef HRES_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-/*$If Float$
-  $float_hdw on$
-  $End$*/
-/*$If Debugflag$
-  $Debug$
-  $End$*/
-
-
-
-extern Void Log_hres_initlib_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_hres_initlib_32 (Analog_32_action *act);
 
 #endif /*HRES_H*/
 
diff --git a/log/src/ana/idiff.c b/log/src/ana/idiff.c
index bd8ac50..416430a 100644
--- a/log/src/ana/idiff.c
+++ b/log/src/ana/idiff.c
@@ -61,14 +61,14 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 typedef struct IDiffConst {
   double Time;
-  boolean First, Limit, OldLimit, NewLimit;
+  int First, Limit, OldLimit, NewLimit;
   double Reset_Time;
-  boolean Reset_First, Reset_Freeze;
+  int Reset_First, Reset_Freeze;
 } IDiffConst;
 
 
 typedef struct ICIDiff {
-  boolean ICFreeze;   /*Default Off*/
+  int ICFreeze;   /*Default Off*/
   double ICCrowbar;   /*Default 0.1*/
   long ICType;   /*Default 0*/
   double ICdc;   /*Default 0*/
@@ -89,9 +89,9 @@ typedef struct ICIDiff {
 
 
 
-Local Void Switchfill(Inst, Erase)
+void Switchfill(Inst, Erase)
 log_grec *Inst;
-boolean Erase;
+int Erase;
 {
   short LLx, LLy, URx, URy;
 
@@ -114,9 +114,9 @@ boolean Erase;
   (*AnaLogglobals->hook.unhidecursor)();
 }
 
-Local Void Limitfill(Inst, Limitflag, Erase)
+void Limitfill(Inst, Limitflag, Erase)
 log_grec *Inst;
-boolean Limitflag, Erase;
+int Limitflag, Erase;
 {
   short LLx, LLy, URx, URy;
 
@@ -139,13 +139,13 @@ boolean Limitflag, Erase;
   (*AnaLogglobals->hook.unhidecursor)();
 }
 
-Local double Pulsemaker(Inst, Ftime, First)
+double Pulsemaker(Inst, Ftime, First)
 log_grec *Inst;
 double Ftime;
-boolean First;
+int First;
 {
   double Result;
-  boolean Found;
+  int Found;
 
   Found = false;
   if (First) {
@@ -198,7 +198,7 @@ boolean First;
 /*            Procedure To Simulate Cell In Algorithm                        */
 /****************************************************************************/
 
-Local Void Ex_IDiff(act)
+void Ex_IDiff(act)
 Analog_32_action *act;
 {
   /*IDifferent*/
@@ -289,7 +289,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Iin_IDiff(act)
+void Iin_IDiff(act)
 Analog_32_action *act;
 {
   /*IDifferent*/
@@ -395,14 +395,14 @@ Analog_32_action *act;
 }  /*Iin_IDiff*/
 
 
-Local Void GetCnf_IDiff(NewIC)
+void GetCnf_IDiff(NewIC)
 ICIDiff *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICIDiff *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -562,7 +562,7 @@ ICIDiff *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_IDiff(act)
+void initlib_IDiff(act)
 Analog_32_action *act;
 {
   /*IDifferent*/
@@ -598,17 +598,17 @@ Analog_32_action *act;
   NewIC->ICpPeriod = 20 * AnaDtmax;
   NewIC->ICpRDelay = 0.0;
   GetCnf_IDiff(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*IDiff_Initlib*/
 
 
 
-Local boolean IDiffcheck(Inst, Attrnum)
+int IDiffcheck(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   IDiffConst *IDiffVar;
   Anainstlist *A_Gate;
 
@@ -710,7 +710,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_IDiff(act)
+void Attr_IDiff(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -723,7 +723,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_IDiff(act)
+void Newgate_IDiff(act)
 Analog_32_action *act;
 {
   IDiffConst *IDiffVar;
@@ -745,7 +745,7 @@ Analog_32_action *act;
   IDiffVar->OldLimit = false;
   IDiffVar->NewLimit = false;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)IDiffVar;
+  A_Gate->InstVar = (void *)IDiffVar;
   AnaCapInit(act->inst);
   WITH = act->inst;
   WITH->attr[N_Freeze - 1].UU.b = ICptr->ICFreeze;
@@ -771,7 +771,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Copygate_IDiff(act)
+void Copygate_IDiff(act)
 Analog_32_action *act;
 {
   IDiffConst *IDiffVar, *Old_IDiffvar;
@@ -782,12 +782,12 @@ Analog_32_action *act;
   IDiffVar = (IDiffConst *)Malloc(sizeof(IDiffConst));
   *IDiffVar = *Old_IDiffvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)IDiffVar;
+  A_Gate->InstVar = (void *)IDiffVar;
   AnaCapCopy(act->inst);
 }
 
 
-Local Void Dispose_IDiff(act)
+void Dispose_IDiff(act)
 Analog_32_action *act;
 {
   IDiffConst *IDiffVar;
@@ -799,13 +799,13 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_IDiff(act)
+void Readgate_IDiff(act)
 Analog_32_action *act;
 {
   IDiffConst *IDiffVar;
   Anainstlist *A_Gate;
   log_grec *WITH1;
-  Char STR1[256];
+  char STR1[256];
 
   AnaCapattrread((long)Cstart, act->inst);   /*Read capacitors*/
   A_Gate = (Anainstlist *)act->inst->info;
@@ -829,7 +829,7 @@ Analog_32_action *act;
   IDiffVar->Reset_Freeze = (*STR1 == 'T' || *STR1 == 't');
 }
 
-Local Void Writegate_IDiff(act)
+void Writegate_IDiff(act)
 Analog_32_action *act;
 {
   IDiffConst *IDiffVar;
@@ -852,7 +852,7 @@ Analog_32_action *act;
 
 
 
-Local Void Reset_IDiff(act)
+void Reset_IDiff(act)
 Analog_32_action *act;
 {
   IDiffConst *IDiffVar;
@@ -873,7 +873,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Set_Idiff(act)
+void Set_Idiff(act)
 Analog_32_action *act;
 {
   IDiffConst *IdiffVar;
@@ -886,7 +886,7 @@ Analog_32_action *act;
   IdiffVar->Reset_Freeze = act->inst->attr[N_Freeze - 1].UU.b;
 }
 
-Local Void Clear_Idiff(act)
+void Clear_Idiff(act)
 Analog_32_action *act;
 {
   IDiffConst *IdiffVar;
@@ -903,7 +903,7 @@ Analog_32_action *act;
   IdiffVar->Reset_Freeze = ICptr->ICFreeze;
 }
 
-Local Void PreUpdate_IDiff(act)
+void PreUpdate_IDiff(act)
 Analog_32_action *act;
 {
   IDiffConst *IDiffVar;
@@ -922,7 +922,7 @@ Analog_32_action *act;
   IDiffVar->NewLimit = (VPin2 - VPin1 + WITH->attr[N_Crowbar - 1].UU.r > -0.0004);
 }
 
-Local Void Update_IDiff(act)
+void Update_IDiff(act)
 Analog_32_action *act;
 {
   IDiffConst *IDiffVar;
@@ -939,7 +939,7 @@ Analog_32_action *act;
     IDiffVar->Time += AnaDtlast;
 }
 
-Local Void Display_IDiff(act)
+void Display_IDiff(act)
 Analog_32_action *act;
 {
   IDiffConst *IDiffVar;
@@ -969,7 +969,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Touch_IDiff(act)
+void Touch_IDiff(act)
 Analog_32_action *act;
 {
   log_action *WITH;
@@ -986,7 +986,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Erase_Idiff(Inst)
+void Erase_Idiff(Inst)
 log_grec *Inst;
 {
   IDiffConst *IDiffVar;
@@ -998,7 +998,7 @@ log_grec *Inst;
   Limitfill(Inst, IDiffVar->Limit, true);
 }
 
-Local Void Refresh_Idiff(Inst)
+void Refresh_Idiff(Inst)
 log_grec *Inst;
 {
   IDiffConst *IDiffVar;
@@ -1012,7 +1012,7 @@ log_grec *Inst;
 
 
 
-Local Void Probe_Idiff(act)
+void Probe_Idiff(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
@@ -1020,11 +1020,11 @@ Analog_32_action *act;
   AnaExt_rec *Node1Ptr, *Node2Ptr;
   double Node1, Node2, Pin1, Pin2;
   log_grec *WITH;
-  Char STR1[20];
-  Char STR2[24];
-  Char STR3[22];
-  Char STR4[256];
-  Char STR6[256];
+  char STR1[20];
+  char STR2[24];
+  char STR3[22];
+  char STR4[256];
+  char STR6[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -1076,98 +1076,98 @@ Analog_32_action *act;
 /*=============================================================================*/
 
 
-Void Log_idiff_initlib_32(act)
+void Log_idiff_initlib_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_IDiff(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_IDiff(act);
     break;
 
-  case Analog_act_preupdate:
+  case ANALOG_ACT_PREUPDATE:
     PreUpdate_IDiff(act);
     break;
 
-  case Analog_act_update:
+  case ANALOG_ACT_UPDATE:
     Update_IDiff(act);
     break;
 
-  case Analog_act_display:
+  case ANALOG_ACT_DISPLAY:
     Display_IDiff(act);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_IDiff(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     Reset_IDiff(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_IDiff(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_IDiff(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_IDiff(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_IDiff(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     Writegate_IDiff(act);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_IDiff(act);
     break;
 
-  case Analog_act_erase:
+  case ANALOG_ACT_ERASE:
     Erase_Idiff(act->inst);
     break;
 
-  case Analog_act_refresh:
+  case ANALOG_ACT_REFRESH:
     Refresh_Idiff(act->inst);
     break;
 
-  case Analog_act_touch:
+  case ANALOG_ACT_TOUCH:
     Touch_IDiff(act);
     break;
 
-  case Analog_act_set:
+  case ANALOG_ACT_SET:
     Set_Idiff(act);
     break;
 
-  case Analog_act_clear:
+  case ANALOG_ACT_CLEAR:
     Clear_Idiff(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Idiff(act);
     break;
 
diff --git a/log/src/ana/idiff.h b/log/src/ana/idiff.h
index 7e1567e..359a38a 100644
--- a/log/src/ana/idiff.h
+++ b/log/src/ana/idiff.h
@@ -1,57 +1,17 @@
-/* Header for module IDIFF, generated by p2c */
 #ifndef IDIFF_H
 #define IDIFF_H
 
 
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef IDIFF_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_idiff_initlib_32 PP((Analog_32_action *act));
 
+extern void Log_idiff_initlib_32 (Analog_32_action *act);
 
-#undef vextern
 
 #endif /*IDIFF_H*/
 
diff --git a/log/src/ana/inter.c b/log/src/ana/inter.c
index 7a3b5a1..4aea269 100644
--- a/log/src/ana/inter.c
+++ b/log/src/ana/inter.c
@@ -34,9 +34,9 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 
-Static Void log_histinit_32(Globals, Voltage)
+static void log_histinit_32(Globals, Voltage)
 log_action *Globals;
-boolean Voltage;
+int Voltage;
 {
   na_strlist *Dummy;
 
@@ -76,7 +76,7 @@ boolean Voltage;
 
 
 
-Static Void log_init_32(act)
+static void log_init_32(act)
 log_action *act;
 {
   log_tool *WITH;
@@ -85,24 +85,24 @@ log_action *act;
   WITH = AnaLogglobals->acttool;
   WITH->ready = true;
   WITH->simulator = true;
-  WITH->shortname = (Char *)Malloc(33);
+  WITH->shortname = (char *)Malloc(33);
   strcpy(WITH->shortname, "analog");
-  WITH->comment = (Char *)Malloc(256);
+  WITH->comment = (char *)Malloc(256);
   strcpy(WITH->comment, "anaLOG - a functional analog simulator");
   log_histinit_32(AnaLogglobals, true);
   Analog_InitVar();
 }
 
 
-Static Void log_edit_32(act)
+static void log_edit_32(act)
 log_action *act;
 {
-  Char Ch;
+  char Ch;
   long Index;
-  Char Response[256];
-  Char Newname[9];
-  Char STR1[256];
-  Char STR2[256];
+  char Response[256];
+  char Newname[9];
+  char STR1[256];
+  char STR2[256];
   long FORLIM;
 
   strcpy(Newname, act->actstr);
@@ -139,24 +139,24 @@ log_action *act;
 }
 
 
-Static Void log_dump_32(act)
+static void log_dump_32(act)
 log_action *act;
 {
   strlist_append(&act->actstrlist, (char *)act->actproc);
 }
 
 
-Static Void log_read_32(act)
+static void log_read_32(act)
 log_action *act;
 {
   strcpy((char *)act->actproc, act->actstrlist->s);
 }
 
 
-Static Void log_pass_32()
+static void log_pass_32()
 {
   short Newgatenum;
-  Char STR1[256];
+  char STR1[256];
 
   if (Anagndsig == NULL) {
     (*AnaLogglobals->hook.getsig)("Gnd", &Anagndsig);
@@ -217,7 +217,7 @@ Static Void log_pass_32()
 
 
 
-Static Void log_egate_32()
+static void log_egate_32()
 {
   AnaCell_rec *A_Kind;
   Analog_32_action act;
@@ -225,13 +225,13 @@ Static Void log_egate_32()
 
   g = AnaLogglobals->actgate;
   A_Kind = (AnaCell_rec *)g->kind->info;
-  act.action = Analog_act_erase;
+  act.action = ANALOG_ACT_ERASE;
   act.inst = g;
   (*A_Kind->proc_cell)(&act);
 }
 
 
-Static Void log_newgate_32()
+static void log_newgate_32()
 {
   long Intnodes, Index;
   Anainstlist *Newgate;
@@ -275,8 +275,8 @@ Static Void log_newgate_32()
       }
     }
   }
-  g->info = (Anyptr)Newgate;
-  act.action = Analog_act_newgate;
+  g->info = (void *)Newgate;
+  act.action = ANALOG_ACT_NEWGATE;
   act.inst = g;
   A_Kind = (AnaCell_rec *)act.inst->kind->info;
   (*A_Kind->proc_cell)(&act);
@@ -284,7 +284,7 @@ Static Void log_newgate_32()
 }
 
 
-Static Void log_copygate_32()
+static void log_copygate_32()
 {
   long Intnodes, Index;
   Anainstlist *Newgate;
@@ -329,8 +329,8 @@ Static Void log_copygate_32()
       }
     }
   }
-  g->info = (Anyptr)Newgate;
-  act.action = Analog_act_copygate;
+  g->info = (void *)Newgate;
+  act.action = ANALOG_ACT_COPYGATE;
   act.inst = g;
   A_Kind = (AnaCell_rec *)act.inst->kind->info;
   (*A_Kind->proc_cell)(&act);
@@ -338,11 +338,11 @@ Static Void log_copygate_32()
 }
 
 
-Static Void Node_remove(oldnode)
+static void Node_remove(oldnode)
 AnaInt_rec *oldnode;
 {
   AnaInt_rec *Count, *Last;
-  boolean Done;
+  int Done;
 
   Done = false;
   Count = AnaInt_nodelist;
@@ -369,7 +369,7 @@ AnaInt_rec *oldnode;
 }
 
 
-Static Void log_disposegate_32()
+static void log_disposegate_32()
 {
   Anainstlist *Oldgate;
   AnaGate_intnoderec *Count, *Oldnode;
@@ -388,7 +388,7 @@ Static Void log_disposegate_32()
       Free(Oldnode);
     } while (Count != NULL);
   }
-  act.action = Analog_act_disposegate;
+  act.action = ANALOG_ACT_DISPOSEGATE;
   act.inst = g;
   A_Kind = (AnaCell_rec *)act.inst->kind->info;
   (*A_Kind->proc_cell)(&act);
@@ -397,26 +397,26 @@ Static Void log_disposegate_32()
 }
 
 
-Static Void log_connectgate_32()
+static void log_connectgate_32()
 {
   AnaChanged = true;
 }
 
 
-Static Void log_disconnectgate_32()
+static void log_disconnectgate_32()
 {
   Analog_32_action Act;
   AnaCell_rec *A_Kind;
 
   AnaChanged = true;
   Act.inst = AnaLogglobals->actgate;
-  Act.action = Analog_act_disconnect;
+  Act.action = ANALOG_ACT_DISCONNECT;
   A_Kind = (AnaCell_rec *)Act.inst->kind->info;
   (*A_Kind->proc_cell)(&Act);
 }
 
 
-Static Void log_configchgate_32()
+static void log_configchgate_32()
 {
   Analog_32_action Act;
   AnaCell_rec *A_Kind;
@@ -424,7 +424,7 @@ Static Void log_configchgate_32()
   Act.pin = AnaLogglobals->actx;
   Act.ok = AnaLogglobals->actflag;
   Act.inst = AnaLogglobals->actgate;
-  Act.action = Analog_act_attrchange;
+  Act.action = ANALOG_ACT_ATTRCHANGE;
   A_Kind = (AnaCell_rec *)Act.inst->kind->info;
   (*A_Kind->proc_cell)(&Act);
   AnaLogglobals->actflag = Act.ok;
@@ -434,7 +434,7 @@ Static Void log_configchgate_32()
 
 
 
-Static Void log_newnode_32(Globals)
+static void log_newnode_32(Globals)
 log_action *Globals;
 {
   AnaExt_rec *Newnode;
@@ -444,13 +444,13 @@ log_action *Globals;
   Newnode->last = 0.0;
   Newnode->now = 0.0;
   Newnode->col_ltimestep = AnaColormap.C_Glow1;
-  Globals->actnode->info = (Anyptr)Newnode;
+  Globals->actnode->info = (void *)Newnode;
   Globals->actnode->changed = true;
   AnaChanged = true;
 }
 
 
-Static Void log_disposenode_32(Globals)
+static void log_disposenode_32(Globals)
 log_action *Globals;
 {
   AnaExt_rec *Oldnode;
@@ -461,7 +461,7 @@ log_action *Globals;
 }
 
 
-Static Void log_copynode_32(Globals)
+static void log_copynode_32(Globals)
 log_action *Globals;
 {
   AnaExt_rec *Newnode, *Oldnode;
@@ -472,13 +472,13 @@ log_action *Globals;
   Newnode->col_ltimestep = Oldnode->col_ltimestep;
   Newnode->last = 0.0;
   Newnode->now = 0.0;
-  Globals->actnode->info = (Anyptr)Newnode;
+  Globals->actnode->info = (void *)Newnode;
   Globals->actnode->changed = true;
   AnaChanged = true;
 }
 
 
-Static Void log_combinenodes_32(Globals)
+static void log_combinenodes_32(Globals)
 log_action *Globals;
 {
   AnaExt_rec *Destnode, *Srcnode;
@@ -494,7 +494,7 @@ log_action *Globals;
 }
 
 
-Static Void log_color_32()
+static void log_color_32()
 {
   (*AnaLogglobals->hook.getcolor)("VMETER", &AnaColormap.C_Vmeter,
 				  log_dyellow);
@@ -514,7 +514,7 @@ Static Void log_color_32()
 }
 
 
-Static long Variantmap(Variantcolor)
+static long Variantmap(Variantcolor)
 long Variantcolor;
 {
   long Result;
@@ -573,9 +573,9 @@ long Variantcolor;
 }
 
 
-Static Void log_history_32(Globals, Voltage)
+static void log_history_32(Globals, Voltage)
 log_action *Globals;
-boolean Voltage;
+int Voltage;
 {
   AnaExt_rec *Histnode;
 
@@ -606,9 +606,9 @@ boolean Voltage;
 }
 
 
-Static Void log_histval_32(Globals, Voltage)
+static void log_histval_32(Globals, Voltage)
 log_action *Globals;
-boolean Voltage;
+int Voltage;
 {
   switch (Globals->actgattr[AnaH_Method - 1].UU.nv) {
 
@@ -641,12 +641,12 @@ boolean Voltage;
 #define Slope           3
 
 
-Static Void log_histstr_32(Globals, Voltage)
+static void log_histstr_32(Globals, Voltage)
 log_action *Globals;
-boolean Voltage;
+int Voltage;
 {
   double Temp;
-  Char Unit[4];
+  char Unit[4];
   log_action *WITH;
 
   WITH = Globals;
@@ -716,9 +716,9 @@ boolean Voltage;
 
 
 
-Static Void log_configchhist_32(Globals, voltage)
+static void log_configchhist_32(Globals, voltage)
 log_action *Globals;
-boolean voltage;
+int voltage;
 {
   Globals->actflag = true;
   switch (Globals->actx) {
@@ -759,9 +759,9 @@ boolean voltage;
 
 
 
-Static Void log_confighist_32(Globals, voltage)
+static void log_confighist_32(Globals, voltage)
 log_action *Globals;
-boolean voltage;
+int voltage;
 {
   if (!Globals->histactive && !Globals->actgattr[AnaH_Present - 1].blnk) {
     Globals->actgattr[AnaH_Present - 1].blnk = true;
@@ -771,56 +771,56 @@ boolean voltage;
 
 
 
-Static Void log_readgate_32()
+static void log_readgate_32()
 {
   Analog_32_action Act;
   AnaCell_rec *A_Kind;
 
   Act.inst = AnaLogglobals->actgate;
-  Act.action = Analog_act_readgate;
+  Act.action = ANALOG_ACT_READGATE;
   A_Kind = (AnaCell_rec *)Act.inst->kind->info;
   (*A_Kind->proc_cell)(&Act);
 }
 
 
-Static Void log_writegate_32()
+static void log_writegate_32()
 {
   Analog_32_action Act;
   AnaCell_rec *A_Kind;
 
   Act.inst = AnaLogglobals->actgate;
-  Act.action = Analog_act_writegate;
+  Act.action = ANALOG_ACT_WRITEGATE;
   A_Kind = (AnaCell_rec *)Act.inst->kind->info;
   (*A_Kind->proc_cell)(&Act);
 }
 
 
-Static Void log_configgate_32()
+static void log_configgate_32()
 {
   Analog_32_action Act;
   AnaCell_rec *A_Kind;
 
   Act.inst = AnaLogglobals->actgate;
-  Act.action = Analog_act_openconfig;
+  Act.action = ANALOG_ACT_OPENCONFIG;
   Act.ok = AnaLogglobals->actflag;
   A_Kind = (AnaCell_rec *)Act.inst->kind->info;
   (*A_Kind->proc_cell)(&Act);
 }
 
 
-Static Void log_touchgate_32()
+static void log_touchgate_32()
 {
   Analog_32_action Act;
   AnaCell_rec *A_Kind;
 
   Act.inst = AnaLogglobals->actgate;
-  Act.action = Analog_act_touch;
+  Act.action = ANALOG_ACT_TOUCH;
   A_Kind = (AnaCell_rec *)Act.inst->kind->info;
   (*A_Kind->proc_cell)(&Act);
 }
 
 
-Static Void log_cnf_32()
+static void log_cnf_32()
 {
   log_action *WITH;
 
@@ -830,10 +830,10 @@ Static Void log_cnf_32()
 }
 
 
-Static Void log_func_32()
+static void log_func_32()
 {
   Analog_32_action AnaAct;
-  boolean Found;
+  int Found;
   log_action *WITH;
 
   WITH = AnaLogglobals;
@@ -846,7 +846,7 @@ Static Void log_func_32()
 }
 
 
-Static Void log_writenode_32()
+static void log_writenode_32()
 {
   AnaExt_rec *Writenode;
 
@@ -860,7 +860,7 @@ Static Void log_writenode_32()
 }
 
 
-Static Void log_glowcol_32()
+static void log_glowcol_32()
 {
   AnaExt_rec *Glownode;
 
@@ -869,7 +869,7 @@ Static Void log_glowcol_32()
 }
 
 
-Void Log_32_proc(act)
+void Log_32_proc(act)
 log_action *act;
 {
   switch (act->action) {
@@ -1028,7 +1028,7 @@ log_action *act;
 /*                Procedures to handle Type 33 Signals                        */
 /******************************************************************************/
 
-Static Void log_init_33(act)
+static void log_init_33(act)
 log_action *act;
 {
   log_tool *WITH;
@@ -1037,15 +1037,15 @@ log_action *act;
   WITH = AnaLogIglobals->acttool;
   WITH->ready = true;
   WITH->simulator = true;
-  WITH->shortname = (Char *)Malloc(33);
+  WITH->shortname = (char *)Malloc(33);
   strcpy(WITH->shortname, "current");
-  WITH->comment = (Char *)Malloc(256);
+  WITH->comment = (char *)Malloc(256);
   strcpy(WITH->comment, "Current simulator to enable current plotting");
   log_histinit_32(AnaLogIglobals, false);
 }
 
 
-Void Log_33_proc(act)
+void Log_33_proc(act)
 log_action *act;
 {
   switch (act->action) {
diff --git a/log/src/ana/inter.h b/log/src/ana/inter.h
index bbbe15a..cd686b2 100644
--- a/log/src/ana/inter.h
+++ b/log/src/ana/inter.h
@@ -3,67 +3,19 @@
 #define INTER_H
 
 
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NEWKBD_H
 #include <p2c/newkbd.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-
-
-
-#ifndef MAIN_H
 #include "main.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef INTER_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-extern Void Log_32_proc PP((log_action *act));
-
-
-extern Void Log_33_proc PP((log_action *act));
 
+extern void Log_32_proc (log_action *act);
+extern void Log_33_proc (log_action *act);
 
-#undef vextern
 
 #endif /*INTER_H*/
 
diff --git a/log/src/ana/iscope.c b/log/src/ana/iscope.c
index ed09c4d..e22febb 100644
--- a/log/src/ana/iscope.c
+++ b/log/src/ana/iscope.c
@@ -26,12 +26,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-
-
-
-#define ISCOPE_G
 #include "iscope.h"
 
 
@@ -43,13 +37,11 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 typedef struct ICIscope {
-  Char InitVsymbol[33], InitIsymbol[33];
+  char InitVsymbol[33], InitIsymbol[33];
   long Initprec;
 } ICIscope;
 
 
-
-
 typedef struct Inoderec {
   log_grec *Igate;   /*Gate connected to meter*/
   long Ipin;   /*Pin connected to meter*/
@@ -59,9 +51,9 @@ typedef struct Inoderec {
 typedef struct Imeterrec {
   Inoderec *Ilist;
   double NewValue;
-  boolean NewBlank;
-  Char NewOutStr[256], OldOutStr[256];
-  boolean Valid, OldValid;
+  int NewBlank;
+  char NewOutStr[256], OldOutStr[256];
+  int Valid, OldValid;
 } Imeterrec;
 
 
@@ -70,10 +62,10 @@ typedef struct Imeterrec {
 /*              Procedure to correctly position labels                        */
 
 
-Local Void Iscope_Locate(rot, Tx, Ty, Left)
+void Iscope_Locate(rot, Tx, Ty, Left)
 long rot;
 short *Tx, *Ty;
-boolean *Left;
+int *Left;
 {
 
   /******************************************************************************/
@@ -110,7 +102,7 @@ boolean *Left;
 }
 
 
-Local double Itot(act)
+double Itot(act)
 Analog_32_action *act;
 {
   Imeterrec *Intptr;
@@ -131,7 +123,7 @@ Analog_32_action *act;
     while (Count != NULL) {
       Iinact.pin = Count->Ipin;
       Iinact.inst = Count->Igate;
-      Iinact.action = Analog_act_Iin;
+      Iinact.action = ANALOG_ACT_IIN;
       A_Kind = (AnaCell_rec *)Count->Igate->kind->info;
       (*A_Kind->proc_cell)(&Iinact);
       Count = Count->Next;
@@ -145,7 +137,7 @@ Analog_32_action *act;
 /*                Procedure to update cell in algorithm                        */
 /*******************************************************************************/
 
-Local Void PreUpdate_Iscope(act)
+void PreUpdate_Iscope(act)
 Analog_32_action *act;
 {
   AnaExt_rec *A_Node;
@@ -196,7 +188,7 @@ Analog_32_action *act;
 /*                Procedure to update cell in algorithm                        */
 /*******************************************************************************/
 
-Local Void Update_Iscope(act)
+void Update_Iscope(act)
 Analog_32_action *act;
 {
   Imeterrec *Intptr;
@@ -227,11 +219,11 @@ Analog_32_action *act;
 /*                Procedure to update cell in algorithm                        */
 /*******************************************************************************/
 
-Local Void Display_Iscope(act)
+void Display_Iscope(act)
 Analog_32_action *act;
 {
   short tx, ty;
-  boolean Left;
+  int Left;
   Imeterrec *Intptr;
   Anainstlist *A_Gate;
   log_grec *WITH;
@@ -263,7 +255,7 @@ Analog_32_action *act;
 
 
 
-Local Void Pass1_Iscope(act)
+void Pass1_Iscope(act)
 Analog_32_action *act;
 {
   long Mx, My;
@@ -313,11 +305,11 @@ Analog_32_action *act;
 /*                Procedure to update cell in algorithm                        */
 /*******************************************************************************/
 
-Local Void Refresh_Iscope(act)
+void Refresh_Iscope(act)
 Analog_32_action *act;
 {
   short tx, ty;
-  boolean Left;
+  int Left;
   Imeterrec *Intptr;
   Anainstlist *A_Gate;
   log_grec *WITH;
@@ -352,7 +344,7 @@ Analog_32_action *act;
 /*                Procedure to give current into cell                          */
 /*******************************************************************************/
 
-Local Void Iin_Iscope(act)
+void Iin_Iscope(act)
 Analog_32_action *act;
 {
   log_grec *WITH;
@@ -364,11 +356,11 @@ Analog_32_action *act;
 /*                Procedure to update meter display                            */
 /*******************************************************************************/
 
-Local Void Erase_Iscope(act)
+void Erase_Iscope(act)
 Analog_32_action *act;
 {
   short tx, ty;
-  boolean Left;
+  int Left;
   Imeterrec *Intptr;
   Anainstlist *A_Gate;
   log_grec *WITH;
@@ -398,16 +390,16 @@ Analog_32_action *act;
 }  /*Erase_Iscope*/
 
 
-Local Void GetCnf_Iscope(NewIC)
+void GetCnf_Iscope(NewIC)
 ICIscope *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICIscope *WITH;
-  Char STR1[256];
-  Char STR2[256];
-  Char *STR3;
+  char STR1[256];
+  char STR2[256];
+  char *STR3;
 
   WITH = NewIC;
   do {
@@ -452,7 +444,7 @@ ICIscope *NewIC;
 /*******************************************************************************/
 
 
-Local Void INITLIB_ISCOPE(act)
+void INITLIB_ISCOPE(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -471,19 +463,19 @@ Analog_32_action *act;
   strcpy(NewIC->InitIsymbol, "Not on a pin");
   NewIC->Initprec = 3;
   GetCnf_Iscope(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*Iscope_initlib*/
 
 
-Local Void Attr_Iscope(act)
+void Attr_Iscope(act)
 Analog_32_action *act;
 {
   long Attrnum;
-  Char Oldout[256], Newout[256];
+  char Oldout[256], Newout[256];
   double Lastval;
   short tx, ty;
-  boolean Left;
+  int Left;
   AnaCell_rec *Cellptr;
   ICIscope *ICptr;
   Imeterrec *Intptr;
@@ -546,12 +538,12 @@ Analog_32_action *act;
 /*                Procedure to reset cell in algorithm                       */
 /*******************************************************************************/
 
-Local Void Reset_Iscope(act)
+void Reset_Iscope(act)
 Analog_32_action *act;
 {
   short tx, ty;
-  Char Oldout[256];
-  boolean Left;
+  char Oldout[256];
+  int Left;
   AnaCell_rec *Cellptr;
   ICIscope *ICptr;
   Imeterrec *Intptr;
@@ -602,12 +594,12 @@ Analog_32_action *act;
 /*                Procedure to disconnect a Iscope                             */
 /*******************************************************************************/
 
-Local Void Disconnect_Iscope(act)
+void Disconnect_Iscope(act)
 Analog_32_action *act;
 {
   short tx, ty;
-  Char Oldout[256];
-  boolean Left;
+  char Oldout[256];
+  int Left;
   AnaCell_rec *Cellptr;
   ICIscope *ICptr;
   Imeterrec *Intptr;
@@ -646,7 +638,7 @@ Analog_32_action *act;
 
 
 
-Local Void Newgate_Iscope(act)
+void Newgate_Iscope(act)
 Analog_32_action *act;
 {
   AnaCell_rec *Cellptr;
@@ -673,10 +665,10 @@ Analog_32_action *act;
   NewIV->Valid = false;
   NewIV->OldValid = false;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)NewIV;
+  A_Gate->InstVar = (void *)NewIV;
 }
 
-Local Void Copygate_Iscope(act)
+void Copygate_Iscope(act)
 Analog_32_action *act;
 {
   AnaCell_rec *Cellptr;
@@ -695,11 +687,11 @@ Analog_32_action *act;
   NewIV->Valid = false;
   NewIV->OldValid = false;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)NewIV;
+  A_Gate->InstVar = (void *)NewIV;
 }
 
 
-Local Void Probe_Iscope(act)
+void Probe_Iscope(act)
 Analog_32_action *act;
 {
   AnaScoreboard(Gatename, (long)AnaMessGate1);
@@ -711,7 +703,7 @@ Analog_32_action *act;
 /*                  Cell Library Entry   Iscope                                */
 /*=============================================================================*/
 
-Void Log_iscope_initlib_32(act)
+void Log_iscope_initlib_32(act)
 Analog_32_action *act;
 {
   /*Body of procedure*/
@@ -719,59 +711,59 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     INITLIB_ISCOPE(act);
     break;
 
-  case Analog_act_preupdate:
+  case ANALOG_ACT_PREUPDATE:
     PreUpdate_Iscope(act);
     break;
 
-  case Analog_act_update:
+  case ANALOG_ACT_UPDATE:
     Update_Iscope(act);
     break;
 
-  case Analog_act_display:
+  case ANALOG_ACT_DISPLAY:
     Display_Iscope(act);
     break;
 
-  case Analog_act_erase:
+  case ANALOG_ACT_ERASE:
     Erase_Iscope(act);
     break;
 
-  case Analog_act_refresh:
+  case ANALOG_ACT_REFRESH:
     Refresh_Iscope(act);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Iscope(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     Reset_Iscope(act);
     break;
 
-  case Analog_act_disconnect:
+  case ANALOG_ACT_DISCONNECT:
     Disconnect_Iscope(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Iscope(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Iscope(act);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_Iscope(act);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     Pass1_Iscope(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Iscope(act);
     break;
 
diff --git a/log/src/ana/iscope.h b/log/src/ana/iscope.h
index 1085404..6ca7ec2 100644
--- a/log/src/ana/iscope.h
+++ b/log/src/ana/iscope.h
@@ -1,57 +1,16 @@
-/* Header for module Iscope, generated by p2c */
 #ifndef ISCOPE_H
 #define ISCOPE_H
 
 
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef ISCOPE_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_iscope_initlib_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_iscope_initlib_32 (Analog_32_action *act);
 
 #endif /*ISCOPE_H*/
 
diff --git a/log/src/ana/iswitch1.c b/log/src/ana/iswitch1.c
index 4d7bdb7..76b6173 100644
--- a/log/src/ana/iswitch1.c
+++ b/log/src/ana/iswitch1.c
@@ -26,12 +26,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-
-
-
-#define ISWITCH1_G
 #include "iswitch1.h"
 
 
@@ -61,11 +55,11 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 typedef struct Iswitch1Const {
-  boolean State, OldState, NewState;
+  int State, OldState, NewState;
   double Time;
-  boolean Limit, OldLimit, NewLimit;
+  int Limit, OldLimit, NewLimit;
   double OldIideal, NewIideal, Iideal, Reset_Time, Reset_Iideal;
-  boolean Reset_State;
+  int Reset_State;
 } Iswitch1Const;
 
 
@@ -86,9 +80,9 @@ typedef struct ICIswitch1 {
 
 
 
-Local Void Iswitch1fill(Inst, State, Erase)
+void Iswitch1fill(Inst, State, Erase)
 log_grec *Inst;
-boolean State, Erase;
+int State, Erase;
 {
   short LLx, LLy, URx, URy;
 
@@ -111,9 +105,9 @@ boolean State, Erase;
   (*AnaLogglobals->hook.unhidecursor)();
 }
 
-Local Void Limitfill(Inst, Limitflag, Erase)
+void Limitfill(Inst, Limitflag, Erase)
 log_grec *Inst;
-boolean Limitflag, Erase;
+int Limitflag, Erase;
 {
   short LLx, LLy, URx, URy;
 
@@ -137,10 +131,10 @@ boolean Limitflag, Erase;
 }
 
 
-Local double Bistablemaker(Inst, time, State, Ex, OldIideal)
+double Bistablemaker(Inst, time, State, Ex, OldIideal)
 log_grec *Inst;
 double time;
-boolean State, Ex;
+int State, Ex;
 double OldIideal;
 {
   double Newtime, Ratio;
@@ -167,10 +161,10 @@ double OldIideal;
 }
 
 
-Local double Monostablemaker(Inst, time, State, Ex, OldIideal)
+double Monostablemaker(Inst, time, State, Ex, OldIideal)
 log_grec *Inst;
 double time;
-boolean State, Ex;
+int State, Ex;
 double OldIideal;
 {
   double Newtime, Ratio;
@@ -207,7 +201,7 @@ double OldIideal;
 /*            Procedure To Simulate Cell In Algorithm                        */
 /****************************************************************************/
 
-Local Void Ex_Iswitch1(act)
+void Ex_Iswitch1(act)
 Analog_32_action *act;
 {
   double MinI1, dI1dV1;
@@ -268,7 +262,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Iin_Iswitch1(act)
+void Iin_Iswitch1(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr;
@@ -317,14 +311,14 @@ Analog_32_action *act;
 }  /*Iin_Iswitch1*/
 
 
-Local Void GetCnf_Iswitch1(NewIC)
+void GetCnf_Iswitch1(NewIC)
 ICIswitch1 *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICIswitch1 *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -440,7 +434,7 @@ ICIswitch1 *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_Iswitch1(act)
+void initlib_Iswitch1(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -468,12 +462,12 @@ Analog_32_action *act;
   NewIC->ICmFall = 3 * AnaDtmax;
   NewIC->ICmWidth = 6 * AnaDtmax;
   GetCnf_Iswitch1(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*Iswitch1_Initlib*/
 
 
-Local Void ResetInit_Iswitch1(act)
+void ResetInit_Iswitch1(act)
 Analog_32_action *act;
 {
   Iswitch1Const *Iswitch1Var;
@@ -499,12 +493,12 @@ Analog_32_action *act;
 }
 
 
-Local boolean Iswitch1check(Inst, Attrnum, act)
+int Iswitch1check(Inst, Attrnum, act)
 log_grec *Inst;
 long Attrnum;
 Analog_32_action *act;
 {
-  boolean Result;
+  int Result;
   Iswitch1Const *Iswitch1Var;
   Anainstlist *A_Gate;
 
@@ -568,7 +562,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Attr_Iswitch1(act)
+void Attr_Iswitch1(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -581,7 +575,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Iswitch1(act)
+void Newgate_Iswitch1(act)
 Analog_32_action *act;
 {
   Iswitch1Const *Iswitch1Var;
@@ -595,7 +589,7 @@ Analog_32_action *act;
   ICptr = (ICIswitch1 *)Cellptr->Ainfo;
   Iswitch1Var = (Iswitch1Const *)Malloc(sizeof(Iswitch1Const));
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)Iswitch1Var;
+  A_Gate->InstVar = (void *)Iswitch1Var;
   ResetInit_Iswitch1(act);
   Iswitch1Var->Limit = false;
   Iswitch1Var->OldLimit = false;
@@ -624,7 +618,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Copygate_Iswitch1(act)
+void Copygate_Iswitch1(act)
 Analog_32_action *act;
 {
   Iswitch1Const *Iswitch1Var, *Old_Iswitch1var;
@@ -635,12 +629,12 @@ Analog_32_action *act;
   Iswitch1Var = (Iswitch1Const *)Malloc(sizeof(Iswitch1Const));
   *Iswitch1Var = *Old_Iswitch1var;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)Iswitch1Var;
+  A_Gate->InstVar = (void *)Iswitch1Var;
   AnaCapCopy(act->inst);
 }
 
 
-Local Void Dispose_Iswitch1(act)
+void Dispose_Iswitch1(act)
 Analog_32_action *act;
 {
   Iswitch1Const *Iswitch1Var;
@@ -652,13 +646,13 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_Iswitch1(act)
+void Readgate_Iswitch1(act)
 Analog_32_action *act;
 {
   Iswitch1Const *Iswitch1Var;
   Anainstlist *A_Gate;
   log_grec *WITH1;
-  Char STR1[256];
+  char STR1[256];
 
   AnaCapattrread((long)Cstart, act->inst);   /*Read capacitors*/
   A_Gate = (Anainstlist *)act->inst->info;
@@ -686,7 +680,7 @@ Analog_32_action *act;
   Iswitch1Var->Iideal = Iswitch1Var->OldIideal;
 }
 
-Local Void Writegate_Iswitch1(act)
+void Writegate_Iswitch1(act)
 Analog_32_action *act;
 {
   Iswitch1Const *Iswitch1Var;
@@ -709,7 +703,7 @@ Analog_32_action *act;
 
 
 
-Local Void Reset_Iswitch1(act)
+void Reset_Iswitch1(act)
 Analog_32_action *act;
 {
   Iswitch1Const *Iswitch1Var;
@@ -731,7 +725,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Set_Iswitch1(act)
+void Set_Iswitch1(act)
 Analog_32_action *act;
 {
   Iswitch1Const *Iswitch1Var;
@@ -747,7 +741,7 @@ Analog_32_action *act;
 }
 
 
-Local Void PreUpdate_Iswitch1(act)
+void PreUpdate_Iswitch1(act)
 Analog_32_action *act;
 {
   Iswitch1Const *Iswitch1Var;
@@ -774,7 +768,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Update_Iswitch1(act)
+void Update_Iswitch1(act)
 Analog_32_action *act;
 {
   Iswitch1Const *Iswitch1Var;
@@ -793,7 +787,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Display_Iswitch1(act)
+void Display_Iswitch1(act)
 Analog_32_action *act;
 {
   Iswitch1Const *Iswitch1Var;
@@ -814,7 +808,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Touch_Iswitch1(act)
+void Touch_Iswitch1(act)
 Analog_32_action *act;
 {
   Iswitch1Const *Iswitch1Var;
@@ -845,7 +839,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Refresh_Iswitch1(act)
+void Refresh_Iswitch1(act)
 Analog_32_action *act;
 {
   Iswitch1Const *Iswitch1Var;
@@ -857,7 +851,7 @@ Analog_32_action *act;
   Limitfill(act->inst, Iswitch1Var->Limit, false);
 }
 
-Local Void Erase_Iswitch1(act)
+void Erase_Iswitch1(act)
 Analog_32_action *act;
 {
   Iswitch1Const *Iswitch1Var;
@@ -869,7 +863,7 @@ Analog_32_action *act;
   Limitfill(act->inst, Iswitch1Var->Limit, true);
 }
 
-Local Void Probe_Iswitch1(act)
+void Probe_Iswitch1(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
@@ -877,8 +871,8 @@ Analog_32_action *act;
   AnaExt_rec *Node1Ptr;
   double Node1, Pin1;
   log_grec *WITH;
-  Char STR1[256];
-  Char STR3[256];
+  char STR1[256];
+  char STR3[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -919,98 +913,98 @@ Analog_32_action *act;
 /*=============================================================================*/
 
 
-Void Log_iswitch1_initlib_32(act)
+void Log_iswitch1_initlib_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_Iswitch1(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_Iswitch1(act);
     break;
 
-  case Analog_act_preupdate:
+  case ANALOG_ACT_PREUPDATE:
     PreUpdate_Iswitch1(act);
     break;
 
-  case Analog_act_update:
+  case ANALOG_ACT_UPDATE:
     Update_Iswitch1(act);
     break;
 
-  case Analog_act_display:
+  case ANALOG_ACT_DISPLAY:
     Display_Iswitch1(act);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Iswitch1(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     Reset_Iswitch1(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Iswitch1(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Iswitch1(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Iswitch1(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Iswitch1(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     Writegate_Iswitch1(act);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_Iswitch1(act);
     break;
 
-  case Analog_act_erase:
+  case ANALOG_ACT_ERASE:
     Erase_Iswitch1(act);
     break;
 
-  case Analog_act_refresh:
+  case ANALOG_ACT_REFRESH:
     Refresh_Iswitch1(act);
     break;
 
-  case Analog_act_touch:
+  case ANALOG_ACT_TOUCH:
     Touch_Iswitch1(act);
     break;
 
-  case Analog_act_set:
+  case ANALOG_ACT_SET:
     Set_Iswitch1(act);
     break;
 
-  case Analog_act_clear:
+  case ANALOG_ACT_CLEAR:
     ResetInit_Iswitch1(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Iswitch1(act);
     break;
 
diff --git a/log/src/ana/iswitch1.h b/log/src/ana/iswitch1.h
index 334055d..8790fca 100644
--- a/log/src/ana/iswitch1.h
+++ b/log/src/ana/iswitch1.h
@@ -3,55 +3,15 @@
 #define ISWITCH1_H
 
 
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef ISWITCH1_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-extern Void Log_iswitch1_initlib_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_iswitch1_initlib_32 (Analog_32_action *act);
 
 #endif /*ISWITCH1_H*/
 
diff --git a/log/src/ana/iswitch2.c b/log/src/ana/iswitch2.c
index 2aa0b50..9cfe767 100644
--- a/log/src/ana/iswitch2.c
+++ b/log/src/ana/iswitch2.c
@@ -60,11 +60,11 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 typedef struct Iswitch2Const {
-  boolean State, OldState, NewState;
+  int State, OldState, NewState;
   double Time;
-  boolean Limit, OldLimit, NewLimit;
+  int Limit, OldLimit, NewLimit;
   double OldIideal, NewIideal, Iideal, Reset_Time, Reset_Iideal;
-  boolean Reset_State;
+  int Reset_State;
 } Iswitch2Const;
 
 
@@ -86,9 +86,9 @@ typedef struct ICIswitch2 {
 
 
 
-Local Void Iswitch2fill(Inst, State, Erase)
+void Iswitch2fill(Inst, State, Erase)
 log_grec *Inst;
-boolean State, Erase;
+int State, Erase;
 {
   short LLx, LLy, URx, URy;
 
@@ -111,9 +111,9 @@ boolean State, Erase;
   (*AnaLogglobals->hook.unhidecursor)();
 }
 
-Local Void Limitfill(Inst, Limitflag, Erase)
+void Limitfill(Inst, Limitflag, Erase)
 log_grec *Inst;
-boolean Limitflag, Erase;
+int Limitflag, Erase;
 {
   short LLx, LLy, URx, URy;
 
@@ -137,10 +137,10 @@ boolean Limitflag, Erase;
 }
 
 
-Local double Bistablemaker(Inst, time, State, Ex, OldIideal)
+double Bistablemaker(Inst, time, State, Ex, OldIideal)
 log_grec *Inst;
 double time;
-boolean State, Ex;
+int State, Ex;
 double OldIideal;
 {
   double Newtime, Ratio;
@@ -168,10 +168,10 @@ double OldIideal;
 
 
 
-Local double Monostablemaker(Inst, time, State, Ex, OldIideal)
+double Monostablemaker(Inst, time, State, Ex, OldIideal)
 log_grec *Inst;
 double time;
-boolean State, Ex;
+int State, Ex;
 double OldIideal;
 {
   double Newtime, Ratio;
@@ -208,7 +208,7 @@ double OldIideal;
 /*            Procedure To Simulate Cell In Algorithm                        */
 /****************************************************************************/
 
-Local Void Ex_Iswitch2(act)
+void Ex_Iswitch2(act)
 Analog_32_action *act;
 {
   double MinI1, dI1dV1;
@@ -269,7 +269,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Iin_Iswitch2(act)
+void Iin_Iswitch2(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr;
@@ -317,14 +317,14 @@ Analog_32_action *act;
   }
 }  /*Iin_Iswitch2*/
 
-Local Void GetCnf_Iswitch2(NewIC)
+void GetCnf_Iswitch2(NewIC)
 ICIswitch2 *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICIswitch2 *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -440,7 +440,7 @@ ICIswitch2 *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_Iswitch2(act)
+void initlib_Iswitch2(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -468,13 +468,13 @@ Analog_32_action *act;
   NewIC->ICmFall = 3 * AnaDtmax;
   NewIC->ICmWidth = 6 * AnaDtmax;
   GetCnf_Iswitch2(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*Iswitch2_Initlib*/
 
 
 
-Local Void ResetInit_Iswitch2(act)
+void ResetInit_Iswitch2(act)
 Analog_32_action *act;
 {
   Iswitch2Const *Iswitch2Var;
@@ -500,12 +500,12 @@ Analog_32_action *act;
 }
 
 
-Local boolean Iswitch2check(Inst, Attrnum, act)
+int Iswitch2check(Inst, Attrnum, act)
 log_grec *Inst;
 long Attrnum;
 Analog_32_action *act;
 {
-  boolean Result;
+  int Result;
   Iswitch2Const *Iswitch2Var;
   Anainstlist *A_Gate;
 
@@ -569,7 +569,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Attr_Iswitch2(act)
+void Attr_Iswitch2(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -582,7 +582,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Iswitch2(act)
+void Newgate_Iswitch2(act)
 Analog_32_action *act;
 {
   Iswitch2Const *Iswitch2Var;
@@ -596,7 +596,7 @@ Analog_32_action *act;
   ICptr = (ICIswitch2 *)Cellptr->Ainfo;
   Iswitch2Var = (Iswitch2Const *)Malloc(sizeof(Iswitch2Const));
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)Iswitch2Var;
+  A_Gate->InstVar = (void *)Iswitch2Var;
   ResetInit_Iswitch2(act);
   Iswitch2Var->Limit = false;
   Iswitch2Var->OldLimit = false;
@@ -625,7 +625,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Copygate_Iswitch2(act)
+void Copygate_Iswitch2(act)
 Analog_32_action *act;
 {
   Iswitch2Const *Iswitch2Var, *Old_Iswitch2var;
@@ -636,12 +636,12 @@ Analog_32_action *act;
   Iswitch2Var = (Iswitch2Const *)Malloc(sizeof(Iswitch2Const));
   *Iswitch2Var = *Old_Iswitch2var;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)Iswitch2Var;
+  A_Gate->InstVar = (void *)Iswitch2Var;
   AnaCapCopy(act->inst);
 }
 
 
-Local Void Dispose_Iswitch2(act)
+void Dispose_Iswitch2(act)
 Analog_32_action *act;
 {
   Iswitch2Const *Iswitch2Var;
@@ -653,13 +653,13 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_Iswitch2(act)
+void Readgate_Iswitch2(act)
 Analog_32_action *act;
 {
   Iswitch2Const *Iswitch2Var;
   Anainstlist *A_Gate;
   log_grec *WITH1;
-  Char STR1[256];
+  char STR1[256];
 
   AnaCapattrread((long)Cstart, act->inst);   /*Read capacitors*/
   A_Gate = (Anainstlist *)act->inst->info;
@@ -687,7 +687,7 @@ Analog_32_action *act;
   Iswitch2Var->Iideal = Iswitch2Var->OldIideal;
 }
 
-Local Void Writegate_Iswitch2(act)
+void Writegate_Iswitch2(act)
 Analog_32_action *act;
 {
   Iswitch2Const *Iswitch2Var;
@@ -710,7 +710,7 @@ Analog_32_action *act;
 
 
 
-Local Void Reset_Iswitch2(act)
+void Reset_Iswitch2(act)
 Analog_32_action *act;
 {
   Iswitch2Const *Iswitch2Var;
@@ -732,7 +732,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Set_Iswitch2(act)
+void Set_Iswitch2(act)
 Analog_32_action *act;
 {
   Iswitch2Const *Iswitch2Var;
@@ -747,7 +747,7 @@ Analog_32_action *act;
   Iswitch2Var->Reset_Time = Iswitch2Var->Time - AnaAccum;
 }
 
-Local Void PreUpdate_Iswitch2(act)
+void PreUpdate_Iswitch2(act)
 Analog_32_action *act;
 {
   Iswitch2Const *Iswitch2Var;
@@ -773,7 +773,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Update_Iswitch2(act)
+void Update_Iswitch2(act)
 Analog_32_action *act;
 {
   Iswitch2Const *Iswitch2Var;
@@ -792,7 +792,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Display_Iswitch2(act)
+void Display_Iswitch2(act)
 Analog_32_action *act;
 {
   Iswitch2Const *Iswitch2Var;
@@ -813,7 +813,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Touch_Iswitch2(act)
+void Touch_Iswitch2(act)
 Analog_32_action *act;
 {
   Iswitch2Const *Iswitch2Var;
@@ -843,7 +843,7 @@ Analog_32_action *act;
   AnaChanged = true;
 }
 
-Local Void Refresh_Iswitch2(act)
+void Refresh_Iswitch2(act)
 Analog_32_action *act;
 {
   Iswitch2Const *Iswitch2Var;
@@ -855,7 +855,7 @@ Analog_32_action *act;
   Limitfill(act->inst, Iswitch2Var->Limit, false);
 }
 
-Local Void Erase_Iswitch2(act)
+void Erase_Iswitch2(act)
 Analog_32_action *act;
 {
   Iswitch2Const *Iswitch2Var;
@@ -868,7 +868,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Probe_Iswitch2(act)
+void Probe_Iswitch2(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
@@ -876,8 +876,8 @@ Analog_32_action *act;
   AnaExt_rec *Node1Ptr;
   double Node1, Pin1;
   log_grec *WITH;
-  Char STR1[256];
-  Char STR3[256];
+  char STR1[256];
+  char STR3[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -918,7 +918,7 @@ Analog_32_action *act;
 /*=============================================================================*/
 
 
-Void Log_iswitch2_initlib_32(act)
+void Log_iswitch2_initlib_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -926,91 +926,91 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_Iswitch2(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_Iswitch2(act);
     break;
 
-  case Analog_act_preupdate:
+  case ANALOG_ACT_PREUPDATE:
     PreUpdate_Iswitch2(act);
     break;
 
-  case Analog_act_update:
+  case ANALOG_ACT_UPDATE:
     Update_Iswitch2(act);
     break;
 
-  case Analog_act_display:
+  case ANALOG_ACT_DISPLAY:
     Display_Iswitch2(act);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Iswitch2(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     Reset_Iswitch2(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Iswitch2(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Iswitch2(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Iswitch2(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Iswitch2(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     Writegate_Iswitch2(act);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_Iswitch2(act);
     break;
 
-  case Analog_act_erase:
+  case ANALOG_ACT_ERASE:
     Erase_Iswitch2(act);
     break;
 
-  case Analog_act_refresh:
+  case ANALOG_ACT_REFRESH:
     Refresh_Iswitch2(act);
     break;
 
-  case Analog_act_touch:
+  case ANALOG_ACT_TOUCH:
     Touch_Iswitch2(act);
     break;
 
-  case Analog_act_set:
+  case ANALOG_ACT_SET:
     Set_Iswitch2(act);
     break;
 
-  case Analog_act_clear:
+  case ANALOG_ACT_CLEAR:
     ResetInit_Iswitch2(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Iswitch2(act);
     break;
 
diff --git a/log/src/ana/iswitch2.h b/log/src/ana/iswitch2.h
index 8f7c9ca..e2fd485 100644
--- a/log/src/ana/iswitch2.h
+++ b/log/src/ana/iswitch2.h
@@ -1,57 +1,16 @@
-/* Header for module ISWITCH2, generated by p2c */
 #ifndef ISWITCH2_H
 #define ISWITCH2_H
 
 
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef ISWITCH2_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_iswitch2_initlib_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_iswitch2_initlib_32 (Analog_32_action *act);
 
 #endif /*ISWITCH2_H*/
 
diff --git a/log/src/ana/log_action.h b/log/src/ana/log_action.h
new file mode 100644
index 0000000..b0fbfc0
--- /dev/null
+++ b/log/src/ana/log_action.h
@@ -0,0 +1,351 @@
+#ifndef LOG_ACTION_H
+#define LOG_ACTION_H
+
+typedef enum
+{
+	act_init,
+	act_endinit,
+	act_exit,
+	act_clearmsg,
+	act_status,
+	act_cnf,
+	act_immed,
+	act_func,
+	act_color,
+	act_select,
+	act_clear,
+	act_edit,
+	act_pass,
+	act_tstep,
+	act_erasegate,
+	act_touchgate,
+	act_history,
+	act_histval,
+	act_histstr,
+	act_trigger,
+	act_glowcol,
+	act_newgate,
+	act_disposegate,
+	act_copygate,
+	act_writegate,
+	act_readgate,
+	act_connectgate,
+	act_disconnectgate,
+	act_configchnode,
+	act_configrelnode,
+	act_confighist,
+	act_confighhist,
+	act_configrelhist,
+	act_newkind,
+	act_disposekind,
+	act_newnode,
+	act_disposenode,
+	act_copynode,
+	act_combinenodes,
+	act_combineintonode,
+	act_writenode,
+	act_readnode,
+	act_refnodes,
+	act_nodeval,
+	act_general,
+	act_gennode,
+	act_genkind,
+	act_gengate
+} log_actionkinds;
+
+typedef struct log_hooks_t
+{
+	void (*hidecursor) ();
+	void (*hidecursorrect) (long x1, long y1, long x2, long y2);
+	void (*unhidecursor) ();
+	void (*nodeconflict) (log_nrec *n);
+	void (*gateconflict) (log_grec *g);
+	void (*clearconflicts) (struct log_tool *tool);
+	void (*setdimgate) (log_grec *g, int dim);
+	void (*xform) (log_grec *g, short *x, short *y);
+	void (*getsig) (char *name, log_sigrec **sig);
+	void (*report) (int num, char *name);
+	void (*alert) ();
+	void (*warning) ();
+	void (*working) ();
+	void (*message) (char *msg);
+	void (*vmessage) (char *msg);
+	void (*vmessageflag) (char *msg, int b);
+	void (*trace) (char *msg);
+	void (*dump) (char *msg);
+	void (*setdump) (char *name);
+	void (*closefiles) ();
+	void (*clearalpha) ();
+	void (*drawstr) (int x, int y, char *s);
+	void (*rightstr) (int x, int y, char *s);
+	void (*centerstr) (int x, int y, char *s);
+	void (*clip) ();
+	void (*remcursor) ();
+	void (*clearscreen) ();
+	void (*setmode) (char *s);
+	void (*getword) (char *buf, char *wrd);
+	void (*getint) (char *buf, long *i, long def);
+	void (*getreal) (char *buf, double *r, double def);
+	void (*getbool) (char *buf, int *b);
+	void (*pen) ();
+	void (*pass) ();
+	void (*trykbd) ();
+	void (*scroll) ();
+	void (*trykbdscroll) ();
+	void (*inkey) (char *ch);
+	void (*udrawgate) (int x, int y, int g, int c);
+	void (*gdrawgate) (int x, int y, int g, int c);
+	void (*drawgate) (log_grec *g);
+	void (*erasegate) (log_grec *g);
+	void (*drawnode) (log_nrec *n, int c);
+	void (*refresh) ();   /*quietly refresh drawing area*/
+	void (*refreshsoon) ();
+	void (*beginbottom) ();
+	void (*endbottom) ();
+	void (*beginerror) ();
+	void (*enderror) ();
+	void (*redraw) ();   /*redraw drawing area*/
+	void (*redrawscreen) ();   /*redraw entire screen*/
+	void (*change) (int pg);
+	void (*newgate) (log_grec **g, int gt);
+	void (*copygate) (log_grec *old, log_grec **g);
+	void (*disposegate) (log_grec **g);
+	void (*newnode) (log_nrec **n, int st);
+	void (*copynode) (log_nrec *old, log_nrec **n);
+	void (*disposenode) (log_nrec **n);
+	void (*switchnode) (log_nrec **n, log_nrec *n2);
+	void (*dumpnodes) ();
+	void (*readlnpass) (char *s, int mode);
+	void (*clearfunc) ();
+	void (*refrfunc) ();
+	void (*assertfunc) (char *name);
+	void (*findobject) (int x, int y);
+	void (*findwire) (int x, int y);
+	void (*deletehw) (log_hwrec *hw);
+	void (*deletevw) (log_vwrec *vw);
+	void (*disconnectgate) (log_grec *g);
+	void (*deletegate) (log_grec *g);
+	void (*addhw) (int x1, int x2, int y);
+	void (*addvw) (int x, int y1, int y2);
+	void (*connectgate) (log_grec *g, int *success);
+	void (*waitnear) ();
+	void (*addgate) (int x, int y, int gtype);
+	void (*uaddgate) (int x, int y, int gtype);
+	void (*getgate) (char *name, short *gtype);
+	void (*realunit) (double r, int p, char *u, char *s);
+	void (*realunit2) (double r, int p, char *u, char *s);
+	void (*addlabel) (log_lrec **l, char *s);
+	void (*getcolor) (char *name, short *val, int def);
+	void (*setcmap) (int n, int r, int g, int b);
+	void (*parselabel) (na_strlistrec **lbl, short *numattrs, log_kattrrec **attr);
+	void (*editattrs) (log_gattrrec *gattr, int numattrs, log_kattrrec *kattr, na_strlistrec *lbl,
+			char *name, void (*proc) (), void (*chproc) (), void (*relproc) ());
+	void (*newattrs) (log_gattrrec **gattr, int numattrs, log_kattrrec *kattr);
+	void (*disposeattrs) (log_gattrrec **gattr, int numattrs, log_kattrrec *kattr);
+	void (*copyattrs) (log_gattrrec **gattr, log_gattrrec *oldattr, int numattrs, log_kattrrec *kattr);
+	void (*initscreen) ();
+	void (*clearshowalpha) ();
+	void (*setupregion) (log_regrec **r, int pagenum);
+	void (*stamp) (long *i);
+	void (*noclip) ();
+} log_hooks_t;
+
+typedef struct log_hook2_t
+{
+	void (*getnodeval) (log_nrec *n, double *val, char *opts);
+	void (*solderat) (int x, int y);
+	void (*unsolderwires) (log_hwrec *hw, log_vwrec *vw);
+	void (*settofrom) (log_grec **g, char *name);
+	void (*findattrnum) (log_krec *k, char *name, char *kinds, short *num);
+	void (*findattrname) (log_krec *k, int num, char *name);
+	void (*findpinnum) (log_krec *k, char *name, short *num);
+	void (*findpinname) (log_krec *k, int num, char *name);
+	void (*setgattr) (log_grec *g, int num, char *value);
+	void (*setnattr) (log_nrec *n, int num, char *value);
+	void (*findpointmarker) (log_krec *k, int num, short *x, short *y);
+	void (*findboxmarker) (log_krec *k, int num, short *x1, short *y1, short *x2, short *y2);
+	void (*send_general) (struct log_tool *sim, char *act);
+	void (*send_gennode) (log_nrec *n, char *act);
+	void (*send_genkind) (log_krec *k, char *act);
+	void (*send_gengate) (log_grec *g, char *act);
+	void (*send_all) (char *act);
+	void (*send_allnodes) (char *act);
+	void (*send_allkinds) (char *act);
+	void (*send_allgates) (char *act);
+	void (*addlabelat) (int x, int y, char *s);
+	void (*addboxat) (int x1, int y1, int x2, int y2);
+	void (*plainxform) (log_grec *g, short *x, short *y);
+	void (*findattrnum2) (int numattrs, log_kattrrec *kattr, na_strlistrec *lbl, char *name, char *kinds, short *num);
+	void (*findattrname2) (int numattrs, log_kattrrec *kattr, na_strlistrec *lbl, int num, char *name);
+	void (*showpinname) (log_grec *g, int i, int c, char *name);
+} log_hook2_t;
+
+typedef struct log_action_t
+{
+	log_actionkinds action;
+	log_krec *actkind;
+	log_grec *actgate;
+	log_grec *actgate2;
+	log_nrec *actnode;
+	log_nrec *actnode2;
+	long actx;
+	long acty;
+	FILLE **actfile;
+	struct log_tool *acttool;
+	char *actstr;
+	double actval;
+	double actval2;
+	double actval3;
+	log_gattrrec *actgattr;
+	log_kattrrec *actkattr;
+	unsigned char *actproc;
+
+	int pagechanged[log_maxpages];
+	log_grec *gbase[log_maxpages];
+	log_srec *sbase[log_maxpages];
+	log_hwrec *hwbase[log_maxpages];
+	log_vwrec *vwbase[log_maxpages];
+	log_lrec *lbase[log_maxpages];
+	log_brec *bbase[log_maxpages];
+	log_nrec *nbase;
+
+	log_sigrec *signaltab;
+	short maxsignal;
+	short lastsignal;
+
+	long numpages; /**< number of pages */
+	long curpage;  /**< current page number */
+	long showpage; /**< currenctly displayed page number */
+
+	short scale;
+	short hscale;
+	long xoff;	   /**< screen_x = grid_x * scale - xoff */
+	long yoff;
+
+	char func[17];
+	char *funcarg;
+
+	log_grec *neargate;
+	log_lrec *nearlabel;
+	log_brec *nearbox;
+	log_hwrec *nearhw;
+	log_hwrec *movinghw;
+	log_vwrec *nearvw;
+	log_vwrec *movingvw;
+
+	log_nrec *probenode;
+	log_grec *probegate;
+	short probepin;
+	struct log_tool *probesimtype;
+	short baselinecolor;
+
+	log_hnrec *hnbase;
+	log_htrec *htbase;
+	log htrec *htlast;
+
+	long fastspeed;
+	long fastmin;
+	long fastmax;
+	long fastrate;
+
+	long singlestepcount;
+
+	double time;
+	double prevtime;
+
+	log_simstatekinds simstate;
+	log_simstatekinds oldsimstate;
+
+	struct log_tool *simstatetool;
+	struct log_tool *oldsimstatetool;
+
+	int histactive;      /** Scope mode is triggered */
+	int dumpopen;        /** Dump output file is open */
+	int traceopen;       /** Trace output is open */
+	int verbose;         /** Commands acknowledge with messages */
+	int traceflag;       /** Debuggin/trace mode on */
+	int quiet;           /** Suppress sound signals */
+	int glowmode;        /** Glowing-wires mode */
+	int probemode;       /** Probe-cursor mode */
+	int markers;         /** Printing markers are defined */
+	int invisible;       /** Gates and wires are invisible */
+	int textinvisible;   /** Lablels and boxes are invisible */
+	int pnuminvisible;   /** Pin numbers are invisible */
+	int dotvisible;      /** Are "red dots" on or off normally? */
+	int showconflicts;   /** Show onlyconflict */
+	int resetflag;       /** "Reset" command has been given */
+	int pwrglag;         /** Simulator is turned on */
+	int intitdone;       /** Done with program initialization */
+	int refrflag;        /** Refreshing all displays */
+
+	int busyflag;        /** Flag for idling simulations */
+
+	short markerx1;
+	short markery1;
+	short markerx2;
+	short markery2;
+
+	m_tablet_info t;
+	m_tablet_info t0;
+	int startpoint;
+	int stillnear;
+	int incircuit;
+
+	short gridx;
+	short gridy;
+	short posx;
+	short posy;
+	short oldx;
+	short oldy;
+	short cx_min;
+	short cy_min;
+	short cx_max;
+	short cy_max;
+	/** Area covered bu cyrsor */
+
+	FILE **dumfile;
+	FILE **tracefile;
+
+	long rndseed; /** Seed for RAND funtion */
+
+	char *homedirname;
+
+	enum
+	{
+		log_host_log;
+		log_host_loged;
+		log_host_3;
+		log_host_4;
+	} host;
+	struct log_tool *toolbase;
+
+	log_hooks hook;
+	log_colorrec color;
+
+	long curstamp;
+	long labelstamp;                /** Changes to labels */
+	long boxstamp;                  /** Changes to boxes */
+	long msgstamp;                  /** Clearing messages screen */
+	long refrstamp;                 /** Clearing graphics screen */
+	long nattrstamp;                /** Changes to note attributes */
+	long gattrstamp;                /** Changes to gate attributes */
+	long sigstamp;                  /** Changes to signal table */
+	long loadstamp;                 /** A page was loaded */
+	long pagestamp[log_maxpages];
+	long colorstamp;                /** Color assignment have changes */
+	long markerstampt;               /** Page markers moved */
+
+	log_krec *probeking;
+	na_strlistrec *actstrlist;
+	log_kook2 *hook2;
+	log_hwrec *probehwire;
+	log vwrec *probevwire;
+	long actx2;
+	long acty2;
+	na_quadword actq1;
+	na_quadword actq2;
+	char genfunc [17];
+	long runstamp;
+} log_action_t
+
+#endif
diff --git a/log/src/ana/main.c b/log/src/ana/main.c
index e091f14..7437068 100644
--- a/log/src/ana/main.c
+++ b/log/src/ana/main.c
@@ -28,19 +28,17 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-#define MAIN_G
+#include "nsolver.h"
 #include "main.h"
 
 
 #define newci_findprocedure  findprocedure
-extern boolean findprocedure PP((Char *name, Void (**start)()));
+extern int findprocedure (char *name, void (**start)());
 
-Static Void Update PV();
+static void Update ();
 
 
-Static Void Clear_Array()
+static void Clear_Array()
 {
   long Row, Col;
   AnaMatRec *WITH;
@@ -60,9 +58,9 @@ Static Void Clear_Array()
 
 /*Doneproc**/
 
-Void Analog_Status()
+void Analog_Status()
 {
-  Char Temp[256];
+  char Temp[256];
 
   if (AnaLogglobals->actflag) {
     if (AnaInuse) {
@@ -188,7 +186,7 @@ Void Analog_Status()
 /*===========================================================================*/
 /*      Procedure To initialize Technology-related constants                 */
 
-Void Analog_InitTechnology()
+void Analog_InitTechnology()
 {
 
 /*===========================================================================*/
@@ -396,7 +394,7 @@ Void Analog_InitTechnology()
 /*===========================================================================*/
 /*              Procedure To initialize constants in program                 */
 
-Void Analog_InitVar()
+void Analog_InitVar()
 {
 
 /*===========================================================================*/
@@ -513,10 +511,10 @@ Void Analog_InitVar()
 }
 
 
-Static Void NewAnalog_SystemInit()
+static void NewAnalog_SystemInit()
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
 
   do {
     AnaGetcommand("SYSTEM", Arg, &Found);
@@ -616,12 +614,12 @@ Static Void NewAnalog_SystemInit()
 }
 
 
-Void Analog_Systeminit()
+void Analog_Systeminit()
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
-  Char *STR1;
+  char *STR1;
 
   do {
     AnaGetcommand("SYSTEM", Arg, &Found);
@@ -802,12 +800,12 @@ Void Analog_Systeminit()
   AnaTimeReset();
 }
 
-Void Analog_TechnologyCnf()
+void Analog_TechnologyCnf()
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
-  Char *STR1;
+  char *STR1;
 
   do {
     AnaGetcommand("PHYSICAL", Arg, &Found);
@@ -1388,7 +1386,7 @@ Void Analog_TechnologyCnf()
 /*==============================================================================*/
 
 
-Void Analog_Reset()
+void Analog_Reset()
 {
   log_nrec *NCount;
   AnaExt_rec *A_Node;
@@ -1421,7 +1419,7 @@ Void Analog_Reset()
     while (GCount != NULL) {
       WITH = GCount;
       if (WITH->kind->simtype->simtype == 32) {
-	Act.action = Analog_act_reset;
+	Act.action = ANALOG_ACT_RESET;
 	Act.page = Pages;
 	Act.inst = GCount;
 	A_Kind = (AnaCell_rec *)WITH->kind->info;
@@ -1443,7 +1441,7 @@ Void Analog_Reset()
 /********************************************************************************/
 /*            Procedure For updating the screen appropiately                    */
 
-Void Analog_Refresh()
+void Analog_Refresh()
 {
 
   /********************************************************************************/
@@ -1460,7 +1458,7 @@ Void Analog_Refresh()
   while (GCount != NULL) {
     WITH = GCount;
     if (WITH->kind->simtype->simtype == 32) {
-      Act.action = Analog_act_refresh;
+      Act.action = ANALOG_ACT_REFRESH;
       Act.inst = GCount;
       A_Kind = (AnaCell_rec *)WITH->kind->info;
       (*A_Kind->proc_cell)(&Act);
@@ -1474,12 +1472,12 @@ Void Analog_Refresh()
 /*         Procedure To Find A New Kind of Gate In  Symbol Table                */
 /*==============================================================================*/
 
-Void Analog_Newkind(newkindptr)
+void Analog_Newkind(newkindptr)
 log_krec *newkindptr;
 {
-  Char Procname[256];
+  char Procname[256];
   long Index;
-  Void (*Initproc) PP((Analog_32_action *act));
+  void (*Initproc) (Analog_32_action *act);
   Analog_32_action Act;
   AnaCell_rec *Temp;
   AnaKlistnode *NewKlist;
@@ -1490,16 +1488,16 @@ log_krec *newkindptr;
     sprintf(Procname + strlen(Procname), "%c", newkindptr->proc[Index - 1]);
     Index++;
   }
-  if (!newci_findprocedure(Procname, (Void(**) PV())(&Initproc))) {
+  if (!newci_findprocedure(Procname, (void(**) ())(&Initproc))) {
     AnaDummyInit(newkindptr);
     return;
   }
-  Act.action = Analog_act_newkind;
+  Act.action = ANALOG_ACT_NEWKIND;
   Act.kind = newkindptr;
   (*Initproc)(&Act);
   Temp = (AnaCell_rec *)newkindptr->info;
   Temp->proc_cell = Initproc;
-  newkindptr->info = (Anyptr)Temp;
+  newkindptr->info = (void *)Temp;
   NewKlist = (AnaKlistnode *)Malloc(sizeof(AnaKlistnode));
   NewKlist->NodeKind = newkindptr;
   NewKlist->Nextnode = AnaKlist;
@@ -1514,7 +1512,7 @@ log_krec *newkindptr;
 /********************************************************************************/
 /* Procedure To Initialize the Reference Counting Fields of Nodes               */
 
-Static Void Nodelist_init()
+static void Nodelist_init()
 {
 
   /********************************************************************************/
@@ -1536,8 +1534,7 @@ Static Void Nodelist_init()
 /********************************************************************************/
 /*              Procedure To Set Reference Counts Of All Nodes                  */
 
-Static Void Nodelist_refcnt(Inuse, Ok)
-boolean *Inuse, *Ok;
+static void Nodelist_refcnt(int *Inuse, int *Ok)
 {
 
   /********************************************************************************/
@@ -1548,7 +1545,7 @@ boolean *Inuse, *Ok;
   long Pages, Numpages;
   Anainstlist *A_Gate;
   log_grec *WITH;
-  Char STR1[26];
+  char STR1[26];
   long FORLIM1;
 
   *Inuse = false;
@@ -1590,8 +1587,7 @@ boolean *Inuse, *Ok;
 /********************************************************************************/
 /*              Procedure To Report Singly Connected Node                       */
 
-Static Void Single_Find(display)
-boolean display;
+static void Single_Find(int display)
 {
 
   /********************************************************************************/
@@ -1601,9 +1597,9 @@ boolean display;
   log_grec *Count;
   long Pages, Numpages;
   Anainstlist *A_Gate;
-  boolean FirstFound, Found;
+  int FirstFound, Found;
   log_grec *WITH;
-  Char STR1[24];
+  char STR1[24];
 
   Numpages = AnaLogglobals->numpages;
   FirstFound = true;
@@ -1644,9 +1640,7 @@ boolean display;
 /********************************************************************************/
 /*        Procedure To Check Reference Counts For a Proper Net                  */
 
-Static Void Nodelist_Check(Ok, Totnodes)
-boolean *Ok;
-long *Totnodes;
+static void Nodelist_Check(int *Ok, long *Totnodes)
 {
 
   /********************************************************************************/
@@ -1702,7 +1696,7 @@ long *Totnodes;
 /******************************************************************************/
 /*        Procedure for setting dimmed status on all gates                    */
 
-Static Void Dimcheck()
+static void Dimcheck()
 {
 
   /******************************************************************************/
@@ -1731,7 +1725,7 @@ Static Void Dimcheck()
 /******************************************************************************/
 /*        Procedure for resetting dimmed status on all gates                  */
 
-Static Void UnDim()
+static void UnDim()
 {
 
   /******************************************************************************/
@@ -1760,9 +1754,7 @@ Static Void UnDim()
 /********************************************************************************/
 /*         Procedure To Check For a Simulatable Net                             */
 
-Static Void Analog_Syntax_Check(Ok, Totnodes)
-boolean *Ok;
-long *Totnodes;
+static void Analog_Syntax_Check(int *Ok, long *Totnodes)
 {
 
   /*  Ok: Set if ok to simulate net;
@@ -1804,7 +1796,7 @@ long *Totnodes;
 /********************************************************************************/
 /*  Procedure To Allocate Internal Node List - Updates Totnodes Appropiately    */
 
-Static Void Internal_Number(Totnodes)
+static void Internal_Number(Totnodes)
 long *Totnodes;
 {
 
@@ -1824,7 +1816,7 @@ long *Totnodes;
 /********************************************************************************/
 /* Procedure To Allocate The correct sized array For Simulation                 */
 
-Static Void Analog_Allocate(Totnodes)
+static void Analog_Allocate(Totnodes)
 long Totnodes;
 {
 
@@ -1839,9 +1831,9 @@ long Totnodes;
 /*         Returns true if any guesses are still needed                       */
 /******************************************************************************/
 
-Static boolean Ext_Anynil()
+static int Ext_Anynil()
 {
-  boolean Result;
+  int Result;
   log_nrec *Count;
   AnaExt_rec *A_Node;
 
@@ -1863,11 +1855,11 @@ Static boolean Ext_Anynil()
 /*         Returns true if any guesses are still needed                       */
 /******************************************************************************/
 
-Static boolean Anynil()
+static int Anynil()
 {
   log_nrec *Count;
   AnaExt_rec *A_Node;
-  boolean Onenil;
+  int Onenil;
   AnaInt_rec *IntCount;
 
   Onenil = false;
@@ -1892,7 +1884,7 @@ Static boolean Anynil()
 
 
 
-Static Void Analog_Guess()
+static void Analog_Guess()
 {
   log_grec *Count;
   long Pages, Numpages;
@@ -1907,7 +1899,7 @@ Static Void Analog_Guess()
     while (Count != NULL) {
       WITH = Count;
       if (WITH->kind->simtype->simtype == 32) {
-	Act.action = Analog_act_pass1;
+	Act.action = ANALOG_ACT_PASS1;
 	Act.page = Pages;
 	Act.inst = Count;
 	A_Kind = (AnaCell_rec *)WITH->kind->info;
@@ -1923,7 +1915,7 @@ Static Void Analog_Guess()
     while (Count != NULL) {
       WITH = Count;
       if (WITH->kind->simtype->simtype == 32) {
-	Act.action = Analog_act_pass2;
+	Act.action = ANALOG_ACT_PASS2;
 	Act.page = Pages;
 	Act.inst = Count;
 	A_Kind = (AnaCell_rec *)WITH->kind->info;
@@ -1941,7 +1933,7 @@ Static Void Analog_Guess()
 /********************************************************************************/
 /*         Procedure for fixing simulation constants                            */
 
-Static Void Timestep()
+static void Timestep()
 {
 
   /********************************************************************************/
@@ -1958,7 +1950,7 @@ Static Void Timestep()
 /********************************************************************************/
 /*                  Main procedure for setup of simulation                      */
 
-Void Analog_Setup()
+void Analog_Setup()
 {
 
   /********************************************************************************/
@@ -1984,7 +1976,7 @@ Void Analog_Setup()
 /********************************************************************************/
 /*           Main procedure to abort simulation gracefully                      */
 
-Void Analog_Cleanup()
+void Analog_Cleanup()
 {
 
   /********************************************************************************/
@@ -2000,12 +1992,11 @@ Void Analog_Cleanup()
 
 
 
-Void Analog_GlobalCommand(Found, Accepted)
-boolean *Found, *Accepted;
+void Analog_GlobalCommand(int *Found, int *Accepted)
 {   /*Func is command, Funcarg^ is argument*/
   long Temp;
   log_action *WITH;
-  Char STR2[256];
+  char STR2[256];
 
 
   WITH = AnaLogglobals;
@@ -2124,11 +2115,11 @@ boolean *Found, *Accepted;
 }
 
 
-Void Analog_Probemode()
+void Analog_Probemode()
 {
   AnaExt_rec *Probenode;
   double Value;
-  Char Outstr[256];
+  char Outstr[256];
   Analog_32_action Act;
   AnaCell_rec *A_Kind;
 
@@ -2177,7 +2168,7 @@ Void Analog_Probemode()
   }
   if (AnaLogglobals->probegate->kind->simtype->simtype == 32) {
     AnaGateHystercount = 0;
-    Act.action = Analog_act_probe;
+    Act.action = ANALOG_ACT_PROBE;
     Act.inst = AnaLogglobals->probegate;
     A_Kind = (AnaCell_rec *)AnaLogglobals->probegate->kind->info;
     (*A_Kind->proc_cell)(&Act);
@@ -2197,7 +2188,7 @@ Void Analog_Probemode()
 /*==============================================================================*/
 
 
-Static Void Update()
+static void Update()
 {
   log_nrec *Ext_Count;
   AnaExt_rec *A_Node;
@@ -2227,12 +2218,12 @@ Static Void Update()
 
 
 /*Doneproc**/
-Static Void Refresh()
+static void Refresh()
 {
   log_nrec *Ext_Count;
   AnaExt_rec *A_Node;
   AnaInt_rec *Int_Count;
-  boolean Glowset;
+  int Glowset;
   double Glowscale;
 
   if (AnaEpoch != AnaE_Refresh || AnaQuit())
@@ -2270,13 +2261,13 @@ Static Void Refresh()
 }
 
 
-Static Void Evaluate()
+static void Evaluate()
 {
   log_grec *Count;
   long Pages, Numpages;
   AnaCell_rec *A_Kind;
   Analog_32_action Act;
-  boolean Timeout;
+  int Timeout;
   log_grec *WITH;
 
   Numpages = AnaLogglobals->numpages;
@@ -2295,7 +2286,7 @@ Static Void Evaluate()
     while (Count != NULL && !Timeout) {
       WITH = Count;
       if (WITH->kind->simtype->simtype == 32) {
-	Act.action = Analog_act_ex;
+	Act.action = ANALOG_ACT_EX;
 	Act.inst = Count;
 	A_Kind = (AnaCell_rec *)WITH->kind->info;
 	(*A_Kind->proc_cell)(&Act);
@@ -2325,8 +2316,7 @@ Static Void Evaluate()
 }
 
 
-Static boolean Vardone(Oldvar, NewVar)
-double Oldvar, NewVar;
+static int Vardone(double Oldvar, double NewVar)
 {
   if (fabs(Oldvar) > AnaVardone_Epsilon)
     return (fabs(1 - NewVar / Oldvar) < AnaTol);
@@ -2340,8 +2330,7 @@ double Oldvar, NewVar;
 
 
 /*Doneproc**/
-Static Void Calculate(Overflow, Done)
-boolean *Overflow, *Done;
+static void Calculate(int *Overflow, int *Done)
 {
   log_nrec *Ext_Count;
   AnaExt_rec *A_Node;
@@ -2413,7 +2402,7 @@ boolean *Overflow, *Done;
 
 
 
-Static Void Backtrack()
+static void Backtrack()
 {
   log_nrec *Ext_Count;
   AnaExt_rec *A_Node;
@@ -2437,8 +2426,7 @@ Static Void Backtrack()
 
 /*Doneproc**/
 
-Static Void OldAdapt(Done)
-boolean Done;
+static void OldAdapt(int Done)
 {
   if (AnaEpoch != AnaE_Adapt || AnaQuit())
     return;
@@ -2488,8 +2476,7 @@ boolean Done;
 
 /*Doneproc**/
 
-Static Void Adapt(Done)
-boolean Done;
+static void Adapt(int Done)
 {
   if (AnaEpoch != AnaE_Adapt || AnaQuit())
     return;
@@ -2553,7 +2540,7 @@ boolean Done;
 }
 
 
-Static Void Timestep_Update()
+static void Timestep_Update()
 {
   log_nrec *Ext_Count;
   AnaExt_rec *A_Node;
@@ -2584,13 +2571,13 @@ Static Void Timestep_Update()
 
 
 
-Static Void Memory()
+static void Memory()
 {
   log_grec *Count;
   long Pages, Numpages;
   AnaCell_rec *A_Kind;
   Analog_32_action Act;
-  boolean Timeout;
+  int Timeout;
   log_grec *WITH;
   log_action *WITH1;
   log_tool *WITH2;
@@ -2609,7 +2596,7 @@ Static Void Memory()
 	  A_Kind = (AnaCell_rec *)WITH->kind->info;
 	  if (A_Kind->phase == Anacomplex) {
 	    Act.page = Pages;
-	    Act.action = Analog_act_preupdate;
+	    Act.action = ANALOG_ACT_PREUPDATE;
 	    Act.inst = Count;
 	    (*A_Kind->proc_cell)(&Act);
 	  }
@@ -2665,7 +2652,7 @@ Static Void Memory()
 	  A_Kind = (AnaCell_rec *)WITH->kind->info;
 	  if (A_Kind->phase == Anacomplex) {
 	    Act.page = Pages;
-	    Act.action = Analog_act_display;
+	    Act.action = ANALOG_ACT_DISPLAY;
 	    Act.inst = Count;
 	    (*A_Kind->proc_cell)(&Act);
 	  }
@@ -2702,7 +2689,7 @@ Static Void Memory()
 }
 
 
-Void Analog_Tstep()
+void Analog_Tstep()
 {
   log_grec *Count;
   AnaCell_rec *A_Kind;
@@ -2721,7 +2708,7 @@ Void Analog_Tstep()
       WITH = Count;
       if (WITH->kind->simtype->simtype == 32) {
 	A_Kind = (AnaCell_rec *)WITH->kind->info;
-	Act.action = Analog_act_update;
+	Act.action = ANALOG_ACT_UPDATE;
 	Act.inst = Count;
 	(*A_Kind->proc_cell)(&Act);
       }
@@ -2734,7 +2721,7 @@ Void Analog_Tstep()
 
 /*Doneproc**/
 
-Void Analog_Simulate()
+void Analog_Simulate()
 {
   AnaTimeinit();
   Evaluate();
diff --git a/log/src/ana/main.h b/log/src/ana/main.h
index d4d74d4..e879ed9 100644
--- a/log/src/ana/main.h
+++ b/log/src/ana/main.h
@@ -2,70 +2,29 @@
 #ifndef MAIN_H
 #define MAIN_H
 
-
-
-
-
-#ifndef NSOLVER_H
-#include "nsolver.h"
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-#ifndef NEWCRT_H
 #include <p2c/newcrt.h>
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-
-#ifdef MAIN_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
 
-extern Void Analog_Cleanup PV();
-extern Void Analog_GlobalCommand PP((boolean *Found, boolean *Accepted));
-extern Void Analog_InitVar PV();
-extern Void Analog_Newkind PP((log_krec *newkindptr));
-extern Void Analog_Probemode PV();
-extern Void Analog_Refresh PV();
-extern Void Analog_Reset PV();
-extern Void Analog_Setup PV();
-extern Void Analog_Simulate PV();
-extern Void Analog_Status PV();
-extern Void Analog_Systeminit PV();
-extern Void Analog_TechnologyCnf PV();
 
-extern Void Analog_Tstep PV();
+extern void Analog_Cleanup ();
+extern void Analog_GlobalCommand (int *Found, int *Accepted);
+extern void Analog_InitVar ();
+extern void Analog_Newkind (log_krec *newkindptr);
+extern void Analog_Probemode ();
+extern void Analog_Refresh ();
+extern void Analog_Reset ();
+extern void Analog_Setup ();
+extern void Analog_Simulate ();
+extern void Analog_Status ();
+extern void Analog_Systeminit ();
+extern void Analog_TechnologyCnf ();
 
+extern void Analog_Tstep ();
 
-#undef vextern
 
 #endif /*MAIN_H*/
 
diff --git a/log/src/ana/mmeter.c b/log/src/ana/mmeter.c
index 52938c8..997fd64 100644
--- a/log/src/ana/mmeter.c
+++ b/log/src/ana/mmeter.c
@@ -26,14 +26,8 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-
-
-#define MMETER_G
 #include "mmeter.h"
 
-
 #define N_Present       1
 #define N_Format        2
 #define N_Prec          3
@@ -45,7 +39,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 typedef struct ICMmeter {
-  Char InitVsymbol[33], InitIsymbol[33];
+  char InitVsymbol[33], InitIsymbol[33];
   long Initprec;
 } ICMmeter;
 
@@ -61,9 +55,9 @@ typedef struct Inoderec {
 typedef struct Imeterrec {
   Inoderec *Ilist;
   double NewValue;
-  boolean NewBlank;
-  Char NewOutStr[256], OldOutStr[256];
-  boolean Valid, OldValid;
+  int NewBlank;
+  char NewOutStr[256], OldOutStr[256];
+  int Valid, OldValid;
 } Imeterrec;
 
 
@@ -72,10 +66,10 @@ typedef struct Imeterrec {
 /*              Procedure to correctly position labels                        */
 
 
-Local Void Mmeter_Locate(rot, Tx, Ty, Left)
+void Mmeter_Locate(rot, Tx, Ty, Left)
 long rot;
 short *Tx, *Ty;
-boolean *Left;
+int *Left;
 {
 
   /******************************************************************************/
@@ -112,7 +106,7 @@ boolean *Left;
 }
 
 
-Local double Itot(act)
+double Itot(act)
 Analog_32_action *act;
 {
   Imeterrec *Intptr;
@@ -133,7 +127,7 @@ Analog_32_action *act;
     while (Count != NULL) {
       Iinact.pin = Count->Ipin;
       Iinact.inst = Count->Igate;
-      Iinact.action = Analog_act_Iin;
+      Iinact.action = ANALOG_ACT_IIN;
       A_Kind = (AnaCell_rec *)Count->Igate->kind->info;
       (*A_Kind->proc_cell)(&Iinact);
       Count = Count->Next;
@@ -147,7 +141,7 @@ Analog_32_action *act;
 /*                Procedure to update cell in algorithm                        */
 /*******************************************************************************/
 
-Local Void PreUpdate_Mmeter(act)
+void PreUpdate_Mmeter(act)
 Analog_32_action *act;
 {
   AnaExt_rec *A_Node;
@@ -158,7 +152,7 @@ Analog_32_action *act;
   log_grec *WITH;
   Imeterrec *WITH1;
   ICMmeter *WITH2;
-  Char Newout[256];
+  char Newout[256];
 
   Cellptr = (AnaCell_rec *)act->inst->kind->info;
   ICptr = (ICMmeter *)Cellptr->Ainfo;
@@ -212,7 +206,7 @@ Analog_32_action *act;
 /*                Procedure to update cell in algorithm                        */
 /*******************************************************************************/
 
-Local Void Update_Mmeter(act)
+void Update_Mmeter(act)
 Analog_32_action *act;
 {
   Imeterrec *Intptr;
@@ -243,11 +237,11 @@ Analog_32_action *act;
 /*                Procedure to update cell in algorithm                        */
 /*******************************************************************************/
 
-Local Void Display_Mmeter(act)
+void Display_Mmeter(act)
 Analog_32_action *act;
 {
   short tx, ty;
-  boolean Left;
+  int Left;
   Imeterrec *Intptr;
   Anainstlist *A_Gate;
   log_grec *WITH;
@@ -282,7 +276,7 @@ Analog_32_action *act;
 
 
 
-Local Void Pass1_Mmeter(act)
+void Pass1_Mmeter(act)
 Analog_32_action *act;
 {
   long Mx, My;
@@ -331,11 +325,11 @@ Analog_32_action *act;
 /*                Procedure to update cell in algorithm                        */
 /*******************************************************************************/
 
-Local Void Refresh_Mmeter(act)
+void Refresh_Mmeter(act)
 Analog_32_action *act;
 {
   short tx, ty;
-  boolean Left;
+  int Left;
   Imeterrec *Intptr;
   Anainstlist *A_Gate;
   log_grec *WITH;
@@ -373,7 +367,7 @@ Analog_32_action *act;
 /*                Procedure to give current into cell                          */
 /*******************************************************************************/
 
-Local Void Iin_Mmeter(act)
+void Iin_Mmeter(act)
 Analog_32_action *act;
 {
   log_grec *WITH;
@@ -385,11 +379,11 @@ Analog_32_action *act;
 /*                Procedure to update meter display                            */
 /*******************************************************************************/
 
-Local Void Erase_Mmeter(act)
+void Erase_Mmeter(act)
 Analog_32_action *act;
 {
   short tx, ty;
-  boolean Left;
+  int Left;
   Imeterrec *Intptr;
   Anainstlist *A_Gate;
   log_grec *WITH;
@@ -419,16 +413,16 @@ Analog_32_action *act;
 }  /*Erase_Mmeter*/
 
 
-Local Void GetCnf_Mmeter(NewIC)
+void GetCnf_Mmeter(NewIC)
 ICMmeter *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICMmeter *WITH;
-  Char STR1[256];
-  Char STR2[256];
-  Char *STR3;
+  char STR1[256];
+  char STR2[256];
+  char *STR3;
 
   WITH = NewIC;
   do {
@@ -473,7 +467,7 @@ ICMmeter *NewIC;
 /*******************************************************************************/
 
 
-Local Void INITLIB_Mmeter(act)
+void INITLIB_Mmeter(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -492,19 +486,19 @@ Analog_32_action *act;
   strcpy(NewIC->InitIsymbol, "Not on a pin");
   NewIC->Initprec = 3;
   GetCnf_Mmeter(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*Mmeter_initlib*/
 
 
-Local Void Attr_Mmeter(act)
+void Attr_Mmeter(act)
 Analog_32_action *act;
 {
   long Attrnum;
-  Char Oldout[256], Newout[256];
+  char Oldout[256], Newout[256];
   double Lastval;
   short tx, ty;
-  boolean Left;
+  int Left;
   AnaCell_rec *Cellptr;
   ICMmeter *ICptr;
   Imeterrec *Intptr;
@@ -610,12 +604,12 @@ Analog_32_action *act;
 /*                Procedure to reset cell in algorithm                       */
 /*******************************************************************************/
 
-Local Void Reset_Mmeter(act)
+void Reset_Mmeter(act)
 Analog_32_action *act;
 {
   short tx, ty;
-  Char Oldout[256];
-  boolean Left;
+  char Oldout[256];
+  int Left;
   AnaCell_rec *Cellptr;
   ICMmeter *ICptr;
   Imeterrec *Intptr;
@@ -669,12 +663,12 @@ Analog_32_action *act;
 /*                Procedure to disconnect a Mmeter                             */
 /*******************************************************************************/
 
-Local Void Disconnect_Mmeter(act)
+void Disconnect_Mmeter(act)
 Analog_32_action *act;
 {
   short tx, ty;
-  Char Oldout[256];
-  boolean Left;
+  char Oldout[256];
+  int Left;
   AnaCell_rec *Cellptr;
   ICMmeter *ICptr;
   Imeterrec *Intptr;
@@ -713,7 +707,7 @@ Analog_32_action *act;
 
 
 
-Local Void Newgate_Mmeter(act)
+void Newgate_Mmeter(act)
 Analog_32_action *act;
 {
   AnaCell_rec *Cellptr;
@@ -743,10 +737,10 @@ Analog_32_action *act;
   NewIV->Valid = false;
   NewIV->OldValid = false;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)NewIV;
+  A_Gate->InstVar = (void *)NewIV;
 }
 
-Local Void Copygate_Mmeter(act)
+void Copygate_Mmeter(act)
 Analog_32_action *act;
 {
   AnaCell_rec *Cellptr;
@@ -765,11 +759,11 @@ Analog_32_action *act;
   NewIV->Valid = false;
   NewIV->OldValid = false;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)NewIV;
+  A_Gate->InstVar = (void *)NewIV;
 }
 
 
-Local Void Probe_Mmeter(act)
+void Probe_Mmeter(act)
 Analog_32_action *act;
 {
   AnaScoreboard(Gatename, (long)AnaMessGate1);
@@ -781,7 +775,7 @@ Analog_32_action *act;
 /*                  Cell Library Entry   Mmeter                                */
 /*=============================================================================*/
 
-Void Log_mmeter_initlib_32(act)
+void Log_mmeter_initlib_32(act)
 Analog_32_action *act;
 {
   /*Body of procedure*/
@@ -789,59 +783,59 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     INITLIB_Mmeter(act);
     break;
 
-  case Analog_act_preupdate:
+  case ANALOG_ACT_PREUPDATE:
     PreUpdate_Mmeter(act);
     break;
 
-  case Analog_act_update:
+  case ANALOG_ACT_UPDATE:
     Update_Mmeter(act);
     break;
 
-  case Analog_act_display:
+  case ANALOG_ACT_DISPLAY:
     Display_Mmeter(act);
     break;
 
-  case Analog_act_erase:
+  case ANALOG_ACT_ERASE:
     Erase_Mmeter(act);
     break;
 
-  case Analog_act_refresh:
+  case ANALOG_ACT_REFRESH:
     Refresh_Mmeter(act);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Mmeter(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     Reset_Mmeter(act);
     break;
 
-  case Analog_act_disconnect:
+  case ANALOG_ACT_DISCONNECT:
     Disconnect_Mmeter(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Mmeter(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Mmeter(act);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_Mmeter(act);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     Pass1_Mmeter(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Mmeter(act);
     break;
 
diff --git a/log/src/ana/mmeter.h b/log/src/ana/mmeter.h
index a0e90d0..72e8f37 100644
--- a/log/src/ana/mmeter.h
+++ b/log/src/ana/mmeter.h
@@ -3,55 +3,16 @@
 #define MMETER_H
 
 
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef MMETER_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_mmeter_initlib_32 PP((Analog_32_action *act));
 
+extern void Log_mmeter_initlib_32 (Analog_32_action *act);
 
-#undef vextern
 
 #endif /*MMETER_H*/
 
diff --git a/log/src/ana/moscap.c b/log/src/ana/moscap.c
index 27016e0..651dfb9 100644
--- a/log/src/ana/moscap.c
+++ b/log/src/ana/moscap.c
@@ -27,14 +27,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /*When its time to add subthreshold light, look at IDIFF for new update,
   write procedures*/
 
-
-
-
-
 #include <p2c/p2c.h>
-
-
-#define MOSCAP_G
 #include "moscap.h"
 
 
@@ -71,7 +64,7 @@ typedef struct ICMoscap {
 /****************************************************************************/
 
 
-Local Void Ex_Moscap(act)
+void Ex_Moscap(act)
 Analog_32_action *act;
 {
   double MinI1, dI1dV1;
@@ -134,7 +127,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Iin_Moscap(act)
+void Iin_Moscap(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr;
@@ -175,14 +168,14 @@ Analog_32_action *act;
 }  /*Iin_Moscap*/
 
 
-Local Void GetCnf_Moscap(NewIC)
+void GetCnf_Moscap(NewIC)
 ICMoscap *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICMoscap *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -242,7 +235,7 @@ ICMoscap *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_Moscap(act)
+void initlib_Moscap(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -264,8 +257,8 @@ Analog_32_action *act;
   NewIC->InitVtp = 0.9;
   NewIC->InitKtqn = 0.04;
   GetCnf_Moscap(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*Moscap_Initlib*/
 
 
@@ -285,11 +278,11 @@ Analog_32_action *act;
 
 
 
-Local boolean Moscapcheck(Inst, Attrnum)
+int Moscapcheck(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   MoscapConst *MoscapVar;
   Anainstlist *A_Gate;
 
@@ -344,7 +337,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_Moscap(act)
+void Attr_Moscap(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -357,7 +350,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Moscap(act)
+void Newgate_Moscap(act)
 Analog_32_action *act;
 {
   MoscapConst *MoscapVar;
@@ -372,7 +365,7 @@ Analog_32_action *act;
   MoscapVar->HalfCap = ICptr->InitNonCap / 2;
   MoscapVar->Kn2 = 1 / ICptr->InitKtqn;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)MoscapVar;
+  A_Gate->InstVar = (void *)MoscapVar;
   AnaCapInit(act->inst);   /*Initialize attributes of Cstart*/
   WITH = act->inst;
   WITH->attr[N_Model - 1].UU.nv = ICptr->InitModel;
@@ -395,7 +388,7 @@ Analog_32_action *act;
   WITH->attr[N_Ktqn - 1].changed = true;
 }
 
-Local Void Copygate_Moscap(act)
+void Copygate_Moscap(act)
 Analog_32_action *act;
 {
   MoscapConst *MoscapVar, *Old_Moscapvar;
@@ -406,11 +399,11 @@ Analog_32_action *act;
   MoscapVar = (MoscapConst *)Malloc(sizeof(MoscapConst));
   *MoscapVar = *Old_Moscapvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)MoscapVar;
+  A_Gate->InstVar = (void *)MoscapVar;
   AnaCapCopy(act->inst);   /*Initialize attributes 1 to 3*#*/
 }
 
-Local Void Dispose_Moscap(act)
+void Dispose_Moscap(act)
 Analog_32_action *act;
 {
   MoscapConst *MoscapVar;
@@ -422,7 +415,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_Moscap(act)
+void Readgate_Moscap(act)
 Analog_32_action *act;
 {
   MoscapConst *MoscapVar;
@@ -464,17 +457,17 @@ Analog_32_action *act;
 
 
 
-Local Void Probe_MosCap(act)
+void Probe_MosCap(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr;
   double Node1, Pin1;
   log_grec *WITH;
-  Char STR1[14];
-  Char STR2[18];
-  Char STR3[256];
-  Char STR4[256];
+  char STR1[14];
+  char STR2[18];
+  char STR3[256];
+  char STR4[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -517,7 +510,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Void Log_moscap_initlib_32(act)
+void Log_moscap_initlib_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -525,63 +518,63 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_Moscap(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_Moscap(act);
     break;
 
-  case Analog_act_update:   /*For complex gates - see IDIFF*/
+  case ANALOG_ACT_UPDATE:   /*For complex gates - see IDIFF*/
     AnaCapUpdate(act->inst);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Moscap(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     AnaCapReset(act->inst);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Moscap(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Moscap(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Moscap(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Moscap(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_Moscap(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_MosCap(act);
     break;
 
diff --git a/log/src/ana/moscap.h b/log/src/ana/moscap.h
index 96d434e..51cc668 100644
--- a/log/src/ana/moscap.h
+++ b/log/src/ana/moscap.h
@@ -1,54 +1,15 @@
-/* Header for module MOSCAP, generated by p2c */
 #ifndef MOSCAP_H
 #define MOSCAP_H
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef MOSCAP_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-/*$If Float$
-  $float_hdw on$
-  $End$*/
-
-
-
-extern Void Log_moscap_initlib_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_moscap_initlib_32 (Analog_32_action *act);
 
 #endif /*MOSCAP_H*/
 
diff --git a/log/src/ana/nfet4.c b/log/src/ana/nfet4.c
index 2970142..5c21173 100644
--- a/log/src/ana/nfet4.c
+++ b/log/src/ana/nfet4.c
@@ -27,12 +27,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-
-
-
-#define NFET4_G
 #include "nfet4.h"
 
 
@@ -75,7 +69,7 @@ typedef struct ICNfet {
 /****************************************************************************/
 
 
-Local Void Ex_NFET4(act)
+void Ex_NFET4(act)
 Analog_32_action *act;
 {
   double MinI2, dI2dV1, dI2dV2, dI2dV3, MinI3, dI3dV1, dI3dV2, dI3dV3, MinI1,
@@ -337,7 +331,7 @@ Analog_32_action *act;
 /*          Procedure To Supply Current  Out of a Cell To Current Meters    */
 /****************************************************************************/
 
-Local Void Iin_NFET4(act)
+void Iin_NFET4(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr, *Pin2Ptr, *Pin3Ptr;
@@ -462,14 +456,14 @@ Analog_32_action *act;
 }  /*Iin_NFET4*/
 
 
-Local Void GetCnf_Nfet4(NewIC)
+void GetCnf_Nfet4(NewIC)
 ICNfet *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICNfet *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -572,7 +566,7 @@ ICNfet *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_NFET4(act)
+void initlib_NFET4(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -603,17 +597,17 @@ Analog_32_action *act;
   NewIC->InitCsb = 10e-15;
   NewIC->InitEarly = 50.0;
   GetCnf_Nfet4(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*NFET4_Initlib*/
 
 
 
-Local boolean Nfetcheck(Inst, Attrnum)
+int Nfetcheck(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   NfetConst *NfetVar;
   Anainstlist *A_Gate;
 
@@ -700,7 +694,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_Nfet4(act)
+void Attr_Nfet4(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -718,7 +712,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Nfet4(act)
+void Newgate_Nfet4(act)
 Analog_32_action *act;
 {
   NfetConst *NfetVar;
@@ -747,7 +741,7 @@ Analog_32_action *act;
   NfetVar->TauCgd = 0.0;
   NfetVar->TauCgs = 0.0;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)NfetVar;
+  A_Gate->InstVar = (void *)NfetVar;
   AnaCapInit(act->inst);   /*6*/
   A_Gate->Pininfo[0].Cap = ICptr->InitCgb;
   A_Gate->Pininfo[1].Cap = ICptr->InitCdb;
@@ -779,7 +773,7 @@ Analog_32_action *act;
   WITH->attr[N_Early - 1].changed = true;
 }
 
-Local Void Copygate_Nfet4(act)
+void Copygate_Nfet4(act)
 Analog_32_action *act;
 {
   NfetConst *NfetVar, *Old_Nfetvar;
@@ -790,11 +784,11 @@ Analog_32_action *act;
   NfetVar = (NfetConst *)Malloc(sizeof(NfetConst));
   *NfetVar = *Old_Nfetvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)NfetVar;
+  A_Gate->InstVar = (void *)NfetVar;
   AnaCapCopy(act->inst);   /*6*/
 }
 
-Local Void Dispose_Nfet4(act)
+void Dispose_Nfet4(act)
 Analog_32_action *act;
 {
   NfetConst *NfetVar;
@@ -806,7 +800,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_Nfet4(act)
+void Readgate_Nfet4(act)
 Analog_32_action *act;
 {
   NfetConst *NfetVar;
@@ -868,18 +862,18 @@ Analog_32_action *act;
   NfetVar->TauCgs = 0.0;
 }
 
-Local Void Probe_Nfet4(act)
+void Probe_Nfet4(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr;
   double Node1, Node2, Node3, Pin1, Pin2, Pin3, d1, d2;
-  Char Name2[256], Name3[256];
+  char Name2[256], Name3[256];
   log_grec *WITH;
-  Char STR1[18];
-  Char STR2[12];
-  Char STR3[256];
-  Char STR4[256];
+  char STR1[18];
+  char STR2[12];
+  char STR3[256];
+  char STR4[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -946,7 +940,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Void Log_nfet4_initlib_32(act)
+void Log_nfet4_initlib_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -954,63 +948,63 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_NFET4(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_NFET4(act);
     break;
 
-  case Analog_act_update:   /*8*/
+  case ANALOG_ACT_UPDATE:   /*8*/
     AnaCapUpdate(act->inst);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Nfet4(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     AnaCapReset(act->inst);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Nfet4(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Nfet4(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Nfet4(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Nfet4(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_NFET4(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Nfet4(act);
     break;
 
diff --git a/log/src/ana/nfet4.h b/log/src/ana/nfet4.h
index a3651da..e2a8222 100644
--- a/log/src/ana/nfet4.h
+++ b/log/src/ana/nfet4.h
@@ -1,58 +1,15 @@
-/* Header for module Nfet4, generated by p2c */
 #ifndef NFET4_H
 #define NFET4_H
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef NFET4_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_nfet4_initlib_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_nfet4_initlib_32 (Analog_32_action *act);
 
 #endif /*NFET4_H*/
 
diff --git a/log/src/ana/nfet5.c b/log/src/ana/nfet5.c
index 095420e..713a99c 100644
--- a/log/src/ana/nfet5.c
+++ b/log/src/ana/nfet5.c
@@ -26,9 +26,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-#define NFET5_G
 #include "nfet5.h"
 
 
@@ -70,7 +67,7 @@ typedef struct ICNfet {
 /****************************************************************************/
 
 
-Local Void Ex_NFET5(act)
+void Ex_NFET5(act)
 Analog_32_action *act;
 {
   double MinI2, dI2dV1, dI2dV2, dI2dV3, MinI3, dI3dV1, dI3dV2, dI3dV3, MinI1,
@@ -246,7 +243,7 @@ Analog_32_action *act;
 /*          Procedure To Supply Current  Out of a Cell To Current Meters    */
 /****************************************************************************/
 
-Local Void Iin_NFET5(act)
+void Iin_NFET5(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr, *Pin2Ptr, *Pin3Ptr;
@@ -362,14 +359,14 @@ Analog_32_action *act;
 }  /*Iin_NFET5*/
 
 
-Local Void GetCnf_Nfet5(NewIC)
+void GetCnf_Nfet5(NewIC)
 ICNfet *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICNfet *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -472,7 +469,7 @@ ICNfet *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_NFET5(act)
+void initlib_NFET5(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -503,16 +500,16 @@ Analog_32_action *act;
   NewIC->InitCsb = 10e-15;
   NewIC->InitEarly = 50.0;
   GetCnf_Nfet5(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*NFET5_Initlib*/
 
 
-Local boolean Nfetcheck(Inst, Attrnum)
+int Nfetcheck(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   NfetConst *NfetVar;
   Anainstlist *A_Gate;
 
@@ -605,7 +602,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_Nfet5(act)
+void Attr_Nfet5(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -623,7 +620,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Nfet5(act)
+void Newgate_Nfet5(act)
 Analog_32_action *act;
 {
   NfetConst *NfetVar;
@@ -649,7 +646,7 @@ Analog_32_action *act;
   NfetVar->TauCgd = 0.0;
   NfetVar->TauCgs = 0.0;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)NfetVar;
+  A_Gate->InstVar = (void *)NfetVar;
   AnaCapInit(act->inst);   /*6*/
   A_Gate->Pininfo[0].Cap = ICptr->InitCgb;
   A_Gate->Pininfo[1].Cap = ICptr->InitCdb;
@@ -681,7 +678,7 @@ Analog_32_action *act;
   WITH->attr[N_Early - 1].changed = true;
 }
 
-Local Void Copygate_Nfet5(act)
+void Copygate_Nfet5(act)
 Analog_32_action *act;
 {
   NfetConst *NfetVar, *Old_Nfetvar;
@@ -692,11 +689,11 @@ Analog_32_action *act;
   NfetVar = (NfetConst *)Malloc(sizeof(NfetConst));
   *NfetVar = *Old_Nfetvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)NfetVar;
+  A_Gate->InstVar = (void *)NfetVar;
   AnaCapCopy(act->inst);   /*6*/
 }
 
-Local Void Dispose_Nfet5(act)
+void Dispose_Nfet5(act)
 Analog_32_action *act;
 {
   NfetConst *NfetVar;
@@ -708,7 +705,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_Nfet5(act)
+void Readgate_Nfet5(act)
 Analog_32_action *act;
 {
   NfetConst *NfetVar;
@@ -768,18 +765,18 @@ Analog_32_action *act;
   NfetVar->TauCgs = 0.0;
 }
 
-Local Void Probe_Nfet5(act)
+void Probe_Nfet5(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr;
   double Node1, Node2, Node3, Pin1, Pin2, Pin3, d1, d2;
-  Char Name2[256], Name3[256];
+  char Name2[256], Name3[256];
   log_grec *WITH;
-  Char STR1[18];
-  Char STR2[14];
-  Char STR3[256];
-  Char STR4[256];
+  char STR1[18];
+  char STR2[14];
+  char STR3[256];
+  char STR4[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -846,7 +843,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Void Log_NFET5_INITLIB_32(act)
+void Log_NFET5_INITLIB_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -854,63 +851,63 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_NFET5(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_NFET5(act);
     break;
 
-  case Analog_act_update:   /*8*/
+  case ANALOG_ACT_UPDATE:   /*8*/
     AnaCapUpdate(act->inst);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Nfet5(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     AnaCapReset(act->inst);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Nfet5(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Nfet5(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Nfet5(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Nfet5(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_NFET5(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Nfet5(act);
     break;
 
diff --git a/log/src/ana/nfet5.h b/log/src/ana/nfet5.h
index 65ced92..31645c8 100644
--- a/log/src/ana/nfet5.h
+++ b/log/src/ana/nfet5.h
@@ -1,57 +1,16 @@
-/* Header for module Nfet5, generated by p2c */
 #ifndef NFET5_H
 #define NFET5_H
 
 
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef NFET5_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_NFET5_INITLIB_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_NFET5_INITLIB_32 (Analog_32_action *act);
 
 #endif /*NFET5_H*/
 
diff --git a/log/src/ana/nfet7f.c b/log/src/ana/nfet7f.c
index afd1e7f..6cdddd7 100644
--- a/log/src/ana/nfet7f.c
+++ b/log/src/ana/nfet7f.c
@@ -26,9 +26,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-#define NFET7F_G
 #include "nfet7f.h"
 
 
@@ -90,7 +87,7 @@ typedef struct ICNfet {
 /****************************************************************************/
 
 
-Local boolean Nfetconsts(Inst)
+int Nfetconsts(Inst)
 log_grec *Inst;
 
 {
@@ -172,7 +169,7 @@ log_grec *Inst;
 /****************************************************************************/
 
 
-Local Void Ex_NFET7F(act)
+void Ex_NFET7F(act)
 Analog_32_action *act;
 {
   log_grec *WITH;
@@ -452,7 +449,7 @@ Analog_32_action *act;
 /*          Procedure To Supply Current  Out of a Cell To Current Meters    */
 /****************************************************************************/
 
-Local Void Iin_NFET7F(act)
+void Iin_NFET7F(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr, *Pin2Ptr, *Pin3Ptr, *Pin4Ptr;
@@ -629,14 +626,14 @@ Analog_32_action *act;
 }  /*Iin_NFET7F*/
 
 
-Local Void GetCnf_Nfet7F(NewIC)
+void GetCnf_Nfet7F(NewIC)
 ICNfet *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICNfet *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -716,7 +713,7 @@ ICNfet *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_NFET7F(act)
+void initlib_NFET7F(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -747,17 +744,17 @@ Analog_32_action *act;
   NewIC->InitMuOffset = 1.0;
   NewIC->InitQssOffset = 0.0;
   GetCnf_Nfet7F(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*NFET7F_Initlib*/
 
 
 
-Local boolean Nfetcheck(Inst, Attrnum)
+int Nfetcheck(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   NfetConst *NfetVar;
   Anainstlist *A_Gate;
 
@@ -853,7 +850,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_Nfet7F(act)
+void Attr_Nfet7F(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -876,7 +873,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Nfet7F(act)
+void Newgate_Nfet7F(act)
 Analog_32_action *act;
 {
   NfetConst *NfetVar;
@@ -891,7 +888,7 @@ Analog_32_action *act;
   NfetVar->TauCgd = 0.0;
   NfetVar->TauCgs = 0.0;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)NfetVar;
+  A_Gate->InstVar = (void *)NfetVar;
   AnaCapInit(act->inst);   /*6*/
   WITH = act->inst;
   WITH->attr[N_Wdrawn - 1].UU.r = ICptr->InitWdrawn;   /**/
@@ -927,7 +924,7 @@ Analog_32_action *act;
   Nfetconsts(WITH);
 }
 
-Local Void Copygate_Nfet7F(act)
+void Copygate_Nfet7F(act)
 Analog_32_action *act;
 {
   NfetConst *NfetVar, *Old_Nfetvar;
@@ -938,11 +935,11 @@ Analog_32_action *act;
   NfetVar = (NfetConst *)Malloc(sizeof(NfetConst));
   *NfetVar = *Old_Nfetvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)NfetVar;
+  A_Gate->InstVar = (void *)NfetVar;
   AnaCapCopy(act->inst);   /*6*/
 }
 
-Local Void Dispose_Nfet7F(act)
+void Dispose_Nfet7F(act)
 Analog_32_action *act;
 {
   NfetConst *NfetVar;
@@ -954,7 +951,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_Nfet7F(act)
+void Readgate_Nfet7F(act)
 Analog_32_action *act;
 {
   NfetConst *NfetVar;
@@ -1007,18 +1004,18 @@ Analog_32_action *act;
   NfetVar->TauCgs = 0.0;
 }
 
-Local Void Probe_Nfet7F(act)
+void Probe_Nfet7F(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr, *Node4Ptr;
   double Node1, Node2, Node3, Node4, Pin1, Pin2, Pin3, Pin4, d1, d2;
-  Char Name2[256], Name3[256];
+  char Name2[256], Name3[256];
   log_grec *WITH;
-  Char STR1[18];
-  Char STR2[14];
-  Char STR3[256];
-  Char STR4[256];
+  char STR1[18];
+  char STR2[14];
+  char STR3[256];
+  char STR4[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -1088,7 +1085,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Update_Nfet7F(act)
+void Update_Nfet7F(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
@@ -1113,7 +1110,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Void Log_NFET7F_INITLIB_32(act)
+void Log_NFET7F_INITLIB_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -1121,63 +1118,63 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_NFET7F(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_NFET7F(act);
     break;
 
-  case Analog_act_update:   /*8*/
+  case ANALOG_ACT_UPDATE:   /*8*/
     Update_Nfet7F(act);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Nfet7F(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     AnaCapReset(act->inst);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Nfet7F(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Nfet7F(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Nfet7F(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Nfet7F(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_NFET7F(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Nfet7F(act);
     break;
 
diff --git a/log/src/ana/nfet7f.h b/log/src/ana/nfet7f.h
index ec09aaa..867e363 100644
--- a/log/src/ana/nfet7f.h
+++ b/log/src/ana/nfet7f.h
@@ -1,57 +1,15 @@
-/* Header for module Nfet7F, generated by p2c */
 #ifndef NFET7F_H
 #define NFET7F_H
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef NFET7F_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_NFET7F_INITLIB_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_NFET7F_INITLIB_32 (Analog_32_action *act);
 
 #endif /*NFET7F_H*/
 
diff --git a/log/src/ana/nfet7t.c b/log/src/ana/nfet7t.c
index 7c4b306..2540951 100644
--- a/log/src/ana/nfet7t.c
+++ b/log/src/ana/nfet7t.c
@@ -26,9 +26,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-#define NFET7T_G
 #include "nfet7t.h"
 
 
@@ -90,7 +87,7 @@ typedef struct ICNfet {
 /****************************************************************************/
 
 
-Local boolean Nfetconsts(Inst)
+int Nfetconsts(Inst)
 log_grec *Inst;
 
 {
@@ -172,7 +169,7 @@ log_grec *Inst;
 /****************************************************************************/
 
 
-Local Void Ex_NFET7T(act)
+void Ex_NFET7T(act)
 Analog_32_action *act;
 {
   log_grec *WITH;
@@ -410,7 +407,7 @@ Analog_32_action *act;
 /*          Procedure To Supply Current  Out of a Cell To Current Meters    */
 /****************************************************************************/
 
-Local Void Iin_NFET7T(act)
+void Iin_NFET7T(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr, *Pin2Ptr, *Pin3Ptr;
@@ -562,14 +559,14 @@ Analog_32_action *act;
 }  /*Iin_NFET7T*/
 
 
-Local Void GetCnf_Nfet7T(NewIC)
+void GetCnf_Nfet7T(NewIC)
 ICNfet *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICNfet *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -640,7 +637,7 @@ ICNfet *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_NFET7T(act)
+void initlib_NFET7T(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -668,16 +665,16 @@ Analog_32_action *act;
   NewIC->InitMuOffset = 1.0;
   NewIC->InitQssOffset = 0;
   GetCnf_Nfet7T(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*NFET7T_Initlib*/
 
 
-Local boolean Nfetcheck(Inst, Attrnum)
+int Nfetcheck(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   NfetConst *NfetVar;
   Anainstlist *A_Gate;
 
@@ -767,7 +764,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_Nfet7T(act)
+void Attr_Nfet7T(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -790,7 +787,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Nfet7T(act)
+void Newgate_Nfet7T(act)
 Analog_32_action *act;
 {
   NfetConst *NfetVar;
@@ -805,7 +802,7 @@ Analog_32_action *act;
   NfetVar->TauCgd = 0.0;
   NfetVar->TauCgs = 0.0;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)NfetVar;
+  A_Gate->InstVar = (void *)NfetVar;
   AnaCapInit(act->inst);   /*6*/
   WITH = act->inst;
   WITH->attr[N_Wdrawn - 1].UU.r = ICptr->InitWdrawn;   /**/
@@ -841,7 +838,7 @@ Analog_32_action *act;
   Nfetconsts(WITH);
 }
 
-Local Void Copygate_Nfet7T(act)
+void Copygate_Nfet7T(act)
 Analog_32_action *act;
 {
   NfetConst *NfetVar, *Old_Nfetvar;
@@ -852,11 +849,11 @@ Analog_32_action *act;
   NfetVar = (NfetConst *)Malloc(sizeof(NfetConst));
   *NfetVar = *Old_Nfetvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)NfetVar;
+  A_Gate->InstVar = (void *)NfetVar;
   AnaCapCopy(act->inst);   /*6*/
 }
 
-Local Void Dispose_Nfet7T(act)
+void Dispose_Nfet7T(act)
 Analog_32_action *act;
 {
   NfetConst *NfetVar;
@@ -868,7 +865,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_Nfet7T(act)
+void Readgate_Nfet7T(act)
 Analog_32_action *act;
 {
   NfetConst *NfetVar;
@@ -921,18 +918,18 @@ Analog_32_action *act;
   NfetVar->TauCgs = 0.0;
 }
 
-Local Void Probe_Nfet7T(act)
+void Probe_Nfet7T(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr;
   double Node1, Node2, Node3, Pin1, Pin2, Pin3, d1, d2;
-  Char Name2[256], Name3[256];
+  char Name2[256], Name3[256];
   log_grec *WITH;
-  Char STR1[18];
-  Char STR2[14];
-  Char STR3[256];
-  Char STR4[256];
+  char STR1[18];
+  char STR2[14];
+  char STR3[256];
+  char STR4[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -992,7 +989,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Update_Nfet7T(act)
+void Update_Nfet7T(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
@@ -1020,7 +1017,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Void Log_NFET7T_INITLIB_32(act)
+void Log_NFET7T_INITLIB_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -1028,63 +1025,63 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_NFET7T(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_NFET7T(act);
     break;
 
-  case Analog_act_update:   /*8*/
+  case ANALOG_ACT_UPDATE:   /*8*/
     Update_Nfet7T(act);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Nfet7T(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     AnaCapReset(act->inst);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Nfet7T(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Nfet7T(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Nfet7T(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Nfet7T(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_NFET7T(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Nfet7T(act);
     break;
 
diff --git a/log/src/ana/nfet7t.h b/log/src/ana/nfet7t.h
index b37bf7f..265f952 100644
--- a/log/src/ana/nfet7t.h
+++ b/log/src/ana/nfet7t.h
@@ -1,57 +1,15 @@
-/* Header for module Nfet7T, generated by p2c */
 #ifndef NFET7T_H
 #define NFET7T_H
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef NFET7T_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_NFET7T_INITLIB_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_NFET7T_INITLIB_32 (Analog_32_action *act);
 
 #endif /*NFET7T_H*/
 
diff --git a/log/src/ana/npn1.c b/log/src/ana/npn1.c
index 7b444ef..5800d8c 100644
--- a/log/src/ana/npn1.c
+++ b/log/src/ana/npn1.c
@@ -27,9 +27,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-#define NPN1_G
 #include "npn1.h"
 
 
@@ -48,8 +45,8 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 typedef struct NPN1Const {
   double betaF, betaR;   /*Transistor Parameters*/
   double For1, For2, R1, R2, Is, IECO, ICEO, lam;
-  boolean Limit;   /*Booleans for indicator light*/
-  boolean OldLimit, NewLimit;
+  int Limit;   /*ints for indicator light*/
+  int OldLimit, NewLimit;
   double TauCbc;   /*Taus for capacitors*/
   double TauCbe;   /*Tau for capacitor*/
 } NPN1Const;
@@ -66,9 +63,9 @@ typedef struct ICNPN1 {
 /****************************************************************************/
 
 
-Local Void Limitfill(Inst, Limitflag, Erase)
+void Limitfill(Inst, Limitflag, Erase)
 log_grec *Inst;
-boolean Limitflag, Erase;
+int Limitflag, Erase;
 {
   short LLx, LLy, URx, URy;
 
@@ -110,7 +107,7 @@ boolean Limitflag, Erase;
 
 
 
-Local Void Ex_NPN1(act)
+void Ex_NPN1(act)
 Analog_32_action *act;
 {
   double MinI1, MinI2, MinI3, dI1dV1, dI1dV2, dI1dV3, dI2dV1, dI2dV2, dI2dV3,
@@ -282,7 +279,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Iin_NPN1(act)
+void Iin_NPN1(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr;
@@ -394,14 +391,14 @@ Analog_32_action *act;
   }
 }  /*Iin_NPN1*/
 
-Local Void GetCnf_NPN1(NewIC)
+void GetCnf_NPN1(NewIC)
 ICNPN1 *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICNPN1 *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -497,7 +494,7 @@ ICNPN1 *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_NPN1(act)
+void initlib_NPN1(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -527,8 +524,8 @@ Analog_32_action *act;
   NewIC->InitCdb = 10e-15;
   NewIC->InitCsb = 10e-15;
   GetCnf_NPN1(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*NPN1_Initlib*/
 
 #define MAKE_ICEO(n)	((n)->ICEO=(n)->Is/(n)->betaR)
@@ -538,11 +535,11 @@ Analog_32_action *act;
    #define MAKE_IECO(n)	((n)->IECO=(n)->Is*(n)->betaR/((n)->betaR+(n)->betaF))
 */
 
-Local boolean NPN1check(Inst, Attrnum)
+int NPN1check(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   NPN1Const *NPN1Var;
   Anainstlist *A_Gate;
 
@@ -639,7 +636,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_NPN1(act)
+void Attr_NPN1(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -657,7 +654,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_NPN1(act)
+void Newgate_NPN1(act)
 Analog_32_action *act;
 {
   NPN1Const *NPN1Var;
@@ -687,7 +684,7 @@ Analog_32_action *act;
   NPN1Var->TauCbc = 0.0;
   NPN1Var->TauCbe = 0.0;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)NPN1Var;
+  A_Gate->InstVar = (void *)NPN1Var;
   AnaCapInit(act->inst);
   A_Gate->Pininfo[0].Cap = ICptr->InitCgb;
   A_Gate->Pininfo[1].Cap = ICptr->InitCdb;
@@ -716,7 +713,7 @@ Analog_32_action *act;
   WITH->attr[N_Vcrow - 1].changed = true;
 }
 
-Local Void Copygate_NPN1(act)
+void Copygate_NPN1(act)
 Analog_32_action *act;
 {
   NPN1Const *NPN1Var, *Old_NPN1var;
@@ -728,12 +725,12 @@ Analog_32_action *act;
   NPN1Var = (NPN1Const *)Malloc(sizeof(NPN1Const));
   *NPN1Var = *Old_NPN1var;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)NPN1Var;
+  A_Gate->InstVar = (void *)NPN1Var;
   /*Always Do*/
   AnaCapCopy(act->inst);
 }
 
-Local Void Dispose_NPN1(act)
+void Dispose_NPN1(act)
 Analog_32_action *act;
 {
   NPN1Const *NPN1Var;
@@ -745,7 +742,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_Npn1(act)
+void Readgate_Npn1(act)
 Analog_32_action *act;
 {
   NPN1Const *Npn1Var;
@@ -805,18 +802,18 @@ Analog_32_action *act;
   Npn1Var->TauCbe = 0.0;
 }
 
-Local Void Probe_Npn1(act)
+void Probe_Npn1(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr;
   double Node1, Node2, Node3, Pin1, Pin2, Pin3, d1, d2;
   log_grec *WITH;
-  Char STR1[18];
-  Char STR2[12];
-  Char STR3[16];
-  Char STR4[256];
-  Char STR5[256];
+  char STR1[18];
+  char STR2[12];
+  char STR3[16];
+  char STR4[256];
+  char STR5[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -871,7 +868,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Reset_NPN1(act)
+void Reset_NPN1(act)
 Analog_32_action *act;
 {
   NPN1Const *NPN1Var;
@@ -887,7 +884,7 @@ Analog_32_action *act;
     Limitfill(act->inst, NPN1Var->Limit, false);
 }
 
-Local Void PreUpdate_NPN1(act)
+void PreUpdate_NPN1(act)
 Analog_32_action *act;
 {
   NPN1Const *NPN1Var;
@@ -909,7 +906,7 @@ Analog_32_action *act;
 		       VPin1 - Vpin2 >= WITH1->attr[N_Vcrow - 1].UU.r);
 }
 
-Local Void Update_NPN1(act)
+void Update_NPN1(act)
 Analog_32_action *act;
 {
   NPN1Const *NPN1Var;
@@ -922,7 +919,7 @@ Analog_32_action *act;
   NPN1Var->Limit = NPN1Var->NewLimit;
 }
 
-Local Void Display_NPN1(act)
+void Display_NPN1(act)
 Analog_32_action *act;
 {
   NPN1Const *NPN1Var;
@@ -939,7 +936,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Refresh_NPN1(act)
+void Refresh_NPN1(act)
 Analog_32_action *act;
 {
   NPN1Const *NPN1Var;
@@ -950,7 +947,7 @@ Analog_32_action *act;
   Limitfill(act->inst, NPN1Var->Limit, false);
 }
 
-Local Void Erase_NPN1(act)
+void Erase_NPN1(act)
 Analog_32_action *act;
 {
   NPN1Const *NPN1Var;
@@ -967,7 +964,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Void Log_NPN1_INITLIB_32(act)
+void Log_NPN1_INITLIB_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -975,79 +972,79 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_NPN1(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_NPN1(act);
     break;
 
-  case Analog_act_preupdate:
+  case ANALOG_ACT_PREUPDATE:
     PreUpdate_NPN1(act);
     break;
 
-  case Analog_act_update:
+  case ANALOG_ACT_UPDATE:
     Update_NPN1(act);
     break;
 
-  case Analog_act_display:
+  case ANALOG_ACT_DISPLAY:
     Display_NPN1(act);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_NPN1(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     Reset_NPN1(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_NPN1(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_NPN1(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_NPN1(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Npn1(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_NPN1(act);
     break;
 
-  case Analog_act_erase:
+  case ANALOG_ACT_ERASE:
     Erase_NPN1(act);
     break;
 
-  case Analog_act_refresh:
+  case ANALOG_ACT_REFRESH:
     Refresh_NPN1(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Npn1(act);
     break;
 
diff --git a/log/src/ana/npn1.h b/log/src/ana/npn1.h
index 8e15132..1bf6a9f 100644
--- a/log/src/ana/npn1.h
+++ b/log/src/ana/npn1.h
@@ -1,54 +1,15 @@
-/* Header for module NPN1, generated by p2c */
 #ifndef NPN1_H
 #define NPN1_H
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef NPN1_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-/*$If Float$
-  $float_hdw on$
-  $End$*/
-
-
-
-extern Void Log_NPN1_INITLIB_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_NPN1_INITLIB_32 (Analog_32_action *act);
 
 #endif /*NPN1_H*/
 
diff --git a/log/src/ana/npn2.c b/log/src/ana/npn2.c
index 59702e8..8e7da25 100644
--- a/log/src/ana/npn2.c
+++ b/log/src/ana/npn2.c
@@ -23,13 +23,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /* Output from p2c, the Pascal-to-C translator */
 /* From input file "scott.text" */
 
-
-
-
 #include <p2c/p2c.h>
-
-
-#define NPN2_G
 #include "npn2.h"
 
 
@@ -50,8 +44,8 @@ typedef struct NPN2Const {
   double betaF, betaR;   /*Transistor Parameters*/
   double For1, For2, R1, R2, Is, IECO, ICEO, lam;
   double Va;		/*Early voltage (Tim 4/6/98) */
-  boolean Limit;   /*Booleans for indicator light*/
-  boolean OldLimit, NewLimit;
+  int Limit;   /*ints for indicator light*/
+  int OldLimit, NewLimit;
   double TauCbc;   /*Taus for capacitors*/
   double TauCbe;   /*Tau for capacitor*/
 } NPN2Const;
@@ -68,9 +62,9 @@ typedef struct ICNPN2 {
 /****************************************************************************/
 
 
-Local Void Limitfill(Inst, Limitflag, Erase)
+void Limitfill(Inst, Limitflag, Erase)
 log_grec *Inst;
-boolean Limitflag, Erase;
+int Limitflag, Erase;
 {
   short LLx, LLy, URx, URy;
 
@@ -121,7 +115,7 @@ boolean Limitflag, Erase;
 
 
 
-Local Void Ex_NPN2(act)
+void Ex_NPN2(act)
 Analog_32_action *act;
 {
   double MinI1, MinI2, MinI3, dI1dV1, dI1dV2, dI1dV3, dI2dV1, dI2dV2, dI2dV3,
@@ -296,7 +290,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Iin_NPN2(act)
+void Iin_NPN2(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr;
@@ -411,14 +405,14 @@ Analog_32_action *act;
   }
 }  /*Iin_NPN2*/
 
-Local Void GetCnf_NPN2(NewIC)
+void GetCnf_NPN2(NewIC)
 ICNPN2 *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICNPN2 *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -522,7 +516,7 @@ ICNPN2 *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_NPN2(act)
+void initlib_NPN2(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -553,8 +547,8 @@ Analog_32_action *act;
   NewIC->InitCdb = 10e-15;
   NewIC->InitCsb = 10e-15;
   GetCnf_NPN2(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*NPN2_Initlib*/
 
 
@@ -562,11 +556,11 @@ Analog_32_action *act;
 #define MAKE_IECO(n)	((n)->IECO=(n)->Is/(n)->betaR)
 
 
-Local boolean NPN2check(Inst, Attrnum)
+int NPN2check(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   NPN2Const *NPN2Var;
   Anainstlist *A_Gate;
 
@@ -670,7 +664,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_NPN2(act)
+void Attr_NPN2(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -688,7 +682,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_NPN2(act)
+void Newgate_NPN2(act)
 Analog_32_action *act;
 {
   NPN2Const *NPN2Var;
@@ -719,7 +713,7 @@ Analog_32_action *act;
   NPN2Var->TauCbc = 0.0;
   NPN2Var->TauCbe = 0.0;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)NPN2Var;
+  A_Gate->InstVar = (void *)NPN2Var;
   AnaCapInit(act->inst);
   A_Gate->Pininfo[0].Cap = ICptr->InitCgb;
   A_Gate->Pininfo[1].Cap = ICptr->InitCdb;
@@ -751,7 +745,7 @@ Analog_32_action *act;
   WITH->attr[N_Vcrow - 1].changed = true;
 }
 
-Local Void Copygate_NPN2(act)
+void Copygate_NPN2(act)
 Analog_32_action *act;
 {
   NPN2Const *NPN2Var, *Old_NPN2var;
@@ -763,12 +757,12 @@ Analog_32_action *act;
   NPN2Var = (NPN2Const *)Malloc(sizeof(NPN2Const));
   *NPN2Var = *Old_NPN2var;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)NPN2Var;
+  A_Gate->InstVar = (void *)NPN2Var;
   /*Always Do*/
   AnaCapCopy(act->inst);
 }
 
-Local Void Dispose_NPN2(act)
+void Dispose_NPN2(act)
 Analog_32_action *act;
 {
   NPN2Const *NPN2Var;
@@ -780,7 +774,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_Npn2(act)
+void Readgate_Npn2(act)
 Analog_32_action *act;
 {
   NPN2Const *Npn2Var;
@@ -844,18 +838,18 @@ Analog_32_action *act;
   Npn2Var->TauCbe = 0.0;
 }
 
-Local Void Probe_Npn2(act)
+void Probe_Npn2(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr;
   double Node1, Node2, Node3, Pin1, Pin2, Pin3, d1, d2;
   log_grec *WITH;
-  Char STR1[18];
-  Char STR2[12];
-  Char STR3[16];
-  Char STR4[256];
-  Char STR5[256];
+  char STR1[18];
+  char STR2[12];
+  char STR3[16];
+  char STR4[256];
+  char STR5[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -910,7 +904,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Reset_NPN2(act)
+void Reset_NPN2(act)
 Analog_32_action *act;
 {
   NPN2Const *NPN2Var;
@@ -926,7 +920,7 @@ Analog_32_action *act;
     Limitfill(act->inst, NPN2Var->Limit, false);
 }
 
-Local Void PreUpdate_NPN2(act)
+void PreUpdate_NPN2(act)
 Analog_32_action *act;
 {
   NPN2Const *NPN2Var;
@@ -948,7 +942,7 @@ Analog_32_action *act;
 		       VPin1 - Vpin2 >= WITH1->attr[N_Vcrow - 1].UU.r);
 }
 
-Local Void Update_NPN2(act)
+void Update_NPN2(act)
 Analog_32_action *act;
 {
   NPN2Const *NPN2Var;
@@ -961,7 +955,7 @@ Analog_32_action *act;
   NPN2Var->Limit = NPN2Var->NewLimit;
 }
 
-Local Void Display_NPN2(act)
+void Display_NPN2(act)
 Analog_32_action *act;
 {
   NPN2Const *NPN2Var;
@@ -978,7 +972,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Refresh_NPN2(act)
+void Refresh_NPN2(act)
 Analog_32_action *act;
 {
   NPN2Const *NPN2Var;
@@ -989,7 +983,7 @@ Analog_32_action *act;
   Limitfill(act->inst, NPN2Var->Limit, false);
 }
 
-Local Void Erase_NPN2(act)
+void Erase_NPN2(act)
 Analog_32_action *act;
 {
   NPN2Const *NPN2Var;
@@ -1006,7 +1000,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Void Log_NPN2_INITLIB_32(act)
+void Log_NPN2_INITLIB_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -1014,79 +1008,79 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_NPN2(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_NPN2(act);
     break;
 
-  case Analog_act_preupdate:
+  case ANALOG_ACT_PREUPDATE:
     PreUpdate_NPN2(act);
     break;
 
-  case Analog_act_update:
+  case ANALOG_ACT_UPDATE:
     Update_NPN2(act);
     break;
 
-  case Analog_act_display:
+  case ANALOG_ACT_DISPLAY:
     Display_NPN2(act);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_NPN2(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     Reset_NPN2(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_NPN2(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_NPN2(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_NPN2(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Npn2(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_NPN2(act);
     break;
 
-  case Analog_act_erase:
+  case ANALOG_ACT_ERASE:
     Erase_NPN2(act);
     break;
 
-  case Analog_act_refresh:
+  case ANALOG_ACT_REFRESH:
     Refresh_NPN2(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Npn2(act);
     break;
 
diff --git a/log/src/ana/npn2.h b/log/src/ana/npn2.h
index ac22add..d910349 100644
--- a/log/src/ana/npn2.h
+++ b/log/src/ana/npn2.h
@@ -1,54 +1,15 @@
-/* Header for module NPN2, generated by p2c */
 #ifndef NPN2_H
 #define NPN2_H
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef NPN2_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-/*$If Float$
-  $float_hdw on$
-  $End$*/
-
-
-
-extern Void Log_NPN2_INITLIB_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_NPN2_INITLIB_32 (Analog_32_action *act);
 
 #endif /*NPN2_H*/
 
diff --git a/log/src/ana/nsolver.c b/log/src/ana/nsolver.c
index 03d78a8..7a7c33f 100644
--- a/log/src/ana/nsolver.c
+++ b/log/src/ana/nsolver.c
@@ -69,7 +69,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 #include <p2c/p2c.h>
 
 
-#define NSOLVER_G
 #include "nsolver.h"
 
 
@@ -82,12 +81,11 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 If no row >= col has a non-zero col value, then the system is
   insolvable and Abort:=True.*/
 
-Static Void BestRow(Col)
-long Col;
+void BestRow(long Col)
 {
   long I, Gr_index;
   double Greatest, Temp;
-  boolean BTemp;
+  int BTemp;
   AnaMatRec *WITH;
   long FORLIM;
 
@@ -127,7 +125,7 @@ long Col;
 
 /********************************************************************************/
 
-Void Solve()
+void Solve()
 {
 
   /********************************************************************************/
@@ -251,7 +249,4 @@ Void Solve()
     AnaEpoch = AnaE_Calculate;
 }
 
-
-
-
 /* End. */
diff --git a/log/src/ana/nsolver.h b/log/src/ana/nsolver.h
index 6d28d80..85e5c02 100644
--- a/log/src/ana/nsolver.h
+++ b/log/src/ana/nsolver.h
@@ -1,40 +1,11 @@
-/* Header for module NSolver, generated by p2c */
 #ifndef NSOLVER_H
 #define NSOLVER_H
 
 
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifdef NSOLVER_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-/*$If Float$
- $float_hdw on$
- $End$*/
-/*$If Debugflag$
- $Debug$
- $End$*/
-
-
-
-
-
-
-extern Void Solve PV();
-
 
-#undef vextern
+void Solve ();
 
 #endif /*NSOLVER_H*/
 
diff --git a/log/src/ana/nspc1.c b/log/src/ana/nspc1.c
index 8e999c0..ebfe4d9 100644
--- a/log/src/ana/nspc1.c
+++ b/log/src/ana/nspc1.c
@@ -41,11 +41,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /* From input file "swiss.text" */
 
 
-
 #include <p2c/p2c.h>
-
-
-#define NSPC1_G
 #include "nspc1.h"
 
 
@@ -88,9 +84,9 @@ typedef struct ICNfet {
 } ICNfet;
 
 
-Local Void Show_W_L(Inst,erase)
+void Show_W_L(Inst,erase)
 log_grec *Inst;
-boolean erase;
+int erase;
 {
   short Lx, Ly, Wx, Wy;
   void drawnum3();
@@ -197,10 +193,10 @@ boolean erase;
 }
 
 
-Void drawnum3(x, y, n)
+void drawnum3(x, y, n)
 short x, y, n;
 {
-  Char s[4];
+  char s[4];
 
   m_move((long)x, (long)y);
   strcpy(s, "   ");
@@ -220,7 +216,7 @@ short x, y, n;
 /****************************************************************************/
 
 
-Local Void Ex_NSPC1(act)
+void Ex_NSPC1(act)
 Analog_32_action *act;
 {
   double MinI2, dI2dV1, dI2dV2, dI2dV3, dI2dV4, 
@@ -436,7 +432,7 @@ Analog_32_action *act;
 /*          Procedure To Supply Current  Out of a Cell To Current Meters    */
 /****************************************************************************/
 
-Local Void Iin_NSPC1(act)
+void Iin_NSPC1(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr, *Pin2Ptr, *Pin3Ptr, *Pin4Ptr;
@@ -564,14 +560,14 @@ Analog_32_action *act;
 }  /*Iin_NSPC1*/
 
 
-Local Void GetCnf_Nspc1(NewIC)
+void GetCnf_Nspc1(NewIC)
 ICNfet *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICNfet *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -708,7 +704,7 @@ ICNfet *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_NSPC1(act)
+void initlib_NSPC1(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -744,16 +740,16 @@ Analog_32_action *act;
   NewIC->InitL = 4.0;
   NewIC->InitNumber = 1;
   GetCnf_Nspc1(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*NSPC1_Initlib*/
 
 
-Local boolean Nfetcheck(Inst, Attrnum)
+int Nfetcheck(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   NfetConst *NfetVar;
   Anainstlist *A_Gate;
 
@@ -889,7 +885,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_Nspc1(act)
+void Attr_Nspc1(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -912,7 +908,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Nspc1(act)
+void Newgate_Nspc1(act)
 Analog_32_action *act;
 {
   NfetConst *NfetVar;
@@ -944,7 +940,7 @@ Analog_32_action *act;
   NfetVar->TauCgd = 0.0;
   NfetVar->TauCgs = 0.0;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)NfetVar;
+  A_Gate->InstVar = (void *)NfetVar;
   AnaCapInit(act->inst);   /*6*/
   A_Gate->Pininfo[0].Cap = ICptr->InitCgb;
   A_Gate->Pininfo[1].Cap = ICptr->InitCdb;
@@ -986,7 +982,7 @@ Analog_32_action *act;
   WITH->attr[N_Number - 1].changed = true;
 }
 
-Local Void Copygate_Nspc1(act)
+void Copygate_Nspc1(act)
 Analog_32_action *act;
 {
   NfetConst *NfetVar, *Old_Nfetvar;
@@ -997,11 +993,11 @@ Analog_32_action *act;
   NfetVar = (NfetConst *)Malloc(sizeof(NfetConst));
   *NfetVar = *Old_Nfetvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)NfetVar;
+  A_Gate->InstVar = (void *)NfetVar;
   AnaCapCopy(act->inst);   /*6*/
 }
 
-Local Void Dispose_Nspc1(act)
+void Dispose_Nspc1(act)
 Analog_32_action *act;
 {
   NfetConst *NfetVar;
@@ -1013,7 +1009,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_Nspc1(act)
+void Readgate_Nspc1(act)
 Analog_32_action *act;
 {
   NfetConst *NfetVar;
@@ -1095,18 +1091,18 @@ Analog_32_action *act;
   NfetVar->TauCgs = 0.0;
 }
 
-Local Void Probe_Nspc1(act)
+void Probe_Nspc1(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr, *Node4Ptr;
   double Node1, Node2, Node3, Node4, Pin1, Pin2, Pin3, Pin4, d1, d2;
-  Char Name2[256], Name3[256];
+  char Name2[256], Name3[256];
   log_grec *WITH;
-  Char STR1[25];
-  Char STR2[14];
-  Char STR3[256];
-  Char STR4[256];
+  char STR1[25];
+  char STR2[14];
+  char STR3[256];
+  char STR4[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -1185,7 +1181,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Void Log_NSPC1_INITLIB_32(act)
+void Log_NSPC1_INITLIB_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -1193,76 +1189,76 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_NSPC1(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_NSPC1(act);
     break;
 
-  case Analog_act_update:   /*8*/
+  case ANALOG_ACT_UPDATE:   /*8*/
     AnaCapUpdate(act->inst);
     break;
 
-  case Analog_act_display:
+  case ANALOG_ACT_DISPLAY:
     if (AnaLogglobals->showpage == act->page)
       Show_W_L(act->inst, false);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);    
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Nspc1(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     AnaCapReset(act->inst);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Nspc1(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Nspc1(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Nspc1(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Nspc1(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_NSPC1(act);
     break;
 
-  case Analog_act_erase:
+  case ANALOG_ACT_ERASE:
     Show_W_L(act->inst, true);
     break;
 
-  case Analog_act_refresh:
+  case ANALOG_ACT_REFRESH:
     Show_W_L(act->inst, false);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Nspc1(act);
     break;
 
diff --git a/log/src/ana/nspc1.h b/log/src/ana/nspc1.h
index 14a63b0..6b531c8 100644
--- a/log/src/ana/nspc1.h
+++ b/log/src/ana/nspc1.h
@@ -1,57 +1,15 @@
-/* edited by Bhusan to add fourth terminal and spice output */
 #ifndef NSPC1_H
 #define NSPC1_H
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef NSPC1_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_NSPC1_INITLIB_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_NSPC1_INITLIB_32 (Analog_32_action *act);
 
 #endif /*NFET7_H*/
 
diff --git a/log/src/ana/numbers.c b/log/src/ana/numbers.c
index a54c3a2..0d2f251 100644
--- a/log/src/ana/numbers.c
+++ b/log/src/ana/numbers.c
@@ -26,9 +26,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-#define NUMBERS_G
 #include "numbers.h"
 
 
@@ -44,18 +41,16 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 #define GateName        "anaLOG status"
 
 
-
-
 typedef struct NumbersConst {
-  Char OldMessScoreboard[256], OldMessNode[256], OldMessGate1[256],
+  char OldMessScoreboard[256], OldMessNode[256], OldMessGate1[256],
        OldMessGate2[256], OldMessGate3[256], OldMessGate4[256],
        OldMessGate5[256];
-  boolean OldErase, OldExact, OldProbeOn;
+  int OldErase, OldExact, OldProbeOn;
 } NumbersConst;
 
 
 typedef struct ICNumbers {
-  Char InitMessScoreboard[256], InitMessNode[256], InitMessGate1[256],
+  char InitMessScoreboard[256], InitMessNode[256], InitMessGate1[256],
        InitMessGate2[256], InitMessGate3[256], InitMessGate4[256],
        InitMessGate5[256];
 } ICNumbers;
@@ -66,11 +61,11 @@ typedef struct ICNumbers {
 /****************************************************************************/
 
 
-Local Void GetCnf_Numbers(NewIC)
+void GetCnf_Numbers(NewIC)
 ICNumbers *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   ICNumbers *WITH;
 
   WITH = NewIC;
@@ -90,7 +85,7 @@ ICNumbers *NewIC;
   } while (Found);
 }
 
-Local Void initlib_NUMBERS(act)
+void initlib_NUMBERS(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -111,15 +106,15 @@ Analog_32_action *act;
   strcpy(NewIC->InitMessGate4, "  ");
   strcpy(NewIC->InitMessGate5, "  ");
   GetCnf_Numbers(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
   act->kind->x1 = -60;
   act->kind->x2 = 60;
   act->kind->y1 = -20;
   act->kind->y2 = 35;
 }  /*NFET4_Initlib*/
 
-Local Void Attr_Numbers(act)
+void Attr_Numbers(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -274,7 +269,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Openconfig_Numbers(act)
+void Openconfig_Numbers(act)
 Analog_32_action *act;
 {
   long Index;
@@ -305,11 +300,11 @@ Analog_32_action *act;
   }
 }
 
-Local Void Readgate_Numbers(act)
+void Readgate_Numbers(act)
 Analog_32_action *act;
 {
   log_grec *WITH;
-  Char STR1[256];
+  char STR1[256];
 
   WITH = act->inst;
   if (AnaOldmodel && !WITH->attr[0].blnk) {
@@ -341,7 +336,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Writegate_Numbers(act)
+void Writegate_Numbers(act)
 Analog_32_action *act;
 {
   fprintf(*AnaLogglobals->actfile, "%s\n", AnaErase ? " TRUE" : "FALSE");
@@ -350,7 +345,7 @@ Analog_32_action *act;
 
 
 
-Local Void Message_Numbers(act)
+void Message_Numbers(act)
 Analog_32_action *act;
 {
   short Tx, Ty;
@@ -358,7 +353,7 @@ Analog_32_action *act;
   Anainstlist *A_Gate;
   AnaCell_rec *Cellptr;
   ICNumbers *ICptr;
-  boolean Draw;
+  int Draw;
   NumbersConst *WITH;
 
   Draw = true;
@@ -705,7 +700,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Refresh_Numbers(act)
+void Refresh_Numbers(act)
 Analog_32_action *act;
 {
   short Tx, Ty;
@@ -809,7 +804,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Erase_Numbers(act)
+void Erase_Numbers(act)
 Analog_32_action *act;
 {
   short Tx, Ty;
@@ -891,7 +886,7 @@ Analog_32_action *act;
 
 
 
-Local Void Newgate_Numbers(act)
+void Newgate_Numbers(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
@@ -914,13 +909,13 @@ Analog_32_action *act;
   NumbersVar->OldExact = AnaExact;
   NumbersVar->OldProbeOn = AnaProbeOn;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)NumbersVar;
+  A_Gate->InstVar = (void *)NumbersVar;
   Newact.inst = act->inst;
   Newact.ok = true;
   Openconfig_Numbers(&Newact);
 }
 
-Local Void Copygate_Numbers(act)
+void Copygate_Numbers(act)
 Analog_32_action *act;
 {
   NumbersConst *NumbersVar, *Old_NumbersVar;
@@ -932,10 +927,10 @@ Analog_32_action *act;
   NumbersVar = (NumbersConst *)Malloc(sizeof(NumbersConst));
   *NumbersVar = *Old_NumbersVar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)NumbersVar;
+  A_Gate->InstVar = (void *)NumbersVar;
 }
 
-Local Void Dispose_Numbers(act)
+void Dispose_Numbers(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
@@ -947,7 +942,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Touch_Numbers(act)
+void Touch_Numbers(act)
 Analog_32_action *act;
 {
   log_action *WITH;
@@ -985,11 +980,11 @@ Analog_32_action *act;
 
 
 
-Local Void Probe_Numbers(act)
+void Probe_Numbers(act)
 Analog_32_action *act;
 {
-  Char dtstr[256];
-  Char STR2[256];
+  char dtstr[256];
+  char STR2[256];
 
   AnaScoreboard(GateName, (long)AnaMessGate1);
   if (AnaChanged) {
@@ -1082,7 +1077,7 @@ Analog_32_action *act;
 /*                 Library Listing For Cell Numbers                    */
 /*==========================================================================*/
 
-Void Log_numbers_initlib_32(act)
+void Log_numbers_initlib_32(act)
 Analog_32_action *act;
 {
   /*Body of procedure*/
@@ -1090,55 +1085,55 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_NUMBERS(act);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Numbers(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     Openconfig_Numbers(act);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Numbers(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     Writegate_Numbers(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Numbers(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Numbers(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Numbers(act);
     break;
 
-  case Analog_act_message:
+  case ANALOG_ACT_MESSAGE:
     Message_Numbers(act);
     break;
 
-  case Analog_act_erase:
+  case ANALOG_ACT_ERASE:
     Erase_Numbers(act);
     break;
 
-  case Analog_act_refresh:
+  case ANALOG_ACT_REFRESH:
     Refresh_Numbers(act);
     break;
 
-  case Analog_act_touch:
+  case ANALOG_ACT_TOUCH:
     Touch_Numbers(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Numbers(act);
     break;
 
diff --git a/log/src/ana/numbers.h b/log/src/ana/numbers.h
index afb05f1..e3062ad 100644
--- a/log/src/ana/numbers.h
+++ b/log/src/ana/numbers.h
@@ -1,58 +1,17 @@
-/* Header for module Numbers, generated by p2c */
 #ifndef NUMBERS_H
 #define NUMBERS_H
 
-
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef NUMBERS_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
 
-extern Void Log_numbers_initlib_32 PP((Analog_32_action *act));
 
+extern void Log_numbers_initlib_32 (Analog_32_action *act);
 
-#undef vextern
 
 #endif /*NUMBERS_H*/
 
diff --git a/log/src/ana/pfet4.c b/log/src/ana/pfet4.c
index 3bc0f24..0d524a9 100644
--- a/log/src/ana/pfet4.c
+++ b/log/src/ana/pfet4.c
@@ -24,12 +24,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /* From input file "gates.text" */
 
 
-
-
 #include <p2c/p2c.h>
-
-
-#define PFET4_G
 #include "pfet4.h"
 
 
@@ -70,7 +65,7 @@ typedef struct ICPfet {
 /****************************************************************************/
 
 
-Local Void Ex_PFET4(act)
+void Ex_PFET4(act)
 Analog_32_action *act;
 {
   double MinI2, dI2dV1, dI2dV2, dI2dV3, MinI3, dI3dV1, dI3dV2, dI3dV3, MinI1,
@@ -330,7 +325,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Iin_PFET4(act)
+void Iin_PFET4(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr, *Pin2Ptr, *Pin3Ptr;
@@ -454,14 +449,14 @@ Analog_32_action *act;
   }
 }  /*Iin_PFET4*/
 
-Local Void GetCnf_Pfet4(NewIC)
+void GetCnf_Pfet4(NewIC)
 ICPfet *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICPfet *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -564,7 +559,7 @@ ICPfet *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_PFET4(act)
+void initlib_PFET4(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -595,17 +590,17 @@ Analog_32_action *act;
   NewIC->InitCsb = 10e-15;
   NewIC->InitEarly = 50.0;
   GetCnf_Pfet4(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*Pfet4_Initlib*/
 
 
 
-Local boolean Pfetcheck(Inst, Attrnum)
+int Pfetcheck(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
 
@@ -692,7 +687,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_Pfet4(act)
+void Attr_Pfet4(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -710,7 +705,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Pfet4(act)
+void Newgate_Pfet4(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar;
@@ -739,7 +734,7 @@ Analog_32_action *act;
   PfetVar->TauCgs = 0.0;
   PfetVar->TauCgd = 0.0;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)PfetVar;
+  A_Gate->InstVar = (void *)PfetVar;
   AnaCapInit(act->inst);   /*6*/
   A_Gate->Pininfo[0].Cap = ICptr->InitCgb;
   A_Gate->Pininfo[1].Cap = ICptr->InitCdb;
@@ -771,7 +766,7 @@ Analog_32_action *act;
   WITH->attr[N_Early - 1].changed = true;
 }
 
-Local Void Copygate_Pfet4(act)
+void Copygate_Pfet4(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar, *Old_Pfetvar;
@@ -782,11 +777,11 @@ Analog_32_action *act;
   PfetVar = (PfetConst *)Malloc(sizeof(PfetConst));
   *PfetVar = *Old_Pfetvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)PfetVar;
+  A_Gate->InstVar = (void *)PfetVar;
   AnaCapCopy(act->inst);   /*6*/
 }
 
-Local Void Dispose_Pfet4(act)
+void Dispose_Pfet4(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar;
@@ -798,7 +793,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_Pfet4(act)
+void Readgate_Pfet4(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar;
@@ -860,18 +855,18 @@ Analog_32_action *act;
   PfetVar->TauCgd = 0.0;
 }
 
-Local Void Probe_Pfet4(act)
+void Probe_Pfet4(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr;
   double Node1, Node2, Node3, Pin1, Pin2, Pin3, d1, d2;
-  Char Name2[256], Name3[256];
+  char Name2[256], Name3[256];
   log_grec *WITH;
-  Char STR1[18];
-  Char STR2[12];
-  Char STR3[256];
-  Char STR4[256];
+  char STR1[18];
+  char STR2[12];
+  char STR3[256];
+  char STR4[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -937,7 +932,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Void Log_pfet4_initlib_32(act)
+void Log_pfet4_initlib_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -945,63 +940,63 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_PFET4(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_PFET4(act);
     break;
 
-  case Analog_act_update:   /*8*/
+  case ANALOG_ACT_UPDATE:   /*8*/
     AnaCapUpdate(act->inst);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Pfet4(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     AnaCapReset(act->inst);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Pfet4(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Pfet4(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Pfet4(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Pfet4(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_PFET4(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Pfet4(act);
     break;
 
diff --git a/log/src/ana/pfet4.h b/log/src/ana/pfet4.h
index 4788eec..72984ce 100644
--- a/log/src/ana/pfet4.h
+++ b/log/src/ana/pfet4.h
@@ -1,59 +1,16 @@
-/* Header for module Pfet4, generated by p2c */
 #ifndef PFET4_H
 #define PFET4_H
 
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef PFET4_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-
-extern Void Log_pfet4_initlib_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_pfet4_initlib_32 (Analog_32_action *act);
 
 #endif /*PFET4_H*/
 
diff --git a/log/src/ana/pfet5.c b/log/src/ana/pfet5.c
index 1b3cbd8..5b2b20f 100644
--- a/log/src/ana/pfet5.c
+++ b/log/src/ana/pfet5.c
@@ -26,11 +26,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-
-
-#define PFET5_G
 #include "pfet5.h"
 
 
@@ -72,7 +67,7 @@ typedef struct ICPfet {
 /****************************************************************************/
 
 
-Local Void Ex_PFET5(act)
+void Ex_PFET5(act)
 Analog_32_action *act;
 {
   double MinI2, dI2dV1, dI2dV2, dI2dV3, MinI3, dI3dV1, dI3dV2, dI3dV3, MinI1,
@@ -246,7 +241,7 @@ Analog_32_action *act;
 /*          Procedure To Supply Current  Out of a Cell To Current Meters    */
 /****************************************************************************/
 
-Local Void Iin_PFET5(act)
+void Iin_PFET5(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr, *Pin2Ptr, *Pin3Ptr;
@@ -362,14 +357,14 @@ Analog_32_action *act;
 }  /*Iin_PFET5*/
 
 
-Local Void GetCnf_Pfet5(NewIC)
+void GetCnf_Pfet5(NewIC)
 ICPfet *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICPfet *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -472,7 +467,7 @@ ICPfet *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_PFET5(act)
+void initlib_PFET5(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -503,16 +498,16 @@ Analog_32_action *act;
   NewIC->InitCsb = 10e-15;
   NewIC->InitEarly = 50.0;
   GetCnf_Pfet5(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*PFET5_Initlib*/
 
 
-Local boolean Pfetcheck(Inst, Attrnum)
+int Pfetcheck(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
 
@@ -607,7 +602,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_Pfet5(act)
+void Attr_Pfet5(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -625,7 +620,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Pfet5(act)
+void Newgate_Pfet5(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar;
@@ -652,7 +647,7 @@ Analog_32_action *act;
   PfetVar->TauCgd = 0.0;
   PfetVar->TauCgs = 0.0;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)PfetVar;
+  A_Gate->InstVar = (void *)PfetVar;
   AnaCapInit(act->inst);   /*6*/
   A_Gate->Pininfo[0].Cap = ICptr->InitCgb;
   A_Gate->Pininfo[1].Cap = ICptr->InitCdb;
@@ -684,7 +679,7 @@ Analog_32_action *act;
   WITH->attr[N_Early - 1].changed = true;
 }
 
-Local Void Copygate_Pfet5(act)
+void Copygate_Pfet5(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar, *Old_Pfetvar;
@@ -695,11 +690,11 @@ Analog_32_action *act;
   PfetVar = (PfetConst *)Malloc(sizeof(PfetConst));
   *PfetVar = *Old_Pfetvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)PfetVar;
+  A_Gate->InstVar = (void *)PfetVar;
   AnaCapCopy(act->inst);   /*6*/
 }
 
-Local Void Dispose_Pfet5(act)
+void Dispose_Pfet5(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar;
@@ -711,7 +706,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_Pfet5(act)
+void Readgate_Pfet5(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar;
@@ -772,18 +767,18 @@ Analog_32_action *act;
   PfetVar->TauCgs = 0.0;
 }
 
-Local Void Probe_Pfet5(act)
+void Probe_Pfet5(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr;
   double Node1, Node2, Node3, Pin1, Pin2, Pin3, d1, d2;
-  Char Name2[256], Name3[256];
+  char Name2[256], Name3[256];
   log_grec *WITH;
-  Char STR1[18];
-  Char STR2[14];
-  Char STR3[256];
-  Char STR4[256];
+  char STR1[18];
+  char STR2[14];
+  char STR3[256];
+  char STR4[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -850,7 +845,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Void Log_PFET5_INITLIB_32(act)
+void Log_PFET5_INITLIB_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -858,63 +853,63 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_PFET5(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_PFET5(act);
     break;
 
-  case Analog_act_update:   /*8*/
+  case ANALOG_ACT_UPDATE:   /*8*/
     AnaCapUpdate(act->inst);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Pfet5(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     AnaCapReset(act->inst);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Pfet5(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Pfet5(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Pfet5(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Pfet5(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_PFET5(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Pfet5(act);
     break;
 
diff --git a/log/src/ana/pfet5.h b/log/src/ana/pfet5.h
index 6c26a42..92328a8 100644
--- a/log/src/ana/pfet5.h
+++ b/log/src/ana/pfet5.h
@@ -1,57 +1,16 @@
-/* Header for module Pfet5, generated by p2c */
 #ifndef PFET5_H
 #define PFET5_H
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef PFET5_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_PFET5_INITLIB_32 PP((Analog_32_action *act));
 
+extern void Log_PFET5_INITLIB_32 (Analog_32_action *act);
 
-#undef vextern
 
 #endif /*PFET5_H*/
 
diff --git a/log/src/ana/pfet6.c b/log/src/ana/pfet6.c
index 0623e5f..94baac8 100644
--- a/log/src/ana/pfet6.c
+++ b/log/src/ana/pfet6.c
@@ -26,11 +26,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-
-
-#define PFET6_G
 #include "pfet6.h"
 
 
@@ -74,7 +69,7 @@ typedef struct ICPfet {
 /****************************************************************************/
 
 
-Local Void Ex_PFET6(act)
+void Ex_PFET6(act)
 Analog_32_action *act;
 {
   double MinI2, dI2dV1, dI2dV2, dI2dV3, dI2dV4, 
@@ -291,7 +286,7 @@ Analog_32_action *act;
 /*          Procedure To Supply Current  Out of a Cell To Current Meters    */
 /****************************************************************************/
 
-Local Void Iin_PFET6(act)
+void Iin_PFET6(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr, *Pin2Ptr, *Pin3Ptr, *Pin4Ptr;
@@ -416,14 +411,14 @@ Analog_32_action *act;
 }  /*Iin_PFET6*/
 
 
-Local Void GetCnf_Pfet6(NewIC)
+void GetCnf_Pfet6(NewIC)
 ICPfet *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICPfet *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -534,7 +529,7 @@ ICPfet *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_PFET6(act)
+void initlib_PFET6(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -568,16 +563,16 @@ Analog_32_action *act;
   NewIC->InitCwb = 10e-15;
   NewIC->InitEarly = 50.0;
   GetCnf_Pfet6(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*PFET6_Initlib*/
 
 
-Local boolean Pfetcheck(Inst, Attrnum)
+int Pfetcheck(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
 
@@ -685,7 +680,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_Pfet6(act)
+void Attr_Pfet6(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -703,7 +698,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Pfet6(act)
+void Newgate_Pfet6(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar;
@@ -733,7 +728,7 @@ Analog_32_action *act;
   PfetVar->TauCgd = 0.0;
   PfetVar->TauCgs = 0.0;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)PfetVar;
+  A_Gate->InstVar = (void *)PfetVar;
   AnaCapInit(act->inst);   /*6*/
   A_Gate->Pininfo[0].Cap = ICptr->InitCgb;
   A_Gate->Pininfo[1].Cap = ICptr->InitCdb;
@@ -766,7 +761,7 @@ Analog_32_action *act;
   WITH->attr[N_Early - 1].changed = true;
 }
 
-Local Void Copygate_Pfet6(act)
+void Copygate_Pfet6(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar, *Old_Pfetvar;
@@ -777,11 +772,11 @@ Analog_32_action *act;
   PfetVar = (PfetConst *)Malloc(sizeof(PfetConst));
   *PfetVar = *Old_Pfetvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)PfetVar;
+  A_Gate->InstVar = (void *)PfetVar;
   AnaCapCopy(act->inst);   /*6*/
 }
 
-Local Void Dispose_Pfet6(act)
+void Dispose_Pfet6(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar;
@@ -793,7 +788,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_Pfet6(act)
+void Readgate_Pfet6(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar;
@@ -859,18 +854,18 @@ Analog_32_action *act;
   PfetVar->TauCgs = 0.0;
 }
 
-Local Void Probe_Pfet6(act)
+void Probe_Pfet6(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr, *Node4Ptr;
   double Node1, Node2, Node3, Node4, Pin1, Pin2, Pin3, Pin4, d1, d2;
-  Char Name2[256], Name3[256];
+  char Name2[256], Name3[256];
   log_grec *WITH;
-  Char STR1[18];
-  Char STR2[14];
-  Char STR3[256];
-  Char STR4[256];
+  char STR1[18];
+  char STR2[14];
+  char STR3[256];
+  char STR4[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -947,7 +942,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Void Log_PFET6_INITLIB_32(act)
+void Log_PFET6_INITLIB_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -955,63 +950,63 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_PFET6(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_PFET6(act);
     break;
 
-  case Analog_act_update:   /*8*/
+  case ANALOG_ACT_UPDATE:   /*8*/
     AnaCapUpdate(act->inst);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Pfet6(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     AnaCapReset(act->inst);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Pfet6(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Pfet6(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Pfet6(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Pfet6(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_PFET6(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Pfet6(act);
     break;
 
diff --git a/log/src/ana/pfet6.h b/log/src/ana/pfet6.h
index 769709f..f0aabf0 100644
--- a/log/src/ana/pfet6.h
+++ b/log/src/ana/pfet6.h
@@ -1,57 +1,16 @@
-/* Header for module Pfet6, generated by p2c */
 #ifndef PFET6_H
 #define PFET6_H
 
 
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef PFET6_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_PFET6_INITLIB_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_PFET6_INITLIB_32 (Analog_32_action *act);
 
 #endif /*PFET6_H*/
 
diff --git a/log/src/ana/pfet7f.c b/log/src/ana/pfet7f.c
index 882d628..2ec8359 100644
--- a/log/src/ana/pfet7f.c
+++ b/log/src/ana/pfet7f.c
@@ -24,11 +24,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /* From input file "swiss.text" */
 
 
-
 #include <p2c/p2c.h>
-
-
-#define PFET7F_G
 #include "pfet7f.h"
 
 #define Cstart          1
@@ -88,7 +84,7 @@ typedef struct ICPfet {
 /****************************************************************************/
 
 
-Local boolean Pfetconsts(Inst)
+int Pfetconsts(Inst)
 log_grec *Inst;
 
 {
@@ -168,7 +164,7 @@ log_grec *Inst;
 /****************************************************************************/
 
 
-Local Void Ex_PFET7F(act)
+void Ex_PFET7F(act)
 Analog_32_action *act;
 {
   log_grec *WITH;
@@ -459,7 +455,7 @@ Analog_32_action *act;
 /*          Procedure To Supply Current  Out of a Cell To Current Meters    */
 /****************************************************************************/
 
-Local Void Iin_PFET7F(act)
+void Iin_PFET7F(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr, *Pin2Ptr, *Pin3Ptr, *Pin4Ptr;
@@ -638,14 +634,14 @@ Analog_32_action *act;
 }  /*Iin_PFET7F*/
 
 
-Local Void GetCnf_Pfet7F(NewIC)
+void GetCnf_Pfet7F(NewIC)
 ICPfet *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICPfet *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -725,7 +721,7 @@ ICPfet *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_PFET7F(act)
+void initlib_PFET7F(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -756,16 +752,16 @@ Analog_32_action *act;
   NewIC->InitMuOffset = 1.0;
   NewIC->InitQssOffset = 0.0;
   GetCnf_Pfet7F(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*PFET7F_Initlib*/
 
 
-Local boolean Pfetcheck(Inst, Attrnum)
+int Pfetcheck(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
 
@@ -860,7 +856,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_Pfet7F(act)
+void Attr_Pfet7F(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -883,7 +879,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Pfet7F(act)
+void Newgate_Pfet7F(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar;
@@ -898,7 +894,7 @@ Analog_32_action *act;
   PfetVar->TauCgd = 0.0;
   PfetVar->TauCgs = 0.0;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)PfetVar;
+  A_Gate->InstVar = (void *)PfetVar;
   AnaCapInit(act->inst);   /*6*/
   WITH = act->inst;
   WITH->attr[N_Wdrawn - 1].UU.r = ICptr->InitWdrawn;   /**/
@@ -934,7 +930,7 @@ Analog_32_action *act;
   Pfetconsts(WITH);
 }
 
-Local Void Copygate_Pfet7F(act)
+void Copygate_Pfet7F(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar, *Old_Pfetvar;
@@ -945,11 +941,11 @@ Analog_32_action *act;
   PfetVar = (PfetConst *)Malloc(sizeof(PfetConst));
   *PfetVar = *Old_Pfetvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)PfetVar;
+  A_Gate->InstVar = (void *)PfetVar;
   AnaCapCopy(act->inst);   /*6*/
 }
 
-Local Void Dispose_Pfet7F(act)
+void Dispose_Pfet7F(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar;
@@ -961,7 +957,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_Pfet7F(act)
+void Readgate_Pfet7F(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar;
@@ -1014,18 +1010,18 @@ Analog_32_action *act;
   PfetVar->TauCgs = 0.0;
 }
 
-Local Void Probe_Pfet7F(act)
+void Probe_Pfet7F(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr, *Node4Ptr;
   double Node1, Node2, Node3, Node4, Pin1, Pin2, Pin3, Pin4, d1, d2;
-  Char Name2[256], Name3[256];
+  char Name2[256], Name3[256];
   log_grec *WITH;
-  Char STR1[18];
-  Char STR2[14];
-  Char STR3[256];
-  Char STR4[256];
+  char STR1[18];
+  char STR2[14];
+  char STR3[256];
+  char STR4[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -1095,7 +1091,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Update_Pfet7F(act)
+void Update_Pfet7F(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
@@ -1119,7 +1115,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Void Log_PFET7F_INITLIB_32(act)
+void Log_PFET7F_INITLIB_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -1127,63 +1123,63 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_PFET7F(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_PFET7F(act);
     break;
 
-  case Analog_act_update:   /*8*/
+  case ANALOG_ACT_UPDATE:   /*8*/
     Update_Pfet7F(act);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Pfet7F(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     AnaCapReset(act->inst);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Pfet7F(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Pfet7F(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Pfet7F(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Pfet7F(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_PFET7F(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Pfet7F(act);
     break;
 
diff --git a/log/src/ana/pfet7f.h b/log/src/ana/pfet7f.h
index 2325b66..ae173c0 100644
--- a/log/src/ana/pfet7f.h
+++ b/log/src/ana/pfet7f.h
@@ -1,57 +1,15 @@
-/* Header for module PFET7F, generated by p2c */
 #ifndef PFET7F_H
 #define PFET7F_H
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef PFET7F_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_PFET7F_INITLIB_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_PFET7F_INITLIB_32 (Analog_32_action *act);
 
 #endif /*PFET7F_H*/
 
diff --git a/log/src/ana/pfet7t.c b/log/src/ana/pfet7t.c
index 7500752..82f6d51 100644
--- a/log/src/ana/pfet7t.c
+++ b/log/src/ana/pfet7t.c
@@ -26,9 +26,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-#define PFET7T_G
 #include "pfet7t.h"
 
 #define Cstart          1
@@ -90,7 +87,7 @@ typedef struct ICPfet {
 /****************************************************************************/
 
 
-Local boolean Pfetconsts(Inst)
+int Pfetconsts(Inst)
 log_grec *Inst;
 
 {
@@ -170,7 +167,7 @@ log_grec *Inst;
 /****************************************************************************/
 
 
-Local Void Ex_PFET7T(act)
+void Ex_PFET7T(act)
 Analog_32_action *act;
 {
   log_grec *WITH;
@@ -419,7 +416,7 @@ Analog_32_action *act;
 /*          Procedure To Supply Current  Out of a Cell To Current Meters    */
 /****************************************************************************/
 
-Local Void Iin_PFET7T(act)
+void Iin_PFET7T(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr, *Pin2Ptr, *Pin3Ptr;
@@ -573,14 +570,14 @@ Analog_32_action *act;
 }  /*Iin_PFET7T*/
 
 
-Local Void GetCnf_Pfet7T(NewIC)
+void GetCnf_Pfet7T(NewIC)
 ICPfet *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICPfet *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -652,7 +649,7 @@ ICPfet *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_PFET7T(act)
+void initlib_PFET7T(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -680,16 +677,16 @@ Analog_32_action *act;
   NewIC->InitMuOffset = 1.0;
   NewIC->InitQssOffset = 0;
   GetCnf_Pfet7T(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*PFET7T_Initlib*/
 
 
-Local boolean Pfetcheck(Inst, Attrnum)
+int Pfetcheck(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
 
@@ -779,7 +776,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_Pfet7T(act)
+void Attr_Pfet7T(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -802,7 +799,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Pfet7T(act)
+void Newgate_Pfet7T(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar;
@@ -817,7 +814,7 @@ Analog_32_action *act;
   PfetVar->TauCgd = 0.0;
   PfetVar->TauCgs = 0.0;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)PfetVar;
+  A_Gate->InstVar = (void *)PfetVar;
   AnaCapInit(act->inst);   /*6*/
   WITH = act->inst;
   WITH->attr[N_Wdrawn - 1].UU.r = ICptr->InitWdrawn;   /**/
@@ -853,7 +850,7 @@ Analog_32_action *act;
   Pfetconsts(WITH);
 }
 
-Local Void Copygate_Pfet7T(act)
+void Copygate_Pfet7T(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar, *Old_Pfetvar;
@@ -864,11 +861,11 @@ Analog_32_action *act;
   PfetVar = (PfetConst *)Malloc(sizeof(PfetConst));
   *PfetVar = *Old_Pfetvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)PfetVar;
+  A_Gate->InstVar = (void *)PfetVar;
   AnaCapCopy(act->inst);   /*6*/
 }
 
-Local Void Dispose_Pfet7T(act)
+void Dispose_Pfet7T(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar;
@@ -880,7 +877,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_Pfet7T(act)
+void Readgate_Pfet7T(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar;
@@ -933,18 +930,18 @@ Analog_32_action *act;
   PfetVar->TauCgs = 0.0;
 }
 
-Local Void Probe_Pfet7T(act)
+void Probe_Pfet7T(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr;
   double Node1, Node2, Node3, Pin1, Pin2, Pin3, d1, d2;
-  Char Name2[256], Name3[256];
+  char Name2[256], Name3[256];
   log_grec *WITH;
-  Char STR1[18];
-  Char STR2[14];
-  Char STR3[256];
-  Char STR4[256];
+  char STR1[18];
+  char STR2[14];
+  char STR3[256];
+  char STR4[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -1004,7 +1001,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Update_Pfet7T(act)
+void Update_Pfet7T(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
@@ -1032,7 +1029,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Void Log_PFET7T_INITLIB_32(act)
+void Log_PFET7T_INITLIB_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -1040,63 +1037,63 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_PFET7T(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_PFET7T(act);
     break;
 
-  case Analog_act_update:   /*8*/
+  case ANALOG_ACT_UPDATE:   /*8*/
     Update_Pfet7T(act);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Pfet7T(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     AnaCapReset(act->inst);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Pfet7T(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Pfet7T(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Pfet7T(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Pfet7T(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_PFET7T(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Pfet7T(act);
     break;
 
diff --git a/log/src/ana/pfet7t.h b/log/src/ana/pfet7t.h
index ebad7ec..3e50bb3 100644
--- a/log/src/ana/pfet7t.h
+++ b/log/src/ana/pfet7t.h
@@ -1,57 +1,15 @@
-/* Header for module PFET7T, generated by p2c */
 #ifndef PFET7T_H
 #define PFET7T_H
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef PFET7T_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_PFET7T_INITLIB_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_PFET7T_INITLIB_32 (Analog_32_action *act);
 
 #endif /*PFET7T_H*/
 
diff --git a/log/src/ana/physical.c b/log/src/ana/physical.c
index b3827e3..0369019 100644
--- a/log/src/ana/physical.c
+++ b/log/src/ana/physical.c
@@ -23,12 +23,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /* Output from p2c, the Pascal-to-C translator */
 /* From input file "tools.text" */
 
-
-
 #include <p2c/p2c.h>
-
-
-#define PHYSICAL_G
 #include "physical.h"
 
 #define N_k            1
@@ -53,7 +48,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /****************************************************************************/
 
 
-Local Void initlib_Physical(act)
+void initlib_Physical(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -64,11 +59,11 @@ Analog_32_action *act;
   NewCell->intr_cell = 0;
   NewCell->plist_cell = NULL;
   NewCell->phase = Anasimple;
-  act->kind->info = (Anyptr)NewCell;
+  act->kind->info = (void *)NewCell;
 }  /*NFET4_Initlib*/
 
 
-Local Void Reload_Physical(act)
+void Reload_Physical(act)
 Analog_32_action *act;
 {
   log_grec *WITH;
@@ -115,7 +110,7 @@ Analog_32_action *act;
 
 }
 
-Local Void Attr_Physical(act)
+void Attr_Physical(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -220,7 +215,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Openconfig_Physical(act)
+void Openconfig_Physical(act)
 Analog_32_action *act;
 {
   long Index;
@@ -232,11 +227,11 @@ Analog_32_action *act;
   Reload_Physical(act);
 }
 
-Local Void Readgate_Physical(act)
+void Readgate_Physical(act)
 Analog_32_action *act;
 {
   log_grec *WITH;
-  Char STR1[256];
+  char STR1[256];
 
   WITH = act->inst;
   if (AnaOldmodel && !WITH->attr[0].blnk) {
@@ -252,11 +247,11 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Physical(act)
+void Newgate_Physical(act)
 Analog_32_action *act;
 {
   Analog_32_action Newact;
-  Char Newout[256];
+  char Newout[256];
 
   Newact.inst = act->inst;
   Newact.ok = true;
@@ -270,7 +265,7 @@ Analog_32_action *act;
 /*                 Library Listing For Cell Physical                    */
 /*==========================================================================*/
 
-Void Log_PHYSICAL_initlib_32(act)
+void Log_PHYSICAL_initlib_32(act)
 Analog_32_action *act;
 {
   /*Body of procedure*/
@@ -278,23 +273,23 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_Physical(act);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Physical(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     Openconfig_Physical(act);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Physical(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Physical(act);
     break;
 
diff --git a/log/src/ana/physical.h b/log/src/ana/physical.h
index 3847a73..898443a 100644
--- a/log/src/ana/physical.h
+++ b/log/src/ana/physical.h
@@ -1,58 +1,15 @@
-/* Header for module PHYSICAL, generated by p2c */
 #ifndef PHYSICAL_H
 #define PHYSICAL_H
 
-
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef PHYSICAL_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_PHYSICAL_initlib_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_PHYSICAL_initlib_32 (Analog_32_action *act);
 
 #endif /*PHYSICAL_H*/
 
diff --git a/log/src/ana/pnp1.c b/log/src/ana/pnp1.c
index 2c0ae0b..a5adbb9 100644
--- a/log/src/ana/pnp1.c
+++ b/log/src/ana/pnp1.c
@@ -23,15 +23,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /* Output from p2c, the Pascal-to-C translator */
 /* From input file "scott.text" */
 
-
-
-
 #include <p2c/p2c.h>
-
-
-
-
-#define PNP1_G
 #include "pnp1.h"
 
 
@@ -50,8 +42,8 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 typedef struct PNP1Const {
   double betaF, betaR;   /*Transistor Parameters*/
   double For1, For2, R1, R2, Is, IECO, ICEO, lam;
-  boolean Limit;   /*Booleans for indicator light*/
-  boolean OldLimit, NewLimit;
+  int Limit;   /*ints for indicator light*/
+  int OldLimit, NewLimit;
   double TauCbc;   /*Taus for capacitors*/
   double TauCbe;   /*Tau for capacitor*/
 } PNP1Const;
@@ -68,9 +60,9 @@ typedef struct ICPNP1 {
 /****************************************************************************/
 
 
-Local Void Limitfill(Inst, Limitflag, Erase)
+void Limitfill(Inst, Limitflag, Erase)
 log_grec *Inst;
-boolean Limitflag, Erase;
+int Limitflag, Erase;
 {
   short LLx, LLy, URx, URy;
 
@@ -112,7 +104,7 @@ boolean Limitflag, Erase;
 
 
 
-Local Void Ex_PNP1(act)
+void Ex_PNP1(act)
 Analog_32_action *act;
 {
   double MinI1, MinI2, MinI3, dI1dV1, dI1dV2, dI1dV3, dI2dV1, dI2dV2, dI2dV3,
@@ -284,7 +276,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Iin_PNP1(act)
+void Iin_PNP1(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr;
@@ -396,14 +388,14 @@ Analog_32_action *act;
   }
 }  /*Iin_PNP1*/
 
-Local Void GetCnf_PNP1(NewIC)
+void GetCnf_PNP1(NewIC)
 ICPNP1 *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICPNP1 *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -499,7 +491,7 @@ ICPNP1 *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_PNP1(act)
+void initlib_PNP1(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -529,8 +521,8 @@ Analog_32_action *act;
   NewIC->InitCdb = 10e-15;
   NewIC->InitCsb = 10e-15;
   GetCnf_PNP1(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*PNP1_Initlib*/
 
 
@@ -542,11 +534,11 @@ Analog_32_action *act;
    #define MAKE_IECO(n)	((n)->IECO=(n)->Is*(n)->betaR/((n)->betaR+(n)->betaF))
 */
 
-Local boolean PNP1check(Inst, Attrnum)
+int PNP1check(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   PNP1Const *PNP1Var;
   Anainstlist *A_Gate;
 
@@ -643,7 +635,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_PNP1(act)
+void Attr_PNP1(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -661,7 +653,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_PNP1(act)
+void Newgate_PNP1(act)
 Analog_32_action *act;
 {
   PNP1Const *PNP1Var;
@@ -691,7 +683,7 @@ Analog_32_action *act;
   PNP1Var->TauCbc = 0.0;
   PNP1Var->TauCbe = 0.0;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)PNP1Var;
+  A_Gate->InstVar = (void *)PNP1Var;
   AnaCapInit(act->inst);
   A_Gate->Pininfo[0].Cap = ICptr->InitCgb;
   A_Gate->Pininfo[1].Cap = ICptr->InitCdb;
@@ -720,7 +712,7 @@ Analog_32_action *act;
   WITH->attr[N_Vcrow - 1].changed = true;
 }
 
-Local Void Copygate_PNP1(act)
+void Copygate_PNP1(act)
 Analog_32_action *act;
 {
   PNP1Const *PNP1Var, *Old_PNP1var;
@@ -732,12 +724,12 @@ Analog_32_action *act;
   PNP1Var = (PNP1Const *)Malloc(sizeof(PNP1Const));
   *PNP1Var = *Old_PNP1var;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)PNP1Var;
+  A_Gate->InstVar = (void *)PNP1Var;
   /*Always Do*/
   AnaCapCopy(act->inst);
 }
 
-Local Void Dispose_PNP1(act)
+void Dispose_PNP1(act)
 Analog_32_action *act;
 {
   PNP1Const *PNP1Var;
@@ -749,7 +741,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_PNP1(act)
+void Readgate_PNP1(act)
 Analog_32_action *act;
 {
   PNP1Const *PNP1Var;
@@ -809,18 +801,18 @@ Analog_32_action *act;
   PNP1Var->TauCbe = 0.0;
 }
 
-Local Void Probe_PNP1(act)
+void Probe_PNP1(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr;
   double Node1, Node2, Node3, Pin1, Pin2, Pin3;
   log_grec *WITH;
-  Char STR1[18];
-  Char STR2[12];
-  Char STR3[16];
-  Char STR4[256];
-  Char STR5[256];
+  char STR1[18];
+  char STR2[12];
+  char STR3[16];
+  char STR4[256];
+  char STR5[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -873,7 +865,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Reset_PNP1(act)
+void Reset_PNP1(act)
 Analog_32_action *act;
 {
   PNP1Const *PNP1Var;
@@ -889,7 +881,7 @@ Analog_32_action *act;
     Limitfill(act->inst, PNP1Var->Limit, false);
 }
 
-Local Void PreUpdate_PNP1(act)
+void PreUpdate_PNP1(act)
 Analog_32_action *act;
 {
   PNP1Const *PNP1Var;
@@ -911,7 +903,7 @@ Analog_32_action *act;
 		       Vpin2 - VPin1 >= WITH1->attr[N_Vcrow - 1].UU.r);
 }
 
-Local Void Update_PNP1(act)
+void Update_PNP1(act)
 Analog_32_action *act;
 {
   PNP1Const *PNP1Var;
@@ -924,7 +916,7 @@ Analog_32_action *act;
   PNP1Var->Limit = PNP1Var->NewLimit;
 }
 
-Local Void Display_PNP1(act)
+void Display_PNP1(act)
 Analog_32_action *act;
 {
   PNP1Const *PNP1Var;
@@ -941,7 +933,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Refresh_PNP1(act)
+void Refresh_PNP1(act)
 Analog_32_action *act;
 {
   PNP1Const *PNP1Var;
@@ -952,7 +944,7 @@ Analog_32_action *act;
   Limitfill(act->inst, PNP1Var->Limit, false);
 }
 
-Local Void Erase_PNP1(act)
+void Erase_PNP1(act)
 Analog_32_action *act;
 {
   PNP1Const *PNP1Var;
@@ -969,7 +961,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Void Log_PNP1_INITLIB_32(act)
+void Log_PNP1_INITLIB_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -977,79 +969,79 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_PNP1(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_PNP1(act);
     break;
 
-  case Analog_act_preupdate:
+  case ANALOG_ACT_PREUPDATE:
     PreUpdate_PNP1(act);
     break;
 
-  case Analog_act_update:
+  case ANALOG_ACT_UPDATE:
     Update_PNP1(act);
     break;
 
-  case Analog_act_display:
+  case ANALOG_ACT_DISPLAY:
     Display_PNP1(act);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_PNP1(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     Reset_PNP1(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_PNP1(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_PNP1(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_PNP1(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_PNP1(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_PNP1(act);
     break;
 
-  case Analog_act_erase:
+  case ANALOG_ACT_ERASE:
     Erase_PNP1(act);
     break;
 
-  case Analog_act_refresh:
+  case ANALOG_ACT_REFRESH:
     Refresh_PNP1(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_PNP1(act);
     break;
 
diff --git a/log/src/ana/pnp1.h b/log/src/ana/pnp1.h
index 8fd4b1f..4de669e 100644
--- a/log/src/ana/pnp1.h
+++ b/log/src/ana/pnp1.h
@@ -1,54 +1,15 @@
-/* Header for module PNP1, generated by p2c */
 #ifndef PNP1_H
 #define PNP1_H
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef PNP1_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-/*$If Float$
-  $float_hdw on$
-  $End$*/
-
-
-
-extern Void Log_PNP1_INITLIB_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_PNP1_INITLIB_32 (Analog_32_action *act);
 
 #endif /*PNP1_H*/
 
diff --git a/log/src/ana/pnp2.c b/log/src/ana/pnp2.c
index dc3c004..fe6153d 100644
--- a/log/src/ana/pnp2.c
+++ b/log/src/ana/pnp2.c
@@ -23,15 +23,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /* Output from p2c, the Pascal-to-C translator */
 /* From input file "scott.text" */
 
-
-
-
 #include <p2c/p2c.h>
-
-
-
-
-#define PNP2_G
 #include "pnp2.h"
 
 
@@ -52,8 +44,8 @@ typedef struct PNP2Const {
   double betaF, betaR;   /*Transistor Parameters*/
   double For1, For2, R1, R2, Is, IECO, ICEO, lam;
   double Va;	   /* Early voltage (Tim 4/6/98) */
-  boolean Limit;   /*Booleans for indicator light*/
-  boolean OldLimit, NewLimit;
+  int Limit;   /*ints for indicator light*/
+  int OldLimit, NewLimit;
   double TauCbc;   /*Taus for capacitors*/
   double TauCbe;   /*Tau for capacitor*/
 } PNP2Const;
@@ -70,9 +62,9 @@ typedef struct ICPNP2 {
 /****************************************************************************/
 
 
-Local Void Limitfill(Inst, Limitflag, Erase)
+void Limitfill(Inst, Limitflag, Erase)
 log_grec *Inst;
-boolean Limitflag, Erase;
+int Limitflag, Erase;
 {
   short LLx, LLy, URx, URy;
 
@@ -123,7 +115,7 @@ boolean Limitflag, Erase;
 
 
 
-Local Void Ex_PNP2(act)
+void Ex_PNP2(act)
 Analog_32_action *act;
 {
   double MinI1, MinI2, MinI3, dI1dV1, dI1dV2, dI1dV3, dI2dV1, dI2dV2, dI2dV3,
@@ -300,7 +292,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Iin_PNP2(act)
+void Iin_PNP2(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr;
@@ -416,14 +408,14 @@ Analog_32_action *act;
   }
 }  /*Iin_PNP2*/
 
-Local Void GetCnf_PNP2(NewIC)
+void GetCnf_PNP2(NewIC)
 ICPNP2 *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICPNP2 *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -527,7 +519,7 @@ ICPNP2 *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_PNP2(act)
+void initlib_PNP2(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -558,8 +550,8 @@ Analog_32_action *act;
   NewIC->InitCdb = 10e-15;
   NewIC->InitCsb = 10e-15;
   GetCnf_PNP2(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*PNP2_Initlib*/
 
 
@@ -567,11 +559,11 @@ Analog_32_action *act;
 #define MAKE_IECO(n)	((n)->IECO=(n)->Is/(n)->betaR)
 
 
-Local boolean PNP2check(Inst, Attrnum)
+int PNP2check(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   PNP2Const *PNP2Var;
   Anainstlist *A_Gate;
 
@@ -675,7 +667,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_PNP2(act)
+void Attr_PNP2(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -693,7 +685,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_PNP2(act)
+void Newgate_PNP2(act)
 Analog_32_action *act;
 {
   PNP2Const *PNP2Var;
@@ -724,7 +716,7 @@ Analog_32_action *act;
   PNP2Var->TauCbc = 0.0;
   PNP2Var->TauCbe = 0.0;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)PNP2Var;
+  A_Gate->InstVar = (void *)PNP2Var;
   AnaCapInit(act->inst);
   A_Gate->Pininfo[0].Cap = ICptr->InitCgb;
   A_Gate->Pininfo[1].Cap = ICptr->InitCdb;
@@ -756,7 +748,7 @@ Analog_32_action *act;
   WITH->attr[N_Vcrow - 1].changed = true;
 }
 
-Local Void Copygate_PNP2(act)
+void Copygate_PNP2(act)
 Analog_32_action *act;
 {
   PNP2Const *PNP2Var, *Old_PNP2var;
@@ -768,12 +760,12 @@ Analog_32_action *act;
   PNP2Var = (PNP2Const *)Malloc(sizeof(PNP2Const));
   *PNP2Var = *Old_PNP2var;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)PNP2Var;
+  A_Gate->InstVar = (void *)PNP2Var;
   /*Always Do*/
   AnaCapCopy(act->inst);
 }
 
-Local Void Dispose_PNP2(act)
+void Dispose_PNP2(act)
 Analog_32_action *act;
 {
   PNP2Const *PNP2Var;
@@ -785,7 +777,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_PNP2(act)
+void Readgate_PNP2(act)
 Analog_32_action *act;
 {
   PNP2Const *PNP2Var;
@@ -849,18 +841,18 @@ Analog_32_action *act;
   PNP2Var->TauCbe = 0.0;
 }
 
-Local Void Probe_PNP2(act)
+void Probe_PNP2(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr;
   double Node1, Node2, Node3, Pin1, Pin2, Pin3;
   log_grec *WITH;
-  Char STR1[18];
-  Char STR2[12];
-  Char STR3[16];
-  Char STR4[256];
-  Char STR5[256];
+  char STR1[18];
+  char STR2[12];
+  char STR3[16];
+  char STR4[256];
+  char STR5[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -913,7 +905,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Reset_PNP2(act)
+void Reset_PNP2(act)
 Analog_32_action *act;
 {
   PNP2Const *PNP2Var;
@@ -929,7 +921,7 @@ Analog_32_action *act;
     Limitfill(act->inst, PNP2Var->Limit, false);
 }
 
-Local Void PreUpdate_PNP2(act)
+void PreUpdate_PNP2(act)
 Analog_32_action *act;
 {
   PNP2Const *PNP2Var;
@@ -951,7 +943,7 @@ Analog_32_action *act;
 		       Vpin2 - VPin1 >= WITH1->attr[N_Vcrow - 1].UU.r);
 }
 
-Local Void Update_PNP2(act)
+void Update_PNP2(act)
 Analog_32_action *act;
 {
   PNP2Const *PNP2Var;
@@ -964,7 +956,7 @@ Analog_32_action *act;
   PNP2Var->Limit = PNP2Var->NewLimit;
 }
 
-Local Void Display_PNP2(act)
+void Display_PNP2(act)
 Analog_32_action *act;
 {
   PNP2Const *PNP2Var;
@@ -981,7 +973,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Refresh_PNP2(act)
+void Refresh_PNP2(act)
 Analog_32_action *act;
 {
   PNP2Const *PNP2Var;
@@ -992,7 +984,7 @@ Analog_32_action *act;
   Limitfill(act->inst, PNP2Var->Limit, false);
 }
 
-Local Void Erase_PNP2(act)
+void Erase_PNP2(act)
 Analog_32_action *act;
 {
   PNP2Const *PNP2Var;
@@ -1009,7 +1001,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Void Log_PNP2_INITLIB_32(act)
+void Log_PNP2_INITLIB_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -1017,79 +1009,79 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_PNP2(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_PNP2(act);
     break;
 
-  case Analog_act_preupdate:
+  case ANALOG_ACT_PREUPDATE:
     PreUpdate_PNP2(act);
     break;
 
-  case Analog_act_update:
+  case ANALOG_ACT_UPDATE:
     Update_PNP2(act);
     break;
 
-  case Analog_act_display:
+  case ANALOG_ACT_DISPLAY:
     Display_PNP2(act);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_PNP2(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     Reset_PNP2(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_PNP2(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_PNP2(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_PNP2(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_PNP2(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_PNP2(act);
     break;
 
-  case Analog_act_erase:
+  case ANALOG_ACT_ERASE:
     Erase_PNP2(act);
     break;
 
-  case Analog_act_refresh:
+  case ANALOG_ACT_REFRESH:
     Refresh_PNP2(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_PNP2(act);
     break;
 
diff --git a/log/src/ana/pnp2.h b/log/src/ana/pnp2.h
index 74c28b3..86c04c3 100644
--- a/log/src/ana/pnp2.h
+++ b/log/src/ana/pnp2.h
@@ -1,54 +1,16 @@
-/* Header for module PNP2, generated by p2c */
 #ifndef PNP2_H
 #define PNP2_H
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef PNP2_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-/*$If Float$
-  $float_hdw on$
-  $End$*/
-
-
-
-extern Void Log_PNP2_INITLIB_32 PP((Analog_32_action *act));
 
+extern void Log_PNP2_INITLIB_32 (Analog_32_action *act);
 
-#undef vextern
 
 #endif /*PNP2_H*/
 
diff --git a/log/src/ana/pspc1.c b/log/src/ana/pspc1.c
index 00430c5..36837a8 100644
--- a/log/src/ana/pspc1.c
+++ b/log/src/ana/pspc1.c
@@ -44,9 +44,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-#define PSPC1_G
 #include "pspc1.h"
 
 
@@ -89,9 +86,9 @@ typedef struct ICPfet {
 } ICPfet;
 
 
-Local Void Show_W_L(Inst,erase)
+void Show_W_L(Inst,erase)
 log_grec *Inst;
-boolean erase;
+int erase;
 {
   short Lx, Ly, Wx, Wy;
   void drawnum3();
@@ -178,7 +175,7 @@ boolean erase;
 /****************************************************************************/
 
 
-Local Void Ex_PSPC1(act)
+void Ex_PSPC1(act)
 Analog_32_action *act;
 {
   double MinI2, dI2dV1, dI2dV2, dI2dV3, dI2dV4, 
@@ -397,7 +394,7 @@ Analog_32_action *act;
 /*          Procedure To Supply Current  Out of a Cell To Current Meters    */
 /****************************************************************************/
 
-Local Void Iin_PSPC1(act)
+void Iin_PSPC1(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr, *Pin2Ptr, *Pin3Ptr, *Pin4Ptr;
@@ -522,14 +519,14 @@ Analog_32_action *act;
 }  /*Iin_Pspc1*/
 
 
-Local Void GetCnf_Pspc1(NewIC)
+void GetCnf_Pspc1(NewIC)
 ICPfet *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICPfet *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -666,7 +663,7 @@ ICPfet *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_PSPC1(act)
+void initlib_PSPC1(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -702,16 +699,16 @@ Analog_32_action *act;
   NewIC->InitL = 4.0;
   NewIC->InitNumber = 1;
   GetCnf_Pspc1(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*PSPC1_Initlib*/
 
 
-Local boolean Pfetcheck(Inst, Attrnum)
+int Pfetcheck(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   PfetConst *PfetVar;
   Anainstlist *A_Gate;
 
@@ -842,7 +839,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_Pspc1(act)
+void Attr_Pspc1(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -870,7 +867,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Pspc1(act)
+void Newgate_Pspc1(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar;
@@ -902,7 +899,7 @@ Analog_32_action *act;
   PfetVar->TauCgd = 0.0;
   PfetVar->TauCgs = 0.0;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)PfetVar;
+  A_Gate->InstVar = (void *)PfetVar;
   AnaCapInit(act->inst);   /*6*/
   A_Gate->Pininfo[0].Cap = ICptr->InitCgb;
   A_Gate->Pininfo[1].Cap = ICptr->InitCdb;
@@ -944,7 +941,7 @@ Analog_32_action *act;
   WITH->attr[N_Number - 1].changed = true;
 }
 
-Local Void Copygate_Pspc1(act)
+void Copygate_Pspc1(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar, *Old_Pfetvar;
@@ -955,11 +952,11 @@ Analog_32_action *act;
   PfetVar = (PfetConst *)Malloc(sizeof(PfetConst));
   *PfetVar = *Old_Pfetvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)PfetVar;
+  A_Gate->InstVar = (void *)PfetVar;
   AnaCapCopy(act->inst);   /*6*/
 }
 
-Local Void Dispose_Pspc1(act)
+void Dispose_Pspc1(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar;
@@ -971,7 +968,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_Pspc1(act)
+void Readgate_Pspc1(act)
 Analog_32_action *act;
 {
   PfetConst *PfetVar;
@@ -1053,18 +1050,18 @@ Analog_32_action *act;
   PfetVar->TauCgs = 0.0;
 }
 
-Local Void Probe_Pspc1(act)
+void Probe_Pspc1(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr, *Node3Ptr, *Node4Ptr;
   double Node1, Node2, Node3, Node4, Pin1, Pin2, Pin3, Pin4, d1, d2;
-  Char Name2[256], Name3[256];
+  char Name2[256], Name3[256];
   log_grec *WITH;
-  Char STR1[25];
-  Char STR2[14];
-  Char STR3[256];
-  Char STR4[256];
+  char STR1[25];
+  char STR2[14];
+  char STR3[256];
+  char STR4[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -1141,7 +1138,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Void Log_PSPC1_INITLIB_32(act)
+void Log_PSPC1_INITLIB_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -1149,75 +1146,75 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_PSPC1(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_PSPC1(act);
     break;
 
-  case Analog_act_update:   /*8*/
+  case ANALOG_ACT_UPDATE:   /*8*/
     AnaCapUpdate(act->inst);
     break;
 
-  case Analog_act_display:
+  case ANALOG_ACT_DISPLAY:
     if (AnaLogglobals->showpage == act->page) 
       Show_W_L(act->inst, false);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);    
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Pspc1(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     AnaCapReset(act->inst);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Pspc1(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Pspc1(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Pspc1(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Pspc1(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_PSPC1(act);
     break;
 
-  case Analog_act_erase:
+  case ANALOG_ACT_ERASE:
     Show_W_L(act->inst, true);
     break;
 
-  case Analog_act_refresh:
+  case ANALOG_ACT_REFRESH:
     Show_W_L(act->inst, false);
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Pspc1(act);
     break;
 
diff --git a/log/src/ana/pspc1.h b/log/src/ana/pspc1.h
index 2e10277..af5e68a 100644
--- a/log/src/ana/pspc1.h
+++ b/log/src/ana/pspc1.h
@@ -1,57 +1,16 @@
-/* edited by Bhusan to add fourth terminal and spice output */
 #ifndef PSPC1_H
 #define PSPC1_H
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef PSPC1_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_PSPC1_INITLIB_32 PP((Analog_32_action *act));
 
+extern void Log_PSPC1_INITLIB_32 (Analog_32_action *act);
 
-#undef vextern
 
 #endif /*PSPC1_H*/
 
diff --git a/log/src/ana/pwl.c b/log/src/ana/pwl.c
index 0c434ce..14ce169 100644
--- a/log/src/ana/pwl.c
+++ b/log/src/ana/pwl.c
@@ -113,7 +113,7 @@ typedef struct PWLConst {
   double	sd[MAX_PWL - 2];
   char		Limit, OldLimit, NewLimit;	/* range light stuff */
   double	low, high;
-  boolean	badFile;
+  int	badFile;
 } PWLConst;
 
 typedef struct ICPWL {
@@ -129,10 +129,10 @@ typedef struct ICPWL {
 /****************************************************************************/
 
 
-Local Void Limitfill(Inst, Limitflag, Erase)
+void Limitfill(Inst, Limitflag, Erase)
 log_grec *Inst;
 char Limitflag;
-boolean Erase;
+int Erase;
 {
   Anainstlist *A_Gate;
   PWLConst *PWLVar;
@@ -193,7 +193,7 @@ boolean Erase;
 /*            Procedure To Simulate Cell In Algorithm                        */
 /****************************************************************************/
 
-Local void locate (x, n, v, j)
+void locate (x, n, v, j)
 double  x[], v;
 int     n, *j;
 {
@@ -214,7 +214,7 @@ int     n, *j;
 }
 
 
-Local void interp (v, j, PWLVar, i, didv)
+void interp (v, j, PWLVar, i, didv)
   double        v, *i, *didv;
   int           j;
   PWLConst	*PWLVar;
@@ -245,7 +245,7 @@ Local void interp (v, j, PWLVar, i, didv)
 }
 
 
-Local Void Ex_PWL(act)
+void Ex_PWL(act)
 Analog_32_action *act;
 {
   double MinI1, MinI2, dI1dV1, dI1dV2, dI2dV1, dI2dV2;
@@ -320,7 +320,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Iin_PWL(act)
+void Iin_PWL(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr;
@@ -387,7 +387,7 @@ Analog_32_action *act;
 }  /*Iin_PWL*/
 
 
-Local void findcircle (x1, y1, x2, y2, x3, y3, rd,
+void findcircle (x1, y1, x2, y2, x3, y3, rd,
                        xc, yc, xl, xr, sd, ml, mr, bl, br)
   double        x1, y1, x2, y2, x3, y3, *rd;
   double        *xc, *yc, *xl, *xr, *sd, *ml, *mr, *bl, *br;
@@ -455,7 +455,7 @@ retry:
 }
 
 
-Local void pwl2c (x, y, n, radius, PWLVar)
+void pwl2c (x, y, n, radius, PWLVar)
   double        x[], y[], radius;
   int           n;
   PWLConst      *PWLVar;
@@ -502,7 +502,7 @@ Local void pwl2c (x, y, n, radius, PWLVar)
 }
 
 
-Local char CheckPWLFile (datafile)
+char CheckPWLFile (datafile)
   FILE		*datafile;
 {
   int		n;
@@ -528,7 +528,7 @@ Local char CheckPWLFile (datafile)
 }
 
 
-Local void LoadPWLVar (PWLVar, datafileName, radius)
+void LoadPWLVar (PWLVar, datafileName, radius)
   PWLConst	*PWLVar;
   char		*datafileName;
   double	radius;
@@ -559,14 +559,14 @@ Local void LoadPWLVar (PWLVar, datafileName, radius)
 }
 
 
-Local Void GetCnf_PWL(NewIC)
+void GetCnf_PWL(NewIC)
 ICPWL *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICPWL *WITH;
-  Char *STR1;
+  char *STR1;
 
   FILE		*datafile;
   char		badPWLFile = 0;
@@ -617,7 +617,7 @@ ICPWL *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_PWL(act)
+void initlib_PWL(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -639,17 +639,17 @@ Analog_32_action *act;
   NewIC->ICRadius = D_Radius;
 
   GetCnf_PWL(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*PWL_Initlib*/
 
 
 
-Local boolean PWLcheck(Inst, Attrnum)
+int PWLcheck(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   PWLConst *PWLVar;
   Anainstlist *A_Gate;
 
@@ -690,7 +690,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_PWL(act)
+void Attr_PWL(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -703,7 +703,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_PWL(act)
+void Newgate_PWL(act)
 Analog_32_action *act;
 {
   PWLConst *PWLVar;
@@ -732,7 +732,7 @@ Analog_32_action *act;
   PWLVar->NewLimit = 0;
 
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)PWLVar;
+  A_Gate->InstVar = (void *)PWLVar;
   AnaCapInit(act->inst);
   WITH = act->inst;
 
@@ -746,7 +746,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Copygate_PWL(act)
+void Copygate_PWL(act)
 Analog_32_action *act;
 {
   PWLConst *PWLVar, *Old_PWLvar;
@@ -758,12 +758,12 @@ Analog_32_action *act;
   PWLVar = (PWLConst *)Malloc(sizeof(PWLConst));
   *PWLVar = *Old_PWLvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)PWLVar;
+  A_Gate->InstVar = (void *)PWLVar;
   /*Always Do*/
   AnaCapCopy(act->inst);
 }
 
-Local Void Dispose_PWL(act)
+void Dispose_PWL(act)
 Analog_32_action *act;
 {
   PWLConst *PWLVar;
@@ -775,7 +775,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_PWL(act)
+void Readgate_PWL(act)
 Analog_32_action *act;
 {
   PWLConst *PWLVar;
@@ -792,17 +792,17 @@ Analog_32_action *act;
 }
 
 
-Local Void Probe_PWL(act)
+void Probe_PWL(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr;
   double Node1, Node2, Pin1, Pin2, d;
-  Char Name1[256], Name2[256];
+  char Name1[256], Name2[256];
   log_grec *WITH;
-  Char STR1[22];
-  Char STR2[256];
-  Char STR3[256];
+  char STR1[22];
+  char STR2[256];
+  char STR3[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -848,7 +848,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Reset_PWL(act)
+void Reset_PWL(act)
 Analog_32_action *act;
 {
   PWLConst *PWLVar;
@@ -865,7 +865,7 @@ Analog_32_action *act;
 }
 
 
-Local Void PreUpdate_PWL(act)
+void PreUpdate_PWL(act)
 Analog_32_action *act;
 {
   PWLConst *PWLVar;
@@ -891,7 +891,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Update_PWL(act)
+void Update_PWL(act)
 Analog_32_action *act;
 {
   PWLConst *PWLVar;
@@ -905,7 +905,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Display_PWL(act)
+void Display_PWL(act)
 Analog_32_action *act;
 {
   PWLConst *PWLVar;
@@ -922,7 +922,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Refresh_PWL(act)
+void Refresh_PWL(act)
 Analog_32_action *act;
 {
   PWLConst *PWLVar;
@@ -933,7 +933,7 @@ Analog_32_action *act;
   Limitfill(act->inst, PWLVar->Limit, false);
 }
 
-Local Void Erase_PWL(act)
+void Erase_PWL(act)
 Analog_32_action *act;
 {
   PWLConst *PWLVar;
@@ -950,7 +950,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Void Log_PWL_INITLIB_32(act)
+void Log_PWL_INITLIB_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -958,79 +958,79 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_PWL(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_PWL(act);
     break;
 
-  case Analog_act_preupdate:
+  case ANALOG_ACT_PREUPDATE:
     PreUpdate_PWL(act);
     break;
 
-  case Analog_act_update:
+  case ANALOG_ACT_UPDATE:
     Update_PWL(act);
     break;
 
-  case Analog_act_display:
+  case ANALOG_ACT_DISPLAY:
     Display_PWL(act);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_PWL(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     Reset_PWL(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_PWL(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_PWL(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_PWL(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_PWL(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_PWL(act);
     break;
 
-  case Analog_act_erase:
+  case ANALOG_ACT_ERASE:
     Erase_PWL(act);
     break;
 
-  case Analog_act_refresh:
+  case ANALOG_ACT_REFRESH:
     Refresh_PWL(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_PWL(act);
     break;
 
diff --git a/log/src/ana/pwl.h b/log/src/ana/pwl.h
index d72d0c9..67b1437 100644
--- a/log/src/ana/pwl.h
+++ b/log/src/ana/pwl.h
@@ -1,57 +1,15 @@
-/* Header for module RESFLOAT, generated by p2c */
 #ifndef PWL_H
 #define PWL_H
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef PWL_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_pwl_initlib_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_pwl_initlib_32 (Analog_32_action *act);
 
 #endif /*PWL_H*/
 
diff --git a/log/src/ana/resfloat.c b/log/src/ana/resfloat.c
index 86c7937..7fdea34 100644
--- a/log/src/ana/resfloat.c
+++ b/log/src/ana/resfloat.c
@@ -27,12 +27,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-
-
-
-#define RESFLOAT_G
 #include "resfloat.h"
 
 
@@ -59,7 +53,7 @@ typedef struct ICResfloat {
 /****************************************************************************/
 
 
-Local Void Ex_Resfloat(act)
+void Ex_Resfloat(act)
 Analog_32_action *act;
 {
   double MinI1, MinI2, dI1dV1, dI1dV2, dI2dV1, dI2dV2;
@@ -112,7 +106,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Iin_Resfloat(act)
+void Iin_Resfloat(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr;
@@ -154,14 +148,14 @@ Analog_32_action *act;
 }  /*Iin_Resfloat*/
 
 
-Local Void GetCnf_Resfloat(NewIC)
+void GetCnf_Resfloat(NewIC)
 ICResfloat *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICResfloat *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -185,7 +179,7 @@ ICResfloat *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_Resfloat(act)
+void initlib_Resfloat(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -204,17 +198,17 @@ Analog_32_action *act;
   NewIC = (ICResfloat *)Malloc(sizeof(ICResfloat));
   NewIC->ICRes = 1000.0;
   GetCnf_Resfloat(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*Resfloat_Initlib*/
 
 
 
-Local boolean Resfloatcheck(Inst, Attrnum)
+int Resfloatcheck(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   ResfloatConst *ResfloatVar;
   Anainstlist *A_Gate;
 
@@ -235,7 +229,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_Resfloat(act)
+void Attr_Resfloat(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -248,7 +242,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Resfloat(act)
+void Newgate_Resfloat(act)
 Analog_32_action *act;
 {
   ResfloatConst *ResfloatVar;
@@ -262,7 +256,7 @@ Analog_32_action *act;
   ResfloatVar = (ResfloatConst *)Malloc(sizeof(ResfloatConst));
   ResfloatVar->Conductance = 1 / ICptr->ICRes;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)ResfloatVar;
+  A_Gate->InstVar = (void *)ResfloatVar;
   AnaCapInit(act->inst);
   WITH = act->inst;
   WITH->attr[N_Res - 1].UU.r = ICptr->ICRes;
@@ -270,7 +264,7 @@ Analog_32_action *act;
   WITH->attr[N_Res - 1].changed = true;
 }
 
-Local Void Copygate_Resfloat(act)
+void Copygate_Resfloat(act)
 Analog_32_action *act;
 {
   ResfloatConst *ResfloatVar, *Old_Resfloatvar;
@@ -282,12 +276,12 @@ Analog_32_action *act;
   ResfloatVar = (ResfloatConst *)Malloc(sizeof(ResfloatConst));
   *ResfloatVar = *Old_Resfloatvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)ResfloatVar;
+  A_Gate->InstVar = (void *)ResfloatVar;
   /*Always Do*/
   AnaCapCopy(act->inst);
 }
 
-Local Void Dispose_Resfloat(act)
+void Dispose_Resfloat(act)
 Analog_32_action *act;
 {
   ResfloatConst *ResfloatVar;
@@ -299,7 +293,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_Resfloat(act)
+void Readgate_Resfloat(act)
 Analog_32_action *act;
 {
   ResfloatConst *ResfloatVar;
@@ -314,17 +308,17 @@ Analog_32_action *act;
 }
 
 
-Local Void Probe_Resfloat(act)
+void Probe_Resfloat(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr;
   double Node1, Node2, Pin1, Pin2, d;
-  Char Name1[256], Name2[256];
+  char Name1[256], Name2[256];
   log_grec *WITH;
-  Char STR1[22];
-  Char STR2[256];
-  Char STR3[256];
+  char STR1[22];
+  char STR2[256];
+  char STR3[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -375,7 +369,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Void Log_resfloat_initlib_32(act)
+void Log_resfloat_initlib_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -383,63 +377,63 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_Resfloat(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_Resfloat(act);
     break;
 
-  case Analog_act_update:   /*8*/
+  case ANALOG_ACT_UPDATE:   /*8*/
     AnaCapUpdate(act->inst);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Resfloat(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     AnaCapReset(act->inst);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Resfloat(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Resfloat(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Resfloat(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Resfloat(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_Resfloat(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Resfloat(act);
     break;
 
diff --git a/log/src/ana/resfloat.h b/log/src/ana/resfloat.h
index 8ed274e..7883636 100644
--- a/log/src/ana/resfloat.h
+++ b/log/src/ana/resfloat.h
@@ -3,55 +3,16 @@
 #define RESFLOAT_H
 
 
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef RESFLOAT_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_resfloat_initlib_32 PP((Analog_32_action *act));
 
+extern void Log_resfloat_initlib_32 (Analog_32_action *act);
 
-#undef vextern
 
 #endif /*RESFLOAT_H*/
 
diff --git a/log/src/ana/rtd.c b/log/src/ana/rtd.c
index fe3c2ef..c9fc0ef 100644
--- a/log/src/ana/rtd.c
+++ b/log/src/ana/rtd.c
@@ -54,11 +54,8 @@ along with this program; see the file COPYING.  If not, write to
 the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-
 #include <math.h>
 #include <p2c/p2c.h>
-
-#define RTD_G
 #include "rtd.h"
 
 /* Defaults */
@@ -122,7 +119,7 @@ typedef struct ICRTD {
 /*            Procedure To Simulate Cell In Algorithm                        */
 /****************************************************************************/
 
-Local double SafeExp (x)
+double SafeExp (x)
 double	x;
 {
   if (x < -700.0)
@@ -133,7 +130,7 @@ double	x;
     return (exp (x));
 }
 
-Local Void Ex_RTD(act)
+void Ex_RTD(act)
 Analog_32_action *act;
 {
   double MinI1, MinI2, dI1dV1, dI1dV2, dI2dV1, dI2dV2;
@@ -280,7 +277,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Iin_RTD(act)
+void Iin_RTD(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr;
@@ -439,14 +436,14 @@ Analog_32_action *act;
 }  /*Iin_RTD*/
 
 
-Local Void GetCnf_RTD(NewIC)
+void GetCnf_RTD(NewIC)
 ICRTD *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICRTD *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -573,7 +570,7 @@ ICRTD *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_RTD(act)
+void initlib_RTD(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -604,17 +601,17 @@ Analog_32_action *act;
   NewIC->ICaOnsV = D_aOnsV;
 
   GetCnf_RTD(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*RTD_Initlib*/
 
 
 
-Local boolean RTDcheck(Inst, Attrnum)
+int RTDcheck(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   RTDConst *RTDVar;
   Anainstlist *A_Gate;
 
@@ -736,7 +733,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_RTD(act)
+void Attr_RTD(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -749,7 +746,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_RTD(act)
+void Newgate_RTD(act)
 Analog_32_action *act;
 {
   RTDConst *RTDVar;
@@ -785,7 +782,7 @@ Analog_32_action *act;
   RTDVar->b = y1 - (RTDVar->g1 * x1);
 
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)RTDVar;
+  A_Gate->InstVar = (void *)RTDVar;
   AnaCapInit(act->inst);
   WITH = act->inst;
 
@@ -806,7 +803,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Copygate_RTD(act)
+void Copygate_RTD(act)
 Analog_32_action *act;
 {
   RTDConst *RTDVar, *Old_RTDvar;
@@ -818,12 +815,12 @@ Analog_32_action *act;
   RTDVar = (RTDConst *)Malloc(sizeof(RTDConst));
   *RTDVar = *Old_RTDvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)RTDVar;
+  A_Gate->InstVar = (void *)RTDVar;
   /*Always Do*/
   AnaCapCopy(act->inst);
 }
 
-Local Void Dispose_RTD(act)
+void Dispose_RTD(act)
 Analog_32_action *act;
 {
   RTDConst *RTDVar;
@@ -835,7 +832,7 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_RTD(act)
+void Readgate_RTD(act)
 Analog_32_action *act;
 {
   RTDConst *RTDVar;
@@ -873,17 +870,17 @@ Analog_32_action *act;
 }
 
 
-Local Void Probe_RTD(act)
+void Probe_RTD(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
   AnaExt_rec *Node1Ptr, *Node2Ptr;
   double Node1, Node2, Pin1, Pin2, d;
-  Char Name1[256], Name2[256];
+  char Name1[256], Name2[256];
   log_grec *WITH;
-  Char STR1[22];
-  Char STR2[256];
-  Char STR3[256];
+  char STR1[22];
+  char STR2[256];
+  char STR3[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -934,7 +931,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Void Log_rtd_initlib_32(act)
+void Log_rtd_initlib_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -942,63 +939,63 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_RTD(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_RTD(act);
     break;
 
-  case Analog_act_update:   /*8*/
+  case ANALOG_ACT_UPDATE:   /*8*/
     AnaCapUpdate(act->inst);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_RTD(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     AnaCapReset(act->inst);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_RTD(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_RTD(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_RTD(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_RTD(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_RTD(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_RTD(act);
     break;
 
diff --git a/log/src/ana/rtd.h b/log/src/ana/rtd.h
index 82c9067..75d2ea5 100644
--- a/log/src/ana/rtd.h
+++ b/log/src/ana/rtd.h
@@ -1,57 +1,15 @@
-/* Header for module RESFLOAT, generated by p2c */
 #ifndef RTD_H
 #define RTD_H
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef RTD_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_rtd_initlib_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_rtd_initlib_32 (Analog_32_action *act);
 
 #endif /*RTD_H*/
 
diff --git a/log/src/ana/runspec.c b/log/src/ana/runspec.c
index a56cb88..a1531c0 100644
--- a/log/src/ana/runspec.c
+++ b/log/src/ana/runspec.c
@@ -26,9 +26,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-#define RUNSPEC_G
 #include "runspec.h"
 
 #define N_fabrun       1
@@ -52,7 +49,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /****************************************************************************/
 
 
-Local Void initlib_Runspec(act)
+void initlib_Runspec(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -63,11 +60,11 @@ Analog_32_action *act;
   NewCell->intr_cell = 0;
   NewCell->plist_cell = NULL;
   NewCell->phase = Anasimple;
-  act->kind->info = (Anyptr)NewCell;
+  act->kind->info = (void *)NewCell;
 }  /*NFET4_Initlib*/
 
 
-Local Void Reload_Runspec(act)
+void Reload_Runspec(act)
 Analog_32_action *act;
 {
   log_grec *WITH;
@@ -105,7 +102,7 @@ Analog_32_action *act;
 
 }
 
-Local Void Attr_Runspec(act)
+void Attr_Runspec(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -218,7 +215,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Openconfig_Runspec(act)
+void Openconfig_Runspec(act)
 Analog_32_action *act;
 {
   long Index;
@@ -230,11 +227,11 @@ Analog_32_action *act;
   Reload_Runspec(act);
 }
 
-Local Void Readgate_Runspec(act)
+void Readgate_Runspec(act)
 Analog_32_action *act;
 {
   log_grec *WITH;
-  Char STR1[256];
+  char STR1[256];
 
   WITH = act->inst;
   if (AnaOldmodel && !WITH->attr[0].blnk) {
@@ -251,11 +248,11 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Runspec(act)
+void Newgate_Runspec(act)
 Analog_32_action *act;
 {
   Analog_32_action Newact;
-  Char Newout[256];
+  char Newout[256];
 
   Newact.inst = act->inst;
   Newact.ok = true;
@@ -269,7 +266,7 @@ Analog_32_action *act;
 /*                 Library Listing For Cell Runspec                          */
 /*==========================================================================*/
 
-Void Log_RUNSPEC_initlib_32(act)
+void Log_RUNSPEC_initlib_32(act)
 Analog_32_action *act;
 {
   /*Body of procedure*/
@@ -277,23 +274,23 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_Runspec(act);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Runspec(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     Openconfig_Runspec(act);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Runspec(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Runspec(act);
     break;
 
@@ -311,10 +308,4 @@ Analog_32_action *act;
 #undef N_P_Mu         
 #undef N_P_Qss        
 
-
-
-
-
-
-
 /* End. */
diff --git a/log/src/ana/runspec.h b/log/src/ana/runspec.h
index 934a962..861fdf1 100644
--- a/log/src/ana/runspec.h
+++ b/log/src/ana/runspec.h
@@ -1,58 +1,15 @@
-/* Header for module RUNSPEC, generated by p2c */
 #ifndef RUNSPEC_H
 #define RUNSPEC_H
 
-
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef RUNSPEC_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_RUNSPEC_initlib_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_RUNSPEC_initlib_32 (Analog_32_action *act);
 
 #endif /*RUNSPEC_H*/
 
diff --git a/log/src/ana/stairs.c b/log/src/ana/stairs.c
index 244542e..1f5bc5f 100644
--- a/log/src/ana/stairs.c
+++ b/log/src/ana/stairs.c
@@ -26,9 +26,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-#define STAIRS_G
 #include "stairs.h"
 
 
@@ -51,14 +48,14 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 typedef struct StairsConst {
   double Conductance, Timez;
-  boolean First, Limit, OldLimit, NewLimit;
+  int First, Limit, OldLimit, NewLimit;
   double Videal, Reset_Time;
-  boolean Reset_First, Reset_Freeze;
+  int Reset_First, Reset_Freeze;
 } StairsConst;
 
 
 typedef struct ICStairs {
-  boolean ICFreeze;   /*Default Off*/
+  int ICFreeze;   /*Default Off*/
   double ICRes;   /*Default 50ohm*/
   long ICType;   /*Default 0*/
   double ICtVstart;   /*Default 0*/
@@ -71,9 +68,9 @@ typedef struct ICStairs {
 
 
 
-Local Void Switchfill(Inst, Erase)
+void Switchfill(Inst, Erase)
 log_grec *Inst;
-boolean Erase;
+int Erase;
 {
   short LLx, LLy, URx, URy;
 
@@ -96,9 +93,9 @@ boolean Erase;
   (*AnaLogglobals->hook.unhidecursor)();
 }
 
-Local Void Limitfill(Inst, Limitflag, Erase)
+void Limitfill(Inst, Limitflag, Erase)
 log_grec *Inst;
-boolean Limitflag, Erase;
+int Limitflag, Erase;
 {
   short LLx, LLy, URx, URy;
 
@@ -123,13 +120,13 @@ boolean Limitflag, Erase;
 
 
 
-Local double Stairmaker(Inst, Ftime, First)
+double Stairmaker(Inst, Ftime, First)
 log_grec *Inst;
 double Ftime;
-boolean First;
+int First;
 {
   double Result;
-  boolean Found;
+  int Found;
   double Period;
   long Step;
   double Steplength, Vinc;
@@ -180,7 +177,7 @@ boolean First;
 /*            Procedure To Simulate Cell In Algorithm                        */
 /****************************************************************************/
 
-Local Void Ex_Stairs(act)
+void Ex_Stairs(act)
 Analog_32_action *act;
 {
   /*Stairserent*/
@@ -243,7 +240,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Iin_Stairs(act)
+void Iin_Stairs(act)
 Analog_32_action *act;
 {
   /*Stairserent*/
@@ -302,14 +299,14 @@ Analog_32_action *act;
   }
 }  /*Iin_Stairs*/
 
-Local Void GetCnf_Stairs(NewIC)
+void GetCnf_Stairs(NewIC)
 ICStairs *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICStairs *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -397,7 +394,7 @@ ICStairs *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_Stairs(act)
+void initlib_Stairs(act)
 Analog_32_action *act;
 {
   /*Stairserent*/
@@ -425,16 +422,16 @@ Analog_32_action *act;
   NewIC->ICtTrantime = AnaDtmax * 2;
   NewIC->ICtRdelay = 0.0;
   GetCnf_Stairs(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*Stairs_Initlib*/
 
 
-Local boolean Stairscheck(Inst, Attrnum)
+int Stairscheck(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   StairsConst *StairsVar;
   Anainstlist *A_Gate;
 
@@ -491,7 +488,7 @@ long Attrnum;
 
 
 
-Local Void Attr_Stairs(act)
+void Attr_Stairs(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -504,7 +501,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Stairs(act)
+void Newgate_Stairs(act)
 Analog_32_action *act;
 {
   StairsConst *StairsVar;
@@ -527,7 +524,7 @@ Analog_32_action *act;
   StairsVar->OldLimit = false;
   StairsVar->NewLimit = false;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)StairsVar;
+  A_Gate->InstVar = (void *)StairsVar;
   AnaCapInit(act->inst);
   WITH = act->inst;
   WITH->attr[N_Freeze - 1].UU.b = ICptr->ICFreeze;
@@ -545,7 +542,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Copygate_Stairs(act)
+void Copygate_Stairs(act)
 Analog_32_action *act;
 {
   StairsConst *StairsVar, *Old_Stairsvar;
@@ -556,12 +553,12 @@ Analog_32_action *act;
   StairsVar = (StairsConst *)Malloc(sizeof(StairsConst));
   *StairsVar = *Old_Stairsvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)StairsVar;
+  A_Gate->InstVar = (void *)StairsVar;
   AnaCapCopy(act->inst);
 }
 
 
-Local Void Dispose_Stairs(act)
+void Dispose_Stairs(act)
 Analog_32_action *act;
 {
   StairsConst *StairsVar;
@@ -573,13 +570,13 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_Stairs(act)
+void Readgate_Stairs(act)
 Analog_32_action *act;
 {
   StairsConst *StairsVar;
   Anainstlist *A_Gate;
   log_grec *WITH1;
-  Char STR1[256];
+  char STR1[256];
 
   AnaCapattrread((long)Cstart, act->inst);   /*Read capacitors*/
   A_Gate = (Anainstlist *)act->inst->info;
@@ -606,7 +603,7 @@ Analog_32_action *act;
   StairsVar->Reset_Freeze = (*STR1 == 'T' || *STR1 == 't');
 }
 
-Local Void Writegate_Stairs(act)
+void Writegate_Stairs(act)
 Analog_32_action *act;
 {
   StairsConst *StairsVar;
@@ -630,7 +627,7 @@ Analog_32_action *act;
 
 
 
-Local Void Reset_Stairs(act)
+void Reset_Stairs(act)
 Analog_32_action *act;
 {
   StairsConst *StairsVar;
@@ -651,7 +648,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Set_Stairs(act)
+void Set_Stairs(act)
 Analog_32_action *act;
 {
   StairsConst *StairsVar;
@@ -664,7 +661,7 @@ Analog_32_action *act;
   StairsVar->Reset_Freeze = act->inst->attr[N_Freeze - 1].UU.b;
 }
 
-Local Void Clear_Stairs(act)
+void Clear_Stairs(act)
 Analog_32_action *act;
 {
   StairsConst *StairsVar;
@@ -681,7 +678,7 @@ Analog_32_action *act;
   StairsVar->Reset_Freeze = ICptr->ICFreeze;
 }
 
-Local Void PreUpdate_Stairs(act)
+void PreUpdate_Stairs(act)
 Analog_32_action *act;
 {
   StairsConst *StairsVar;
@@ -700,7 +697,7 @@ Analog_32_action *act;
   StairsVar->NewLimit = (fabs(VPin1 - VPin2 - StairsVar->Videal) > 0.1);
 }
 
-Local Void Update_Stairs(act)
+void Update_Stairs(act)
 Analog_32_action *act;
 {
   StairsConst *StairsVar;
@@ -717,7 +714,7 @@ Analog_32_action *act;
     StairsVar->Timez += AnaDtlast;
 }
 
-Local Void Display_Stairs(act)
+void Display_Stairs(act)
 Analog_32_action *act;
 {
   StairsConst *StairsVar;
@@ -750,7 +747,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Touch_Stairs(act)
+void Touch_Stairs(act)
 Analog_32_action *act;
 {
   log_action *WITH;
@@ -767,7 +764,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Erase_Stairs(Inst)
+void Erase_Stairs(Inst)
 log_grec *Inst;
 {
   StairsConst *StairsVar;
@@ -779,7 +776,7 @@ log_grec *Inst;
   Limitfill(Inst, StairsVar->Limit, true);
 }
 
-Local Void Refresh_Stairs(Inst)
+void Refresh_Stairs(Inst)
 log_grec *Inst;
 {
   StairsConst *StairsVar;
@@ -791,7 +788,7 @@ log_grec *Inst;
   Limitfill(Inst, StairsVar->Limit, false);
 }
 
-Local Void Probe_Stairs(act)
+void Probe_Stairs(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
@@ -799,8 +796,8 @@ Analog_32_action *act;
   AnaExt_rec *Node1Ptr, *Node2Ptr;
   double Node1, Node2, Pin1, Pin2, d;
   log_grec *WITH;
-  Char STR1[256];
-  Char STR2[256];
+  char STR1[256];
+  char STR2[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -840,98 +837,98 @@ $End$*/
 /*=============================================================================*/
 
 
-Void Log_stairs_initlib_32(act)
+void Log_stairs_initlib_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_Stairs(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_Stairs(act);
     break;
 
-  case Analog_act_preupdate:
+  case ANALOG_ACT_PREUPDATE:
     PreUpdate_Stairs(act);
     break;
 
-  case Analog_act_update:
+  case ANALOG_ACT_UPDATE:
     Update_Stairs(act);
     break;
 
-  case Analog_act_display:
+  case ANALOG_ACT_DISPLAY:
     Display_Stairs(act);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Stairs(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     Reset_Stairs(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Stairs(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Stairs(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Stairs(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Stairs(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     Writegate_Stairs(act);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_Stairs(act);
     break;
 
-  case Analog_act_erase:
+  case ANALOG_ACT_ERASE:
     Erase_Stairs(act->inst);
     break;
 
-  case Analog_act_refresh:
+  case ANALOG_ACT_REFRESH:
     Refresh_Stairs(act->inst);
     break;
 
-  case Analog_act_touch:
+  case ANALOG_ACT_TOUCH:
     Touch_Stairs(act);
     break;
 
-  case Analog_act_set:
+  case ANALOG_ACT_SET:
     Set_Stairs(act);
     break;
 
-  case Analog_act_clear:
+  case ANALOG_ACT_CLEAR:
     Clear_Stairs(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Stairs(act);
     break;
 
diff --git a/log/src/ana/stairs.h b/log/src/ana/stairs.h
index d009ab9..efe361f 100644
--- a/log/src/ana/stairs.h
+++ b/log/src/ana/stairs.h
@@ -1,50 +1,16 @@
-/* Header for module STAIRS, generated by p2c */
 #ifndef STAIRS_H
 #define STAIRS_H
 
 
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef STAIRS_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-
-extern Void Log_stairs_initlib_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_stairs_initlib_32 (Analog_32_action *act);
 
 #endif /*STAIRS_H*/
 
diff --git a/log/src/ana/tc.c b/log/src/ana/tc.c
index b42d772..5cc99b3 100644
--- a/log/src/ana/tc.c
+++ b/log/src/ana/tc.c
@@ -28,20 +28,10 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
   write procedures*/
 
 
-
-
-
 #include <p2c/p2c.h>
-
-
-
-
-#define TC_G
 #include "tc.h"
 
 
-
-
 #define Normal          0
 #define Wide            1
 #define Hwr             2
@@ -106,7 +96,7 @@ typedef struct TCAmpConst {
 
   double TauVset, TauVout, TauVdiff;
 
-  boolean Limit, OldLimit, NewLimit;
+  int Limit, OldLimit, NewLimit;
 
   /*For every 'state variable'*/
   /*OldState:Statetype;*/
@@ -130,7 +120,7 @@ typedef enum {
 } Deltasign;
 
 
-Static long AmpRange;
+static long AmpRange;
 
 
 /*The library of shared procedures among all four gates*/
@@ -141,9 +131,9 @@ Static long AmpRange;
 /****************************************************************************/
 
 
-Static Void Limitfill(Inst, Limitflag, Erase)
+static void Limitfill(Inst, Limitflag, Erase)
 log_grec *Inst;
-boolean Limitflag, Erase;
+int Limitflag, Erase;
 {
   short LLx, LLy, URx, URy;
 
@@ -171,14 +161,14 @@ boolean Limitflag, Erase;
 /*                   Cell Installation Procedures                           */
 /****************************************************************************/
 
-Static Void GetCnf_TCAmp(NewIC)
+static void GetCnf_TCAmp(NewIC)
 ICTCAmp *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICTCAmp *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -327,7 +317,7 @@ ICTCAmp *NewIC;
 }
 
 
-Static Void INITLIB_TCAMP(act)
+static void INITLIB_TCAMP(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -382,8 +372,8 @@ Analog_32_action *act;
   NewIC->InitCdbVout = 10e-15;
   NewIC->InitCgbVset = 10e-15;
   GetCnf_TCAmp(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*TCAmp_Initlib*/
 
 
@@ -402,11 +392,11 @@ Analog_32_action *act;
       TimeTooSmall=1e-60;*/
 
 
-Static boolean TCAmpcheck(Inst, Attrnum)
+static int TCAmpcheck(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   TCAmpConst *TCAmpVar;
   Anainstlist *A_Gate;
 
@@ -510,7 +500,7 @@ long Attrnum;
 }
 
 
-Static Void Attr_TCAmp(act)
+static void Attr_TCAmp(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -528,7 +518,7 @@ Analog_32_action *act;
 }
 
 
-Static Void Newgate_TCAmp(act)
+static void Newgate_TCAmp(act)
 Analog_32_action *act;
 {
   TCAmpConst *TCAmpVar;
@@ -565,7 +555,7 @@ Analog_32_action *act;
   TCAmpVar->NewLimit = false;
   /*Give internal variables values derived from initial attribute values*/
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)TCAmpVar;
+  A_Gate->InstVar = (void *)TCAmpVar;
   AnaCapInit(act->inst);   /*Initialize attributes of Cstart*/
   switch (AmpRange) {
 
@@ -625,7 +615,7 @@ Analog_32_action *act;
 }
 
 
-Static Void Copygate_TCAmp(act)
+static void Copygate_TCAmp(act)
 Analog_32_action *act;
 {
   TCAmpConst *TCAmpVar, *Old_TCAmpvar;
@@ -636,12 +626,12 @@ Analog_32_action *act;
   TCAmpVar = (TCAmpConst *)Malloc(sizeof(TCAmpConst));
   *TCAmpVar = *Old_TCAmpvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)TCAmpVar;
+  A_Gate->InstVar = (void *)TCAmpVar;
   AnaCapCopy(act->inst);
 }
 
 
-Static Void Dispose_TCAmp(act)
+static void Dispose_TCAmp(act)
 Analog_32_action *act;
 {
   TCAmpConst *TCAmpVar;
@@ -654,7 +644,7 @@ Analog_32_action *act;
 }
 
 
-Static Void Readgate_TCAmp(act)
+static void Readgate_TCAmp(act)
 Analog_32_action *act;
 {
   TCAmpConst *TCAmpVar;
@@ -751,7 +741,7 @@ Analog_32_action *act;
 }
 
 
-Static Void Reset_TCAmp(act)
+static void Reset_TCAmp(act)
 Analog_32_action *act;
 {
   TCAmpConst *TCAmpVar;
@@ -768,7 +758,7 @@ Analog_32_action *act;
 }
 
 
-Static Void PreUpdate_TCAmp(act)
+static void PreUpdate_TCAmp(act)
 Analog_32_action *act;
 {
   TCAmpConst *TCAmpVar;
@@ -817,7 +807,7 @@ Analog_32_action *act;
 }
 
 
-Static Void Update_TCAmp(act)
+static void Update_TCAmp(act)
 Analog_32_action *act;
 {
   TCAmpConst *TCAmpVar;
@@ -831,7 +821,7 @@ Analog_32_action *act;
 }
 
 
-Static Void Display_TCAmp(act)
+static void Display_TCAmp(act)
 Analog_32_action *act;
 {
   TCAmpConst *TCAmpVar;
@@ -848,7 +838,7 @@ Analog_32_action *act;
 }
 
 
-Static Void Refresh_TCAmp(act)
+static void Refresh_TCAmp(act)
 Analog_32_action *act;
 {
   TCAmpConst *TCAmpVar;
@@ -861,7 +851,7 @@ Analog_32_action *act;
 
 
 
-Static Void Erase_TCAmp(act)
+static void Erase_TCAmp(act)
 Analog_32_action *act;
 {
   TCAmpConst *TCAmpVar;
@@ -874,7 +864,7 @@ Analog_32_action *act;
 
 
 
-Static Void Probe_TCAmp(act)
+static void Probe_TCAmp(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
@@ -882,11 +872,11 @@ Analog_32_action *act;
   double Node1, Node2, Node3, Node4, Pin1, Pin2, Pin3, Pin4;
   TCAmpConst *TCAmpVar;
   double ExpoVset, BlendVset, Iset;
-  boolean Outhigh, Outlow;
+  int Outhigh, Outlow;
   long IntAmp;
   log_grec *WITH;
-  Char STR1[256];
-  Char STR2[256];
+  char STR1[256];
+  char STR2[256];
 
   WITH = act->inst;
   IntAmp = AmpRange;
@@ -1012,7 +1002,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Ex_TCAmp(act)
+void Ex_TCAmp(act)
 Analog_32_action *act;
 {
   double MinI1, dI1dV1, dI1dV2, dI1dV3, dI1dV4, MinI2, dI2dV1, dI2dV2, dI2dV3,
@@ -1581,7 +1571,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Iin_TCAmp(act)
+void Iin_TCAmp(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr;
@@ -1811,7 +1801,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Static Void TC_System(act)
+static void TC_System(act)
 Analog_32_action *act;
 {
 
@@ -1826,79 +1816,79 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     INITLIB_TCAMP(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_TCAmp(act);
     break;
 
-  case Analog_act_preupdate:
+  case ANALOG_ACT_PREUPDATE:
     PreUpdate_TCAmp(act);
     break;
 
-  case Analog_act_update:   /*For complex gates - see IDIFF*/
+  case ANALOG_ACT_UPDATE:   /*For complex gates - see IDIFF*/
     Update_TCAmp(act);
     break;
 
-  case Analog_act_display:
+  case ANALOG_ACT_DISPLAY:
     Display_TCAmp(act);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_TCAmp(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     Reset_TCAmp(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_TCAmp(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_TCAmp(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_TCAmp(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_TCAmp(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_TCAmp(act);
     break;
 
-  case Analog_act_erase:
+  case ANALOG_ACT_ERASE:
     Erase_TCAmp(act);
     break;
 
-  case Analog_act_refresh:
+  case ANALOG_ACT_REFRESH:
     Refresh_TCAmp(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_TCAmp(act);
     break;
 
@@ -1908,7 +1898,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Ex_Abs(act)
+void Ex_Abs(act)
 Analog_32_action *act;
 {
   double MinI1, dI1dV1, dI1dV2, dI1dV3, dI1dV4, MinI2, dI2dV1, dI2dV2, dI2dV3,
@@ -2305,7 +2295,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Iin_Abs(act)
+void Iin_Abs(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr;
@@ -2481,7 +2471,7 @@ Analog_32_action *act;
 /*==========================================================================*/
 
 
-Static Void Abs_System(act)
+static void Abs_System(act)
 Analog_32_action *act;
 {
 
@@ -2497,79 +2487,79 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     INITLIB_TCAMP(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_Abs(act);
     break;
 
-  case Analog_act_preupdate:
+  case ANALOG_ACT_PREUPDATE:
     PreUpdate_TCAmp(act);
     break;
 
-  case Analog_act_update:   /*For complex gates - see IDIFF*/
+  case ANALOG_ACT_UPDATE:   /*For complex gates - see IDIFF*/
     Update_TCAmp(act);
     break;
 
-  case Analog_act_display:
+  case ANALOG_ACT_DISPLAY:
     Display_TCAmp(act);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_TCAmp(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     Reset_TCAmp(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_TCAmp(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_TCAmp(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_TCAmp(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_TCAmp(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     AnaCapattrwrite((long)Cstart, act->inst);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_Abs(act);
     break;
 
-  case Analog_act_erase:
+  case ANALOG_ACT_ERASE:
     Erase_TCAmp(act);
     break;
 
-  case Analog_act_refresh:
+  case ANALOG_ACT_REFRESH:
     Refresh_TCAmp(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_TCAmp(act);
     break;
 
@@ -2579,7 +2569,7 @@ Analog_32_action *act;
 }
 
 
-Void Log_opamp_initlib_32(act)
+void Log_opamp_initlib_32(act)
 Analog_32_action *act;
 {
   AmpRange = Normal;
@@ -2587,7 +2577,7 @@ Analog_32_action *act;
 }
 
 
-Void Log_wramp_initlib_32(act)
+void Log_wramp_initlib_32(act)
 Analog_32_action *act;
 {
   AmpRange = Wide;
@@ -2595,7 +2585,7 @@ Analog_32_action *act;
 }
 
 
-Void Log_hwr_initlib_32(act)
+void Log_hwr_initlib_32(act)
 Analog_32_action *act;
 {
   AmpRange = Hwr;
@@ -2603,7 +2593,7 @@ Analog_32_action *act;
 }
 
 
-Void Log_fwr_initlib_32(act)
+void Log_fwr_initlib_32(act)
 Analog_32_action *act;
 {
   AmpRange = Fwr;
diff --git a/log/src/ana/tc.h b/log/src/ana/tc.h
index 96c6bbf..9339897 100644
--- a/log/src/ana/tc.h
+++ b/log/src/ana/tc.h
@@ -1,60 +1,19 @@
-/* Header for module TC, generated by p2c */
 #ifndef TC_H
 #define TC_H
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef TC_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-/*$If Float$
-  $float_hdw on$
-  $End$*/
-/*$If Debugflag$
-  $Debug$
-  $End$*/
-
-
-extern Void Log_opamp_initlib_32 PP((Analog_32_action *act));
-extern Void Log_wramp_initlib_32 PP((Analog_32_action *act));
-extern Void Log_hwr_initlib_32 PP((Analog_32_action *act));
-
-extern Void Log_fwr_initlib_32 PP((Analog_32_action *act));
 
+extern void Log_opamp_initlib_32 (Analog_32_action *act);
+extern void Log_wramp_initlib_32 (Analog_32_action *act);
+extern void Log_hwr_initlib_32 (Analog_32_action *act);
+extern void Log_fwr_initlib_32 (Analog_32_action *act);
 
-#undef vextern
 
 #endif /*TC_H*/
 
diff --git a/log/src/ana/thermal.c b/log/src/ana/thermal.c
index 7f4288f..97ab73a 100644
--- a/log/src/ana/thermal.c
+++ b/log/src/ana/thermal.c
@@ -26,9 +26,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-#define THERMAL_G
 #include "thermal.h"
 
 #define N_Kelvin       1
@@ -46,8 +43,8 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 typedef struct ThermalConst {
-  Char OldDisplay[256], Display[256];
-  boolean Changed;
+  char OldDisplay[256], Display[256];
+  int Changed;
 } ThermalConst;
 
 
@@ -58,11 +55,11 @@ typedef struct ICThermal {
 
 
 
-Local Void GetCnf_Thermal(NewIC)
+void GetCnf_Thermal(NewIC)
 ICThermal *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   ICThermal *WITH;
 
   WITH = NewIC;
@@ -104,7 +101,7 @@ ICThermal *NewIC;
 /****************************************************************************/
 
 
-Local Void initlib_Thermal(act)
+void initlib_Thermal(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -119,17 +116,17 @@ Analog_32_action *act;
   NewIC = (ICThermal *)Malloc(sizeof(ICThermal));
   NewIC->InitUnits = Kdisplay;
   GetCnf_Thermal(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*NFET4_Initlib*/
 
-Local Void Refresh_Thermal(act)
+void Refresh_Thermal(act)
 Analog_32_action *act;
 {
   short Tx, Ty;
   Anainstlist *A_Gate;
   ThermalConst *ThermalVar, *WITH;
-  Char Newout[256];
+  char Newout[256];
 
   A_Gate = (Anainstlist *)act->inst->info;
   ThermalVar = (ThermalConst *)A_Gate->InstVar;
@@ -173,7 +170,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Erase_Thermal(act)
+void Erase_Thermal(act)
 Analog_32_action *act;
 {
   short Tx, Ty;
@@ -197,7 +194,7 @@ Analog_32_action *act;
 
 
  
-Local Void Attr_Thermal(act)
+void Attr_Thermal(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -293,7 +290,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Openconfig_Thermal(act)
+void Openconfig_Thermal(act)
 Analog_32_action *act;
 {
   long Index;
@@ -313,11 +310,11 @@ Analog_32_action *act;
   WITH->attr[N_Celsius - 1].changed = true;
 }
 
-Local Void Readgate_Thermal(act)
+void Readgate_Thermal(act)
 Analog_32_action *act;
 {
   log_grec *WITH;
-  Char STR1[256];
+  char STR1[256];
 
   WITH = act->inst;
   if (AnaOldmodel && !WITH->attr[0].blnk) {
@@ -328,7 +325,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Thermal(act)
+void Newgate_Thermal(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
@@ -336,7 +333,7 @@ Analog_32_action *act;
   ICThermal *ICptr;
   ThermalConst *ThermalVar;
   Analog_32_action Newact;
-  Char Newout[256];
+  char Newout[256];
 
   ThermalVar = (ThermalConst *)Malloc(sizeof(ThermalConst));
   Cellptr = (AnaCell_rec *)act->inst->kind->info;
@@ -349,7 +346,7 @@ Analog_32_action *act;
   /*ThermalVar->OldErase = AnaErase;*/
 
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)ThermalVar;
+  A_Gate->InstVar = (void *)ThermalVar;
   Newact.inst = act->inst;
   Newact.ok = true;
   Openconfig_Thermal(&Newact);
@@ -379,7 +376,7 @@ Analog_32_action *act;
     }
 }
 
-Local Void Copygate_Thermal(act)
+void Copygate_Thermal(act)
 Analog_32_action *act;
 {
   ThermalConst *ThermalVar, *Old_ThermalVar;
@@ -390,10 +387,10 @@ Analog_32_action *act;
   ThermalVar = (ThermalConst *)Malloc(sizeof(ThermalConst));
   *ThermalVar = *Old_ThermalVar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)ThermalVar;
+  A_Gate->InstVar = (void *)ThermalVar;
 }
 
-Local Void Dispose_Thermal(act)
+void Dispose_Thermal(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
@@ -410,7 +407,7 @@ Analog_32_action *act;
 /*                 Library Listing For Cell Thermal                    */
 /*==========================================================================*/
 
-Void Log_THERMAL_initlib_32(act)
+void Log_THERMAL_initlib_32(act)
 Analog_32_action *act;
 {
   /*Body of procedure*/
@@ -418,39 +415,39 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_Thermal(act);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Thermal(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     Openconfig_Thermal(act);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Thermal(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Thermal(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Thermal(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Thermal(act);
     break;
 
-  case Analog_act_erase:
+  case ANALOG_ACT_ERASE:
     Erase_Thermal(act);
     break;
 
-  case Analog_act_refresh:
+  case ANALOG_ACT_REFRESH:
     Refresh_Thermal(act);
     break;
 
diff --git a/log/src/ana/thermal.h b/log/src/ana/thermal.h
index 5db3dad..e1152cb 100644
--- a/log/src/ana/thermal.h
+++ b/log/src/ana/thermal.h
@@ -1,58 +1,15 @@
-/* Header for module THERMAL, generated by p2c */
 #ifndef THERMAL_H
 #define THERMAL_H
 
-
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef THERMAL_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-/*$If Float$
-$float_hdw on$
-$End$*/
-/*$If Debugflag$
-$Debug$
-$End$*/
-
-
-
-extern Void Log_THERMAL_initlib_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_THERMAL_initlib_32 (Analog_32_action *act);
 
 #endif /*THERMAL_H*/
 
diff --git a/log/src/ana/vdiff.c b/log/src/ana/vdiff.c
index adae695..24af02a 100644
--- a/log/src/ana/vdiff.c
+++ b/log/src/ana/vdiff.c
@@ -26,11 +26,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-
-
-#define VDIFF_G
 #include "vdiff.h"
 
 
@@ -60,14 +55,14 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 typedef struct VdiffConst {
   double Conductance, Timez;
-  boolean First, Limit, OldLimit, NewLimit;
+  int First, Limit, OldLimit, NewLimit;
   double Videal, Reset_Time;
-  boolean Reset_First, Reset_Freeze;
+  int Reset_First, Reset_Freeze;
 } VdiffConst;
 
 
 typedef struct ICVdiff {
-  boolean ICFreeze;   /*Default Off*/
+  int ICFreeze;   /*Default Off*/
   double ICRes;   /*Default 50ohm*/
   long ICType;   /*Default 0*/
   double ICdc;   /*Default 0*/
@@ -88,9 +83,9 @@ typedef struct ICVdiff {
 
 
 
-Local Void Switchfill(Inst, Erase)
+void Switchfill(Inst, Erase)
 log_grec *Inst;
-boolean Erase;
+int Erase;
 {
   short LLx, LLy, URx, URy;
 
@@ -113,9 +108,9 @@ boolean Erase;
   (*AnaLogglobals->hook.unhidecursor)();
 }
 
-Local Void Limitfill(Inst, Limitflag, Erase)
+void Limitfill(Inst, Limitflag, Erase)
 log_grec *Inst;
-boolean Limitflag, Erase;
+int Limitflag, Erase;
 {
   short LLx, LLy, URx, URy;
 
@@ -139,13 +134,13 @@ boolean Limitflag, Erase;
 }
 
 
-Local double Pulsemaker(Inst, Ftime, First)
+double Pulsemaker(Inst, Ftime, First)
 log_grec *Inst;
 double Ftime;
-boolean First;
+int First;
 {
   double Result;
-  boolean Found;
+  int Found;
 
   Found = false;
   if (First) {
@@ -198,7 +193,7 @@ boolean First;
 /*            Procedure To Simulate Cell In Algorithm                        */
 /****************************************************************************/
 
-Local Void Ex_Vdiff(act)
+void Ex_Vdiff(act)
 Analog_32_action *act;
 {
   /*Vdifferent*/
@@ -276,7 +271,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Iin_Vdiff(act)
+void Iin_Vdiff(act)
 Analog_32_action *act;
 {
   /*Vdifferent*/
@@ -370,14 +365,14 @@ Analog_32_action *act;
 }  /*Iin_Vdiff*/
 
 
-Local Void GetCnf_Vdiff(NewIC)
+void GetCnf_Vdiff(NewIC)
 ICVdiff *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICVdiff *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -537,7 +532,7 @@ ICVdiff *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_Vdiff(act)
+void initlib_Vdiff(act)
 Analog_32_action *act;
 {
   /*Vdifferent*/
@@ -573,17 +568,17 @@ Analog_32_action *act;
   NewIC->ICpPeriod = 20 * AnaDtmax;
   NewIC->ICpRDelay = 0.0;
   GetCnf_Vdiff(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void *)NewCell;
 }  /*Vdiff_Initlib*/
 
 
 
-Local boolean Vdiffcheck(Inst, Attrnum)
+int Vdiffcheck(Inst, Attrnum)
 log_grec *Inst;
 long Attrnum;
 {
-  boolean Result;
+  int Result;
   VdiffConst *VdiffVar;
   Anainstlist *A_Gate;
 
@@ -685,7 +680,7 @@ long Attrnum;
 }
 
 
-Local Void Attr_Vdiff(act)
+void Attr_Vdiff(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -698,7 +693,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Newgate_Vdiff(act)
+void Newgate_Vdiff(act)
 Analog_32_action *act;
 {
   VdiffConst *VdiffVar;
@@ -721,7 +716,7 @@ Analog_32_action *act;
   VdiffVar->OldLimit = false;
   VdiffVar->NewLimit = false;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)VdiffVar;
+  A_Gate->InstVar = (void *)VdiffVar;
   AnaCapInit(act->inst);
   WITH = act->inst;
   WITH->attr[N_Freeze - 1].UU.b = ICptr->ICFreeze;
@@ -747,7 +742,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Copygate_Vdiff(act)
+void Copygate_Vdiff(act)
 Analog_32_action *act;
 {
   VdiffConst *VdiffVar, *Old_Vdiffvar;
@@ -758,12 +753,12 @@ Analog_32_action *act;
   VdiffVar = (VdiffConst *)Malloc(sizeof(VdiffConst));
   *VdiffVar = *Old_Vdiffvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)VdiffVar;
+  A_Gate->InstVar = (void *)VdiffVar;
   AnaCapCopy(act->inst);
 }
 
 
-Local Void Dispose_Vdiff(act)
+void Dispose_Vdiff(act)
 Analog_32_action *act;
 {
   VdiffConst *VdiffVar;
@@ -775,13 +770,13 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_Vdiff(act)
+void Readgate_Vdiff(act)
 Analog_32_action *act;
 {
   VdiffConst *VdiffVar;
   Anainstlist *A_Gate;
   log_grec *WITH1;
-  Char STR1[256];
+  char STR1[256];
 
   AnaCapattrread((long)Cstart, act->inst);   /*Read capacitors*/
   A_Gate = (Anainstlist *)act->inst->info;
@@ -808,7 +803,7 @@ Analog_32_action *act;
   VdiffVar->Reset_Freeze = (*STR1 == 'T' || *STR1 == 't');
 }
 
-Local Void Writegate_Vdiff(act)
+void Writegate_Vdiff(act)
 Analog_32_action *act;
 {
   VdiffConst *VdiffVar;
@@ -832,7 +827,7 @@ Analog_32_action *act;
 
 
 
-Local Void Reset_Vdiff(act)
+void Reset_Vdiff(act)
 Analog_32_action *act;
 {
   VdiffConst *VdiffVar;
@@ -853,7 +848,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Set_Vdiff(act)
+void Set_Vdiff(act)
 Analog_32_action *act;
 {
   VdiffConst *VdiffVar;
@@ -866,7 +861,7 @@ Analog_32_action *act;
   VdiffVar->Reset_Freeze = act->inst->attr[N_Freeze - 1].UU.b;
 }
 
-Local Void Clear_Vdiff(act)
+void Clear_Vdiff(act)
 Analog_32_action *act;
 {
   VdiffConst *VdiffVar;
@@ -883,7 +878,7 @@ Analog_32_action *act;
   VdiffVar->Reset_Freeze = ICptr->ICFreeze;
 }
 
-Local Void PreUpdate_VDiff(act)
+void PreUpdate_VDiff(act)
 Analog_32_action *act;
 {
   VdiffConst *VDiffVar;
@@ -903,7 +898,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Update_VDiff(act)
+void Update_VDiff(act)
 Analog_32_action *act;
 {
   VdiffConst *VDiffVar;
@@ -920,7 +915,7 @@ Analog_32_action *act;
     VDiffVar->Timez += AnaDtlast;
 }
 
-Local Void Display_VDiff(act)
+void Display_VDiff(act)
 Analog_32_action *act;
 {
   VdiffConst *VDiffVar;
@@ -951,7 +946,7 @@ Analog_32_action *act;
 
 
 
-Local Void Touch_Vdiff(act)
+void Touch_Vdiff(act)
 Analog_32_action *act;
 {
   log_action *WITH;
@@ -968,7 +963,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Erase_Vdiff(Inst)
+void Erase_Vdiff(Inst)
 log_grec *Inst;
 {
   VdiffConst *VDiffVar;
@@ -980,7 +975,7 @@ log_grec *Inst;
   Limitfill(Inst, VDiffVar->Limit, true);
 }
 
-Local Void Refresh_Vdiff(Inst)
+void Refresh_Vdiff(Inst)
 log_grec *Inst;
 {
   VdiffConst *VDiffVar;
@@ -992,7 +987,7 @@ log_grec *Inst;
   Limitfill(Inst, VDiffVar->Limit, false);
 }
 
-Local Void Probe_Vdiff(act)
+void Probe_Vdiff(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
@@ -1000,11 +995,11 @@ Analog_32_action *act;
   AnaExt_rec *Node1Ptr, *Node2Ptr;
   double Node1, Node2, Pin1, Pin2, d;
   log_grec *WITH;
-  Char STR1[20];
-  Char STR2[24];
-  Char STR3[22];
-  Char STR4[256];
-  Char STR5[256];
+  char STR1[20];
+  char STR2[24];
+  char STR3[22];
+  char STR4[256];
+  char STR5[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -1053,7 +1048,7 @@ Analog_32_action *act;
 /*=============================================================================*/
 
 
-Void Log_vdiff_initlib_32(act)
+void Log_vdiff_initlib_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
@@ -1061,91 +1056,91 @@ Analog_32_action *act;
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_Vdiff(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_Vdiff(act);
     break;
 
-  case Analog_act_preupdate:
+  case ANALOG_ACT_PREUPDATE:
     PreUpdate_VDiff(act);
     break;
 
-  case Analog_act_update:
+  case ANALOG_ACT_UPDATE:
     Update_VDiff(act);
     break;
 
-  case Analog_act_display:
+  case ANALOG_ACT_DISPLAY:
     Display_VDiff(act);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Vdiff(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     Reset_Vdiff(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Vdiff(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Vdiff(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Vdiff(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Vdiff(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     Writegate_Vdiff(act);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_Vdiff(act);
     break;
 
-  case Analog_act_erase:
+  case ANALOG_ACT_ERASE:
     Erase_Vdiff(act->inst);
     break;
 
-  case Analog_act_refresh:
+  case ANALOG_ACT_REFRESH:
     Refresh_Vdiff(act->inst);
     break;
 
-  case Analog_act_touch:
+  case ANALOG_ACT_TOUCH:
     Touch_Vdiff(act);
     break;
 
-  case Analog_act_set:
+  case ANALOG_ACT_SET:
     Set_Vdiff(act);
     break;
 
-  case Analog_act_clear:
+  case ANALOG_ACT_CLEAR:
     Clear_Vdiff(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Vdiff(act);
     break;
 
diff --git a/log/src/ana/vdiff.h b/log/src/ana/vdiff.h
index 11fdede..610ea18 100644
--- a/log/src/ana/vdiff.h
+++ b/log/src/ana/vdiff.h
@@ -3,48 +3,15 @@
 #define VDIFF_H
 
 
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef VDIFF_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-
-
-extern Void Log_vdiff_initlib_32 PP((Analog_32_action *act));
-
 
-#undef vextern
+extern void Log_vdiff_initlib_32 (Analog_32_action *act);
 
 #endif /*VDIFF_H*/
 
diff --git a/log/src/ana/vswitch.c b/log/src/ana/vswitch.c
index 9f793fd..8ff5bcd 100644
--- a/log/src/ana/vswitch.c
+++ b/log/src/ana/vswitch.c
@@ -26,11 +26,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-
-
-#define VSWITCH_G
 #include "vswitch.h"
 
 
@@ -60,11 +55,11 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 typedef struct VswitchConst {
   double Conductance;
-  boolean State, OldState, NewState;
+  int State, OldState, NewState;
   double Time;
-  boolean Limit, OldLimit, NewLimit;
+  int Limit, OldLimit, NewLimit;
   double OldVideal, NewVideal, Videal, Reset_Time, Reset_Videal;
-  boolean Reset_State;
+  int Reset_State;
 } VswitchConst;
 
 
@@ -85,9 +80,9 @@ typedef struct ICVswitch {
 
 
 
-Local Void Vswitchfill(Inst, State, Erase)
+void Vswitchfill(Inst, State, Erase)
 log_grec *Inst;
-boolean State, Erase;
+int State, Erase;
 {
   short LLx, LLy, URx, URy;
 
@@ -110,9 +105,9 @@ boolean State, Erase;
   (*AnaLogglobals->hook.unhidecursor)();
 }
 
-Local Void Limitfill(Inst, Limitflag, Erase)
+void Limitfill(Inst, Limitflag, Erase)
 log_grec *Inst;
-boolean Limitflag, Erase;
+int Limitflag, Erase;
 {
   short LLx, LLy, URx, URy;
 
@@ -136,10 +131,10 @@ boolean Limitflag, Erase;
 }
 
 
-Local double Bistablemaker(Inst, time, State, Ex, OldVideal)
+double Bistablemaker(Inst, time, State, Ex, OldVideal)
 log_grec *Inst;
 double time;
-boolean State, Ex;
+int State, Ex;
 double OldVideal;
 {
   double Newtime, Ratio;
@@ -166,10 +161,10 @@ double OldVideal;
 }
 
 
-Local double Monostablemaker(Inst, time, State, Ex, OldVideal)
+double Monostablemaker(Inst, time, State, Ex, OldVideal)
 log_grec *Inst;
 double time;
-boolean State, Ex;
+int State, Ex;
 double OldVideal;
 {
   double Newtime, Ratio;
@@ -206,7 +201,7 @@ double OldVideal;
 /*            Procedure To Simulate Cell In Algorithm                        */
 /****************************************************************************/
 
-Local Void Ex_Vswitch(act)
+void Ex_Vswitch(act)
 Analog_32_action *act;
 {
   double MinI1, dI1dV1;
@@ -254,7 +249,7 @@ Analog_32_action *act;
 /****************************************************************************/
 
 
-Local Void Iin_Vswitch(act)
+void Iin_Vswitch(act)
 Analog_32_action *act;
 {
   AnaExt_rec *Pin1Ptr;
@@ -297,14 +292,14 @@ Analog_32_action *act;
 }  /*Iin_Vswitch*/
 
 
-Local Void GetCnf_Vswitch(NewIC)
+void GetCnf_Vswitch(NewIC)
 ICVswitch *NewIC;
 {
-  boolean Found;
-  Char Arg[256], Keyword[256];
+  int Found;
+  char Arg[256], Keyword[256];
   long Dummy;
   ICVswitch *WITH;
-  Char *STR1;
+  char *STR1;
 
   WITH = NewIC;
   do {
@@ -420,7 +415,7 @@ ICVswitch *NewIC;
 /*                          Installation Procedure                           */
 /****************************************************************************/
 
-Local Void initlib_Vswitch(act)
+void initlib_Vswitch(act)
 Analog_32_action *act;
 {
   AnaCell_rec *NewCell;
@@ -448,12 +443,12 @@ Analog_32_action *act;
   NewIC->ICmFall = 3 * AnaDtmax;
   NewIC->ICmWidth = 6 * AnaDtmax;
   GetCnf_Vswitch(NewIC);
-  NewCell->Ainfo = (Anyptr)NewIC;
-  act->kind->info = (Anyptr)NewCell;
+  NewCell->Ainfo = (void *)NewIC;
+  act->kind->info = (void* )NewCell;
 }  /*Vswitch_Initlib*/
 
 
-Local Void ResetInit_Vswitch(act)
+void ResetInit_Vswitch(act)
 Analog_32_action *act;
 {
   VswitchConst *VswitchVar;
@@ -479,12 +474,12 @@ Analog_32_action *act;
 }
 
 
-Local boolean Vswitchcheck(Inst, Attrnum, act)
+int Vswitchcheck(Inst, Attrnum, act)
 log_grec *Inst;
 long Attrnum;
 Analog_32_action *act;
 {
-  boolean Result;
+  int Result;
   VswitchConst *VswitchVar;
   Anainstlist *A_Gate;
 
@@ -550,7 +545,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Attr_Vswitch(act)
+void Attr_Vswitch(act)
 Analog_32_action *act;
 {
   long Attrnum;
@@ -564,7 +559,7 @@ Analog_32_action *act;
 
 
 
-Local Void Newgate_Vswitch(act)
+void Newgate_Vswitch(act)
 Analog_32_action *act;
 {
   VswitchConst *VswitchVar;
@@ -578,7 +573,7 @@ Analog_32_action *act;
   ICptr = (ICVswitch *)Cellptr->Ainfo;
   VswitchVar = (VswitchConst *)Malloc(sizeof(VswitchConst));
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)VswitchVar;
+  A_Gate->InstVar = (void *)VswitchVar;
   ResetInit_Vswitch(act);
   VswitchVar->Conductance = 1 / ICptr->ICRes;
   VswitchVar->Limit = false;
@@ -608,7 +603,7 @@ Analog_32_action *act;
   }
 }
 
-Local Void Copygate_Vswitch(act)
+void Copygate_Vswitch(act)
 Analog_32_action *act;
 {
   VswitchConst *VswitchVar, *Old_Vswitchvar;
@@ -619,12 +614,12 @@ Analog_32_action *act;
   VswitchVar = (VswitchConst *)Malloc(sizeof(VswitchConst));
   *VswitchVar = *Old_Vswitchvar;
   A_Gate = (Anainstlist *)act->inst->info;
-  A_Gate->InstVar = (Anyptr)VswitchVar;
+  A_Gate->InstVar = (void *)VswitchVar;
   AnaCapCopy(act->inst);
 }
 
 
-Local Void Dispose_Vswitch(act)
+void Dispose_Vswitch(act)
 Analog_32_action *act;
 {
   VswitchConst *VswitchVar;
@@ -636,13 +631,13 @@ Analog_32_action *act;
   AnaCapDispose(act->inst);   /*7*/
 }
 
-Local Void Readgate_Vswitch(act)
+void Readgate_Vswitch(act)
 Analog_32_action *act;
 {
   VswitchConst *VswitchVar;
   Anainstlist *A_Gate;
   log_grec *WITH1;
-  Char STR1[256];
+  char STR1[256];
 
   AnaCapattrread((long)Cstart, act->inst);   /*Read capacitors*/
   A_Gate = (Anainstlist *)act->inst->info;
@@ -671,7 +666,7 @@ Analog_32_action *act;
   VswitchVar->Videal = VswitchVar->OldVideal;
 }
 
-Local Void Writegate_Vswitch(act)
+void Writegate_Vswitch(act)
 Analog_32_action *act;
 {
   VswitchConst *VswitchVar;
@@ -694,7 +689,7 @@ Analog_32_action *act;
 
 
 
-Local Void Reset_Vswitch(act)
+void Reset_Vswitch(act)
 Analog_32_action *act;
 {
   VswitchConst *VswitchVar;
@@ -717,7 +712,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Set_Vswitch(act)
+void Set_Vswitch(act)
 Analog_32_action *act;
 {
   VswitchConst *VswitchVar;
@@ -733,7 +728,7 @@ Analog_32_action *act;
 }
 
 
-Local Void PreUpdate_Vswitch(act)
+void PreUpdate_Vswitch(act)
 Analog_32_action *act;
 {
   VswitchConst *VswitchVar;
@@ -758,7 +753,7 @@ Analog_32_action *act;
     VswitchVar->NewState = VswitchVar->State;
 }
 
-Local Void Update_Vswitch(act)
+void Update_Vswitch(act)
 Analog_32_action *act;
 {
   VswitchConst *VswitchVar;
@@ -776,7 +771,7 @@ Analog_32_action *act;
   VswitchVar->Limit = VswitchVar->NewLimit;
 }
 
-Local Void Display_Vswitch(act)
+void Display_Vswitch(act)
 Analog_32_action *act;
 {
   VswitchConst *VswitchVar;
@@ -797,7 +792,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Touch_Vswitch(act)
+void Touch_Vswitch(act)
 Analog_32_action *act;
 {
   VswitchConst *VswitchVar;
@@ -827,7 +822,7 @@ Analog_32_action *act;
   AnaChanged = true;
 }
 
-Local Void Refresh_Vswitch(act)
+void Refresh_Vswitch(act)
 Analog_32_action *act;
 {
   VswitchConst *VswitchVar;
@@ -839,7 +834,7 @@ Analog_32_action *act;
   Limitfill(act->inst, VswitchVar->Limit, false);
 }
 
-Local Void Erase_Vswitch(act)
+void Erase_Vswitch(act)
 Analog_32_action *act;
 {
   VswitchConst *VswitchVar;
@@ -852,7 +847,7 @@ Analog_32_action *act;
 }
 
 
-Local Void Probe_Vswitch(act)
+void Probe_Vswitch(act)
 Analog_32_action *act;
 {
   Anainstlist *A_Gate;
@@ -860,8 +855,8 @@ Analog_32_action *act;
   AnaExt_rec *Node1Ptr;
   double Node1, Pin1;
   log_grec *WITH;
-  Char STR1[256];
-  Char STR3[256];
+  char STR1[256];
+  char STR3[256];
 
   WITH = act->inst;
   A_Gate = (Anainstlist *)WITH->info;
@@ -902,98 +897,98 @@ Analog_32_action *act;
 /*=============================================================================*/
 
 
-Void Log_vswitch_initlib_32(act)
+void Log_vswitch_initlib_32(act)
 Analog_32_action *act;
 {
   /*Main Procedure*/
 
   switch (act->action) {
 
-  case Analog_act_newkind:
+  case ANALOG_ACT_NEWKIND:
     initlib_Vswitch(act);
     break;
 
-  case Analog_act_ex:
+  case ANALOG_ACT_EX:
     Ex_Vswitch(act);
     break;
 
-  case Analog_act_preupdate:
+  case ANALOG_ACT_PREUPDATE:
     PreUpdate_Vswitch(act);
     break;
 
-  case Analog_act_update:
+  case ANALOG_ACT_UPDATE:
     Update_Vswitch(act);
     break;
 
-  case Analog_act_display:
+  case ANALOG_ACT_DISPLAY:
     Display_Vswitch(act);
     break;
 
-  case Analog_act_pass1:
+  case ANALOG_ACT_PASS1:
     AnaCappass1(act->inst);
     break;
 
-  case Analog_act_pass2:
+  case ANALOG_ACT_PASS2:
     AnaCappass2(act->inst);
     break;
 
-  case Analog_act_attrchange:
+  case ANALOG_ACT_ATTRCHANGE:
     Attr_Vswitch(act);
     break;
 
-  case Analog_act_reset:
+  case ANALOG_ACT_RESET:
     Reset_Vswitch(act);
     break;
 
-  case Analog_act_newgate:
+  case ANALOG_ACT_NEWGATE:
     Newgate_Vswitch(act);
     break;
 
-  case Analog_act_copygate:
+  case ANALOG_ACT_COPYGATE:
     Copygate_Vswitch(act);
     break;
 
-  case Analog_act_disposegate:
+  case ANALOG_ACT_DISPOSEGATE:
     Dispose_Vswitch(act);
     break;
 
-  case Analog_act_openconfig:
+  case ANALOG_ACT_OPENCONFIG:
     AnaCapattrload((long)Cstart, act->inst, act->ok);
     break;
 
-  case Analog_act_readgate:
+  case ANALOG_ACT_READGATE:
     Readgate_Vswitch(act);
     break;
 
-  case Analog_act_writegate:
+  case ANALOG_ACT_WRITEGATE:
     Writegate_Vswitch(act);
     break;
 
-  case Analog_act_Iin:
+  case ANALOG_ACT_IIN:
     Iin_Vswitch(act);
     break;
 
-  case Analog_act_erase:
+  case ANALOG_ACT_ERASE:
     Erase_Vswitch(act);
     break;
 
-  case Analog_act_refresh:
+  case ANALOG_ACT_REFRESH:
     Refresh_Vswitch(act);
     break;
 
-  case Analog_act_touch:
+  case ANALOG_ACT_TOUCH:
     Touch_Vswitch(act);
     break;
 
-  case Analog_act_set:
+  case ANALOG_ACT_SET:
     Set_Vswitch(act);
     break;
 
-  case Analog_act_clear:
+  case ANALOG_ACT_CLEAR:
     ResetInit_Vswitch(act);
     break;
 
-  case Analog_act_probe:
+  case ANALOG_ACT_PROBE:
     Probe_Vswitch(act);
     break;
 
diff --git a/log/src/ana/vswitch.h b/log/src/ana/vswitch.h
index b1b6900..ba34358 100644
--- a/log/src/ana/vswitch.h
+++ b/log/src/ana/vswitch.h
@@ -2,56 +2,16 @@
 #ifndef VSWITCH_H
 #define VSWITCH_H
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NSOLVER_H
 #include "nsolver.h"
-#endif
-
-#ifndef GLOBALS_H
 #include "globals.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-
-#ifdef VSWITCH_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-/*$If Float$
-  $float_hdw on$
-  $End$*/
-/*$If Debugflag$
-  $Debug$
-  $End$*/
-
-
-
-extern Void Log_vswitch_initlib_32 PP((Analog_32_action *act));
 
 
-#undef vextern
+extern void Log_vswitch_initlib_32 (Analog_32_action *act);
 
 #endif /*VSWITCH_H*/
 
diff --git a/log/src/diggates.c b/log/src/diggates.c
index 693e304..87cd122 100644
--- a/log/src/diggates.c
+++ b/log/src/diggates.c
@@ -1,7 +1,3 @@
-/* Output from p2c, the Pascal-to-C translator */
-/* From input file "diggates.text" */
-
-
 /* "LOG", the circuit editing and simulation system,
    "DigLOG", the digital simulator for LOG.
    Copyright (C) 1985, 1990 David Gillespie.
@@ -27,21 +23,14 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 /* Pascal module for SRAM8K and other gates */
 
-/*$debug${*/
-
-
 
 #include <p2c/p2c.h>
 
-
-#define MYGATES_G
 #include "mygates.h"
 
 
-
-
-Static short crtcolor;
-Static m_chpicrec **crtfont;
+static short crtcolor;
+static m_chpicrec **crtfont;
 
 
 #define ramsize         8191
@@ -60,13 +49,13 @@ Static m_chpicrec **crtfont;
 typedef uchar ramarray[ramsize + 1];
 
 
-/* Local variables for Log_mygates_sram8k: */
+/* variables for Log_mygates_sram8k: */
 struct LOC_Log_mygates_sram8k {
   log_16_action *act;
   uchar *ram;
 } ;
 
-Local Void peek(n, LINK)
+void peek(n, LINK)
 long n;
 struct LOC_Log_mygates_sram8k *LINK;
 {
@@ -96,7 +85,7 @@ struct LOC_Log_mygates_sram8k *LINK;
   WITH2->attr[attr_valdec - 1].UU.U73.i1 = LINK->ram[n];
 }
 
-Local Void poke(n, LINK)
+void poke(n, LINK)
 long n;
 struct LOC_Log_mygates_sram8k *LINK;
 {
@@ -123,20 +112,20 @@ struct LOC_Log_mygates_sram8k *LINK;
   WITH2->attr[attr_valhex - 1].changed = true;
 }
 
-Local Void configchgate(LINK)
+void configchgate(LINK)
 struct LOC_Log_mygates_sram8k *LINK;
 {
   long index_;
-  boolean lineflag;
-  Char buf[256];
+  int lineflag;
+  char buf[256];
   FILE *textfile;
   log_16_action *WITH;
   log_action *WITH1;
   log_grec *WITH2;
   log_gattrrec *WITH3;
   long FORLIM;
-  Char STR3[256];
-  Char *TEMP;
+  char STR3[256];
+  char *TEMP;
 
   textfile = NULL;
   WITH = LINK->act;
@@ -241,7 +230,7 @@ struct LOC_Log_mygates_sram8k *LINK;
 
 
 
-Void Log_mygates_sram8k(act_)
+void Log_mygates_sram8k(act_)
 log_16_action *act_;
 {  /*sram8k*/
   struct LOC_Log_mygates_sram8k V;
@@ -262,12 +251,12 @@ log_16_action *act_;
 
   case act_16_new:
     V.ram = (uchar *)Malloc(sizeof(ramarray));
-    WITH2->info = (Anyptr)V.ram;
+    WITH2->info = (void *)V.ram;
     break;
 
   case act_16_copy:
     V.ram = (uchar *)Malloc(sizeof(ramarray));
-    WITH2->info = (Anyptr)V.ram;
+    WITH2->info = (void *)V.ram;
     ram2 = (uchar *)WITH1->actgate2->info;
     memcpy(V.ram, ram2, sizeof(ramarray));
     break;
@@ -385,7 +374,7 @@ log_16_action *act_;
 
 
 
-Static long byte_reverse(n)
+static long byte_reverse(n)
 long n;
 {
   return (((n / 128) & 1) + ((n / 64) & 1) * 2 + ((n / 32) & 1) * 4 +
@@ -404,18 +393,18 @@ long n;
 
 typedef struct dispinfo {
   long xpos, ypos;
-  boolean savetrig, saveclr, chgflag;
-  Char scrn[height_][width_];
+  int savetrig, saveclr, chgflag;
+  char scrn[height_][width_];
 } dispinfo;
 
 
-/* Local variables for Log_mygates_ascdisp: */
+/* variables for Log_mygates_ascdisp: */
 struct LOC_Log_mygates_ascdisp {
   log_16_action *act;
   dispinfo *dip;
 } ;
 
-Local Void findorg(xorg, yorg, LINK)
+void findorg(xorg, yorg, LINK)
 long *xorg, *yorg;
 struct LOC_Log_mygates_ascdisp *LINK;
 {
@@ -432,7 +421,7 @@ struct LOC_Log_mygates_ascdisp *LINK;
   *yorg = ty - yspc * height_ + 22;
 }
 
-Local Void xorcursor(LINK)
+void xorcursor(LINK)
 struct LOC_Log_mygates_ascdisp *LINK;
 {
   long xorg, yorg;
@@ -450,7 +439,7 @@ struct LOC_Log_mygates_ascdisp *LINK;
   m_colormode((long)m_normal);
 }
 
-Local Void erasedisp(LINK)
+void erasedisp(LINK)
 struct LOC_Log_mygates_ascdisp *LINK;
 {
   long xorg, yorg;
@@ -467,13 +456,13 @@ struct LOC_Log_mygates_ascdisp *LINK;
   (*WITH1->hook.unhidecursor)();
 }
 
-Local Void refrdisp(LINK)
+void refrdisp(LINK)
 struct LOC_Log_mygates_ascdisp *LINK;
 {
   long x, y, yy, xorg, yorg;
   dispinfo *WITH;
   log_action *WITH1;
-  Char STR1[2];
+  char STR1[2];
 
   WITH = LINK->dip;
   WITH1 = LINK->act->lact;
@@ -498,7 +487,7 @@ struct LOC_Log_mygates_ascdisp *LINK;
   (*WITH1->hook.unhidecursor)();
 }
 
-Local Void cleardisp(LINK)
+void cleardisp(LINK)
 struct LOC_Log_mygates_ascdisp *LINK;
 {
   log_action *WITH;
@@ -506,13 +495,13 @@ struct LOC_Log_mygates_ascdisp *LINK;
 
   WITH = LINK->act->lact;
   WITH1 = LINK->dip;
-  memset((Anyptr)WITH1->scrn, ' ', (long)(width_ * height_));
+  memset((void *)WITH1->scrn, ' ', (long)(width_ * height_));
   WITH1->xpos = 0;
   WITH1->ypos = 0;
   WITH1->chgflag = true;
 }
 
-Local Void scrollup(LINK)
+void scrollup(LINK)
 struct LOC_Log_mygates_ascdisp *LINK;
 {
   log_action *WITH;
@@ -520,14 +509,14 @@ struct LOC_Log_mygates_ascdisp *LINK;
 
   WITH = LINK->act->lact;
   WITH1 = LINK->dip;
-  memmove((Anyptr)WITH1->scrn[0], (Anyptr)WITH1->scrn[1],
+  memmove((void *)WITH1->scrn[0], (void *)WITH1->scrn[1],
 	  width_ * (height_ - 1L));
-  memset((Anyptr)WITH1->scrn[height_ - 1], ' ', (long)width_);
+  memset((void *)WITH1->scrn[height_ - 1], ' ', (long)width_);
   WITH1->chgflag = true;
 }
 
-Local Void drawchar(ch, LINK)
-Char ch;
+void drawchar(ch, LINK)
+char ch;
 struct LOC_Log_mygates_ascdisp *LINK;
 {
   short attrnum;
@@ -561,7 +550,7 @@ struct LOC_Log_mygates_ascdisp *LINK;
       break;
 
     case '\t':
-      memset((Anyptr)(&WITH1->scrn[WITH1->ypos][WITH1->xpos]), ' ',
+      memset((void *)(&WITH1->scrn[WITH1->ypos][WITH1->xpos]), ' ',
 	     width_ - WITH1->xpos);
       WITH1->chgflag = true;
       break;
@@ -575,7 +564,7 @@ struct LOC_Log_mygates_ascdisp *LINK;
       break;
 
     case '\013':
-      memset((Anyptr)(&WITH1->scrn[WITH1->ypos][WITH1->xpos]), ' ',
+      memset((void *)(&WITH1->scrn[WITH1->ypos][WITH1->xpos]), ' ',
 	     width_ * height_ - WITH1->ypos * width_ - WITH1->xpos);
       WITH1->chgflag = true;
       break;
@@ -611,7 +600,7 @@ struct LOC_Log_mygates_ascdisp *LINK;
   }
   if ((ch & (~127)) != 0)
     return;
-/* p2c: diggates.text, line 472: Note: Character >= 128 encountered [281] */
+/* p2c: diggates.text, line 472: Note: character >= 128 encountered [281] */
   WITH1->scrn[WITH1->ypos][WITH1->xpos] = ch;
   WITH1->xpos++;
   if (WITH1->xpos >= width_) {
@@ -630,7 +619,7 @@ struct LOC_Log_mygates_ascdisp *LINK;
 }
 
 
-Void Log_mygates_ascdisp(act_)
+void Log_mygates_ascdisp(act_)
 log_16_action *act_;
 {  /*ascdisp*/
   struct LOC_Log_mygates_ascdisp V;
@@ -653,7 +642,7 @@ log_16_action *act_;
     m_seefont(&crtfont);
     m_setfont(savef);
     V.dip = (dispinfo *)Malloc(sizeof(dispinfo));
-    WITH2->info = (Anyptr)V.dip;
+    WITH2->info = (void *)V.dip;
     cleardisp(&V);
     V.dip->savetrig = true;
     V.dip->saveclr = true;
@@ -661,7 +650,7 @@ log_16_action *act_;
 
   case act_16_copy:
     V.dip = (dispinfo *)Malloc(sizeof(dispinfo));
-    WITH2->info = (Anyptr)V.dip;
+    WITH2->info = (void *)V.dip;
     dip2 = (dispinfo *)WITH1->actgate2->info;
     *V.dip = *dip2;
     break;
@@ -677,7 +666,7 @@ log_16_action *act_;
       if (!V.dip->saveclr)
 	cleardisp(&V);
     } else if ((((unsigned long)WITH2->vars) & (1L << 7)) != 0 && !V.dip->savetrig)
-      drawchar((Char)byte_reverse(((long)WITH2->vars / 256L) & 255), &V);
+      drawchar((char)byte_reverse(((long)WITH2->vars / 256L) & 255), &V);
     V.dip->saveclr = ((((unsigned long)WITH2->vars) & (1L << 6)) != 0);
     V.dip->savetrig = ((((unsigned long)WITH2->vars) & (1L << 7)) != 0);
     break;
@@ -717,12 +706,12 @@ log_16_action *act_;
 
 
 
-Void Log_mygates_asckbd(act)
+void Log_mygates_asckbd(act)
 log_16_action *act;
 {
-  Char ch;
+  char ch;
   long keyx, keyy;
-  boolean asciimode;
+  int asciimode;
   log_action *WITH;
   log_grec *WITH1;
   int TEMP;
@@ -773,7 +762,7 @@ log_16_action *act;
 	    else
 	      ch = map[keyy * 12 + keyx];
 	  } else
-	    ch = (Char)(keyy * 16 + keyx);
+	    ch = (char)(keyy * 16 + keyx);
 	  WITH1->vars = (na_long)(byte_reverse((long)ch) * 256 + 128);
 	}
 	WITH->actflag = true;
@@ -791,11 +780,4 @@ log_16_action *act;
 #undef map_c
 
 
-
-
-
-
-
-
-
 /* End. */
diff --git a/log/src/fixfet7 b/log/src/fixfet7
index 546a324..6e48916 100755
--- a/log/src/fixfet7
+++ b/log/src/fixfet7
@@ -2,5 +2,3 @@
 cp $1 old$1
 sed -e s/FET7/SPC1/ < old$1 > $1
 
-
-
diff --git a/log/src/log.c b/log/src/log.c
index a8c3578..b8533c8 100644
--- a/log/src/log.c
+++ b/log/src/log.c
@@ -1,7 +1,3 @@
-/* Output from p2c, the Pascal-to-C translator */
-/* From input file "log.text" */
-
-
 /* "LOG", the circuit editing and simulation system,
    "DigLOG", the digital simulator for LOG.
    Copyright (C) 1985, 1990 David Gillespie.
@@ -42,17 +38,11 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 */
 
 
-#ifndef OS2
 #include <unistd.h>
-#endif
 #include <time.h>
 
 #define LOAD_SEARCH    /* Use the search path in load command. */
 
-#ifdef OS2
-#include <float.h>
-#endif
-
 #include <p2c/p2c.h>
 
 #if aux
@@ -71,92 +61,37 @@ char *str, **ptr;
 #endif
 
 
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef SYSDEVS_H
 #include <p2c/sysdevs.h>
-#endif
-
-#ifndef RND_H
 #include <p2c/rnd.h>
-#endif
 
 /*homeless orphans*/
 
-#ifndef MISC_H
 #include <p2c/misc.h>
-#endif
-/* p2c: log.text, line 49: Warning: Could not find module HELP [271] */
-
 #include "help.h"
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-#ifndef FILEPACK_H
 #include <p2c/filepack.h>
-#endif
-
-#ifndef CITINFOMOD_H
 #include <p2c/citinfomod.h>
-#endif
-
-#ifndef IODECLARATIONS_H
 #include <p2c/iodecl.h>
-#endif
-
-#ifndef GENERAL_1_H
 #include <p2c/general_1.h>
-#endif
-
-#ifndef GENERAL_2_H
 #include <p2c/general_2.h>
-#endif
-
-#ifndef GENERAL_3_H
 #include <p2c/general_3.h>
-#endif
-
-#ifndef FS_H
 #include <p2c/fs.h>
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-/* p2c: logfont.text, line 1: Warning: Expected MODULE, found a '*' [227] */
-/* p2c: log.text, line 52: Warning: Could not find module LOGFONT [271] */
-
 #include "logfont.h"
 #include "logstuff.h"
 #include "swap.h"
-
-#ifndef NEWKBD_H
 #include <p2c/newkbd.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef NEWCRT_H
 #include <p2c/newcrt.h>
-#endif
-
 
 extern char *GetChipmunkPath();
 char *my_strdup();
 #undef strdup
 #define strdup my_strdup
 #define newci_findprocedure2  findprocedure
-extern boolean findprocedure PP((Char *name, Void (**start)()));
+extern int findprocedure (char *name, void (**start)());
 
 
 #define debuglog        false
@@ -292,7 +227,7 @@ typedef struct ovectorrec {
 typedef union filerec {
   uchar b[256];
   schar sb[256];
-  Char c[256];
+  char c[256];
   short sh[128];
 #ifdef __alpha__
   int i[64];
@@ -328,15 +263,15 @@ typedef short kindgrouptype[kindgroupmaxsize];
 typedef log_gattrrec *kindattrtype[kindgroupmaxsize];
 
 typedef uchar loadedgatesarray[(log_million + 7) / 8];
-typedef Char indexarray[log_million][9];
+typedef char indexarray[log_million][9];
 typedef short ioffsetarray[log_million];
 typedef uchar igrouparray[log_million];
 /* Index to gate library */
 
 typedef struct logmenurec {
-  Char name[17];
-  Char cmd[33];
-  boolean *bool;
+  char name[17];
+  char cmd[33];
+  int *bool;
 } logmenurec;   /* Pop-up menu options */
 
 typedef logmenurec logmenutype[8];
@@ -353,7 +288,7 @@ typedef logmenurec logmenutype[8];
 
 typedef struct cnrec {
   log_nrec *n, **np;
-  boolean done;
+  int done;
   struct cnrec *next;
 } cnrec;   /* Delayed Combinenodes record */
 
@@ -367,16 +302,16 @@ typedef struct blobrec {
 
 
 typedef struct cnfrec {
-  Char tool[17];
+  char tool[17];
   struct cnfrec *next;
-  Char s[256];   /*not fully allocated*/
+  char s[256];   /*not fully allocated*/
 } cnfrec;   /* Tool configuration record */
 
 
 typedef struct macrorec {
-  Char key;
+  char key;
   struct macrorec *next;
-  Char name[33];
+  char name[33];
 } macrorec;   /* Macro key */
 
 
@@ -387,8 +322,8 @@ typedef struct catboxrec {
 
 
 typedef struct librstrrec {
-  Char name[9];
-  Char *str;
+  char name[9];
+  char *str;
   struct librstrrec *left, *right;
 } librstrrec;
 
@@ -401,7 +336,7 @@ typedef struct baseptrs {
   log_lrec *lcopy;
   log_brec *bcopy;
   short x1copy, y1copy, x2copy, y2copy, dxcopy, dycopy, pgnum;
-  boolean valid;
+  int valid;
 } baseptrs;
 
 
@@ -437,7 +372,7 @@ typedef struct baseptrs {
 /*22*/
 /*23*/
 
-static Const rablisttype rablist = {
+static const rablisttype rablist = {
   { 0, 0, 1 },
   { 0, 4, 2 },
   { 0, 3, 3 },
@@ -464,7 +399,7 @@ static Const rablisttype rablist = {
   { 4, 4, 42 }
 };
 
-static Const rabmustype discomadness = {
+static const rabmustype discomadness = {
   { 3, 46 },
   { 0, 8 },
   { 4, 10 },
@@ -504,187 +439,187 @@ static Const rabmustype discomadness = {
 
 
 
-Static log_action gg;   /* External global variables */
+static log_action 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 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 boolean cursorflag;   /* Cursor is displayed */
-Static boolean prevcursorflag;
+static int cursorflag;   /* Cursor is displayed */
+static int prevcursorflag;
     /* Cursor was displayed before operation began */
-Static boolean chairflag;   /* Crosshair is on screen */
-Static boolean chairflag2;   /* Crosshair will be on screen */
-Static boolean rbandflag;   /* Rubber-band wire is on screen */
-Static boolean rabbits, rabflag;   /* Rabbit mode */
-Static boolean avoidrabbits;
+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;
 
-Static short txacross, txdown, across, down, baseline, line1, line2,
+static short txacross, txdown, across, down, baseline, line1, line2,
 	     kindgroupbase, kindgroupleft, kindgroupright, kindgroupstart,
 	     kindgroupsize, histdown;
 
-Static boolean entrycapslock;   /* Capslock status on entry */
-Static boolean oldcapslock;   /* Previous capslock status */
+static int entrycapslock;   /* Capslock status on entry */
+static int oldcapslock;   /* Previous capslock status */
 
-Static boolean signalcaps;   /* Capslock flag for signal-name entry */
-Static boolean labelcaps;   /* Capslock flag for label entry */
+static int signalcaps;   /* Capslock flag for signal-name entry */
+static 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 *gatefilenames;
-Static short maxkinds, catwidth;
-Static catboxrec *catboxes;
-Static librstrrec *librstrs;
+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 *gatefilenames;
+static short maxkinds, catwidth;
+static catboxrec *catboxes;
+static librstrrec *librstrs;
 
-Static Char *gatesname[maxgatesfiles];
-Static Char *loghelpname, *lognewsname;   /* Names of system files */
+static char *gatesname[maxgatesfiles];
+static char *loghelpname, *lognewsname;   /* Names of system files */
 
-Static long temp1, temp2, temp3, temp4;   /* For use by main program */
-Static Char tempch;
+static long temp1, temp2, temp3, temp4;   /* For use by main program */
+static char tempch;
 
-Static short zoom;   /* Zooming level */
-Static boolean ospointflag;   /* Starting point was touched */
+static short zoom;   /* Zooming level */
+static int ospointflag;   /* Starting point was touched */
 
-Static long xoff0, yoff0;   /* Old XOFF, YOFF */
+static 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 */
+static short curwcolor;   /* Current VLSI wire color */
+static char cureditmode;   /* Current editing (gate-tapping) mode */
+static short curlistgroup;   /* Current group in library list */
 
-Static boolean vlsimode[log_maxpages];   /* Page contains VLSI circuits */
-Static long xoffp[log_maxpages], yoffp[log_maxpages];
+static int vlsimode[log_maxpages];   /* Page contains VLSI circuits */
+static 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 *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 boolean histonscreen;   /* Leading edge of trace is visible */
-Static boolean histreset;   /* Clear the history memory */
-Static double histtime;   /* Current time for history mode */
-
-Static boolean 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 *colorbase;   /* List of configured colors */
-Static macrorec *macrobase;   /* List of macro keys */
-Static na_strlist *thingstodo, *nexttodo;   /* List of delayed commands */
-Static na_strlist *messages;   /* List of delayed messages */
-Static na_strlist *commandlist;   /* List of tool-activation commands */
-
-Static Char modename[9];   /* Word in 'mode' area of menu */
-Static boolean 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 {
+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 *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 *colorbase;   /* List of configured colors */
+static macrorec *macrobase;   /* List of macro keys */
+static na_strlist *thingstodo, *nexttodo;   /* List of delayed commands */
+static na_strlist *messages;   /* List of delayed messages */
+static na_strlist *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 {
   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 */
+static short bottomcount;   /* How many nested BEGINBOTTOMs */
 
-Static uchar rcolormap[16], gcolormap[16], bcolormap[16];
+static uchar rcolormap[16], gcolormap[16], bcolormap[16];
 
-Static short gategreen, gateyellow, gatered, gateorange, gateblack, gatewhite;
+static short gategreen, gateyellow, gatered, gateorange, gateblack, gatewhite;
 
-Static short defineboxcolor, definebackcolor, definetextcolor, catboxcolor;
+static short defineboxcolor, definebackcolor, definetextcolor, catboxcolor;
 
-Static short messagepos;   /* Position of next message */
-Static short messageright;   /* Maximum width of messages */
+static short messagepos;   /* Position of next message */
+static short messageright;   /* Maximum width of messages */
 
-Static long fastsavetime;
+static long fastsavetime;
 
-Static long watchdog, rabtime;   /* Miscellaneous timers */
+static long watchdog, rabtime;   /* Miscellaneous timers */
 
-Static log_tool *simtype_ignore;   /* Non-simulated type */
-Static log_tool *simtype_common;   /* Common-pin type */
+static log_tool *simtype_ignore;   /* Non-simulated type */
+static log_tool *simtype_common;   /* Common-pin type */
 
-Static double status_oldtime, status_oldtstep;
-Static long status_oldmem;
+static double status_oldtime, status_oldtstep;
+static long status_oldmem;
 
-Static rablistrec rabtable[rabtabsize];   /* Positions of rabbits */
-Static short rabstate;   /* Rabbit recognizer state */
+static rablistrec rabtable[rabtabsize];   /* Positions of rabbits */
+static short rabstate;   /* Rabbit recognizer state */
 
-Static long helpptr;   /* Help descriptor */
+static long helpptr;   /* Help descriptor */
 
-Static boolean popup_grid;   /* Pop-up menus */
-Static logmenurec *popupmenus[4];
+static int popup_grid;   /* Pop-up menus */
+static logmenurec *popupmenus[4];
 
-Static filerecfilerec *libf1[maxgatesfiles];   /* Library files */
-Static short libfstart[maxgatesfiles];
+static filerecfilerec *libf1[maxgatesfiles];   /* Library files */
+static 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];
+static short libptr;   /* Most recently replaced catalog item */
+static short idxsize;   /* Number of gates in library */
+static char *librgroupnames[9];
 
-Static short refrtimer, refrtimer0;   /* Time until screen is refreshed */
+static short refrtimer, refrtimer0;   /* Time until screen is refreshed */
 
-Static long tabletaddr;
+static long tabletaddr;
 
-Static Char *dumpfname, *tracefname;
-Static FILE *dumpfile, *tracefile;
+static char *dumpfname, *tracefname;
+static FILE *dumpfile, *tracefile;
 
-Static long programmark;
+static long programmark;
 
-Static Char pushedbackkey, realkey;
+static char pushedbackkey, realkey;
 
 extern long EXCP_LINE;   /* Line number of last error */
-Static long excpline;
-
-Static short conflictdelay;
-
-Static boolean eightcolors;   /* Has only 8 colors */
-Static boolean onescreen;   /* Has only one screen */
-Static boolean doingcnffunction;   /* This is an ACT_CNF, not an ACT_FUNC */
-Static boolean justonecommand;   /* LOG -R mode, so exit after first cmd */
-Static boolean displaynews;   /* LOGNEWS has not yet been displayed */
-Static boolean immedscroll;   /* Don't need to defer 'REFR' function */
-Static boolean tempverbose;   /* Verbose mode temporarily on */
-Static boolean commandfound;   /* Function name was acknowledged */
-Static boolean cursorhide;   /* Cursor is hidden */
-Static boolean reportnowait;   /* Don't wait for key on bug reports */
-Static boolean firsttraining;   /* Training used for first time */
-Static boolean training;   /* Training mode for Help command */
-Static boolean snapflag;   /* Snap-to-grid cursor */
-Static boolean showsolder;   /* Display solder points */
-Static boolean briefprobe;   /* Temporary probe mode */
-Static boolean conflictenbl;   /* Conflict checking enabled */
-Static boolean conflictstop;   /* Conflict stopping mode */
-Static boolean anyconflicts;   /* Any active, reported conflicts? */
-Static boolean steppingoff;   /* Single-step is turning simulation off */
-Static boolean suppressdots;   /* Temporarily suppressing red dots */
-Static boolean glowsolder;   /* Display solder dots in Glow mode */
-Static boolean vlsi;   /* Current page is VLSI mode */
+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 */
 
 
 
@@ -703,11 +638,11 @@ $ end $*/
 
 
 
-extern Void m_saveclip PV();
+extern void m_saveclip ();
 
-extern Void nc_cursor_on PV();
+extern void nc_cursor_on ();
 
-extern Void nc_cursor_off PV();
+extern void nc_cursor_off ();
 
 
 
@@ -719,7 +654,7 @@ extern Void nc_cursor_off PV();
 /*=                                              =*/
 /*================================================*/
 
-Static Void initcolormap()
+static void initcolormap()
 {
   m_setcolor((long)log_gray, 4L, 4L, 4L);
   m_setcolor((long)log_red, 15L, 0L, 0L);
@@ -746,7 +681,7 @@ Static Void initcolormap()
 }
 
 
-Static Void fixcolormap()
+static void fixcolormap()
 {
   m_vsetcolors(0L, 16L, rcolormap, gcolormap, bcolormap);
   recolor_log_cursors(gg.color.cursor, true);
@@ -754,7 +689,7 @@ Static Void fixcolormap()
 
 
 
-Static Void initscreen()
+static void initscreen()
 {
   m_init_screen();
   m_upside_down();
@@ -794,7 +729,7 @@ Static Void initscreen()
 }
 
 
-Static Void initscreen2()
+static void initscreen2()
 {
   initscreen();
   m_clear();
@@ -803,11 +738,11 @@ Static Void initscreen2()
 
 
 
-Static Char *ioresult_message(Result, iores)
-Char *Result;
+static char *ioresult_message(Result, iores)
+char *Result;
 long iores;
 {
-  Char s[81];
+  char s[81];
 
   misc_getioerrmsg(s, iores);   /* MISC */
   return strcpy(Result, s);
@@ -822,7 +757,7 @@ long iores;
 /*=                                              =*/
 /*================================================*/
 
-Static Void working()
+static void working()
 {
 }
 
@@ -835,7 +770,7 @@ Static Void working()
 /*=                                              =*/
 /*================================================*/
 
-Static Void alert()
+static void alert()
 {
   if (!gg.quiet)
     BEEPER(17, 10);
@@ -850,7 +785,7 @@ Static Void alert()
 /*=                                              =*/
 /*================================================*/
 
-Static Void warning()
+static void warning()
 {
   if (!gg.quiet)
     BEEPER(4, 10);
@@ -866,7 +801,7 @@ Static Void warning()
 /*=                                              =*/
 /*================================================*/
 
-Static Void noblink()
+static void noblink()
 {
   nc_cursXY(-1, -1);
   /*  oldx := xpos;
@@ -881,7 +816,7 @@ Static Void noblink()
 
 
 
-Static Void clearalpha()
+static void clearalpha()
 {
   if (!onescreen) {
     printf("\f");
@@ -893,7 +828,7 @@ Static Void clearalpha()
 
 
 
-Static Void showalpha()
+static void showalpha()
 {
   m_graphics_off();
   m_alpha_on();
@@ -901,7 +836,7 @@ Static Void showalpha()
 
 
 
-Static Void clearshowalpha PV();
+static void clearshowalpha ();
 
 
 
@@ -913,15 +848,15 @@ Static Void clearshowalpha PV();
 /*=                                              =*/
 /*================================================*/
 
-Static Void message PP((Char *msg));
+static void message (char *msg);
 
 
-Static Void report(num, s)
+static void report(num, s)
 short num;
-Char *s;
+char *s;
 {
-  Char ch;
-  Char STR2[256];
+  char ch;
+  char STR2[256];
 
   if (reportnowait) {
     sprintf(STR2, "Internal error %d in %s", num, s);
@@ -957,7 +892,7 @@ Char *s;
 /*=                                              =*/
 /*================================================*/
 
-Static Void line(x1, y1, x2, y2)
+static void line(x1, y1, x2, y2)
 short x1, y1, x2, y2;
 {
   m_drawline(x1 * gg.scale - gg.xoff, y1 * gg.scale - gg.yoff,
@@ -973,7 +908,7 @@ short x1, y1, x2, y2;
 /*=                                              =*/
 /*================================================*/
 
-Static Void hline(x1, x2, y)
+static void hline(x1, x2, y)
 short x1, x2, y;
 {
   short yy;
@@ -992,7 +927,7 @@ short x1, x2, y;
 /*=                                              =*/
 /*================================================*/
 
-Static Void vline(x, y1, y2)
+static void vline(x, y1, y2)
 short x, y1, y2;
 {
   short xx;
@@ -1010,7 +945,7 @@ short x, y1, y2;
 /*=                                              =*/
 /*================================================*/
 
-Static Void point(x, y)
+static void point(x, y)
 short x, y;
 {
   m_drawpoint(x * gg.scale - gg.xoff, y * gg.scale - gg.yoff);
@@ -1024,7 +959,7 @@ short x, y;
 /*=                                              =*/
 /*================================================*/
 
-Static Void rect(x1, y1, x2, y2)
+static void rect(x1, y1, x2, y2)
 short x1, y1, x2, y2;
 {
   m_drawrect(x1 * gg.scale - gg.xoff, y1 * gg.scale - gg.yoff,
@@ -1039,7 +974,7 @@ short x1, y1, x2, y2;
 /*=                                              =*/
 /*================================================*/
 
-Static Void box(x1, y1, x2, y2)
+static void box(x1, y1, x2, y2)
 short x1, y1, x2, y2;
 {
   m_fillrect(x1 * gg.scale - gg.xoff, y1 * gg.scale - gg.yoff,
@@ -1054,9 +989,9 @@ short x1, y1, x2, y2;
 /*=                                              =*/
 /*================================================*/
 
-Static Void drawstr2(x, y, s)
+static void drawstr2(x, y, s)
 short x, y;
-Char *s;
+char *s;
 {
   long save;
 
@@ -1073,9 +1008,9 @@ Char *s;
 }
 
 
-Static Void rightstr2(x, y, s)
+static void rightstr2(x, y, s)
 short x, y;
-Char *s;
+char *s;
 {
   long save;
 
@@ -1093,9 +1028,9 @@ Char *s;
 }
 
 
-Static Void centerstr2(x, y, s)
+static void centerstr2(x, y, s)
 short x, y;
-Char *s;
+char *s;
 {
   short w;
   long save;
@@ -1123,10 +1058,10 @@ Char *s;
 /*=                                              =*/
 /*================================================*/
 
-Static Void drawnum1(x, y, n)
+static void drawnum1(x, y, n)
 short x, y, n;
 {
-  Char s[2];
+  char s[2];
 
   m_move((long)x, (long)y);
   strcpy(s, " ");
@@ -1143,10 +1078,10 @@ short x, y, n;
 /*=                                              =*/
 /*================================================*/
 
-Static Void drawnum2(x, y, n)
+static void drawnum2(x, y, n)
 short x, y, n;
 {
-  Char s[3];
+  char s[3];
 
   m_move((long)x, (long)y);
   strcpy(s, "  ");
@@ -1162,7 +1097,7 @@ short x, y, n;
 
 
 
-Static Void xformcoords(g, x, y)
+static void xformcoords(g, x, y)
 log_grec *g;
 short *x, *y;
 {
@@ -1183,7 +1118,7 @@ short *x, *y;
 
 
 
-Static Void plainxformcoords(g, x, y)
+static void plainxformcoords(g, x, y)
 log_grec *g;
 short *x, *y;
 {
@@ -1210,7 +1145,7 @@ short *x, *y;
 /*=                                              =*/
 /*================================================*/
 
-Static Void clipon()
+static void clipon()
 {
   m_clip(0L, 0L, (long)across, baseline - 1L);
 }
@@ -1223,7 +1158,7 @@ Static Void clipon()
 /*=                                              =*/
 /*================================================*/
 
-Static Void clipoff()
+static void clipoff()
 {
   m_noclip();
 }
@@ -1237,7 +1172,7 @@ Static Void clipoff()
 /*=                                              =*/
 /*================================================*/
 
-Static Void uerase(x1, y1, x2, y2)
+static void uerase(x1, y1, x2, y2)
 short x1, y1, x2, y2;
 {
   m_color((long)gg.color.backgr);
@@ -1253,7 +1188,7 @@ short x1, y1, x2, y2;
 /*=                                              =*/
 /*================================================*/
 
-Static Void erase(x1, y1, x2, y2)
+static void erase(x1, y1, x2, y2)
 short x1, y1, x2, y2;
 {
   m_color((long)gg.color.backgr);
@@ -1269,7 +1204,7 @@ short x1, y1, x2, y2;
 /*=                                              =*/
 /*================================================*/
 
-Static Void norabbits()
+static void norabbits()
 {
   short i;
 
@@ -1290,10 +1225,10 @@ Static Void norabbits()
 /*=                                              =*/
 /*================================================*/
 
-Static Void addrabbit()
+static void addrabbit()
 {
   short i, j, rx, ry;
-  boolean nogood;
+  int nogood;
   rablistrec *WITH;
 
   clipoff();
@@ -1341,10 +1276,10 @@ Static Void addrabbit()
 /*=                                              =*/
 /*================================================*/
 
-Static boolean hvline(x1, y1, x2, y2)
+static int hvline(x1, y1, x2, y2)
 short x1, y1, *x2, *y2;
 {
-  boolean Result;
+  int Result;
 
   Result = true;
   if (x1 == *x2 && y1 == *y2)
@@ -1371,7 +1306,7 @@ short x1, y1, *x2, *y2;
 /*=                                              =*/
 /*================================================*/
 
-Static Void fixxy(x, y)
+static void fixxy(x, y)
 short *x, *y;
 {
   *x = (*x + gg.xoff + gg.hscale) / gg.scale * gg.scale - gg.xoff;
@@ -1387,7 +1322,7 @@ short *x, *y;
 /*=                                              =*/
 /*================================================*/
 
-Static Void nocrosshair()
+static void nocrosshair()
 {
   chairflag2 = false;
 }
@@ -1401,7 +1336,7 @@ Static Void nocrosshair()
 /*=                                              =*/
 /*================================================*/
 
-Static Void crosshair(x, y)
+static void crosshair(x, y)
 short x, y;
 {
   chairx = x * gg.scale - gg.xoff;
@@ -1431,7 +1366,7 @@ short x, y;
 /*=                                              =*/
 /*================================================*/
 
-Static Void xorcursor()
+static void xorcursor()
 {
   long curcm;
   short cx0, cy0;
@@ -1549,7 +1484,7 @@ Static Void xorcursor()
 /*=                                              =*/
 /*================================================*/
 
-Static Void hidecursor()
+static void hidecursor()
 {
   if (cursorflag)
     xorcursor();
@@ -1558,7 +1493,7 @@ Static Void hidecursor()
 
 
 
-Static Void hidecursor_hook()
+static void hidecursor_hook()
 {
   if (!cursorhide)
     hidecursor();
@@ -1566,7 +1501,7 @@ Static Void hidecursor_hook()
 }
 
 
-Static Void unhidecursor_hook()
+static void unhidecursor_hook()
 {
   if (cursorhide)
     hidecursor();
@@ -1574,7 +1509,7 @@ Static Void unhidecursor_hook()
 }
 
 
-Static Void hidecursorrect_hook(x1, y1, x2, y2)
+static void hidecursorrect_hook(x1, y1, x2, y2)
 long x1, y1, x2, y2;
 {
   if (!cursorhide && x1 <= gg.cx_max && x2 >= gg.cx_min && y1 <= gg.cy_max &&
@@ -1595,7 +1530,7 @@ long x1, y1, x2, y2;
 /*=                                              =*/
 /*================================================*/
 
-Static Void drawcursor(x, y)
+static void drawcursor(x, y)
 short x, y;
 {
   if (x != cursx || y != cursy || !cursorflag || cursortype != oldcursortype) {
@@ -1631,7 +1566,7 @@ short x, y;
 /*=                                              =*/
 /*================================================*/
 
-Static Void remcursor()
+static void remcursor()
 {
   prevcursorflag = cursorflag;
   if (cursorflag)
@@ -1649,7 +1584,7 @@ Static Void remcursor()
 /*=                                              =*/
 /*================================================*/
 
-Static Void restorecursor()
+static void restorecursor()
 {
   if (prevcursorflag != cursorflag)
     xorcursor();
@@ -1667,10 +1602,10 @@ Static Void restorecursor()
 /*=                                              =*/
 /*================================================*/
 
-Static Void refreditmode PV();
+static void refreditmode ();
 
-Static Void log_setmode(s)
-Const Char *s;
+static void log_setmode(s)
+const char *s;
 
 
 {
@@ -1713,11 +1648,11 @@ Const Char *s;
 
 
 
-Static Void dounits(s, r)
-Char *s;
+static void dounits(s, r)
+char *s;
 double *r;
 {
-  Char ch;
+  char ch;
 
   if (*s == '\0')
     return;
@@ -1763,14 +1698,14 @@ double *r;
 
 
 
-Static Void readreal(s_, r)
-Char *s_;
+static void readreal(s_, r)
+char *s_;
 double *r;
 {
-  Char s[256];
+  char s[256];
   long i;
-  Char *STR1;
-  Char STR2[256];
+  char *STR1;
+  char STR2[256];
 
   strcpy(s, s_);
   if (!(*s != '\0' &&
@@ -1788,12 +1723,12 @@ double *r;
 
 
 
-Static Void strwordx(buf, wrd)
-Char *buf, *wrd;
+static void strwordx(buf, wrd)
+char *buf, *wrd;
 {
   short i;
-  Char STR1[256];
-  Char STR2[256];
+  char STR1[256];
+  char STR2[256];
 
   strcpy(STR1, strltrim(strrtrim(strcpy(STR2, buf))));
   strcpy(buf, STR1);
@@ -1810,11 +1745,11 @@ Char *buf, *wrd;
 
 
 
-Static Void getword(buf, wrd)
-Char *buf, *wrd;
+static void getword(buf, wrd)
+char *buf, *wrd;
 {
-  Char STR1[256];
-  Char STR2[256];
+  char STR1[256];
+  char STR2[256];
 
   strcpy(STR1, strltrim(strrtrim(strcpy(STR2, buf))));
   strcpy(buf, STR1);
@@ -1828,13 +1763,13 @@ Char *buf, *wrd;
 
 
 
-Static long getint(s, def)
-Char *s;
+static long getint(s, def)
+char *s;
 long def;
 {
-  Char w[10];
+  char w[10];
   long i, j, sign;
-  boolean valid;
+  int valid;
   long FORLIM;
 
   getword(s, w);
@@ -1860,8 +1795,8 @@ long def;
 
 
 
-Static Void pgetint(buf, i, def)
-Char *buf;
+static void pgetint(buf, i, def)
+char *buf;
 long *i, def;
 {
   *i = getint(buf, def);
@@ -1869,11 +1804,11 @@ long *i, def;
 
 
 
-Static double getreal(s, def)
-Char *s;
+static double getreal(s, def)
+char *s;
 double def;
 {
-  Char w[81];
+  char w[81];
   double r;
 
   getword(s, w);
@@ -1890,8 +1825,8 @@ double def;
 
 
 
-Static Void pgetreal(buf, r, def)
-Char *buf;
+static void pgetreal(buf, r, def)
+char *buf;
 double *r, def;
 {
   *r = getreal(buf, def);
@@ -1899,11 +1834,11 @@ double *r, def;
 
 
 
-Static Void getbool(buf, b)
-Char *buf;
-boolean *b;
+static void getbool(buf, b)
+char *buf;
+int *b;
 {
-  Char w[17];
+  char w[17];
 
   getword(buf, w);
   if (!strcmp(w, "ON") || !strcmp(w, "YES") || !strcmp(w, "Y") ||
@@ -1934,7 +1869,7 @@ boolean *b;
 /*=                                              =*/
 /*================================================*/
 
-Static Void sortshints(x, y)
+static void sortshints(x, y)
 short *x, *y;
 {
   short temp;
@@ -1956,7 +1891,7 @@ short *x, *y;
 
 /* new version by Tim Edwards, Dec 1996 */
 
-Static boolean insidegate(g, x, y)
+static int insidegate(g, x, y)
 log_grec *g;
 short x, y;
 {
@@ -1973,7 +1908,7 @@ short x, y;
   /* Modify x1 position for length of text on TO/FROM-type gates */
 
   if (WITH->flag.U3.named && g->sig > 0) {
-     Char STR1[256];
+     char STR1[256];
      short xwid = m_strwidth(NULL, strrtrim(strcpy(STR1,
 	    gg.signaltab[g->sig - 1].name))) - NAMEGAP;
 
@@ -2010,7 +1945,7 @@ short x, y;
 /*=                                              =*/
 /*================================================*/
 
-Static Void unprobe()
+static void unprobe()
 {
   gg.probenode = NULL;
   gg.probegate = NULL;
@@ -2026,7 +1961,7 @@ Static Void unprobe()
 
 
 
-Static log_krec *peninkind(xx, yy)
+static log_krec *peninkind(xx, yy)
 short xx, yy;
 {
   log_krec *Result;
@@ -2045,7 +1980,7 @@ short xx, yy;
 
 
 
-Static Void testprobe(xx, yy)
+static void testprobe(xx, yy)
 short xx, yy;
 {
   log_grec *g;
@@ -2110,7 +2045,7 @@ short xx, yy;
 
 
 
-Static Void checkprobe(xx, yy)
+static void checkprobe(xx, yy)
 short xx, yy;
 {
   short x, y;
@@ -2146,18 +2081,18 @@ short xx, yy;
 
 
 
-Static Void parselabel(lbl, numattrs, attr)
+static void parselabel(lbl, numattrs, attr)
 na_strlist **lbl;
 short *numattrs;
 log_kattrrec **attr;
 {
   short j, j1, j2, j3, yy, maxx;
   na_strlist *l1, *l2, *l3, *attrnames;
-  Char buf[256];
-  boolean haveprec;
+  char buf[256];
+  int haveprec;
   log_kattrrec *WITH;
-  Char STR1[256];
-  Char STR2[256];
+  char STR1[256];
+  char STR2[256];
   short FORLIM;
 
   j = 1;
@@ -2309,7 +2244,7 @@ log_kattrrec **attr;
 /* p2c: log.text, line 2200:
  * Note: Modification of string length may translate incorrectly [146] */
 	}
-	WITH->UU.c = (Char *)Malloc(WITH->prec + 1L);
+	WITH->UU.c = (char *)Malloc(WITH->prec + 1L);
 	strcpy(WITH->UU.c, buf);
 	WITH->blnk = (*buf == '\0');
       } else if (WITH->dtype == 'A') {
@@ -2388,7 +2323,7 @@ log_kattrrec **attr;
   if (attrnames != NULL) {
     l1 = strlist_insert(lbl, "");
     l1->kind = '\001';
-    l1->value = (Anyptr)attrnames;
+    l1->value = (void *)attrnames;
   }
   FORLIM = *numattrs;
   for (j = 0; j < FORLIM; j++)
@@ -2400,7 +2335,7 @@ log_kattrrec **attr;
 
 
 
-Static Void stamp(i)
+static void stamp(i)
 long *i;
 {
   gg.curstamp++;
@@ -2410,9 +2345,9 @@ long *i;
 
 
 
-Static Void newtool(t, name)
+static void newtool(t, name)
 log_tool **t;
-Char *name;
+char *name;
 {
   log_tool *t2;
 
@@ -2423,12 +2358,12 @@ Char *name;
   (*t)->keep = false;
   (*t)->nostatus = false;
   (*t)->fname = NULL;
-  (*t)->comment = (Char *)Malloc(256);
+  (*t)->comment = (char *)Malloc(256);
   *(*t)->comment = '\0';
   (*t)->info = (na_long)0;
   (*t)->nlbl = NULL;
   (*t)->hlbl = NULL;
-  (*t)->shortname = (Char *)Malloc(33);
+  (*t)->shortname = (char *)Malloc(33);
   strcpy((*t)->shortname, name);
   stamp(&(*t)->netstamp);
   (*t)->deltatime = 0.0;
@@ -2445,17 +2380,17 @@ Char *name;
 
 
 
-Static log_tool *findtool(name_)
-Char *name_;
+static log_tool *findtool(name_)
+char *name_;
 {
   log_tool *Result;
-  Char name[17];
+  char name[17];
   log_tool *lp;
-  Char savefunc[17];
-  Char saveargs[256];
-  Char suffix[51];
-  Void (*proc) PP((log_action *act));
-  boolean ready;
+  char savefunc[17];
+  char saveargs[256];
+  char suffix[51];
+  void (*proc) (log_action *act);
+  int ready;
   cnfrec *cnfp;
 
   strcpy(name, name_);
@@ -2468,7 +2403,7 @@ Char *name_;
     newtool(&lp, name);
   if (!lp->ready) {
     sprintf(suffix, "LOG_%s_PROC", name);
-    ready = newci_findprocedure2(suffix, (Void(**) PV())(&proc));
+    ready = newci_findprocedure2(suffix, (void(**) ())(&proc));
     if (gg.traceflag)
       fprintf(tracefile, "Findtool to load: %s -  %s.\n", suffix, lp->fname);
     if (!ready && lp->fname != NULL) {
@@ -2481,7 +2416,7 @@ Char *name_;
 	if (P_escapecode == -20)
 	  _Escape(P_escapecode);
       ENDTRY(try2);
-      ready = newci_findprocedure2(suffix, (Void(**) PV())(&proc));
+      ready = newci_findprocedure2(suffix, (void(**) ())(&proc));
       if (gg.traceflag)
 	fprintf(tracefile, "Findtool, ready=%s\n", ready ? " TRUE" : "FALSE");
     }
@@ -2527,7 +2462,7 @@ Char *name_;
 
 
 
-Static Void calltool(t, act)
+static void calltool(t, act)
 log_tool *t;
 log_actionkinds act;
 {
@@ -2542,7 +2477,7 @@ log_actionkinds act;
 
 
 
-Static Void calltoolgate(g, act)
+static void calltoolgate(g, act)
 log_grec *g;
 log_actionkinds act;
 {
@@ -2552,7 +2487,7 @@ log_actionkinds act;
 
 
 
-Static Void calltoolnode(n, act)
+static void calltoolnode(n, act)
 log_nrec *n;
 log_actionkinds act;
 {
@@ -2562,7 +2497,7 @@ log_actionkinds act;
 
 
 
-Static Void calltoolkind(k, act)
+static void calltoolkind(k, act)
 log_krec *k;
 log_actionkinds act;
 {
@@ -2572,7 +2507,7 @@ log_actionkinds act;
 
 
 
-Static Void calltools(act)
+static void calltools(act)
 log_actionkinds act;
 {
   log_tool *tp;
@@ -2586,7 +2521,7 @@ log_actionkinds act;
 }
 
 
-Static Void callsimtools(act)
+static void callsimtools(act)
 log_actionkinds act;
 {
   log_tool *tp;
@@ -2602,11 +2537,11 @@ log_actionkinds act;
 
 
 
-Static Void send_general(sim, act)
+static void send_general(sim, act)
 log_tool *sim;
-Char *act;
+char *act;
 {
-  Char savefunc[17];
+  char savefunc[17];
 
   strcpy(savefunc, gg.genfunc);
   strcpy(gg.genfunc, act);
@@ -2616,11 +2551,11 @@ Char *act;
 
 
 
-Static Void send_gennode(n, act)
+static void send_gennode(n, act)
 log_nrec *n;
-Char *act;
+char *act;
 {
-  Char savefunc[17];
+  char savefunc[17];
 
   strcpy(savefunc, gg.genfunc);
   strcpy(gg.genfunc, act);
@@ -2629,11 +2564,11 @@ Char *act;
 }
 
 
-Static Void send_genkind(k, act)
+static void send_genkind(k, act)
 log_krec *k;
-Char *act;
+char *act;
 {
-  Char savefunc[17];
+  char savefunc[17];
 
   strcpy(savefunc, gg.genfunc);
   strcpy(gg.genfunc, act);
@@ -2642,11 +2577,11 @@ Char *act;
 }
 
 
-Static Void send_gengate(g, act)
+static void send_gengate(g, act)
 log_grec *g;
-Char *act;
+char *act;
 {
-  Char savefunc[17];
+  char savefunc[17];
 
   strcpy(savefunc, gg.genfunc);
   strcpy(gg.genfunc, act);
@@ -2656,11 +2591,11 @@ Char *act;
 
 
 
-Static Void send_all(act)
-Char *act;
+static void send_all(act)
+char *act;
 {
   log_tool *tp;
-  Char savefunc[17];
+  char savefunc[17];
 
   strcpy(savefunc, gg.genfunc);
   tp = gg.toolbase;
@@ -2675,11 +2610,11 @@ Char *act;
 }
 
 
-Static Void send_allnodes(act)
-Char *act;
+static void send_allnodes(act)
+char *act;
 {
   log_tool *tp;
-  Char savefunc[17];
+  char savefunc[17];
 
   strcpy(savefunc, gg.genfunc);
   tp = gg.toolbase;
@@ -2695,11 +2630,11 @@ Char *act;
 }
 
 
-Static Void send_allkinds(act)
-Char *act;
+static void send_allkinds(act)
+char *act;
 {
   log_tool *tp;
-  Char savefunc[17];
+  char savefunc[17];
 
   strcpy(savefunc, gg.genfunc);
   tp = gg.toolbase;
@@ -2715,11 +2650,11 @@ Char *act;
 }
 
 
-Static Void send_allgates(act)
-Char *act;
+static void send_allgates(act)
+char *act;
 {
   log_tool *tp;
-  Char savefunc[17];
+  char savefunc[17];
 
   strcpy(savefunc, gg.genfunc);
   tp = gg.toolbase;
@@ -2739,7 +2674,7 @@ Char *act;
 
 
 
-Static Void closetool(tp)
+static void closetool(tp)
 log_tool *tp;
 {
   if (tp->ready)
@@ -2749,7 +2684,7 @@ log_tool *tp;
 
 
 
-Static Void closetools()
+static void closetools()
 {
   log_tool *tp;
 
@@ -2762,7 +2697,7 @@ Static Void closetools()
 
 
 
-Static long glowcol(n, def)
+static long glowcol(n, def)
 log_nrec *n;
 long def;
 {
@@ -2775,7 +2710,7 @@ long def;
 
 
 
-Static Void resetmessages()
+static void resetmessages()
 {
   short opos;
 
@@ -2798,7 +2733,7 @@ Static Void resetmessages()
 /*=                                              =*/
 /*================================================*/
 
-Static Void clearscreen()
+static void clearscreen()
 {
   remcursor();
   m_noclip();
@@ -2815,7 +2750,7 @@ Static Void clearscreen()
 
 
 
-Static Void clearshowalpha()
+static void clearshowalpha()
 {
   if (onescreen)
     clearscreen();
@@ -2849,7 +2784,7 @@ Static Void clearshowalpha()
 /*=                                              =*/
 /*================================================*/
 
-Static Void show_events()
+static void show_events()
 {
   /*zEMBED
      char buf[30];
@@ -2877,13 +2812,13 @@ Static Void show_events()
 /*=                                              =*/
 /*================================================*/
 
-Static boolean pollkbd2()
+static int pollkbd2()
 {
   return (nk_keybufsize() != 0 || pushedbackkey != '\0');
 }
 
 
-Static Void pen()
+static void pen()
 {
 
 #define ALERTNESS 2 /* Time to get bored (in cs) */
@@ -2891,11 +2826,11 @@ Static Void pen()
 
   long x, y;
   short i, rx, ry, cred;
-  /* Static boolean pollkbd2(void); */
+  /* static int pollkbd2(void); */
   static int oldx, oldy;
   static long awake;
   long now; 
-  Char rval, gval, bval;
+  char rval, gval, bval;
 
 
   /* the following section improves idling behavior       */
@@ -3006,9 +2941,9 @@ Static Void pen()
     x = timers_sysclock() * 6 % 137 + 119;
 /* p2c: log.text, line 2863:
  * Note: Using % for possibly-negative arguments [317] */
-    rval = (Char)(x * rcolormap[cred] / 255);
-    gval = (Char)(x * gcolormap[cred] / 255);
-    bval = (Char)(x * bcolormap[cred] / 255);
+    rval = (char)(x * rcolormap[cred] / 255);
+    gval = (char)(x * gcolormap[cred] / 255);
+    bval = (char)(x * bcolormap[cred] / 255);
     m_vsetcolors((long)cred, 1L, (unsigned char *) &rval, 
 		 (unsigned char *) &gval, (unsigned char *) &bval);
   }
@@ -3033,7 +2968,7 @@ Static Void pen()
 /*=                                              =*/
 /*================================================*/
 
-Static boolean justtap()
+static int justtap()
 {
   long t0;
   short tx, ty;
@@ -3059,7 +2994,7 @@ Static boolean justtap()
 /*=                                              =*/
 /*================================================*/
 
-Static Char testkey2()
+static char testkey2()
 {
   if (pushedbackkey != '\0')
     return pushedbackkey;
@@ -3078,9 +3013,9 @@ Static Char testkey2()
 /*=                                              =*/
 /*================================================*/
 
-Static Char inkey2()
+static char inkey2()
 {
-  Char ch;
+  char ch;
 
   do {
   } while (!pollkbd2());
@@ -3106,17 +3041,17 @@ Static Char inkey2()
 }
 
 
-Static Void inkey3(ch)
-Char *ch;
+static void inkey3(ch)
+char *ch;
 {
   *ch = inkey2();
 }
 
 
-Static Char inkey4()
+static char inkey4()
 {
   /* undo CAPSLOCK key */
-  Char ch;
+  char ch;
 
   ch = inkey2();
   if (!nk_capslock)
@@ -3129,8 +3064,8 @@ Static Char inkey4()
 }
 
 
-Static Void ungetkey2(ch)
-Char ch;
+static void ungetkey2(ch)
+char ch;
 {
   pushedbackkey = ch;
 }
@@ -3143,9 +3078,9 @@ Char ch;
 /*=                                              =*/
 /*================================================*/
 
-Static Void waitforkey()
+static void waitforkey()
 {
-  Char ch;
+  char ch;
 
   while (pollkbd2())
     ch = inkey2();
@@ -3167,7 +3102,7 @@ Static Void waitforkey()
 /*=                                              =*/
 /*================================================*/
 
-Static boolean inbox(x, y, x1, y1)
+static int inbox(x, y, x1, y1)
 short x, y, x1, y1;
 {
   return (gg.t.x >= x && gg.t.y >= y && gg.t.x <= x + x1 && gg.t.y <= y + y1);
@@ -3182,7 +3117,7 @@ short x, y, x1, y1;
 /*=                                              =*/
 /*================================================*/
 
-Static Void drawvector2(v, x1, y1, x2, y2)
+static void drawvector2(v, x1, y1, x2, y2)
 log_vectorrec *v;
 long x1, y1, x2, y2;
 {
@@ -3270,7 +3205,7 @@ long x1, y1, x2, y2;
 }
 
 
-Static Void drawvector4(v, x1, y1, x2, y2, x3, y3, x4, y4)
+static void drawvector4(v, x1, y1, x2, y2, x3, y3, x4, y4)
 log_vectorrec *v;
 long x1, y1, x2, y2, x3, y3, x4, y4;
 {
@@ -3301,13 +3236,13 @@ long x1, y1, x2, y2, x3, y3, x4, y4;
 #define big2            "0.,\000123-456\000789 "
 
 
-Static Void drawtext(v, scale, rot, xx, yy)
+static void drawtext(v, scale, rot, xx, yy)
 log_vectorrec *v;
 long scale, rot, xx, yy;
 {
   long sc, i, j, tx, ty;
-  Char mode;
-  Char buf[256];
+  char mode;
+  char buf[256];
   long FORLIM;
 
   sc = v->UU.U116.tsize * scale;
@@ -3348,23 +3283,23 @@ long scale, rot, xx, yy;
 	case 'P':
 	  j = strposc("0.,+123-456*789/E()^", buf[i - 1], 1L);
 	  if (j > 0)
-	    buf[i - 1] = (Char)(j + 147);
+	    buf[i - 1] = (char)(j + 147);
 	  break;
 
 	case 'B':
 	  j = strposc("0.,+123-456*789/\0()^ABCDEFGHIJKLMNOPQRSTUVWXYZ",
 		      toupper(buf[i - 1]), 1L);
 	  if (j > 20)
-	    buf[i - 1] = (Char)(j + 147);
+	    buf[i - 1] = (char)(j + 147);
 	  else if (j > 0)
-	    buf[i - 1] = (Char)(j + 127);
+	    buf[i - 1] = (char)(j + 127);
 	  break;
 
 	case 'O':
 	  j = strposc("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
 		      toupper(buf[i - 1]), 1L);
 	  if (j > 0)
-	    buf[i - 1] = (Char)(j + 213);
+	    buf[i - 1] = (char)(j + 213);
 	  break;
 	}
 	i++;
@@ -3413,11 +3348,11 @@ long scale, rot, xx, yy;
     for (i = 0; i < FORLIM; i++) {
       j = strposc(big1, v->UU.U116.sp[i], 1L);
       if (j <= 20)
-	buf[i] = (Char)(j + 127);
+	buf[i] = (char)(j + 127);
       else if (j <= 46)
-	buf[i] = (Char)(j + 147);
+	buf[i] = (char)(j + 147);
       else if (j <= 72)
-	buf[i] = (Char)(j + 121);
+	buf[i] = (char)(j + 121);
       else
 	buf[i] = ' ';
     }
@@ -3450,7 +3385,7 @@ long scale, rot, xx, yy;
   for (i = 0; i < FORLIM; i++) {
     j = strposc(big2, v->UU.U116.sp[i], 1L);
     if (j <= 15)
-      buf[i] = (Char)(j + 193);
+      buf[i] = (char)(j + 193);
     else
       buf[i] = ' ';
   }
@@ -3479,12 +3414,12 @@ long scale, rot, xx, yy;
 
 
 
-Static Void plaindrawgatec(x, y, g, c)
+static void plaindrawgatec(x, y, g, c)
 short x, y, g, c;
 {
   short i, z, rxx, rxy, ryx, ryy;
   log_krec *k;
-  boolean hascolor;
+  int hascolor;
   short FORLIM;
   log_vectorrec *WITH1;
 
@@ -3645,12 +3580,12 @@ short x, y, g, c;
 
 
 
-Static Void udrawgatec(x, y, g, c)
+static void udrawgatec(x, y, g, c)
 short x, y, g, c;
 {
   short i, z, rxx, rxy, ryx, ryy;
   log_krec *k;
-  boolean hascolor;
+  int hascolor;
   short FORLIM;
   log_vectorrec *WITH1;
 
@@ -3763,7 +3698,7 @@ short x, y, g, c;
 /*=                                              =*/
 /*================================================*/
 
-Static Void drawgatedotsc(x, y, g, c)
+static void drawgatedotsc(x, y, g, c)
 short x, y, g, c;
 {
   short i, z, rxx, rxy, ryx, ryy;
@@ -3793,12 +3728,12 @@ short x, y, g, c;
 }
 
 
-Static Void drawgatec(x, y, g, c)
+static void drawgatec(x, y, g, c)
 short x, y, g, c;
 {
   short i, xx, yy, z, rxx, rxy, ryx, ryy;
   long savecol;
-  boolean hascolor;
+  int hascolor;
   log_krec *WITH;
   short FORLIM;
   log_vectorrec *WITH1;
@@ -3958,11 +3893,11 @@ short x, y, g, c;
 
 
 
-Static Void signallabel(x, y, gtype, sig, c)
+static void signallabel(x, y, gtype, sig, c)
 short x, y, gtype, sig, c;
 {
   log_krec *k;
-  Char STR1[256];
+  char STR1[256];
 
   k = kind[(gtype & (log_kindoffset - 1)) - 1];
   if (!(sig != 0 && k->flag.U3.named))
@@ -3979,7 +3914,7 @@ short x, y, gtype, sig, c;
 
 
 
-Static Void gsignallabel(x, y, g, c)
+static void gsignallabel(x, y, g, c)
 short x, y;
 log_grec *g;
 short c;
@@ -3992,12 +3927,12 @@ short c;
 typedef enum {inside,north,east,south,west} placement;
 
 
-Static Void drawpnums(g, c)
+static void drawpnums(g, c)
 log_grec *g;
 short c;
 {
   short rxx, rxy, ryx, ryy, i, j, k;
-  Char s[7];
+  char s[7];
   log_krec *WITH;
   short FORLIM, FORLIM1;
   int tx,ty,ex,ey;
@@ -4069,10 +4004,10 @@ short c;
 #undef totab
 
 
-Static Void setscale PP((short s));
+static void setscale (short s);
 
 
-Static Void kdrawgatec(i, c)
+static void kdrawgatec(i, c)
 short i, c;
 {
   short x, y;
@@ -4102,7 +4037,7 @@ short i, c;
 /*=                                              =*/
 /*================================================*/
 
-Static Void drawgatexc(g, c)
+static void drawgatexc(g, c)
 log_grec *g;
 short c;
 {
@@ -4116,7 +4051,7 @@ short c;
 }
 
 
-Static Void drawgatex(g)
+static void drawgatex(g)
 log_grec *g;
 {
   drawgatexc(g, gg.color.gate);
@@ -4124,9 +4059,9 @@ log_grec *g;
 
 
 
-Static Void setdimgate(g, dim)
+static void setdimgate(g, dim)
 log_grec *g;
-boolean dim;
+int dim;
 {
   log_grec *g1;
 
@@ -4159,7 +4094,7 @@ boolean dim;
 /*=                                              =*/
 /*================================================*/
 
-Static Void eragate(g)
+static void eragate(g)
 log_grec *g;
 {
   log_grec *g1, *g2;
@@ -4201,7 +4136,7 @@ log_grec *g;
 /*=                                              =*/
 /*================================================*/
 
-Static Void drawsolderc(x, y, c)
+static void drawsolderc(x, y, c)
 short x, y, c;
 {
   if (!showsolder)
@@ -4238,7 +4173,7 @@ short x, y, c;
 /*=                                              =*/
 /*================================================*/
 
-Static Void drawtransc(x, y, c)
+static void drawtransc(x, y, c)
 short x, y, c;
 {
   if (!vlsi)
@@ -4260,7 +4195,7 @@ short x, y, c;
 /*=                                              =*/
 /*================================================*/
 
-Static Void eralabel(l)
+static void eralabel(l)
 log_lrec *l;
 {
   m_color((long)gg.color.backgr);
@@ -4278,7 +4213,7 @@ log_lrec *l;
 /*=                                              =*/
 /*================================================*/
 
-Static Void xorlabel(x, y, l)
+static void xorlabel(x, y, l)
 short x, y;
 log_lrec *l;
 {
@@ -4299,7 +4234,7 @@ log_lrec *l;
 /*=                                              =*/
 /*================================================*/
 
-Static Void drawboxc0(x1, y1, x2, y2, c)
+static void drawboxc0(x1, y1, x2, y2, c)
 short x1, y1, x2, y2, c;
 {
   m_color((long)c);
@@ -4309,7 +4244,7 @@ short x1, y1, x2, y2, c;
 }
 
 
-Static Void drawboxc(b, c)
+static void drawboxc(b, c)
 log_brec *b;
 short c;
 {
@@ -4324,7 +4259,7 @@ short c;
 /*=                                              =*/
 /*================================================*/
 
-Static Void drawmarkersc(c)
+static void drawmarkersc(c)
 short c;
 {
   clipon();
@@ -4348,7 +4283,7 @@ short c;
 /*=                                              =*/
 /*================================================*/
 
-Static Void drawnodec(n, c)
+static void drawnodec(n, c)
 log_nrec *n;
 short c;
 {
@@ -4420,7 +4355,7 @@ short c;
 /*=                                              =*/
 /*================================================*/
 
-Static Void drawnode(n)
+static void drawnode(n)
 log_nrec *n;
 {
   drawnodec(n, -1);
@@ -4434,10 +4369,10 @@ log_nrec *n;
 /*=                                              =*/
 /*================================================*/
 
-Static boolean pageempty PP((int pg));
+static int pageempty (int pg);
 
 
-Static Void refrpagedisp()
+static void refrpagedisp()
 {
   short num;
 
@@ -4462,7 +4397,7 @@ Static Void refrpagedisp()
 /*=                                              =*/
 /*================================================*/
 
-Static Void refreditmode()
+static void refreditmode()
 {
   hidecursor();
   m_color((long)gg.color.backgr);
@@ -4501,8 +4436,8 @@ Static Void refreditmode()
 /*=                                              =*/
 /*================================================*/
 
-Static Void refrbaseline(always)
-boolean always;
+static void refrbaseline(always)
+int always;
 {
   short c;
 
@@ -4535,7 +4470,7 @@ boolean always;
 /*=                                              =*/
 /*================================================*/
 
-Static Void refresh()
+static void refresh()
 {
   long x1, y1, x2, y2;
   log_grec *g;
@@ -4692,7 +4627,7 @@ Static Void refresh()
 /*=                                              =*/
 /*================================================*/
 
-Static Void refreshsoon()
+static void refreshsoon()
 {
   refrtimer0 = refrdelay;
   refrtimer = refrdelay;
@@ -4708,8 +4643,8 @@ Static Void refreshsoon()
 
 
 
-Static Void message(msg)
-Char *msg;
+static void message(msg)
+char *msg;
 {
   na_strlist *l1;
 
@@ -4738,8 +4673,8 @@ Char *msg;
 
 
 
-Static Void vmessage(msg)
-Char *msg;
+static void vmessage(msg)
+char *msg;
 {
   na_strlist *l1;
 
@@ -4758,11 +4693,11 @@ Char *msg;
 
 
 
-Static Void vmessageflag(msg, b)
-Char *msg;
-boolean b;
+static void vmessageflag(msg, b)
+char *msg;
+int b;
 {
-  Char STR1[256];
+  char STR1[256];
 
   if (b) {
     sprintf(STR1, "%sON", msg);
@@ -4775,8 +4710,8 @@ boolean b;
 
 
 
-Static Void tracemessage(msg)
-Char *msg;
+static void tracemessage(msg)
+char *msg;
 {
   if (!gg.traceflag)
     return;
@@ -4802,8 +4737,8 @@ Char *msg;
 
 
 
-Static Void dumpmessage(msg)
-Char *msg;
+static void dumpmessage(msg)
+char *msg;
 {
   if (*dumpfname == '\0')
     return;
@@ -4821,7 +4756,7 @@ Char *msg;
 
 
 
-Static Void closedump()
+static void closedump()
 {
   if (gg.dumpopen) {
     TRY(try4);
@@ -4838,7 +4773,7 @@ Static Void closedump()
 
 
 
-Static Void closetrace()
+static void closetrace()
 {
   if (gg.traceopen) {
     TRY(try5);
@@ -4855,10 +4790,10 @@ Static Void closetrace()
 
 
 
-Static Void setdumpname(name_)
-Char *name_;
+static void setdumpname(name_)
+char *name_;
 {
-  Char name[256];
+  char name[256];
 
   strcpy(name, name_);
   newci_fixfname(name, "text", "");
@@ -4868,10 +4803,10 @@ Char *name_;
 
 
 
-Static Void settracename(name_)
-Char *name_;
+static void settracename(name_)
+char *name_;
 {
-  Char name[256];
+  char name[256];
 
   strcpy(name, name_);
   newci_fixfname(name, "text", "");
@@ -4883,7 +4818,7 @@ Char *name_;
 
 
 
-Static Void closedumpfiles()
+static void closedumpfiles()
 {
   closedump();
   closetrace();
@@ -4899,7 +4834,7 @@ Static Void closedumpfiles()
 /*=                                              =*/
 /*================================================*/
 
-Static Void refrmenu()
+static void refrmenu()
 {
   short i, FORLIM;
 
@@ -4931,7 +4866,7 @@ Static Void refrmenu()
 
 
 
-Static Void beginbottom()
+static void beginbottom()
 {
   remcursor();
   clipoff();
@@ -4949,7 +4884,7 @@ Static Void beginbottom()
 
 
 
-Static Void endbottom()
+static void endbottom()
 {
   remcursor();
   bottomcount--;
@@ -4978,7 +4913,7 @@ Static Void endbottom()
 /*=                                              =*/
 /*================================================*/
 
-Static Void beginerror()
+static void beginerror()
 {
   beginbottom();
   strlist_empty(&thingstodo);
@@ -4994,7 +4929,7 @@ Static Void beginerror()
 /*=                                              =*/
 /*================================================*/
 
-Static Void enderror()
+static void enderror()
 {
   printf("  Press any key to continue.");
   m_alpha_on();
@@ -5011,7 +4946,7 @@ Static Void enderror()
 /*=                                              =*/
 /*================================================*/
 
-Static Void refrscreen1()
+static void refrscreen1()
 {
   m_colormode((long)m_normal);
   m_noclip();
@@ -5033,7 +4968,7 @@ Static Void refrscreen1()
 /*=                                              =*/
 /*================================================*/
 
-Static Void refrscreen()
+static void refrscreen()
 {
   gg.showpage = gg.curpage;
   bottomcount = 0;
@@ -5048,7 +4983,7 @@ Static Void refrscreen()
 
 
 
-Static Void resize_screen()
+static void resize_screen()
 {
   initscreen2();
   refrscreen();
@@ -5060,7 +4995,7 @@ Static Void resize_screen()
 
 
 
-Static Void chpage(pg)
+static void chpage(pg)
 short pg;
 {
   log_regrec *r;
@@ -5075,7 +5010,7 @@ short pg;
 }
 
 
-Static Void chpageplace(pg, x1, y1, x2, y2)
+static void chpageplace(pg, x1, y1, x2, y2)
 short pg, x1, y1, x2, y2;
 {
   log_regrec *r;
@@ -5096,7 +5031,7 @@ short pg, x1, y1, x2, y2;
 
 
 
-Static boolean pageempty(pg)
+static int pageempty(pg)
 short pg;
 {
   return (gg.gbase[pg - 1] == NULL && gg.hwbase[pg - 1] == NULL &&
@@ -5105,14 +5040,14 @@ short pg;
 }
 
 
-Static boolean pagenull(pg)
+static int pagenull(pg)
 short pg;
 {
   return (pageempty(pg) && gg.pageregions[pg - 1] == NULL);
 }
 
 
-Static boolean pagechanged(pg)
+static int pagechanged(pg)
 short pg;
 {
   return (gg.pagechanged[pg - 1] && !pageempty(pg));
@@ -5120,7 +5055,7 @@ short pg;
 
 
 
-Static boolean anychanged()
+static int anychanged()
 {
   short i;
 
@@ -5136,7 +5071,7 @@ Static boolean anychanged()
 
 
 
-Static Void reportnodeconflict(n)
+static void reportnodeconflict(n)
 log_nrec *n;
 {
   if (n->conflict || !conflictenbl)
@@ -5152,7 +5087,7 @@ log_nrec *n;
 
 
 
-Static Void reportgateconflict(g)
+static void reportgateconflict(g)
 log_grec *g;
 {
   if (g->conflict || !conflictenbl)
@@ -5172,7 +5107,7 @@ log_grec *g;
 
 
 
-Static Void drawhistdivisions(x1, x2)
+static void drawhistdivisions(x1, x2)
 short x1, x2;
 {
   short x, y;
@@ -5193,7 +5128,7 @@ short x1, x2;
 
 
 
-Static Void historypointx(ht, x)
+static void historypointx(ht, x)
 log_htrec *ht;
 short *x;
 {
@@ -5211,7 +5146,7 @@ short *x;
 
 
 
-Static Void historyvaluey(hn, value, outval, y)
+static void historyvaluey(hn, value, outval, y)
 log_hnrec *hn;
 double value, *outval;
 short *y;
@@ -5231,7 +5166,7 @@ short *y;
 
 
 
-Static Void historypointy(hn, ht, y)
+static void historypointy(hn, ht, y)
 log_hnrec *hn;
 log_htrec *ht;
 short *y;
@@ -5244,10 +5179,10 @@ short *y;
 
 
 
-Static Void getnodeval(n, val, opts)
+static void getnodeval(n, val, opts)
 log_nrec *n;
 double *val;
-Char *opts;
+char *opts;
 {
   gg.actval = 0.0;
   strcpy(gg.actstr, opts);
@@ -5269,7 +5204,7 @@ Char *opts;
 /*=                                              =*/
 /*================================================*/
 
-Static Void pass()
+static void pass()
 {
   log_grec *g, *g1, *g2;
   log_nrec *n, *n1, *n2;
@@ -5281,9 +5216,9 @@ Static Void pass()
   log_hnrec *hn;
   long i1;
   short histsweep, hx1, hx2, hy1, hy2;
-  boolean havetime, hadconflicts;
+  int havetime, hadconflicts;
   double mintime, dtime;
-  boolean flag, flag2;
+  int flag, flag2;
   log_gattrrec *WITH;
   log_hwrec *WITH1;
   log_vwrec *WITH2;
@@ -5476,12 +5411,12 @@ Static Void pass()
 
 #ifdef __alpha__
           ht = (log_htrec *)Malloc(sizeof(log_htrec) -
-                                  log_million * sizeof(Anyptr) +
-                                  hncount * sizeof(Anyptr) *2);
+                                  log_million * sizeof(void *) +
+                                  hncount * sizeof(void *) *2);
 #else
           ht = (log_htrec *)Malloc(sizeof(log_htrec) -
-                                  log_million * sizeof(Anyptr) +
-                                  hncount * sizeof(Anyptr));
+                                  log_million * sizeof(void *) +
+                                  hncount * sizeof(void *));
 #endif
 
 	  ht->next = NULL;
@@ -5683,7 +5618,7 @@ Static Void pass()
 
 
 
-Static Void clearconflicts(tool)
+static void clearconflicts(tool)
 log_tool *tool;
 {
   log_grec *g;
@@ -5704,14 +5639,7 @@ log_tool *tool;
 }
 
 
-
-
-
-
-Static short getsignal PP((int d, Char *n));
-
-
-
+static short getsignal (int d, char *n);
 
 
 /*===================  NEWHW  ====================*/
@@ -5720,7 +5648,7 @@ Static short getsignal PP((int d, Char *n));
 /*=                                              =*/
 /*================================================*/
 
-Static Void newhw(hw)
+static void newhw(hw)
 log_hwrec **hw;
 {
   *hw = (log_hwrec *)Malloc(sizeof(log_hwrec));
@@ -5740,7 +5668,7 @@ log_hwrec **hw;
 /*=                                              =*/
 /*================================================*/
 
-Static Void disphw(hw)
+static void disphw(hw)
 log_hwrec **hw;
 {
   log_hwrec *hw1;
@@ -5774,7 +5702,7 @@ log_hwrec **hw;
 /*=                                              =*/
 /*================================================*/
 
-Static Void newvw(vw)
+static void newvw(vw)
 log_vwrec **vw;
 {
   *vw = (log_vwrec *)Malloc(sizeof(log_vwrec));
@@ -5784,17 +5712,17 @@ log_vwrec **vw;
 }
 
 
-#define rtn             "DISPVW"
+#define rtn             "DISW"
 
 
 
-/*==================  DISPVW  ====================*/
+/*==================  DISW  ====================*/
 /*=                                              =*/
 /*=  Dispose of a Vertical Wire.                 =*/
 /*=                                              =*/
 /*================================================*/
 
-Static Void dispvw(vw)
+static void dispvw(vw)
 log_vwrec **vw;
 {
   log_vwrec *vw1;
@@ -5828,7 +5756,7 @@ log_vwrec **vw;
 /*=                                              =*/
 /*================================================*/
 
-Static Void newsolder(s)
+static void newsolder(s)
 log_srec **s;
 {
   *s = (log_srec *)Malloc(sizeof(log_srec));
@@ -5852,7 +5780,7 @@ log_srec **s;
 /*=                                              =*/
 /*================================================*/
 
-Static Void dispsolder(s)
+static void dispsolder(s)
 log_srec **s;
 {
   log_srec *s1;
@@ -5886,7 +5814,7 @@ log_srec **s;
 /*=                                              =*/
 /*================================================*/
 
-Static Void linkgate(g)
+static void linkgate(g)
 log_grec **g;
 {
   (*g)->next = gg.gbase[gg.curpage - 1];
@@ -5900,7 +5828,7 @@ log_grec **g;
 
 
 
-Static Void newattrs(gattr, numattrs, kattr)
+static void newattrs(gattr, numattrs, kattr)
 log_gattrrec **gattr;
 short numattrs;
 log_kattrrec *kattr;
@@ -5924,7 +5852,7 @@ log_kattrrec *kattr;
       break;
 
     case 'C':
-      (*gattr)[i].UU.c = (Char *)Malloc(kattr[i].prec + 1L);
+      (*gattr)[i].UU.c = (char *)Malloc(kattr[i].prec + 1L);
       strcpy((*gattr)[i].UU.c, kattr[i].UU.c);
       break;
 
@@ -5947,7 +5875,7 @@ log_kattrrec *kattr;
 
 
 
-Static Void disposeattrs(gattr, numattrs, kattr)
+static void disposeattrs(gattr, numattrs, kattr)
 log_gattrrec **gattr;
 short numattrs;
 log_kattrrec *kattr;
@@ -5971,7 +5899,7 @@ log_kattrrec *kattr;
 
 
 
-Static Void copyattrs(gattr, oldattr, numattrs, kattr)
+static void copyattrs(gattr, oldattr, numattrs, kattr)
 log_gattrrec **gattr, *oldattr;
 short numattrs;
 log_kattrrec *kattr;
@@ -5985,7 +5913,7 @@ log_kattrrec *kattr;
     switch (kattr[i].dtype) {
 
     case 'C':
-      (*gattr)[i].UU.c = (Char *)Malloc(kattr[i].prec + 1L);
+      (*gattr)[i].UU.c = (char *)Malloc(kattr[i].prec + 1L);
       strcpy((*gattr)[i].UU.c, oldattr[i].UU.c);
       break;
 
@@ -6006,7 +5934,7 @@ log_kattrrec *kattr;
 /*=                                              =*/
 /*================================================*/
 
-Static Void newgptr(g)
+static void newgptr(g)
 log_grec **g;
 {
   if (freegate == NULL)
@@ -6018,13 +5946,13 @@ log_grec **g;
 }
 
 
-Static Void newgate2(g, gt, sig, attrs)
+static void newgate2(g, gt, sig, attrs)
 log_grec **g;
 short gt, sig;
 log_gattrrec *attrs;
 {
   short i;
-  Char name[256];
+  char name[256];
 
   newgptr(g);
   (*g)->g = gt;
@@ -6063,7 +5991,7 @@ log_gattrrec *attrs;
 
 
 
-Static Void newgate(g, gt)
+static void newgate(g, gt)
 log_grec **g;
 short gt;
 {
@@ -6080,7 +6008,7 @@ short gt;
 /*=                                              =*/
 /*================================================*/
 
-Static Void copygate(old, g)
+static void copygate(old, g)
 log_grec *old, **g;
 {
   long i, FORLIM;
@@ -6116,7 +6044,7 @@ log_grec *old, **g;
 /*=                                              =*/
 /*================================================*/
 
-Static Void unlkgate(g)
+static void unlkgate(g)
 log_grec **g;
 {
   log_grec *g1;
@@ -6141,7 +6069,7 @@ log_grec **g;
 /*=                                              =*/
 /*================================================*/
 
-Static Void disposegptr(g)
+static void disposegptr(g)
 log_grec **g;
 {
   (*g)->next = freegate;
@@ -6152,7 +6080,7 @@ log_grec **g;
 #define rtn             "DISPOSEGATE"
 
 
-Static Void disposegate(g)
+static void disposegate(g)
 log_grec **g;
 {
   log_grec *g1, *g2;
@@ -6190,7 +6118,7 @@ log_grec **g;
 /*=                                              =*/
 /*================================================*/
 
-Static Void linklabel(l)
+static void linklabel(l)
 log_lrec *l;
 {
   l->next = gg.lbase[gg.curpage - 1];
@@ -6199,7 +6127,7 @@ log_lrec *l;
 }
 
 
-Static Void newlabel(l)
+static void newlabel(l)
 log_lrec **l;
 {
   *l = (log_lrec *)Malloc(sizeof(log_lrec));
@@ -6215,7 +6143,7 @@ log_lrec **l;
 /*=                                              =*/
 /*================================================*/
 
-Static Void unlinklabel(l)
+static void unlinklabel(l)
 log_lrec *l;
 {
   log_lrec *l1;
@@ -6232,7 +6160,7 @@ log_lrec *l;
 }
 
 
-Static Void displabel(l)
+static void displabel(l)
 log_lrec **l;
 {
   unlinklabel(*l);
@@ -6247,7 +6175,7 @@ log_lrec **l;
 /*=                                              =*/
 /*================================================*/
 
-Static Void linkbox(b)
+static void linkbox(b)
 log_brec *b;
 {
   b->next = gg.bbase[gg.curpage - 1];
@@ -6256,7 +6184,7 @@ log_brec *b;
 }
 
 
-Static Void newbox(b)
+static void newbox(b)
 log_brec **b;
 {
   *b = (log_brec *)Malloc(sizeof(log_brec));
@@ -6272,7 +6200,7 @@ log_brec **b;
 /*=                                              =*/
 /*================================================*/
 
-Static Void unlinkbox(b)
+static void unlinkbox(b)
 log_brec *b;
 {
   log_brec *b1;
@@ -6289,7 +6217,7 @@ log_brec *b;
 }
 
 
-Static Void dispbox(b)
+static void dispbox(b)
 log_brec **b;
 {
   unlinkbox(*b);
@@ -6302,7 +6230,7 @@ log_brec **b;
 
 
 
-Static Void defsimulator(act)
+static void defsimulator(act)
 log_action *act;
 {
   switch (act->action) {
@@ -6320,12 +6248,12 @@ log_action *act;
 
 
 
-Static log_tool *findsimtype(st)
+static log_tool *findsimtype(st)
 uchar st;
 {
-  Char simname[17];
+  char simname[17];
   log_tool *stp;
-  boolean rdy;
+  int rdy;
 
   sprintf(simname, "%d", st);
   stp = findtool(simname);
@@ -6367,7 +6295,7 @@ uchar st;
 /*=                                              =*/
 /*================================================*/
 
-Static Void newnptr(n)
+static void newnptr(n)
 log_nrec **n;
 {
   if (freenode == NULL)
@@ -6379,7 +6307,7 @@ log_nrec **n;
 }
 
 
-Static Void newnode(n, st)
+static void newnode(n, st)
 log_nrec **n;
 uchar st;
 {
@@ -6408,7 +6336,7 @@ uchar st;
 
 
 
-Static Void dumpconflicts()
+static void dumpconflicts()
 {
   /*no longer needed (I hope!)*/
   log_grec *g;
@@ -6445,7 +6373,7 @@ Static Void dumpconflicts()
 /*=                                              =*/
 /*================================================*/
 
-Static Void copynode(old, n)
+static void copynode(old, n)
 log_nrec *old, **n;
 {
   newnptr(n);
@@ -6473,7 +6401,7 @@ log_nrec *old, **n;
 /*=                                              =*/
 /*================================================*/
 
-Static Void disposenptr(n)
+static void disposenptr(n)
 log_nrec **n;
 {
   (*n)->next = freenode;
@@ -6484,7 +6412,7 @@ log_nrec **n;
 #define rtn             "DISPNODE"
 
 
-Static Void disposenode(n)
+static void disposenode(n)
 log_nrec **n;
 {
   log_nrec *n1, *n2;
@@ -6531,7 +6459,7 @@ log_nrec **n;
 
 
 
-Static boolean nodeexists(n)
+static int nodeexists(n)
 log_nrec *n;
 {
   log_nrec *n1;
@@ -6544,7 +6472,7 @@ log_nrec *n;
 
 
 
-Static Void newnoderef(n, st, ref)
+static void newnoderef(n, st, ref)
 log_nrec **n;
 uchar st;
 long ref;
@@ -6555,7 +6483,7 @@ long ref;
 
 
 
-Static log_nrec *refnode(n)
+static log_nrec *refnode(n)
 log_nrec *n;
 {
   if (n == NULL)
@@ -6571,7 +6499,7 @@ log_nrec *n;
 
 
 
-Static Void unrefnode(n)
+static void unrefnode(n)
 log_nrec **n;
 {
   if (*n == NULL)
@@ -6593,7 +6521,7 @@ log_nrec **n;
 
 
 
-Static Void switchnode(n, n2)
+static void switchnode(n, n2)
 log_nrec **n, *n2;
 {
   if (*n != n2) {
@@ -6603,7 +6531,7 @@ log_nrec **n, *n2;
 }
 
 
-Static Void purgesignaltab()
+static void purgesignaltab()
 {
   short i, pg;
   log_nrec *n1;
@@ -6681,7 +6609,7 @@ Static Void purgesignaltab()
 /*=                                              =*/
 /*================================================*/
 
-Static Void garbagecoll()
+static void garbagecoll()
 {
   log_nrec *n, *n1;
   log_grec *g;
@@ -6747,13 +6675,13 @@ Static Void garbagecoll()
 /*=                                              =*/
 /*================================================*/
 
-Static short getsignal(d, n_)
+static short getsignal(d, n_)
 short d;
-Char *n_;
+char *n_;
 {
-  Char n[256];
+  char n[256];
   short i;
-  Char STR1[256], STR2[256];
+  char STR1[256], STR2[256];
   short FORLIM;
   log_sigrec *WITH;
 
@@ -6796,8 +6724,8 @@ Char *n_;
 
 
 
-Static Void getsigname(name, sig)
-Char *name;
+static void getsigname(name, sig)
+char *name;
 log_sigrec **sig;
 {
   short i;
@@ -6820,7 +6748,7 @@ log_sigrec **sig;
 /*=                                              =*/
 /*================================================*/
 
-Static Void setscale(short s)
+static void setscale(short s)
 
 {
   zoom = s;
@@ -6837,7 +6765,7 @@ Static Void setscale(short s)
 /*=                                              =*/
 /*================================================*/
 
-Static Void newpage(p)
+static void newpage(p)
 short p;
 {
   short i;
@@ -6877,7 +6805,7 @@ short p;
 
 
 
-Static Void setupregion(r, pagenum)
+static void setupregion(r, pagenum)
 log_regrec **r;
 short pagenum;
 {
@@ -6923,8 +6851,8 @@ short pagenum;
 /*=                                              =*/
 /*================================================*/
 
-Static Char *colorname(Result, c)
-Char *Result;
+static char *colorname(Result, c)
+char *Result;
 short c;
 {
   if (c == log_wcol_normal)
@@ -6952,7 +6880,7 @@ short c;
 /*=                                              =*/
 /*================================================*/
 
-Static Void dumpnodes()
+static void dumpnodes()
 {
   log_nrec *n, *n1;
   log_hwrec *hw;
@@ -6962,8 +6890,8 @@ Static Void dumpnodes()
   short i, j;
   timerec timevar;
   daterec datevar;
-  boolean savebool;
-  Char STR3[9];
+  int savebool;
+  char STR3[9];
   short FORLIM;
   log_krec *WITH;
 
@@ -7117,36 +7045,23 @@ Static Void dumpnodes()
 /*=                                              =*/
 /*================================================*/
 
-Static Void gethelp(s)
-Char *s;
+static void gethelp(s)
+char *s;
 {  
-   Char cmdline[256];
+   char cmdline[256];
    char *pager;
   
-#ifdef OS2
-   vmessage("Starting a help window");
-#else
    vmessage("Starting an xterm for help");
-#endif /* OS2 */
 
    pager = getenv("PAGER");
    if (!pager)
      pager = "more";
 
-#ifdef OS2
-/* Note that this is not fully correct since if you are running
-   on OS/2 remotely it will start the editor on the host machine,
-   not on your machine. When OS/2 TCPIP discovers xterm this code can
-   be removed and setting PAGER to the right thing will work on all
-   systems.                                          */
-    sprintf(cmdline, "start EPM.EXE %s\n",loghelpname);
-#else
    if (*m_display_name == '\0')
     sprintf(cmdline, "xterm -e %s %s & \n", pager, loghelpname);
    else
     sprintf(cmdline, "xterm -display %s -e %s %s & \n",
             m_display_name, pager, loghelpname);
-#endif /* OS2 */
 
    system(cmdline);
 }
@@ -7159,15 +7074,15 @@ Char *s;
 /*=                                              =*/
 /*================================================*/
 
-Static Void readlnpass(s, mode)
-Char *s;
+static void readlnpass(s, mode)
+char *s;
 short mode;
 {
   uchar ch;
   short i, xleft, oxleft;
   long x, y;
-  boolean redraw, starting;
-  Char STR1[256];
+  int redraw, starting;
+  char STR1[256];
 
   m_alpha_on();
   if (mode != 3)   /*mode 0: normal*/
@@ -7245,19 +7160,12 @@ short mode;
   }
 }
 
+static void dofunction ();
 
 
+static void assertfunc (char *name);
 
-
-
-Static Void dofunction PV();
-
-
-Static Void assertfunc PP((Char *name));
-
-
-
-Static Void clearfunc()
+static void clearfunc()
 {
   if (doingcnffunction)
     *gg.func = '\0';
@@ -7265,9 +7173,7 @@ Static Void clearfunc()
     assertfunc("");
 }
 
-
-
-Static Void refrfunc()
+static void refrfunc()
 {
   if (gg.initdone && !doingcnffunction)
     assertfunc("REFR");
@@ -7275,9 +7181,7 @@ Static Void refrfunc()
     clearfunc();
 }
 
-
-
-Static Void zoomto(z)
+static void zoomto(z)
 short z;
 {
   short s0, i, FORLIM;
@@ -7300,9 +7204,9 @@ short z;
 
 
 
-Static Void scroll()
+static void scroll()
 {
-  Char ch, TEMP;
+  char ch, TEMP;
 
   if (strcmp(gg.func, "REFR"))
     return;
@@ -7323,9 +7227,9 @@ Static Void scroll()
 
 
 
-Static Void doimmedcnffunction()
+static void doimmedcnffunction()
 {
-  Char STR1[256], STR2[256];
+  char STR1[256], STR2[256];
 
   if (*gg.func == '\0')
     return;
@@ -7485,17 +7389,17 @@ Static Void doimmedcnffunction()
 
 
 
-Static Void doimmedfunction()
+static void doimmedfunction()
 {
   log_tool *tp;
-  Char cmd[256];
+  char cmd[256];
   na_strlist *l1;
 
   if (*gg.func != '\0') {
     l1 = strlist_find(commandlist, gg.func);
     if (l1 != NULL) {
-      if (*(Char *)l1->value != '\0') {
-	tp = findtool((Char *)l1->value);
+      if (*(char *)l1->value != '\0') {
+	tp = findtool((char *)l1->value);
 	if (tp->ready)
 	  strlist_delete(&commandlist, l1);
       }
@@ -7631,11 +7535,11 @@ Static Void doimmedfunction()
 
 
 
-Static Void assertfunc(name_)
-Char *name_;
+static void assertfunc(name_)
+char *name_;
 {
-  Char name[256];
-  Char cmd[17];
+  char name[256];
+  char cmd[17];
 
   strcpy(name, name_);
   remcursor();
@@ -7668,14 +7572,14 @@ Char *name_;
 /*=                                              =*/
 /*================================================*/
 
-Static Void trykbd()
+static void trykbd()
 {
   long t;
-  boolean moving;
-  Char ch;
+  int moving;
+  char ch;
   macrorec *mp;
   na_strlist *todo;
-  Char TEMP;
+  char TEMP;
 
   if (gg.t.near_ && !gg.t0.near_ && gg.showpage >= 0) {
     m_graphics_on();
@@ -7773,7 +7677,7 @@ Static Void trykbd()
 
 
 
-Static Void trykbdscroll()
+static void trykbdscroll()
 {
   immedscroll = true;
   trykbd();
@@ -7793,7 +7697,7 @@ Static Void trykbdscroll()
 /*=                                              =*/
 /*================================================*/
 
-Static Void closergate(x, y)
+static void closergate(x, y)
 short x, y;
 {
   if (gg.textinvisible)
@@ -7843,7 +7747,7 @@ short x, y;
 /*=                                              =*/
 /*================================================*/
 
-Static Void closerwire(x, y)
+static void closerwire(x, y)
 short x, y;
 {
   if (gg.invisible || gg.showconflicts) {
@@ -7876,7 +7780,7 @@ short x, y;
 /*=                                              =*/
 /*================================================*/
 
-Static Void addsolder(x, y, hw, hw2, vw, vw2)
+static void addsolder(x, y, hw, hw2, vw, vw2)
 short x, y;
 log_hwrec *hw, *hw2;
 log_vwrec *vw, *vw2;
@@ -7950,7 +7854,7 @@ log_vwrec *vw, *vw2;
 /*=                                              =*/
 /*================================================*/
 
-Static log_srec *findsolder(x, y)
+static log_srec *findsolder(x, y)
 short x, y;
 {
   log_srec *s;
@@ -7970,7 +7874,7 @@ short x, y;
 /*=                                              =*/
 /*================================================*/
 
-Static Void addsoldert(hw, vw)
+static void addsoldert(hw, vw)
 log_hwrec *hw;
 log_vwrec *vw;
 {
@@ -8000,15 +7904,15 @@ log_vwrec *vw;
 /*=                                              =*/
 /*================================================*/
 
-Static Void chggate PP((log_grec *g, int i, log_nrec *oldnode, log_nrec *n));
+static void chggate (log_grec *g, int i, log_nrec *oldnode, log_nrec *n);
 
-Static Void chgvw PP((log_vwrec *vw, log_nrec *oldnode, log_nrec *n));
+static void chgvw (log_vwrec *vw, log_nrec *oldnode, log_nrec *n);
 
 
 #define rtn             "CHGHW"
 
 
-Static Void chghw(hw, oldnode, n)
+static void chghw(hw, oldnode, n)
 log_hwrec *hw;
 log_nrec *oldnode, *n;
 {
@@ -8071,7 +7975,7 @@ log_nrec *oldnode, *n;
 #define rtn             "CHGVW"
 
 
-Static Void chgvw(vw, oldnode, n)
+static void chgvw(vw, oldnode, n)
 log_vwrec *vw;
 log_nrec *oldnode, *n;
 {
@@ -8132,7 +8036,7 @@ log_nrec *oldnode, *n;
 #define rtn             "CHGGATE"
 
 
-Static Void chggate(g, i, oldnode, n)
+static void chggate(g, i, oldnode, n)
 log_grec *g;
 short i;
 log_nrec *oldnode, *n;
@@ -8203,12 +8107,12 @@ log_nrec *oldnode, *n;
 #undef rtn
 
 
-/* Local variables for wantsolder: */
+/* variables for wantsolder: */
 struct LOC_wantsolder {
-  boolean hasred, hasgreen, hasyellow, hasblue;
+  int hasred, hasgreen, hasyellow, hasblue;
 } ;
 
-Local Void markcolor(hw, LINK)
+void markcolor(hw, LINK)
 log_hwrec **hw;
 struct LOC_wantsolder *LINK;
 {
@@ -8244,7 +8148,7 @@ struct LOC_wantsolder *LINK;
 /*=                                              =*/
 /*================================================*/
 
-Static boolean wantsolder(s)
+static int wantsolder(s)
 log_srec *s;
 {
   struct LOC_wantsolder V;
@@ -8262,7 +8166,7 @@ log_srec *s;
 
 
 
-Static Void delgetnode(save, old, n)
+static void delgetnode(save, old, n)
 log_nrec **save, **old, **n;
 {
   /*     if save <> nil then
@@ -8277,7 +8181,7 @@ log_nrec **save, **old, **n;
 
 
 
-Static Void delhwire(hw)
+static void delhwire(hw)
 log_hwrec *hw;
 {
   log_vwrec *vw;
@@ -8360,7 +8264,7 @@ log_hwrec *hw;
 
 
 
-Static Void delvwire(vw)
+static void delvwire(vw)
 log_vwrec *vw;
 {
   log_hwrec *hw;
@@ -8444,7 +8348,7 @@ log_vwrec *vw;
 
 
 
-Static Void chggatepin(g, i, oldnode, savenode)
+static void chggatepin(g, i, oldnode, savenode)
 log_grec *g;
 short i;
 log_nrec **oldnode, **savenode;
@@ -8498,7 +8402,7 @@ log_nrec **oldnode, **savenode;
 
 
 
-Static Void disconnectgate(g)
+static void disconnectgate(g)
 log_grec *g;
 {
   log_nrec *savenode;
@@ -8540,7 +8444,7 @@ log_grec *g;
 
 
 
-Static Void delgate(g)
+static void delgate(g)
 log_grec *g;
 {
   clipon();
@@ -8560,12 +8464,12 @@ log_grec *g;
 
 
 
-Static Void confirmsimtype(n)
+static void confirmsimtype(n)
 log_nrec *n;
 {
   log_grec *g;
   short i, pg;
-  boolean found;
+  int found;
   log_hnrec *hn;
   short FORLIM, FORLIM1;
 
@@ -8618,7 +8522,7 @@ log_nrec *n;
 /*=                                              =*/
 /*================================================*/
 
-Static Void combinenodes(n2, n1, cnbase)
+static void combinenodes(n2, n1, cnbase)
 log_nrec **n2, **n1;
 cnrec *cnbase;
 {
@@ -8728,7 +8632,7 @@ cnrec *cnbase;
    that N2 must be assigned a node, but we don't have anything to connect
    to it yet. */
 
-Static Void queuecombine(cnbase, n, n2)
+static void queuecombine(cnbase, n, n2)
 cnrec **cnbase;
 log_nrec **n, **n2;
 {
@@ -8747,22 +8651,22 @@ log_nrec **n, **n2;
 }
 
 
-/* Local variables for checkcombine: */
+/* variables for checkcombine: */
 struct LOC_checkcombine {
   cnrec **cnbase;
   short passcount;
-  boolean good;
+  int good;
   log_tool *cursimtype;
 } ;
 
-Local Void scancn PP((cnrec *cn, struct LOC_checkcombine *LINK));
+void scancn (cnrec *cn, struct LOC_checkcombine *LINK);
 
-Local Void checknode(n, LINK)
+void checknode(n, LINK)
 log_nrec *n;
 struct LOC_checkcombine *LINK;
 {
   log_tool *newsimtype;
-  Char STR1[94];
+  char STR1[94];
 
   newsimtype = n->simtype;
   if (newsimtype->simtype < 8)
@@ -8781,14 +8685,12 @@ struct LOC_checkcombine *LINK;
   LINK->good = false;
 }
 
-/* Local variables for scancn: */
+/* variables for scancn: */
 struct LOC_scancn {
   struct LOC_checkcombine *LINK;
 } ;
 
-Local Void scan(n, LINK)
-log_nrec **n;
-struct LOC_scancn *LINK;
+void scan(log_nrec **n, struct LOC_scancn *LINK)
 {
   cnrec *cn;
 
@@ -8804,7 +8706,7 @@ struct LOC_scancn *LINK;
   }
 }
 
-Local Void scancn(cn, LINK)
+void scancn(cn, LINK)
 cnrec *cn;
 struct LOC_checkcombine *LINK;
 {
@@ -8824,7 +8726,7 @@ struct LOC_checkcombine *LINK;
    merge any nodes.  If a node doesn't have anything merged into it, make
    a new node. */
 
-Static boolean checkcombine(cnbase_)
+static int checkcombine(cnbase_)
 cnrec **cnbase_;
 {
   struct LOC_checkcombine V;
@@ -8875,7 +8777,7 @@ cnrec **cnbase_;
 
 
 
-Static boolean trycombinenodes(n1, n2)
+static int trycombinenodes(n1, n2)
 log_nrec **n1, **n2;
 {
   cnrec *cnbase;
@@ -8889,7 +8791,7 @@ log_nrec **n1, **n2;
 
 
 
-Static Void fryhwire(hw)
+static void fryhwire(hw)
 log_hwrec *hw;
 {
   long t0;
@@ -8908,7 +8810,7 @@ log_hwrec *hw;
 }
 
 
-Static Void fryvwire(vw)
+static void fryvwire(vw)
 log_vwrec *vw;
 {
   long t0;
@@ -8927,7 +8829,7 @@ log_vwrec *vw;
 }
 
 
-Static Void frygate(g)
+static void frygate(g)
 log_grec *g;
 {
   long t0;
@@ -8944,7 +8846,7 @@ log_grec *g;
 }
 
 
-Static Void frysolder(x, y)
+static void frysolder(x, y)
 short x, y;
 {
   long t0;
@@ -8964,7 +8866,7 @@ short x, y;
 
 
 
-Static Void addblobs(blbase, x1, y1, x2, y2)
+static void addblobs(blbase, x1, y1, x2, y2)
 blobrec **blbase;
 short x1, y1, x2, y2;
 {
@@ -8986,7 +8888,7 @@ short x1, y1, x2, y2;
 }
 
 
-Static Void doblobs(blp)
+static void doblobs(blp)
 blobrec *blp;
 {
   log_hwrec *hw;
@@ -9016,7 +8918,7 @@ blobrec *blp;
 }
 
 
-Static Void dispblobs(blbase)
+static void dispblobs(blbase)
 blobrec **blbase;
 {
   blobrec *blp;
@@ -9048,7 +8950,7 @@ blobrec **blbase;
 /*=                                              =*/
 /*================================================*/
 
-Static Void addhwire(x1, x2, y, colr)
+static void addhwire(x1, x2, y, colr)
 short x1, x2, y, colr;
 {
   cnrec *cnbase;
@@ -9174,7 +9076,7 @@ _L1:
 #undef rtn
 
 
-Static Void addhwire2(x1, x2, y)
+static void addhwire2(x1, x2, y)
 short x1, x2, y;
 {
   addhwire(x1, x2, y, log_wcol_normal);
@@ -9185,7 +9087,7 @@ short x1, x2, y;
 
 
 
-Static Void addvwire(x, y1, y2, colr)
+static void addvwire(x, y1, y2, colr)
 short x, y1, y2, colr;
 {
   cnrec *cnbase;
@@ -9311,7 +9213,7 @@ _L1:
 #undef rtn
 
 
-Static Void addvwire2(x, y1, y2)
+static void addvwire2(x, y1, y2)
 short x, y1, y2;
 {
   addvwire(x, y1, y2, log_wcol_normal);
@@ -9327,7 +9229,7 @@ short x, y1, y2;
 /*=                                              =*/
 /*================================================*/
 
-Static Void initpinpos(g)
+static void initpinpos(g)
 log_grec *g;
 {
   short i, rxx, rxy, ryx, ryy;
@@ -9347,10 +9249,10 @@ log_grec *g;
 }
 
 
-Static boolean connectgate(g)
+static int connectgate(g)
 log_grec *g;
 {
-  boolean Result;
+  int Result;
   cnrec *cnbase;
   short i, j, xp, yp;
   log_hwrec *hw;
@@ -9358,7 +9260,7 @@ log_grec *g;
   log_nrec **n1;
   log_grec *g1;
   short ptrs[log_maxpins];
-  boolean success;
+  int success;
   short FORLIM, FORLIM1;
 
   if (gg.traceflag)
@@ -9448,9 +9350,9 @@ _L1:
 
 
 
-Static Void pconnectgate(g, success)
+static void pconnectgate(g, success)
 log_grec *g;
-boolean *success;
+int *success;
 {
   *success = connectgate(g);
 }
@@ -9467,7 +9369,7 @@ boolean *success;
 /*=                                              =*/
 /*================================================*/
 
-Static Void initbuf(bases)
+static void initbuf(bases)
 baseptrs *bases;
 {
   bases->gcopy = NULL;
@@ -9481,7 +9383,7 @@ baseptrs *bases;
 }
 
 
-Static Void clearbuf(bases)
+static void clearbuf(bases)
 baseptrs *bases;
 {
   log_grec *g;
@@ -9527,7 +9429,7 @@ baseptrs *bases;
 
 
 
-Static boolean bufempty(bases)
+static int bufempty(bases)
 baseptrs *bases;
 {
   return (bases->gcopy == NULL && bases->scopy == NULL &&
@@ -9537,7 +9439,7 @@ baseptrs *bases;
 
 
 
-Static boolean bufissmall(bases)
+static int bufissmall(bases)
 baseptrs *bases;
 {
   return ((bases->gcopy == NULL || bases->gcopy->next == NULL ||
@@ -9557,9 +9459,6 @@ baseptrs *bases;
 
 
 
-
-
-
 /*==================  CUTCOPY  ===================*/
 /*=                                              =*/
 /*=  Cut or Copy all gates/wires/solder points   =*/
@@ -9568,10 +9467,10 @@ baseptrs *bases;
 /*=                                              =*/
 /*================================================*/
 
-Static Void cutcopy(bases, x1, y1, x2, y2, cut, tap)
+static void cutcopy(bases, x1, y1, x2, y2, cut, tap)
 baseptrs *bases;
 short x1, y1, x2, y2;
-boolean cut, tap;
+int cut, tap;
 {
   log_grec *g, *g1, *g2;
   log_hwrec *hw, *hw1, *hw2;
@@ -9580,7 +9479,7 @@ boolean cut, tap;
   log_lrec *l, *l1, *l2;
   log_brec *b, *b1, *b2;
   short xx1, yy1, xx2, yy2, anchorx, anchory;
-  boolean found;
+  int found;
   blobrec *blbase;
 
   clearbuf(bases);
@@ -9790,7 +9689,7 @@ boolean cut, tap;
 
 
 
-Static Void checkabort()
+static void checkabort()
 {
   if (!gg.stillnear || (gg.t.dn && !gg.incircuit) || *gg.func != '\0')
     _Escape(5);
@@ -9799,7 +9698,7 @@ Static Void checkabort()
 
 
 
-Static Void waitnear()
+static void waitnear()
 {
   do {
     gg.stillnear = true;
@@ -9813,7 +9712,7 @@ Static Void waitnear()
 
 
 
-Static Void getfirstpoint()
+static void getfirstpoint()
 {
   checkabort();
   do {
@@ -9829,11 +9728,11 @@ Static Void getfirstpoint()
 
 
 
-Static boolean getrectangle(x1, y1, x2, y2, first)
+static int getrectangle(x1, y1, x2, y2, first)
 short *x1, *y1, *x2, *y2;
-boolean first;
+int first;
 {
-  boolean flag;
+  int flag;
   long time;
 
   if (first)
@@ -9884,10 +9783,10 @@ boolean first;
 /*=                                              =*/
 /*================================================*/
 
-Static Void delcommand()
+static void delcommand()
 {
   short x1, y1, x2, y2;
-  boolean flag;
+  int flag;
 
   log_setmode("DEL");
   clearfunc();
@@ -9903,7 +9802,7 @@ Static Void delcommand()
 
 
 
-Static boolean pagembb(pg, x1, y1, x2, y2)
+static int pagembb(pg, x1, y1, x2, y2)
 short pg, *x1, *y1, *x2, *y2;
 {
   short max;
@@ -9990,7 +9889,7 @@ short pg, *x1, *y1, *x2, *y2;
 
 
 
-Static Void deleverything()
+static void deleverything()
 {
   short x1, y1, x2, y2;
 
@@ -10011,7 +9910,7 @@ Static Void deleverything()
 /*=                                              =*/
 /*================================================*/
 
-Static Void changekind2(i, gtype, sig, attrs)
+static void changekind2(i, gtype, sig, attrs)
 short i, gtype, sig;
 log_gattrrec *attrs;
 {
@@ -10036,7 +9935,7 @@ log_gattrrec *attrs;
 
 
 
-Static Void changekind(gtype, sig, attrs)
+static void changekind(gtype, sig, attrs)
 short gtype, sig;
 log_gattrrec *attrs;
 {
@@ -10049,7 +9948,7 @@ log_gattrrec *attrs;
 }
 
 
-Local Void showstick(x1, y1, x2, y2, mode)
+void showstick(x1, y1, x2, y2, mode)
 long x1, y1, x2, y2, mode;
 {
   m_colormode(mode);
@@ -10071,7 +9970,7 @@ long x1, y1, x2, y2, mode;
 
 
 
-Static Void yardstick()
+static void yardstick()
 {
   long x1, y1, x2, y2;
 
@@ -10113,7 +10012,7 @@ Static Void yardstick()
 
 
 
-Static Void yardstickcommand()
+static void yardstickcommand()
 {
   log_setmode("YARD");
   clearfunc();
@@ -10136,13 +10035,13 @@ Static Void yardstickcommand()
 /*=                                              =*/
 /*================================================*/
 
-Static Void addgate2(x, y, gtype, sig, attrs)
+static void addgate2(x, y, gtype, sig, attrs)
 short x, y, gtype, sig;
 log_gattrrec *attrs;
 {
   log_grec *g, *g1;
   short i, gmax;
-  boolean flag;
+  int flag;
 
   newgate2(&g, gtype, sig, attrs);
   if (gatecount[gg.curpage - 1] == log_maxshint) {
@@ -10179,7 +10078,7 @@ log_gattrrec *attrs;
 
 
 
-Static Void addgate1(x, y, gtype)
+static void addgate1(x, y, gtype)
 short x, y, gtype;
 {
   addgate2(x, y, gtype, 0, NULL);
@@ -10187,7 +10086,7 @@ short x, y, gtype;
 
 
 
-Static Void uaddgate(x, y, gtype)
+static void uaddgate(x, y, gtype)
 short x, y, gtype;
 {
   short xx, yy;
@@ -10227,7 +10126,7 @@ short x, y, gtype;
 /*=                                              =*/
 /*================================================*/
 
-Static Void movexorgate(x, y, g, sig, yy)
+static void movexorgate(x, y, g, sig, yy)
 short x, y, g, sig, yy;
 {
   clipoff();
@@ -10247,13 +10146,13 @@ short x, y, g, sig, yy;
 }
 
 
-Static boolean addgate(gtype, sig, attrs)
+static int addgate(gtype, sig, attrs)
 short gtype, sig;
 log_gattrrec *attrs;
 {
-  boolean Result;
+  int Result;
   short yy;
-  boolean oo;
+  int oo;
   log_krec *k;
 
   Result = false;
@@ -10290,12 +10189,12 @@ log_gattrrec *attrs;
 
 
 
-Static Void nextkindsig(i)
+static void nextkindsig(i)
 short i;
 {
-  Char buf[256];
+  char buf[256];
   short j;
-  Char STR1[256];
+  char STR1[256];
 
   if (kindsig[i - 1] == 0)
     return;
@@ -10319,13 +10218,13 @@ short i;
 }
 
 
-/* Local variables for xorcopybuf: */
+/* variables for xorcopybuf: */
 struct LOC_xorcopybuf {
   long *count, max, time;
-  boolean aborting;
+  int aborting;
 } ;
 
-Local boolean abortit(LINK)
+int abortit(LINK)
 struct LOC_xorcopybuf *LINK;
 {
   if (LINK->max == LONG_MAX) {
@@ -10355,7 +10254,7 @@ struct LOC_xorcopybuf *LINK;
 /*=                                              =*/
 /*================================================*/
 
-Static Void xorcopybuf(bases, x, y, count_)
+static void xorcopybuf(bases, x, y, count_)
 baseptrs *bases;
 short x, y;
 long *count_;
@@ -10421,7 +10320,7 @@ long *count_;
 /*=                                              =*/
 /*================================================*/
 
-Static Void pastebuf(bases, x, y)
+static void pastebuf(bases, x, y)
 baseptrs *bases;
 short x, y;
 {
@@ -10517,7 +10416,7 @@ short x, y;
 }
 
 
-Local Void xororiginal()
+void xororiginal()
 {
   remcursor();
   clipon();
@@ -10542,14 +10441,14 @@ Local Void xororiginal()
 /*=                                              =*/
 /*================================================*/
 
-Static Void pastecommand(movemode)
+static void pastecommand(movemode)
 long movemode;
 {
   short thepage;
   long max;
   baseptrs deleted;
   long time;
-  boolean smallbuf;
+  int smallbuf;
 
   clearfunc();
   if (!copybuf.valid)
@@ -10647,9 +10546,9 @@ long movemode;
 
 
 
-Static Void extract()
+static void extract()
 {
-  boolean okay;
+  int okay;
   short x1, y1, x2, y2;
 
   okay = pagembb((int)gg.curpage, &x1, &y1, &x2, &y2);
@@ -10672,10 +10571,10 @@ Static Void extract()
 /*=                                              =*/
 /*================================================*/
 
-Static Void copycommand()
+static void copycommand()
 {
   short x1, y1, x2, y2;
-  boolean flag;
+  int flag;
 
   log_setmode("COPY");
   clearfunc();
@@ -10701,11 +10600,11 @@ Static Void copycommand()
 /*=                                              =*/
 /*================================================*/
 
-Static Void movecommand(waitflag)
-boolean waitflag;
+static void movecommand(waitflag)
+int waitflag;
 {
   short x1, y1, x2, y2;
-  boolean flag;
+  int flag;
 
   log_setmode("MOVE");
   clearfunc();
@@ -10728,7 +10627,7 @@ boolean waitflag;
 
 
 
-Static Void OLDmovecommand()
+static void OLDmovecommand()
 {
   short x1, y1, oldpg, stillhere;
   baseptrs buf;
@@ -10847,7 +10746,7 @@ Static Void OLDmovecommand()
 }
 
 
-Local boolean near_(x, y)
+int near_(x, y)
 short x, y;
 {
   return (abs(x - y) < 2);
@@ -10864,11 +10763,11 @@ short x, y;
 /*=                                              =*/
 /*================================================*/
 
-Static Void moveobject()
+static void moveobject()
 {
   short gtype, x1, y1, yy, hx1, hx2, hy, vx, vy1, vy2, hc, vc, oldpg, newpg,
 	oldx1, oldy1, oldx2, oldy2;
-  boolean fh1, fv1, fh2, fv2, oo;
+  int fh1, fv1, fh2, fv2, oo;
   log_srec *s;
   log_hwrec *hw1;
   log_vwrec *vw1;
@@ -11312,7 +11211,7 @@ Static Void moveobject()
 
 
 
-Static Void shiftgate(g, dx, dy)
+static void shiftgate(g, dx, dy)
 log_grec *g;
 short dx, dy;
 {
@@ -11330,7 +11229,7 @@ short dx, dy;
 }
 
 
-Local Void xorrect(x1, y1, x2, y2)
+void xorrect(x1, y1, x2, y2)
 short x1, y1, x2, y2;
 {
   short y3;
@@ -11358,7 +11257,7 @@ short x1, y1, x2, y2;
 /*=                                              =*/
 /*================================================*/
 
-Static Void openhoriz()
+static void openhoriz()
 {
   log_grec *g;
   log_hwrec *hw;
@@ -11367,7 +11266,7 @@ Static Void openhoriz()
   log_lrec *l;
   log_brec *b;
   short x1, y1;
-  boolean flag;
+  int flag;
 
   log_setmode("OPNH");
   clearfunc();
@@ -11479,7 +11378,7 @@ Static Void openhoriz()
 }
 
 
-Local Void xorrect_(x1, y1, x2, y2)
+void xorrect_(x1, y1, x2, y2)
 short x1, y1, x2, y2;
 {
   short x3;
@@ -11504,7 +11403,7 @@ short x1, y1, x2, y2;
 /*=                                              =*/
 /*================================================*/
 
-Static Void openvert()
+static void openvert()
 {
   log_grec *g;
   log_hwrec *hw;
@@ -11513,7 +11412,7 @@ Static Void openvert()
   log_lrec *l;
   log_brec *b;
   short x1, y1;
-  boolean flag;
+  int flag;
 
   log_setmode("OPNV");
   clearfunc();
@@ -11624,7 +11523,7 @@ Static Void openvert()
 }
 
 
-Local Void xorrect__(x1, y1, x2, y2)
+void xorrect__(x1, y1, x2, y2)
 short x1, y1, x2, y2;
 {
   short y3;
@@ -11649,7 +11548,7 @@ short x1, y1, x2, y2;
 /*=                                              =*/
 /*================================================*/
 
-Static Void closehoriz()
+static void closehoriz()
 {
   log_grec *g, *g1;
   log_hwrec *hw, *hw1;
@@ -11658,7 +11557,7 @@ Static Void closehoriz()
   log_lrec *l, *l1;
   log_brec *b, *b1;
   short x1, y1;
-  boolean flag;
+  int flag;
 
   log_setmode("CLSH");
   clearfunc();
@@ -11817,7 +11716,7 @@ Static Void closehoriz()
 }
 
 
-Local Void xorrect___(x1, y1, x2, y2)
+void xorrect___(x1, y1, x2, y2)
 short x1, y1, x2, y2;
 {
   short x3;
@@ -11842,7 +11741,7 @@ short x1, y1, x2, y2;
 /*=                                              =*/
 /*================================================*/
 
-Static Void closevert()
+static void closevert()
 {
   log_grec *g, *g1;
   log_hwrec *hw, *hw1;
@@ -11851,7 +11750,7 @@ Static Void closevert()
   log_lrec *l, *l1;
   log_brec *b, *b1;
   short x1, y1;
-  boolean flag;
+  int flag;
 
   log_setmode("CLSV");
   clearfunc();
@@ -12014,7 +11913,7 @@ Static Void closevert()
 
 
 
-Static Void centercommand()
+static void centercommand()
 {
   log_grec *g;
   log_hwrec *hw;
@@ -12087,7 +11986,7 @@ Static Void centercommand()
 /*=                                              =*/
 /*================================================*/
 
-Static Void showcatalog()
+static void showcatalog()
 {
   short i;
   catboxrec *cb;
@@ -12143,16 +12042,16 @@ Static Void showcatalog()
 /*=                                              =*/
 /*================================================*/
 
-Static boolean comparestr(s_, g, t_)
-Char *s_;
+static int comparestr(s_, g, t_)
+char *s_;
 short g;
-Char *t_;
+char *t_;
 {
-  boolean Result;
-  Char s[9], t[9];
-  Char ch;
+  int Result;
+  char s[9], t[9];
+  char ch;
   short i;
-  boolean match;
+  int match;
   short FORLIM;
 
   strcpy(s, s_);
@@ -12193,13 +12092,13 @@ Char *t_;
 #define maxvars         16
 
 
-/* Local variables for readlibrary_at: */
+/* variables for readlibrary_at: */
 struct LOC_readlibrary_at {
   short p, f;
   long dist;
 } ;
 
-Local Void readint(LINK)
+void readint(LINK)
 struct LOC_readlibrary_at *LINK;
 {
   if (LINK->p >= 64) {
@@ -12208,7 +12107,7 @@ struct LOC_readlibrary_at *LINK;
   }
 }
 
-Local long readnum(LINK)
+long readnum(LINK)
 struct LOC_readlibrary_at *LINK;
 {
   long Result;
@@ -12223,7 +12122,7 @@ struct LOC_readlibrary_at *LINK;
   return Result;
 }
 
-Local long readcoord(LINK)
+long readcoord(LINK)
 struct LOC_readlibrary_at *LINK;
 {
   long i;
@@ -12237,7 +12136,7 @@ struct LOC_readlibrary_at *LINK;
     return (i - 256);
 }
 
-Local Void bound(k, x, y, LINK)
+void bound(k, x, y, LINK)
 log_krec *k;
 long x, y;
 struct LOC_readlibrary_at *LINK;
@@ -12252,7 +12151,7 @@ struct LOC_readlibrary_at *LINK;
     k->bby2 = y;
 }
 
-Local long uncompress(i, LINK)
+long uncompress(i, LINK)
 long i;
 struct LOC_readlibrary_at *LINK;
 {
@@ -12265,7 +12164,7 @@ struct LOC_readlibrary_at *LINK;
 }
 
 
-Local descrec *readdesc(rec)
+descrec *readdesc(rec)
 char *rec;
 {
        unsigned short i,j1,j2,s1,s2;
@@ -12292,7 +12191,7 @@ char *rec;
 }
 
 
-Local log_pnumrec readpnum(rec)
+log_pnumrec readpnum(rec)
  char *rec;
 {
        static log_pnumrec p;
@@ -12313,23 +12212,23 @@ Local log_pnumrec readpnum(rec)
 /*=                                              =*/
 /*================================================*/
 
-Static short readlibrary_at(n_, where, loadit)
-Char *n_;
+static short readlibrary_at(n_, where, loadit)
+char *n_;
 short where;
-boolean loadit;
+int loadit;
 {
   struct LOC_readlibrary_at V;
   short Result;
-  Char n[9];
+  char n[9];
   short i, i0, i00, j, j0, j00, j000, count;
   long j1;
   na_strlist *l2;
   log_grec *g;
-  Char buf[256];
-  Char ch, ch2, curcol;
-  boolean found, flag;
+  char buf[256];
+  char ch, ch2, curcol;
+  int found, flag;
   log_vectorrec *tempvects;
-  Char STR1[256];
+  char STR1[256];
   short FORLIM, FORLIM1;
   long TEMP;
   log_krec *WITH;
@@ -12482,11 +12381,11 @@ boolean loadit;
 	    V.p *= 4;
 	    FORLIM1 = WITH->numvects;
 	    for (j0 = 1; j0 <= FORLIM1; j0++) {
-	      ch = (Char)readnum(&V);
+	      ch = (char)readnum(&V);
 	      if (ch >= '1' && ch <= '7') {
 		do {
 		  ch2 = ch;
-		  ch = (Char)readnum(&V);
+		  ch = (char)readnum(&V);
 		} while (ch >= '1' && ch <= '7');
 		if (ch2 != curcol) {
 		  j++;
@@ -12578,7 +12477,7 @@ boolean loadit;
 /* p2c: log.text, line 12128:
  * Note: Modification of string length may translate incorrectly [146] */
 		for (j00 = 0; j00 < j000; j00++)
-		  buf[j00] = (Char)readnum(&V);
+		  buf[j00] = (char)readnum(&V);
 		WITH2->UU.U116.sp = strdup(buf);
 		break;
 
@@ -12590,7 +12489,7 @@ boolean loadit;
 	    WITH->numvects = j;
 	    WITH->vector = (log_vectorrec *)
 			   Malloc(WITH->numvects * sizeof(log_vectorrec));
-	    memmove((Anyptr)WITH->vector, (Anyptr)tempvects,
+	    memmove((void *)WITH->vector, (void *)tempvects,
 		    WITH->numvects * sizeof(log_vectorrec));
 	    while (V.dist < WITH->bigvectsize)
 	      j0 = readnum(&V);
@@ -12764,27 +12663,27 @@ _L1:
 
 
 
-Static short readlibrary(n)
-Char *n;
+static short readlibrary(n)
+char *n;
 {
   return (readlibrary_at(n, 1, true));
 }
 
 
-Static Void getgate(name, gtype)
-Char *name;
+static void getgate(name, gtype)
+char *name;
 short *gtype;
 {
   *gtype = readlibrary(name);
 }
 
 
-Static Void getgategroup(grp)
+static void getgategroup(grp)
 na_strlist *grp;
 {
   na_strlist *l1;
   short pos, i, count;
-  boolean done;
+  int done;
   catboxrec *cb;
 
   l1 = grp;
@@ -12839,14 +12738,14 @@ na_strlist *grp;
 
 
 
-Static Void showpinname(g, i, c, name)
+static void showpinname(g, i, c, name)
 log_grec *g;
 short i, c;
-Char *name;
+char *name;
 {
   short j, j2, x, y, w, y0, y1, y2;
-  boolean small;
-  Char buf[256];
+  int small;
+  char buf[256];
   short FORLIM;
 
   if (zoom < 2) {
@@ -12899,7 +12798,7 @@ Char *name;
 
 
 
-Static Void showgateinfo(info, g)
+static void showgateinfo(info, g)
 na_strlist *info;
 log_grec *g;
 {
@@ -13017,12 +12916,12 @@ log_grec *g;
 
 
 
-Static Void showgatedef(k, g)
+static void showgatedef(k, g)
 log_krec *k;
 log_grec *g;
 {
   na_strlist *l1;
-  Char STR1[42];
+  char STR1[42];
 
   gg.actstrlist = NULL;
   if (g != NULL) {
@@ -13042,10 +12941,10 @@ log_grec *g;
 
 
 
-Static Void gatedefinitioncommand()
+static void gatedefinitioncommand()
 {
   long i;
-  Char STR1[256];
+  char STR1[256];
 
   if (*gg.funcarg == '\0') {
     clearfunc();
@@ -13095,11 +12994,11 @@ Static Void gatedefinitioncommand()
 /*=                                              =*/
 /*================================================*/
 
-Static Char *strreverse(Result, s)
-Char *Result, *s;
+static char *strreverse(Result, s)
+char *Result, *s;
 {
   long i;
-  Char s2[256];
+  char s2[256];
 
   *s2 = '\0';
   for (i = strlen(s) - 1; i >= 0; i--)
@@ -13108,12 +13007,12 @@ Char *Result, *s;
 }
 
 
-Static librstrrec *findlibrstr(name_)
-Char *name_;
+static librstrrec *findlibrstr(name_)
+char *name_;
 {
-  Char name[9];
+  char name[9];
   librstrrec *lsp;
-  Char STR1[256];
+  char STR1[256];
 
   strcpy(name, name_);
   lsp = librstrs;
@@ -13133,13 +13032,13 @@ Char *name_;
 #define huge_           30000
 
 
-/* Local variables for listlibrary: */
+/* variables for listlibrary: */
 struct LOC_listlibrary {
   short maxi, maxj;
   short karr[maxmaxi + 1][maxmaxj];
 } ;
 
-Local short kfunc(i, j, LINK)
+short kfunc(i, j, LINK)
 short *i, *j;
 struct LOC_listlibrary *LINK;
 {
@@ -13164,14 +13063,14 @@ struct LOC_listlibrary *LINK;
 }
 
 
-Static Void listlibrary()
+static void listlibrary()
 {
   struct LOC_listlibrary V;
   short i, j, ii, jj, k, nn0, nn;
   librstrrec *lsp;
-  Char ch;
-  boolean exitflag;
-  Char STR1[256];
+  char ch;
+  int exitflag;
+  char STR1[256];
   short FORLIM, FORLIM1;
 
   V.maxi = P_imin2((txacross - 9L) / 10, (long)maxmaxi);
@@ -13360,17 +13259,17 @@ Static Void listlibrary()
 /*=                                              =*/
 /*================================================*/
 
-Static Void gatecatalog(librmode)
-boolean librmode;
+static void gatecatalog(librmode)
+int librmode;
 {
   short x, y, x0, y0, x00, y00, w, x1, y1;
-  Char nm[9];
+  char nm[9];
   /*  pic : m_picturevar;  */
   uchar ch;
   log_krec *k;
-  Char bot1[256], bot2[256], bot3[256];
+  char bot1[256], bot2[256], bot3[256];
   na_strlist *lp;
-  boolean flag, oo, done, botflag, refrflag;
+  int flag, oo, done, botflag, refrflag;
   long bottime;
   librstrrec *lsp;
 
@@ -13526,8 +13425,8 @@ boolean librmode;
 /*=                                              =*/
 /*================================================*/
 
-Static Void setvlsimode(flag)
-boolean flag;
+static void setvlsimode(flag)
+int flag;
 {
   if (flag) {
     beginerror();
@@ -13584,13 +13483,13 @@ $end$*/
 /*=                                              =*/
 /*================================================*/
 
-Static Char *realstr(Result, r, p)
-Char *Result;
+static char *realstr(Result, r, p)
+char *Result;
 double r;
 short p;
 {
   long i, j;
-  Char s[81];
+  char s[81];
 
   s[80] = '\0';
   if ((fabs(r) < 1e-2 || fabs(r) >= 1e6) && r != 0) {
@@ -13645,15 +13544,15 @@ short p;
 /*=                                              =*/
 /*================================================*/
 
-Static Char *realunit(Result, r, p, u, mu)
-Char *Result;
+static char *realunit(Result, r, p, u, mu)
+char *Result;
 double r;
 short p;
-Char *u;
-boolean mu;
+char *u;
+int mu;
 {
-  Char s[81], STR1[81];
-  Char STR2[162];
+  char s[81], STR1[81];
+  char STR2[162];
 
 /* zfprintf(stdout, "Realunit r: %le\n ", r);  ***MDG** */
   *s = '\0';
@@ -13695,44 +13594,44 @@ boolean mu;
   return Result;
 }
 
-/* was Static Void, cause gcc problems in some releases */
+/* was static Void, cause gcc problems in some releases */
 
 extern void prealunit(r, p, u, s)
 double r;
 short p;
-Char *u;
-Char *s;
+char *u;
+char *s;
 {
   realunit(s, r, p, u, false);
 }
 
-/* was Static Void, cause gcc problems in some releases */
+/* was static Void, cause gcc problems in some releases */
 
 extern void prealunit2(r, p, u, s)
 double r;
 short p;
-Char *u;
-Char *s;
+char *u;
+char *s;
 {
   realunit(s, r, p, u, true);
 }
 
 
-/* Local variables for editattrs: */
+/* variables for editattrs: */
 struct LOC_editattrs {
   log_gattrrec *gattr;
   short numattrs;
   log_kattrrec *kattr;
   na_strlist *lbl;
-  Char name[256];
-  Void (*chproc) PV();
+  char name[256];
+  void (*chproc) ();
   log_tool *tool;
   log_grec *gate;
   log_nrec *node;
   short acty, p, ybase;
 } ;
 
-Local Void drawlabelline(i, LINK)
+void drawlabelline(i, LINK)
 long i;
 struct LOC_editattrs *LINK;
 {
@@ -13752,7 +13651,7 @@ struct LOC_editattrs *LINK;
     nc_putStr(0, (int)i, l1->s);
 }
 
-Local Void eraselabelline(i, LINK)
+void eraselabelline(i, LINK)
 long i;
 struct LOC_editattrs *LINK;
 {
@@ -13761,7 +13660,7 @@ struct LOC_editattrs *LINK;
   putchar('\t');
 }
 
-Local Void drawlabel(LINK)
+void drawlabel(LINK)
 struct LOC_editattrs *LINK;
 {
   short i, FORLIM;
@@ -13773,15 +13672,15 @@ struct LOC_editattrs *LINK;
     drawlabelline((long)i, LINK);
 }
 
-Local Void drawvalue(i, highlight, LINK)
+void drawvalue(i, highlight, LINK)
 short i;
-boolean highlight;
+int highlight;
 struct LOC_editattrs *LINK;
 {
   na_strlist *l1;
   log_kattrrec *WITH;
-  Char STR1[81];
-  Char STR4[256];
+  char STR1[81];
+  char STR4[256];
 
   WITH = &LINK->kattr[i - 1];
   if (WITH->y < LINK->ybase || WITH->y > LINK->ybase + txdown)
@@ -13864,7 +13763,7 @@ struct LOC_editattrs *LINK;
   LINK->gattr[i - 1].changed = false;
 }
 
-Local Void maskvalues(LINK)
+void maskvalues(LINK)
 struct LOC_editattrs *LINK;
 {
   short i, FORLIM;
@@ -13886,13 +13785,13 @@ struct LOC_editattrs *LINK;
   }
 }
 
-Local double cleanup(r, r1, LINK)
+double cleanup(r, r1, LINK)
 double r, r1;
 struct LOC_editattrs *LINK;
 {
   long i;
-  Char s[81];
-  Char *STR1;
+  char s[81];
+  char *STR1;
 
   if (fabs(r) * 2 < r1)
     return 0.0;
@@ -13909,13 +13808,13 @@ struct LOC_editattrs *LINK;
     return r;
 }
 
-Local double scrnincr(p, LINK)
+double scrnincr(p, LINK)
 short p;
 struct LOC_editattrs *LINK;
 {
   long i;
   double r1;
-  Char s[81];
+  char s[81];
   log_kattrrec *WITH;
 
   WITH = &LINK->kattr[p - 1];
@@ -13949,8 +13848,8 @@ struct LOC_editattrs *LINK;
   return r1;
 }
 
-Local Void callconfig(proc, LINK)
-Void (*proc) PV();
+void callconfig(proc, LINK)
+void (*proc) ();
 struct LOC_editattrs *LINK;
 {
   gg.actx = LINK->p;
@@ -13963,7 +13862,7 @@ struct LOC_editattrs *LINK;
   (*proc)();
 }
 
-Local boolean tryconfig(LINK)
+int tryconfig(LINK)
 struct LOC_editattrs *LINK;
 {
   gg.actflag = true;
@@ -13975,14 +13874,14 @@ struct LOC_editattrs *LINK;
 
 
 
-Static Void editattrs(gattr_, numattrs_, kattr_, lbl_, name_, proc, chproc_,
+static void editattrs(gattr_, numattrs_, kattr_, lbl_, name_, proc, chproc_,
 		      relproc, attrstamp)
 log_gattrrec *gattr_;
 short numattrs_;
 log_kattrrec *kattr_;
 na_strlist *lbl_;
-Char *name_;
-Void (*proc) PV(), (*chproc_) PV(), (*relproc) PV();
+char *name_;
+void (*proc) (), (*chproc_) (), (*relproc) ();
 long *attrstamp;
 {
   struct LOC_editattrs V;
@@ -13990,14 +13889,14 @@ long *attrstamp;
   na_strlist *l1;
   long j, j1, savei;
   double r1, saver;
-  Char ch;
-  Char buf[256], savebuf[256];
-  boolean exitflag, saveb, saveb2, touched, understood;
+  char ch;
+  char buf[256], savebuf[256];
+  int exitflag, saveb, saveb2, touched, understood;
   short FORLIM;
   log_gattrrec *WITH;
-  Char STR1[256];
-  Char *STR2;
-  Char STR3[256];
+  char STR1[256];
+  char *STR2;
+  char STR3[256];
 
   V.gattr = gattr_;
   V.numattrs = numattrs_;
@@ -14494,14 +14393,14 @@ long *attrstamp;
 
 
 
-Static Void editattrsx(gattr, numattrs, kattr, lbl, name, proc, chproc,
+static void editattrsx(gattr, numattrs, kattr, lbl, name, proc, chproc,
 		       relproc)
 log_gattrrec *gattr;
 short numattrs;
 log_kattrrec *kattr;
 na_strlist *lbl;
-Char *name;
-Void (*proc) PV(), (*chproc) PV(), (*relproc) PV();
+char *name;
+void (*proc) (), (*chproc) (), (*relproc) ();
 {
   long stamp;
 
@@ -14510,30 +14409,30 @@ Void (*proc) PV(), (*chproc) PV(), (*relproc) PV();
 
 
 
-Static Void gproc1()
+static void gproc1()
 {
   calltool(gg.acttool, act_configgate);
 }
 
 
-Static Void gproc2()
+static void gproc2()
 {
   calltool(gg.acttool, act_configchgate);
 }
 
 
-Static Void gproc3()
+static void gproc3()
 {
   calltool(gg.acttool, act_configrelgate);
 }
 
 
-Static Void configgate(g)
+static void configgate(g)
 log_grec *g;
 {
-  Void (*TEMP) PV();
-  Void (*TEMP5) PV();
-  Void (*TEMP6) PV();
+  void (*TEMP) ();
+  void (*TEMP5) ();
+  void (*TEMP6) ();
 
   gg.actgate = g;
   gg.acttool = g->kind->simtype;
@@ -14547,31 +14446,31 @@ log_grec *g;
 
 
 
-Static Void nproc1()
+static void nproc1()
 {
   calltool(gg.acttool, act_confignode);
 }
 
 
-Static Void nproc2()
+static void nproc2()
 {
   calltool(gg.acttool, act_configchnode);
 }
 
 
-Static Void nproc3()
+static void nproc3()
 {
   calltool(gg.acttool, act_configrelnode);
 }
 
 
-Static Void confignode(n, name)
+static void confignode(n, name)
 log_nrec *n;
-Char *name;
+char *name;
 {
-  Void (*TEMP) PV();
-  Void (*TEMP5) PV();
-  Void (*TEMP6) PV();
+  void (*TEMP) ();
+  void (*TEMP5) ();
+  void (*TEMP6) ();
 
   gg.actnode = n;
   gg.acttool = n->simtype;
@@ -14585,7 +14484,7 @@ Char *name;
 
 
 
-Static Void configkind(i)
+static void configkind(i)
 short i;
 {
   log_krec *k;
@@ -14607,14 +14506,14 @@ short i;
 }
 
 
-/* Local variables for setattr: */
+/* variables for setattr: */
 struct LOC_setattr {
   log_gattrrec *gattr;
   log_kattrrec *kattr;
   short p;
 } ;
 
-Local boolean tryconfig_(LINK)
+int tryconfig_(LINK)
 struct LOC_setattr *LINK;
 {
   gg.actflag = true;
@@ -14629,24 +14528,24 @@ struct LOC_setattr *LINK;
 
 
 
-Static boolean setattr(gattr_, kattr_, p_, buf)
+static int setattr(gattr_, kattr_, p_, buf)
 log_gattrrec *gattr_;
 log_kattrrec *kattr_;
 short p_;
-Char *buf;
+char *buf;
 {
   struct LOC_setattr V;
-  boolean touched;
+  int touched;
   long savei;
   double r1, saver;
-  boolean saveb, saveb2;
-  Char savebuf[256];
+  int saveb, saveb2;
+  char savebuf[256];
   long j, j1;
   na_strlist *l1;
   log_gattrrec *WITH;
-  Char STR1[256];
-  Char *STR2;
-  Char STR3[256];
+  char STR1[256];
+  char *STR2;
+  char STR3[256];
 
   V.gattr = gattr_;
   V.kattr = kattr_;
@@ -14837,12 +14736,12 @@ Char *buf;
 
 
 
-Static Void setgattr(g, num, value_)
+static void setgattr(g, num, value_)
 log_grec *g;
 short num;
-Char *value_;
+char *value_;
 {
-  Char value[256];
+  char value[256];
   log_grec *g1;
   short pg;
   log_tool *saveacttool;
@@ -14873,12 +14772,12 @@ Char *value_;
 
 
 
-Static Void setnattr(n, num, value_)
+static void setnattr(n, num, value_)
 log_nrec *n;
 short num;
-Char *value_;
+char *value_;
 {
-  Char value[256];
+  char value[256];
   log_tool *saveacttool;
 
   strcpy(value, value_);
@@ -14899,7 +14798,7 @@ typedef short flipvec[8];
 typedef flipvec fliparr[4];
 
 
-Const fliparr flips = {
+const fliparr flips = {
   { 4, 5, 6, 7, 0, 1, 2, 3 },
   { 1, 2, 3, 0, 5, 6, 7, 4 },
   { 4, 7, 6, 5, 0, 3, 2, 1 },
@@ -14916,7 +14815,7 @@ Const fliparr flips = {
 
 
 
-Static short doflip(rot, mode)
+static short doflip(rot, mode)
 short rot, mode;
 {
   return (flips[mode][rot]);
@@ -14931,7 +14830,7 @@ short rot, mode;
 /*=                                              =*/
 /*================================================*/
 
-Static Void flipgate(g)
+static void flipgate(g)
 log_grec *g;
 {
   short i;
@@ -14982,7 +14881,7 @@ log_grec *g;
 /*=                                              =*/
 /*================================================*/
 
-Static Void flipkind()
+static void flipkind()
 {
   short i, z, k;
 
@@ -15024,9 +14923,9 @@ Static Void flipkind()
 /*=                                              =*/
 /*================================================*/
 
-Static Void settofrom(g, name)
+static void settofrom(g, name)
 log_grec **g;
-Char *name;
+char *name;
 {
   if (!(*g)->kind->flag.U3.named)
     return;
@@ -15047,13 +14946,13 @@ Char *name;
 }
 
 
-Static Void adjustsignal(g)
+static void adjustsignal(g)
 log_grec *g;
 {
-  Char n[256];
+  char n[256];
   uchar ch;
-  boolean savecaps, rightface;
-  Char STR1[256], STR2[256];
+  int savecaps, rightface;
+  char STR1[256], STR2[256];
 
   alert();
   savecaps = nk_setcapslock(signalcaps);
@@ -15128,7 +15027,7 @@ log_grec *g;
 
 
 
-Static Void touchgate(g)
+static void touchgate(g)
 log_grec *g;
 {
   short xx, yy;
@@ -15158,7 +15057,7 @@ log_grec *g;
 
 
 
-Static Void unsoldernear()
+static void unsoldernear()
 {
   short oldx, oldy1, oldy2, oldcolr;
   blobrec *blbase;
@@ -15181,7 +15080,7 @@ Static Void unsoldernear()
 }
 
 
-Static Void unsolderwires(hw, vw)
+static void unsolderwires(hw, vw)
 log_hwrec *hw;
 log_vwrec *vw;
 {
@@ -15194,7 +15093,7 @@ log_vwrec *vw;
 
 
 
-Static Void soldernear()
+static void soldernear()
 {
   if (!trycombinenodes(&gg.nearvw->node, &gg.nearhw->node)) {
     frysolder(gg.nearvw->x, gg.nearhw->y);
@@ -15206,7 +15105,7 @@ Static Void soldernear()
 }
 
 
-Static Void solderat(x, y)
+static void solderat(x, y)
 short x, y;
 {
   if (findsolder(x, y) != NULL)
@@ -15221,11 +15120,11 @@ short x, y;
 
 
 
-Static Void findattrnum2(numattrs, kattr, lbl, name, kinds, num)
+static void findattrnum2(numattrs, kattr, lbl, name, kinds, num)
 short numattrs;
 log_kattrrec *kattr;
 na_strlist *lbl;
-Char *name, *kinds;
+char *name, *kinds;
 short *num;
 {
   na_strlist *l1;
@@ -15252,9 +15151,9 @@ short *num;
 }
 
 
-Static Void findattrnum(k, name, kinds, num)
+static void findattrnum(k, name, kinds, num)
 log_krec *k;
-Char *name, *kinds;
+char *name, *kinds;
 short *num;
 {
   findattrnum2(k->numattrs, k->attr, k->lbl, name, kinds, num);
@@ -15262,12 +15161,12 @@ short *num;
 
 
 
-Static Void findattrname2(numattrs, kattr, lbl, num, name)
+static void findattrname2(numattrs, kattr, lbl, num, name)
 short numattrs;
 log_kattrrec *kattr;
 na_strlist *lbl;
 short num;
-Char *name;
+char *name;
 {
   na_strlist *l1;
 
@@ -15290,10 +15189,10 @@ Char *name;
 }
 
 
-Static Void findattrname(k, num, name)
+static void findattrname(k, num, name)
 log_krec *k;
 short num;
-Char *name;
+char *name;
 {
   findattrname2(k->numattrs, k->attr, k->lbl, num, name);
 }
@@ -15301,12 +15200,12 @@ Char *name;
 
 
 
-Static Void findpinnum(k, name_, num)
+static void findpinnum(k, name_, num)
 log_krec *k;
-Char *name_;
+char *name_;
 short *num;
 {
-  Char name[256];
+  char name[256];
 
   strcpy(name, name_);
   if (*name == '#')
@@ -15331,10 +15230,10 @@ short *num;
 
 
 
-Static Void findpinname(k, num, name)
+static void findpinname(k, num, name)
 log_krec *k;
 short num;
-Char *name;
+char *name;
 {
   if (num >= 1 && num <= k->numpins && k->pinnames[num - 1] != NULL) {
     strcpy(name, k->pinnames[num - 1]->s);
@@ -15349,7 +15248,7 @@ Char *name;
 
 
 
-Static Void findpointmarker(k, num, x, y)
+static void findpointmarker(k, num, x, y)
 log_krec *k;
 short num, *x, *y;
 {
@@ -15367,7 +15266,7 @@ short num, *x, *y;
 
 
 
-Static Void findboxmarker(k, num, x1, y1, x2, y2)
+static void findboxmarker(k, num, x1, y1, x2, y2)
 log_krec *k;
 short num, *x1, *y1, *x2, *y2;
 {
@@ -15393,9 +15292,9 @@ short num, *x1, *y1, *x2, *y2;
 
 
 
-Static Void addlabelat(x, y, s)
+static void addlabelat(x, y, s)
 short x, y;
-Char *s;
+char *s;
 {
   log_lrec *l;
 
@@ -15420,11 +15319,11 @@ Char *s;
 
 
 
-Static Void addlabel(l, s)
+static void addlabel(l, s)
 log_lrec **l;
-Char *s;
+char *s;
 {
-  boolean conflict;
+  int conflict;
   log_lrec *l1;
   short x, y;
 
@@ -15469,15 +15368,15 @@ Char *s;
 /*=                                              =*/
 /*================================================*/
 
-Static Void editlabel(l)
+static void editlabel(l)
 log_lrec *l;
 {
   short i, x1, y1;
   long j;
   uchar ch;
-  boolean savecaps, redraw, touching;
-  Char name[log_lablen + 1];
-  Char STR1[256];
+  int savecaps, redraw, touching;
+  char name[log_lablen + 1];
+  char STR1[256];
 
   m_graphics_on();
   clearalpha();
@@ -15628,7 +15527,7 @@ log_lrec *l;
 /*=                                              =*/
 /*================================================*/
 
-Static Void addboxat(x1, y1, x2, y2)
+static void addboxat(x1, y1, x2, y2)
 short x1, y1, x2, y2;
 {
   log_brec *b;
@@ -15650,7 +15549,7 @@ short x1, y1, x2, y2;
 
 
 
-Static Void addbox()
+static void addbox()
 {
   short x1, y1;
 
@@ -15715,14 +15614,14 @@ Static Void addbox()
 
 
 
-Static Void initcolors PV();
+static void initcolors ();
 
-/* Local variables for doshellescape: */
+/* variables for doshellescape: */
 struct LOC_doshellescape {
   long oldc;
 } ;
 
-Local Void recov(LINK)
+void recov(LINK)
 struct LOC_doshellescape *LINK;
 {
   nk_settransarray(nk_ktsupplied, &curkeytrans);
@@ -15735,13 +15634,13 @@ struct LOC_doshellescape *LINK;
 }
 
 
-Static Void doshellescape(arg)
-Char *arg;
+static void doshellescape(arg)
+char *arg;
 {
   struct LOC_doshellescape V;
   nk_keytransinfo *ktemp;
   long i, j;
-  Char STR1[256];
+  char STR1[256];
 
   m_graphics_off();
   m_alpha_on();
@@ -15769,7 +15668,7 @@ Char *arg;
 
 
 
-Static Void dumphistory()
+static void dumphistory()
 {
   log_htrec *ht;
   log_hnrec *hn;
@@ -15814,7 +15713,7 @@ Static Void dumphistory()
 /*================================================*/
 
 
-Static Void reshuffle()
+static void reshuffle()
 {
   log_hnrec *hn;
   short i;
@@ -15831,7 +15730,7 @@ Static Void reshuffle()
 }
 
 
-Static Void histdelsignals()
+static void histdelsignals()
 {
   log_hnrec *hn;
   log_tool *tool;
@@ -15853,7 +15752,7 @@ Static Void histdelsignals()
 #define unit            (histdivision / 2)
 
 
-Static Void alignsigname(y)
+static void alignsigname(y)
 short *y;
 {
   if (histgattr[histalignsigs - 1].UU.b)
@@ -15863,7 +15762,7 @@ short *y;
 #undef unit
 
 
-Static short histaddsignalpos()
+static short histaddsignalpos()
 {
   log_hnrec *hn;
   short y;
@@ -15882,7 +15781,7 @@ Static short histaddsignalpos()
 }
 
 
-Static Void histaddsignal(hn, sig, y)
+static void histaddsignal(hn, sig, y)
 log_hnrec **hn;
 short sig, y;
 {
@@ -15903,25 +15802,25 @@ short sig, y;
 
 
 
-Static Void hnproc1()
+static void hnproc1()
 {
   calltool(gg.acttool, act_confighist);
 }
 
 
-Static Void hnproc2()
+static void hnproc2()
 {
   calltool(gg.acttool, act_configchhist);
 }
 
 
-Static Void hnproc3()
+static void hnproc3()
 {
   calltool(gg.acttool, act_configrelhist);
 }
 
 
-Static Void haproc1()
+static void haproc1()
 {
   log_gattrrec *WITH;
 
@@ -15946,7 +15845,7 @@ Static Void haproc1()
 }
 
 
-Static Void haproc2()
+static void haproc2()
 {
   log_gattrrec *WITH;
 
@@ -16003,7 +15902,7 @@ Static Void haproc2()
 }
 
 
-Static Void haproc3()
+static void haproc3()
 {
   /* nothing at all! */
 }
@@ -16043,19 +15942,19 @@ Static Void haproc3()
 typedef short ararr[log_million];
 
 
-/* Local variables for historycommand: */
+/* variables for historycommand: */
 struct LOC_historycommand {
-  boolean rflag, oldtrigger, oldreset, oldonoff, oldfast;
+  int rflag, oldtrigger, oldreset, oldonoff, oldfast;
   short oldgridmode, oldgridwhich, gridx1, gridy1, gridx2, gridy2, valuey,
 	whichmenu, vmenu1, vmenu2;
-  boolean xactive, yactive;
-  Char xexpr[256], yexpr[256];
+  int xactive, yactive;
+  char xexpr[256], yexpr[256];
   double gridval, gridval2, gridtime;
-  Char gridstr[81];
+  char gridstr[81];
   long stamp;
 } ;
 
-Local double valueattime(hn, time, LINK)
+double valueattime(hn, time, LINK)
 log_hnrec *hn;
 double time;
 struct LOC_historycommand *LINK;
@@ -16079,7 +15978,7 @@ struct LOC_historycommand *LINK;
   }
 }
 
-Local log_hnrec *findtrace(x, y, LINK)
+log_hnrec *findtrace(x, y, LINK)
 short x, y;
 struct LOC_historycommand *LINK;
 {
@@ -16122,7 +16021,7 @@ struct LOC_historycommand *LINK;
 
 #undef tolerance
 
-Local Void refrtrigger(LINK)
+void refrtrigger(LINK)
 struct LOC_historycommand *LINK;
 {
   if (gg.histactive == LINK->oldtrigger || LINK->whichmenu != 0)
@@ -16137,7 +16036,7 @@ struct LOC_historycommand *LINK;
   LINK->oldtrigger = gg.histactive;
 }
 
-Local Void refrreset(LINK)
+void refrreset(LINK)
 struct LOC_historycommand *LINK;
 {
   if (gg.resetflag == LINK->oldreset || LINK->whichmenu != 0)
@@ -16152,7 +16051,7 @@ struct LOC_historycommand *LINK;
   LINK->oldreset = gg.resetflag;
 }
 
-Local Void refronoff(LINK)
+void refronoff(LINK)
 struct LOC_historycommand *LINK;
 {
   if (gg.pwrflag == LINK->oldonoff || LINK->whichmenu != 0)
@@ -16169,7 +16068,7 @@ struct LOC_historycommand *LINK;
   LINK->oldonoff = gg.pwrflag;
 }
 
-Local Void refrgridmode(LINK)
+void refrgridmode(LINK)
 struct LOC_historycommand *LINK;
 {
   if (histgridmode != LINK->oldgridmode && LINK->whichmenu == 0) {
@@ -16220,10 +16119,10 @@ struct LOC_historycommand *LINK;
   LINK->oldgridwhich = histgridwhich;
 }
 
-Local Void refrfast(LINK)
+void refrfast(LINK)
 struct LOC_historycommand *LINK;
 {
-  boolean fast;
+  int fast;
 
   fast = (gg.fastspeed == gg.fastmax);
   if (fast == LINK->oldfast || LINK->whichmenu != 0)
@@ -16238,7 +16137,7 @@ struct LOC_historycommand *LINK;
   LINK->oldfast = fast;
 }
 
-Local Void drawsigname(hn, opt, LINK)
+void drawsigname(hn, opt, LINK)
 log_hnrec *hn;
 short opt;
 struct LOC_historycommand *LINK;
@@ -16259,7 +16158,7 @@ struct LOC_historycommand *LINK;
   m_colormode((long)m_normal);
 }
 
-/* Local variables for drawhistory: */
+/* variables for drawhistory: */
 struct LOC_drawhistory {
   struct LOC_historycommand *LINK;
   short x, y, oldx;
@@ -16267,7 +16166,7 @@ struct LOC_drawhistory {
   short *ar;
 } ;
 
-Local Void drawtrace(hn, i, LINK)
+void drawtrace(hn, i, LINK)
 log_hnrec *hn;
 short i;
 struct LOC_drawhistory *LINK;
@@ -16285,7 +16184,7 @@ struct LOC_drawhistory *LINK;
   LINK->ar[i - 1] = LINK->y;
 }
 
-Local Void drawhistory(LINK)
+void drawhistory(LINK)
 struct LOC_historycommand *LINK;
 {
   struct LOC_drawhistory V;
@@ -16337,7 +16236,7 @@ struct LOC_historycommand *LINK;
   Free(V.ar);
 }
 
-Local Void setgridwhich(hn, LINK)
+void setgridwhich(hn, LINK)
 log_hnrec *hn;
 struct LOC_historycommand *LINK;
 {
@@ -16352,7 +16251,7 @@ struct LOC_historycommand *LINK;
     drawsigname(histgridhn, 0, LINK);
 }
 
-Local Void nextgridwhich(LINK)
+void nextgridwhich(LINK)
 struct LOC_historycommand *LINK;
 {
   log_hnrec *nexthn;
@@ -16385,7 +16284,7 @@ struct LOC_historycommand *LINK;
     drawsigname(histgridhn, 0, LINK);
 }
 
-Local Void nextgridmode(LINK)
+void nextgridmode(LINK)
 struct LOC_historycommand *LINK;
 {
   if (histgridmode == 0)
@@ -16394,14 +16293,14 @@ struct LOC_historycommand *LINK;
     histgridmode--;
 }
 
-Local Void confighistmode(LINK)
+void confighistmode(LINK)
 struct LOC_historycommand *LINK;
 {
-  boolean flag;
+  int flag;
   log_hnrec *hn;
-  Void (*TEMP) PV();
-  Void (*TEMP5) PV();
-  Void (*TEMP6) PV();
+  void (*TEMP) ();
+  void (*TEMP5) ();
+  void (*TEMP6) ();
 
   flag = histgattr[histalignsigs - 1].UU.b;
   TEMP = haproc1;
@@ -16418,7 +16317,7 @@ struct LOC_historycommand *LINK;
   }
 }
 
-Local Void passetc(LINK)
+void passetc(LINK)
 struct LOC_historycommand *LINK;
 {
   m_noclip();
@@ -16430,7 +16329,7 @@ struct LOC_historycommand *LINK;
   pen();
 }
 
-Local Void fastmode(LINK)
+void fastmode(LINK)
 struct LOC_historycommand *LINK;
 {
   long t0;
@@ -16443,15 +16342,15 @@ struct LOC_historycommand *LINK;
   gg.fastspeed = gg.fastmax;
 }
 
-Local Void dumpcmd(LINK)
+void dumpcmd(LINK)
 struct LOC_historycommand *LINK;
 {
-  Char fn[256];
+  char fn[256];
   log_htrec *ht;
   log_hnrec *hn;
   short i;
   long j;
-  Char STR2[256], STR3[256];
+  char STR2[256], STR3[256];
   short FORLIM;
 
   if (gg.htbase == NULL)
@@ -16534,10 +16433,10 @@ struct LOC_historycommand *LINK;
   LINK->rflag = true;
 }
 
-Local Void refraxis(pos, name, expr, flag, LINK)
+void refraxis(pos, name, expr, flag, LINK)
 long pos;
-Char *name, *expr;
-boolean flag;
+char *name, *expr;
+int flag;
 struct LOC_historycommand *LINK;
 {
   if (flag)
@@ -16553,15 +16452,15 @@ struct LOC_historycommand *LINK;
   m_noclip();
 }
 
-Local Void refraxes(LINK)
+void refraxes(LINK)
 struct LOC_historycommand *LINK;
 {
   refraxis(xaxispos, "X-axis", LINK->xexpr, LINK->xactive, LINK);
   refraxis(yaxispos, "Y-axis", LINK->yexpr, LINK->yactive, LINK);
 }
 
-Local Void setaxis(expr, LINK)
-Char *expr;
+void setaxis(expr, LINK)
+char *expr;
 struct LOC_historycommand *LINK;
 {
   if (LINK->xactive) {
@@ -16581,10 +16480,10 @@ struct LOC_historycommand *LINK;
   refraxes(LINK);
 }
 
-Local Void getexpr(LINK)
+void getexpr(LINK)
 struct LOC_historycommand *LINK;
 {
-  Char expr[256];
+  char expr[256];
 
   if (!(LINK->xactive || LINK->yactive))
     return;
@@ -16598,10 +16497,10 @@ struct LOC_historycommand *LINK;
     setaxis(expr, LINK);
 }
 
-Local Void plotcmd(LINK)
+void plotcmd(LINK)
 struct LOC_historycommand *LINK;
 {
-  Char STR1[256];
+  char STR1[256];
 
   if (*LINK->xexpr == '\0' || *LINK->yexpr == '\0')
     return;
@@ -16612,10 +16511,10 @@ struct LOC_historycommand *LINK;
   LINK->rflag = true;
 }
 
-Local Void measurecmd(LINK)
+void measurecmd(LINK)
 struct LOC_historycommand *LINK;
 {
-  Char STR1[81];
+  char STR1[81];
 
   do {
     while ((gg.t.x < histleft || gg.t.y > histdown) && gg.t.depressed)
@@ -16791,25 +16690,25 @@ struct LOC_historycommand *LINK;
 }
 
 
-Static Void historycommand()
+static void historycommand()
 {
   struct LOC_historycommand V;
   short y, i;
   long t;
   log_hnrec *hn, *hn0, *hn1, *hn2, *hn1a, *hn2a, *movinghn;
   uchar ch;
-  Char name[256];
+  char name[256];
   log_tool *tool;
-  boolean flag, rmflag, keyflag, savecaps;
+  int flag, rmflag, keyflag, savecaps;
   short scrollpos, scrollmin;
   double newhistfirsttime;
-  boolean gridflag;
-  Void (*TEMP) PV();
-  Void (*TEMP5) PV();
-  Void (*TEMP6) PV();
-  Char STR2[256];
-  Char STR3[256];
-  Char TEMP7;
+  int gridflag;
+  void (*TEMP) ();
+  void (*TEMP5) ();
+  void (*TEMP6) ();
+  char STR2[256];
+  char STR3[256];
+  char TEMP7;
 
   savecaps = nk_setcapslock(signalcaps);
   remcursor();
@@ -17226,7 +17125,7 @@ Static Void historycommand()
 #undef nummenus
 
 
-/* Local variables for savepage: */
+/* variables for savepage: */
 struct LOC_savepage {
   log_hwrec *firsthwire;
   log_vwrec *firstvwire;
@@ -17234,7 +17133,7 @@ struct LOC_savepage {
   short numhw, maxunat;
 } ;
 
-Local short countnode(n, LINK)
+short countnode(n, LINK)
 log_nrec *n;
 struct LOC_savepage *LINK;
 {
@@ -17250,7 +17149,7 @@ struct LOC_savepage *LINK;
   return i;
 }
 
-Local short counthw(hw, LINK)
+short counthw(hw, LINK)
 log_hwrec *hw;
 struct LOC_savepage *LINK;
 {
@@ -17268,7 +17167,7 @@ struct LOC_savepage *LINK;
   return i;
 }
 
-Local short countvw(vw, LINK)
+short countvw(vw, LINK)
 log_vwrec *vw;
 struct LOC_savepage *LINK;
 {
@@ -17286,12 +17185,12 @@ struct LOC_savepage *LINK;
   return (i + LINK->numhw);
 }
 
-Local boolean eqattr(ka, ga, LINK)
+int eqattr(ka, ga, LINK)
 log_kattrrec *ka;
 log_gattrrec *ga;
 struct LOC_savepage *LINK;
 {
-  boolean Result;
+  int Result;
 
   switch (ka->dtype) {
 
@@ -17325,7 +17224,7 @@ struct LOC_savepage *LINK;
   return Result;
 }
 
-Local na_strlist *attrname(i, lbl, LINK)
+na_strlist *attrname(i, lbl, LINK)
 short i;
 na_strlist *lbl;
 struct LOC_savepage *LINK;
@@ -17343,7 +17242,7 @@ struct LOC_savepage *LINK;
   return l1;
 }
 
-Local short countattrs(gattr, numattrs, kattr, lbl, LINK)
+short countattrs(gattr, numattrs, kattr, lbl, LINK)
 log_gattrrec *gattr;
 short numattrs;
 log_kattrrec *kattr;
@@ -17366,7 +17265,7 @@ struct LOC_savepage *LINK;
   return j;
 }
 
-Local Void writeattrs(f, gattr, numattrs, kattr, lbl, LINK)
+void writeattrs(f, gattr, numattrs, kattr, lbl, LINK)
 FILE **f;
 log_gattrrec *gattr;
 short numattrs;
@@ -17376,7 +17275,7 @@ struct LOC_savepage *LINK;
 {
   short num, i;   /*reads maxunat from last call to countattrs*/
   na_strlist *l1;
-  Char STR2[81];
+  char STR2[81];
 
   num = countattrs(gattr, numattrs, kattr, lbl, LINK);
   for (i = 1; i <= numattrs; i++) {
@@ -17431,12 +17330,12 @@ struct LOC_savepage *LINK;
 
 
 
-Static Void savepage(pgnum, filename_)
+static void savepage(pgnum, filename_)
 short pgnum;
-Char *filename_;
+char *filename_;
 {
   struct LOC_savepage V;
-  Char filename[256];
+  char filename[256];
   FILE *f;
   log_grec *g;
   log_srec *s, *firstsolder;
@@ -17446,11 +17345,11 @@ Char *filename_;
   log_brec *b, *firstbox;
   log_krec *k;
   log_hnrec *hn;
-  Char buf[256];
+  char buf[256];
   log_nrec *n1, *lastnode;
   short i, j, count, numvw, numnodes;
-  Char STR1[9];
-  Char STR2[256];
+  char STR1[9];
+  char STR2[256];
   short FORLIM;
 
   strcpy(filename, filename_);
@@ -17513,7 +17412,7 @@ Char *filename_;
 	/* n1^.temp.p := firstnode;
 	 firstnode := n1; */
 	if (lastnode != NULL)
-	  lastnode->temp = (Anyptr)n1;
+	  lastnode->temp = (void *)n1;
 	else
 	  V.firstnode = n1;
 	n1->temp = NULL;
@@ -17568,7 +17467,7 @@ Char *filename_;
     V.firsthwire = NULL;
     while (hw != NULL) {
       V.numhw++;
-      hw->temp = (Anyptr)V.firsthwire;
+      hw->temp = (void *)V.firsthwire;
       V.firsthwire = hw;
       hw = hw->next;
     }
@@ -17577,7 +17476,7 @@ Char *filename_;
     V.firstvwire = NULL;
     while (vw != NULL) {
       numvw++;
-      vw->temp = (Anyptr)V.firstvwire;
+      vw->temp = (void *)V.firstvwire;
       V.firstvwire = vw;
       vw = vw->next;
     }
@@ -17601,7 +17500,7 @@ Char *filename_;
     firstsolder = NULL;
     while (s != NULL) {
       count++;
-      s->temp = (Anyptr)firstsolder;
+      s->temp = (void *)firstsolder;
       firstsolder = s;
       s = s->next;
     }
@@ -17625,7 +17524,7 @@ Char *filename_;
     firstlabel = NULL;
     while (l != NULL) {
       count++;
-      l->temp = (Anyptr)firstlabel;
+      l->temp = (void *)firstlabel;
       firstlabel = l;
       l = l->next;
     }
@@ -17644,7 +17543,7 @@ Char *filename_;
     firstbox = NULL;
     while (b != NULL) {
       count++;
-      b->temp = (Anyptr)firstbox;
+      b->temp = (void *)firstbox;
       firstbox = b;
       b = b->next;
     }
@@ -17709,7 +17608,7 @@ Char *filename_;
     f = NULL;
     gg.pagechanged[pgnum - 1] = false;
     if (curfilename[pgnum - 1] == NULL)
-      curfilename[pgnum - 1] = (Char *)Malloc(256);
+      curfilename[pgnum - 1] = (char *)Malloc(256);
     strcpy(curfilename[pgnum - 1], filename);
   }
   if (f != NULL)
@@ -17719,10 +17618,10 @@ Char *filename_;
 
 
 
-Static Void emergencysave(pgnum)
+static void emergencysave(pgnum)
 short pgnum;
 {
-  Char filename[256];
+  char filename[256];
 
   TRY(try25);
     printf("File name");
@@ -17740,9 +17639,9 @@ short pgnum;
 }
 
 
-Local Void safesavepage(pgnum, fn)
+void safesavepage(pgnum, fn)
 short pgnum;
-Char *fn;
+char *fn;
 {
   long i, j;
 
@@ -17769,13 +17668,13 @@ Char *fn;
 
 
 
-Static Void savecommand()
+static void savecommand()
 {
   short pgnum;
-  Char filename[256];
+  char filename[256];
   short FORLIM;
-  Char STR1[256];
-  Char STR2[256];
+  char STR1[256];
+  char STR2[256];
 
   garbagecoll();
   if (*gg.funcarg == '\0') {
@@ -17812,10 +17711,10 @@ Static Void savecommand()
 
 
 
-Static Void namecommand()
+static void namecommand()
 {
-  Char filename[256];
-  Char STR2[256], STR3[256];
+  char filename[256];
+  char STR2[256], STR3[256];
 
   if (*gg.funcarg == '\0') {
     beginbottom();
@@ -17835,7 +17734,7 @@ Static Void namecommand()
     else {
       newci_fixfname(filename, "lgf", "");
       if (curfilename[gg.curpage - 1] == NULL)
-	curfilename[gg.curpage - 1] = (Char *)Malloc(256);
+	curfilename[gg.curpage - 1] = (char *)Malloc(256);
       strcpy(curfilename[gg.curpage - 1], filename);
     }
   }
@@ -17858,16 +17757,16 @@ Static Void namecommand()
 
 
 
-Static Void loadlog30(f, ver)
+static void loadlog30(f, ver)
 FILE **f;
 short ver;
 {
   short i, j, x, y, x1, y1, x2, y2;
-  Char nam[81];
-  Char ch;
+  char nam[81];
+  char ch;
   log_lrec *l;
   log_brec *b;
-  Char *TEMP;
+  char *TEMP;
 
   fscanf(*f, "%*[^\n]");   /*version number*/
   getc(*f);
@@ -18033,7 +17932,7 @@ short ver;
 
 
 
-Static Void readattrs(f, gattr, numattrs, kattr, lbl, count)
+static void readattrs(f, gattr, numattrs, kattr, lbl, count)
 FILE **f;
 log_gattrrec **gattr;
 short numattrs;
@@ -18042,8 +17941,8 @@ na_strlist *lbl;
 short count;
 {
   short j, jj;
-  Char ch;
-  Char buf[256];
+  char ch;
+  char buf[256];
   na_strlist *l1, *names;
 
   l1 = lbl;
@@ -18162,7 +18061,7 @@ short count;
 typedef log_nrec *nodearray[log_million];
 
 typedef struct wirerec {
-  boolean horiz;
+  int horiz;
   union {
     log_hwrec *hw;
     log_vwrec *vw;
@@ -18173,17 +18072,17 @@ typedef wirerec wirearray[log_million];
 typedef long intarray[log_million];
 
 
-/* Local variables for loadpage: */
+/* variables for loadpage: */
 struct LOC_loadpage {
-  Char *reason;
+  char *reason;
   FILE *f;
   long *ip;
   short numnodes;
   log_nrec **np;
 } ;
 
-Local Void loadfail(msg, LINK)
-Char *msg;
+void loadfail(msg, LINK)
+char *msg;
 struct LOC_loadpage *LINK;
 {
   if (LINK->f)
@@ -18196,11 +18095,11 @@ struct LOC_loadpage *LINK;
   _Escape(1);
 }
 
-Local log_nrec *countnode_(i, LINK)
+log_nrec *countnode_(i, LINK)
 short i;
 struct LOC_loadpage *LINK;
 {
-  Char STR2[256];
+  char STR2[256];
 
   if (i >= 1 && i <= LINK->numnodes)
     return (refnode(LINK->np[i - 1]));
@@ -18212,24 +18111,24 @@ struct LOC_loadpage *LINK;
 
 
 
-/* Local variables for initialize: */
+/* variables for initialize: */
 struct LOC_initialize {
   short j;
   na_strlist *loadgates, *logmenu;
-  Char cmdbuf[81];
+  char cmdbuf[81];
   cnfrec *cnflast;
 } ;
 
 
-Local boolean tryfindfile(name, path, LINK)
-Char *name;
-Char *path;
+int tryfindfile(name, path, LINK)
+char *name;
+char *path;
 struct LOC_initialize *LINK;
 {
-  boolean Result;
-  Char fname[256];
+  int Result;
+  char fname[256];
   FILE *f;
-  Char *ep;
+  char *ep;
 
   f = NULL;
   Result = false;
@@ -18265,11 +18164,11 @@ struct LOC_initialize *LINK;
   return Result;
 }
 
-Local boolean locatefile(name, LINK)
-Char *name;
+int locatefile(name, LINK)
+char *name;
 struct LOC_initialize *LINK;
 {
-  Char path[256];
+  char path[256];
 
   sprintf(path, "%s/", GetChipmunkPath("LOGLIB", LOGLIB));
   return (tryfindfile(name, "", LINK) ||
@@ -18279,12 +18178,12 @@ struct LOC_initialize *LINK;
 
 
 
-Static Void loadpage(filename_, reason_)
-Char *filename_;
-Char *reason_;
+static void loadpage(filename_, reason_)
+char *filename_;
+char *reason_;
 {
   struct LOC_loadpage V;
-  Char filename[256];
+  char filename[256];
   log_nrec *n, *n1;
   log_grec *g, *g1;
   log_srec *s;
@@ -18296,14 +18195,14 @@ Char *reason_;
   short i, j, k, x, y, x1, y1, x2, y2, numwires, count, ver;
   long ii;
   cnrec *cnbase;
-  Char tempname[256];
-  Char labelname[log_lablen + 1];
-  Char ch, ch1, ch2;
+  char tempname[256];
+  char labelname[log_lablen + 1];
+  char ch, ch1, ch2;
   wirerec *wp;
-  Char STR2[20];
-  Char STR3[18];
+  char STR2[20];
+  char STR3[18];
   short FORLIM;
-  Char *TEMP;
+  char *TEMP;
 
   strcpy(filename, filename_);
   V.reason = reason_;
@@ -18694,7 +18593,7 @@ Char *reason_;
     chpage((int)gg.curpage);
     gg.pagechanged[gg.curpage - 1] = false;
     if (curfilename[gg.curpage - 1] == NULL)
-      curfilename[gg.curpage - 1] = (Char *)Malloc(256);
+      curfilename[gg.curpage - 1] = (char *)Malloc(256);
     strcpy(curfilename[gg.curpage - 1], filename);
   }
 }
@@ -18708,7 +18607,7 @@ Char *reason_;
 
 
 typedef misc_catentry catarray[catsize];
-typedef Char dirarray[maxdirmax + 1][fidleng + 1];
+typedef char dirarray[maxdirmax + 1][fidleng + 1];
 
 
 
@@ -18722,15 +18621,15 @@ typedef Char dirarray[maxdirmax + 1][fidleng + 1];
 /*=                                              =*/
 /*================================================*/
 
-Static Void loadcommand()
+static void loadcommand()
 {
   short i, j, x, y, x1, y1, dirmax, dircol;
-  Char filename[256];
-  Char ch;
-  Char name[fidleng + 1];
+  char filename[256];
+  char ch;
+  char name[fidleng + 1];
   misc_catentry *cat;
-  Char (*dirs[maxdircol + 1])[fidleng + 1];
-  Char STR3[256];
+  char (*dirs[maxdircol + 1])[fidleng + 1];
+  char STR3[256];
 
   dircol = P_imin2((txacross - 14L) / 15, (long)maxdircol);
   dirmax = -1;
@@ -18866,15 +18765,15 @@ Static Void loadcommand()
 typedef long intarray_[log_million];
 
 
-/* Local variables for readlgf: */
+/* variables for readlgf: */
 struct LOC_readlgf {
-  Char *reason;
+  char *reason;
   FILE **f;
   long *ip;
 } ;
 
-Local Void loadfail_(msg, LINK)
-Char *msg;
+void loadfail_(msg, LINK)
+char *msg;
 struct LOC_readlgf *LINK;
 {
   if (*LINK->f)
@@ -18891,20 +18790,20 @@ struct LOC_readlgf *LINK;
 
 
 
-Static Void readlgf(f, reason_)
+static void readlgf(f, reason_)
 FILE **f;
-Char *reason_;
+char *reason_;
 {
   struct LOC_readlgf V;
-  Char buf[256];
-  Char ch;
+  char buf[256];
+  char ch;
   long i, j, k, m, n, ii;
   short x1, y1, x2, y2;
   log_grec *g;
   log_hnrec *hn;
   log_nrec *n1;
-  Char *TEMP;
-  Char STR2[38];
+  char *TEMP;
+  char STR2[38];
 
   V.reason = reason_;
   V.f = f;
@@ -19098,13 +18997,13 @@ Char *reason_;
 }
 
 
-/* Local variables for readpage: */
+/* variables for readpage: */
 struct LOC_readpage {
-  Char *reason;
+  char *reason;
 } ;
 
-Local Void loadfail__(msg, LINK)
-Char *msg;
+void loadfail__(msg, LINK)
+char *msg;
 struct LOC_readpage *LINK;
 {
   strcpy(LINK->reason, msg);
@@ -19113,15 +19012,15 @@ struct LOC_readpage *LINK;
 
 
 
-Static Void readpage(filename_, reason_)
-Char *filename_;
-Char *reason_;
+static void readpage(filename_, reason_)
+char *filename_;
+char *reason_;
 {
   struct LOC_readpage V;
-  Char filename[256];
+  char filename[256];
   FILE *f;
-  Char buf[256];
-  Char *TEMP;
+  char buf[256];
+  char *TEMP;
 
   strcpy(filename, filename_);
   V.reason = reason_;
@@ -19150,7 +19049,7 @@ Char *reason_;
   chpage((int)gg.curpage);
   gg.pagechanged[gg.curpage - 1] = false;
   if (curfilename[gg.curpage - 1] == NULL)
-    curfilename[gg.curpage - 1] = (Char *)Malloc(256);
+    curfilename[gg.curpage - 1] = (char *)Malloc(256);
   strcpy(curfilename[gg.curpage - 1], filename);
   if (f != NULL)
     fclose(f);
@@ -19158,9 +19057,9 @@ Char *reason_;
 
 
 
-Static Void readcommand()
+static void readcommand()
 {
-  Char filename[256], reason[256];
+  char filename[256], reason[256];
   long i, j;
 
   if (*gg.funcarg == '\0' || !strcmp(gg.funcarg, "*")) {
@@ -19204,7 +19103,7 @@ Static Void readcommand()
 
 
 
-Static Void singlestep()
+static void singlestep()
 {
   gg.singlestepcount = getint(gg.funcarg, 1L);
   steppingoff = gg.pwrflag;
@@ -19216,10 +19115,10 @@ Static Void singlestep()
 
 
 
-Static Void getgatecmd()
+static void getgatecmd()
 {
   short i;
-  Char name[9];
+  char name[9];
 
   do {
     getword(gg.funcarg, name);
@@ -19232,10 +19131,10 @@ Static Void getgatecmd()
 
 
 
-Static Void makegatecmd()
+static void makegatecmd()
 {
   short i;
-  Char name[9];
+  char name[9];
 
   do {
     getword(gg.funcarg, name);
@@ -19252,13 +19151,13 @@ Static Void makegatecmd()
 #define maxtools        23
 
 
-/* Local variables for toolcommand: */
+/* variables for toolcommand: */
 struct LOC_toolcommand {
   log_tool *ta[maxtools + 1];
-  boolean refrflag, wasselected;
+  int refrflag, wasselected;
 } ;
 
-Local Void describe(i, LINK)
+void describe(i, LINK)
 long i;
 struct LOC_toolcommand *LINK;
 {
@@ -19273,7 +19172,7 @@ struct LOC_toolcommand *LINK;
   printf("%c\n", chrgreen);
 }
 
-Local long which(LINK)
+long which(LINK)
 struct LOC_toolcommand *LINK;
 {
   if (gg.t.near_ && gg.t.ay >= 1 && gg.t.ay <= maxtools)
@@ -19282,8 +19181,8 @@ struct LOC_toolcommand *LINK;
     return -1;
 }
 
-Local Void selecttool(name, LINK)
-Char *name;
+void selecttool(name, LINK)
+char *name;
 struct LOC_toolcommand *LINK;
 {
   log_tool *tp;
@@ -19304,13 +19203,13 @@ struct LOC_toolcommand *LINK;
 
 
 
-Static Void toolcommand()
+static void toolcommand()
 {
   struct LOC_toolcommand V;
   log_tool *tp;
   long i, j, numtools;
-  boolean exitflag;
-  Char ch;
+  int exitflag;
+  char ch;
 
   V.wasselected = false;
   if (*gg.funcarg != '\0')
@@ -19366,7 +19265,7 @@ Static Void toolcommand()
 	    break;
 
 	  default:
-	    ch = (Char)(j + 64);
+	    ch = (char)(j + 64);
 	    if (V.ta[ch - 64] == NULL)
 	      ch = '\003';
 	    break;
@@ -19397,7 +19296,7 @@ Static Void toolcommand()
 #define whichmin        (-2)
 
 
-Local log_tool *counttool(i)
+log_tool *counttool(i)
 long i;
 {
   log_tool *tp;
@@ -19413,9 +19312,9 @@ long i;
   return tp;
 }
 
-Local Char *onoff(Result, b)
-Char *Result;
-boolean b;
+char *onoff(Result, b)
+char *Result;
+int b;
 {
   if (b)
     return strcpy(Result, "ON ");
@@ -19423,12 +19322,12 @@ boolean b;
     return strcpy(Result, "OFF");
 }
 
-Local Void status_log()
+void status_log()
 {
   timerec time;
   daterec date;
-  Char STR2[9];
-  Char STR3[81];
+  char STR2[9];
+  char STR3[81];
   char * months[12] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
 		       "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
 
@@ -19506,7 +19405,7 @@ Local Void status_log()
 }
 
 
-Local Void status_mem()
+void status_mem()
 {
   long i, j;
   log_grec *g;
@@ -19622,10 +19521,10 @@ Local Void status_mem()
   printf("Total signal names:  %12ld\n", j);
 }
 
-Local Void status_macro(int v)
+void status_macro(int v)
 {
   macrorec *mp;
-  Char ch;
+  char ch;
   long i, j;
   int half;
   int k;
@@ -19672,7 +19571,7 @@ Local Void status_macro(int v)
 	else if (ch == ' ')
 	  printf("sp ");
 	else if ((ch & 255) >= 168 && (ch & 255) <= 193)
-	  printf("^%c ", (Char)((uchar)ch - 'g'));
+	  printf("^%c ", (char)((uchar)ch - 'g'));
 	else if (ch <= '\037' || (ch & (~127)) != 0)
 	  printf("%3d", ch);
 	else
@@ -19699,22 +19598,16 @@ Local Void status_macro(int v)
 /* p2c: log.text, line 18562: Note: Character >= 128 encountered [281] */
 }
 
-
-
-
-
-
-
-Static Void statusdisplay(name_)
-Char *name_;
+static void statusdisplay(name_)
+char *name_;
 {
-  Char name[256];
-  Char ch;
+  char name[256];
+  char ch;
   short which, whichmax;
   long savex, savey;
-  boolean refrflag, exitflag;
+  int refrflag, exitflag;
   log_tool *tp;
-  Char STR2[256], STR3[256];
+  char STR2[256], STR3[256];
   int n = 0;
 
   strcpy(name, name_);
@@ -19879,12 +19772,12 @@ Char *name_;
 /*=                                              =*/
 /*================================================*/
 
-Static Void popupmenu(num)
+static void popupmenu(num)
 short num;
 {
   short i, j, x, y, xx, x0, y0, x1, y1, x00, y00;
   logmenurec *menu;
-  Char STR1[256];
+  char STR1[256];
 
   menu = popupmenus[num - 1];
   popup_grid = (cursortype == grid);
@@ -19983,7 +19876,7 @@ short num;
 
 
 
-Static short reducecolor8(c)
+static short reducecolor8(c)
 short c;
 {
   short Result;
@@ -20041,7 +19934,7 @@ short c;
 
 
 
-Static Void setcmap(n, r, g, b)
+static void setcmap(n, r, g, b)
 short n, r, g, b;
 {
   n = reducecolor8(n);
@@ -20053,14 +19946,14 @@ short n, r, g, b;
 
 
 
-Static Void getcolor(name_, val, def)
-Char *name_;
+static void getcolor(name_, val, def)
+char *name_;
 short *val, def;
 {
-  Char name[256];
+  char name[256];
   na_strlist *cp;
-  Char STR2[256];
-  Char STR3[256];
+  char STR2[256];
+  char STR3[256];
 
   strcpy(name, name_);
   strupper(name, strcpy(STR2, strltrim(strrtrim(strcpy(STR3, name)))));
@@ -20074,7 +19967,7 @@ short *val, def;
 
 
 
-Static Void initcolors()
+static void initcolors()
 {
   getcolor("BACKGR", &gg.color.backgr, log_gray);   /* Color of background */
   getcolor("CURSOR", &gg.color.cursor, log_white);   /* Color of cursors */
@@ -20166,12 +20059,12 @@ Static Void initcolors()
 
 
 
-Static Void echomacro(key)
-Char key;
+static void echomacro(key)
+char key;
 {
   macrorec *mp;
-  Char name[256];
-  Char STR1[256];
+  char name[256];
+  char STR1[256];
 
   if (isupper(key))
     sprintf(name, "Shift-%c key", key);
@@ -20202,9 +20095,9 @@ Char key;
 
 
 
-Static Void definemacro(key, name)
-Char key;
-Char *name;
+static void definemacro(key, name)
+char key;
+char *name;
 {
   macrorec *mp, *mp2, *mp3;
 
@@ -20233,9 +20126,9 @@ Char *name;
 
 
 
-Static Void definemenu(num, part, name, cmd, bool)
+static void definemenu(num, part, name, cmd, bool)
 short num, part;
-Char *name, *cmd;
+char *name, *cmd;
 short bool;
 {
   logmenurec *menu;
@@ -20288,23 +20181,23 @@ short bool;
 }
 
 
-typedef Char cnamearray[16][8];
+typedef char cnamearray[16][8];
 
 
-Const cnamearray cnames = {
+const cnamearray cnames = {
   "GRAY", "RED", "GREEN", "YELLOW", "MRED", "ORANGE", "CYAN", "WHITE",
   "BLACK", "PINK", "DYELLOW", "XGREEN", "DCYAN", "DRED", "LGRAY", "CRED"
 };
 
 
-Local long getcolorname(w_)
-Char *w_;
+long getcolorname(w_)
+char *w_;
 {
   long Result;
-  Char w[256];
+  char w[256];
   short i;
-  Char STR1[256];
-  Char STR2[256];
+  char STR1[256];
+  char STR2[256];
 
   strcpy(w, w_);
   strcpy(STR1, strltrim(strrtrim(strupper(STR2, w))));
@@ -20333,16 +20226,16 @@ Char *w_;
 
 
 
-Static Void docnffunction()
+static void docnffunction()
 {
-  Char arg[256];
+  char arg[256];
   long i, j, k;
-  Char ch;
+  char ch;
   na_strlist *cp;
   long clrarr[3];
-  boolean flag;
+  int flag;
   librstrrec *lsp, **lspp;
-  Char STR2[256];
+  char STR2[256];
 
   if (*gg.func == '\0')
     return;
@@ -20401,7 +20294,7 @@ Static Void docnffunction()
 	else if (strlen(arg) == 2 && arg[0] == '^')
 	  ch = (arg[1] & 31) + 167;
 	else
-	  ch = (Char)getint(arg, 32L);
+	  ch = (char)getint(arg, 32L);
       } else
 	ch = arg[0];
       if (*gg.funcarg == '\0')
@@ -20475,13 +20368,13 @@ Static Void docnffunction()
 
 
 
-Static Void dofunction()
+static void dofunction()
 {
   log_tool *tp;
-  Char cmd[17];
+  char cmd[17];
   short i;
-  boolean oflag;
-  Char STR2[256];
+  int oflag;
+  char STR2[256];
   short FORLIM;
   unsigned char TEMP;
 
@@ -20731,7 +20624,7 @@ Static Void dofunction()
 
 
 
-Static Void initmacros()
+static void initmacros()
 {
   definemacro(171, "EXIT *");   /*control-D*/
   definemacro(':', "DO");
@@ -20797,7 +20690,7 @@ Static Void initmacros()
 }
 
 
-Local Void newmenu(menu)
+void newmenu(menu)
 logmenurec **menu;
 {
   short i;
@@ -20809,7 +20702,7 @@ logmenurec **menu;
 
 
 
-Static Void initmenus()
+static void initmenus()
 {
   short i;
 
@@ -20849,7 +20742,7 @@ Static Void initmenus()
 
 
 
-Static Void inithooks()
+static void inithooks()
 {
   gg.hook.hidecursor = hidecursor_hook;
   gg.hook.unhidecursor = unhidecursor_hook;
@@ -20976,16 +20869,16 @@ Static Void inithooks()
 #define rtn             "INITIALIZE"
 
 #if 0
-/* Local variables for initialize: */
+/* variables for initialize: */
 struct LOC_initialize {
   short j;
   na_strlist *loadgates, *logmenu;
-  Char cmdbuf[81];
+  char cmdbuf[81];
   cnfrec *cnflast;
 } ;
 #endif
 
-Local Void beginfatal(LINK)
+void beginfatal(LINK)
 struct LOC_initialize *LINK;
 {
   if (P_escapecode == -20)
@@ -20995,18 +20888,18 @@ struct LOC_initialize *LINK;
   printf("\n\n%c", chryellow);
 }
 
-Local Void endfatal(LINK)
+void endfatal(LINK)
 struct LOC_initialize *LINK;
 {
   printf("%c  Program aborted.\n", chrgreen);
   _Escape(0);
 }
 
-Local Void addgatesfile(fn_, LINK)
-Char *fn_;
+void addgatesfile(fn_, LINK)
+char *fn_;
 struct LOC_initialize *LINK;
 {
-  Char fn[256];
+  char fn[256];
   na_strlist *l1;
 
   strcpy(fn, fn_);
@@ -21017,12 +20910,12 @@ struct LOC_initialize *LINK;
     l1 = strlist_append(&gatefilenames, fn);
 }
 
-Local Void sethomedirname(dir_, LINK)
-Char *dir_;
+void sethomedirname(dir_, LINK)
+char *dir_;
 struct LOC_initialize *LINK;
 {
-  Char dir[256], buf[256];
-  Char *ep;
+  char dir[256], buf[256];
+  char *ep;
 
   if (dir_[0] == '~') {
     ep = tilde_expand(dir_);
@@ -21036,36 +20929,28 @@ struct LOC_initialize *LINK;
     strcat(gg.homedirname, "/");
 }
 
-Local Void removepath(name)
-Char *name;
+void removepath(name)
+char *name;
 {
   char *cp = (char *)strrchr(name, '/');
-#ifdef OS2
-  if (!cp) cp = strrchr(name, '\\');
-#endif
   if (cp)
      strcpy_overlap(name, cp + 1);
-#ifdef OS2
-  cp = strstr(name, ".exe");
-  if (cp)
-     *cp = '\0';
-#endif
 }
 
-Local Void readcnf(fn_, LINK)
-Char *fn_;
+void readcnf(fn_, LINK)
+char *fn_;
 struct LOC_initialize *LINK;
 {
-  Char fn[256];
-  boolean flag;
+  char fn[256];
+  int flag;
   long cnflin;
   FILE *tx;
-  Char txbuf[256], txarg[256], txarg2[256];
-  boolean erasegates, eraseload, erasemenu;
+  char txbuf[256], txarg[256], txarg2[256];
+  int erasegates, eraseload, erasemenu;
   na_strlist *l1, *l2;
   log_tool *tp;
   cnfrec *cnfp;
-  Char *TEMP;
+  char *TEMP;
 
   strcpy(fn, fn_);
   tx = NULL;
@@ -21264,7 +21149,7 @@ struct LOC_initialize *LINK;
 	    getword(txbuf, txarg);
 	    if (*txarg != '\0') {
 	      l1 = strlist_add(&commandlist, txarg);
-	      *(Char **)((Char **)(&l1->value)) = strdup(txarg2);
+	      *(char **)((char **)(&l1->value)) = strdup(txarg2);
 	    }
 	  } while (*txarg != '\0');
 	  continue;
@@ -21326,26 +21211,23 @@ struct LOC_initialize *LINK;
 /*=                                              =*/
 /*================================================*/
 
-Static Void initialize()
+static void initialize()
 {
   struct LOC_initialize V;
   newci_parserec swtab[10];
   short i, k, curgate;
   short gptr[maxgatesfiles], ggroup[maxgatesfiles], gsize[maxgatesfiles];
-  Char gname[maxgatesfiles][9];
+  char gname[maxgatesfiles][9];
   na_strlist *l1, *l2;
-  Char s[256];
-  boolean flag;
-  Char cnfname[256];
+  char s[256];
+  int flag;
+  char cnfname[256];
   nk_keytransinfo *keytrans;
-  Char STR2[256], STR3[256];
+  char STR2[256], STR3[256];
   short FORLIM;
   nk_keytransinfo *WITH;
   log_sigrec *WITH1;
 
-#ifdef OS2
-  _control87(EM_UNDERFLOW, EM_UNDERFLOW);  /* Turn off underflow exception. */
-#endif
   strcpy(swtab[0].switch_, "cC");   /* CNF file name */
   swtab[0].kind = 'M';
   strcpy(swtab[1].switch_, "vV");   /* Vanilla LOG (no CNF) */
@@ -21420,7 +21302,7 @@ Static Void initialize()
   conflictstop = false;
   conflictdelay = 1;
   anyconflicts = false;
-  gg.actstr = (Char *)Malloc(256);
+  gg.actstr = (char *)Malloc(256);
   *gg.actstr = '\0';
   gg.maxsignal = defmaxsignal;
   freenode = NULL;
@@ -21455,11 +21337,11 @@ Static Void initialize()
   vlsi = false;
   gg.dumpopen = false;
   gg.dumpfile = &dumpfile;
-  dumpfname = (Char *)Malloc(256);
+  dumpfname = (char *)Malloc(256);
   *dumpfname = '\0';
   gg.traceopen = false;
   gg.tracefile = &tracefile;
-  tracefname = (Char *)Malloc(256);
+  tracefname = (char *)Malloc(256);
   *tracefname = '\0';
   if (swtab[3].used > 0)
     strcpy(dumpfname, swtab[3].UU.s);
@@ -21472,7 +21354,7 @@ Static Void initialize()
   gg.traceflag = (swtab[2].used > 0);
   if (gg.traceflag)
     tracemessage("Trace mode ON");
-  gg.homedirname = (Char *)Malloc(256);
+  gg.homedirname = (char *)Malloc(256);
   if (swtab[5].used > 0) {
     if (*swtab[5].UU.s == '\0')
       sethomedirname("", &V);
@@ -21482,7 +21364,7 @@ Static Void initialize()
     sethomedirname("~/log", &V);
   cursorhide = false;
   initmenus();
-  gg.funcarg = (Char *)Malloc(256);
+  gg.funcarg = (char *)Malloc(256);
   *gg.funcarg = '\0';
   gg.host = log_host_log;
   gg.toolbase = NULL;
@@ -21494,9 +21376,9 @@ Static Void initialize()
     gatesname[i] = NULL;
   for (i = 0; i <= 8; i++)
     librgroupnames[i] = NULL;
-  loghelpname = (Char *)Malloc(256);
+  loghelpname = (char *)Malloc(256);
   strcpy(loghelpname, "loghelp");
-  lognewsname = (Char *)Malloc(256);
+  lognewsname = (char *)Malloc(256);
   strcpy(lognewsname, "lognews");
   gg.fastmin = deffastmin;
   gg.fastmax = deffastmax;
@@ -21575,7 +21457,7 @@ Static Void initialize()
     *gname[k] = '\0';
     if (gatefilenames != NULL) {
       TRY(try35);
-	gatesname[k] = (Char *)Malloc(256);
+	gatesname[k] = (char *)Malloc(256);
 	strcpy(gatesname[k], gatefilenames->s);
 	gatefilenames = gatefilenames->next;
 	libf1[k] = (filerecfilerec *)Malloc(sizeof(filerecfilerec));
@@ -21584,17 +21466,9 @@ Static Void initialize()
 	flag = false;
 	TRY(try36);
 	  if (libf1[k]->f != NULL)
-#ifndef OS2
   	    libf1[k]->f = freopen(gatesname[k], "r", libf1[k]->f);
-#else
- 	    libf1[k]->f = freopen(gatesname[k], "rb", libf1[k]->f);
-#endif
 	  else
-#ifndef OS2
   	    libf1[k]->f = fopen(gatesname[k], "r");
-#else
- 	    libf1[k]->f = fopen(gatesname[k], "rb");
-#endif	    
 	  if (libf1[k]->f == NULL) {
 	    P_escapecode = -10;
 	    P_ioresult = FileNotFound;
@@ -21609,19 +21483,11 @@ Static Void initialize()
 	    if (libf1[k]->f != NULL) {
 	      sprintf(STR2, "%s/%s", GetChipmunkPath("LOGLIB", LOGLIB),
 		      gatesname[k]);
-#ifndef OS2
   	      libf1[k]->f = freopen(STR2, "r", libf1[k]->f);
-#else
- 	      libf1[k]->f = freopen(STR2, "rb", libf1[k]->f);
-#endif
 	    } else {
 	      sprintf(STR2, "%s/%s", GetChipmunkPath("LOGLIB", LOGLIB),
 		      gatesname[k]);
-#ifndef OS2
   	      libf1[k]->f = fopen(STR2, "r");
-#else
- 	      libf1[k]->f = fopen(STR2, "rb");
-#endif
 	    }
 	    if (libf1[k]->f == NULL) {
 	      P_escapecode = -10;
@@ -21675,7 +21541,7 @@ Static Void initialize()
     printf("No gates files!\n");
     endfatal(&V);
   }
-  index_ = (Char(*)[9])Malloc(idxsize * 10L);
+  index_ = (char(*)[9])Malloc(idxsize * 10L);
 /* p2c: log.text, line 20391: Note: Can't interpret size in NA_NEW [174] */
   indexfile = (uchar *)Malloc(idxsize);
   indexoffset = (short *)Malloc(idxsize * sizeof(short));
@@ -21704,7 +21570,7 @@ Static Void initialize()
 	    if ((gname[i][V.j - 1] & (~127)) != 0) {
 /* p2c: log.text, line 20412: Note: Character >= 128 encountered [281] */
 	      ggroup[i] = V.j;
-	      gname[i][V.j - 1] = (Char)((uchar)gname[i][V.j - 1] - 128);
+	      gname[i][V.j - 1] = (char)((uchar)gname[i][V.j - 1] - 128);
 	    }
 	  }
 	RECOVER(try38);
@@ -21899,11 +21765,11 @@ Static Void initialize()
 
 
 
-Static Void shownews()
+static void shownews()
 {
   FILE *f;
-  Char s[256];
-  Char *TEMP;
+  char s[256];
+  char *TEMP;
 
   f = NULL;
   TRY(try39);
@@ -21946,10 +21812,10 @@ Static Void shownews()
 /*=                                              =*/
 /*================================================*/
 
-int main(int argc, Char * argv[])
+int main(int argc, char * argv[])
 {
   long FORLIM;
-  Char STR1[81];
+  char STR1[81];
 
   nc_text_in_window = 1;  
   PASCAL_MAIN(argc, argv);
diff --git a/log/src/log_action.h b/log/src/log_action.h
new file mode 100644
index 0000000..b0fbfc0
--- /dev/null
+++ b/log/src/log_action.h
@@ -0,0 +1,351 @@
+#ifndef LOG_ACTION_H
+#define LOG_ACTION_H
+
+typedef enum
+{
+	act_init,
+	act_endinit,
+	act_exit,
+	act_clearmsg,
+	act_status,
+	act_cnf,
+	act_immed,
+	act_func,
+	act_color,
+	act_select,
+	act_clear,
+	act_edit,
+	act_pass,
+	act_tstep,
+	act_erasegate,
+	act_touchgate,
+	act_history,
+	act_histval,
+	act_histstr,
+	act_trigger,
+	act_glowcol,
+	act_newgate,
+	act_disposegate,
+	act_copygate,
+	act_writegate,
+	act_readgate,
+	act_connectgate,
+	act_disconnectgate,
+	act_configchnode,
+	act_configrelnode,
+	act_confighist,
+	act_confighhist,
+	act_configrelhist,
+	act_newkind,
+	act_disposekind,
+	act_newnode,
+	act_disposenode,
+	act_copynode,
+	act_combinenodes,
+	act_combineintonode,
+	act_writenode,
+	act_readnode,
+	act_refnodes,
+	act_nodeval,
+	act_general,
+	act_gennode,
+	act_genkind,
+	act_gengate
+} log_actionkinds;
+
+typedef struct log_hooks_t
+{
+	void (*hidecursor) ();
+	void (*hidecursorrect) (long x1, long y1, long x2, long y2);
+	void (*unhidecursor) ();
+	void (*nodeconflict) (log_nrec *n);
+	void (*gateconflict) (log_grec *g);
+	void (*clearconflicts) (struct log_tool *tool);
+	void (*setdimgate) (log_grec *g, int dim);
+	void (*xform) (log_grec *g, short *x, short *y);
+	void (*getsig) (char *name, log_sigrec **sig);
+	void (*report) (int num, char *name);
+	void (*alert) ();
+	void (*warning) ();
+	void (*working) ();
+	void (*message) (char *msg);
+	void (*vmessage) (char *msg);
+	void (*vmessageflag) (char *msg, int b);
+	void (*trace) (char *msg);
+	void (*dump) (char *msg);
+	void (*setdump) (char *name);
+	void (*closefiles) ();
+	void (*clearalpha) ();
+	void (*drawstr) (int x, int y, char *s);
+	void (*rightstr) (int x, int y, char *s);
+	void (*centerstr) (int x, int y, char *s);
+	void (*clip) ();
+	void (*remcursor) ();
+	void (*clearscreen) ();
+	void (*setmode) (char *s);
+	void (*getword) (char *buf, char *wrd);
+	void (*getint) (char *buf, long *i, long def);
+	void (*getreal) (char *buf, double *r, double def);
+	void (*getbool) (char *buf, int *b);
+	void (*pen) ();
+	void (*pass) ();
+	void (*trykbd) ();
+	void (*scroll) ();
+	void (*trykbdscroll) ();
+	void (*inkey) (char *ch);
+	void (*udrawgate) (int x, int y, int g, int c);
+	void (*gdrawgate) (int x, int y, int g, int c);
+	void (*drawgate) (log_grec *g);
+	void (*erasegate) (log_grec *g);
+	void (*drawnode) (log_nrec *n, int c);
+	void (*refresh) ();   /*quietly refresh drawing area*/
+	void (*refreshsoon) ();
+	void (*beginbottom) ();
+	void (*endbottom) ();
+	void (*beginerror) ();
+	void (*enderror) ();
+	void (*redraw) ();   /*redraw drawing area*/
+	void (*redrawscreen) ();   /*redraw entire screen*/
+	void (*change) (int pg);
+	void (*newgate) (log_grec **g, int gt);
+	void (*copygate) (log_grec *old, log_grec **g);
+	void (*disposegate) (log_grec **g);
+	void (*newnode) (log_nrec **n, int st);
+	void (*copynode) (log_nrec *old, log_nrec **n);
+	void (*disposenode) (log_nrec **n);
+	void (*switchnode) (log_nrec **n, log_nrec *n2);
+	void (*dumpnodes) ();
+	void (*readlnpass) (char *s, int mode);
+	void (*clearfunc) ();
+	void (*refrfunc) ();
+	void (*assertfunc) (char *name);
+	void (*findobject) (int x, int y);
+	void (*findwire) (int x, int y);
+	void (*deletehw) (log_hwrec *hw);
+	void (*deletevw) (log_vwrec *vw);
+	void (*disconnectgate) (log_grec *g);
+	void (*deletegate) (log_grec *g);
+	void (*addhw) (int x1, int x2, int y);
+	void (*addvw) (int x, int y1, int y2);
+	void (*connectgate) (log_grec *g, int *success);
+	void (*waitnear) ();
+	void (*addgate) (int x, int y, int gtype);
+	void (*uaddgate) (int x, int y, int gtype);
+	void (*getgate) (char *name, short *gtype);
+	void (*realunit) (double r, int p, char *u, char *s);
+	void (*realunit2) (double r, int p, char *u, char *s);
+	void (*addlabel) (log_lrec **l, char *s);
+	void (*getcolor) (char *name, short *val, int def);
+	void (*setcmap) (int n, int r, int g, int b);
+	void (*parselabel) (na_strlistrec **lbl, short *numattrs, log_kattrrec **attr);
+	void (*editattrs) (log_gattrrec *gattr, int numattrs, log_kattrrec *kattr, na_strlistrec *lbl,
+			char *name, void (*proc) (), void (*chproc) (), void (*relproc) ());
+	void (*newattrs) (log_gattrrec **gattr, int numattrs, log_kattrrec *kattr);
+	void (*disposeattrs) (log_gattrrec **gattr, int numattrs, log_kattrrec *kattr);
+	void (*copyattrs) (log_gattrrec **gattr, log_gattrrec *oldattr, int numattrs, log_kattrrec *kattr);
+	void (*initscreen) ();
+	void (*clearshowalpha) ();
+	void (*setupregion) (log_regrec **r, int pagenum);
+	void (*stamp) (long *i);
+	void (*noclip) ();
+} log_hooks_t;
+
+typedef struct log_hook2_t
+{
+	void (*getnodeval) (log_nrec *n, double *val, char *opts);
+	void (*solderat) (int x, int y);
+	void (*unsolderwires) (log_hwrec *hw, log_vwrec *vw);
+	void (*settofrom) (log_grec **g, char *name);
+	void (*findattrnum) (log_krec *k, char *name, char *kinds, short *num);
+	void (*findattrname) (log_krec *k, int num, char *name);
+	void (*findpinnum) (log_krec *k, char *name, short *num);
+	void (*findpinname) (log_krec *k, int num, char *name);
+	void (*setgattr) (log_grec *g, int num, char *value);
+	void (*setnattr) (log_nrec *n, int num, char *value);
+	void (*findpointmarker) (log_krec *k, int num, short *x, short *y);
+	void (*findboxmarker) (log_krec *k, int num, short *x1, short *y1, short *x2, short *y2);
+	void (*send_general) (struct log_tool *sim, char *act);
+	void (*send_gennode) (log_nrec *n, char *act);
+	void (*send_genkind) (log_krec *k, char *act);
+	void (*send_gengate) (log_grec *g, char *act);
+	void (*send_all) (char *act);
+	void (*send_allnodes) (char *act);
+	void (*send_allkinds) (char *act);
+	void (*send_allgates) (char *act);
+	void (*addlabelat) (int x, int y, char *s);
+	void (*addboxat) (int x1, int y1, int x2, int y2);
+	void (*plainxform) (log_grec *g, short *x, short *y);
+	void (*findattrnum2) (int numattrs, log_kattrrec *kattr, na_strlistrec *lbl, char *name, char *kinds, short *num);
+	void (*findattrname2) (int numattrs, log_kattrrec *kattr, na_strlistrec *lbl, int num, char *name);
+	void (*showpinname) (log_grec *g, int i, int c, char *name);
+} log_hook2_t;
+
+typedef struct log_action_t
+{
+	log_actionkinds action;
+	log_krec *actkind;
+	log_grec *actgate;
+	log_grec *actgate2;
+	log_nrec *actnode;
+	log_nrec *actnode2;
+	long actx;
+	long acty;
+	FILLE **actfile;
+	struct log_tool *acttool;
+	char *actstr;
+	double actval;
+	double actval2;
+	double actval3;
+	log_gattrrec *actgattr;
+	log_kattrrec *actkattr;
+	unsigned char *actproc;
+
+	int pagechanged[log_maxpages];
+	log_grec *gbase[log_maxpages];
+	log_srec *sbase[log_maxpages];
+	log_hwrec *hwbase[log_maxpages];
+	log_vwrec *vwbase[log_maxpages];
+	log_lrec *lbase[log_maxpages];
+	log_brec *bbase[log_maxpages];
+	log_nrec *nbase;
+
+	log_sigrec *signaltab;
+	short maxsignal;
+	short lastsignal;
+
+	long numpages; /**< number of pages */
+	long curpage;  /**< current page number */
+	long showpage; /**< currenctly displayed page number */
+
+	short scale;
+	short hscale;
+	long xoff;	   /**< screen_x = grid_x * scale - xoff */
+	long yoff;
+
+	char func[17];
+	char *funcarg;
+
+	log_grec *neargate;
+	log_lrec *nearlabel;
+	log_brec *nearbox;
+	log_hwrec *nearhw;
+	log_hwrec *movinghw;
+	log_vwrec *nearvw;
+	log_vwrec *movingvw;
+
+	log_nrec *probenode;
+	log_grec *probegate;
+	short probepin;
+	struct log_tool *probesimtype;
+	short baselinecolor;
+
+	log_hnrec *hnbase;
+	log_htrec *htbase;
+	log htrec *htlast;
+
+	long fastspeed;
+	long fastmin;
+	long fastmax;
+	long fastrate;
+
+	long singlestepcount;
+
+	double time;
+	double prevtime;
+
+	log_simstatekinds simstate;
+	log_simstatekinds oldsimstate;
+
+	struct log_tool *simstatetool;
+	struct log_tool *oldsimstatetool;
+
+	int histactive;      /** Scope mode is triggered */
+	int dumpopen;        /** Dump output file is open */
+	int traceopen;       /** Trace output is open */
+	int verbose;         /** Commands acknowledge with messages */
+	int traceflag;       /** Debuggin/trace mode on */
+	int quiet;           /** Suppress sound signals */
+	int glowmode;        /** Glowing-wires mode */
+	int probemode;       /** Probe-cursor mode */
+	int markers;         /** Printing markers are defined */
+	int invisible;       /** Gates and wires are invisible */
+	int textinvisible;   /** Lablels and boxes are invisible */
+	int pnuminvisible;   /** Pin numbers are invisible */
+	int dotvisible;      /** Are "red dots" on or off normally? */
+	int showconflicts;   /** Show onlyconflict */
+	int resetflag;       /** "Reset" command has been given */
+	int pwrglag;         /** Simulator is turned on */
+	int intitdone;       /** Done with program initialization */
+	int refrflag;        /** Refreshing all displays */
+
+	int busyflag;        /** Flag for idling simulations */
+
+	short markerx1;
+	short markery1;
+	short markerx2;
+	short markery2;
+
+	m_tablet_info t;
+	m_tablet_info t0;
+	int startpoint;
+	int stillnear;
+	int incircuit;
+
+	short gridx;
+	short gridy;
+	short posx;
+	short posy;
+	short oldx;
+	short oldy;
+	short cx_min;
+	short cy_min;
+	short cx_max;
+	short cy_max;
+	/** Area covered bu cyrsor */
+
+	FILE **dumfile;
+	FILE **tracefile;
+
+	long rndseed; /** Seed for RAND funtion */
+
+	char *homedirname;
+
+	enum
+	{
+		log_host_log;
+		log_host_loged;
+		log_host_3;
+		log_host_4;
+	} host;
+	struct log_tool *toolbase;
+
+	log_hooks hook;
+	log_colorrec color;
+
+	long curstamp;
+	long labelstamp;                /** Changes to labels */
+	long boxstamp;                  /** Changes to boxes */
+	long msgstamp;                  /** Clearing messages screen */
+	long refrstamp;                 /** Clearing graphics screen */
+	long nattrstamp;                /** Changes to note attributes */
+	long gattrstamp;                /** Changes to gate attributes */
+	long sigstamp;                  /** Changes to signal table */
+	long loadstamp;                 /** A page was loaded */
+	long pagestamp[log_maxpages];
+	long colorstamp;                /** Color assignment have changes */
+	long markerstampt;               /** Page markers moved */
+
+	log_krec *probeking;
+	na_strlistrec *actstrlist;
+	log_kook2 *hook2;
+	log_hwrec *probehwire;
+	log vwrec *probevwire;
+	long actx2;
+	long acty2;
+	na_quadword actq1;
+	na_quadword actq2;
+	char genfunc [17];
+	long runstamp;
+} log_action_t
+
+#endif
diff --git a/log/src/logcom.c b/log/src/logcom.c
index aaeefb7..bb3085d 100644
--- a/log/src/logcom.c
+++ b/log/src/logcom.c
@@ -33,88 +33,30 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 */
 
-
-
 #include <p2c/p2c.h>
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef SYSDEVS_H
 #include <p2c/sysdevs.h>
-#endif
-
-#ifndef RND_H
 #include <p2c/rnd.h>
-#endif
-
-#ifndef MISC_H
 #include <p2c/misc.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-#ifndef FILEPACK_H
 #include <p2c/filepack.h>
-#endif
-
-#ifndef CITINFOMOD_H
 #include <p2c/citinfomod.h>
-#endif
-
-#ifndef IODECLARATIONS_H
 #include <p2c/iodecl.h>
-#endif
-
-#ifndef GENERAL_1_H
 #include <p2c/general_1.h>
-#endif
-
-#ifndef GENERAL_2_H
 #include <p2c/general_2.h>
-#endif
-
-#ifndef GENERAL_3_H
 #include <p2c/general_3.h>
-#endif
-
-#ifndef FS_H
 #include <p2c/fs.h>
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-
 #include "logfont.h"
-
-#ifndef NEWKBD_H
 #include <p2c/newkbd.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef NEWCRT_H
 #include <p2c/newcrt.h>
-#endif
-
-
-#define LOGCOM_G
 #include "logcom.h"
 
 
 #define newci_findprocedure  findprocedure
-extern boolean findprocedure PP((Char *name, Void (**start)()));
+extern int findprocedure (char *name, void (**start)());
 
 #define attr_time       1
 #define attr_tstep      2
@@ -132,7 +74,7 @@ typedef struct _REC_timeinfoarr {
 typedef _REC_timeinfoarr timeinfoarr[timeattrs];
 
 typedef struct timeattrrec {
-  Char *disp, *disp0;
+  char *disp, *disp0;
   short dtype;
   union {
     struct {
@@ -146,26 +88,26 @@ typedef struct timeattrrec {
 
 typedef timeattrrec timeattrarr[timeattrs];
 
-typedef Void (*procarray[256]) PP((log_action *act));
+typedef void (*procarray[256]) (log_action *act);
 
 
 
-Static log_simstatekinds oldoldsimstate, old3simstate;
-Static short timecolor;
-Static boolean timeexists, timechanged, timeinit;
-Static timeattrarr timeattr;
-Static _REC_timeinfoarr *timeinfo;
-Static long oldperftime, perftime, watchtime;
-Static boolean watchflag, drawtime, refrtime;
+static log_simstatekinds oldoldsimstate, old3simstate;
+static short timecolor;
+static int timeexists, timechanged, timeinit;
+static timeattrarr timeattr;
+static _REC_timeinfoarr *timeinfo;
+static long oldperftime, perftime, watchtime;
+static int watchflag, drawtime, refrtime;
 
-Static long numprocs_7;
-Static Void (**procs_7) PP((log_action *act));
-Static log_krec *unfoundkind;
-Static boolean unfoundshown;
+static long numprocs_7;
+static void (**procs_7) (log_action *act);
+static log_krec *unfoundkind;
+static int unfoundshown;
 
 
 
-Void Log_0_proc(act)
+void Log_0_proc(act)
 log_action *act;
 {
   switch (act->action) {
@@ -181,11 +123,7 @@ log_action *act;
   }
 }
 
-
-
-
-
-Static Void edit_1(proc, proclen, sl, mode)
+static void edit_1(proc, proclen, sl, mode)
 uchar *proc;
 long *proclen;
 na_strlist **sl;
@@ -193,12 +131,12 @@ long mode;
 {
   long i;
   na_strlist *l1;
-  Char buf[9];
-  Char ch;
-  Char STR1[22];
-  Char STR2[256];
-  Char STR3[256];
-  Char *TEMP;
+  char buf[9];
+  char ch;
+  char STR1[22];
+  char STR2[256];
+  char STR3[256];
+  char *TEMP;
   long FORLIM;
 
   *buf = '\0';
@@ -254,10 +192,7 @@ long mode;
   proc[strlen(buf)] = '\0';
 }
 
-
-
-
-Void Log_1_proc(act)
+void Log_1_proc(act)
 log_action *act;
 {
   switch (act->action) {
@@ -281,14 +216,13 @@ log_action *act;
 #define ystart          23
 #define yincr           11
 
-
-/* Local variables for Log_7_time: */
+/* variables for Log_7_time: */
 struct LOC_Log_7_time {
   log_action *act;
   short x, y;
 } ;
 
-Local Void displaystate(state, LINK)
+void displaystate(state, LINK)
 log_simstatekinds state;
 struct LOC_Log_7_time *LINK;
 {
@@ -317,11 +251,11 @@ struct LOC_Log_7_time *LINK;
   m_fillrect(LINK->x - 3L, LINK->y - 3L, LINK->x + 3L, LINK->y + 3L);
 }
 
-Local boolean attrsame(i, LINK)
+int attrsame(i, LINK)
 long i;
 struct LOC_Log_7_time *LINK;
 {
-  boolean Result;
+  int Result;
 
   switch (timeattr[i - 1].dtype) {
 
@@ -336,7 +270,7 @@ struct LOC_Log_7_time *LINK;
   return Result;
 }
 
-Local Void touchwatch(g, LINK)
+void touchwatch(g, LINK)
 log_grec *g;
 struct LOC_Log_7_time *LINK;
 {
@@ -353,24 +287,21 @@ struct LOC_Log_7_time *LINK;
   g->vars = (na_long)(((long)g->vars) | 1);
 }
 
-Local Void checkcolors(LINK)
+void checkcolors(LINK)
 struct LOC_Log_7_time *LINK;
 {
   (*LINK->act->hook.getcolor)("TIME", &timecolor, log_dyellow);
 }
 
-
-
-
-Void Log_7_time(act_)
+void Log_7_time(act_)
 log_action *act_;
 {
   struct LOC_Log_7_time V;
   short i, i1, i2, i3;
-  boolean refr, draw;
+  int refr, draw;
   log_action *WITH;
-  Char STR1[256];
-  Char STR2[256], STR3[256];
+  char STR1[256];
+  char STR2[256], STR3[256];
 
   V.act = act_;
   WITH = V.act;
@@ -390,9 +321,9 @@ log_action *act_;
       timeattr[i].UU.U1.i0 = 0.0;
     }
     for (i = 0; i < timeattrs; i++) {
-      timeattr[i].disp = (Char *)Malloc(81);
+      timeattr[i].disp = (char *)Malloc(81);
       *timeattr[i].disp = '\0';
-      timeattr[i].disp0 = (Char *)Malloc(81);
+      timeattr[i].disp0 = (char *)Malloc(81);
       *timeattr[i].disp0 = '\0';
     }
     watchflag = false;
@@ -546,7 +477,7 @@ log_action *act_;
   case act_newgate:
   case act_copygate:
     timeinfo = (_REC_timeinfoarr *)Malloc(sizeof(timeinfoarr));
-    WITH->actgate->info = (Anyptr)timeinfo;
+    WITH->actgate->info = (void *)timeinfo;
     for (i = 0; i < timeattrs; i++)
       timeinfo[i].y = -1;
     timeexists = true;
@@ -592,7 +523,7 @@ log_action *act_;
 
 
 
-Void Log_2_proc(act)
+void Log_2_proc(act)
 log_action *act;
 {
   log_grec *g;
@@ -626,12 +557,12 @@ log_action *act;
 
 
 
-Static Char *proc_name_7(Result, proc)
-Char *Result;
+static char *proc_name_7(Result, proc)
+char *Result;
 uchar *proc;
 {
   long i;
-  Char buf[256];
+  char buf[256];
 
   *buf = '\0';
   i = 2;
@@ -650,7 +581,7 @@ uchar *proc;
 
 
 
-Static Void edit_7(proc, proclen, sl, mode)
+static void edit_7(proc, proclen, sl, mode)
 uchar *proc;
 long *proclen;
 na_strlist **sl;
@@ -658,12 +589,12 @@ long mode;
 {
   long i;
   na_strlist *l1;
-  Char buf[101];
-  Char ch;
-  Char STR1[118];
-  Char STR2[256];
-  Char STR3[256];
-  Char *TEMP;
+  char buf[101];
+  char ch;
+  char STR1[118];
+  char STR2[256];
+  char STR3[256];
+  char *TEMP;
   long FORLIM;
 
   if (proc[0] != '\001') {
@@ -717,7 +648,7 @@ long mode;
 
 
 
-Static Void nullproc(act)
+static void nullproc(act)
 log_action *act;
 {
   if (act->action == act_pass && act->actgate != NULL)
@@ -725,16 +656,16 @@ log_action *act;
 }
 
 
-Void Log_7_proc(act)
+void Log_7_proc(act)
 log_action *act;
 {
   long i;
-  Char buf[256];
+  char buf[256];
   log_grec *g;
-  Void (*myproc) PP((log_action *act));
+  void (*myproc) (log_action *act);
   log_krec *unfound;
   log_action *WITH;
-  Char STR1[42];
+  char STR1[42];
   long FORLIM;
 
   WITH = act;
@@ -744,7 +675,7 @@ log_action *act;
     WITH->acttool->simulator = true;
     WITH->acttool->ready = true;
     WITH->acttool->nostatus = true;
-    procs_7 = (Void(**) PP((log_action *act)))Malloc(sizeof(procarray));
+    procs_7 = (void(**) (log_action *act))Malloc(sizeof(procarray));
     procs_7[0] = nullproc;
     procs_7[1] = nullproc;
     numprocs_7 = 1;
@@ -759,14 +690,14 @@ log_action *act;
   case act_newkind:
     if (WITH->actkind->proc[0] != '\0') {
       proc_name_7(buf, WITH->actkind->proc);
-      if (*buf == '\0' || !newci_findprocedure(buf, (Void(**) PV())(&myproc)))
+      if (*buf == '\0' || !newci_findprocedure(buf, (void(**) ())(&myproc)))
 	myproc = nullproc;
       i = 1;
       while (i <= numprocs_7 && myproc != procs_7[i])
 	i++;
       if (i == 256)
 	i = 1;
-      WITH->actkind->proc[0] = (Char)i;
+      WITH->actkind->proc[0] = (char)i;
       if (i > numprocs_7) {
 	procs_7[i] = myproc;
 	numprocs_7 = i;
@@ -886,10 +817,7 @@ log_action *act;
 }
 
 
-
-
-
-Void Log_17_proc(act)
+void Log_17_proc(act)
 log_action *act;
 {
   switch (act->action) {
@@ -907,13 +835,4 @@ log_action *act;
 }
 
 
-
-
-
-
-
-
-
-
-
 /* End. */
diff --git a/log/src/logcom.h b/log/src/logcom.h
index fb6784b..7f032b8 100644
--- a/log/src/logcom.h
+++ b/log/src/logcom.h
@@ -1,56 +1,24 @@
-/* Header for module logcom, generated by p2c */
 #ifndef LOGCOM_H
 #define LOGCOM_H
 
-
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef NEWKBD_H
 #include <p2c/newkbd.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-#ifndef SYSDEVS_H
 #include <p2c/sysdevs.h>
-#endif
 
-
-#ifdef LOGCOM_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-
-extern Void Log_0_proc PP((log_action *act));
-extern Void Log_1_proc PP((log_action *act));
+extern void Log_0_proc (log_action *act);
+extern void Log_1_proc (log_action *act);
 /*obsolete*/
-extern Void Log_2_proc PP((log_action *act));
-extern Void Log_7_proc PP((log_action *act));
-
-extern Void Log_17_proc PP((log_action *act));
-
+extern void Log_2_proc (log_action *act);
+extern void Log_7_proc (log_action *act);
 
+extern void Log_17_proc (log_action *act);
 
-extern Void Log_7_time PP((log_action *act));
 
+extern void Log_7_time (log_action *act);
 
-#undef vextern
 
 #endif /*LOGCOM_H*/
 
diff --git a/log/src/logcurs_arr.h b/log/src/logcurs_arr.h
index e52b53f..7c26728 100644
--- a/log/src/logcurs_arr.h
+++ b/log/src/logcurs_arr.h
@@ -2,6 +2,7 @@
 #define logcurs_arr_height 16
 #define logcurs_arr_x_hot 0
 #define logcurs_arr_y_hot 0
+
 static char logcurs_arr_bits[] = {
    0x1f, 0x00, 0x03, 0x00, 0x05, 0x00, 0x09, 0x00, 0x11, 0x00, 0x20, 0x00,
    0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
diff --git a/log/src/logcurs_box.h b/log/src/logcurs_box.h
index 7bb3979..76d708b 100644
--- a/log/src/logcurs_box.h
+++ b/log/src/logcurs_box.h
@@ -2,6 +2,7 @@
 #define logcurs_box_height 16
 #define logcurs_box_x_hot 5
 #define logcurs_box_y_hot 5
+
 static char logcurs_box_bits[] = {
    0xff, 0x07, 0x03, 0x06, 0x05, 0x05, 0x89, 0x04, 0x51, 0x04, 0x21, 0x04,
    0x51, 0x04, 0x89, 0x04, 0x05, 0x05, 0x03, 0x06, 0xff, 0x07, 0x00, 0x00,
diff --git a/log/src/logcurs_cpy.h b/log/src/logcurs_cpy.h
index 05d5f6b..7980fc2 100644
--- a/log/src/logcurs_cpy.h
+++ b/log/src/logcurs_cpy.h
@@ -2,6 +2,7 @@
 #define logcurs_cpy_height 16
 #define logcurs_cpy_x_hot 0
 #define logcurs_cpy_y_hot 0
+
 static char logcurs_cpy_bits[] = {
    0x1f, 0x00, 0x03, 0x00, 0x05, 0x00, 0x09, 0x00, 0x11, 0x00, 0x20, 0x00,
    0x40, 0x00, 0x80, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04, 0x00, 0x08,
diff --git a/log/src/logcurs_del.h b/log/src/logcurs_del.h
index 9c079db..5c24ece 100644
--- a/log/src/logcurs_del.h
+++ b/log/src/logcurs_del.h
@@ -2,6 +2,7 @@
 #define logcurs_del_height 32
 #define logcurs_del_x_hot 9
 #define logcurs_del_y_hot 9
+
 static char logcurs_del_bits[] = {
    0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00,
    0x20, 0x01, 0x00, 0x00, 0x46, 0x01, 0x00, 0x00, 0x8a, 0x02, 0x00, 0x00,
diff --git a/log/src/logcurs_prb.h b/log/src/logcurs_prb.h
index d3c250f..c1ada4f 100644
--- a/log/src/logcurs_prb.h
+++ b/log/src/logcurs_prb.h
@@ -2,6 +2,7 @@
 #define logcurs_prb_height 16
 #define logcurs_prb_x_hot 0
 #define logcurs_prb_y_hot 0
+
 static char logcurs_prb_bits[] = {
    0x01, 0x00, 0x06, 0x00, 0x1e, 0x00, 0x0c, 0x00, 0x14, 0x00, 0x20, 0x00,
    0x40, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
diff --git a/log/src/logdef.c b/log/src/logdef.c
index c4992cd..719438f 100644
--- a/log/src/logdef.c
+++ b/log/src/logdef.c
@@ -1,7 +1,3 @@
-/* Output from p2c, the Pascal-to-C translator */
-/* From input file "logdef.text" */
-
-
 /* "LOG", the circuit editing and simulation system,
    "DigLOG", the digital simulator for LOG.
    Copyright (C) 1985, 1990 David Gillespie.
@@ -35,7 +31,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 */
 
 
-
 #include <p2c/p2c.h>
 
 
@@ -43,45 +38,40 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 #include "logdef.h"
 
 
-Const log_rottab log_rotxx = {
+const log_rottab log_rotxx = {
   1, 0, -1, 0, -1, 0, 1, 0
 };
 
-Const log_rottab log_rotxy = {
+const log_rottab log_rotxy = {
   0, -1, 0, 1, 0, 1, 0, -1
 };
 
-Const log_rottab log_rotyx = {
+const log_rottab log_rotyx = {
   0, 1, 0, -1, 0, 1, 0, -1
 };
 
-Const log_rottab log_rotyy = {
+const log_rottab log_rotyy = {
   1, 0, -1, 0, 1, 0, -1, 0
 };
 
-Const log_rottab log_irotxx = {
+const log_rottab log_irotxx = {
   1, 0, -1, 0, -1, 0, 1, 0
 };
 
-Const log_rottab log_irotxy = {
+const log_rottab log_irotxy = {
   0, 1, 0, -1, 0, -1, 0, 1
 };
 
-Const log_rottab log_irotyx = {
+const log_rottab log_irotyx = {
   0, -1, 0, 1, 0, -1, 0, 1
 };
 
-Const log_rottab log_irotyy = {
+const log_rottab log_irotyy = {
   1, 0, -1, 0, 1, 0, -1, 0
 };
 
-Const log_zoomtab zoomscales = {
+const log_zoomtab zoomscales = {
   2, 3, 5, 8, 12
 };
 
-
-
-
-
-
 /* End. */
diff --git a/log/src/logdef.h b/log/src/logdef.h
index 1701eec..ca53338 100644
--- a/log/src/logdef.h
+++ b/log/src/logdef.h
@@ -1,19 +1,10 @@
-
-
-/* Header for module logdef, generated by p2c */
-/*  5.66  */
 #ifndef LOGDEF_H
 #define LOGDEF_H
 
 
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
+#include "log_action.h"
 
 #ifdef LOGDEF_G
 # define vextern
@@ -76,36 +67,20 @@
 typedef short log_zoomtab[5];
 typedef short log_rottab[8];
 
-/* workaround for bug in OS2 icc compiler */
-
-#ifdef OS2
-#ifndef LOGDEF_G
-vextern Const log_rottab log_rotxx;
-vextern Const log_rottab log_rotxy;
-vextern Const log_rottab log_rotyx;
-vextern Const log_rottab log_rotyy;
-vextern Const log_rottab log_irotxx;
-vextern Const log_rottab log_irotxy;
-vextern Const log_rottab log_irotyx;
-vextern Const log_rottab log_irotyy;
-vextern Const log_zoomtab zoomscales;
-#endif
-#else
-vextern Const log_rottab log_rotxx;
-vextern Const log_rottab log_rotxy;
-vextern Const log_rottab log_rotyx;
-vextern Const log_rottab log_rotyy;
-vextern Const log_rottab log_irotxx;
-vextern Const log_rottab log_irotxy;
-vextern Const log_rottab log_irotyx;
-vextern Const log_rottab log_irotyy;
-vextern Const log_zoomtab zoomscales;
-#endif
+vextern const log_rottab log_rotxx;
+vextern const log_rottab log_rotxy;
+vextern const log_rottab log_rotyx;
+vextern const log_rottab log_rotyy;
+vextern const log_rottab log_irotxx;
+vextern const log_rottab log_irotxy;
+vextern const log_rottab log_irotyx;
+vextern const log_rottab log_irotyy;
+vextern const log_zoomtab zoomscales;
 
-typedef Anyptr log_long;
+typedef void *log_long;
 
-typedef Char log_pac4[4];
-typedef Char log_pac8[8];
+typedef char log_pac4[4];
+typedef char log_pac8[8];
 
 typedef uchar log_procarray[log_million];
 typedef uchar log_uchararray[log_million + 1];
@@ -132,7 +107,7 @@ typedef union log_kflags {
 } log_kflags;
 
 typedef struct log_vectorrec {
-  Char vkind;
+  char vkind;
   schar numcoords, x1, y1;
   union {
     struct {
@@ -143,7 +118,7 @@ typedef struct log_vectorrec {
     } U98;
     struct {
       uchar tsize, torg;
-      Char *sp;
+      char *sp;
     } U116;
   } UU;
 } log_vectorrec;
@@ -174,13 +149,13 @@ typedef struct log_kattrrec {
   union {
     struct {
       double r;
-      Char u[4];
+      char u[4];
     } U82;
     struct {
       long i1, i2;
     } U73;
-    Char *c;
-    Char *sp;
+    char *c;
+    char *sp;
 #ifdef mips
     unsigned b;
 #else
@@ -205,8 +180,8 @@ typedef struct log_gattrrec {
     struct {
       long i1, i2;
     } U73;
-    Char *c;
-    Char *sp;
+    char *c;
+    char *sp;
 #ifdef mips
     unsigned b;
 #else
@@ -238,7 +213,7 @@ typedef struct log_krec {
   uchar *proc;
   log_kattrrec *attr;
   struct log_tool *simtype;
-  Char name[9];
+  char name[9];
   uchar group;
   short dummy1, dummy2, numvects, numpins, numpnums, numattrs;
   log_kflags flag;
@@ -277,7 +252,7 @@ typedef struct log_nrec {
 } log_nrec;   /* Node */
 
 typedef struct log_sigrec {
-  Char *name;
+  char *name;
   unsigned f : 1, keep : 1, f5 : 1, f4 : 1, f3 : 1, f2 : 1, f1 : 1, f0 : 1;
   na_long temp;
   log_nrec *np;   /* Node value */
@@ -288,7 +263,7 @@ typedef log_sigrec log_sigrecs[log_million];
 typedef struct log_htrec {
   struct log_htrec *next;
   double time;
-  Anyptr val[log_million];   /*NEWFP shortreals*/
+  void *val[log_million];   /*NEWFP shortreals*/
 } log_htrec;   /* History timestep */
 
 typedef struct log_hnrec {
@@ -341,7 +316,7 @@ typedef struct log_grec {
 
 typedef struct log_lrec {
   short x, y, w;
-  Char name[log_lablen + 1];
+  char name[log_lablen + 1];
   unsigned f7 : 1, f6 : 1, f5 : 1, f4 : 1, f3 : 1, f2 : 1, f1 : 1, f0 : 1;
   struct log_lrec *next;
   na_long temp;
@@ -359,7 +334,7 @@ typedef struct log_regrec {
   long regstamp;
   na_long info;
   struct log_regrec *next;
-  boolean f7, f6, f5, f4, f3, f2, f1, f0;
+  int f7, f6, f5, f4, f3, f2, f1, f0;
 } log_regrec;   /* Sensitive region */
 
 
@@ -367,157 +342,6 @@ typedef enum {
   simst_null, simst_off, simst_notactive, simst_notready, simst_running
 } log_simstatekinds;
 
-typedef enum {
-  act_init, act_endinit, act_exit, act_clearmsg, act_status, act_cnf,
-  act_immed, act_func, act_color, act_select, act_clear, act_edit, act_pass,
-  act_tstep, act_erasegate, act_touchgate, act_history, act_histval,
-  act_histstr, act_trigger, act_glowcol, act_newgate, act_disposegate,
-  act_copygate, act_writegate, act_readgate, act_connectgate,
-  act_disconnectgate, act_configgate, act_configchgate, act_configrelgate,
-  act_confignode, act_configchnode, act_configrelnode, act_confighist,
-  act_configchhist, act_configrelhist, act_newkind, act_disposekind,
-  act_newnode, act_disposenode, act_copynode, act_combinenodes,
-  act_combineintonode, act_writenode, act_readnode, act_refnodes, act_nodeval,
-  act_general, act_gennode, act_genkind, act_gengate
-/* p2c: logdef.text, line 709: 
- * Note: Line breaker spent 2.0 seconds, 5000 tries on line 356 [251] */
-} log_actionkinds;
-
-typedef struct log_hooks {
-  Void (*hidecursor) PV();
-  Void (*hidecursorrect) PP((long x1, long y1, long x2, long y2));
-  Void (*unhidecursor) PV();
-  Void (*nodeconflict) PP((log_nrec *n));
-  Void (*gateconflict) PP((log_grec *g));
-  Void (*clearconflicts) PP((struct log_tool *tool));
-  Void (*setdimgate) PP((log_grec *g, int dim));
-  Void (*xform) PP((log_grec *g, short *x, short *y));
-  Void (*getsig) PP((Char *name, log_sigrec **sig));
-  Void (*report) PP((int num, Char *name));
-  Void (*alert) PV();
-  Void (*warning) PV();
-  Void (*working) PV();
-  Void (*message) PP((Char *msg));
-  Void (*vmessage) PP((Char *msg));
-  Void (*vmessageflag) PP((Char *msg, int b));
-  Void (*trace) PP((Char *msg));
-  Void (*dump) PP((Char *msg));
-  Void (*setdump) PP((Char *name));
-  Void (*closefiles) PV();
-  Void (*clearalpha) PV();
-  Void (*drawstr) PP((int x, int y, Char *s));
-  Void (*rightstr) PP((int x, int y, Char *s));
-  Void (*centerstr) PP((int x, int y, Char *s));
-  Void (*clip) PV();
-  Void (*remcursor) PV();
-  Void (*clearscreen) PV();
-  Void (*setmode) PP((Char *s));
-  Void (*getword) PP((Char *buf, Char *wrd));
-  Void (*getint) PP((Char *buf, long *i, long def));
-  Void (*getreal) PP((Char *buf, double *r, double def));
-  Void (*getbool) PP((Char *buf, boolean *b));
-  Void (*pen) PV();
-  Void (*pass) PV();
-  Void (*trykbd) PV();
-  Void (*scroll) PV();
-  Void (*trykbdscroll) PV();
-  Void (*inkey) PP((Char *ch));
-  Void (*udrawgate) PP((int x, int y, int g, int c));
-  Void (*gdrawgate) PP((int x, int y, int g, int c));
-  Void (*drawgate) PP((log_grec *g));
-  Void (*erasegate) PP((log_grec *g));
-  Void (*drawnode) PP((log_nrec *n, int c));
-  Void (*refresh) PV();   /*quietly refresh drawing area*/
-  Void (*refreshsoon) PV();
-  Void (*beginbottom) PV();
-  Void (*endbottom) PV();
-  Void (*beginerror) PV();
-  Void (*enderror) PV();
-  Void (*redraw) PV();   /*redraw drawing area*/
-  Void (*redrawscreen) PV();   /*redraw entire screen*/
-  Void (*change) PP((int pg));
-  Void (*newgate) PP((log_grec **g, int gt));
-  Void (*copygate) PP((log_grec *old, log_grec **g));
-  Void (*disposegate) PP((log_grec **g));
-  Void (*newnode) PP((log_nrec **n, int st));
-  Void (*copynode) PP((log_nrec *old, log_nrec **n));
-  Void (*disposenode) PP((log_nrec **n));
-  Void (*switchnode) PP((log_nrec **n, log_nrec *n2));
-  Void (*dumpnodes) PV();
-  Void (*readlnpass) PP((Char *s, int mode));
-  Void (*clearfunc) PV();
-  Void (*refrfunc) PV();
-  Void (*assertfunc) PP((Char *name));
-  Void (*findobject) PP((int x, int y));
-  Void (*findwire) PP((int x, int y));
-  Void (*deletehw) PP((log_hwrec *hw));
-  Void (*deletevw) PP((log_vwrec *vw));
-  Void (*disconnectgate) PP((log_grec *g));
-  Void (*deletegate) PP((log_grec *g));
-  Void (*addhw) PP((int x1, int x2, int y));
-  Void (*addvw) PP((int x, int y1, int y2));
-  Void (*connectgate) PP((log_grec *g, boolean *success));
-  Void (*waitnear) PV();
-  Void (*addgate) PP((int x, int y, int gtype));
-  Void (*uaddgate) PP((int x, int y, int gtype));
-  Void (*getgate) PP((Char *name, short *gtype));
-  Void (*realunit) PP((double r, int p, Char *u, Char *s));
-  Void (*realunit2) PP((double r, int p, Char *u, Char *s));
-  Void (*addlabel) PP((log_lrec **l, Char *s));
-  Void (*getcolor) PP((Char *name, short *val, int def));
-  Void (*setcmap) PP((int n, int r, int g, int b));
-  Void (*parselabel)
-       PP((na_strlistrec **lbl, short *numattrs, log_kattrrec **attr));
-  Void (*editattrs)
-       PP((log_gattrrec *gattr, int numattrs, log_kattrrec *kattr,
-	   na_strlistrec *lbl, Char *name, Void (*proc) PV(),
-	   Void (*chproc) PV(), Void (*relproc) PV()));
-  Void (*newattrs)
-       PP((log_gattrrec **gattr, int numattrs, log_kattrrec *kattr));
-  Void (*disposeattrs)
-       PP((log_gattrrec **gattr, int numattrs, log_kattrrec *kattr));
-  Void (*copyattrs) PP((log_gattrrec **gattr, log_gattrrec *oldattr,
-			int numattrs, log_kattrrec *kattr));
-  Void (*initscreen) PV();
-  Void (*clearshowalpha) PV();
-  Void (*setupregion) PP((log_regrec **r, int pagenum));
-  Void (*stamp) PP((long *i));
-  Void (*noclip) PV();
-} log_hooks;
-
-typedef struct log_hook2 {
-  Void (*getnodeval) PP((log_nrec *n, double *val, Char *opts));
-  Void (*solderat) PP((int x, int y));
-  Void (*unsolderwires) PP((log_hwrec *hw, log_vwrec *vw));
-  Void (*settofrom) PP((log_grec **g, Char *name));
-  Void (*findattrnum) PP((log_krec *k, Char *name, Char *kinds, short *num));
-  Void (*findattrname) PP((log_krec *k, int num, Char *name));
-  Void (*findpinnum) PP((log_krec *k, Char *name, short *num));
-  Void (*findpinname) PP((log_krec *k, int num, Char *name));
-  Void (*setgattr) PP((log_grec *g, int num, Char *value));
-  Void (*setnattr) PP((log_nrec *n, int num, Char *value));
-  Void (*findpointmarker) PP((log_krec *k, int num, short *x, short *y));
-  Void (*findboxmarker)
-       PP((log_krec *k, int num, short *x1, short *y1, short *x2, short *y2));
-  Void (*send_general) PP((struct log_tool *sim, Char *act));
-  Void (*send_gennode) PP((log_nrec *n, Char *act));
-  Void (*send_genkind) PP((log_krec *k, Char *act));
-  Void (*send_gengate) PP((log_grec *g, Char *act));
-  Void (*send_all) PP((Char *act));
-  Void (*send_allnodes) PP((Char *act));
-  Void (*send_allkinds) PP((Char *act));
-  Void (*send_allgates) PP((Char *act));
-  Void (*addlabelat) PP((int x, int y, Char *s));
-  Void (*addboxat) PP((int x1, int y1, int x2, int y2));
-  Void (*plainxform) PP((log_grec *g, short *x, short *y));
-  Void (*findattrnum2) PP((int numattrs, log_kattrrec *kattr,
-			   na_strlistrec *lbl, Char *name, Char *kinds,
-			   short *num));
-  Void (*findattrname2) PP((int numattrs, log_kattrrec *kattr,
-			    na_strlistrec *lbl, int num, Char *name));
-  Void (*showpinname) PP((log_grec *g, int i, int c, Char *name));
-} log_hook2;
-
 typedef struct log_colorrec {
   short backgr, cursor, gate, dimgate, kindgate, catgate, gatepin, pinnum;
   short wire[log_wcol_blue - log_wcol_normal + 1];
@@ -527,138 +351,11 @@ typedef struct log_colorrec {
 	popupsel, redword, blueword, vlsicut;
 } log_colorrec;
 
-typedef struct log_action {
-  log_actionkinds action;
-  log_krec *actkind;
-  log_grec *actgate, *actgate2;
-  log_nrec *actnode, *actnode2;
-  long actx, acty;
-  boolean actflag, actflag2;
-  FILE **actfile;
-  struct log_tool *acttool;
-  Char *actstr;
-  double actval, actval2, actval3;
-  log_gattrrec *actgattr;
-  log_kattrrec *actkattr;
-  uchar *actproc;
-
-  boolean pagechanged[log_maxpages];
-  log_grec *gbase[log_maxpages];
-  log_srec *sbase[log_maxpages];
-  log_hwrec *hwbase[log_maxpages];
-  log_vwrec *vwbase[log_maxpages];
-  log_lrec *lbase[log_maxpages];
-  log_brec *bbase[log_maxpages];
-  log_nrec *nbase;
-
-  log_sigrec *signaltab;
-  short maxsignal, lastsignal;
-
-  long numpages;   /* number of pages */
-  long curpage;   /* current page number */
-  long showpage;   /* currently displayed page number */
-
-  short scale, hscale;
-  long xoff, yoff;   /* screen_x := grid_x * scale - xoff */
-
-  Char func[17];
-  Char *funcarg;
-
-  log_grec *neargate;
-  log_lrec *nearlabel;
-  log_brec *nearbox;
-  log_hwrec *nearhw, *movinghw;
-  log_vwrec *nearvw, *movingvw;
-
-  log_nrec *probenode;
-  log_grec *probegate;
-  short probepin;
-  struct log_tool *probesimtype;
-  short baselinecolor;
-
-  log_hnrec *hnbase;
-  log_htrec *htbase, *htlast;
-
-  long fastspeed, fastmin, fastmax, fastrate;
-
-  long singlestepcount;
-
-  double time, prevtimestep;
-
-  log_simstatekinds simstate, oldsimstate;
-  struct log_tool *simstatetool, *oldsimstatetool;
-
-  boolean histactive;   /* Scope mode is triggered */
-  boolean dumpopen;   /* Dump output file is open */
-  boolean traceopen;   /* Trace output file is open */
-  boolean verbose;   /* Commands acknowledge with messages */
-  boolean traceflag;   /* Debugging/trace mode on */
-  boolean quiet;   /* Suppress sound signals */
-  boolean glowmode;   /* Glowing-wires mode */
-  boolean probemode;   /* Probe-cursor mode */
-  boolean markers;   /* printing markers are defined */
-  boolean invisible;   /* gates and wires are invisible */
-  boolean textinvisible;   /* labels and boxes are invisible */
-  boolean pnuminvisible;   /* pin numbers are invisible */
-  boolean dotsvisible;   /* are "red dots" on or off normally? */
-  boolean showconflicts;   /* show only conflicts */
-  boolean resetflag;   /* "Reset" command has been given */
-  boolean pwrflag;   /* simulator is turned on */
-  boolean initdone;   /* done with program initialization */
-  boolean refrflag;   /* refreshing all displays */
-
-  boolean busyflag;   /* flag for idling simulations */
-
-  short markerx1, markery1, markerx2, markery2;
-
-  m_tablet_info t, t0;
-  boolean startpoint, stillnear, incircuit;
-  short gridx, gridy, posx, posy, oldx, oldy, cx_min, cy_min, cx_max, cy_max;
-      /* area covered by cursor */
-
-  FILE **dumpfile, **tracefile;
-
-  long rndseed;   /* Seed for RAND function */
-
-  Char *homedirname;
-
-  enum {
-    log_host_log, log_host_loged, log_host_3, log_host_4
-  } host;
-  struct log_tool *toolbase;
-  log_hooks hook;
-  log_colorrec color;
-
-  long curstamp, labelstamp;   /* Changes to labels */
-  long boxstamp;   /* Changes to boxes */
-  long msgstamp;   /* Clearing messages from screen */
-  long refrstamp;   /* Clearing graphics screen */
-  long nattrstamp;   /* Changes to node attributes */
-  long gattrstamp;   /* Changes to gate attributes */
-  long sigstamp;   /* Changes to signal table */
-  long loadstamp;   /* A page was loaded */
-  long pagestamp[log_maxpages];
-  long colorstamp;   /* Color assignments have changed */
-  long resetstamp;   /* Simulation has been reset */
-  log_regrec *pageregions[log_maxpages];
-  long markerstamp;   /* Page markers moved */
-
-  log_krec *probekind;
-  na_strlistrec *actstrlist;
-  log_hook2 *hook2;
-  log_hwrec *probehwire;
-  log_vwrec *probevwire;
-  long actx2, acty2;
-  na_quadword actq1, actq2;
-  Char genfunc[17];
-  long runstamp;
-} log_action;
-
 typedef struct log_tool {
-  Char name[17];
-  Void (*proc) PP((log_action *act));
-  Char *fname, *comment;
-  Char *shortname;
+  char name[17];
+  void (*proc) (log_action *act);
+  char *fname, *comment;
+  char *shortname;
   unsigned ready : 1, simulator : 1, keep : 1, nostatus : 1, tstepflag : 1;
   uchar simtype;
   double nexttstep;
diff --git a/log/src/logdig.c b/log/src/logdig.c
index 01614f2..b5314dd 100644
--- a/log/src/logdig.c
+++ b/log/src/logdig.c
@@ -43,19 +43,19 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 #include "logdig.h"
 
 
-Const log_16_viarr log_16_vi = {
+const log_16_viarr log_16_vi = {
   0, 1, 3
 };
 
-Const log_16_ivarr log_16_iv = {
+const log_16_ivarr log_16_iv = {
   log_none, log_zero, log_one, log_one
 };
 
-Const log_16_vbarr log_16_vb = {
+const log_16_vbarr log_16_vb = {
   false, false, true
 };
 
-Const log_16_bvarr log_16_bv = {
+const log_16_bvarr log_16_bv = {
   log_zero, log_one
 };
 
diff --git a/log/src/logdig.h b/log/src/logdig.h
index 93c26e7..2719af4 100644
--- a/log/src/logdig.h
+++ b/log/src/logdig.h
@@ -1,17 +1,8 @@
-/* Header for module logdig, generated by p2c */
 #ifndef LOGDIG_H
 #define LOGDIG_H
 
-
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
 
 #ifdef LOGDIG_G
 # define vextern
@@ -29,12 +20,12 @@ typedef enum {
 } log_16_value;
 typedef short log_16_viarr[(long)log_one - (long)log_none + 1];
 typedef log_16_value log_16_ivarr[4];
-typedef boolean log_16_vbarr[(long)log_one - (long)log_none + 1];
+typedef int log_16_vbarr[(long)log_one - (long)log_none + 1];
 typedef log_16_value log_16_bvarr[2 - false];
 
 typedef struct log_16_kindinfo {
   na_long info;
-  Char internally_defined_stuff;
+  char internally_defined_stuff;
 } log_16_kindinfo;
 
 typedef enum {
@@ -49,27 +40,18 @@ typedef enum {
 typedef struct log_16_action {
   log_16_actionkinds action;
   log_action *lact;
-  Void (*hook_input) PP((log_action *lact, log_nrec *n, log_16_value *v));
-  Void (*hook_output) PP((log_action *lact, log_nrec *n, log_16_value v));
-  Void (*hook_ocoutput) PP((log_action *lact, log_nrec *n, log_16_value v));
-  Void (*hook_led) PP((log_action *lact, int x, int y, log_16_value v));
-  Void (*hook_eraled) PP((log_action *lact, int x, int y));
-  Void (*hook_plotled) PP((log_action *lact, int x, int y, log_16_value v));
+  void (*hook_input) (log_action *lact, log_nrec *n, log_16_value *v);
+  void (*hook_output) (log_action *lact, log_nrec *n, log_16_value v);
+  void (*hook_ocoutput) (log_action *lact, log_nrec *n, log_16_value v);
+  void (*hook_led) (log_action *lact, int x, int y, log_16_value v);
+  void (*hook_eraled) (log_action *lact, int x, int y);
+  void (*hook_plotled) (log_action *lact, int x, int y, log_16_value v);
 } log_16_action;
 
-#if OS2
-#ifndef LOGDIG_G
-vextern Const log_16_viarr log_16_vi;
-vextern Const log_16_ivarr log_16_iv;
-vextern Const log_16_vbarr log_16_vb;
-vextern Const log_16_bvarr log_16_bv;
-#endif
-#else
-vextern Const log_16_viarr log_16_vi;
-vextern Const log_16_ivarr log_16_iv;
-vextern Const log_16_vbarr log_16_vb;
-vextern Const log_16_bvarr log_16_bv;
-#endif
+vextern const log_16_viarr log_16_vi;
+vextern const log_16_ivarr log_16_iv;
+vextern const log_16_vbarr log_16_vb;
+vextern const log_16_bvarr log_16_bv;
 
 #undef vextern
 
diff --git a/log/src/loged.c b/log/src/loged.c
index e06336d..d108899 100644
--- a/log/src/loged.c
+++ b/log/src/loged.c
@@ -45,14 +45,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 */
 
-
-
-
-#ifndef OS2
 #include <unistd.h>
-#endif
-
-
 #include <p2c/p2c.h>
 
 
@@ -105,7 +98,7 @@ char *my_strdup(char *);
 #undef strdup
 #define strdup my_strdup
 #define newci_findprocedure2 findprocedure
-extern boolean findprocedure PP((Char *name, Void (**start)()));
+extern boolean findprocedure PP((Char *name, void (**start)()));
 extern short getshortsw(char *);
 
 
@@ -137,7 +130,7 @@ extern short getshortsw(char *);
 
 
 /* horizontal positions of menu components */
-Static short msg_name, msg_veckindmenu, msg_veckindname,
+static short msg_name, msg_veckindmenu, msg_veckindname,
              msg_color, msg_torg, msg_end;
 
 /*-32768..32767*/
@@ -514,44 +507,44 @@ typedef struct krec {
 
 
 
-Static short msgwidth = 256;
-Static short msgheight = 25;
-Static short numspc = 12;
-Static short defgridspc = 6;
-Static short defmargin = 20;
-Static short numright = 30;
-Static uchar torgkind = 4;            /* default = center,center */
-Static boolean show_preview = false;    /* toggle: false=grid, true=small */
+static short msgwidth = 256;
+static short msgheight = 25;
+static short numspc = 12;
+static short defgridspc = 6;
+static short defmargin = 20;
+static short numright = 30;
+static uchar torgkind = 4;            /* default = center,center */
+static boolean show_preview = false;    /* toggle: false=grid, true=small */
 
-Static m_chpicrec *chair;
-Static m_tablet_info pen;
+static m_chpicrec *chair;
+static m_tablet_info pen;
 
-Static long scrwidth, scrheight, chx, chy, esc, iores;
+static long scrwidth, scrheight, chx, chy, esc, iores;
 
-Static long helpdsc;
+static long helpdsc;
 
 
-Static short defgridspc, gridspc, gridleft, gridx, gridright, gridy, gridbot;
-Static short smallx, smally, smallxmin, smallxmax, smallymin, smallymax;
-Static short msgx, msgy;
-Static long firstpin, scrpins;
-Static short gridxmin, gridxmax, gridymin, gridymax, gridmax, gridscale;
-Static short gridtop, gridlimit;
-Static long colortrans[7];
+static short defgridspc, gridspc, gridleft, gridx, gridright, gridy, gridbot;
+static short smallx, smally, smallxmin, smallxmax, smallymin, smallymax;
+static short msgx, msgy;
+static long firstpin, scrpins;
+static short gridxmin, gridxmax, gridymin, gridymax, gridmax, gridscale;
+static short gridtop, gridlimit;
+static long colortrans[7];
 
-Static log_action gg;
-Static krec kind, *kbase, *curkind, *shadowkind;
-Static long newsimtype;
-Static Char veckind;
-Static long curcolor, regionstyle;
-Static Char command[256], argument[256], filename[256];
-Static boolean onescreen, fullcolor;   /*updated 7/12/88*/
-Static boolean firsttime, menuflag, refrkind, needrefr, firsthelp,
+static log_action gg;
+static krec kind, *kbase, *curkind, *shadowkind;
+static long newsimtype;
+static Char veckind;
+static long curcolor, regionstyle;
+static Char command[256], argument[256], filename[256];
+static boolean onescreen, fullcolor;   /*updated 7/12/88*/
+static boolean firsttime, menuflag, refrkind, needrefr, firsthelp,
 	       savedflag, errorflag, exitflag;
-Static pnumrec pn;
+static pnumrec pn;
 
 
-Static Void writedesc(rec,d)
+static void writedesc(rec,d)
    char *rec;
    descrec *d;
    {
@@ -585,7 +578,7 @@ Static Void writedesc(rec,d)
        rec[15] = d->yy2;
    }
 
-   Local descrec *readdesc(rec)
+   static descrec *readdesc(rec)
    char *rec;
    {
        unsigned short i,j1,j2,s1,s2;
@@ -613,7 +606,7 @@ Static Void writedesc(rec,d)
        return &d;
    }
 
-   Local pnumrec readpnum(rec)
+   static pnumrec readpnum(rec)
    char *rec;
    {
        static pnumrec p;
@@ -628,7 +621,7 @@ Static Void writedesc(rec,d)
 
 
 
-Static Void docolors(lo, hi)
+static void docolors(lo, hi)
 long lo, hi;
 {
   m_setcolor((long)black, 0L, 0L, 0L);
@@ -647,7 +640,7 @@ long lo, hi;
 }
 
 
-Static Void dim()
+static void dim()
 {
 #if 0
   if (onescreen)
@@ -658,7 +651,7 @@ Static Void dim()
 }
 
 
-Static Void bright()
+static void bright()
 {
   if (nc_gType() == nc_g300)   /*bobcat monitors aren't as bright*/
     docolors(11L, 15L);
@@ -668,7 +661,7 @@ Static Void bright()
 
 
 
-Static Void setscale(sc)
+static void setscale(sc)
 long sc;
 {
 short w,h;
@@ -721,7 +714,7 @@ short stepsiz = m_across / 3L - 40;
 
 
 
-Static Void initscreen()
+static void initscreen()
 {
   m_init_graphics();
   m_upside_down();
@@ -756,7 +749,7 @@ Static Void initscreen()
 }
 
 
-Static boolean comparestr(s_, t_)
+static boolean comparestr(s_, t_)
 Char *s_, *t_;
 {
   Char s[256], t[256];
@@ -770,7 +763,7 @@ Char *s_, *t_;
 }
 
 
-Static boolean comparegroup(gn, g)
+static boolean comparegroup(gn, g)
 short gn;
 Char *g;
 {
@@ -781,7 +774,7 @@ Char *g;
 }
 
 
-Static Void wildcards(s, g, verify)
+static void wildcards(s, g, verify)
 Char *s, *g;
 boolean *verify;
 {
@@ -834,7 +827,7 @@ boolean *verify;
 
 
 
-Static Char readyn(s)
+static Char readyn(s)
 Char *s;
 {
   Char ch;
@@ -848,7 +841,7 @@ Char *s;
 
 
 
-Static Void crosshair(x, y)
+static void crosshair(x, y)
 short x, y;
 {
   if (x == chx && y == chy)
@@ -865,13 +858,13 @@ short x, y;
 }
 
 
-Static Void nocrosshair()
+static void nocrosshair()
 {
   crosshair(-10, -10);
 }
 
 
-Static Void drawnum(x, y, n)
+static void drawnum(x, y, n)
 short x, y, n;
 {
   Char STR1[256];
@@ -881,7 +874,7 @@ short x, y, n;
 }
 
 
-Static Void drawnum2(x, y, n)
+static void drawnum2(x, y, n)
 short x, y, n;
 {
   Char STR1[256];
@@ -891,7 +884,7 @@ short x, y, n;
 }
 
 
-Static Void drawnum3(x, y, n)
+static void drawnum3(x, y, n)
 short x, y, n;
 {
   Char STR1[256];
@@ -901,7 +894,7 @@ short x, y, n;
 }
 
 
-Static Void erase(x1, y1, x2, y2)
+static void erase(x1, y1, x2, y2)
 short x1, y1, x2, y2;
 {
   m_color((long)black);
@@ -909,7 +902,7 @@ short x1, y1, x2, y2;
 }
 
 
-Static Void diamond(x, y)
+static void diamond(x, y)
 short x, y;
 {
   m_move(x - 3L, (long)y);
@@ -925,7 +918,7 @@ short x, y;
 /*$ if debugloged $ $ debug $ $ end $*/
 
 
-Static Void growkind(k)
+static void growkind(k)
 krec *k;
 {
   long i, FORLIM;
@@ -994,7 +987,7 @@ krec *k;
 
 
 
-Static Void autoscale(sc)
+static void autoscale(sc)
 long sc;
 {
   setscale(sc);
@@ -1007,7 +1000,7 @@ long sc;
 
 
 
-Static boolean before(n1, n2)
+static boolean before(n1, n2)
 Char *n1, *n2;
 {
   long i, j;
@@ -1033,7 +1026,7 @@ Char *n1, *n2;
 
 
 
-Static boolean addkind(n_)
+static boolean addkind(n_)
 Char *n_;
 {
   boolean Result;
@@ -1072,7 +1065,7 @@ Char *n_;
 }
 
 
-Static Void reallocproc(k, len)
+static void reallocproc(k, len)
 krec *k;
 long len;
 {
@@ -1099,7 +1092,7 @@ long len;
 }
 
 
-Static Void realloclbl(k, len)
+static void realloclbl(k, len)
 krec *k;
 long len;
 {
@@ -1126,7 +1119,7 @@ long len;
 }
 
 
-Static Void reallocvects(k, len)
+static void reallocvects(k, len)
 krec *k;
 long len;
 {
@@ -1155,7 +1148,7 @@ long len;
 
 
 
-Static Void flushcurkind()
+static void flushcurkind()
 {
   if (curkind != NULL) {
     kind.next = curkind->next;
@@ -1164,7 +1157,7 @@ Static Void flushcurkind()
 }
 
 
-Static Void makekind(n)
+static void makekind(n)
 Char *n;
 {
   flushcurkind();
@@ -1194,7 +1187,7 @@ Char *n;
 }
 
 
-Static Void wrmsg(s)
+static void wrmsg(s)
 Char *s;
 {
   nc_gotoXY(0, (int)(scrheight - 5));
@@ -1204,7 +1197,7 @@ Char *s;
 }
 
 
-Static long compress(i)
+static long compress(i)
 long i;
 {
   long j, k;
@@ -1226,7 +1219,7 @@ long i;
 }
 
 
-Static long uncompress(i)
+static long uncompress(i)
 long i;
 {
   if (i < 0)
@@ -1246,7 +1239,7 @@ struct LOC_wshapes {
   FILEBUFNC(f,filerec);
 } ;
 
-Local Void writeint(LINK)
+static void writeint(LINK)
 struct LOC_wshapes *LINK;
 {
   if (LINK->p != 64)
@@ -1256,7 +1249,7 @@ struct LOC_wshapes *LINK;
   LINK->p = 0;
 }
 
-Local Void writechar(val, LINK)
+static void writechar(val, LINK)
 long val;
 struct LOC_wshapes *LINK;
 {
@@ -1280,7 +1273,7 @@ struct LOC_wshapes *LINK;
 
 
 
-Static Void wshapes(s_)
+static void wshapes(s_)
 Char *s_;
 {
   struct LOC_wshapes V;
@@ -1310,17 +1303,9 @@ Char *s_;
 	    s1[i] = 'o';
 	    s1[i + 1] = 'g';
 	    if (V.f != NULL)
-#ifndef OS2
 	      V.f = freopen(s, "r", V.f);
-#else
-	      V.f = freopen(s, "rb", V.f);
-#endif
 	    else
-#ifndef OS2
 	      V.f = fopen(s, "r");
-#else
-	      V.f = fopen(s, "rb");
-#endif
 	    if (V.f == NULL) {
 	      P_escapecode = -10;
 	      P_ioresult = FileNotFound;
@@ -1347,23 +1332,11 @@ Char *s_;
 	  ENDTRY(try4);
 	}
 	if (V.f != NULL)
-#ifndef OS2
 	  V.f = freopen(s, "r", V.f);
-#else
-	  V.f = freopen(s, "rb", V.f);
-#endif
 	else
-#ifndef OS2
 	  V.f = fopen(s, "r");
-#else
-	  V.f = fopen(s, "rb");
-#endif
 	if (V.f == NULL)
-#ifndef OS2
 	  V.f = fopen(s, "w+");
-#else
-	  V.f = fopen(s, "wb+");
-#endif
 	if (V.f == NULL) {
 	  P_escapecode = -10;
 	  P_ioresult = FileNotFound;
@@ -1693,7 +1666,7 @@ Char *s_;
 }
 
 
-Local Void copykind(k, o)
+static void copykind(k, o)
 krec *k;
 oldrec *o;
 {
@@ -1736,7 +1709,7 @@ oldrec *o;
 }
 
 
-Static Void roshapes(s_, gname_)
+static void roshapes(s_, gname_)
 Char *s_, *gname_;
 {
   Char s[256], gname[256], ggroup[256];
@@ -1760,17 +1733,9 @@ Char *s_, *gname_;
       k1 = curkind;
       TRY(try6);
 	if (f != NULL)
-#ifndef OS2
 	  f = freopen(s, "r", f);
-#else
-	  f = freopen(s, "rb", f);
-#endif
 	else
-#ifndef OS2
 	  f = fopen(s, "r");
-#else
-	  f = fopen(s, "rb");
-#endif
 	if (f == NULL) {
 	  P_escapecode = -10;
 	  P_ioresult = FileNotFound;
@@ -1780,18 +1745,10 @@ Char *s_, *gname_;
       RECOVER2(try6,_Ltry6);
 	if (f != NULL) {
 	  sprintf(STR1, "/LIB/LOG/%s", s);
-#ifndef OS2
 	  f = freopen(STR1, "r", f);
-#else
-	  f = freopen(STR1, "rb", f);
-#endif
 	} else {
 	  sprintf(STR1, "/LIB/LOG/%s", s);
-#ifndef OS2
 	  f = fopen(STR1, "r");
-#else
-	  f = fopen(STR1, "rb");
-#endif
 	}
 	if (f == NULL) {
 	  P_escapecode = -10;
@@ -1878,7 +1835,7 @@ struct LOC_rshapes {
   FILEBUFNC(f,filerec);
 } ;
 
-Local Void readint(LINK)
+static void readint(LINK)
 struct LOC_rshapes *LINK;
 {
   if (LINK->p == 64) {
@@ -1887,7 +1844,7 @@ struct LOC_rshapes *LINK;
   }
 }
 
-Local long readnum(LINK)
+static long readnum(LINK)
 struct LOC_rshapes *LINK;
 {
   long Result;
@@ -1897,7 +1854,7 @@ struct LOC_rshapes *LINK;
   return Result;
 }
 
-Local long readcoord(LINK)
+static long readcoord(LINK)
 struct LOC_rshapes *LINK;
 {
   long Result;
@@ -1914,7 +1871,7 @@ struct LOC_rshapes *LINK;
   return Result;
 }
 
-Local Void parsepinnames(kind, LINK)
+static void parsepinnames(kind, LINK)
 krec *kind;
 struct LOC_rshapes *LINK;
 {
@@ -1948,7 +1905,7 @@ struct LOC_rshapes *LINK;
 
 
 
-Static boolean rshapes(s_, gname_)
+static boolean rshapes(s_, gname_)
 Char *s_, *gname_;
 {
   struct LOC_rshapes V;
@@ -2399,7 +2356,7 @@ Char *s_, *gname_;
 
 
 
-Static Void clearalpha()
+static void clearalpha()
 {
   if (onescreen)
     m_nocursor();
@@ -2409,7 +2366,7 @@ Static Void clearalpha()
 }
 
 
-Static Void crosshairx(x, y)
+static void crosshairx(x, y)
 short x, y;
 {
   crosshair(gridx + x * gridspc, gridy + y * gridspc);
@@ -2417,7 +2374,7 @@ short x, y;
 
 
 
-Static Void roundrect(x1, y1, x2, y2, r, col, shadow)
+static void roundrect(x1, y1, x2, y2, r, col, shadow)
 long x1, y1, x2, y2, r, col;
 boolean shadow;
 {
@@ -2435,7 +2392,7 @@ boolean shadow;
 }
 
 
-Static Void grgridvector(v)
+static void grgridvector(v)
 vectorrec *v;
 {
   long xarr[4], yarr[4];
@@ -2609,7 +2566,7 @@ vectorrec *v;
 
 
 /* draw vector in the small picture */
-Static Void grsmallvector(v)
+static void grsmallvector(v)
 vectorrec *v;
 {
   long xarr[4], yarr[4];
@@ -2715,7 +2672,7 @@ vectorrec *v;
   }
 }
 
-Static Void grvector(v)
+static void grvector(v)
 vectorrec *v;
 {
   if (show_preview)
@@ -2725,7 +2682,7 @@ vectorrec *v;
 }
 
 
-Static Void grregion(x1, y1, x2, y2)
+static void grregion(x1, y1, x2, y2)
 short x1, y1, x2, y2;
 {
   if (fullcolor)
@@ -2739,7 +2696,7 @@ short x1, y1, x2, y2;
 }
 
 
-Static Void grpinz(x, y, n)
+static void grpinz(x, y, n)
 short x, y, n;
 {
   m_color((long)red);
@@ -2749,7 +2706,7 @@ short x, y, n;
 }
 
 
-Static Char *getpinname(Result, num)
+static Char *getpinname(Result, num)
 Char *Result;
 long num;
 {
@@ -2769,7 +2726,7 @@ long num;
 
 /* drpin() functions as both grpin() and erpin(), using the 'visible' arg. */
 /* it can place the pin number north or south in addition to east or west. */ 
-Static Void drpin(x, y, n, visible)
+static void drpin(x, y, n, visible)
 short x,y,n;
 boolean visible;
 {
@@ -2812,7 +2769,7 @@ typedef enum {inside,north,east,south,west} placement;
     m_drawstr(x + 8L, P_imax2(y - 3L, 1L), NULL, STR1);
 }
 
-Static Void grpin(x, y, n)
+static void grpin(x, y, n)
 short x, y, n;
 {
   Char STR1[256];
@@ -2829,7 +2786,7 @@ short x, y, n;
 }
 
 
-Static Void erpin(x, y, n)
+static void erpin(x, y, n)
 short x, y, n;
 {
   Char STR1[256];
@@ -2846,7 +2803,7 @@ short x, y, n;
 }
 
 
-Static Void grpinnum(x, y, n)
+static void grpinnum(x, y, n)
 short x, y, n;
 {
   m_color((long)yellow);
@@ -2856,7 +2813,7 @@ short x, y, n;
 }
 
 
-Static Void erpinnum(x, y, n)
+static void erpinnum(x, y, n)
 short x, y, n;
 {
   m_color((long)black);
@@ -2865,7 +2822,7 @@ short x, y, n;
 }
 
 
-Static Void grrefr()
+static void grrefr()
 {
   if (show_preview)
     return;
@@ -2887,7 +2844,7 @@ Static Void grrefr()
 }
 
 
-Static Void refrpinnums()
+static void refrpinnums()
 {
   long i, FORLIM;
 
@@ -2901,7 +2858,7 @@ Static Void refrpinnums()
 }
 
 
-Static Void refrname()
+static void refrname()
 {
 Char *sp;
 
@@ -2924,7 +2881,7 @@ Char *sp;
   }
 }
 
-Static Void refrtorgmenu()
+static void refrtorgmenu()
 {
 
   long i, FORLIM;
@@ -2943,7 +2900,7 @@ Static Void refrtorgmenu()
 }
 
 
-Static Void refrveckindmenu()
+static void refrveckindmenu()
 {
   long i, FORLIM;
   Char STR1[256], STR2[256];
@@ -3004,7 +2961,7 @@ Static Void refrveckindmenu()
 }
 
 
-Static Void refrcolormenu()
+static void refrcolormenu()
 {
 
   m_color(colortrans[curcolor - 1]);
@@ -3040,7 +2997,7 @@ Static Void refrcolormenu()
   }
 }
 
-Static Void refrmenus()
+static void refrmenus()
 {
   refrname();
   refrveckindmenu();
@@ -3048,7 +3005,7 @@ Static Void refrmenus()
 }
 
 
-Static Void grid()
+static void grid()
 {
   m_nocursor();
   m_linestyle(0L);
@@ -3064,7 +3021,7 @@ Static Void grid()
 }
 
 
-Static Void refresh1()
+static void refresh1()
 {
   short i;
   krec *WITH;
@@ -3171,7 +3128,7 @@ Static Void refresh1()
 }
 
 
-Static Void refresh()
+static void refresh()
 {
   if (nc_gType() != nc_g300) {
     nocrosshair();
@@ -3193,7 +3150,7 @@ Static Void refresh()
 
 
 
-Static Void gatecmd()
+static void gatecmd()
 {
   if (*argument != '\0') {
     makekind(argument);
@@ -3203,7 +3160,7 @@ Static Void gatecmd()
 }
 
 
-Static Void nextcmd(indraw)
+static void nextcmd(indraw)
 boolean indraw;
 {
   Char arg[256], ggroup[256];
@@ -3245,7 +3202,7 @@ boolean indraw;
 }
 
 
-Static Void prevcmd(indraw)
+static void prevcmd(indraw)
 boolean indraw;
 {
   Char arg[256], ggroup[256];
@@ -3295,11 +3252,11 @@ boolean indraw;
 
 
 
-Static Void editcmd PP((Char *argument));
+static void editcmd PP((Char *argument));
 
 
 
-Static Void fixnumpins(num)
+static void fixnumpins(num)
 long num;
 {
   long i;
@@ -3318,7 +3275,7 @@ long num;
 }
 
 
-Static Void deletepin(num)
+static void deletepin(num)
 long num;
 {
   long i, j;
@@ -3351,7 +3308,7 @@ long num;
 
 
 
-Static krec *findkind(n)
+static krec *findkind(n)
 Char *n;
 {
   krec *k;
@@ -3363,7 +3320,7 @@ Char *n;
 }
 
 
-Static Void cpyfunc()
+static void cpyfunc()
 {
   krec *k;
   Char n[9];
@@ -3418,7 +3375,7 @@ Static Void cpyfunc()
 }
 
 
-Static Void shadowfunc()
+static void shadowfunc()
 {
   Char n[9];
   Char STR1[256];
@@ -3442,7 +3399,7 @@ Static Void shadowfunc()
 
 
 
-Static Void delfunc(x, y)
+static void delfunc(x, y)
 short *x, *y;
 {
   short i, j, FORLIM;
@@ -3498,7 +3455,7 @@ struct LOC_drawcmd {
   long nearpin, nearregion;
 } ;
 
-Local Void fixscale(LINK)
+static void fixscale(LINK)
 struct LOC_drawcmd *LINK;
 {
   long savescale;
@@ -3524,7 +3481,7 @@ struct LOC_drawcmd *LINK;
   return (!pen.depressed);
 }
 
-Local Void getgrid(px, py, x, y, LINK)
+Local void getgrid(px, py, x, y, LINK)
 long px, py, *x, *y;
 struct LOC_drawcmd *LINK;
 {
@@ -3538,7 +3495,7 @@ struct LOC_drawcmd *LINK;
   }
 }
 
-Local Void addvector(knd, LINK)
+Local void addvector(knd, LINK)
 Char knd;
 struct LOC_drawcmd *LINK;
 {
@@ -3552,7 +3509,7 @@ struct LOC_drawcmd *LINK;
   savedflag = false;
 }
 
-Local Void flipX(v, LINK)
+Local void flipX(v, LINK)
 vectorrec *v;
 struct LOC_drawcmd *LINK;
 {
@@ -3669,7 +3626,7 @@ struct LOC_drawcmd *LINK;
   }
 }
 
-Local Void checkoverpin(num, LINK)
+Local void checkoverpin(num, LINK)
 long num;
 struct LOC_drawcmd *LINK;
 {
@@ -3684,7 +3641,7 @@ struct LOC_drawcmd *LINK;
   }
 }
 
-Local Void purgeoutside(LINK)
+Local void purgeoutside(LINK)
 struct LOC_drawcmd *LINK;
 {
   long i, j, FORLIM;
@@ -3733,7 +3690,7 @@ struct LOC_drawcmd *LINK;
   }
 }
 
-Local Void fixpin(i, LINK)
+Local void fixpin(i, LINK)
 long i;
 struct LOC_drawcmd *LINK;
 {
@@ -3757,7 +3714,7 @@ struct LOC_movepoint {
   boolean done;
 } ;
 
-Local Void drawthem(LINK)
+Local void drawthem(LINK)
 struct LOC_movepoint *LINK;
 {
   long i, FORLIM;
@@ -3777,7 +3734,7 @@ struct LOC_movepoint *LINK;
     grregion(kind.xx1, kind.yy1, kind.xx2, kind.yy2);
 }
 
-Local Void checkdone(LINK)
+Local void checkdone(LINK)
 struct LOC_movepoint *LINK;
 {
   if (!LINK->waitdn) {
@@ -3792,7 +3749,7 @@ struct LOC_movepoint *LINK;
 }
 
 
-Local Void movepoint(waitdn_, LINK)
+Local void movepoint(waitdn_, LINK)
 boolean waitdn_;
 struct LOC_drawcmd *LINK;
 {
@@ -3911,7 +3868,7 @@ struct LOC_drawcmd *LINK;
 }
 
 
-Local Void movesel(LINK)
+Local void movesel(LINK)
 struct LOC_drawcmd *LINK;
 {
   long x1, y1, x2, y2, i;
@@ -3985,7 +3942,7 @@ struct LOC_drawcmd *LINK;
 }
 
 
-Local Void addobject(LINK)
+Local void addobject(LINK)
 struct LOC_drawcmd *LINK;
 {
   long x1, y1, x2, y2, x3, y3, x4, y4, num;
@@ -4180,7 +4137,7 @@ struct LOC_drawcmd *LINK;
 }
 
 
-Local Void setmodes(vk, col, LINK)
+Local void setmodes(vk, col, LINK)
 Char vk;
 long col;
 struct LOC_drawcmd *LINK;
@@ -4194,7 +4151,7 @@ struct LOC_drawcmd *LINK;
 }
 
 
-Local Void instructions(LINK)
+Local void instructions(LINK)
 struct LOC_drawcmd *LINK;
 {
   clearalpha();
@@ -4221,7 +4178,7 @@ struct LOC_drawcmd *LINK;
 
 
 
-Static Void drawcmd()
+static void drawcmd()
 {
   struct LOC_drawcmd V;
   boolean exitflag;
@@ -4521,7 +4478,7 @@ Static Void drawcmd()
 
 
 
-Static Void libcmd()
+static void libcmd()
 {
   krec *k;
   Char ggroup[256];
@@ -4570,9 +4527,9 @@ Static Void libcmd()
 
 
 
-Static Void defcmd()
+static void defcmd()
 {
-  Void (*proc) PP((log_action *act));
+  void (*proc) PP((log_action *act));
   Char name[256];
   Char STR1[256];
 
@@ -4590,7 +4547,7 @@ Static Void defcmd()
     return;
   }
   sprintf(name, "LOG_%d_PROC", kind.simtype);
-  if (!newci_findprocedure2(name, (Void(**) PV())(&proc))) {
+  if (!newci_findprocedure2(name, (void(**) PV())(&proc))) {
     sprintf(STR1, "Simulator for type %d not loaded", kind.simtype);
     wrmsg(STR1);
     return;
@@ -4614,7 +4571,7 @@ Static Void defcmd()
 
 
 
-Static Void simtypecmd()
+static void simtypecmd()
 {
   long i, j, k;
   boolean flag;
@@ -4683,7 +4640,7 @@ Static Void simtypecmd()
 
 
 
-Static Void connectcmd()
+static void connectcmd()
 {
   long i, j, k, n, n0;
   long st[log_maxpins / 32 + 2];
@@ -4771,7 +4728,7 @@ Static Void connectcmd()
 
 
 
-Static Void labelcmd()
+static void labelcmd()
 {
   short i, i1, p, x, y, xx, yy, len;
   Char snail[5];
@@ -4995,7 +4952,7 @@ Static Void labelcmd()
 
 
 
-Static Void groupcmd()
+static void groupcmd()
 {
   long i, j;
   Char *STR1;
@@ -5032,7 +4989,7 @@ narr names = {
   };
 
 
-Static Void flagcmd(kind, buf, mode)
+static void flagcmd(kind, buf, mode)
 krec *kind;
 Char *buf;
 long mode;
@@ -5095,7 +5052,7 @@ long mode;
 
 
 
-Static Void copycmd()
+static void copycmd()
 {
   Char n[9];
   krec *k, *k1;
@@ -5143,7 +5100,7 @@ Static Void copycmd()
 
 
 
-Static Void renamecmd()
+static void renamecmd()
 {
   Char n[9];
   krec *k, *k1, *k2;
@@ -5192,7 +5149,7 @@ Static Void renamecmd()
 
 
 
-Static Void dispcurkind()
+static void dispcurkind()
 {
   Free(kind.proc);
   Free(kind.lbl);
@@ -5202,7 +5159,7 @@ Static Void dispcurkind()
 }
 
 
-Static Void deletecmd()
+static void deletecmd()
 {
   Char ch;
   krec *k, *k1, *k2;
@@ -5298,20 +5255,20 @@ Static Void deletecmd()
 
 
 
-Static Void getdefn(kind, def, mode)
+static void getdefn(kind, def, mode)
 krec *kind;
 na_strlist **def;
 long mode;
 {
   Char name[256];
-  Void (*proc) PP((log_action *act));
+  void (*proc) PP((log_action *act));
 
   if (mode != 3)
     *def = NULL;
   if (kind->simtype == 0)
     return;
   sprintf(name, "LOG_%d_PROC", kind->simtype);
-  if (!newci_findprocedure2(name, (Void(**) PV())(&proc)))
+  if (!newci_findprocedure2(name, (void(**) PV())(&proc)))
     return;
   gg.action = act_edit;
   gg.acttool = NULL;
@@ -5345,7 +5302,7 @@ struct LOC_dumpcmd {
   FILE *f;
 } ;
 
-Local Void writestr(s_, LINK)
+Local void writestr(s_, LINK)
 Char *s_;
 struct LOC_dumpcmd *LINK;
 {
@@ -5376,7 +5333,7 @@ struct LOC_dumpcmd *LINK;
 
 
 
-Static Void dumpcmd()
+static void dumpcmd()
 {
   struct LOC_dumpcmd V;
   long i, n, curcol;
@@ -5777,7 +5734,7 @@ Static Void dumpcmd()
 
 
 
-Static Void addpinname(num, name)
+static void addpinname(num, name)
 long num;
 Char *name;
 {
@@ -5798,7 +5755,7 @@ struct LOC_readfile {
   boolean defining, hasdef, haslabels;
 } ;
 
-Local Void addvector_(knd, LINK)
+Local void addvector_(knd, LINK)
 Char knd;
 struct LOC_readfile *LINK;
 {
@@ -5811,7 +5768,7 @@ struct LOC_readfile *LINK;
   WITH->col = LINK->curcol;
 }
 
-Local Void endkind(LINK)
+Local void endkind(LINK)
 struct LOC_readfile *LINK;
 {
   long i;
@@ -5852,7 +5809,7 @@ struct LOC_readfile *LINK;
 
 
 
-Static Void readfile(filename_, gname_)
+static void readfile(filename_, gname_)
 Char *filename_, *gname_;
 {
   struct LOC_readfile V;
@@ -5888,17 +5845,9 @@ Char *filename_, *gname_;
     wildcards(gname, ggroup, &verify);
     TRY(try13);
       if (f != NULL)
-#ifndef OS2
 	f = freopen(filename, "r", f);
-#else
-	f = freopen(filename, "rb", f);
-#endif
       else
-#ifndef OS2
 	f = fopen(filename, "r");
-#else
-	f = fopen(filename, "rb");
-#endif
       if (f == NULL) {
 	P_escapecode = -10;
 	P_ioresult = FileNotFound;
@@ -6221,7 +6170,7 @@ struct LOC_writefile {
   FILE *f;
 } ;
 
-Local Void writeit(k, LINK)
+Local void writeit(k, LINK)
 krec *k;
 struct LOC_writefile *LINK;
 {
@@ -6403,7 +6352,7 @@ struct LOC_writefile *LINK;
 
 
 
-Static Void writefile(filename_, gname_)
+static void writefile(filename_, gname_)
 Char *filename_, *gname_;
 {
   struct LOC_writefile V;
@@ -6421,17 +6370,9 @@ Char *filename_, *gname_;
   else {
     wildcards(gname, ggroup, &verify);
     if (V.f != NULL)
-#ifndef OS2
       V.f = freopen(filename, "w", V.f);
-#else
-      V.f = freopen(filename, "wb", V.f);
-#endif
     else
-#ifndef OS2
       V.f = fopen(filename, "w");
-#else
-      V.f = fopen(filename, "wb");
-#endif
     if (V.f == NULL)
       _EscIO(FileNotFound);
     fprintf(V.f, "# Created by LOGED on %s\n\n\n", strdate(STR2, ""));
@@ -6456,7 +6397,7 @@ Char *filename_, *gname_;
 
 
 
-Static Void parse(s1, s2)
+static void parse(s1, s2)
 Char *s1, *s2;
 {
   short i;
@@ -6481,7 +6422,7 @@ Char *s1, *s2;
 }
 
 
-Static Void load20cmd()
+static void load20cmd()
 {
   Char gname[256];
 
@@ -6503,7 +6444,7 @@ Static Void load20cmd()
 }
 
 
-Static Void loadcmd()
+static void loadcmd()
 {
   Char gname[256];
 
@@ -6525,7 +6466,7 @@ Static Void loadcmd()
 }
 
 
-Static Void readcmd()
+static void readcmd()
 {
   Char fname[256], gname[256];
 
@@ -6548,7 +6489,7 @@ Static Void readcmd()
 
 
 
-Static Void savecmd()
+static void savecmd()
 {
   Char gname[256];
   Char ch;
@@ -6569,7 +6510,7 @@ Static Void savecmd()
 }
 
 
-Static Void writecmd()
+static void writecmd()
 {
   Char buf[256], gname[256];
 
@@ -6592,7 +6533,7 @@ Static Void writecmd()
 
 
 
-Static Void editcmd(argument_)
+static void editcmd(argument_)
 Char *argument_;
 {
   Char argument[256], fn[256];
@@ -6617,7 +6558,7 @@ Char *argument_;
 
 
 
-Static Void helpcmd()
+static void helpcmd()
 {
   TRY(try16);
     if (helpdsc == 0) {
@@ -6637,7 +6578,7 @@ Static Void helpcmd()
 }
 
 
-Static Void memorycmd()
+static void memorycmd()
 {
   Char STR2[256];
 
@@ -6650,9 +6591,9 @@ Static Void memorycmd()
 }
 
 
-Static Void docommand PP((Char *command));
+static void docommand PP((Char *command));
 
-Local Void docmd()
+Local void docmd()
 {
   Char savecmd[256], gname[256], ggroup[256];
   krec *k, *k2;
@@ -6686,7 +6627,7 @@ Local Void docmd()
 
 
 
-Static Void docommand(command_)
+static void docommand(command_)
 Char *command_;
 {
   Char command[256];
@@ -6804,7 +6745,7 @@ Char *command_;
 
 
 
-Static Void commandline()
+static void commandline()
 {
   long i;
   Char s[256];
diff --git a/log/src/loged.safe.c b/log/src/loged.safe.c
deleted file mode 100644
index 2d53882..0000000
--- a/log/src/loged.safe.c
+++ /dev/null
@@ -1,7046 +0,0 @@
-/* Output from p2c, the Pascal-to-C translator */
-/* From input file "loged.text" */
-
-
-/* "LOG", the circuit editing and simulation system,
-   "DigLOG", the digital simulator for LOG.
-   Copyright (C) 1985, 1990 David Gillespie.
-   Author's address: daveg@csvax.caltech.edu; 256-80 Caltech/Pasadena CA 91125.
-
-   "AnaLOG", the analog simulator for LOG.
-   Copyright (C) 1985, 1990 John Lazzaro.
-   Author's address: lazzaro@csvax.caltech.edu; 256-80 Caltech.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation (any version).
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-
-/* caged_process='newcom $B$M' */
-/*
-
-
-
-        Logic Simulator      Gate Editor
-                 for HP 9836C
-
-
-             Copyright (c)  1983
-
-               David Gillespie
-
-
-      Modified 3/18/84 for HP 9836C
-      Modified 7/12/88 to bring things up-to-date
-
-
-*/
-
-
-
-
-#ifndef OS2
-#include <unistd.h>
-#endif
-
-
-#include <p2c/p2c.h>
-
-
-#ifndef LOGDEF_H
-#include "logdef.h"
-#endif
-
-#ifndef MYLIB_H
-#include <p2c/mylib.h>
-#endif
-
-#ifndef NEWCI_H
-#include <p2c/newci.h>
-#endif
-
-#ifndef NEWKBD_H
-#include <p2c/newkbd.h>
-#endif
-
-#ifndef NEWASM_H
-#include <p2c/newasm.h>
-#endif
-
-#ifndef NEWCRT_H
-#include <p2c/newcrt.h>
-#endif
-
-#ifndef MATH_H
-#include <p2c/math.h>
-#endif
-/* p2c: loged.text, line 30: Warning: Could not find module HELP [271] */
-
-#include "help.h"
-
-#ifndef FILEPACK_H
-#include <p2c/filepack.h>
-#endif
-
-#ifndef FS_H
-#include <p2c/fs.h>
-#endif
-
-#ifndef REGEX_H
-#include <p2c/regex.h>
-#endif
-
-
-char *my_strdup(char *);
-#undef strdup
-#define strdup my_strdup
-#define newci_findprocedure2 findprocedure
-extern boolean findprocedure PP((Char *name, Void (**start)()));
-extern short getshortsw(char *);
-
-
-#define debugloged      false
-
-#define maxpins         255   /* <= 255*/
-#define maxpnums        32   /* <= 255*/
-#define maxgrid         50   /* <= 50 */
-
-#define veckindmenu     "vCeErcFtpb"
-
-#define torgkindmenu	"ulucurclcccrlllclr"
-
-#define helpfile        "/LIB/LOG/LOGHELP"
-
-#define charheight      8
-
-#define black           0
-#define red             1
-#define green           2
-#define yellow          3
-#define red2            4
-#define purple2         5
-#define cyan            6
-#define white           7
-#define yellow2         8
-#define orange          9
-#define gray            10
-
-
-/* horizontal positions of menu components */
-Static short msg_name, msg_veckindmenu, msg_veckindname,
-             msg_color, msg_torg, msg_end;
-
-/*-32768..32767*/
-/*0 .. 255*/
-/*-128 .. 127*/
-
-typedef Char gatename[8];
-
-typedef Char pac4[4];
-
-typedef struct descrec {
-  long ptr;
-  uchar numvects, numpins, numpnums, lblsize, simtype, procsize;
-  /* log_kflags */ short flag;
-  schar xx1, yy1, xx2, yy2;
-} descrec;
-
-typedef struct ovectorrec {
-  schar x1, y1, x2, y2;
-} ovectorrec;
-
-typedef struct vectorrec {
-  Char kind;
-  schar col, x1, y1;
-  union {
-    struct {
-      schar x2, y2, x3, y3, x4, y4;
-    } U99;
-    struct {
-      uchar ux2, uy2, num;
-    } U98;
-    struct {
-      uchar tsize, torg;
-      Char *sp;
-    } U116;
-  } UU;
-} vectorrec;
-
-typedef vectorrec vectorarray[100000L];
-
-typedef struct pinrec {
-  schar x, y, s;
-  uchar c;
-} pinrec;
-
-typedef struct pnumrec {
-  schar x, y;
-  short num;
-} pnumrec;
-
-typedef union filerec {
-  uchar b[256];
-  schar sb[256];
-  uchar c[256];
-  short sh[128];
-#ifdef __alpha__
-  int i[64];
-#else
-  long i[64];
-#endif
-  gatename ix[32];
-  ovectorrec vec[64];
-  pinrec pin[64];
-  pnumrec pnum[64];
-  descrec desc[16];
-  pac4 c4[64];
-} filerec;
-
-typedef struct _REC_pin {
-  schar x, y;
-} _REC_pin;
-
-typedef struct oldrec {
-  uchar proc[256];
-  gatename name;
-  short code;
-  schar xx1, yy1, xx2, yy2;
-  short numpins;
-  _REC_pin pin[32];
-  short numvects;
-  ovectorrec vector[64];
-#ifdef __alpha__
-  int next;
-#else
-  long next;
-#endif
-} oldrec;
-
-
-typedef Char lblarray[log_million];
-
-typedef struct _REC_pin_ {
-  schar x, y;
-} _REC_pin_;
-
-typedef struct _REC_pinoff {
-  schar x, y;
-} _REC_pinoff;
-
-typedef struct krec {
-  Char name[9];
-  uchar *proc;
-  Char *lbl;
-  long proclen, lbllen;
-  schar xx1, yy1, xx2, yy2;
-  uchar numpins, numpnums, group, simtype;
-  long sizelbl;   /*only load/save*/
-  long sizeproc;   /*only load/save*/
-  long sizevects;   /*only load/save*/
-  log_kflags flag;
-  _REC_pin_ pin[maxpins];
-  _REC_pinoff pinoff[maxpnums];
-  uchar pinsim[maxpins];
-  uchar pincon[maxpins];
-  short pinnum[maxpnums];
-  na_strlist *pinnames;
-  vectorrec *vector;
-  short numvects, allocvects;
-  long address;   /*only load/save*/
-  struct krec *next;
-} krec;
-
-typedef union swap2 {
-        short ival;
-        unsigned char c[2];
-} swap2;
-
-
-typedef union swap4 {
-        long ival;
-        unsigned char c[4];
-} swap4;
-
-
-/* GATE file format:
-
-   Records are 256 bytes long.  Bytes are sometimes interpreted as
-   short or long integers, always on even or doubly-even boundaries.
-   Records are stored in 3 groups:
-
-      Index (8 bytes per gate)
-      Descriptors (16 bytes per gate)
-      Extra information (divided into 4-byte blocks)
-
-   The first 8 bytes of the first record in the file are:
-
-      0  \
-      1  |  Version number:  0
-      2  |
-      3  /
-      4  \  Number of gates in the file, 1..8159
-      5  /
-      6  >  Number of 256-byte records in index, 1..255
-      7       (reserved)
-
-   The remainder of the first record contains 8-character names of
-   gates, in alphabetical order.  Unused portions are padded with
-   zeros.  In other index records, all 32 slots are used for gate
-   names.  If a gate is in one of the groups 1..8, the corresponding
-   byte of its name has bit 7 set.  If a gate is in group 0, all
-   8 characters of the name are <= #127.
-
-   Descriptors are stored next.  Descriptors are 16 bytes long, and
-   the first descriptor is on a record boundary.  Descriptors are
-   listed in the same order as the gates in the index.  Note that
-   the first gate is stored in index position 1, but descriptor
-   position 0.
-
-      0  \  Integer pointer to gate's information block.  0 points to
-      1  |     the first integer in the file, 64 points to the first
-      2  |     integer in the second record, etc.
-      3  /
-      4  >  Number of vectors in gate's picture, 0..255
-      5  >  Number of pins, 0..255
-      6  >  Number of pin numbers, 0..255
-      7  >  Total length of attribute labels, in multiples of 4 bytes
-      8  >  Gate's simulation type, 0..254
-      9  >  Total length of gate definition, in multiples of 4 bytes, 0..255
-     10  \  Flags describing special attributes of the gate
-     11  /          (see log_kflags in LOGDEF)
-     12  >  X1
-     13  >  Y1  Dimensions of bounding box, -127..127.
-     14  >  X2
-     15  >  Y2
-
-   If the "expanded" bit is set for a gate, then bytes 7 and 9 of the
-   header (length of labels and legth of definition) are instead
-   compressed numbers of the form 16*J+K, where 0<=J<=15 and 0<=K<=15.
-   The number represented is 2^J*4*(16+K).  So, the maximum representable
-   "expanded" length is 2^15*4*31 = 4 million approx.  If J=K=0, then the
-   represented length is zero; the smallest non-zero representable length
-   is 2^0*4*(16+1) = 68.
-
-   In "expanded" mode, header byte 6 encodes the length of the
-   "annotation" section, compressed in the same way as bytes 7 and 9.
-   Header byte 4 is the number of annotations present (not counting
-   color-change annotations).  Vectors and pin numbers become a
-   special case of annotations.
-
-   The information records contain variable-length blocks of data
-   for each gate.  Order is unimportant, since this area is only ever
-   accessed using pointers from the gate descriptors.  The information
-   block is organized as several fields, each containing zero or more
-   4-byte values:
-
-         Vectors or annotations
-         Pins
-         Pin numbers
-         Attribute labels
-         Gate definition
-
-
-   Vectors make up the picture of the gate.  If the gate has no vectors
-   or annotations, LOG will draw it as a small dot.  There is no
-   explicit vectors section for "expanded" gates; vectors are encoded
-   as annotations instead.
-
-      0  >  X1  First endpoint of vector, -127..127.
-      1  >  Y1
-      2  >  X2  Second endpoint of vector (may be listed in either order).
-      3  >  Y2
-
-
-   Pins contain the positions, simulation types, and connectivities of
-   the pins.
-
-      0  >  X   Position relative to center of gate: -125..125, multiple of 5.
-      1  >  Y
-      2  >  S   Simulation type of the pin (default is gate's simtype).
-      3  >  C   Connectivity pointer.
-
-   Connectivity pointers are normally zero.  If the gate is a connection
-   gate (e.g. CROSS) this pointer is the pin number of another pin which
-   shares this pin's node.  Connectivity pointers must form a circularly-
-   linked list of size two pins or more.
-
-
-   Pin numbers are optional tiny numbers which are intended to be placed
-   near the pins for labelling purposes.  They are present only in non-
-   "expanded" mode.
-
-      0  >  X   Position of number.  -127..127.
-      1  >  Y
-      2  \  Pin number.  Arbitrary number in range 0..32767.
-      3  /
-
-
-   Annotations are a generalization of vectors and pin numbers.  They
-   are graphical objects to be placed in the gate's picture.  They are
-   present only in "expanded" mode.  Annotations are stored as a string
-   of bytes; when the gate is drawn, annotations are processed from
-   left to right in this string.  The following annotation types are
-   currently recognized:
-
-      "1".."7"
-            Select color for subsequent drawings.  Color is represented
-            by the digit, which is "1" for cyan, "2" for green, "3" for
-            yellow, "4" for red, "5" for orange, "6" for black, or "7"
-            for white.  Initial current color is cyan.
-
-      "v" <x1> <y1> <x2> <y2>
-            A vector from point (x1,y1) to point (x2,y2).
-
-      "F" <x1> <y1> <x2> <y2> <x3> <y3> <x4> <y4>
-            A four-sided filled polygon.  The polygon is filled solid
-            in the current color.
-
-      "e" <x1> <y1> <x2> <y2>
-            An unfilled ellipse with (x1,y1)-(x2,y2) as its bounding
-            box.
-
-      "E" <x1> <y1> <x2> <y2>
-            A filled ellipse bounded by the box (x1,y1)-(x2,y2).
-
-      "r" <x1> <y1> <x2> <y2> <r>
-            A rectangle with rounded corners of radius <r>.  (If the
-            height or width is less than 2*<r>, a plain rectangle is
-            drawn.)
-
-      "c" <x1> <y1> <x2> <y2> <x3> <y3> <x4> <y4>
-            A Bezier curve with the specified control points.
-
-      "p" <n> <x> <y>
-            An invisible point marker.  Markers are numbered 1 through
-            255, not necessarily contiguously.  Their intended use is
-            for gates whose Pascal procedures need to annotate their
-            appearances.
-
-      "b" <n> <x1> <y1> <x2> <y2>
-            An invisible box marker.  Box markers are also numbered
-            1 through 255; box marker numbering is independent of
-            point marker numbering.
-
-      "t" <size> <org> <x> <y> <n> <t1> <t2> ... <tn>
-            A text object.  Capital letters are optimally <size>*10 units
-            high, in the same units as other coordinates in gate
-            pictures.  Origin <org> is 3*J+K+1, where K=0 for left, 1 for
-            center, 2 for right and J=0 for top, 1 for center, and 2 for
-            baseline.  The text consists of the <n> character string
-            <t1>...<tn>.  If text is so small that drawing it at the
-            optimal size would render it illegible, Log will not draw
-            the text.
-
-   The annotation string is terminated by a <0> byte.  Note that <0>
-   bytes may not appear as data values within the annotations; any
-   coordinate that would be written as <0> is written as <-128> instead.
-   An old-fashioned pin-number is represented as a text item with size
-   3, origin J=K=1, and color 3 (yellow).
-
-
-   The "labels" are a zero-terminated list of strings of characters.
-   Each string is terminated by a <1> byte.  Up to three additional
-   zero bytes may be appended to fill out a multiple of 4 bytes.
-   (In "expanded" mode, many padding zeros may be necessary.)
-
-      label1 <1> label2 <1> label3 <1> <0> <fill bytes>
-
-   If the first label begins with a <2> byte, then it describes names
-   for the pins of the gate.  E.g., <2> foo <2> <2> bar <3> spam <1>
-   says that pin #1 is also named #foo, #2 has no name, and #3 has
-   the two names #bar and #spam.  Other pins, if any, are not named.
-
-   If a label contains a colon, then LOG will consider the characters
-   before the colon as a value descriptor, so that the label will have
-   a changeable value.  Otherwise, the label is for display only.
-   If a double colon appears before any single colons, then it is
-   converted to a single colon and the label is display-only.
-
-   Value descriptors are of the form:
-         <names> <selector> <precision> <type> <default>
-
-   The Names are zero or more names of the form:  [<name>]
-   optionally followed by spaces.
-
-   The Selector is the name of a variant that appears in a previous
-   type-"V" attribute.  This attribute is displayed only if that
-   attribute has this variant as its current value.
-
-   The Type is a letter describing the data type of the value:
-
-      R     Real.  "Precision" is the number of digits after the decimal.
-            If zero, free format is used.  Default is one digit.
-      U     Real with units.  Example: 2U15pF.
-      F     Real with units appended, but no scaling applied.
-      I     Integer.  "Precision" is ignored.
-      H     Hex integer.  "Precision" is ignored.
-      B     Boolean.  Either True or False.  Precision is ignored.
-      C     Character string.  Precision is the maximum length of
-            the string, default 255.
-      A     Dynamically-allocated string.  Functionally the same as
-            "C", but the precision is ignored.
-      V     Variant.  Followed by a comma-separated list of strings.
-            Precision specifies the default variant, where 0 is first.
-
-   The default default value is zero, false, or blank, as appropriate.
-
-
-   The gate definition is an arbitrary zero-terminated string of bytes
-   which defines the simulator behavior of the gate.  If the size-of-
-   definition is zero, this field is not present.  Otherwise, the
-   string is interpreted by the simulator identified by the gate's
-   "simulation type" field.
-
-
-   Simulation types defined so far:
-
-      0     Inert (ignored by simulation)
-      1     Common gate (e.g., GND, +5V, TO, FROM)
-      2-15   (reserved)
-      16    Digital TTL simulator
-      32    Analog standard-cell simulator
-      33    (also used by Analog simulator)
-      48-   (undefined)
-
-   For simtype 0, the definition string is not used.
-
-   For simtype 1, the string is the signal name of the node.  If the
-   gate's "named" flag is set, the signal name is instead entered in
-   LOG, and this string becomes the default.  The string may be
-   blank, although this is only useful if the gate is "named."
-*/
-
-
-
-#define nopin           255   /*value of pinsim if pin not defined*/
-
-
-
-Static short msgwidth = 256;
-Static short msgheight = 25;
-Static short numspc = 12;
-Static short defgridspc = 6;
-Static short defmargin = 20;
-Static short numright = 30;
-Static uchar torgkind = 4;            /* default = center,center */
-Static boolean show_preview = false;    /* toggle: false=grid, true=small */
-
-Static m_chpicrec *chair;
-Static m_tablet_info pen;
-
-Static long scrwidth, scrheight, chx, chy, esc, iores;
-
-Static long helpdsc;
-
-
-Static short defgridspc, gridspc, gridleft, gridx, gridright, gridy, gridbot;
-Static short smallx, smally, smallxmin, smallxmax, smallymin, smallymax;
-Static short msgx, msgy;
-Static long firstpin, scrpins;
-Static short gridxmin, gridxmax, gridymin, gridymax, gridmax, gridscale;
-Static short gridtop, gridlimit;
-Static long colortrans[7];
-
-Static log_action gg;
-Static krec kind, *kbase, *curkind, *shadowkind;
-Static long newsimtype;
-Static Char veckind;
-Static long curcolor, regionstyle;
-Static Char command[256], argument[256], filename[256];
-Static boolean onescreen, fullcolor;   /*updated 7/12/88*/
-Static boolean firsttime, menuflag, refrkind, needrefr, firsthelp,
-	       savedflag, errorflag, exitflag;
-Static pnumrec pn;
-
-
-Static Void writedesc(rec,d)
-   char *rec;
-   descrec *d;
-   {
-       swap2 s2;
-       swap4 s4;
-
-       s4.ival = intsw(d->ptr);
-       rec[0] = s4.c[0];
-       rec[1] = s4.c[1];
-       rec[2] = s4.c[2];
-       rec[3] = s4.c[3];
-       rec[4] = d->numvects;
-       rec[5] = d->numpins;
-       rec[6] = d->numpnums;
-       rec[7] = d->lblsize;
-       rec[8] = d->simtype;
-       rec[9] = d->procsize;
-
-       if (!bigendian)
-	 {
-	   /* d->flag.i = reverse(shortsw(d->flag.i)); */
-	   d->flag = reverse(shortsw(d->flag));
-	 }
-
-       s2.ival = d->flag;
-       rec[10] = s2.c[0];
-       rec[11] = s2.c[1];
-       rec[12] = d->xx1;
-       rec[13] = d->yy1;
-       rec[14] = d->xx2;
-       rec[15] = d->yy2;
-   }
-
-   Local descrec *readdesc(rec)
-   char *rec;
-   {
-       unsigned short i,j1,j2,s1,s2;
-       static descrec d;
-       d.ptr = getintsw(rec);
-       d.numvects = rec[4];
-       d.numpins = rec[5];
-       d.numpnums= rec[6];
-       d.lblsize = rec[7];
-       d.simtype = rec[8];
-       d.procsize= rec[9];
-       d.flag = getshortsw(&(rec[10]));
-
-
-       if (!bigendian)
-	 {
-	   /* d.flag.i = reverse(d.flag.i); */
-           d.flag = reverse(d.flag);
-	 }
-
-       d.xx1= rec[12];
-       d.yy1= rec[13];
-       d.xx2= rec[14];
-       d.yy2= rec[15];
-       return &d;
-   }
-
-   Local pnumrec readpnum(rec)
-   char *rec;
-   {
-       static pnumrec p;
-
-       p.x = rec[0];
-       p.y = rec[1];
-       p.num = getshortsw(&(rec[2]));
-       return p;
-   }
-
-
-
-
-
-Static Void docolors(lo, hi)
-long lo, hi;
-{
-  m_setcolor((long)black, 0L, 0L, 0L);
-  m_setcolor((long)red, hi, 0L, 0L);
-  m_setcolor((long)green, 0L, hi, 0L);
-  m_setcolor((long)yellow, hi, hi, 0L);
-  m_setcolor((long)cyan, 0L, hi, hi);
-  m_setcolor((long)white, hi, hi, hi);
-  m_setcolor((long)red2, lo, 0L, 0L);
-  m_setcolor((long)purple2, lo + 1, 0L, lo + 1);
-  if (!fullcolor)
-    return;
-  m_setcolor((long)yellow2, lo - 2, lo - 2, 0L);
-  m_setcolor((long)orange, hi, lo, 0L);
-  m_setcolor((long)gray, lo, lo, lo);
-}
-
-
-Static Void dim()
-{
-#if 0
-  if (onescreen)
-    m_choosecolors(0L);
-  else
-    docolors(7L, 7L);
-#endif
-}
-
-
-Static Void bright()
-{
-  if (nc_gType() == nc_g300)   /*bobcat monitors aren't as bright*/
-    docolors(11L, 15L);
-  else
-    docolors(9L, 15L);
-}
-
-
-
-Static Void setscale(sc)
-long sc;
-{
-short w,h;
-short stepsiz = m_across / 3L - 40;
-
-  /* pins are down left side */
-  scrpins = (m_down - msgheight) / numspc;
-
-  /* msg is along the bottom */
-  msgx = 0;
-  msgy = m_down - msgheight;
-  msg_name = 10;
-  msg_veckindmenu = stepsiz;
-  msg_veckindname = stepsiz;
-  msg_color = stepsiz * 2;
-  msg_torg = stepsiz * 2;
-  msg_end =  m_across - 30;
-
-
-  /* small is centered between numright and m_across, 0 and msgy */
-  smallx = numright+ ((m_across - numright) / 2L);
-  smallxmin = numright;
-  smallxmax = m_across -1;
-  smally = (m_down - msgheight) / 2L;
-  smallymin = 1;
-  smallymax = (m_down - msgheight) + 1;
-
-  gridscale = sc;
-  gridspc = defgridspc - gridscale;
-
-  /* grid is centered between num, msgx, top and bot */
-  w = ((m_across - (defmargin + numright + 4*gridspc)) / (gridspc * 10L)) * 2L;
-  h = ((m_down - (defmargin + msgheight + 4*gridspc)) / (gridspc * 10L)) * 2L;
-  if (w > maxgrid)
-    w = maxgrid;
-  if (h > maxgrid)
-    h = maxgrid;
-  gridx = numright + ((m_across - (defmargin + numright)) / 2L);
-  gridy = (m_down - msgheight) / 2L;
-  gridxmax = 2+(w * 5L) / 2L;
-  gridymax = 2+(h * 5L) / 2L;
-  gridxmin = -gridxmax;
-  gridymin = -gridymax;
-  gridmax = gridxmax > gridymax ? gridxmax : gridymax;
-  gridleft = gridx - gridxmax * gridspc;
-  gridtop = gridy - gridymax * gridspc;
-  gridright = gridx + gridxmax * gridspc;
-  gridbot = gridy + gridymax * gridspc;
-}
-
-
-
-Static Void initscreen()
-{
-  m_init_graphics();
-  m_upside_down();
-  onescreen = nc_alphashared();
-  m_makechar((Anyptr *)(&chair), 11L, 11L, -5L, -5L, 0L, 0L);
-  m_changechar((Anyptr)chair, 1L, 5L, 0L, 5L, 11L);
-  m_changechar((Anyptr)chair, 1L, 0L, 5L, 11L, 5L);
-  m_choosecursor(1L);
-  m_setlinestyle(1L, 0x8888L);
-  m_setlinestyle(2L, 0xaaaaL);
-  colortrans[0] = cyan;
-  colortrans[1] = green;
-  colortrans[2] = yellow;
-  colortrans[3] = red;
-  colortrans[6] = white;
-  fullcolor = (m_maxcolor > 7);
-  if (fullcolor) {
-    regionstyle = 0;
-    colortrans[4] = orange;
-    colortrans[5] = gray;
-  } else {
-    regionstyle = 1;
-    colortrans[4] = red2;
-    colortrans[5] = purple2;
-  }
-  dim();
-  chx = -10;
-  chy = -10;
-  scrwidth = nc_curWindow->width;
-  scrheight = nc_curWindow->height;   /*e.g., 24 or 47*/
-  setscale(1L);
-}
-
-
-Static boolean comparestr(s_, t_)
-Char *s_, *t_;
-{
-  Char s[256], t[256];
-
-  strcpy(s, s_);
-  strcpy(t, t_);
-  if (*t == '\0')
-    return true;
-  else
-    return (re_compare(s, t));
-}
-
-
-Static boolean comparegroup(gn, g)
-short gn;
-Char *g;
-{
-  if (*g == '\0')
-    return true;
-  else
-    return (strposc(g, gn + '0', 1L) != 0);
-}
-
-
-Static Void wildcards(s, g, verify)
-Char *s, *g;
-boolean *verify;
-{
-  long i, gi;
-  Char STR1[256];
-
-  strupper(s, s);
-  *verify = false;
-  gi = 0;
-  *g = '\0';
-  i = 1;
-  while (i <= strlen(s)) {
-    if (s[i - 1] == '?' || s[i - 1] == '%')
-      *verify = true;
-    if (s[i - 1] == '*' || s[i - 1] == '?')
-      s[i - 1] = '=';
-    else if (s[i - 1] == '%')
-      s[i - 1] = '.';
-    else if (s[i - 1] == ' ') {
-      s[i - 1] = '|';
-      while (i < strlen(s) && s[i] == ' ')
-	strcpy(s + i, s + i + 1);
-    } else if (s[i - 1] == ';') {
-      if (i == 1) {
-	gi = i + 1;
-	s[i - 1] = '*';
-      } else
-	gi = i;
-    } else if (gi != 0)
-      sprintf(g + strlen(g), "%c", s[i - 1]);
-    else if (strposc(re_defchars, s[i - 1], 1L) != 0) {
-      sprintf(STR1, "\\%s", s + i - 1);
-      strcpy(s + i - 1, STR1);
-      i++;
-    }
-    i++;
-  }
-  if (!strcmp(g, "*"))
-    *g = '\0';
-  if (gi != 0) {
-    s[gi - 1] = '\0';
-/* p2c: loged.text, line 674:
- * Note: Modification of string length may translate incorrectly [146] */
-  }
-  if (!strcmp(s, "=") || *s == '\0')
-    *s = '\0';
-  else
-    re_compile(s, s, "");
-}
-
-
-
-Static Char readyn(s)
-Char *s;
-{
-  Char ch;
-
-  do {
-    ch = toupper(nk_getkey());
-  } while (strposc(s, ch, 1L) == 0);
-  printf("%c\n", ch);
-  return ch;
-}
-
-
-
-Static Void crosshair(x, y)
-short x, y;
-{
-  if (x == chx && y == chy)
-    return;
-  m_colormode((long)m_xor);
-  m_color((long)white);
-  m_move(chx, chy);
-  m_drawchar((Anyptr)chair);
-  chx = x;
-  chy = y;
-  m_move(chx, chy);
-  m_drawchar((Anyptr)chair);
-  m_colormode((long)m_normal);
-}
-
-
-Static Void nocrosshair()
-{
-  crosshair(-10, -10);
-}
-
-
-Static Void drawnum(x, y, n)
-short x, y, n;
-{
-  Char STR1[256];
-
-  sprintf(STR1, "%d", n);
-  m_drawstr((long)x, (long)y, NULL, STR1);
-}
-
-
-Static Void drawnum2(x, y, n)
-short x, y, n;
-{
-  Char STR1[256];
-
-  sprintf(STR1, "%2d", n);
-  m_drawstr((long)x, (long)y, NULL, STR1);
-}
-
-
-Static Void drawnum3(x, y, n)
-short x, y, n;
-{
-  Char STR1[256];
-
-  sprintf(STR1, "%3d", n);
-  m_drawstr((long)x, (long)y, NULL, STR1);
-}
-
-
-Static Void erase(x1, y1, x2, y2)
-short x1, y1, x2, y2;
-{
-  m_color((long)black);
-  m_fillrect((long)x1, (long)y1, (long)x2, (long)y2);
-}
-
-
-Static Void diamond(x, y)
-short x, y;
-{
-  m_move(x - 3L, (long)y);
-  m_draw((long)x, y - 3L);
-  m_draw(x + 3L, (long)y);
-  m_draw((long)x, y + 3L);
-  m_draw(x - 3L, (long)y);
-}
-
-
-
-
-/*$ if debugloged $ $ debug $ $ end $*/
-
-
-Static Void growkind(k)
-krec *k;
-{
-  long i, FORLIM;
-  vectorrec *WITH1;
-
-  FORLIM = k->numvects;
-  for (i = 0; i < FORLIM; i++) {
-    WITH1 = &k->vector[i];
-    switch (WITH1->kind) {
-
-    case 'v':
-    case 'C':
-    case 'e':
-    case 'E':
-    case 'r':
-    case 'b':
-      while (!(P_ibetween((long)gridxmin, (long)WITH1->x1, (long)gridxmax) &&
-	  P_ibetween((long)gridymin, (long)WITH1->y1, (long)gridymax) &&
-	  P_ibetween((long)gridxmin, (long)WITH1->UU.U99.x2, (long)gridxmax) &&
-	  P_ibetween((long)gridymin, (long)WITH1->UU.U99.y2, (long)gridymax)))
-	setscale(gridscale + 1L);
-      break;
-
-    case 'F':
-    case 'c':
-      while (!(P_ibetween((long)gridxmin, (long)WITH1->x1, (long)gridxmax) &&
-	  P_ibetween((long)gridymin, (long)WITH1->y1, (long)gridymax) &&
-	  P_ibetween((long)gridxmin, (long)WITH1->UU.U99.x2, (long)gridxmax) &&
-	  P_ibetween((long)gridymin, (long)WITH1->UU.U99.y2, (long)gridymax) &&
-	  P_ibetween((long)gridxmin, (long)WITH1->UU.U99.x3, (long)gridxmax) &&
-	  P_ibetween((long)gridymin, (long)WITH1->UU.U99.y3, (long)gridymax) &&
-	  P_ibetween((long)gridxmin, (long)WITH1->UU.U99.x4, (long)gridxmax) &&
-	  P_ibetween((long)gridymin, (long)WITH1->UU.U99.y4, (long)gridymax)))
-/* p2c: loged.text, line 805: 
- * Note: Line breaker spent 2.0 seconds, 5000 tries on line 826 [251] */
-	setscale(gridscale + 1L);
-      break;
-
-    case 'p':
-      while (!(P_ibetween((long)gridxmin, (long)WITH1->x1, (long)gridxmax) &&
-	       P_ibetween((long)gridymin, (long)WITH1->y1, (long)gridymax)))
-	setscale(gridscale + 1L);
-      break;
-
-    case 't':
-      while (!(P_ibetween((long)gridxmin, (long)WITH1->x1, (long)gridxmax) &&
-	       P_ibetween((long)gridymin, (long)WITH1->y1, (long)gridymax)))
-	setscale(gridscale + 1L);
-      break;
-    }
-  }
-  FORLIM = k->numpins;
-  for (i = 0; i < FORLIM; i++) {
-    if (k->pinsim[i] != nopin) {
-      while (!(P_ibetween((long)gridxmin, (long)k->pin[i].x, (long)gridxmax) &&
-	       P_ibetween((long)gridymin, (long)k->pin[i].y, (long)gridymax)))
-	setscale(gridscale + 1L);
-    }
-  }
-  while (!(P_ibetween((long)gridxmin, (long)k->xx1, (long)gridxmax) &&
-	   P_ibetween((long)gridymin, (long)k->yy1, (long)gridymax) &&
-	   P_ibetween((long)gridxmin, (long)k->xx2, (long)gridxmax) &&
-	   P_ibetween((long)gridymin, (long)k->yy2, (long)gridymax)))
-    setscale(gridscale + 1L);
-}
-
-
-
-Static Void autoscale(sc)
-long sc;
-{
-  setscale(sc);
-  if (curkind != NULL)
-    growkind(&kind);
-  if (shadowkind != NULL && shadowkind != curkind)
-    growkind(shadowkind);
-}
-
-
-
-
-Static boolean before(n1, n2)
-Char *n1, *n2;
-{
-  long i, j;
-
-  if (*n1 == '\0' || *n2 == '\0' || n1[0] < '0' || n1[0] > '9' ||
-      n2[0] < '0' || n2[0] > '9')
-    return (strcmp(n1, n2) < 0);
-  else {
-    i = 1;
-    while (i <= strlen(n1) && isdigit(n1[i - 1]))
-      i++;
-    j = 1;
-    while (j <= strlen(n2) && isdigit(n2[j - 1]))
-      j++;
-    if (i < j)
-      return true;
-    else if (i > j)
-      return false;
-    else
-      return (strcmp(n1, n2) < 0);
-  }
-}
-
-
-
-Static boolean addkind(n_)
-Char *n_;
-{
-  boolean Result;
-  Char n[9];
-  krec *k, *k1;
-
-  strncpy(n, n_, 8);
-  n[8] = '\0';
-  strupper(n, n);
-  k = kbase;
-  k1 = NULL;
-  while (k != NULL && before(k->name, n)) {
-    k1 = k;
-    k = k->next;
-  }
-  if (k != NULL && !strcmp(k->name, n))
-    Result = false;
-  else {
-    k = (krec *)Malloc(sizeof(krec));
-    strcpy(k->name, n);
-    if (k1 == NULL) {
-      k->next = kbase;
-      kbase = k;
-    } else {
-      k->next = k1->next;
-      k1->next = k;
-    }
-    k->proclen = 0;
-    k->lbllen = 0;
-    k->allocvects = 0;
-    k->pinnames = NULL;
-    Result = true;
-  }
-  curkind = k;
-  return Result;
-}
-
-
-Static Void reallocproc(k, len)
-krec *k;
-long len;
-{
-  long newlen;
-  uchar *newproc;
-
-  if (k->proclen == 0) {
-    k->proclen = 32;
-    while (k->proclen < len)
-      k->proclen *= 2;
-    k->proc = (uchar *)Malloc(k->proclen);
-    return;
-  }
-  if (k->proclen >= len)
-    return;
-  newlen = k->proclen;
-  while (newlen < len)
-    newlen *= 2;
-  newproc = (uchar *)Malloc(newlen);
-  memmove((Anyptr)newproc, (Anyptr)k->proc, k->proclen);
-  Free(k->proc);
-  k->proclen = newlen;
-  k->proc = newproc;
-}
-
-
-Static Void realloclbl(k, len)
-krec *k;
-long len;
-{
-  long newlen;
-  Char *newlbl;
-
-  if (k->lbllen == 0) {
-    k->lbllen = 32;
-    while (k->lbllen < len)
-      k->lbllen *= 2;
-    k->lbl = (Char *)Malloc(k->lbllen);
-    return;
-  }
-  if (k->lbllen >= len)
-    return;
-  newlen = k->lbllen;
-  while (newlen < len)
-    newlen *= 2;
-  newlbl = (Char *)Malloc(newlen);
-  memmove((Anyptr)newlbl, (Anyptr)k->lbl, k->lbllen);
-  Free(k->lbl);
-  k->lbllen = newlen;
-  k->lbl = newlbl;
-}
-
-
-Static Void reallocvects(k, len)
-krec *k;
-long len;
-{
-  long newlen;
-  vectorrec *newvects;
-
-  if (k->allocvects == 0) {
-    k->allocvects = 32;
-    while (k->allocvects < len)
-      k->allocvects *= 2;
-    k->vector = (vectorrec *)Malloc(k->allocvects * sizeof(vectorrec));
-    return;
-  }
-  if (k->allocvects >= len)
-    return;
-  newlen = k->allocvects;
-  while (newlen < len)
-    newlen *= 2;
-  newvects = (vectorrec *)Malloc(newlen * sizeof(vectorrec));
-  memmove((Anyptr)newvects, (Anyptr)k->vector,
-	  k->allocvects * sizeof(vectorrec));
-  Free(k->vector);
-  k->allocvects = newlen;
-  k->vector = newvects;
-}
-
-
-
-Static Void flushcurkind()
-{
-  if (curkind != NULL) {
-    kind.next = curkind->next;
-    *curkind = kind;
-  }
-}
-
-
-Static Void makekind(n)
-Char *n;
-{
-  flushcurkind();
-  if (!addkind(n)) {
-    kind = *curkind;
-    autoscale(1L);
-    return;
-  }
-  reallocproc(curkind, 1L);
-  curkind->proc[0] = '\0';
-  realloclbl(curkind, 1L);
-  curkind->lbl[0] = '\0';
-  curkind->numpins = 0;
-  curkind->numpnums = 0;
-  curkind->numvects = 0;
-  curkind->vector = NULL;
-  curkind->pinnames = NULL;
-  curkind->group = 0;
-  curkind->simtype = newsimtype;
-  curkind->flag.i = 0;
-  curkind->xx1 = -25;
-  curkind->yy1 = -25;
-  curkind->xx2 = 25;
-  curkind->yy2 = 25;
-  savedflag = false;
-  kind = *curkind;
-}
-
-
-Static Void wrmsg(s)
-Char *s;
-{
-  nc_gotoXY(0, (int)(scrheight - 5));
-  printf("%s\007", s);
-  nc_gotoXY(0, (int)(scrheight - 3));
-  errorflag = true;
-}
-
-
-Static long compress(i)
-long i;
-{
-  long j, k;
-
-  if (i == 0)
-    return 0;
-  else {
-    if (i < 68)
-      i = 68;
-    j = na_log2(i) - 4;
-    if (j < 2)   /* j = max(2, floor(log_2(i/16))) */
-      j = 2;
-    i += na_po2(j) - 1;   /* i' = i + (2^j-1) */
-    k = ((unsigned long)i) >> j;   /* k = ceil(i / 2^j), in [16..31] */
-/* p2c: loged.text, line 1032:
- * Note: Assuming count for NA_LSL is negative [506] */
-    return ((j - 2) * 16 + k - 16);
-  }
-}
-
-
-Static long uncompress(i)
-long i;
-{
-  if (i < 0)
-    i += 256;
-  if (i == 0)
-    return 0;
-  else
-    return (na_po2(i / 16) * ((i & 15) + 16) * 4);
-}
-
-
-/* Local variables for wshapes: */
-struct LOC_wshapes {
-  FILE *f;
-  short p, r;
-  long vsize;
-  FILEBUFNC(f,filerec);
-} ;
-
-Local Void writeint(LINK)
-struct LOC_wshapes *LINK;
-{
-  if (LINK->p != 64)
-    return;
-  PUT(LINK->f, filerec);
-  LINK->r++;
-  LINK->p = 0;
-}
-
-Local Void writechar(val, LINK)
-long val;
-struct LOC_wshapes *LINK;
-{
-  if (LINK->p == 256) {
-    PUT(LINK->f, filerec);
-    LINK->r++;
-    LINK->p = 0;
-  }
-  if (val == LONG_MAX)
-    GETFBUF(LINK->f, filerec).b[LINK->p] = 0;
-  else {
-    val &= 255;
-    if (val == 0)
-      GETFBUF(LINK->f, filerec).b[LINK->p] = 128;
-    else
-      GETFBUF(LINK->f, filerec).b[LINK->p] = val;
-  }
-  LINK->p++;
-  LINK->vsize++;
-}
-
-
-
-Static Void wshapes(s_)
-Char *s_;
-{
-  struct LOC_wshapes V;
-  Char s[256], s1[256];
-  krec *k;
-  short ng, ii;
-  int i, j;
-  na_strlist *l1;
-  boolean success;
-  short FORLIM;
-  vectorrec *WITH;
-  short FORLIM1;
-  Char STR1[256];
-  Char STR3[256];
-  descrec *WITH1;
-
-  strcpy(s, s_);
-  V.f = NULL;
-  do {
-    TRY(try1);
-      if (*s != '\0' && kbase != NULL) {
-	flushcurkind();
-	i = strcipos2(s, ".gate", 1L);
-	if (i != 0) {
-	  TRY(try2);
-	    strcpy(s1, s);
-	    s1[i] = 'o';
-	    s1[i + 1] = 'g';
-	    if (V.f != NULL)
-#ifndef OS2
-	      V.f = freopen(s, "r", V.f);
-#else
-	      V.f = freopen(s, "rb", V.f);
-#endif
-	    else
-#ifndef OS2
-	      V.f = fopen(s, "r");
-#else
-	      V.f = fopen(s, "rb");
-#endif
-	    if (V.f == NULL) {
-	      P_escapecode = -10;
-	      P_ioresult = FileNotFound;
-	      goto _Ltry2;
-	    }
-	    RESETBUF(V.f, filerec);
-	    if (V.f != NULL)
-	      fclose(V.f);
-	    V.f = NULL;
-	    TRY(try3);
-	      fp_remove(s1);
-	    RECOVER(try3);
-	      ;
-	    ENDTRY(try3);
-	    fp_change(s, s1);
-	  RECOVER2(try2,_Ltry2);
-	    ;
-	  ENDTRY(try2);
-	} else {
-	  TRY(try4);
-	    fp_remove(s);
-	  RECOVER(try4);
-	    ;
-	  ENDTRY(try4);
-	}
-	if (V.f != NULL)
-#ifndef OS2
-	  V.f = freopen(s, "r", V.f);
-#else
-	  V.f = freopen(s, "rb", V.f);
-#endif
-	else
-#ifndef OS2
-	  V.f = fopen(s, "r");
-#else
-	  V.f = fopen(s, "rb");
-#endif
-	if (V.f == NULL)
-#ifndef OS2
-	  V.f = fopen(s, "w+");
-#else
-	  V.f = fopen(s, "wb+");
-#endif
-	if (V.f == NULL) {
-	  P_escapecode = -10;
-	  P_ioresult = FileNotFound;
-	  goto _Ltry1;
-	}
-	SETUPBUF(V.f, filerec);
-	ng = 0;
-	k = kbase;
-	while (k != NULL) {
-	  ng++;
-	  k = k->next;
-	}
-	GETFBUF(V.f, filerec).i[0] = 0;   /*version num*/
-	GETFBUF(V.f, filerec).sh[2] = shortsw(ng);
-	GETFBUF(V.f, filerec).b[6] = ng / 32 + 1;
-	GETFBUF(V.f, filerec).b[7] = 0;   /*reserved*/
-	V.p = 1;
-	k = kbase;
-	while (k != NULL) {
-	  if (V.p == 32) {
-	    PUT(V.f, filerec);
-	    V.p = 0;
-	  }
-	  memcpy(GETFBUF(V.f, filerec).ix[V.p], "        ", sizeof(gatename));
-	  strmove(strlen(k->name), k->name, 1, GETFBUF(V.f, filerec).ix[V.p],
-		  1);
-	  if (k->group != 0)
-	    GETFBUF(V.f, filerec).ix[V.p][k->group - 1] += 128;
-	  V.p++;
-	  k = k->next;
-	}
-	while (V.p < 32) {
-	  GETFBUF(V.f, filerec).i[V.p * 2] = 0;
-	  GETFBUF(V.f, filerec).i[V.p * 2 + 1] = 0;
-	  V.p++;
-	}
-	PUT(V.f, filerec);
-
-	V.r = ng / 32 + (ng + 15) / 16 + 1;
-	fseek(V.f, V.r * sizeof(filerec), 0);
-	SETUPBUF(V.f, filerec);
-	V.p = 0;
-	k = kbase;
-	while (k != NULL) {
-	  k->address = V.p + V.r * 64;
-	  i = 1;
-	  while (k->lbl[i - 1] != '\0')
-	    i++;
-	  l1 = k->pinnames;
-	  j = 0;
-	  while (l1 != NULL) {
-	    if ((long)l1->value > j)
-	      i += (long)l1->value - j - 1;
-	    j = (long)l1->value;
-	    i += strlen(l1->s) + 1;
-	    l1 = l1->next;
-	  }
-	  k->sizelbl = i - (i == 1) + (k->pinnames != NULL);
-	  i = 1;
-	  while (k->proc[i - 1] != '\0')
-	    i++;
-	  k->sizeproc = i - (i == 1);
-	  k->flag.U3.expanded = (k->sizelbl > 1020 || k->sizeproc > 1020);
-	  FORLIM = k->numvects;
-	  for (i = 0; i < FORLIM; i++) {
-	    WITH = &k->vector[i];
-	    if (WITH->kind != 'v' || WITH->col != 1)
-	      k->flag.U3.expanded = true;
-	  }
-	  if (k->flag.U3.expanded) {
-	    k->sizelbl = uncompress(compress(k->sizelbl));
-	    k->sizeproc = uncompress(compress(k->sizeproc));
-	    if (k->numvects > 0) {
-	      V.vsize = 1;
-	      V.p *= 4;
-	      j = 1;
-	      FORLIM = k->numvects;
-	      for (i = 0; i < FORLIM; i++) {
-		WITH = &k->vector[i];
-		if (WITH->col != j && (WITH->kind == 't' || WITH->kind == 'c' ||
-		      WITH->kind == 'r' || WITH->kind == 'E' ||
-		      WITH->kind == 'e' || WITH->kind == 'F' ||
-		      WITH->kind == 'C' || WITH->kind == 'v')) {
-		  writechar(WITH->col + 48L, &V);
-		  j = WITH->col;
-		}
-		writechar((long)WITH->kind, &V);
-		switch (WITH->kind) {
-
-		case 'v':
-		case 'C':
-		case 'e':
-		case 'E':
-		  writechar((long)WITH->x1, &V);
-		  writechar((long)WITH->y1, &V);
-		  writechar((long)WITH->UU.U99.x2, &V);
-		  writechar((long)WITH->UU.U99.y2, &V);
-		  break;
-
-		case 'r':
-		  writechar((long)WITH->x1, &V);
-		  writechar((long)WITH->y1, &V);
-		  writechar((long)WITH->UU.U99.x2, &V);
-		  writechar((long)WITH->UU.U99.y2, &V);
-		  writechar((long)WITH->UU.U98.num, &V);
-		  break;
-
-		case 'F':
-		case 'c':
-		  writechar((long)WITH->x1, &V);
-		  writechar((long)WITH->y1, &V);
-		  writechar((long)WITH->UU.U99.x2, &V);
-		  writechar((long)WITH->UU.U99.y2, &V);
-		  writechar((long)WITH->UU.U99.x3, &V);
-		  writechar((long)WITH->UU.U99.y3, &V);
-		  writechar((long)WITH->UU.U99.x4, &V);
-		  writechar((long)WITH->UU.U99.y4, &V);
-		  break;
-
-		case 'p':
-		  writechar((long)WITH->UU.U98.num, &V);
-		  writechar((long)WITH->x1, &V);
-		  writechar((long)WITH->y1, &V);
-		  break;
-
-		case 'b':
-		  writechar((long)WITH->UU.U98.num, &V);
-		  writechar((long)WITH->x1, &V);
-		  writechar((long)WITH->y1, &V);
-		  writechar((long)WITH->UU.U99.x2, &V);
-		  writechar((long)WITH->UU.U99.y2, &V);
-		  break;
-
-		case 't':
-		  writechar((long)WITH->UU.U116.tsize, &V);
-		  writechar(WITH->UU.U116.torg + 1L, &V);
-		  writechar((long)WITH->x1, &V);
-		  writechar((long)WITH->y1, &V);
-		  writechar((long)strlen(WITH->UU.U116.sp), &V);
-		  FORLIM1 = strlen(WITH->UU.U116.sp);
-		  for (ii = 0; ii < FORLIM1; ii++)
-		    writechar((long)WITH->UU.U116.sp[ii], &V);
-		  break;
-		}
-	      }
-	      k->sizevects = uncompress(compress(V.vsize));
-	      FORLIM = k->sizevects;
-	      for (j = V.vsize; j <= FORLIM; j++)
-		writechar(LONG_MAX, &V);
-	      V.p /= 4;
-	    } else
-	      k->sizevects = 0;
-	  } else {
-	    k->sizelbl = (k->sizelbl + 3) / 4 * 4;
-	    k->sizeproc = (k->sizeproc + 3) / 4 * 4;
-	    k->sizevects = k->numvects * 4;
-	    FORLIM = k->numvects;
-	    for (i = 0; i < FORLIM; i++) {
-	      writeint(&V);
-	      GETFBUF(V.f, filerec).vec[V.p].x1 = k->vector[i].x1;
-	      GETFBUF(V.f, filerec).vec[V.p].y1 = k->vector[i].y1;
-	      GETFBUF(V.f, filerec).vec[V.p].x2 = k->vector[i].UU.U99.x2;
-	      GETFBUF(V.f, filerec).vec[V.p].y2 = k->vector[i].UU.U99.y2;
-	      V.p++;
-	    }
-	  }
-	  FORLIM = k->numpins;
-	  for (i = 1; i <= FORLIM; i++) {
-	    writeint(&V);
-	    if (k->pinsim[i - 1] == nopin) {
-	      GETFBUF(V.f, filerec).pin[V.p].x = 0;
-	      GETFBUF(V.f, filerec).pin[V.p].y = 0;
-	      GETFBUF(V.f, filerec).pin[V.p].s = 0;
-	      GETFBUF(V.f, filerec).pin[V.p].c = 0;
-	      printf("Warning: missing pin %d of %s\n", i, k->name);
-	    } else {
-	      GETFBUF(V.f, filerec).pin[V.p].x = k->pin[i - 1].x;
-	      GETFBUF(V.f, filerec).pin[V.p].y = k->pin[i - 1].y;
-	      GETFBUF(V.f, filerec).pin[V.p].s = k->pinsim[i - 1];
-	      GETFBUF(V.f, filerec).pin[V.p].c = k->pincon[i - 1];
-	    }
-	    V.p++;
-	  }
-	  if (!k->flag.U3.expanded) {
-	    FORLIM = k->numpnums;
-	    for (i = 0; i < FORLIM; i++) {
-	      writeint(&V);
-	      GETFBUF(V.f, filerec).pnum[V.p].x = k->pinoff[i].x;
-	      GETFBUF(V.f, filerec).pnum[V.p].y = k->pinoff[i].y;
-	      GETFBUF(V.f, filerec).pnum[V.p].num = shortsw(k->pinnum[i]);
-	      V.p++;
-	    }
-	  }
-	  if (k->sizelbl != 0) {
-	    V.vsize = 0;
-	    V.p *= 4;
-	    i = 0;
-	    l1 = k->pinnames;
-	    while (l1 != NULL) {
-	      if ((long)l1->value == i)
-		writechar(3L, &V);
-	      while ((long)l1->value > i) {
-		writechar(2L, &V);
-		i++;
-	      }
-	      FORLIM = strlen(l1->s);
-	      for (j = 0; j < FORLIM; j++)
-		writechar((long)l1->s[j], &V);
-	      l1 = l1->next;
-	    }
-	    if (k->pinnames != NULL)
-	      writechar(1L, &V);
-	    i = 1;
-	    while (k->lbl[i - 1] != '\0') {
-	      writechar((long)k->lbl[i - 1], &V);
-	      i++;
-	    }
-	    while (V.vsize < k->sizelbl)
-	      writechar(LONG_MAX, &V);
-	    V.p /= 4;
-	  }
-	  if (k->proc[0] != '\0') {
-	    writeint(&V);
-	    j = 0;
-	    i = 0;
-	    do {
-	      i++;
-	      if (j == 4) {
-		V.p++;
-		writeint(&V);
-		j = 0;
-	      }
-	      GETFBUF(V.f, filerec).b[V.p * 4 + j] = k->proc[i - 1];
-	      j++;
-	    } while (k->proc[i - 1] != '\0');
-	    while (j < 4) {
-	      i++;
-	      GETFBUF(V.f, filerec).b[V.p * 4 + j] = 0;
-	      j++;
-	    }
-	    V.p++;
-	    while (i < k->sizeproc) {
-	      i += 4;
-	      writeint(&V);
-	      GETFBUF(V.f, filerec).i[V.p] = 0;
-	      V.p++;
-	    }
-	  }
-	  k = k->next;
-	}
-	while (V.p < 64) {
-	  GETFBUF(V.f, filerec).i[V.p] = 0;
-	  V.p++;
-	}
-	PUT(V.f, filerec);
-
-	fseek(V.f, (ng / 32L + 1) * sizeof(filerec), 0);
-	SETUPBUF(V.f, filerec);
-	V.p = 0;
-	k = kbase;
-	while (k != NULL) {
-	  if (V.p == 16) {
-	    PUT(V.f, filerec);
-	    V.p = 0;
-	  }
-	  WITH1 = (descrec *) malloc(sizeof(descrec));
-	  WITH1->ptr = k->address;
-	  WITH1->numpins = k->numpins;
-	  WITH1->simtype = k->simtype;
-	  WITH1->flag = k->flag.i;
-	  if (k->flag.U3.expanded) {
-	    WITH1->numvects = k->numvects;
-	    WITH1->numpnums = compress(k->sizevects);
-	    WITH1->lblsize = compress(k->sizelbl);
-	    WITH1->procsize = compress(k->sizeproc);
-	  } else {
-	    WITH1->numvects = k->numvects;
-	    WITH1->numpnums = k->numpnums;
-	    WITH1->lblsize = k->sizelbl / 4;
-	    WITH1->procsize = k->sizeproc / 4;
-	  }
-	  WITH1->xx1 = k->xx1;
-	  WITH1->yy1 = k->yy1;
-	  WITH1->xx2 = k->xx2;
-	  WITH1->yy2 = k->yy2;
-          writedesc(&GETFBUF(V.f, filerec).b[16*(V.p & 15)],WITH1);
-	  V.p++;
-	  k = k->next;
-	}
-	while (V.p < 16) {
-	  GETFBUF(V.f, filerec).i[V.p * 4] = 0;
-	  GETFBUF(V.f, filerec).i[V.p * 4 + 1] = 0;
-	  GETFBUF(V.f, filerec).i[V.p * 4 + 2] = 0;
-	  GETFBUF(V.f, filerec).i[V.p * 4 + 3] = 0;
-	  V.p++;
-	}
-	PUT(V.f, filerec);
-	if (V.f != NULL)
-	  fclose(V.f);
-	V.f = NULL;
-	savedflag = true;
-      }
-      success = true;
-    RECOVER2(try1,_Ltry1);
-      j = P_ioresult;
-      nc_gotoXY(0, (int)(scrheight - 5));
-      putchar('\t');
-      if (j == 41)
-	printf("\007File %s is in use", s);
-      else {
-	sprintf(STR1, "Unable to save file %s", s);
-	printf("\007%s", _ShowEscape(STR3, P_escapecode, j, STR1));
-      }
-      printf("; new file name: ");
-      gets(s1);
-      nc_gotoXY(0, (int)(scrheight - 3));
-      putchar('\t');
-      success = false;
-      if (*s1 == '\0')
-	success = true;
-      else if (strcmp(s1, "$"))
-	strcpy(s, s1);
-    ENDTRY(try1);
-  } while (!success);
-  if (V.f != NULL)
-    fclose(V.f);
-}
-
-
-Local Void copykind(k, o)
-krec *k;
-oldrec *o;
-{
-  krec *k1;
-  long i, FORLIM;
-  vectorrec *WITH;
-
-  k1 = k->next;
-  reallocproc(k, 256L);
-  for (i = 0; i <= 255; i++)
-    k->proc[i] = o->proc[i];
-  k->xx1 = o->xx1;
-  k->yy1 = o->yy1;
-  k->xx2 = o->xx2;
-  k->yy2 = o->yy2;
-  k->numpins = o->numpins;
-  FORLIM = o->numpins;
-  for (i = 0; i < FORLIM; i++) {
-    k->pin[i].x = o->pin[i].x;
-    k->pin[i].y = o->pin[i].y;
-  }
-  k->numvects = o->numvects;
-  reallocvects(k, (long)k->numvects);
-  FORLIM = o->numvects;
-  for (i = 0; i < FORLIM; i++) {
-    WITH = &k->vector[i];
-    WITH->kind = 'v';
-    WITH->col = 1;
-    WITH->x1 = o->vector[i].x1;
-    WITH->y1 = o->vector[i].y1;
-    WITH->UU.U99.x2 = o->vector[i].x2;
-    WITH->UU.U99.y2 = o->vector[i].y2;
-  }
-  k->numpnums = 0;
-  k->group = 0;
-  realloclbl(k, 1L);
-  k->lbl[0] = '\0';
-  k->flag.i = 0;
-  k->next = k1;
-}
-
-
-Static Void roshapes(s_, gname_)
-Char *s_, *gname_;
-{
-  Char s[256], gname[256], ggroup[256];
-  FILE *f;
-  Char name[9];
-  krec *k1;
-  Char ch;
-  boolean verify, useit;
-  Char STR1[256];
-  Char STR3[256];
-  Char *TEMP;
-  FILEBUFNC(f,oldrec);
-
-  strcpy(s, s_);
-  strcpy(gname, gname_);
-  f = NULL;
-  wildcards(gname, ggroup, &verify);
-  if (*s != '\0') {
-    TRY(try5);
-      newci_fixfname(s, "gate", "/LIB/LOG/");
-      k1 = curkind;
-      TRY(try6);
-	if (f != NULL)
-#ifndef OS2
-	  f = freopen(s, "r", f);
-#else
-	  f = freopen(s, "rb", f);
-#endif
-	else
-#ifndef OS2
-	  f = fopen(s, "r");
-#else
-	  f = fopen(s, "rb");
-#endif
-	if (f == NULL) {
-	  P_escapecode = -10;
-	  P_ioresult = FileNotFound;
-	  goto _Ltry6;
-	}
-	RESETBUF(f, oldrec);
-      RECOVER2(try6,_Ltry6);
-	if (f != NULL) {
-	  sprintf(STR1, "/LIB/LOG/%s", s);
-#ifndef OS2
-	  f = freopen(STR1, "r", f);
-#else
-	  f = freopen(STR1, "rb", f);
-#endif
-	} else {
-	  sprintf(STR1, "/LIB/LOG/%s", s);
-#ifndef OS2
-	  f = fopen(STR1, "r");
-#else
-	  f = fopen(STR1, "rb");
-#endif
-	}
-	if (f == NULL) {
-	  P_escapecode = -10;
-	  P_ioresult = FileNotFound;
-	  goto _Ltry5;
-	}
-	RESETBUF(f, oldrec);
-	nc_gotoXY(0, (int)(scrheight - 5));
-	printf("Using file name /lib/log/%s\n", s);
-	nc_gotoXY(0, (int)(scrheight - 3));
-      ENDTRY(try6);
-      while (!P_eof(f)) {
-	name[8] = '\0';
-	strmove(8, GETFBUF(f, oldrec).name, 1, name, 1);
-	strcpy(name, strrtrim(strcpy(STR3, name)));
-	useit = false;
-	if (comparestr(name, gname)) {
-	  if (verify) {
-	    printf("Load %s? ", name);
-	    do {
-	      ch = nk_getkey();
-	    } while (ch != ' ' && ch != 'R' && ch != 'r' && ch != 'N' &&
-		     ch != 'n' && ch != 'Y' && ch != 'y');
-	    if (ch == ' ')
-	      ch = 'N';
-	    if (ch == 'R' || ch == 'r') {
-	      printf("Rename as: ");
-	      fgets(name, 9, stdin);
-	      TEMP = (char *) strchr(name, '\n');
-	      if (TEMP != NULL)
-		*TEMP = 0;
-	      /*name := strupper(name);*/
-	      if (*name == '\0')
-		ch = 'N';
-	    } else
-	      printf("%c\n", ch);
-	    useit = (ch == 'R' || ch == 'r' || ch == 'Y' || ch == 'y');
-	    menuflag = true;
-	  } else
-	    useit = true;
-	}
-	if (useit) {
-	  if (addkind(name)) {
-	    if (*gname != '\0' && !verify) {
-	      printf("Loaded: %s\n", name);
-	      menuflag = true;
-	    }
-	    copykind(curkind, &GETFBUF(f, oldrec));
-	    strcpy(curkind->name, name);
-	  } else if (verify) {
-	    printf("%s already exists (overwritten)\n", name);
-	    copykind(curkind, &GETFBUF(f, oldrec));
-	  } else {
-	    printf("%s already exists (not loaded)\n", name);
-	    menuflag = true;
-	  }
-	}
-	GET(f, oldrec);
-      }
-      if (f != NULL)
-	fclose(f);
-      f = NULL;
-      curkind = k1;
-    RECOVER2(try5,_Ltry5);
-      if (P_escapecode != -20) {
-	sprintf(STR1, "Can't find or load file %s", s);
-	wrmsg(STR1);
-      }
-    ENDTRY(try5);
-  }
-  if (f != NULL)
-    fclose(f);
-}
-
-
-typedef krec *loadindex[10000];
-
-
-/* Local variables for rshapes: */
-struct LOC_rshapes {
-  FILE *f;
-  long j, p;
-  uchar *vects;
-  FILEBUFNC(f,filerec);
-} ;
-
-Local Void readint(LINK)
-struct LOC_rshapes *LINK;
-{
-  if (LINK->p == 64) {
-    GET(LINK->f, filerec);
-    LINK->p = 0;
-  }
-}
-
-Local long readnum(LINK)
-struct LOC_rshapes *LINK;
-{
-  long Result;
-
-  Result = LINK->vects[LINK->j];
-  LINK->j++;
-  return Result;
-}
-
-Local long readcoord(LINK)
-struct LOC_rshapes *LINK;
-{
-  long Result;
-
-  if (LINK->vects[LINK->j] < 128) {
-/* p2c: loged.text, line 1607: Note: Character >= 128 encountered [281] */
-    Result = LINK->vects[LINK->j];
-  } else if (LINK->vects[LINK->j] == 128) {
-/* p2c: loged.text, line 1609: Note: Character >= 128 encountered [281] */
-    Result = 0;
-  } else
-    Result = LINK->vects[LINK->j] - 256;
-  LINK->j++;
-  return Result;
-}
-
-Local Void parsepinnames(kind, LINK)
-krec *kind;
-struct LOC_rshapes *LINK;
-{
-  long i, j, num;
-  na_strlist *l1;
-  Char buf[256];
-
-  num = 0;
-  i = 1;
-  while (kind->lbl[i - 1] > '\001') {
-    if (kind->lbl[i - 1] == '\002')
-      num++;
-    i++;
-    *buf = '\0';
-    while (kind->lbl[i - 1] > '\003') {
-      sprintf(buf + strlen(buf), "%c", kind->lbl[i - 1]);
-      i++;
-    }
-    if (*buf != '\0') {
-      l1 = strlist_append(&kind->pinnames, buf);
-      l1->value = (na_long)num;
-    }
-  }
-  if (kind->lbl[i - 1] == '\001')
-    i++;
-  j = i;
-  while (kind->lbl[j - 1] != '\0')
-    j++;
-  memmove((Anyptr)kind->lbl, (Anyptr)(&kind->lbl[i - 1]), j - i + 1);
-}
-
-
-
-Static boolean rshapes(s_, gname_)
-Char *s_, *gname_;
-{
-  struct LOC_rshapes V;
-  boolean Result;
-  Char s[256], gname[256];
-  krec **li;
-  Char s0[256], s1[256], ggroup[256], tbuf[256];
-  Char name[9];
-  krec *k, *k0, *k1;
-  long i, j0, j1, curcol, r, gr;
-  short ng;
-  Char ch;
-  boolean verify, useit, loadany, flag;
-  Char STR1[256];
-  Char STR2[256];
-  Char STR3[32];
-  long FORLIM;
-  Char STR4[40];
-  Char *TEMP;
-  descrec *WITH;
-  vectorrec *WITH2;
-  Char STR5[256];
-
-  strcpy(s, s_);
-  strcpy(gname, gname_);
-  V.f = NULL;
-  Result = true;
-  li = NULL;
-  wildcards(gname, ggroup, &verify);
-  strcpy(s0, s);
-  if (*s != '\0') {
-    TRY(try7);
-      newci_fixfname(s, "gate", "/LIB/LOG/");
-      k1 = curkind;
-      strcpy(s1, s);
-      TRY(try8);
-	if (V.f != NULL)
-	  V.f = freopen(s1, "rb", V.f);
-	else
-	  V.f = fopen(s1, "rb");
-	if (V.f == NULL) {
-	  P_escapecode = -10;
-	  P_ioresult = FileNotFound;
-	  goto _Ltry8;
-	}
-	RESETBUF(V.f, filerec);
-      RECOVER2(try8,_Ltry8);
-	sprintf(s1, "/lib/log/%s", s);
-	if (V.f != NULL)
-	  V.f = freopen(s1, "rb", V.f);
-	else
-	  V.f = fopen(s1, "rb");
-	if (V.f == NULL) {
-	  P_escapecode = -10;
-	  P_ioresult = FileNotFound;
-	  goto _Ltry7;
-	}
-	RESETBUF(V.f, filerec);
-	nc_gotoXY(0, (int)(scrheight - 5));
-	printf("Using file name %s\n", s1);
-	nc_gotoXY(0, (int)(scrheight - 3));
-      ENDTRY(try8);
-      for (i = 1; i <= 4; i++) {
-	fread(&ch, 1, 1, V.f);
-	if (ch == '#') {
-	  if (V.f != NULL)
-	    fclose(V.f);
-	  V.f = NULL;
-	  Result = false;   /* It's a textual file */
-	  P_escapecode = 0;
-	  goto _Ltry7;
-	}
-	if (ch != '\0') {
-	  if (V.f != NULL)
-	    fclose(V.f);
-	  V.f = NULL;
-	  wrmsg("Wrong version number, or bad file format!");
-	  P_escapecode = 0;
-	  goto _Ltry7;
-	}
-      }
-      flag = false;
-      for (i = 1; i <= 12; i++) {
-	fread(&ch, 1, 1, V.f);
-	if (ch != '\0')
-	  flag = true;
-      }
-      if (!flag) {
-	if (V.f != NULL)
-	  fclose(V.f);
-	V.f = NULL;
-	Result = false;   /* Probably a textual file */
-	P_escapecode = 0;
-	goto _Ltry7;
-      }
-/* p2c: loged.text, line 1701: Note: OPEN does not specify a name [181] */
-      if (V.f != NULL)
-	rewind(V.f);
-      else
-	V.f = tmpfile();
-      if (V.f == NULL) {
-	P_escapecode = -10;
-	P_ioresult = FileNotFound;
-	goto _Ltry7;
-      }
-      SETUPBUF(V.f, filerec);
-      fseek(V.f, 0L, 0);
-      SETUPBUF(V.f, filerec);
-      GET(V.f, filerec);
-      ng = getshortsw(&GETFBUF(V.f, filerec).b[4]);
-      li = (krec **)Malloc(ng * sizeof(krec *));
-      for (i = 0; i < ng; i++)
-	li[i] = NULL;
-      loadany = false;
-      V.p = 1;
-      r = 0;
-      for (i = 0; i < ng; i++) {
-	if (V.p >= 32) {
-	  r += 64;
-	  GET(V.f, filerec);
-	  V.p = 0;
-	}
-	name[8] = '\0';
-	strmove(8, GETFBUF(V.f, filerec).ix[V.p], 1, name, 1);
-	gr = 0;
-	for (V.j = 1; V.j <= 8; V.j++) {
-	  if ((name[V.j - 1] & (~127)) != 0) {
-/* p2c: loged.text, line 1723: Note: Character >= 128 encountered [281] */
-	    gr = V.j;
-	    name[V.j - 1] = (Char)((uchar)name[V.j - 1] - 128);
-	  }
-	}
-	strcpy(name, strrtrim(strcpy(STR2, name)));
-	useit = false;
-	if (comparestr(name, gname) && comparegroup((int)gr, ggroup)) {
-	  if (verify) {
-	    printf("Load %s? ", name);
-	    do {
-	      ch = nk_getkey();
-	    } while (ch != ' ' && ch != 'R' && ch != 'r' && ch != 'N' &&
-		     ch != 'n' && ch != 'Y' && ch != 'y');
-	    if (ch == ' ')
-	      ch = 'N';
-	    if (ch == 'R' || ch == 'r') {
-	      printf("Rename as: ");
-	      fgets(name, 9, stdin);
-	      TEMP = (char *) strchr(name, '\n');
-	      if (TEMP != NULL)
-		*TEMP = 0;
-	      /*name := strupper(name);*/
-	      if (*name == '\0')
-		ch = 'N';
-	    } else
-	      printf("%c\n", ch);
-	    useit = (ch == 'R' || ch == 'r' || ch == 'Y' || ch == 'y');
-	    menuflag = true;
-	  } else
-	    useit = true;
-	}
-	if (useit) {
-	  if (addkind(name)) {
-	    if (*gname != '\0' && !verify) {
-	      printf("Loaded: %s\n", name);
-	      menuflag = true;
-	    }
-	    li[i] = curkind;
-	    curkind->group = gr;
-	    loadany = true;
-	    strcpy(curkind->name, name);
-	  } else if (verify) {
-	    printf("%s already exists (overwritten)\n", name);
-	    loadany = true;
-	    li[i] = curkind;
-	    curkind->group = gr;
-	  } else {
-	    printf("%s already exists (not loaded)\n", name);
-	    menuflag = true;
-	  }
-	}
-	V.p++;
-      }
-      if (!loadany) {
-	wrmsg("No gates loaded");
-	P_escapecode = 0;
-	goto _Ltry7;
-      }
-      k = kbase;
-      while (k != NULL) {
-	k->address = 0;
-	k = k->next;
-      }
-      GET(V.f, filerec);
-      r += 64;
-      V.p = 0;
-      for (i = 0; i < ng; i++) {
-	if (V.p >= 16) {
-	  GET(V.f, filerec);
-	  r += 64;
-	  V.p = 0;
-	}
-	if (li[i] != NULL) {
-	  WITH = readdesc(&GETFBUF(V.f, filerec).b[16*((i) & 15)]);
-	  if (WITH->numpins > maxpins) {
-	    sprintf(STR3, "Gate %s has too many pins", li[i]->name);
-	    wrmsg(STR3);
-	    P_escapecode = 0;
-	    goto _Ltry7;
-	  }
-          li[i]->flag.i = WITH->flag;
-	  if (li[i]->flag.U3.expanded) {
-	    li[i]->sizelbl = uncompress((long)WITH->lblsize);
-	    li[i]->sizeproc = uncompress((long)WITH->procsize);
-	    li[i]->sizevects = uncompress((long)WITH->numpnums);
-	    li[i]->numpnums = 0;
-	    li[i]->numvects = WITH->numvects;
-	  } else {
-	    if (WITH->numpnums > maxpnums) {
-	      sprintf(STR4, "Gate %s has too many pin numbers", li[i]->name);
-	      wrmsg(STR4);
-	      P_escapecode = 0;
-	      goto _Ltry7;
-	    }
-	    li[i]->sizelbl = WITH->lblsize * 4;
-	    li[i]->sizeproc = WITH->procsize * 4;
-	    li[i]->numpnums = WITH->numpnums;
-	    li[i]->numvects = WITH->numvects;
-	  }
-	  li[i]->numpins = WITH->numpins;
-	  realloclbl(li[i], li[i]->sizelbl + (li[i]->sizelbl == 0));
-	  li[i]->lbl[0] = '\0';
-	  reallocproc(li[i], li[i]->sizeproc + (li[i]->sizeproc == 0));
-	  li[i]->proc[0] = '\0';
-	  reallocvects(li[i], (long)li[i]->numvects);
-	  strlist_empty(&li[i]->pinnames);
-          li[i]->simtype = WITH->simtype;
-	  li[i]->xx1 = WITH->xx1;
-	  li[i]->yy1 = WITH->yy1;
-	  li[i]->xx2 = WITH->xx2;
-	  li[i]->yy2 = WITH->yy2;
-	  li[i]->address = WITH->ptr;
-	}
-	V.p++;
-      }
-      GET(V.f, filerec);
-      r += 64;
-      V.p = 0;
-      do {
-	loadany = false;
-	V.j = LONG_MAX;
-	k0 = kbase;
-	while (k0 != NULL && !loadany) {
-	  if (k0->address > 0 && k0->address < V.j) {
-	    k = k0;
-	    V.j = k0->address;
-	    loadany = true;
-	  }
-	  k0 = k0->next;
-	}
-	if (loadany) {
-	  if (r != V.j) {
-	    r = V.j;
-	    fseek(V.f, r / 64 * sizeof(filerec), 0);
-	    SETUPBUF(V.f, filerec);
-	    GET(V.f, filerec);
-	    V.p = r & 63;
-	  }
-	  k->address = 0;
-	  if (k->flag.U3.expanded) {
-	    V.j = 0;
-	    V.vects = (uchar *)Malloc(k->sizevects);
-	    FORLIM = k->sizevects / 4;
-	    for (i = 1; i <= FORLIM; i++) {
-	      readint(&V);
-	      for (j0 = 0; j0 <= 3; j0++)
-		V.vects[V.j + j0] = GETFBUF(V.f, filerec).b[V.p * 4 + j0];
-	      V.j += 4;
-	      V.p++;
-	      r++;
-	    }
-	    V.j = 0;
-	    curcol = 1;
-	    FORLIM = k->numvects;
-	    for (i = 0; i < FORLIM; i++) {
-	      WITH2 = &k->vector[i];
-	      while (V.vects[V.j] >= '1' && V.vects[V.j] <= '7') {
-		curcol = V.vects[V.j] - '0';
-		V.j++;
-	      }
-	      WITH2->kind = V.vects[V.j];
-	      V.j++;
-	      WITH2->col = curcol;
-	      switch (WITH2->kind) {
-
-	      case 'v':
-	      case 'C':
-	      case 'e':
-	      case 'E':
-		WITH2->x1 = readcoord(&V);
-		WITH2->y1 = readcoord(&V);
-		WITH2->UU.U99.x2 = readcoord(&V);
-		WITH2->UU.U99.y2 = readcoord(&V);
-		break;
-
-	      case 'r':
-		WITH2->x1 = readcoord(&V);
-		WITH2->y1 = readcoord(&V);
-		WITH2->UU.U99.x2 = readcoord(&V);
-		WITH2->UU.U99.y2 = readcoord(&V);
-		WITH2->UU.U98.num = readcoord(&V);
-		break;
-
-	      case 'F':
-	      case 'c':
-		WITH2->x1 = readcoord(&V);
-		WITH2->y1 = readcoord(&V);
-		WITH2->UU.U99.x2 = readcoord(&V);
-		WITH2->UU.U99.y2 = readcoord(&V);
-		WITH2->UU.U99.x3 = readcoord(&V);
-		WITH2->UU.U99.y3 = readcoord(&V);
-		WITH2->UU.U99.x4 = readcoord(&V);
-		WITH2->UU.U99.y4 = readcoord(&V);
-		break;
-
-	      case 'p':
-		WITH2->UU.U98.num = readnum(&V);
-		WITH2->x1 = readcoord(&V);
-		WITH2->y1 = readcoord(&V);
-		break;
-
-	      case 'b':
-		WITH2->UU.U98.num = readnum(&V);
-		WITH2->x1 = readcoord(&V);
-		WITH2->y1 = readcoord(&V);
-		WITH2->UU.U99.x2 = readcoord(&V);
-		WITH2->UU.U99.y2 = readcoord(&V);
-		break;
-
-	      case 't':
-		WITH2->UU.U116.tsize = readnum(&V);
-		WITH2->UU.U116.torg = readnum(&V) - 1;
-		WITH2->x1 = readcoord(&V);
-		WITH2->y1 = readcoord(&V);
-		j1 = readnum(&V);
-		tbuf[j1] = '\0';
-/* p2c: loged.text, line 1952:
- * Note: Modification of string length may translate incorrectly [146] */
-		for (j0 = 0; j0 < j1; j0++)
-		  tbuf[j0] = (Char)readnum(&V);
-		WITH2->UU.U116.sp = strdup(tbuf);
-		break;
-
-	      default:
-		printf("Error in annotations section\n");
-		k->numvects = 0;
-		break;
-	      }
-	    }
-	    Free(V.vects);
-	  } else {
-	    FORLIM = k->numvects;
-	    for (i = 0; i < FORLIM; i++) {
-	      readint(&V);
-	      k->vector[i].kind = 'v';
-	      k->vector[i].col = 1;
-	      k->vector[i].x1 = GETFBUF(V.f, filerec).vec[V.p].x1;
-	      k->vector[i].y1 = GETFBUF(V.f, filerec).vec[V.p].y1;
-	      k->vector[i].UU.U99.x2 = GETFBUF(V.f, filerec).vec[V.p].x2;
-	      k->vector[i].UU.U99.y2 = GETFBUF(V.f, filerec).vec[V.p].y2;
-	      V.p++;
-	      r++;
-	    }
-	  }
-	  FORLIM = k->numpins;
-	  for (i = 0; i < FORLIM; i++) {
-	    readint(&V);
-	    k->pin[i].x = GETFBUF(V.f, filerec).pin[V.p].x;
-	    k->pin[i].y = GETFBUF(V.f, filerec).pin[V.p].y;
-	    k->pinsim[i] = GETFBUF(V.f, filerec).pin[V.p].s;
-	    k->pincon[i] = GETFBUF(V.f, filerec).pin[V.p].c;
-	    V.p++;
-	    r++;
-	  }
-	  if (!k->flag.U3.expanded) {
-	    FORLIM = k->numpnums;
-	    for (i = 0; i < FORLIM; i++) {
-	      readint(&V);
-              pn = readpnum(&GETFBUF(V.f, filerec).b[4*V.p]);
-              k->pinoff[i].x = pn.x;
-              k->pinoff[i].y = pn.y;
-              k->pinnum[i] = pn.num;
-	      V.p++;
-	      r++;
-	    }
-	  }
-	  V.j = 1;
-	  FORLIM = k->sizelbl / 4;
-	  for (i = 1; i <= FORLIM; i++) {
-	    readint(&V);
-	    memmove((void *)(k->lbl + V.j - 1), 
-		    (const void *)GETFBUF(V.f, filerec).c4[V.p], 4);
-	    V.j += 4;
-	    V.p++;
-	    r++;
-	  }
-	  if (k->lbl[0] == '\002')
-	    parsepinnames(k, &V);
-	  V.j = 1;
-	  FORLIM = k->sizeproc / 4;
-	  for (i = 1; i <= FORLIM; i++) {
-	    readint(&V);
-	    for (j0 = 0; j0 <= 3; j0++)
-	      k->proc[V.j + j0 - 1] = GETFBUF(V.f, filerec).b[V.p * 4 + j0];
-	    V.j += 4;
-	    V.p++;
-	    r++;
-	  }
-	}
-      } while (loadany);
-      k = kbase;
-      while (k != NULL) {
-	if (k->address != 0) {
-	  wrmsg("Internal error in gates file");
-	      /*info blocks not sequential*/
-	  P_escapecode = 0;
-	  goto _Ltry7;
-	}
-	k = k->next;
-      }
-      if (V.f != NULL)
-	fclose(V.f);
-      V.f = NULL;
-      curkind = k1;
-    RECOVER2(try7,_Ltry7);
-      if (P_escapecode < 0 && P_escapecode != -20) {
-	sprintf(STR1, "Can't find or load file %s", s0);
-	wrmsg(_ShowEscape(STR5, P_escapecode, P_ioresult, STR1));
-      }
-    ENDTRY(try7);
-  }
-  if (li != NULL)
-    Free(li);
-  if (V.f != NULL)
-    fclose(V.f);
-  return Result;
-}  /*rshapes*/
-
-
-
-
-
-Static Void clearalpha()
-{
-  if (onescreen)
-    m_nocursor();
-  printf("\f");
-  m_alpha_on();
-  nc_gotoXY(0, (int)P_imax2(scrheight - 24, 0L));
-}
-
-
-Static Void crosshairx(x, y)
-short x, y;
-{
-  crosshair(gridx + x * gridspc, gridy + y * gridspc);
-}
-
-
-
-Static Void roundrect(x1, y1, x2, y2, r, col, shadow)
-long x1, y1, x2, y2, r, col;
-boolean shadow;
-{
-  if (labs(x2 - x1) < r * 2 || labs(y2 - y1) < r * 2) {
-    m_color(col);
-    m_drawrect(x1, y1, x2, y2);
-    return;
-  }
-  if (!shadow) {
-    m_color((long)purple2);
-    m_drawrect(x1, y1, x2, y2);
-  }
-  m_color(m_trans);
-  m_roundrect(x1, y1, x2, y2, r, r, col);
-}
-
-
-Static Void grgridvector(v)
-vectorrec *v;
-{
-  long xarr[4], yarr[4];
-  long xx, yy, len;
-  Char STR1[256];
-
-  switch (v->kind) {
-
-  case 'v':
-    m_color(colortrans[v->col - 1]);
-    m_drawline((long)(gridx + v->x1 * gridspc),
-	       (long)(gridy + v->y1 * gridspc),
-	       (long)(gridx + v->UU.U99.x2 * gridspc),
-	       (long)(gridy + v->UU.U99.y2 * gridspc));
-    break;
-
-  case 'C':
-    m_color((long)purple2);
-    m_drawline((long)(gridx + v->x1 * gridspc),
-	       (long)(gridy + v->y1 * gridspc),
-	       (long)(gridx + v->UU.U99.x2 * gridspc),
-	       (long)(gridy + v->UU.U99.y2 * gridspc));
-    m_color(colortrans[v->col - 1]);
-    m_circle(gridx + (v->x1 + v->UU.U99.x2) * gridspc / 2L,
-	     gridy + (v->y1 + v->UU.U99.y2) * gridspc / 2L,
-	     P_imax2((long)abs(v->x1 - v->UU.U99.x2),
-		     (long)abs(v->y1 - v->UU.U99.y2)) * gridspc / 2);
-    break;
-
-  case 'F':
-    m_color(colortrans[v->col - 1]);
-    xarr[0] = gridx + v->x1 * gridspc;
-    xarr[1] = gridx + v->UU.U99.x2 * gridspc;
-    xarr[2] = gridx + v->UU.U99.x3 * gridspc;
-    xarr[3] = gridx + v->UU.U99.x4 * gridspc;
-    yarr[0] = gridy + v->y1 * gridspc;
-    yarr[1] = gridy + v->UU.U99.y2 * gridspc;
-    yarr[2] = gridy + v->UU.U99.y3 * gridspc;
-    yarr[3] = gridy + v->UU.U99.y4 * gridspc;
-    m_fillpoly(4L, (int *) xarr, (int *) yarr);
-    break;
-
-  case 'e':
-    m_color((long)purple2);
-    m_drawline((long)(gridx + v->x1 * gridspc),
-	       (long)(gridy + v->y1 * gridspc),
-	       (long)(gridx + v->UU.U99.x2 * gridspc),
-	       (long)(gridy + v->UU.U99.y2 * gridspc));
-    m_color(m_trans);
-    m_ellipse(gridx + (v->x1 + v->UU.U99.x2) * gridspc / 2L,
-	      gridy + (v->y1 + v->UU.U99.y2) * gridspc / 2L,
-	      abs(v->x1 - v->UU.U99.x2) * gridspc / 2L,
-	      abs(v->y1 - v->UU.U99.y2) * gridspc / 2L,
-	      colortrans[v->col - 1]);
-    break;
-
-  case 'E':
-    m_color((long)purple2);
-    m_drawline((long)(gridx + v->x1 * gridspc),
-	       (long)(gridy + v->y1 * gridspc),
-	       (long)(gridx + v->UU.U99.x2 * gridspc),
-	       (long)(gridy + v->UU.U99.y2 * gridspc));
-    m_color(colortrans[v->col - 1]);
-    m_ellipse(gridx + (v->x1 + v->UU.U99.x2) * gridspc / 2L,
-	      gridy + (v->y1 + v->UU.U99.y2) * gridspc / 2L,
-	      abs(v->x1 - v->UU.U99.x2) * gridspc / 2L,
-	      abs(v->y1 - v->UU.U99.y2) * gridspc / 2L,
-	      colortrans[v->col - 1]);
-    break;
-
-  case 'r':
-    roundrect((long)(gridx + v->x1 * gridspc),
-	      (long)(gridy + v->y1 * gridspc),
-	      (long)(gridx + v->UU.U99.x2 * gridspc),
-	      (long)(gridy + v->UU.U99.y2 * gridspc),
-	      (long)(v->UU.U98.num * gridspc), colortrans[v->col - 1], false);
-    break;
-
-  case 'c':
-    m_color((long)purple2);
-    m_move((long)(gridx + v->x1 * gridspc), (long)(gridy + v->y1 * gridspc));
-    m_draw((long)(gridx + v->UU.U99.x2 * gridspc),
-	   (long)(gridy + v->UU.U99.y2 * gridspc));
-    m_draw((long)(gridx + v->UU.U99.x3 * gridspc),
-	   (long)(gridy + v->UU.U99.y3 * gridspc));
-    m_draw((long)(gridx + v->UU.U99.x4 * gridspc),
-	   (long)(gridy + v->UU.U99.y4 * gridspc));
-    m_color(colortrans[v->col - 1]);
-    m_bezier((long)(gridx + v->x1 * gridspc), (long)(gridy + v->y1 * gridspc),
-	     (long)(gridx + v->UU.U99.x2 * gridspc),
-	     (long)(gridy + v->UU.U99.y2 * gridspc),
-	     (long)(gridx + v->UU.U99.x3 * gridspc),
-	     (long)(gridy + v->UU.U99.y3 * gridspc),
-	     (long)(gridx + v->UU.U99.x4 * gridspc),
-	     (long)(gridy + v->UU.U99.y4 * gridspc));
-    break;
-
-  case 'p':
-    if (fullcolor)
-      m_color((long)yellow2);
-    else
-      m_color((long)yellow);
-    xx = gridx + v->x1 * gridspc;
-    yy = gridy + v->y1 * gridspc;
-    m_drawline(xx - 2, yy - 2, xx + 2, yy + 2);
-    m_drawline(xx + 2, yy - 2, xx - 2, yy + 2);
-    if (fullcolor)
-      m_color((long)gray);
-    else
-      m_color((long)white);
-    sprintf(STR1, "%d", v->UU.U98.num);
-    m_drawstr(xx + 8, yy - 3, NULL, STR1);
-    break;
-
-  case 'b':
-    if (fullcolor)
-      m_color((long)yellow2);
-    else
-      m_color((long)yellow);
-    m_linestyle(2L);
-    m_drawrect((long)(gridx + v->x1 * gridspc),
-	       (long)(gridy + v->y1 * gridspc),
-	       (long)(gridx + v->UU.U99.x2 * gridspc),
-	       (long)(gridy + v->UU.U99.y2 * gridspc));
-    m_linestyle(0L);
-    if (fullcolor)
-      m_color((long)gray);
-    else
-      m_color((long)white);
-    sprintf(STR1, "%d", v->UU.U98.num);
-    m_centerstr(gridx + (v->x1 + v->UU.U99.x2) * gridspc / 2L,
-		gridy + (v->y1 + v->UU.U99.y2) * gridspc / 2L - 3, NULL,
-		STR1);
-    break;
-
-  case 't':
-    m_color(colortrans[v->col - 1]);
-    switch (v->UU.U116.torg / 3) {
-
-    case 0:
-      yy = gridy + v->y1 * gridspc;
-      break;
-
-    case 1:
-      yy = gridy + v->y1 * gridspc - 3;
-      break;
-
-    case 2:
-      yy = gridy + v->y1 * gridspc - 6;
-      break;
-    }
-    len = m_strwidth(NULL, v->UU.U116.sp);
-    switch (v->UU.U116.torg % 3) {
-
-    case 0:
-      xx = gridx + v->x1 * gridspc;
-      break;
-
-    case 1:
-      xx = gridx + v->x1 * gridspc - len / 2;
-      break;
-
-    case 2:
-      xx = gridx + v->x1 * gridspc - len;
-      break;
-    }
-    m_drawstr(xx, yy, NULL, v->UU.U116.sp);
-    break;
-  }
-}
-
-
-/* draw vector in the small picture */
-Static Void grsmallvector(v)
-vectorrec *v;
-{
-  long xarr[4], yarr[4];
-  long xx, yy, len;
-  Char STR1[256];
-
-  switch (v->kind) {
-
-  case 'v':
-    m_color(colortrans[v->col - 1]);
-    m_drawline((long)(smallx + v->x1), (long)(smally + v->y1),
-	       (long)(smallx + v->UU.U99.x2), (long)(smally + v->UU.U99.y2));
-    break;
-
-  case 'C':
-    m_color(colortrans[v->col - 1]);
-    m_circle(smallx + (v->x1 + v->UU.U99.x2) / 2L,
-	     smally + (v->y1 + v->UU.U99.y2) / 2L,
-	     P_imax2((long)abs(v->x1 - v->UU.U99.x2),
-		     (long)abs(v->y1 - v->UU.U99.y2)) / 2);
-    break;
-
-  case 'F':
-    m_color(colortrans[v->col - 1]);
-    xarr[0] = smallx + v->x1;
-    xarr[1] = smallx + v->UU.U99.x2;
-    xarr[2] = smallx + v->UU.U99.x3;
-    xarr[3] = smallx + v->UU.U99.x4;
-    yarr[0] = smally + v->y1;
-    yarr[1] = smally + v->UU.U99.y2;
-    yarr[2] = smally + v->UU.U99.y3;
-    yarr[3] = smally + v->UU.U99.y4;
-    m_fillpoly(4L, (int *) xarr, (int *) yarr);
-    break;
-
-  case 'e':
-    m_ellipse(smallx + (v->x1 + v->UU.U99.x2) / 2L,
-	      smally + (v->y1 + v->UU.U99.y2) / 2L,
-	      abs(v->x1 - v->UU.U99.x2) / 2L, abs(v->y1 - v->UU.U99.y2) / 2L,
-	      colortrans[v->col - 1]);
-    break;
-
-  case 'E':
-    m_ellipse(smallx + (v->x1 + v->UU.U99.x2) / 2L,
-	      smally + (v->y1 + v->UU.U99.y2) / 2L,
-	      abs(v->x1 - v->UU.U99.x2) / 2L, abs(v->y1 - v->UU.U99.y2) / 2L,
-	      colortrans[v->col - 1]);
-    break;
-
-  case 'r':
-    roundrect((long)(smallx + v->x1), (long)(smally + v->y1),
-	      (long)(smallx + v->UU.U99.x2), (long)(smally + v->UU.U99.y2),
-	      (long)v->UU.U98.num, colortrans[v->col - 1], true);
-    break;
-
-  case 'c':
-    m_color(colortrans[v->col - 1]);
-    m_bezier((long)(smallx + v->x1), (long)(smally + v->y1),
-	     (long)(smallx + v->UU.U99.x2), (long)(smally + v->UU.U99.y2),
-	     (long)(smallx + v->UU.U99.x3), (long)(smally + v->UU.U99.y3),
-	     (long)(smallx + v->UU.U99.x4), (long)(smally + v->UU.U99.y4));
-    break;
-
-  case 'p':
-    break;
-
-  case 'b':
-    break;
-
-  case 't':
-    m_color(colortrans[v->col - 1]);
-    switch (v->UU.U116.torg / 3) {
-
-    case 0:
-      yy = smally + v->y1;
-      break;
-
-    case 1:
-      yy = smally + v->y1 - v->UU.U116.tsize / 20;
-      break;
-
-    case 2:
-      yy = smally + v->y1 - v->UU.U116.tsize / 10;
-      break;
-    }
-    len = m_strwidth(NULL, v->UU.U116.sp) * v->UU.U116.tsize / 70;
-    switch (v->UU.U116.torg % 3) {
-
-    case 0:
-      xx = smallx + v->x1;
-      break;
-
-    case 1:
-      xx = smallx + v->x1 - len / 2;
-      break;
-
-    case 2:
-      xx = smallx + v->x1 - len;
-      break;
-    }
-    m_drawrect(xx, yy, xx + len, yy + v->UU.U116.tsize / 10);
-    break;
-  }
-}
-
-Static Void grvector(v)
-vectorrec *v;
-{
-  if (show_preview)
-    grsmallvector(v);
-  else
-    grgridvector(v);
-}
-
-
-Static Void grregion(x1, y1, x2, y2)
-short x1, y1, x2, y2;
-{
-  if (fullcolor)
-    m_color((long)yellow2);
-  else
-    m_color((long)yellow);
-  m_linestyle(regionstyle);
-  m_drawrect(gridx + x1 * gridspc + 1L, gridy + y1 * gridspc + 1L,
-	     gridx + x2 * gridspc - 1L, gridy + y2 * gridspc - 1L);
-  m_linestyle(0L);
-}
-
-
-Static Void grpinz(x, y, n)
-short x, y, n;
-{
-  m_color((long)red);
-  diamond(x, y);
-  m_color((long)white);
-  drawnum(x + 8, y - 3, n);
-}
-
-
-Static Char *getpinname(Result, num)
-Char *Result;
-long num;
-{
-  na_strlist *l1;
-  Char name[256];
-
-  sprintf(name, "%ld", num);
-  l1 = kind.pinnames;
-  while (l1 != NULL) {
-    if ((long)l1->value == num)
-      sprintf(name + strlen(name), " \"%s\"", l1->s);
-    l1 = l1->next;
-  }
-  return strcpy(Result, name);
-}
-
-
-/* drpin() functions as both grpin() and erpin(), using the 'visible' arg. */
-/* it can place the pin number north or south in addition to east or west. */ 
-Static Void drpin(x, y, n, visible)
-short x,y,n;
-boolean visible;
-{
-typedef enum {inside,north,east,south,west} placement;
-  placement p = inside;
-  Char STR1[256];
-  long hw = m_strwidth(NULL, getpinname(STR1, (long)n)) / 2;
-
-  /* use the grab rectangle to determine which edge this pin is attached to. */
-  if (x < kind.xx1)
-    p = west;
-  else if (x > kind.xx2)
-    p = east;
-  else if (y < kind.yy1)
-    p = north;
-  else if (y > kind.yy2)
-    p = south;
-
-  x = gridx + x * gridspc;
-  y = gridy + y * gridspc;
-
-  m_color((long) (visible ? red : black));
-  diamond(x, y);
-
-  /* if it's not visible, it has just been set to black. */
-  if (visible)
-    m_color((long)white);
-
-  if (p == west)
-    m_rightstr(x - 8L, P_imax2(y - 3L, 1L), NULL, STR1);
-  else if (p == east)
-    m_drawstr(x + 8L, P_imax2(y - 3L, 1L), NULL, STR1);
-  else if (p == north && y >= 15)
-    m_drawstr(x - hw, P_imax2(y - 15L, 1L), NULL, STR1);
-  else if (p == south)
-    m_drawstr(x - hw, P_imax2(y + 8L, 1L), NULL, STR1);
-  else if (x < gridx)
-    m_rightstr(x - 8L, P_imax2(y - 3L, 1L), NULL, STR1);
-  else
-    m_drawstr(x + 8L, P_imax2(y - 3L, 1L), NULL, STR1);
-}
-
-Static Void grpin(x, y, n)
-short x, y, n;
-{
-  Char STR1[256];
-
-  x = gridx + x * gridspc;
-  y = gridy + y * gridspc;
-  m_color((long)red);
-  diamond(x, y);
-  m_color((long)white);
-  if (x < gridx)
-    m_rightstr(x - 8L, P_imax2(y - 3L, 1L), NULL, getpinname(STR1, (long)n));
-  else
-    m_drawstr(x + 8L, P_imax2(y - 3L, 1L), NULL, getpinname(STR1, (long)n));
-}
-
-
-Static Void erpin(x, y, n)
-short x, y, n;
-{
-  Char STR1[256];
-
-  x = gridx + x * gridspc;
-  y = gridy + y * gridspc;
-  m_color((long)black);
-  diamond(x, y);
-  m_color((long)black);
-  if (x < gridx)
-    m_rightstr(x - 8L, P_imax2(y - 3L, 1L), NULL, getpinname(STR1, (long)n));
-  else
-    m_drawstr(x + 8L, P_imax2(y - 3L, 1L), NULL, getpinname(STR1, (long)n));
-}
-
-
-Static Void grpinnum(x, y, n)
-short x, y, n;
-{
-  m_color((long)yellow);
-  drawnum(gridx + x * gridspc - 8, gridy + y * gridspc - 3, n);
-  m_color((long)white);
-  m_drawpoint((long)(gridx + x * gridspc), (long)(gridy + y * gridspc));
-}
-
-
-Static Void erpinnum(x, y, n)
-short x, y, n;
-{
-  m_color((long)black);
-  drawnum(gridx + x * gridspc - 8, gridy + y * gridspc - 3, n);
-  m_drawpoint((long)(gridx + x * gridspc), (long)(gridy + y * gridspc));
-}
-
-
-Static Void grrefr()
-{
-  if (show_preview)
-    return;
-  m_color((long)red2);
-  m_grid((long)gridleft, (long)gridtop, (long)gridright, (long)gridbot,
-           (long)gridspc, (long)gridspc, (long)gridleft, (long)gridtop);
-  m_color((long)purple2);
-  /* horizontal lines */
-  m_grid((long)gridleft, (long)gridtop + 2*gridspc,
-         (long)gridright, (long)gridbot - 2*gridspc,
-	 (long)gridspc, gridspc * 5L, (long)gridleft,(long)gridtop + 2*gridspc);
-  /* vertical lines */
-  m_grid((long)gridleft + 2*gridspc, (long)gridtop,
-         (long)gridright - 2*gridspc, (long)gridbot,
-	 gridspc * 5L, (long)gridspc, (long)gridleft + 2*gridspc,
-                                       (long)gridtop);
-  m_color((long)yellow);
-  m_drawpoint((long)gridx, (long)gridy);
-}
-
-
-Static Void refrpinnums()
-{
-  long i, FORLIM;
-
-  erase(0, 0, 20, (int)msgy);
-  m_color((long)green);
-  FORLIM = P_imin2(firstpin + scrpins - 1, (long)maxpins);
-  for (i = firstpin; i <= FORLIM; i++)
-    drawnum3(0, (int)((i - firstpin) * numspc), (int)i);
-/* p2c: loged.text, line 2362:
- * Note: Evaluating FOR loop limit before initial value [315] */
-}
-
-
-Static Void refrname()
-{
-Char *sp;
-
-  erase((long)msg_name, msgy+5, msg_veckindmenu, msgy+msgheight);
-  m_color((long)green);
-  m_drawstr((long)msg_name, msgy+5, NULL, "GATE");
-  if (curkind != NULL) {
-    m_color((long)yellow);
-    m_drawstr((long)msg_name + 30, msgy+5, NULL, kind.name);
-  }
-  m_color((long)green);
-  m_drawstr((long)msg_name, msgy+15, NULL, savedflag ? "LIB" : "LIB*");
-  if (*filename != '\0') {
-    if ((sp = strrchr(filename,'/')) != NULL)
-      sp++;
-    else
-      sp = filename;
-    m_color((long)yellow);
-    m_drawstr((long)msg_name + 30, msgy+15, NULL, sp);
-  }
-}
-
-Static Void refrtorgmenu()
-{
-
-  long i, FORLIM;
-  Char STR1[256], STR2[256];
-  long lx, ly;
-
-  FORLIM = strlen(torgkindmenu);
-  for (i = 1; i <= FORLIM; i += 2) {
-    if (torgkind == (i - 1)/2)
-      m_color((long)yellow);
-    else
-      m_color((long)green);
-    m_drawstr(msg_torg + (i - 1) * 7, (long)msgy+15, NULL,
-	      strupper(STR1, strsub(STR2, torgkindmenu, (int)i, 2)));
-  }
-}
-
-
-Static Void refrveckindmenu()
-{
-  long i, FORLIM;
-  Char STR1[256], STR2[256];
-
-  FORLIM = strlen(veckindmenu);
-  for (i = 1; i <= FORLIM; i++) {
-    if (veckind == veckindmenu[i - 1])
-      m_color((long)yellow);
-    else
-      m_color((long)green);
-    m_drawstr((long)msg_veckindmenu + (i - 1) * 8 + 1, (long)msgy+5, NULL,
-	      strupper(STR1, strsub(STR2, veckindmenu, (int)i, 1)));
-  }
-  m_color((long)yellow);
-  switch (veckind) {
-
-  case 'v':
-    m_drawstr((long)msg_veckindmenu, (long)msgy+15, NULL, "Vectors");
-    break;
-
-  case 'C':
-    m_drawstr((long)msg_veckindmenu, (long)msgy+15, NULL, "Circles");
-    break;
-
-  case 'F':
-    m_drawstr((long)msg_veckindmenu, (long)msgy+15, NULL, "Filled Polygons");
-    break;
-
-  case 'e':
-    m_drawstr((long)msg_veckindmenu, (long)msgy+15, NULL, "Ellipses");
-    break;
-
-  case 'E':
-    m_drawstr((long)msg_veckindmenu, (long)msgy+15, NULL, "Filled Ellipses");
-    break;
-
-  case 'r':
-    m_drawstr((long)msg_veckindmenu, (long)msgy+15, NULL, "Rounded Boxes");
-    break;
-
-  case 'c':
-    m_drawstr((long)msg_veckindmenu, (long)msgy+15, NULL, "Curves");
-    break;
-
-  case 'p':
-    m_drawstr((long)msg_veckindmenu, (long)msgy+15, NULL, "Point-markers");
-    break;
-
-  case 'b':
-    m_drawstr((long)msg_veckindmenu, (long)msgy+15, NULL, "Box-markers");
-    break;
-
-  case 't':
-    m_drawstr((long)msg_veckindmenu, (long)msgy+15, NULL, "Text");
-    refrtorgmenu();
-    break;
-  }
-}
-
-
-Static Void refrcolormenu()
-{
-
-  m_color(colortrans[curcolor - 1]);
-  switch (curcolor) {
-
-  case 1:
-    m_drawstr((long)msg_color, (long)msgy+5, NULL, "Cyan");
-    break;
-
-  case 2:
-    m_drawstr((long)msg_color, (long)msgy+5, NULL, "Green");
-    break;
-
-  case 3:
-    m_drawstr((long)msg_color, (long)msgy+5, NULL, "Yellow");
-    break;
-
-  case 4:
-    m_drawstr((long)msg_color, (long)msgy+5, NULL, "Red");
-    break;
-
-  case 5:
-    m_drawstr((long)msg_color, (long)msgy+5, NULL, "Orange");
-    break;
-
-  case 6:
-    m_drawstr((long)msg_color, (long)msgy+5, NULL, "Black");
-    break;
-
-  case 7:
-    m_drawstr((long)msg_color, (long)msgy+5, NULL, "White");
-    break;
-  }
-}
-
-Static Void refrmenus()
-{
-  refrname();
-  refrveckindmenu();
-  refrcolormenu();
-}
-
-
-Static Void grid()
-{
-  m_nocursor();
-  m_linestyle(0L);
-  m_colormode((long)m_normal);
-  m_noclip();
-  m_clear();
-  grrefr();
-  refrpinnums();
-  m_color((long)green);
-  refrmenus();
-  m_color((long)green);
-  m_drawstr((long)msg_end,(long) msgy+5, NULL, "END");
-}
-
-
-Static Void refresh1()
-{
-  short i;
-  krec *WITH;
-  short FORLIM;
-  vectorrec *WITH1;
-
-  needrefr = false;
-  nocrosshair();
-  m_nocursor();
-  if (show_preview) {
-    FORLIM = kind.numvects;
-    for (i = 0; i < FORLIM; i++)
-      grvector(&kind.vector[i]);
-    refrname();
-    return;
-  }
-  if (shadowkind != NULL && shadowkind != curkind) {
-    WITH = shadowkind;
-    m_color((long)red2);
-    FORLIM = WITH->numpins;
-    for (i = 0; i < FORLIM; i++) {
-      if (WITH->pinsim[i] != nopin)
-	diamond(gridx + WITH->pin[i].x * gridspc,
-		gridy + WITH->pin[i].y * gridspc);
-    }
-    FORLIM = WITH->numvects;
-    for (i = 0; i < FORLIM; i++) {
-      WITH1 = &WITH->vector[i];
-      switch (WITH1->kind) {
-
-      case 'v':
-	m_drawline((long)(gridx + WITH1->x1 * gridspc),
-		   (long)(gridy + WITH1->y1 * gridspc),
-		   (long)(gridx + WITH1->UU.U99.x2 * gridspc),
-		   (long)(gridy + WITH1->UU.U99.y2 * gridspc));
-	break;
-
-      case 'C':
-	m_circle(gridx + (WITH1->x1 + WITH1->UU.U99.x2) * gridspc / 2L,
-	  gridy + (WITH1->y1 + WITH1->UU.U99.y2) * gridspc / 2L,
-	  P_imax2((long)abs(WITH1->x1 - WITH1->UU.U99.x2),
-		  (long)abs(WITH1->y1 - WITH1->UU.U99.y2)) * gridspc / 2);
-	m_color((long)red2);
-	break;
-
-      case 'F':
-	m_move((long)(gridx + WITH1->x1 * gridspc),
-	       (long)(gridy + WITH1->y1 * gridspc));
-	m_draw((long)(gridx + WITH1->UU.U99.x2 * gridspc),
-	       (long)(gridy + WITH1->UU.U99.y2 * gridspc));
-	m_draw((long)(gridx + WITH1->UU.U99.x3 * gridspc),
-	       (long)(gridy + WITH1->UU.U99.y3 * gridspc));
-	m_draw((long)(gridx + WITH1->UU.U99.x4 * gridspc),
-	       (long)(gridy + WITH1->UU.U99.y4 * gridspc));
-	m_draw((long)(gridx + WITH1->x1 * gridspc),
-	       (long)(gridy + WITH1->y1 * gridspc));
-	break;
-
-      case 'e':
-      case 'E':
-	m_color(m_trans);
-	m_ellipse(gridx + (WITH1->x1 + WITH1->UU.U99.x2) * gridspc / 2L,
-		  gridy + (WITH1->y1 + WITH1->UU.U99.y2) * gridspc / 2L,
-		  abs(WITH1->x1 - WITH1->UU.U99.x2) * gridspc / 2L,
-		  abs(WITH1->y1 - WITH1->UU.U99.y2) * gridspc / 2L,
-		  (long)red2);
-	m_color((long)red2);
-	break;
-
-      case 'r':
-	roundrect((long)(gridx + WITH1->x1 * gridspc),
-		  (long)(gridy + WITH1->y1 * gridspc),
-		  (long)(gridx + WITH1->UU.U99.x2 * gridspc),
-		  (long)(gridy + WITH1->UU.U99.y2 * gridspc),
-		  (long)(WITH1->UU.U98.num * gridspc), (long)red2, true);
-	break;
-
-      case 'c':
-	m_bezier((long)(gridx + WITH1->x1 * gridspc),
-		 (long)(gridy + WITH1->y1 * gridspc),
-		 (long)(gridx + WITH1->UU.U99.x2 * gridspc),
-		 (long)(gridy + WITH1->UU.U99.y2 * gridspc),
-		 (long)(gridx + WITH1->UU.U99.x3 * gridspc),
-		 (long)(gridy + WITH1->UU.U99.y3 * gridspc),
-		 (long)(gridx + WITH1->UU.U99.x4 * gridspc),
-		 (long)(gridy + WITH1->UU.U99.y4 * gridspc));
-	break;
-      }
-    }
-  }
-  FORLIM = kind.numpins;
-  for (i = 1; i <= FORLIM; i++) {
-    if (kind.pinsim[i - 1] != nopin)
-      drpin(kind.pin[i - 1].x, kind.pin[i - 1].y, i, true);
-  }
-  FORLIM = kind.numpnums;
-  for (i = 0; i < FORLIM; i++)
-    grpinnum(kind.pinoff[i].x, kind.pinoff[i].y, kind.pinnum[i]);
-  FORLIM = kind.numvects;
-  for (i = 0; i < FORLIM; i++)
-    grvector(&kind.vector[i]);
-  grregion(kind.xx1, kind.yy1, kind.xx2, kind.yy2);
-  refrname();
-}
-
-
-Static Void refresh()
-{
-  if (nc_gType() != nc_g300) {
-    nocrosshair();
-    m_nocursor();
-    if (show_preview)
-      erase(smallxmin, smallymin, smallxmax, smallymax);
-    else
-      erase(gridleft - gridspc * 2 - 1, gridtop, gridright + gridspc * 2 + 1,
-	  gridbot + gridspc);
-    grrefr();
-  } else
-    grid();
-  refresh1();
-}
-
-
-
-/*$ if debugloged $ $ debug $ $ end $*/
-
-
-
-Static Void gatecmd()
-{
-  if (*argument != '\0') {
-    makekind(argument);
-    refrkind = true;
-  }
-  needrefr = true;
-}
-
-
-Static Void nextcmd(indraw)
-boolean indraw;
-{
-  Char arg[256], ggroup[256];
-  krec *k;
-  short count;
-  boolean flag;
-
-  if (indraw || *argument == '\0')
-    *arg = '\0';
-  else
-    strcpy(arg, argument);
-  wildcards(arg, ggroup, &flag);
-  flushcurkind();
-  if (kbase == NULL) {
-    wrmsg("No gates in memory!");
-    return;
-  }
-  count = 0;
-  k = curkind;
-  do {
-    if (k != NULL)
-      k = k->next;
-    if (k == NULL) {
-      k = kbase;
-      count++;
-    }
-  } while (!(k == curkind || count >= 2 ||
-	     comparestr(k->name, arg) && comparegroup(k->group, ggroup)));
-  if (k == curkind || count >= 2) {
-    if (!indraw)
-      wrmsg("Gate not found!");
-    return;
-  }
-  curkind = k;
-  kind = *curkind;
-  refrkind = true;
-  autoscale(1L);
-  needrefr = true;
-}
-
-
-Static Void prevcmd(indraw)
-boolean indraw;
-{
-  Char arg[256], ggroup[256];
-  krec *k, *k1;
-  boolean flag;
-
-  if (indraw || *argument == '\0')
-    *arg = '\0';
-  else
-    strcpy(arg, argument);
-  wildcards(arg, ggroup, &flag);
-  flushcurkind();
-  if (kbase == NULL) {
-    wrmsg("No gates in memory!");
-    return;
-  }
-  k1 = NULL;
-  k = kbase;
-  while (k != NULL && k != curkind) {
-    if (comparestr(k->name, arg) && comparegroup(k->group, ggroup))
-      k1 = k;
-    k = k->next;
-  }
-  if (k1 == NULL) {
-    if (k != NULL)
-      k = k->next;
-    while (k != NULL) {
-      if (comparestr(k->name, arg) && comparegroup(k->group, ggroup))
-	k1 = k;
-      k = k->next;
-    }
-  }
-  if (k1 == NULL) {
-    if (!indraw)
-      wrmsg("Gate not found!");
-    return;
-  }
-  curkind = k1;
-  kind = *curkind;
-  refrkind = true;
-  autoscale(1L);
-  needrefr = true;
-}
-
-
-
-
-
-
-Static Void editcmd PP((Char *argument));
-
-
-
-Static Void fixnumpins(num)
-long num;
-{
-  long i;
-
-  if (num > kind.numpins) {
-    for (i = kind.numpins; i <= num - 2; i++) {
-      kind.pinsim[i] = nopin;
-      kind.pincon[i] = 0;
-    }
-    kind.pinsim[num - 1] = kind.simtype;
-    kind.pincon[num - 1] = 0;
-    kind.numpins = num;
-  }
-  while (kind.numpins > 0 && kind.pinsim[kind.numpins - 1] == nopin)
-    kind.numpins--;
-}
-
-
-Static Void deletepin(num)
-long num;
-{
-  long i, j;
-  na_strlist *l1;
-
-  if (num <= kind.numpins && kind.pinsim[num - 1] != nopin) {
-    if (kind.pincon[num - 1] != 0) {
-      i = num;
-      do {
-	j = kind.pincon[i - 1];
-	kind.pincon[i - 1] = 0;
-	i = j;
-      } while (i != num);
-    }
-    do {
-      l1 = kind.pinnames;
-      while (l1 != NULL && (long)l1->value != num)
-	l1 = l1->next;
-      if (l1 != NULL)
-	strlist_delete(&kind.pinnames, l1);
-    } while (l1 != NULL);
-    kind.pinsim[num - 1] = nopin;
-    fixnumpins(num);
-  }
-  savedflag = false;
-}
-
-
-
-
-
-
-Static krec *findkind(n)
-Char *n;
-{
-  krec *k;
-
-  k = kbase;
-  while (k != NULL && strcmp(k->name, n))
-    k = k->next;
-  return k;
-}
-
-
-Static Void cpyfunc()
-{
-  krec *k;
-  Char n[9];
-  long i;
-  Char STR1[256];
-  Char *TEMP;
-  long FORLIM;
-
-  m_nocursor();
-  clearalpha();
-  dim();
-  printf("Enter name of gate to copy:  ");
-  fgets(n, 9, stdin);
-  TEMP = (char *) strchr(n, '\n');
-  if (TEMP != NULL)
-    *TEMP = 0;
-  k = findkind(strupper(STR1, n));
-  if (k != NULL) {
-    kind.xx1 = k->xx1;
-    kind.yy1 = k->yy1;
-    kind.xx2 = k->xx2;
-    kind.yy2 = k->yy2;
-    kind.numpins = k->numpins;
-    memcpy(kind.pin, k->pin, maxpins * sizeof(_REC_pin_));
-    memcpy(kind.pinsim, k->pinsim, maxpins * sizeof(uchar));
-    FORLIM = kind.numpins;
-    for (i = 0; i < FORLIM; i++) {
-      if (kind.pinsim[i] == k->simtype)
-	kind.pinsim[i] = kind.simtype;
-    }
-    memcpy(kind.pincon, k->pincon, maxpins * sizeof(uchar));
-    kind.numpnums = k->numpnums;
-    memcpy(kind.pinoff, k->pinoff, maxpnums * sizeof(_REC_pinoff));
-    memcpy(kind.pinnum, k->pinnum, maxpnums * sizeof(short));
-    strlist_copy(&kind.pinnames, k->pinnames);
-    kind.numvects = k->numvects;
-    kind.allocvects = k->allocvects;
-    kind.vector = (vectorrec *)Malloc(k->allocvects * sizeof(vectorrec));
-    memmove((Anyptr)kind.vector, (Anyptr)k->vector,
-	    k->allocvects * sizeof(vectorrec));
-    bright();
-    needrefr = true;
-    savedflag = false;
-  } else
-    bright();
-  clearalpha();
-  if (onescreen || needrefr) {
-    autoscale(1L);
-    grid();
-    refresh1();
-  }
-}
-
-
-Static Void shadowfunc()
-{
-  Char n[9];
-  Char STR1[256];
-  Char *TEMP;
-
-  m_nocursor();
-  clearalpha();
-  dim();
-  printf("Enter name of gate to shadow:  ");
-  fgets(n, 9, stdin);
-  TEMP = (char *) strchr(n, '\n');
-  if (TEMP != NULL)
-    *TEMP = 0;
-  shadowkind = findkind(strupper(STR1, n));
-  autoscale(1L);
-  clearalpha();
-  bright();
-  grid();
-  refresh1();
-}
-
-
-
-Static Void delfunc(x, y)
-short *x, *y;
-{
-  short i, j, FORLIM;
-
-  if (*x != -1000) {
-    i = 1;
-    while (i <= kind.numvects) {
-      if (kind.vector[i - 1].kind != 'v' ||
-	  kind.vector[i - 1].x1 == *x && kind.vector[i - 1].y1 == *y ||
-	  (kind.vector[i - 1].UU.U99.x2 == *x &&
-	   kind.vector[i - 1].UU.U99.y2 == *y)) {
-	FORLIM = kind.numvects;
-	for (j = i; j < FORLIM; j++)
-	  kind.vector[j - 1] = kind.vector[j];
-	kind.numvects--;
-      } else
-	i++;
-    }
-    i = 1;
-    while (i <= kind.numpins) {
-      if (kind.pinsim[i - 1] != nopin && kind.pin[i - 1].x == *x &&
-	  kind.pin[i - 1].y == *y)
-	deletepin((long)i);
-      i++;
-    }
-    i = 1;
-    j = 0;
-    while (i <= kind.numpnums) {
-      if (kind.pinnum[i - 1] != -1 && kind.pinoff[i - 1].x == *x &&
-	  kind.pinoff[i - 1].y == *y)
-	kind.pinnum[i - 1] = -1;
-      else
-	j = i;
-      i++;
-    }
-    kind.numpnums = j;
-  }
-  grid();
-  refresh1();
-  *x = -1000;
-}
-
-
-typedef short shortarray[1000000L];
-
-
-/* Local variables for drawcmd: */
-struct LOC_drawcmd {
-  long x, y;
-  short *nearvec;
-  boolean anyvec;
-  boolean nearpins[maxpins];
-  long nearpin, nearregion;
-} ;
-
-Local Void fixscale(LINK)
-struct LOC_drawcmd *LINK;
-{
-  long savescale;
-
-  savescale = gridscale;
-  autoscale((long)gridscale);
-  if (gridscale != savescale)
-    grid();
-}
-
-Local boolean checktap(LINK)
-struct LOC_drawcmd *LINK;
-{
-  long t, x0, y0;
-
-  x0 = pen.x;
-  y0 = pen.y;
-  t = timers_sysclock();
-  do {
-    m_waitpen(&pen);
-  } while (labs(pen.x - x0) + labs(pen.y - y0) <= 4 &&
-	   timers_sysclock() <= t + 35 && pen.depressed);
-  return (!pen.depressed);
-}
-
-Local Void getgrid(px, py, x, y, LINK)
-long px, py, *x, *y;
-struct LOC_drawcmd *LINK;
-{
-  if (P_ibetweenm((long)gridleft, px, (long)gridright, 2L)
-       && P_ibetweenm((long)gridtop, py, (long)gridbot, 2L)) {
-    *x = (px - gridleft + gridspc / 2) / gridspc + gridxmin;
-    *y = (py - gridtop + gridspc / 2) / gridspc + gridymin;
-  } else {
-    *x = -1000;
-    *y = -1000;
-  }
-}
-
-Local Void addvector(knd, LINK)
-Char knd;
-struct LOC_drawcmd *LINK;
-{
-  vectorrec *WITH;
-
-  kind.numvects++;
-  reallocvects(&kind, (long)kind.numvects);
-  WITH = &kind.vector[kind.numvects - 1];
-  WITH->kind = knd;
-  WITH->col = curcolor;
-  savedflag = false;
-}
-
-Local Void flipX(v, LINK)
-vectorrec *v;
-struct LOC_drawcmd *LINK;
-{
-  schar t;
-
-  t = v->x1;
-  v->x1 = v->UU.U99.x2;
-  v->UU.U99.x2 = t;
-}
-
-Local boolean checknear(px, py, LINK)
-long px, py;
-struct LOC_drawcmd *LINK;
-{
-  long i, x, y, FORLIM;
-  vectorrec *WITH;
-
-  getgrid(px, py, &x, &y, LINK);
-  LINK->anyvec = false;
-  FORLIM = kind.numvects;
-  for (i = 0; i < FORLIM; i++) {
-    WITH = &kind.vector[i];
-    LINK->nearvec[i] = 0;
-    if (WITH->x1 == x && WITH->y1 == y) {
-      LINK->anyvec = true;
-      LINK->nearvec[i] = 1;
-    }
-    if (WITH->kind == 'b' || WITH->kind == 'c' || WITH->kind == 'r' ||
-	WITH->kind == 'E' || WITH->kind == 'e' || WITH->kind == 'F' ||
-	WITH->kind == 'C' || WITH->kind == 'v') {
-      if (WITH->UU.U99.x2 == x && WITH->UU.U99.y2 == y) {
-	LINK->anyvec = true;
-	LINK->nearvec[i] += 2;
-      }
-      if ((WITH->kind == 'b' || WITH->kind == 'r') && LINK->nearvec[i] == 0) {
-	if (WITH->UU.U99.x2 == x && WITH->y1 == y) {
-	  flipX(&kind.vector[i], LINK);
-	  LINK->anyvec = true;
-	  LINK->nearvec[i] = 1;
-	} else if (WITH->x1 == x && WITH->UU.U99.y2 == y) {
-	  flipX(&kind.vector[i], LINK);
-	  LINK->anyvec = true;
-	  LINK->nearvec[i] = 2;
-	}
-      } else if (WITH->kind == 'c' || WITH->kind == 'F') {
-	if (WITH->UU.U99.x3 == x && WITH->UU.U99.y3 == y) {
-	  LINK->anyvec = true;
-	  LINK->nearvec[i] += 4;
-	}
-	if (WITH->UU.U99.x4 == x && WITH->UU.U99.y4 == y) {
-	  LINK->anyvec = true;
-	  LINK->nearvec[i] += 8;
-	}
-      }
-    }
-  }
-  LINK->nearpin = kind.numpins;
-  while (LINK->nearpin > 0 && (kind.pinsim[LINK->nearpin - 1] == nopin ||
-			       kind.pin[LINK->nearpin - 1].x != x ||
-			       kind.pin[LINK->nearpin - 1].y != y))
-    LINK->nearpin--;
-  FORLIM = kind.numpins;
-  for (i = 1; i <= FORLIM; i++)
-    LINK->nearpins[i - 1] = (i == LINK->nearpin);
-  LINK->nearregion = 0;
-  if (LINK->anyvec || LINK->nearpin > 0)
-    return true;
-  else {
-    if (P_ibetween((long)kind.xx1, x, (long)kind.xx2) &&
-	P_ibetween((long)kind.yy1, y, (long)kind.yy2))
-      LINK->nearregion = (x == kind.xx1) + (y == kind.yy1) * 2 +
-			 (x == kind.xx2) * 4 + (y == kind.yy2) * 8;
-    if (LINK->nearregion > 0)
-      return true;
-    else {
-      LINK->anyvec = false;
-      m_clip(px - 4, py - 4, px + 4, py + 4);
-      m_colormode(m_hitdet);
-      FORLIM = kind.numvects;
-      for (i = 0; i < FORLIM; i++) {
-	m_hitcount = 0;
-	grvector(&kind.vector[i]);
-	if (m_hitcount > 0) {
-	  LINK->anyvec = true;
-	  LINK->nearvec[i] =
-	    (kind.vector[i].kind == 'b' || kind.vector[i].kind == 'c' ||
-	     kind.vector[i].kind == 'r' ||
-	     kind.vector[i].kind == 'E' ||
-	     kind.vector[i].kind == 'e' || kind.vector[i].kind == 'F' ||
-	     kind.vector[i].kind == 'C' ||
-	     kind.vector[i].kind == 'v') *
-	    2 +
-	    (kind.vector[i].kind == 'c' || kind.vector[i].kind == 'F') * 12 +
-	    1;
-/* p2c: loged.text, line 4173: Note:
- * Line breaker spent 2.0+2.00 seconds, 5000 tries on line 3647 [251] */
-	}
-      }
-      FORLIM = kind.numvects;
-      for (i = 0; i < FORLIM; i++) {
-	if (kind.pinsim[i] != nopin) {
-	  m_hitcount = 0;
-	  drpin(kind.pin[i].x, kind.pin[i].y, (int)(i + 1), true);
-	  if (m_hitcount > 0) {
-	    LINK->anyvec = true;
-	    LINK->nearpins[i] = true;
-	  }
-	}
-      }
-      m_noclip();
-      m_colormode((long)m_normal);
-      return LINK->anyvec;
-    }
-  }
-}
-
-Local Void checkoverpin(num, LINK)
-long num;
-struct LOC_drawcmd *LINK;
-{
-  long i, FORLIM;
-
-  FORLIM = kind.numpins;
-  for (i = 1; i <= FORLIM; i++) {
-    if (kind.pinsim[i - 1] != nopin && i != num &&
-	kind.pin[i - 1].x == kind.pin[num - 1].x &&
-	kind.pin[i - 1].y == kind.pin[num - 1].y)
-      deletepin(i);
-  }
-}
-
-Local Void purgeoutside(LINK)
-struct LOC_drawcmd *LINK;
-{
-  long i, j, FORLIM;
-  vectorrec *WITH;
-
-  j = 0;
-  FORLIM = kind.numvects;
-  for (i = 0; i < FORLIM; i++) {
-    WITH = &kind.vector[i];
-    if (P_ibetween((long)gridxmin, (long)WITH->x1, (long)gridxmax) &&
-	P_ibetween((long)gridymin, (long)WITH->y1, (long)gridymax) && ((WITH->
-		kind != 'b' && WITH->kind != 'c' && WITH->kind != 'r' &&
-	    WITH->kind != 'E' && WITH->kind != 'e' && WITH->kind != 'F' &&
-	    WITH->kind != 'C' && WITH->kind != 'v') || (P_ibetween((long)
-		gridxmin, (long)WITH->UU.U99.x2, (long)gridxmax) &&
-	    P_ibetween((long)gridymin, (long)WITH->UU.U99.y2, (long)gridymax) &&
-	    (WITH->kind != 'c' && WITH->kind != 'F' || (P_ibetween(
-		  (long)gridxmin, (long)WITH->UU.U99.x3,
-		  (long)gridxmax) && P_ibetween((long)gridymin,
-		  (long)WITH->UU.U99.y3,
-		  (long)gridymax) && P_ibetween((long)gridxmin,
-		  (long)WITH->UU.U99.x4,
-		  (long)gridxmax) && P_ibetween((long)gridymin,
-		  (long)WITH->UU.U99.y4, (long)gridymax)))))) {
-/* p2c: loged.text, line 4173: Note:
- * Line breaker spent 0.0+5.00 seconds, 5000 tries on line 3709 [251] */
-      j++;
-      if (j != i + 1) {
-	kind.vector[j - 1] = kind.vector[i];
-	if (LINK->nearvec != NULL)
-	  LINK->nearvec[j - 1] = LINK->nearvec[i];
-      }
-    }
-  }
-  kind.numvects = j;
-  FORLIM = kind.numpins;
-  for (i = 1; i <= FORLIM; i++) {
-    if (LINK->nearpins[i - 1]) {
-      if (!(P_ibetween((long)gridxmin, (long)kind.pin[i - 1].x, (long)gridxmax) &&
-	    P_ibetween((long)gridymin, (long)kind.pin[i - 1].y, (long)gridymax))) {
-	deletepin(i);
-	LINK->nearpins[i - 1] = false;
-      } else
-	checkoverpin(i, LINK);
-    }
-  }
-}
-
-Local Void fixpin(i, LINK)
-long i;
-struct LOC_drawcmd *LINK;
-{
-  _REC_pin_ *WITH;
-
-  WITH = &kind.pin[i - 1];
-  if (kind.pinsim[i - 1] == nopin)
-    return;
-  WITH->x = (WITH->x + 1002) / 5 * 5 - 1000;
-  WITH->y = (WITH->y + 1002) / 5 * 5 - 1000;
-  if (!(P_ibetween((long)gridxmin, (long)WITH->x, (long)gridxmax) &&
-	P_ibetween((long)gridymin, (long)WITH->y, (long)gridymax)))
-    deletepin(i);
-}
-
-/* Local variables for movepoint: */
-struct LOC_movepoint {
-  struct LOC_drawcmd *LINK;
-  boolean waitdn;
-  long x1, y1, initx, inity;
-  boolean done;
-} ;
-
-Local Void drawthem(LINK)
-struct LOC_movepoint *LINK;
-{
-  long i, FORLIM;
-
-  m_nocursor();
-  FORLIM = kind.numvects;
-  for (i = 0; i < FORLIM; i++) {
-    if (LINK->LINK->nearvec[i] != 0)
-      grvector(&kind.vector[i]);
-  }
-  FORLIM = kind.numpins;
-  for (i = 1; i <= FORLIM; i++) {
-    if (LINK->LINK->nearpins[i - 1])
-      drpin(kind.pin[i - 1].x, kind.pin[i - 1].y, (int)i, true);
-  }
-  if (LINK->LINK->nearregion != 0)
-    grregion(kind.xx1, kind.yy1, kind.xx2, kind.yy2);
-}
-
-Local Void checkdone(LINK)
-struct LOC_movepoint *LINK;
-{
-  if (!LINK->waitdn) {
-    LINK->done = !pen.depressed;
-    return;
-  }
-  LINK->done = (pen.dn || !pen.near_);
-  if (!pen.near_) {
-    LINK->x1 = LINK->initx;
-    LINK->y1 = LINK->inity;
-  }
-}
-
-
-Local Void movepoint(waitdn_, LINK)
-boolean waitdn_;
-struct LOC_drawcmd *LINK;
-{
-  struct LOC_movepoint V;
-  long i, dx, dy, homexx1, homeyy1, homexx2, homeyy2, FORLIM;
-  vectorrec *WITH;
-
-  V.LINK = LINK;
-  V.waitdn = waitdn_;
-  homexx1 = kind.xx1 - LINK->x;
-  homeyy1 = kind.yy1 - LINK->y;
-  homexx2 = kind.xx2 - LINK->x;
-  homeyy2 = kind.yy2 - LINK->y;
-  V.initx = LINK->x;
-  V.inity = LINK->y;
-  m_colormode(m_erase);
-  drawthem(&V);
-  do {
-    m_colormode((long)m_xor);
-    drawthem(&V);
-    do {
-      m_waitpen(&pen);
-      getgrid(pen.x, pen.y, &V.x1, &V.y1, LINK);
-      checkdone(&V);
-    } while (!(V.x1 != LINK->x || V.y1 != LINK->y || V.done));
-    drawthem(&V);
-    m_colormode((long)m_normal);
-    while (V.x1 == -1000 && !V.done) {
-      m_waitpen(&pen);
-      getgrid(pen.x, pen.y, &V.x1, &V.y1, LINK);
-      checkdone(&V);
-    }
-    dx = V.x1 - LINK->x;
-    dy = V.y1 - LINK->y;
-    LINK->x = V.x1;
-    LINK->y = V.y1;
-    if (V.waitdn || pen.depressed) {
-      if ((dx != 0 || dy != 0) && LINK->x != -1000) {
-	FORLIM = kind.numvects;
-	for (i = 0; i < FORLIM; i++) {
-	  WITH = &kind.vector[i];
-	  if ((1 & LINK->nearvec[i]) != 0) {
-	    WITH->x1 = P_ibound(-127L, WITH->x1 + dx, 127L);
-	    WITH->y1 = P_ibound(-127L, WITH->y1 + dy, 127L);
-	  }
-	  if ((2 & LINK->nearvec[i]) != 0) {
-	    WITH->UU.U99.x2 = P_ibound(-127L, WITH->UU.U99.x2 + dx, 127L);
-	    WITH->UU.U99.y2 = P_ibound(-127L, WITH->UU.U99.y2 + dy, 127L);
-	  }
-	  if ((4 & LINK->nearvec[i]) != 0) {
-	    WITH->UU.U99.x3 = P_ibound(-127L, WITH->UU.U99.x3 + dx, 127L);
-	    WITH->UU.U99.y3 = P_ibound(-127L, WITH->UU.U99.y3 + dy, 127L);
-	  }
-	  if ((8 & LINK->nearvec[i]) != 0) {
-	    WITH->UU.U99.x4 = P_ibound(-127L, WITH->UU.U99.x4 + dx, 127L);
-	    WITH->UU.U99.y4 = P_ibound(-127L, WITH->UU.U99.y4 + dy, 127L);
-	  }
-	}
-	FORLIM = kind.numpins;
-	for (i = 0; i < FORLIM; i++) {
-	  if (LINK->nearpins[i]) {
-	    kind.pin[i].x = P_ibound(-127L, kind.pin[i].x + dx, 127L);
-	    kind.pin[i].y = P_ibound(-127L, kind.pin[i].y + dy, 127L);
-	  }
-	}
-	if ((1 & LINK->nearregion) != 0) {
-	  kind.xx1 = P_ibound((long)gridxmin, homexx1 + LINK->x, gridxmax - 1L);
-	  if ((4 & LINK->nearregion) == 0)
-	    kind.xx2 = P_imax2((long)kind.xx2, kind.xx1 + 1L);
-	}
-	if ((4 & LINK->nearregion) != 0) {
-	  kind.xx2 = P_ibound(gridxmin + 1L, homexx2 + LINK->x, (long)gridxmax);
-	  if ((1 & LINK->nearregion) == 0)
-	    kind.xx1 = P_imin2((long)kind.xx1, kind.xx2 - 1L);
-	}
-	if ((2 & LINK->nearregion) != 0) {
-	  kind.yy1 = P_ibound((long)gridymin, homeyy1 + LINK->y, gridymax - 1L);
-	  if ((8 & LINK->nearregion) == 0)
-	    kind.yy2 = P_imax2((long)kind.yy2, kind.yy1 + 1L);
-	}
-	if ((8 & LINK->nearregion) != 0) {
-	  kind.yy2 = P_ibound(gridymin + 1L, homeyy2 + LINK->y, (long)gridymax);
-	  if ((2 & LINK->nearregion) == 0)
-	    kind.yy1 = P_imin2((long)kind.yy1, kind.yy2 - 1L);
-	}
-	kind.xx1 = P_ibound((long)gridxmin, (long)kind.xx1, (long)kind.xx2);
-	kind.xx2 = P_ibound((long)kind.xx1, (long)kind.xx2, (long)gridxmax);
-	kind.yy1 = P_ibound((long)gridymin, (long)kind.yy1, (long)kind.yy2);
-	kind.yy2 = P_ibound((long)kind.yy1, (long)kind.yy2, (long)gridymax);
-      }
-    }
-  } while (!V.done);
-  if (LINK->x == -1000) {
-    FORLIM = kind.numvects;
-    for (i = 0; i < FORLIM; i++) {
-      if (LINK->nearvec[i] != 0)
-	kind.vector[i].x1 = -128;
-    }
-    FORLIM = kind.numpins;
-    for (i = 0; i < FORLIM; i++) {
-      if (LINK->nearpins[i])
-	kind.pin[i].x = -128;
-    }
-    kind.xx1 = homexx1 + V.initx;
-    kind.yy1 = homeyy1 + V.inity;
-    kind.xx2 = homexx2 + V.initx;
-    kind.yy2 = homeyy2 + V.inity;
-  }
-  purgeoutside(LINK);
-  FORLIM = kind.numpins;
-  for (i = 1; i <= FORLIM; i++)
-    fixpin(i, LINK);
-  if (LINK->x != V.initx || LINK->y != V.inity)
-    savedflag = false;
-  needrefr = true;
-}
-
-
-Local Void movesel(LINK)
-struct LOC_drawcmd *LINK;
-{
-  long x1, y1, x2, y2, i;
-  boolean any;
-  long FORLIM;
-
-  m_colormode((long)m_xor);
-  m_color((long)white);
-  do {
-    getgrid(pen.x, pen.y, &x1, &y1, LINK);
-    if (x1 != -1000)
-      m_drawrect(gridx + LINK->x * gridspc, gridy + LINK->y * gridspc,
-		 gridx + x1 * gridspc, gridy + y1 * gridspc);
-    do {
-      m_waitpen(&pen);
-      getgrid(pen.x, pen.y, &x2, &y2, LINK);
-    } while (x1 == x2 && y1 == y2 && pen.depressed);
-    if (x1 != -1000)
-      m_drawrect(gridx + LINK->x * gridspc, gridy + LINK->y * gridspc,
-		 gridx + x1 * gridspc, gridy + y1 * gridspc);
-  } while (pen.depressed);
-  m_colormode((long)m_normal);
-  if (x1 == -1000 || x1 == LINK->x || y1 == LINK->y)
-    return;
-  any = false;
-  FORLIM = kind.numvects;
-  for (i = 0; i < FORLIM; i++) {
-    LINK->nearvec[i] = 0;
-    if (P_ibetween(LINK->x, (long)kind.vector[i].x1, x1) &&
-	P_ibetween(LINK->y, (long)kind.vector[i].y1, y1))
-      LINK->nearvec[i] = 1;
-    if (kind.vector[i].kind == 'b' || kind.vector[i].kind == 'c' ||
-	kind.vector[i].kind == 'r' || kind.vector[i].kind == 'E' ||
-	kind.vector[i].kind == 'e' || kind.vector[i].kind == 'F' ||
-	kind.vector[i].kind == 'C' || kind.vector[i].kind == 'v') {
-      if (P_ibetween(LINK->x, (long)kind.vector[i].UU.U99.x2, x1) &&
-	  P_ibetween(LINK->y, (long)kind.vector[i].UU.U99.y2, y1))
-	LINK->nearvec[i] += 2;
-      if (kind.vector[i].kind == 'c' || kind.vector[i].kind == 'F') {
-	if (P_ibetween(LINK->x, (long)kind.vector[i].UU.U99.x3, x1) &&
-	    P_ibetween(LINK->y, (long)kind.vector[i].UU.U99.y3, y1))
-	  LINK->nearvec[i] += 4;
-	if (P_ibetween(LINK->x, (long)kind.vector[i].UU.U99.x4, x1) &&
-	    P_ibetween(LINK->y, (long)kind.vector[i].UU.U99.y4, y1))
-	  LINK->nearvec[i] += 8;
-      }
-    }
-    if (LINK->nearvec[i] != 0)
-      any = true;
-  }
-  FORLIM = kind.numpins;
-  for (i = 0; i < FORLIM; i++) {
-    LINK->nearpins[i] = (kind.pinsim[i] != nopin && P_ibetween(LINK->x,
-	  (long)kind.pin[i].x,
-	  x1) && P_ibetween(LINK->y, (long)kind.pin[i].y, y1));
-    if (LINK->nearpins[i])
-      any = true;
-  }
-  LINK->nearregion = P_ibetween(LINK->x, (long)kind.xx1, x1) +
-		     P_ibetween(LINK->y, (long)kind.yy1, y1) * 2 +
-		     P_ibetween(LINK->x, (long)kind.xx2, x1) * 4 +
-		     P_ibetween(LINK->y, (long)kind.yy2, y1) * 8;
-  if ((LINK->nearregion & 5) == 0 || (LINK->nearregion & 10) == 0)
-	/*don't move region unless a corner is enclosed*/
-	  LINK->nearregion = 0;
-  if (!(any || LINK->nearregion != 0))
-    return;
-  LINK->x = x1;
-  LINK->y = y1;
-  movepoint(true, LINK);
-}
-
-
-Local Void addobject(LINK)
-struct LOC_drawcmd *LINK;
-{
-  long x1, y1, x2, y2, x3, y3, x4, y4, num;
-  boolean good;
-  Char buf[256];
-
-  m_color(colortrans[curcolor - 1]);
-  switch (veckind) {
-
-  case 'v':
-  case 'C':
-  case 'e':
-  case 'E':
-  case 'r':
-    do {
-      addvector(veckind, LINK);
-      kind.vector[kind.numvects - 1].x1 = LINK->x;
-      kind.vector[kind.numvects - 1].y1 = LINK->y;
-      if (veckind == 'r')
-	kind.vector[kind.numvects - 1].UU.U98.num = 4;
-      m_colormode((long)m_xor);
-      do {
-	getgrid(pen.x, pen.y, &x1, &y1, LINK);
-	if (x1 != -1000) {
-	  kind.vector[kind.numvects - 1].UU.U99.x2 = x1;
-	  kind.vector[kind.numvects - 1].UU.U99.y2 = y1;
-	  grvector(&kind.vector[kind.numvects - 1]);
-	}
-	do {
-	  m_waitpen(&pen);
-	  getgrid(pen.x, pen.y, &x2, &y2, LINK);
-	} while (!(x1 != x2 || y1 != y2 || pen.dn) && pen.near_);
-	if (x1 != -1000)
-	  grvector(&kind.vector[kind.numvects - 1]);
-      } while (!pen.dn && pen.near_);
-      m_colormode((long)m_normal);
-      if (!pen.near_ || x1 == -1000)
-	kind.numvects--;
-      else
-	grvector(&kind.vector[kind.numvects - 1]);
-      LINK->x = x1;
-      LINK->y = y1;
-    } while (pen.near_ && LINK->x != -1000 && veckind == 'v');
-    break;
-
-  case 'c':
-  case 'F':
-    if (veckind == 'c')
-      m_color((long)purple2);
-    good = false;
-    m_colormode((long)m_xor);
-    do {
-      getgrid(pen.x, pen.y, &x1, &y1, LINK);
-      if (x1 != -1000)
-	m_drawline(gridx + LINK->x * gridspc, gridy + LINK->y * gridspc,
-		   gridx + x1 * gridspc, gridy + y1 * gridspc);
-      do {
-	m_waitpen(&pen);
-	getgrid(pen.x, pen.y, &x4, &y4, LINK);
-      } while (!(x1 != x4 || y1 != y4 || pen.dn) && pen.near_);
-      if (x1 != -1000 && !pen.dn && pen.near_)
-	m_drawline(gridx + LINK->x * gridspc, gridy + LINK->y * gridspc,
-		   gridx + x1 * gridspc, gridy + y1 * gridspc);
-    } while (!pen.dn && pen.near_);
-    if (pen.near_ && x1 != -1000) {
-      do {
-	getgrid(pen.x, pen.y, &x2, &y2, LINK);
-	if (x2 != -1000)
-	  m_drawline(gridx + x1 * gridspc, gridy + y1 * gridspc,
-		     gridx + x2 * gridspc, gridy + y2 * gridspc);
-	do {
-	  m_waitpen(&pen);
-	  getgrid(pen.x, pen.y, &x4, &y4, LINK);
-	} while (!(x2 != x4 || y2 != y4 || pen.dn) && pen.near_);
-	if (x2 != -1000 && !pen.dn && pen.near_)
-	  m_drawline(gridx + x1 * gridspc, gridy + y1 * gridspc,
-		     gridx + x2 * gridspc, gridy + y2 * gridspc);
-      } while (!pen.dn && pen.near_);
-      if (pen.near_ && x2 != -1000) {
-	do {
-	  getgrid(pen.x, pen.y, &x3, &y3, LINK);
-	  if (x3 != -1000)
-	    m_drawline(gridx + x2 * gridspc, gridy + y2 * gridspc,
-		       gridx + x3 * gridspc, gridy + y3 * gridspc);
-	  do {
-	    m_waitpen(&pen);
-	    getgrid(pen.x, pen.y, &x4, &y4, LINK);
-	  } while (!(x3 != x4 || y3 != y4 || pen.dn) && pen.near_);
-	  if (x3 != -1000)
-	    m_drawline(gridx + x2 * gridspc, gridy + y2 * gridspc,
-		       gridx + x3 * gridspc, gridy + y3 * gridspc);
-	} while (!pen.dn && pen.near_);
-	if (pen.near_ && x3 != -1000) {
-	  addvector(veckind, LINK);
-	  kind.vector[kind.numvects - 1].x1 = LINK->x;
-	  kind.vector[kind.numvects - 1].y1 = LINK->y;
-	  kind.vector[kind.numvects - 1].UU.U99.x2 = x1;
-	  kind.vector[kind.numvects - 1].UU.U99.y2 = y1;
-	  kind.vector[kind.numvects - 1].UU.U99.x3 = x2;
-	  kind.vector[kind.numvects - 1].UU.U99.y3 = y2;
-	  kind.vector[kind.numvects - 1].UU.U99.x4 = x3;
-	  kind.vector[kind.numvects - 1].UU.U99.y4 = y3;
-	  good = true;
-	}
-      }
-      if (x2 != -1000)
-	m_drawline(gridx + x1 * gridspc, gridy + y1 * gridspc,
-		   gridx + x2 * gridspc, gridy + y2 * gridspc);
-    }
-    if (x1 != -1000)
-      m_drawline(gridx + LINK->x * gridspc, gridy + LINK->y * gridspc,
-		 gridx + x1 * gridspc, gridy + y1 * gridspc);
-    if (good)
-      grvector(&kind.vector[kind.numvects - 1]);
-    break;
-
-  case 'b':
-  case 'p':
-    if (veckind == 'b') {
-      if (fullcolor)
-	m_color((long)yellow2);
-      else
-	m_color((long)yellow);
-      m_colormode((long)m_xor);
-      do {
-	getgrid(pen.x, pen.y, &x1, &y1, LINK);
-	if (x1 != -1000)
-	  m_drawrect(gridx + LINK->x * gridspc, gridy + LINK->y * gridspc,
-		     gridx + x1 * gridspc, gridy + y1 * gridspc);
-	do {
-	  m_waitpen(&pen);
-	  getgrid(pen.x, pen.y, &x2, &y2, LINK);
-	} while (!(x1 != x2 || y1 != y2 || pen.dn) && pen.near_);
-	if (x1 != -1000)
-	  m_drawrect(gridx + LINK->x * gridspc, gridy + LINK->y * gridspc,
-		     gridx + x1 * gridspc, gridy + y1 * gridspc);
-      } while (!pen.dn && pen.near_);
-      m_colormode((long)m_normal);
-      good = (pen.near_ && x1 != -1000);
-    } else
-      good = true;
-    if (good) {
-      m_nocursor();
-      clearalpha();
-      dim();
-      printf("Enter number of marker: ");
-      gets(buf);
-      bright();
-      if (onescreen) {
-	grid();
-	refresh1();
-      }
-      if (*buf != '\0' && strsubset(buf, "0123456789")) {
-	num = strtol(buf, NULL, 0);
-	if (P_ibetween(1L, num, 255L)) {
-	  addvector(veckind, LINK);
-	  kind.vector[kind.numvects - 1].x1 = LINK->x;
-	  kind.vector[kind.numvects - 1].y1 = LINK->y;
-	  if (veckind == 'b') {
-	    kind.vector[kind.numvects - 1].UU.U99.x2 = x1;
-	    kind.vector[kind.numvects - 1].UU.U99.y2 = y1;
-	  }
-	  kind.vector[kind.numvects - 1].UU.U98.num = num;
-	  grvector(&kind.vector[kind.numvects - 1]);
-	}
-      }
-    }
-    break;
-
-  case 't':
-    m_nocursor();
-    clearalpha();
-    dim();
-    printf("Enter text to display: ");
-    gets(buf);
-    bright();
-    if (onescreen) {
-      grid();
-      refresh1();
-    }
-    if (*buf != '\0') {
-      addvector(veckind, LINK);
-      kind.vector[kind.numvects - 1].x1 = LINK->x;
-      kind.vector[kind.numvects - 1].y1 = LINK->y;
-      kind.vector[kind.numvects - 1].UU.U116.tsize = 50;
-      kind.vector[kind.numvects - 1].UU.U116.torg = torgkind;
-      kind.vector[kind.numvects - 1].UU.U116.sp = strdup(buf);
-      grvector(&kind.vector[kind.numvects - 1]);
-    }
-    break;
-  }
-}
-
-
-Local Void setmodes(vk, col, LINK)
-Char vk;
-long col;
-struct LOC_drawcmd *LINK;
-{
-  m_colormode(m_erase);
-  refrmenus();
-  veckind = vk;
-  curcolor = col;
-  m_colormode((long)m_normal);
-  refrmenus();
-}
-
-
-Local Void instructions(LINK)
-struct LOC_drawcmd *LINK;
-{
-  clearalpha();
-  dim();
-  printf("Hit space bar to refresh and rescale.\n\n");
-  printf("Press [ or ] to advance pin number menu.\n");
-  printf("Press < or > to change scale.\n");
-  printf("Press N or P to switch to next/previous gate.\n\n");
-  printf("Press C to copy another gate's picture.\n");
-  printf("Press S to set up a \"shadow\" gate.\n");
-  printf("Press E to edit the gate's picture textually.\n");
-  nc_gotoXY(0, (int)(scrheight - 2));
-  printf("Press any key to continue... ");
-  m_inkey();
-  clearalpha();
-  bright();
-  if (onescreen) {
-    grid();
-    refresh1();
-  }
-}
-
-
-
-
-
-Static Void drawcmd()
-{
-  struct LOC_drawcmd V;
-  boolean exitflag;
-  uchar cmd;
-  long x1, y1, x2, y2, px, py;
-
-
-  if (*argument != '\0') {
-    makekind(argument);
-    grid();
-  }
-  if (curkind == NULL) {
-    wrmsg("No current gate");
-    return;
-  }
-  fixscale(&V);
-  bright();
-  autoscale(1L);
-  clearalpha();
-  m_graphics_on();
-  needrefr = m_autoraise ? true : false;
-  do {
-    if (onescreen || needrefr) {
-      grid();
-      refresh1();
-    }
-    exitflag = false;
-    V.nearvec = NULL;
-    do {
-      do {
-	m_waitpen(&pen);
-      } while (!(pen.dn || m_pollkbd()));
-      if (m_pollkbd()) {
-        cmd = toupper(m_inkey());
-	switch (cmd) {
-
-        case 250:
-          needrefr = true;
-          break;
-
-        case 251:             /* X ConfigureNotify (resize) event */
-	  autoscale(1L);
-          break;         
-
-	case ' ':
-	case '5':
-	  autoscale(1L);
-          needrefr = true;
-	  break;
-
-	case '?':
-	  instructions(&V);
-	  break;
-
-	case ']':
-	  if (firstpin + scrpins <= maxpins)
-	    firstpin += scrpins;
-	  refrpinnums();
-	  break;
-
-	case '[':
-	  firstpin = P_imax2(1L, firstpin - scrpins);
-	  refrpinnums();
-	  break;
-
-	case '<':
-	  if (gridscale < 4) {
-	    autoscale(gridscale + 1L);
-            needrefr = true;  
-	  }
-	  break;
-
-	case '>':
-	  if (gridscale > 1) {
-	    autoscale(gridscale - 1L);
-            needrefr = true;  
-	  }
-	  break;
-
-	case 'C':
-	  cpyfunc();
-	  break;
-
-	case 'S':
-	  shadowfunc();
-	  break;
-
-	case 'X':  /*destroy (obsolete) pin-number annotations*/
-	  kind.numpnums = 0;
-          needrefr = true;  
-	  break;
-
-	case 'L':
-	  show_preview = show_preview ? false : true;
-          needrefr = true;  
-	  break;
-
-	case '\003':
-	case '\004':
-	case '\015':
-	case 'Q':
-	case 'N':
-	case 'P':
-	case '+':
-	case '-':
-	case '!':
-	case 'E':
-	  exitflag = true;
-	  break;
-	}
-      } else {
-	if (pen.x < numright - 2 && pen.y < msgy) {  /*grabbing a pin number*/
-	  if (!show_preview) {
-	    V.nearpin = pen.y / numspc + firstpin;
-	    if (P_ibetween(1L, V.nearpin, (long)maxpins) && pen.x < 22) {
-	      if (V.nearpin <= kind.numpins && kind.pinsim[V.nearpin - 1] != nopin) {
-	        drpin(kind.pin[V.nearpin - 1].x, kind.pin[V.nearpin - 1].y,
-		    (int)V.nearpin, false);
-	        deletepin(V.nearpin);
-	      }
-	      m_colormode((long)m_xor);
-	      do {
-	        x1 = pen.x;
-	        y1 = pen.y;
-	        grpinz((int)x1, (int)y1, (int)V.nearpin);
-	        do {
-		  m_waitpen(&pen);
-	        } while (!pen.moving);
-	        grpinz((int)x1, (int)y1, (int)V.nearpin);
-	        getgrid(pen.x, pen.y, &x1, &y1, &V);
-	      } while (x1 == -1000 && pen.depressed);
-	      m_colormode((long)m_normal);
-	      if (pen.depressed) {
-	        m_colormode((long)m_xor);
-	        do {
-		  getgrid(pen.x, pen.y, &x1, &y1, &V);
-		  if (x1 != -1000)
-		    drpin((int)x1, (int)y1, (int)V.nearpin, true);
-		  do {
-		    m_waitpen(&pen);
-		    getgrid(pen.x, pen.y, &x2, &y2, &V);
-		  } while (x2 == x1 && y2 == y1 && pen.depressed);
-		  if (x1 != -1000)
-		    drpin((int)x1, (int)y1, (int)V.nearpin, true);
-	        } while (pen.depressed);
-	        m_colormode((long)m_normal);
-	        if (x1 != -1000) {
-		  kind.pin[V.nearpin - 1].x = x1;
-		  kind.pin[V.nearpin - 1].y = y1;
-		  kind.pinsim[V.nearpin - 1] = kind.simtype;
-		  kind.pincon[V.nearpin - 1] = 0;
-		  fixpin(V.nearpin, &V);
-		  fixnumpins(V.nearpin);
-		  checkoverpin(V.nearpin, &V);
-                  drpin(kind.pin[V.nearpin - 1].x, kind.pin[V.nearpin - 1].y,
-                                        V.nearpin, true);
-		  savedflag = false;
-	        }
-	      }
-            }
-	  }
-	} else if (pen.y < msgy) {
-          if (!show_preview) {
-	    if (pen.x <= gridright + 2) {  /*in main drawing area*/
-	      px = pen.x;
-	      py = pen.y;
-	      getgrid(px, py, &V.x, &V.y, &V);
-	      if (checktap(&V)) {
-	        if (V.x != -1000)
-		  addobject(&V);
-	      } else {
-	        V.nearvec = (short *)Malloc(kind.numvects * sizeof(short));
-	        if (checknear(px, py, &V))
-		  movepoint(false, &V);
-	        else
-		  movesel(&V);
-	        Free(V.nearvec);
-	        V.nearvec = NULL;
-	      }
-            }
-	  }
-	} else if (pen.y >= msgy && pen.y <= msgy + msgheight) {
-	  if (pen.x >= msg_end) {
-	    cmd = 'Q';
-	    exitflag = true;
-	  } else if (pen.x > msg_torg && pen.y > msgy + 15) {
-            if (veckind == 't') {
-	      torgkind = (pen.x - msg_torg) / (7*2);
-	      refrtorgmenu();
-            }
-	  } else if (pen.x > msg_color
-                        && pen.x < msg_color + strlen("yellow")*8) {
-	      setmodes(veckind, curcolor % 7 + 1, &V);
-	  } else if (pen.x > msg_veckindname
-                        && pen.y > msgy + 15) {
-	      switch (veckind) {
-
-	      case 'v':
-		setmodes('C', curcolor, &V);
-		break;
-
-	      case 'C':
-		setmodes('e', curcolor, &V);
-		break;
-
-	      case 'e':
-		setmodes('E', curcolor, &V);
-		break;
-
-	      case 'E':
-		setmodes('r', curcolor, &V);
-		break;
-
-	      case 'r':
-		setmodes('c', curcolor, &V);
-		break;
-
-	      case 'c':
-		setmodes('F', curcolor, &V);
-		break;
-
-	      case 'F':
-		setmodes('t', curcolor, &V);
-		break;
-
-	      case 't':
-		setmodes('p', curcolor, &V);
-		break;
-
-	      case 'p':
-		setmodes('b', curcolor, &V);
-		break;
-
-	      case 'b':
-		setmodes('v', curcolor, &V);
-		break;
-	      }
-	    } else if (pen.x >= msg_veckindmenu
-                        && pen.x < msg_veckindmenu + strlen(veckindmenu) * 8) {
-	      setmodes(veckindmenu[(pen.x - msg_veckindmenu)/8L], curcolor, &V);
-            }
-	}
-      }
-      m_alpha_off();
-      m_graphics_on();
-      if (onescreen || needrefr) {
-        grid();
-        refresh1();
-      }
-    } while (!exitflag);
-    exitflag = false;
-    switch (cmd) {
-
-    case 'N':
-    case '+':
-      nextcmd(true);
-      break;
-
-    case 'P':
-    case '-':
-      prevcmd(true);
-      break;
-
-    case '!':
-      dim();
-      printf("\f");
-      m_alpha_on();
-      newci_shellescape("");
-      initscreen();
-      bright();
-      clearalpha();
-      needrefr = true;
-      break;
-
-    case 'E':
-      dim();
-      printf("\f");
-      m_alpha_on();
-      editcmd("");
-      bright();
-      clearalpha();
-      needrefr = true;
-      break;
-
-    default:
-      exitflag = true;
-      break;
-    }
-  } while (!exitflag);
-  m_nocursor();
-  menuflag = true;
-
-  /* right of drawing area, do nothing */
-}
-
-
-
-
-
-Static Void libcmd()
-{
-  krec *k;
-  Char ggroup[256];
-  short i, j, pg;
-  boolean flag;
-  Char ch;
-
-  flushcurkind();
-  wildcards(argument, ggroup, &flag);
-  clearalpha();
-  k = kbase;
-  pg = 1;
-  i = 2;
-  j = 2;
-  ch = ' ';
-  while (k != NULL && ch == ' ') {
-    if (comparestr(k->name, argument) && comparegroup(k->group, ggroup)) {
-      if (i == 2 && j == 2) {
-	clearalpha();
-	nc_gotoXY(0, 0);
-	printf("Listing of gates%55cPage%3d\n", ' ', pg);
-	pg++;
-      }
-      nc_gotoXY(i, j);
-      fputs(k->name, stdout);
-      j++;
-      if (j > scrheight - 4) {
-	j = 2;
-	i += 10;
-	if (i > scrwidth - 10 && k != NULL) {
-	  nc_gotoXY(0, (int)(scrheight - 2));
-	  printf("Press SPACE to continue, any letter to quit.  ");
-	  ch = nk_getkey();
-	  i = 2;
-	}
-      }
-    }
-    k = k->next;
-  }
-  nc_gotoXY(0, (int)(scrheight - 2));
-  printf("Press SPACE to continue, any letter to quit.  ");
-  ch = nk_getkey();
-  menuflag = true;
-}
-
-
-
-
-Static Void defcmd()
-{
-  Void (*proc) PP((log_action *act));
-  Char name[256];
-  Char STR1[256];
-
-  if (*argument != '\0') {
-    makekind(argument);
-    if (!onescreen)
-      refresh();
-  }
-  if (curkind == NULL) {
-    wrmsg("No current gate");
-    return;
-  }
-  if (kind.simtype == 0) {
-    wrmsg("Gate has simulation type 0");
-    return;
-  }
-  sprintf(name, "LOG_%d_PROC", kind.simtype);
-  if (!newci_findprocedure2(name, (Void(**) PV())(&proc))) {
-    sprintf(STR1, "Simulator for type %d not loaded", kind.simtype);
-    wrmsg(STR1);
-    return;
-  }
-  m_nocursor();
-  printf("\f");
-  gg.action = act_edit;
-  gg.acttool = NULL;
-  reallocproc(&kind, 100L);
-  gg.actproc = kind.proc;
-  gg.actx = kind.proclen;
-  gg.acty = 0;
-  strcpy(gg.actstr, kind.name);
-  (*proc)(&gg);
-  kind.proc = gg.actproc;
-  kind.proclen = gg.actx;
-  menuflag = true;
-  savedflag = false;
-}
-
-
-
-
-Static Void simtypecmd()
-{
-  long i, j, k;
-  boolean flag;
-  Char *STR1;
-  long FORLIM;
-
-  if (curkind != NULL) {
-    TRY(try9);
-      if (*argument != '\0') {
-	savedflag = false;
-	i = strtol(argument, &STR1, 10);
-	j = STR1 - argument + 1;
-	if (i > 254)
-	  i = 254;
-	else if (i < 0)
-	  i = 0;
-	if (j <= strlen(argument)) {
-	  k = strtol(argument + j - 1, &STR1, 10);
-	  j = STR1 - argument + 1;
-	  if (k >= 1 && k <= kind.numpins && kind.pinsim[k - 1] != nopin)
-	    kind.pinsim[k - 1] = i;
-	  else
-	    wrmsg("Pin number out of range");
-	} else {
-	  FORLIM = kind.numpins;
-	  for (j = 0; j < FORLIM; j++) {
-	    if (kind.pinsim[j] == kind.simtype)
-	      kind.pinsim[j] = i;
-	  }
-	  kind.simtype = i;
-	  newsimtype = i;
-	}
-      }
-      nc_gotoXY(0, (int)(scrheight - 5));
-      flag = false;
-      FORLIM = kind.numpins;
-      for (i = 1; i <= FORLIM; i++) {
-	if (kind.pinsim[i - 1] != nopin && kind.pinsim[i - 1] != kind.simtype) {
-	  if (!flag)
-	    printf("Main type is %d", kind.simtype);
-	  printf(", pin %ld is %d", i, kind.pinsim[i - 1]);
-	  flag = true;
-	}
-      }
-      if (!flag)
-	printf("This gate has simulation type %d", kind.simtype);
-      printf(".\n");
-    RECOVER(try9);
-      wrmsg("Bad number format!");
-    ENDTRY(try9);
-    return;
-  }
-  if (*argument == '\0') {
-    wrmsg("No current gate!");
-    return;
-  }
-  i = strtol(argument, &STR1, 10);
-  j = STR1 - argument + 1;
-  if (i > 254)
-    i = 254;
-  else if (i < 0)
-    i = 0;
-  newsimtype = i;
-}
-
-
-
-
-Static Void connectcmd()
-{
-  long i, j, k, n, n0;
-  long st[log_maxpins / 32 + 2];
-  Char *STR1;
-  long SET[257];
-  long FORLIM;
-
-  if (curkind == NULL) {
-    wrmsg("No current gate!");
-    return;
-  }
-  /* try */
-  if (*argument != '\0') {
-    i = strtol(argument, &STR1, 10);
-    j = STR1 - argument + 1;
-    if (j <= strlen(argument)) {
-      while (j <= strlen(argument)) {
-	k = strtol(argument + j - 1, &STR1, 10);
-	j = STR1 - argument + 1;
-	if (i == k || i < 1 || i > kind.numpins || k < 1 || k > kind.numpins ||
-	    kind.pinsim[i - 1] == nopin || kind.pinsim[k - 1] == nopin)
-	  continue;
-	n = i;
-	if (kind.pincon[n - 1] != 0) {
-	  do {
-	    n = kind.pincon[n - 1];
-	  } while (n != i && n != k);
-	}
-	if (n == k)
-	  continue;
-	savedflag = false;
-	n = kind.pincon[k - 1];
-	if (kind.pincon[i - 1] == 0)
-	  kind.pincon[k - 1] = i;
-	else
-	  kind.pincon[k - 1] = kind.pincon[i - 1];
-	if (n == 0)
-	  kind.pincon[i - 1] = k;
-	else
-	  kind.pincon[i - 1] = n;
-      }
-    } else {
-      if (i >= 1 && i <= kind.numpins && kind.pinsim[i - 1] != nopin &&
-	  kind.pincon[i - 1] != 0) {
-	savedflag = false;
-	n = i;
-	do {
-	  n0 = n;
-	  n = kind.pincon[n - 1];
-	} while (n != i);
-	if (kind.pincon[n - 1] == n0)
-	  kind.pincon[n0 - 1] = 0;
-	else
-	  kind.pincon[n0 - 1] = kind.pincon[n - 1];
-	kind.pincon[n - 1] = 0;
-      }
-    }
-  }
-  nc_gotoXY(0, (int)(scrheight - 5));
-  printf("Connectivity: ");
-  P_expset(st, 0L);
-  FORLIM = kind.numpins;
-  for (i = 1; i <= FORLIM; i++) {
-    if (kind.pinsim[i - 1] != nopin && kind.pincon[i - 1] != 0 &&
-	!P_inset((int)i, st)) {
-      if (*st != 0L)
-	printf("; ");
-      printf("%ld", i);
-      n = i;
-      do {
-	n = kind.pincon[n - 1];
-	if (n != i)
-	  printf(",%ld", n);
-	P_addset(st, (int)n);
-      } while (n != i);
-    }
-  }
-  if (*st == 0L)
-    printf("None");
-  printf(".\n");
-  /*  recover
-       wrmsg('Bad number format!'); */
-}
-
-
-
-
-Static Void labelcmd()
-{
-  short i, i1, p, x, y, xx, yy, len;
-  Char snail[5];
-  boolean refr;
-  nk_keytransinfo *keytrans, *keytrans2;
-  Char ch;
-
-  if (*argument != '\0') {
-    makekind(argument);
-    if (!onescreen)
-      refresh();
-  }
-  if (curkind == NULL)
-    wrmsg("No current gate");
-  else {
-    TRY(try10);
-      nk_settransarray(nk_ktstandard, &keytrans2);
-      keytrans = (nk_keytransinfo *)Malloc(sizeof(nk_keytransinfo));
-      *keytrans = *keytrans2;
-      nk_settransarray(nk_ktsupplied, &keytrans);
-      keytrans->matrix[40 - nk_keylow][-nk_keymodlow].c = 1;   /*ins ln*/
-      keytrans->matrix[41 - nk_keylow][-nk_keymodlow].c = 2;   /*del ln*/
-      keytrans->matrix[42 - nk_keylow][-nk_keymodlow].c = 4;
-	  /*recall not implemented*/
-      keytrans->matrix[43 - nk_keylow][-nk_keymodlow].c = 0;   /*ins char*/
-      keytrans->matrix[44 - nk_keylow][-nk_keymodlow].c = 5;   /*del char*/
-      keytrans->matrix[45 - nk_keylow][-nk_keymodlow].c = 6;   /*clr end*/
-      keytrans->matrix[46 - nk_keylow][-nk_keymodlow].c = 7;   /*back space*/
-      keytrans->matrix[40 - nk_keylow][-nk_keymodlow].k = nk_kknormal;
-      keytrans->matrix[41 - nk_keylow][-nk_keymodlow].k = nk_kknormal;
-      keytrans->matrix[42 - nk_keylow][-nk_keymodlow].k = nk_kknormal;
-      keytrans->matrix[43 - nk_keylow][-nk_keymodlow].k = nk_kknone;
-      keytrans->matrix[44 - nk_keylow][-nk_keymodlow].k = nk_kknormal;
-      keytrans->matrix[45 - nk_keylow][-nk_keymodlow].k = nk_kknormal;
-      keytrans->matrix[46 - nk_keylow][-nk_keymodlow].k = nk_kknormal;
-      len = 1;
-      while (kind.lbl[len - 1] != '\0')
-	len++;
-      clearalpha();
-      p = 1;
-      refr = true;
-      do {
-	if (refr) {
-	  i = 1;
-	  x = 0;
-	  y = 0;
-	  while (kind.lbl[i - 1] != '\0' && y < scrheight) {
-	    if (i == p) {
-	      xx = x;
-	      yy = y;
-	    }
-	    if (kind.lbl[i - 1] == '\001') {
-	      if (x < scrwidth) {
-/* p2c: loged.text, line 4500: Note: Character >= 128 encountered [281] */
-		nc_putChar(x, y, 170);
-		nc_clearXY(x + 1, y, (int)(scrwidth - x - 1), 1);
-	      }
-	      x = 0;
-	      y++;
-	      i++;
-	      continue;
-	    }
-	    i1 = i;
-	    while (kind.lbl[i - 1] > '\001')
-	      i++;
-	    nc_putChars(x, y, (int)P_imin2((long)(i - i1), scrwidth - x),
-			&kind.lbl[i1 - 1]);
-	    if (i1 < p && p < i) {
-	      xx = x + p - i1;
-	      yy = y;
-	    }
-	    x += i - i1;
-	  }
-	  if (i == p) {
-	    xx = x;
-	    yy = y;
-	  }
-	  if (y < scrheight)
-	    nc_clearXY(x, y, (int)(scrwidth - x), 1);
-	  if (y + 1 < scrheight)
-	    nc_clearXY(0, y + 1, (int)scrwidth, (int)(scrheight - y - 1));
-	  nc_gotoXY(xx, yy);
-	  refr = false;
-	}
-	ch = m_inkey();
-	if (ch == '\007' && p > 1) {  /*BACKSP*/
-	  p--;
-	  ch = '\005';
-	}
-	if (ch == '\b' && p > 1) {  /*left*/
-	  p--;
-	  if (kind.lbl[p - 1] != '\001')
-	    putchar(ch);
-	  else
-	    refr = true;
-	} else if (ch == '\034' && p < len) {
-	  if (kind.lbl[p - 1] != '\001')
-	    putchar(ch);
-	  else
-	    refr = true;
-	  p++;
-	} else if (ch == '\037' && p > 1) {
-	  p--;
-	  do {
-	    p--;
-	  } while (p != 0 && kind.lbl[p - 1] != '\001');
-	  p++;
-	  refr = true;
-	} else if (ch == '\n' && p < len) {
-	  while (kind.lbl[p - 1] > '\001')
-	    p++;
-	  if (p < len)
-	    p++;
-	  refr = true;
-	} else if ((uchar)ch < 32 && ((1L << ch) & 0x44) != 0 && len > p) {
-	  if (ch == '\002') {  /*DELLN*/
-	    do {
-	      p--;
-	    } while (p != 0 && kind.lbl[p - 1] != '\001');
-	    p++;
-	  }
-	  i = p;
-	  i1 = p;
-	  while (kind.lbl[i1 - 1] > '\001')
-	    i1++;
-	  if (kind.lbl[i1 - 1] != '\0')
-	    i1++;
-	  do {
-	    kind.lbl[i - 1] = kind.lbl[i1 - 1];
-	    i++;
-	    i1++;
-	  } while (kind.lbl[i - 2] != '\0');
-	  len = i - 1;
-	  refr = true;
-	  savedflag = false;
-	} else if (ch == '\004') {
-	  strcpy(snail, "__@/");
-	  nc_putStr((int)(scrwidth - 4), 0, snail);
-	  do {
-	  } while (!m_pollkbd());
-	  if (m_inkeyn() == '\004')
-	    ch = m_inkey();
-	  refr = true;
-	} else if (ch == '\005' && len > p) {
-	  for (i = p; i < len; i++)
-	    kind.lbl[i - 1] = kind.lbl[i];
-	  len--;
-	  refr = true;
-	  savedflag = false;
-	} else if ((uchar)ch < 32 && ((1L << ch) & 0x2002) != 0 ||
-		   ch >= ' ' && (ch & (~127)) == 0) {
-	  realloclbl(&kind, len + 1L);
-	  for (i = len; i >= p; i--)
-	    kind.lbl[i] = kind.lbl[i - 1];
-	  len++;
-	  if (ch == '\015')
-	    kind.lbl[p - 1] = '\001';   /*ENTER*/
-	  else
-	    kind.lbl[p - 1] = ch;
-	  if (ch != '\001')
-	    p++;
-	  if (ch >= ' ' && p == len)
-	    putchar(ch);
-	  else
-	    refr = true;
-	  savedflag = false;
-	}
-      } while (ch != '\003');
-      if (len > 1 && kind.lbl[len - 2] != '\001') {
-	realloclbl(&kind, len + 1L);
-	kind.lbl[len - 1] = '\001';
-	kind.lbl[len] = '\0';
-      }
-      menuflag = true;
-      nk_settransarray(nk_ktstandard, &keytrans);
-    RECOVER(try10);
-      nk_settransarray(nk_ktstandard, &keytrans);
-      _Escape(P_escapecode);
-    ENDTRY(try10);
-  }
-  i = 1;
-  y = 0;
-  x = 0;
-  if (true || curkind == NULL)   /*THIS CODE IS DISABLED!*/
-    return;
-  TRY(try11);
-    while (kind.lbl[i - 1] != '\0') {
-      if (kind.lbl[i - 1] == '\001') {
-	x = 0;
-	y++;
-	if (y > 23) {
-	  wrmsg("Warning: more than 24 lines!");
-	  P_escapecode = 0;
-	  goto _Ltry11;
-	}
-      } else {
-	x++;
-	if (x >= 80) {
-	  wrmsg("Warning: a line is longer than 80 characters!");
-	  P_escapecode = 0;
-	  goto _Ltry11;
-	}
-      }
-      i++;
-    }
-  RECOVER2(try11,_Ltry11);
-    if (P_escapecode == -20)
-      _Escape(-20);
-    menuflag = false;
-  ENDTRY(try11);
-
-  /*right*/
-  /*up*/
-  /*down*/
-  /*DELLN or CLREND*/
-  /*RECALL*/
-  /*DELCH or BACKSP*/
-  /*INSLN, ENTER, or char*/
-}
-
-
-
-
-Static Void groupcmd()
-{
-  long i, j;
-  Char *STR1;
-
-  if (curkind == NULL) {
-    wrmsg("No current gate!");
-    return;
-  }
-  TRY(try12);
-    if (*argument != '\0') {
-      i = strtol(argument, &STR1, 10);
-      j = STR1 - argument + 1;
-      if (i > 8)
-	kind.group = 8;
-      else if (i < 0)
-	kind.group = 0;
-      else
-	kind.group = i;
-      savedflag = false;
-    }
-    nc_gotoXY(0, (int)(scrheight - 5));
-    printf("This gate is in group %d.\n", kind.group);
-  RECOVER(try12);
-    wrmsg("Bad number format!");
-  ENDTRY(try12);
-}
-
-
-typedef Char narr[16][9];
-
-narr names = {
-  "NOFLIP", "TOGGLE", "VISIBLE", "NAMED", "NRIGHT", "NOSOLDER", "Z", "Z", "Z",
-  "Z", "Z", "Z", "Z", "Z", "USER1", "USER2"
-  };
-
-
-Static Void flagcmd(kind, buf, mode)
-krec *kind;
-Char *buf;
-long mode;
-{
-  long i;
-  int TEMP;
-
-  switch (mode) {
-
-  case 0:
-    if (curkind != NULL) {
-      strupper(argument, argument);
-      if (!strcmp(argument, "Z"))
-	kind->flag.i = 0;
-      else if (argument[0] != '\0') {
-	for (i = 0; i <= 15; i++) {
-	  if (strbegins(names[i], argument)) {
-	    TEMP = ((kind->flag.a & (1 << i)) == 0);
-	    kind->flag.a &= ~(1 << i);
-	    kind->flag.a |= TEMP << i;
-	    savedflag = false;
-	  }
-	}
-      }
-      nc_gotoXY(0, (int)(scrheight - 5));
-      printf("Flags Set:");
-      for (i = 0; i <= 15; i++) {
-	if ((kind->flag.a & (1 << i)) != 0 && strcmp(names[i], "Z"))
-	  printf(" %s", names[i]);
-      }
-      printf("  Clear:");
-      for (i = 0; i <= 15; i++) {
-	if ((kind->flag.a & (1 << i)) == 0 && strcmp(names[i], "Z"))
-	  printf(" %s", names[i]);
-      }
-    }
-    break;
-
-  case 1:
-  case 2:
-    *buf = '\0';
-    for (i = 0; i <= 15; i++) {
-      if ((kind->flag.a & (1 << i)) != 0 && strcmp(names[i], "Z")) {
-	if (*buf != '\0')
-	  strcat(buf, " ");
-	strcat(buf, names[i]);
-      }
-    }
-    break;
-
-  case 3:
-    for (i = 0; i <= 15; i++) {
-      if (strcicmp(names[i], buf) == 0)
-	kind->flag.a |= 1 << i;
-    }
-    break;
-  }
-}
-
-
-
-
-Static Void copycmd()
-{
-  Char n[9];
-  krec *k, *k1;
-  uchar *newproc;
-  Char *newlbl;
-  vectorrec *newvects;
-  Char ch;
-
-  if (*argument == '\0' || curkind == NULL)
-    return;
-  flushcurkind();
-  k1 = curkind;
-  ch = 'Y';
-  if (!addkind(argument)) {
-    printf("\"%s\" already exists -- destroy it? ", argument);
-    ch = readyn("YN");
-  }
-  if (ch != 'Y') {
-    curkind = k1;
-    return;
-  }
-  if (shadowkind == curkind)
-    shadowkind = NULL;
-  k = curkind->next;
-  strcpy(n, curkind->name);
-  *curkind = *k1;
-  newproc = (uchar *)Malloc(k1->proclen);
-  memmove((Anyptr)newproc, (Anyptr)k1->proc, k1->proclen);
-  curkind->proc = newproc;
-  newlbl = (Char *)Malloc(k1->lbllen);
-  memmove((Anyptr)newlbl, (Anyptr)k1->lbl, k1->lbllen);
-  curkind->lbl = newlbl;
-  newvects = (vectorrec *)Malloc(k1->allocvects * sizeof(vectorrec));
-  memmove((Anyptr)newvects, (Anyptr)k1->vector,
-	  k1->allocvects * sizeof(vectorrec));
-  curkind->vector = newvects;
-  strlist_copy(&curkind->pinnames, k1->pinnames);
-  strcpy(curkind->name, n);
-  curkind->next = k;
-  kind = *curkind;
-  savedflag = false;
-  refrkind = true;
-}
-
-
-
-
-Static Void renamecmd()
-{
-  Char n[9];
-  krec *k, *k1, *k2;
-  Char STR2[256];
-
-  if (*argument == '\0' || curkind == NULL)
-    return;
-  strncpy(n, argument, 8);
-  n[8] = '\0';
-  strupper(n, n);
-  k = kbase;
-  k1 = NULL;
-  while (k != NULL && before(k->name, n)) {
-    k1 = k;
-    k = k->next;
-  }
-  if (k != NULL && !strcmp(k->name, n)) {
-    sprintf(STR2, "\"%s\" already exists", argument);
-    wrmsg(STR2);
-    return;
-  }
-  if (shadowkind == curkind)
-    shadowkind = NULL;
-  if (k1 != curkind) {
-    k2 = kbase;
-    while (k2 != NULL && k2->next != curkind)
-      k2 = k2->next;
-    if (k2 == NULL)
-      kbase = curkind->next;
-    else
-      k2->next = curkind->next;
-    if (k1 == NULL) {
-      curkind->next = kbase;
-      kbase = curkind;
-    } else {
-      curkind->next = k1->next;
-      k1->next = curkind;
-    }
-  }
-  strcpy(curkind->name, n);
-  strcpy(kind.name, n);
-  savedflag = false;
-  refrkind = true;
-}
-
-
-
-
-Static Void dispcurkind()
-{
-  Free(kind.proc);
-  Free(kind.lbl);
-  Free(kind.vector);
-  strlist_empty(&kind.pinnames);
-  Free(curkind);
-}
-
-
-Static Void deletecmd()
-{
-  Char ch;
-  krec *k, *k1, *k2;
-  Char ggroup[256];
-  boolean current, verf, found, anyfound;
-
-  flushcurkind();
-  current = (*argument == '\0');
-  wildcards(argument, ggroup, &verf);
-  anyfound = false;
-  k1 = curkind;
-  do {
-    if (!current) {
-      k2 = kbase;
-      found = false;
-      do {
-	while (k2 != NULL && !(comparestr(k2->name, argument) &&
-			       comparegroup(k2->group, ggroup)))
-	  k2 = k2->next;
-	if (k2 != NULL) {
-	  if (verf) {
-	    nc_gotoXY(0, (int)(scrheight - 3));
-	    anyfound = true;
-	    printf("Delete %s? ", k2->name);
-	    ch = readyn("YNQ");
-	    switch (ch) {
-
-	    case 'Y':
-	      found = true;
-	      break;
-
-	    case 'N':
-	      k2 = k2->next;
-	      break;
-
-	    case 'Q':
-	      k2 = NULL;
-	      break;
-	    }
-	    nc_gotoXY(0, (int)(scrheight - 3));
-	    putchar('\t');
-	  } else
-	    found = true;
-	} else
-	  found = false;
-      } while (!(found || k2 == NULL));
-      if (k2 != NULL) {
-	curkind = k2;
-	kind = *curkind;
-	found = true;
-      }
-    } else
-      found = (curkind != NULL);
-    if (found) {
-      if (shadowkind == curkind)
-	shadowkind = NULL;
-      k = kbase;
-      while (k != NULL && k->next != curkind)
-	k = k->next;
-      if (k == NULL)
-	kbase = curkind->next;
-      else
-	k->next = curkind->next;
-      if (k1 != curkind) {
-	dispcurkind();
-	curkind = k1;
-	if (k1 != NULL)
-	  kind = *curkind;
-      } else {
-	k = curkind->next;
-	dispcurkind();
-	if (k != NULL)
-	  curkind = k;
-	else
-	  curkind = kbase;
-	if (curkind != NULL)
-	  kind = *curkind;
-      }
-      anyfound = true;
-    }
-  } while (!current && found);
-  if (!anyfound) {
-    wrmsg("No such gate!");
-    return;
-  }
-  refrkind = true;
-  autoscale(1L);
-  needrefr = true;
-  savedflag = false;
-}
-
-
-
-
-
-Static Void getdefn(kind, def, mode)
-krec *kind;
-na_strlist **def;
-long mode;
-{
-  Char name[256];
-  Void (*proc) PP((log_action *act));
-
-  if (mode != 3)
-    *def = NULL;
-  if (kind->simtype == 0)
-    return;
-  sprintf(name, "LOG_%d_PROC", kind->simtype);
-  if (!newci_findprocedure2(name, (Void(**) PV())(&proc)))
-    return;
-  gg.action = act_edit;
-  gg.acttool = NULL;
-  gg.actproc = kind->proc;
-  gg.actx = kind->proclen;
-  gg.acty = mode;
-  strcpy(gg.actstr, kind->name);
-  gg.actstrlist = *def;
-  (*proc)(&gg);
-  if (mode == 3) {
-    kind->proc = gg.actproc;
-    kind->proclen = gg.actx;
-  } else
-    *def = gg.actstrlist;
-}
-
-
-#define lblx            6.8
-#define lblspc          0.15
-#define defmin          4.9
-#define lblsep          4.5
-#define lblmin          0.5
-#define headerx1        0.5
-#define headerx2        2.5
-#define headery         1.2
-#define headerspc       0.2
-
-
-/* Local variables for dumpcmd: */
-struct LOC_dumpcmd {
-  FILE *f;
-} ;
-
-Local Void writestr(s_, LINK)
-Char *s_;
-struct LOC_dumpcmd *LINK;
-{
-  Char s[256];
-  long i;
-  Char STR1[256];
-
-  strcpy(s, s_);
-  i = 1;
-  while (i <= strlen(s)) {
-    switch (s[i - 1]) {
-
-    case '(':
-    case ')':
-    case '\\':
-      sprintf(STR1, "\\%s", s + i - 1);
-      strcpy(s + i - 1, STR1);
-      i += 2;
-      break;
-
-    default:
-      i++;
-      break;
-    }
-  }
-  fprintf(LINK->f, "(%s)\n", s);
-}
-
-
-
-Static Void dumpcmd()
-{
-  struct LOC_dumpcmd V;
-  long i, n, curcol;
-  long st[log_maxpins / 32 + 2];
-  na_strlist *def, *fonts, *l1;
-  boolean markerfont;
-  double x, y, dx, dy, norm;
-  Char name[256], STR1[256], STR2[256];
-  Char STR3[256];
-  long FORLIM;
-  vectorrec *WITH;
-  long SET[257];
-  FILE *preamble;
-  int predata;
-  Char prefile[1024];
-  int spool = 0;
-  Char	unixCommand[256];
-
-  V.f = NULL;
-  if (curkind == NULL)
-    wrmsg("No current gate");
-  else {
-    if (*argument == '\0') {
-      do {
-	sprintf(argument, "/tmp/loged%ld.ps",
-		ma_rand2(0L, 9999L));
-	spool = 1;
-      } while (access(argument, F_OK) == 0);
-    } else
-      newci_fixfname(argument, "ps", "");
-    if (V.f != NULL)
-      V.f = freopen(argument, "w", V.f);
-    else
-      V.f = fopen(argument, "w");
-    if (V.f == NULL)
-      _EscIO(FileNotFound);
-    fprintf(V.f, "%%!Not-Quite-PS-Adobe-1.0\n");   /*stolen from Until*/
-    fprintf(V.f, "%%%%Creator: Loged\n");
-    sprintf(prefile, "%s/preamble.ps", LOGLIB);
-    preamble=fopen(prefile,"r");
-    while((predata = fgetc(preamble)) != EOF)
-        {
-          putc(predata,V.f);
-        }
-    fclose(preamble);
-    fprintf(V.f,
-      "/BOX { 2 copy M 3 index exch L 3 -1 roll 2 index L exch L CP } def\n");
-    fprintf(V.f, "%%%%EndProlog\n");
-    /*$if false$ writeln(f, '{/TeX-MBB [20 20 576 756] def} Not-In-TeX'); $end$*/
-    fprintf(V.f, "{/TeX-MBB [0 0 612 792] def} Not-In-TeX\n");
-    fprintf(V.f, "[ 0 0 8.5 11 ] TeX-do-square-scale\n");
-    fprintf(V.f, "0 11 translate -90 rotate FILLSTROKE\n");
-
-    /* Gate name */
-    fprintf(V.f, "/bigfont 40 /Helvetica-Bold DF bigfont SF\n");
-    writestr(kind.name, &V);
-    fprintf(V.f, "0.5 8.2 TUL\n");
-    writestr(kind.name, &V);
-    fprintf(V.f, "10.5 8.2 TUR\n");
-
-    /* Picture */
-    fprintf(V.f, "save 3.5 4.5 translate 3 %d div dup scale\n", gridmax);
-    fprintf(V.f, "/pinfont 10 /Helvetica DF pinfont SF\n");
-    fprintf(V.f, ".2 pt SLW 0 SG\n");
-    fprintf(V.f, "NP %d dup dup neg dup BOX SP\n", gridmax);
-    fprintf(V.f, "2 pt SLW .95 SG\n");
-    fprintf(V.f, "NP %d %d %d %d BOX SP\n",
-	    kind.xx1, -kind.yy1, kind.xx2, -kind.yy2);
-    fprintf(V.f, ".9 SG\n");
-    FORLIM = kind.numpins;
-    for (i = 0; i < FORLIM; i++) {
-      if (kind.pinsim[i] != nopin)
-	fprintf(V.f, "%d %d 5 pt 0 360 arc FP\n",
-		kind.pin[i].x, -kind.pin[i].y);
-    }
-    fprintf(V.f, "1 pt SLW 0 SG gsave 1 SLC 1 SLJ\n");
-    fonts = NULL;
-    markerfont = false;
-    curcol = 1;
-    FORLIM = kind.numvects;
-    for (i = 0; i < FORLIM; i++) {
-      WITH = &kind.vector[i];
-      if (WITH->col != curcol) {
-	curcol = WITH->col;
-	if (WITH->col == 1 || WITH->col == 3 && WITH->kind == 't')
-	  fprintf(V.f, "0 SG\n");
-	else
-	  fprintf(V.f, ".5 SG\n");
-      }
-      switch (WITH->kind) {
-
-      case 'v':
-	fprintf(V.f, "NP %d %d M %d %d L SP\n",
-		WITH->x1, -WITH->y1, WITH->UU.U99.x2, -WITH->UU.U99.y2);
-	break;
-
-      case 'F':
-	fprintf(V.f, "NP %d %d M %d %d L %d %d L %d %d L CP FP\n",
-		WITH->x1, -WITH->y1, WITH->UU.U99.x2, -WITH->UU.U99.y2,
-		WITH->UU.U99.x3, -WITH->UU.U99.y3, WITH->UU.U99.x4,
-		-WITH->UU.U99.y4);
-	break;
-
-      case 'C':
-	fprintf(V.f, "NP %1.1f %1.1f %1.1f 0 360 arc CP SP\n",
-		(WITH->x1 + WITH->UU.U99.x2) / 2.0,
-		(WITH->y1 + WITH->UU.U99.y2) / -2.0,
-		P_imax2((long)abs(WITH->x1 - WITH->UU.U99.x2),
-			(long)abs(WITH->y1 - WITH->UU.U99.y2)) / 2.0);
-	break;
-
-      case 'e':
-      case 'E':
-	fprintf(V.f, "NP %d %1.1f M\n",
-		WITH->x1, (WITH->y1 + WITH->UU.U99.y2) / -2.0);
-	fprintf(V.f, "%d %1.2f %1.2f %d %1.1f %d curveto\n",
-		WITH->x1, -0.22386 * WITH->y1 - 0.77614 * WITH->UU.U99.y2,
-		0.22386 * WITH->UU.U99.x2 + 0.77614 * WITH->x1,
-		-WITH->UU.U99.y2, (WITH->x1 + WITH->UU.U99.x2) / 2.0,
-		-WITH->UU.U99.y2);
-	fprintf(V.f, "%1.2f %d %d %1.2f %d %1.1f curveto\n",
-		0.22386 * WITH->x1 + 0.77614 * WITH->UU.U99.x2,
-		-WITH->UU.U99.y2, WITH->UU.U99.x2,
-		-0.22386 * WITH->y1 - 0.77614 * WITH->UU.U99.y2,
-		WITH->UU.U99.x2, (WITH->y1 + WITH->UU.U99.y2) / -2.0);
-	fprintf(V.f, "%d %1.2f %1.2f %d %1.1f %d curveto\n",
-		WITH->UU.U99.x2,
-		-0.22386 * WITH->UU.U99.y2 - 0.77614 * WITH->y1,
-		0.22386 * WITH->x1 + 0.77614 * WITH->UU.U99.x2, -WITH->y1,
-		(WITH->x1 + WITH->UU.U99.x2) / 2.0, -WITH->y1);
-	fprintf(V.f, "%1.2f %d %d %1.2f %d %1.1f curveto CP",
-		0.22386 * WITH->UU.U99.x2 + 0.77614 * WITH->x1, -WITH->y1,
-		WITH->x1, -0.22386 * WITH->UU.U99.y2 - 0.77614 * WITH->y1,
-		WITH->x1, (WITH->y1 + WITH->UU.U99.y2) / -2.0);
-	if (WITH->kind == 'e')
-	  fprintf(V.f, " SP\n");
-	else
-	  fprintf(V.f, " FP\n");
-	break;
-
-      case 'r':
-	if (abs(WITH->x1 - WITH->UU.U99.x2) <= WITH->UU.U98.num * 2 ||
-	    abs(WITH->y1 - WITH->UU.U99.y2) <= WITH->UU.U98.num * 2)
-	  fprintf(V.f, "NP %d %d %d %d BOX SP\n",
-		  WITH->x1, -WITH->y1, WITH->UU.U99.x2, -WITH->UU.U99.y2);
-	else {
-	  fprintf(V.f,
-	    "NP %ld %ld M %ld %ld %d -90 0 arc %ld %ld %d 0 90 arc\n",
-	    P_imin2((long)WITH->x1, (long)WITH->UU.U99.x2) + WITH->UU.U98.num,
-	    P_imin2((long)(-WITH->y1), (long)(-WITH->UU.U99.y2)),
-	    P_imax2((long)WITH->x1, (long)WITH->UU.U99.x2) - WITH->UU.U98.num,
-	    P_imin2((long)(-WITH->y1), (long)(-WITH->UU.U99.y2)) +
-	      WITH->UU.U98.num, WITH->UU.U98.num,
-	    P_imax2((long)WITH->x1, (long)WITH->UU.U99.x2) - WITH->UU.U98.num,
-	    P_imax2((long)(-WITH->y1), (long)(-WITH->UU.U99.y2)) -
-	      WITH->UU.U98.num, WITH->UU.U98.num);
-/* p2c: loged.text, line 5381: 
- * Note: Line breaker spent 2.0 seconds, 5000 tries on line 5498 [251] */
-	  fprintf(V.f, "%ld %ld %d 90 180 arc %ld %ld %d 180 270 arc CP SP\n",
-	    P_imin2((long)WITH->x1, (long)WITH->UU.U99.x2) + WITH->UU.U98.num,
-	    P_imax2((long)(-WITH->y1), (long)(-WITH->UU.U99.y2)) -
-	      WITH->UU.U98.num, WITH->UU.U98.num,
-	    P_imin2((long)WITH->x1, (long)WITH->UU.U99.x2) + WITH->UU.U98.num,
-	    P_imin2((long)(-WITH->y1), (long)(-WITH->UU.U99.y2)) +
-	      WITH->UU.U98.num, WITH->UU.U98.num);
-/* p2c: loged.text, line 5381: Note:
- * Line breaker spent 1.0+1.00 seconds, 5000 tries on line 5507 [251] */
-	}
-	break;
-
-      case 'c':
-	fprintf(V.f, "NP %d %d M %d %d %d %d %d %d curveto SP\n",
-		WITH->x1, -WITH->y1, WITH->UU.U99.x2, -WITH->UU.U99.y2,
-		WITH->UU.U99.x3, -WITH->UU.U99.y3, WITH->UU.U99.x4,
-		-WITH->UU.U99.y4);
-	break;
-
-      case 'p':
-	if (!markerfont)
-	  fprintf(V.f, "/markfont 10 /Times-Italic DF\n");
-	markerfont = true;
-	fprintf(V.f, "gsave 0 SLW NP \n");
-	fprintf(V.f, "%d 3 pt sub %d 3 pt sub M\n", WITH->x1, -WITH->y1);
-	fprintf(V.f, "%d 3 pt add %d 3 pt add L\n", WITH->x1, -WITH->y1);
-	fprintf(V.f, "%d 3 pt sub %d 3 pt add M\n", WITH->x1, -WITH->y1);
-	fprintf(V.f, "%d 3 pt add %d 3 pt sub L\n", WITH->x1, -WITH->y1);
-	fprintf(V.f, "SP grestore markfont SF\n");
-	fprintf(V.f, "(%d) %d 8 pt add %d TCL\n",
-		WITH->UU.U98.num, WITH->x1, -WITH->y1);
-	break;
-
-      case 'b':
-	if (!markerfont)
-	  fprintf(V.f, "/markfont 10 /Times-Italic DF\n");
-	markerfont = true;
-	fprintf(V.f, "gsave 0 SLW NP %d %d %d %d BOX SP grestore\n",
-		WITH->x1, -WITH->y1, WITH->UU.U99.x2, -WITH->UU.U99.y2);
-	fprintf(V.f, "markfont SF\n");
-	fprintf(V.f, "(%d) %1.1f %1.1f TCC\n",
-		WITH->UU.U98.num, (WITH->x1 + WITH->UU.U99.x2) / 2.0,
-		(WITH->y1 + WITH->UU.U99.y2) / -2.0);
-	break;
-
-      case 't':
-	sprintf(STR2, "%d", WITH->UU.U116.tsize);
-	if (strlist_find(fonts, STR2) == NULL) {
-	  sprintf(STR1, "%d", WITH->UU.U116.tsize);
-	  l1 = strlist_add(&fonts, STR1);
-	  fprintf(V.f, "/font%d /Helvetica findfont %1.1f scalefont def\n",
-		  WITH->UU.U116.tsize, WITH->UU.U116.tsize / 10.0);
-	}
-	fprintf(V.f, "font%d SF /STRH %1.3f def\n",
-		WITH->UU.U116.tsize, WITH->UU.U116.tsize * 0.08);
-	writestr(WITH->UU.U116.sp, &V);
-	fprintf(V.f, "%d %d T%s\n",
-		WITH->x1, -WITH->y1,
-		strsub(STR2, "ULUCURCLCCCRLLLCLR", WITH->UU.U116.torg * 2 + 1,
-		       2));
-	break;
-      }
-    }
-    fprintf(V.f, "grestore\n");
-    strlist_empty(&fonts);
-    l1 = kind.pinnames;
-    FORLIM = kind.numpins;
-    for (i = 1; i <= FORLIM; i++) {
-      if (kind.pinsim[i - 1] != nopin) {
-	dx = kind.pin[i - 1].x;
-	dy = -kind.pin[i - 1].y;
-	sprintf(name, "%ld", i);
-	if (kind.pinsim[i - 1] != kind.simtype)
-	  sprintf(name + strlen(name), "/%d", kind.pinsim[i - 1]);
-	while (l1 != NULL && (long)l1->value <= i) {
-	  if ((long)l1->value == i)
-	    sprintf(name + strlen(name), " \"%s\"", l1->s);
-	  l1 = l1->next;
-	}
-	writestr(name, &V);
-	if (kind.pin[i - 1].x < kind.xx1 && P_ibetween((long)kind.yy1,
-	      (long)kind.pin[i - 1].y, (long)kind.yy2))
-	  fprintf(V.f, "%d %d TCR\n",
-		  kind.pin[i - 1].x - gridscale, -kind.pin[i - 1].y);
-	else if (kind.pin[i - 1].x > kind.xx2 && P_ibetween((long)kind.yy1,
-		   (long)kind.pin[i - 1].y, (long)kind.yy2))
-	  fprintf(V.f, "%d %d TCL\n",
-		  kind.pin[i - 1].x + gridscale, -kind.pin[i - 1].y);
-	else if (kind.pin[i - 1].y < kind.yy1 && P_ibetween((long)kind.xx1,
-		   (long)kind.pin[i - 1].x, (long)kind.xx2))
-	  fprintf(V.f, "%d %d TLC\n",
-		  kind.pin[i - 1].x, gridscale - kind.pin[i - 1].y);
-	else if (kind.pin[i - 1].y > kind.yy2 && P_ibetween((long)kind.xx1,
-		   (long)kind.pin[i - 1].x, (long)kind.xx2))
-	  fprintf(V.f, "%d %d TUC\n",
-		  kind.pin[i - 1].x, -kind.pin[i - 1].y - gridscale);
-	else {
-	  if (dx != 0 || dy != 0) {
-	    norm = 2 / sqrt((double)(dx * dx + dy * dy));
-	    dx *= norm;
-	    dy *= norm;
-	  }
-	  fprintf(V.f, "%1.2f %1.2f TCC\n",
-		  kind.pin[i - 1].x + dx, dy - kind.pin[i - 1].y);
-	}
-      }
-    }
-    fprintf(V.f, "restore\n");
-
-    /* Definition */
-    fprintf(V.f, "/labelfont 10 /Helvetica DF labelfont SF\n");
-    fprintf(V.f, "/notefont 8 /Times-Italic DF\n");
-    getdefn(&kind, &def, 1L);
-    if (def != NULL) {
-      l1 = def;
-      i = 0;
-      while (l1 != NULL) {
-	i++;
-	l1 = l1->next;
-      }
-      y = 7.5;
-      l1 = def;
-      while (l1 != NULL && y > defmin) {
-	if (*l1->s != '\0') {
-	  writestr(l1->s, &V);
-	  fprintf(V.f, "%1.2f %1.2f TUL\n", lblx, y);
-	}
-	y -= lblspc;
-	l1 = l1->next;
-      }
-      if (l1 != NULL)
-	fprintf(V.f, "notefont SF (etc\\274) %1.2f %1.2f TUL labelfont SF\n",
-		lblx, y);
-      strlist_empty(&def);
-    }
-    fprintf(V.f, ".2 pt SLW NP %1.2f %1.2f M 6 0 R SP\n", lblx - 0.1, lblsep);
-
-    /* write labels */
-    y = lblsep - 0.2;
-    i = 1;
-    while (kind.lbl[i - 1] != '\0' && y > lblmin) {
-      *name = '\0';
-      while (kind.lbl[i - 1] > '\001' && strlen(name) < 255) {
-	sprintf(name + strlen(name), "%c", kind.lbl[i - 1]);
-	i++;
-      }
-      if (kind.lbl[i - 1] == '\001')
-	i++;
-      if (*name != '\0') {
-	writestr(name, &V);
-	fprintf(V.f, "%1.2f %1.2f TUL\n", lblx, y);
-      }
-      y -= lblspc;
-    }
-    if (kind.lbl[i - 1] != '\0')
-      fprintf(V.f, "notefont SF (etc\\274) %1.2f %1.2f TUL\n", lblx, y);
-
-    /* other information */
-    fprintf(V.f, "/headerfont 12 /Helvetica DF headerfont SF\n");
-    x = headerx1;
-    y = headery;
-    if (*filename != '\0') {
-      sprintf(STR3, "File: %s", filename);
-      writestr(STR3, &V);
-    } else
-      writestr("File: (unknown)", &V);
-    fprintf(V.f, "%1.2f %1.2f TLL\n", x, y);
-    y -= headerspc;
-    sprintf(STR3, "Group: %d", kind.group);
-    writestr(STR3, &V);
-    fprintf(V.f, "%1.2f %1.2f TLL\n", x, y);
-    y -= headerspc;
-    sprintf(STR3, "Simtype: %d", kind.simtype);
-    writestr(STR3, &V);
-    fprintf(V.f, "%1.2f %1.2f TLL\n", x, y);
-    x = headerx2;
-    y = headery - headerspc;
-    strcpy(name, "Connectivity: ");
-    P_expset(st, 0L);
-    FORLIM = kind.numpins;
-    for (i = 1; i <= FORLIM; i++) {
-      if (kind.pinsim[i - 1] != nopin && kind.pincon[i - 1] != 0 &&
-	  !P_inset((int)i, st)) {
-	if (*st != 0L)
-	  strcat(name, "; ");
-	sprintf(name + strlen(name), "%ld", i);
-	n = i;
-	do {
-	  n = kind.pincon[n - 1];
-	  if (n != i)
-	    sprintf(name + strlen(name), ",%ld", n);
-	  P_addset(st, (int)n);
-	} while (n != i);
-      }
-    }
-    if (*st == 0L)
-      strcat(name, "None");
-    writestr(name, &V);
-    fprintf(V.f, "%1.2f %1.2f TLL\n", x, y);
-    y -= headerspc;
-    flagcmd(&kind, name, 1L);
-    if (*name == '\0')
-      writestr("Flags: None", &V);
-    else {
-      sprintf(STR3, "Flags: %s", name);
-      writestr(STR3, &V);
-    }
-    fprintf(V.f, "%1.2f %1.2f TLL\n", x, y);
-
-    fprintf(V.f, "{showpage} Not-In-TeX UNTILFINISH\n");
-    fprintf(V.f, "%%%%EndFile\n");
-    if (V.f != NULL)
-      fclose(V.f);
-    V.f = NULL;
-  }
-  if (V.f != NULL)
-    fclose(V.f);
-  if (spool)
-    {
-      strcpy (unixCommand, "lpr -h ");
-      strcat (unixCommand, argument);
-      system (unixCommand);
-      strcpy (unixCommand, "rm -f ");
-      strcat (unixCommand, argument);
-      system (unixCommand);
-    }
-}
-
-#undef lblx
-#undef lblspc
-#undef defmin
-#undef lblsep
-#undef lblmin
-#undef headerx1
-#undef headerx2
-#undef headery
-#undef headerspc
-
-
-
-
-
-Static Void addpinname(num, name)
-long num;
-Char *name;
-{
-  na_strlist *l1, **prev;
-
-  prev = &kind.pinnames;
-  while (*prev != NULL && (long)(*prev)->value <= num)
-    prev = &(*prev)->next;
-  l1 = strlist_insert(prev, name);
-  l1->value = (na_long)num;
-}
-
-
-/* Local variables for readfile: */
-struct LOC_readfile {
-  na_strlist *def, *labels;
-  long curcol;
-  boolean defining, hasdef, haslabels;
-} ;
-
-Local Void addvector_(knd, LINK)
-Char knd;
-struct LOC_readfile *LINK;
-{
-  vectorrec *WITH;
-
-  kind.numvects++;
-  reallocvects(&kind, (long)kind.numvects);
-  WITH = &kind.vector[kind.numvects - 1];
-  WITH->kind = knd;
-  WITH->col = LINK->curcol;
-}
-
-Local Void endkind(LINK)
-struct LOC_readfile *LINK;
-{
-  long i;
-  na_strlist *l1;
-
-  if (LINK->hasdef) {
-    reallocproc(&kind, 100L);
-    getdefn(&kind, &LINK->def, 3L);
-  }
-  if (LINK->haslabels) {
-    i = 1;
-    l1 = LINK->labels;
-    while (l1 != NULL) {
-      i += strlen(l1->s) + 1;
-      l1 = l1->next;
-    }
-    realloclbl(&kind, i);
-    i = 1;
-    l1 = LINK->labels;
-    while (l1 != NULL) {
-      if (*l1->s != '\0')
-	memmove((Anyptr)(&kind.lbl[i - 1]), (Anyptr)l1->s,
-		(long)strlen(l1->s));
-      i += strlen(l1->s);
-      kind.lbl[i - 1] = '\001';
-      i++;
-      l1 = l1->next;
-    }
-    kind.lbl[i - 1] = '\0';
-  }
-  strlist_empty(&LINK->def);
-  strlist_empty(&LINK->labels);
-  LINK->hasdef = false;
-  LINK->haslabels = false;
-  LINK->defining = false;
-}
-
-
-
-
-Static Void readfile(filename_, gname_)
-Char *filename_, *gname_;
-{
-  struct LOC_readfile V;
-  Char filename[256], gname[256];
-  FILE *f;
-  Char ggroup[256], *buf, wrd[256];
-  boolean verify;
-  na_strlist *l1;
-  long i, num, x, y, sim, lnum, savenumv;
-  boolean okay, wasempty;
-  Char STR1[256];
-  Char STR2[256];
-  Char *STR3;
-  Char *TEMP;
-  Char *STR4;
-  long FORLIM;
-  int TEMP1, TEMP2, TEMP3, TEMP4;
-  vectorrec *WITH;
-  int TEMP5, TEMP6, TEMP7, TEMP8;
-  long TEMP9;
-  Char *STR5, STR6[256];
-  Char *holdbuf;
-  Char *copybuf;
-
-  strcpy(filename, filename_);
-  strcpy(gname, gname_);
-  f = NULL;
-  okay = false;
-  newci_fixfname(filename, "gate", "");
-  okay = rshapes(filename, gname);
-  if (!okay) {
-    wasempty = (kbase == NULL);
-    wildcards(gname, ggroup, &verify);
-    TRY(try13);
-      if (f != NULL)
-#ifndef OS2
-	f = freopen(filename, "r", f);
-#else
-	f = freopen(filename, "rb", f);
-#endif
-      else
-#ifndef OS2
-	f = fopen(filename, "r");
-#else
-	f = fopen(filename, "rb");
-#endif
-      if (f == NULL) {
-	P_escapecode = -10;
-	P_ioresult = FileNotFound;
-	goto _Ltry13;
-      }
-      okay = true;
-    RECOVER2(try13,_Ltry13);
-      if (P_escapecode < 0 && P_escapecode != -20) {
-	sprintf(STR2, "Can't find file %s", filename);
-	wrmsg(_ShowEscape(STR1, P_escapecode, P_ioresult, STR2));
-      }
-    ENDTRY(try13);
-    lnum = 0;
-    V.defining = false;
-    V.def = NULL;
-    V.labels = NULL;
-    V.hasdef = false;
-    V.haslabels = false;
-    V.curcol = 1;
-    buf = (Char *)Malloc(256);
-    while (okay && !P_eof(f)) {
-      lnum++;
-      fgets(buf, 256, f);
-      if (!P_eof(f) && (strlen(buf) == 256-1) && !strchr(buf, '\n')) {
-        /* read up to end of line. */
-        holdbuf = strdup(buf);
-        do {
-          if (fgets(buf, 256, f)) {
-            copybuf = (Char*)Malloc( strlen(holdbuf) + strlen(buf) +1 );
-            strcpy(copybuf, holdbuf);
-            strcat(copybuf, buf);
-            Free(holdbuf);
-            holdbuf = strdup(copybuf);
-            Free(copybuf);
-          }
-        } while (!P_eof(f) && (strlen(buf) == 256-1) && !strchr(buf, '\n'));
-        Free(buf);
-        buf = strdup(holdbuf);
-        Free(holdbuf);
-      }
-
-      TEMP = (char *) strchr(buf, '\n');
-      if (TEMP != NULL)
-	*TEMP = 0;
-      STR4 = (Char*)Malloc(strlen(buf) +1);
-      savenumv = kind.numvects;
-      TRY(try14);
-	strword(buf, wrd);
-	if (*wrd != '\0' && wrd[0] != '#') {
-	  strlower(wrd, wrd);
-          STR3 = strdup(buf);
-	  strcpy(buf, strrtrim(STR3));
-          Free(STR3);
-	  if (!strcmp(wrd, "kind")) {
-	    if (V.defining)
-	      endkind(&V);
-	    strword(buf, wrd);
-	    strupper(wrd, wrd);
-	    if (comparestr(wrd, gname)) {
-	      V.defining = true;
-	      makekind(wrd);
-	      kind.simtype = 0;
-	      kind.group = 0;
-	      kind.flag.i = 0;
-	      kind.numpins = 0;
-	      kind.numpnums = 0;
-	      kind.numvects = 0;
-	      strlist_empty(&kind.pinnames);
-	      kind.proc[0] = '\0';
-	      kind.lbl[0] = '\0';
-	      kind.xx1 = -25;
-	      kind.yy1 = -25;
-	      kind.xx2 = 25;
-	      kind.yy2 = 25;
-	      V.curcol = 1;
-	    }
-	  } else if (!strcmp(wrd, "updatekind")) {
-	    if (curkind != NULL)
-	      V.defining = true;
-	  } else if (V.defining) {
-	    if (!strcmp(wrd, "simtype")) {
-	      num = strtol(buf, NULL, 0);
-	      FORLIM = kind.numpins;
-	      for (i = 0; i < FORLIM; i++) {
-		if (kind.pinsim[i] == kind.simtype)
-		  kind.pinsim[i] = num;
-	      }
-	      kind.simtype = num;
-	    } else if (!strcmp(wrd, "group"))
-	      kind.group = strtol(buf, NULL, 0);
-	    else if (!strcmp(wrd, "grab")) {
-	      sscanf(buf, "%d%d%d%d%ln", &TEMP1, &TEMP2, &TEMP3, &TEMP4, &i);
-	      kind.xx1 = TEMP1;
-	      kind.yy1 = TEMP2;
-	      kind.xx2 = TEMP3;
-	      kind.yy2 = TEMP4;
-	      i++;
-	    } else if (!strcmp(wrd, "color")) {
-	      strlower(buf, buf);
-	      if (!strcmp(buf, "cyan"))
-		V.curcol = 1;
-	      else if (!strcmp(buf, "green"))
-		V.curcol = 2;
-	      else if (!strcmp(buf, "yellow"))
-		V.curcol = 3;
-	      else if (!strcmp(buf, "red"))
-		V.curcol = 4;
-	      else if (!strcmp(buf, "orange"))
-		V.curcol = 5;
-	      else if (!strcmp(buf, "black"))
-		V.curcol = 6;
-	      else if (!strcmp(buf, "white"))
-		V.curcol = 7;
-	      else
-		V.curcol = P_ibound(1L, strtol(buf, NULL, 0), 7L);
-	    } else if (!strcmp(wrd, "vector")) {
-	      addvector_('v', &V);
-	      WITH = &kind.vector[kind.numvects - 1];
-	      sscanf(buf, "%d%d%d%d%ln", &TEMP1, &TEMP2, &TEMP3, &TEMP4, &i);
-	      WITH->x1 = TEMP1;
-	      WITH->y1 = TEMP2;
-	      WITH->UU.U99.x2 = TEMP3;
-	      WITH->UU.U99.y2 = TEMP4;
-	      i++;
-	    } else if (!strcmp(wrd, "circle")) {
-	      addvector_('C', &V);
-	      WITH = &kind.vector[kind.numvects - 1];
-	      sscanf(buf, "%d%d%d%d%ln", &TEMP1, &TEMP2, &TEMP3, &TEMP4, &i);
-	      WITH->x1 = TEMP1;
-	      WITH->y1 = TEMP2;
-	      WITH->UU.U99.x2 = TEMP3;
-	      WITH->UU.U99.y2 = TEMP4;
-	      i++;
-	    } else if (!strcmp(wrd, "fpoly")) {
-	      addvector_('F', &V);
-	      WITH = &kind.vector[kind.numvects - 1];
-	      sscanf(buf, "%d%d%d%d%d%d%d%d%ln", &TEMP1, &TEMP2, &TEMP3,
-		     &TEMP4, &TEMP5, &TEMP6, &TEMP7, &TEMP8, &i);
-	      WITH->x1 = TEMP1;
-	      WITH->y1 = TEMP2;
-	      WITH->UU.U99.x2 = TEMP3;
-	      WITH->UU.U99.y2 = TEMP4;
-	      WITH->UU.U99.x3 = TEMP5;
-	      WITH->UU.U99.y3 = TEMP6;
-	      WITH->UU.U99.x4 = TEMP7;
-	      WITH->UU.U99.y4 = TEMP8;
-	      i++;
-	    } else if (!strcmp(wrd, "ellipse")) {
-	      addvector_('e', &V);
-	      WITH = &kind.vector[kind.numvects - 1];
-	      sscanf(buf, "%d%d%d%d%ln", &TEMP1, &TEMP2, &TEMP3, &TEMP4, &i);
-	      WITH->x1 = TEMP1;
-	      WITH->y1 = TEMP2;
-	      WITH->UU.U99.x2 = TEMP3;
-	      WITH->UU.U99.y2 = TEMP4;
-	      i++;
-	    } else if (!strcmp(wrd, "fellipse")) {
-	      addvector_('E', &V);
-	      WITH = &kind.vector[kind.numvects - 1];
-	      sscanf(buf, "%d%d%d%d%ln", &TEMP1, &TEMP2, &TEMP3, &TEMP4, &i);
-	      WITH->x1 = TEMP1;
-	      WITH->y1 = TEMP2;
-	      WITH->UU.U99.x2 = TEMP3;
-	      WITH->UU.U99.y2 = TEMP4;
-	      i++;
-	    } else if (!strcmp(wrd, "roundbox")) {
-	      addvector_('r', &V);
-	      WITH = &kind.vector[kind.numvects - 1];
-	      sscanf(buf, "%d%d%d%d%d%ln", &TEMP1, &TEMP2, &TEMP3, &TEMP4,
-		     &TEMP5, &i);
-	      WITH->x1 = TEMP1;
-	      WITH->y1 = TEMP2;
-	      WITH->UU.U99.x2 = TEMP3;
-	      WITH->UU.U99.y2 = TEMP4;
-	      WITH->UU.U98.num = TEMP5;
-	      i++;
-	    } else if (!strcmp(wrd, "bezier")) {
-	      addvector_('c', &V);
-	      WITH = &kind.vector[kind.numvects - 1];
-	      sscanf(buf, "%d%d%d%d%d%d%d%d%ln", &TEMP1, &TEMP2, &TEMP3,
-		     &TEMP4, &TEMP5, &TEMP6, &TEMP7, &TEMP8, &i);
-	      WITH->x1 = TEMP1;
-	      WITH->y1 = TEMP2;
-	      WITH->UU.U99.x2 = TEMP3;
-	      WITH->UU.U99.y2 = TEMP4;
-	      WITH->UU.U99.x3 = TEMP5;
-	      WITH->UU.U99.y3 = TEMP6;
-	      WITH->UU.U99.x4 = TEMP7;
-	      WITH->UU.U99.y4 = TEMP8;
-	      i++;
-	    } else if (!strcmp(wrd, "marker")) {
-	      addvector_('p', &V);
-	      WITH = &kind.vector[kind.numvects - 1];
-	      sscanf(buf, "%d%d%d%ln", &TEMP1, &TEMP2, &TEMP3, &i);
-	      WITH->UU.U98.num = TEMP1;
-	      WITH->x1 = TEMP2;
-	      WITH->y1 = TEMP3;
-	      i++;
-	      if (i <= strlen(buf)) {
-		WITH->kind = 'b';
-		sscanf(buf + i - 1, "%d%d%ln", &TEMP1, &TEMP2, &TEMP9);
-		WITH->UU.U99.x2 = TEMP1;
-		WITH->UU.U99.y2 = TEMP2;
-		i += TEMP9;
-	      }
-	    } else if (!strcmp(wrd, "text")) {
-	      addvector_('t', &V);
-	      WITH = &kind.vector[kind.numvects - 1];
-	      strword(buf, wrd);
-	      WITH->x1 = strtol(wrd, NULL, 0);
-	      strword(buf, wrd);
-	      WITH->y1 = strtol(wrd, NULL, 0);
-	      strword(buf, wrd);
-	      strlower(wrd, wrd);
-	      if (strlen(wrd) == 2)
-		WITH->UU.U116.torg = ((wrd[0] == 'c') + (wrd[0] == 'l') * 2) * 3 +
-				     (wrd[1] == 'c') + (wrd[1] == 'r') * 2;
-	      else
-		WITH->UU.U116.torg = 4;
-	      strword(buf, wrd);
-	      WITH->UU.U116.tsize = P_ibound(1L, strtol(wrd, NULL, 0), 255L);
-	      if (*buf == '"' && strends(buf, "\""))
-		strcpy(buf, strpart(STR4, buf, 2, (int)(strlen(buf) - 1L)));
-	      if (*buf == '\0')
-		kind.numvects--;
-	      else
-		WITH->UU.U116.sp = strdup(buf);
-	    } else if (!strcmp(wrd, "pinnum")) {
-              long tn,tx,ty;
-              sscanf(buf, "%ld%ld%ld", &tn, &tx, &ty);
-              if (kind.numpnums < maxpnums-1) {
-                kind.pinnum[kind.numpnums] = tn;
-                kind.pinoff[kind.numpnums].x = tx;
-                kind.pinoff[kind.numpnums].y = ty;
-                kind.numpnums++;
-              }
-	    } else if (!strcmp(wrd, "pin")) {
-	      if (*buf == '#') {
-		strword(buf, wrd);
-		strcpy(wrd, wrd + 1);
-		num = strtol(wrd, NULL, 0);
-	      } else {
-		num = 1;
-		while (num <= kind.numpins && kind.pinsim[num - 1] != nopin)
-		  num++;
-	      }
-	      while (*buf == '"') {
-		strword(buf, wrd);
-		strcpy(wrd, strpart(STR4, wrd, 2, (int)(strlen(wrd) - 1L)));
-		if (*wrd != '\0')
-		  addpinname(num, wrd);
-	      }
-	      sscanf(buf, "%ld%ld%ln", &x, &y, &i);
-	      i++;
-	      if (i < strlen(buf)) {
-		sim = strtol(buf + i - 1, &STR5, 10);
-		i = STR5 - buf + 1;
-	      } else
-		sim = kind.simtype;
-	      fixnumpins(num);
-	      kind.pin[num - 1].x = x;
-	      kind.pin[num - 1].y = y;
-	      kind.pinsim[num - 1] = sim;
-	      kind.pincon[num - 1] = 0;
-	    } else if (!strcmp(wrd, "connect")) {
-	      strcpy(argument, buf);
-	      connectcmd();
-	    } else if (!strcmp(wrd, "flags")) {
-	      while (*buf != '\0') {
-		strword(buf, wrd);
-		flagcmd(&kind, wrd, 3L);
-	      }
-	    } else if (!strcmp(wrd, "def")) {
-	      if (*buf == '"' && strends(buf, "\""))
-		strcpy(buf, strpart(STR4, buf, 2, (int)(strlen(buf) - 1L)));
-	      l1 = strlist_append(&V.def, buf);
-	      V.hasdef = true;
-	    } else if (!strcmp(wrd, "nodef"))
-	      V.hasdef = true;
-	    else if (!strcmp(wrd, "label")) {
-	      if (*buf == '"' && strends(buf, "\""))
-		strcpy(buf, strpart(STR4, buf, 2, (int)(strlen(buf) - 1L)));
-	      l1 = strlist_append(&V.labels, buf);
-	      V.haslabels = true;
-	    } else if (!strcmp(wrd, "nolabels"))
-	      V.haslabels = true;
-	    else {
-	      sprintf(STR2, "%s, line %ld: Unrecognized command",
-		      filename, lnum);
-	      wrmsg(STR2);
-	    }
-	  }
-	}
-      RECOVER(try14);
-	if (P_escapecode == -20)
-	  _Escape(P_escapecode);
-	sprintf(STR6, "%s, line %ld", filename, lnum);
-	wrmsg(_ShowEscape(STR1, P_escapecode, P_ioresult, STR6));
-	kind.numvects = savenumv;
-      ENDTRY(try14);
-      Free(STR4);
-    }
-    if (okay && V.defining)
-      endkind(&V);
-    menuflag = true;
-    needrefr = true;
-    if (okay)
-      savedflag = wasempty;
-    Free(buf);
-  }
-  if (f != NULL)
-    fclose(f);
-
-  /*ignoring this gate*/
-}
-
-
-/* Local variables for writefile: */
-struct LOC_writefile {
-  FILE *f;
-} ;
-
-Local Void writeit(k, LINK)
-krec *k;
-struct LOC_writefile *LINK;
-{
-  short i, n, curcol;
-  na_strlist *def, *l1;
-  Char buf[256];
-  long st[log_maxpins / 32 + 2];
-  Char STR2[256];
-  short FORLIM;
-  vectorrec *WITH;
-  long SET[257];
-
-  fprintf(LINK->f, "kind %s\n", k->name);
-  if (k->simtype != 0)
-    fprintf(LINK->f, "simtype %d\n", k->simtype);
-  if (k->group != 0)
-    fprintf(LINK->f, "group %d\n", k->group);
-  fprintf(LINK->f, "grab %d %d %d %d\n", k->xx1, k->yy1, k->xx2, k->yy2);
-  curcol = 1;
-  FORLIM = k->numvects;
-  for (i = 0; i < FORLIM; i++) {
-    WITH = &k->vector[i];
-    if (WITH->col != curcol) {
-      fprintf(LINK->f, "color ");
-      switch (WITH->col) {
-
-      case 1:
-	fprintf(LINK->f, "cyan");
-	break;
-
-      case 2:
-	fprintf(LINK->f, "green");
-	break;
-
-      case 3:
-	fprintf(LINK->f, "yellow");
-	break;
-
-      case 4:
-	fprintf(LINK->f, "red");
-	break;
-
-      case 5:
-	fprintf(LINK->f, "orange");
-	break;
-
-      case 6:
-	fprintf(LINK->f, "black");
-	break;
-
-      case 7:
-	fprintf(LINK->f, "white");
-	break;
-      }
-      putc('\n', LINK->f);
-      curcol = WITH->col;
-    }
-    switch (WITH->kind) {
-
-    case 'v':
-      fprintf(LINK->f, "vector %d %d %d %d\n",
-	      WITH->x1, WITH->y1, WITH->UU.U99.x2, WITH->UU.U99.y2);
-      break;
-
-    case 'C':
-      fprintf(LINK->f, "circle %d %d %d %d\n",
-	      WITH->x1, WITH->y1, WITH->UU.U99.x2, WITH->UU.U99.y2);
-      break;
-
-    case 'F':
-      fprintf(LINK->f, "fpoly %d %d %d %d %d %d %d %d\n",
-	      WITH->x1, WITH->y1, WITH->UU.U99.x2, WITH->UU.U99.y2,
-	      WITH->UU.U99.x3, WITH->UU.U99.y3, WITH->UU.U99.x4,
-	      WITH->UU.U99.y4);
-      break;
-
-    case 'e':
-      fprintf(LINK->f, "ellipse %d %d %d %d\n",
-	      WITH->x1, WITH->y1, WITH->UU.U99.x2, WITH->UU.U99.y2);
-      break;
-
-    case 'E':
-      fprintf(LINK->f, "fellipse %d %d %d %d\n",
-	      WITH->x1, WITH->y1, WITH->UU.U99.x2, WITH->UU.U99.y2);
-      break;
-
-    case 'r':
-      fprintf(LINK->f, "roundbox %d %d %d %d %d\n",
-	      WITH->x1, WITH->y1, WITH->UU.U99.x2, WITH->UU.U99.y2,
-	      WITH->UU.U98.num);
-      break;
-
-    case 'c':
-      fprintf(LINK->f, "bezier %d %d %d %d %d %d %d %d\n",
-	      WITH->x1, WITH->y1, WITH->UU.U99.x2, WITH->UU.U99.y2,
-	      WITH->UU.U99.x3, WITH->UU.U99.y3, WITH->UU.U99.x4,
-	      WITH->UU.U99.y4);
-      break;
-
-    case 'p':
-      fprintf(LINK->f, "marker %d %d %d\n",
-	      WITH->UU.U98.num, WITH->x1, WITH->y1);
-      break;
-
-    case 'b':
-      fprintf(LINK->f, "marker %d %d %d %d %d\n",
-	      WITH->UU.U98.num, WITH->x1, WITH->y1, WITH->UU.U99.x2,
-	      WITH->UU.U99.y2);
-      break;
-
-    case 't':
-      fprintf(LINK->f, "text %d %d %s %d \"%s\"\n",
-	      WITH->x1, WITH->y1,
-	      strsub(STR2, "ulucurclcccrlllclr", WITH->UU.U116.torg * 2 + 1,
-		     2), WITH->UU.U116.tsize, WITH->UU.U116.sp);
-      break;
-    }
-  }
-  FORLIM = k->numpnums;
-  for (i = 1; i <= FORLIM; i++) {
-    fprintf(LINK->f, "pinnum %d %d %d\n",
-         k->pinnum[i-1], k->pinoff[i-1].x, k->pinoff[i-1].y);
-  }
-  l1 = k->pinnames;
-  FORLIM = k->numpins;
-  for (i = 1; i <= FORLIM; i++) {
-    if (k->pinsim[i - 1] != nopin) {
-      fprintf(LINK->f, "pin #%d ", i);
-      while (l1 != NULL && (long)l1->value <= i) {
-	if ((long)l1->value == i)
-	  fprintf(LINK->f, "\"%s\" ", l1->s);
-	l1 = l1->next;
-      }
-      fprintf(LINK->f, "%d %d", k->pin[i - 1].x, k->pin[i - 1].y);
-      if (k->pinsim[i - 1] != k->simtype)
-	fprintf(LINK->f, " %d", k->pinsim[i - 1]);
-      putc('\n', LINK->f);
-    }
-  }
-  P_expset(st, 0L);
-  FORLIM = k->numpins;
-  for (i = 1; i <= FORLIM; i++) {
-    if (k->pinsim[i - 1] != nopin && k->pincon[i - 1] != 0 && !P_inset(i, st)) {
-      fprintf(LINK->f, "connect %d", i);
-      n = i;
-      do {
-	n = k->pincon[n - 1];
-	if (n != i)
-	  fprintf(LINK->f, " %d", n);
-	P_addset(st, n);
-      } while (n != i);
-      putc('\n', LINK->f);
-    }
-  }
-  flagcmd(k, buf, 2L);
-  if (*buf != '\0')
-    fprintf(LINK->f, "flags %s\n", buf);
-  getdefn(k, &def, 2L);
-  l1 = def;
-  while (l1 != NULL) {
-    fprintf(LINK->f, "def \"%s\"\n", l1->s);
-    l1 = l1->next;
-  }
-  i = 1;
-  while (k->lbl[i - 1] != '\0') {
-    *buf = '\0';
-    while (k->lbl[i - 1] > '\001' && strlen(buf) < 255) {
-      sprintf(buf + strlen(buf), "%c", k->lbl[i - 1]);
-      i++;
-    }
-    if (*buf != '\0' || k->lbl[i - 1] != '\0')
-      fprintf(LINK->f, "label \"%s\"\n", buf);
-    if (k->lbl[i - 1] == '\001')
-      i++;
-  }
-  putc('\n', LINK->f);
-}
-
-
-
-
-Static Void writefile(filename_, gname_)
-Char *filename_, *gname_;
-{
-  struct LOC_writefile V;
-  Char filename[256], gname[256], ggroup[256];
-  krec *k;
-  boolean verify;
-  Char STR2[256];
-
-  strcpy(filename, filename_);
-  strcpy(gname, gname_);
-  V.f = NULL;
-  newci_fixfname(filename, "gate", "");
-  if (strciends(filename, ".gate"))
-    wshapes(filename);
-  else {
-    wildcards(gname, ggroup, &verify);
-    if (V.f != NULL)
-#ifndef OS2
-      V.f = freopen(filename, "w", V.f);
-#else
-      V.f = freopen(filename, "wb", V.f);
-#endif
-    else
-#ifndef OS2
-      V.f = fopen(filename, "w");
-#else
-      V.f = fopen(filename, "wb");
-#endif
-    if (V.f == NULL)
-      _EscIO(FileNotFound);
-    fprintf(V.f, "# Created by LOGED on %s\n\n\n", strdate(STR2, ""));
-    flushcurkind();
-    k = kbase;
-    while (k != NULL) {
-      if (comparestr(k->name, gname) && comparegroup(k->group, ggroup))
-	writeit(k, &V);
-      k = k->next;
-    }
-    fprintf(V.f, "\n# End of file.\n\n");
-    if (V.f != NULL)
-      fclose(V.f);
-    V.f = NULL;
-    if (*gname == '\0')
-      savedflag = true;
-  }
-  if (V.f != NULL)
-    fclose(V.f);
-}
-
-
-
-
-Static Void parse(s1, s2)
-Char *s1, *s2;
-{
-  short i;
-  Char *STR1;
-  Char *STR3;
-
-  STR1 = strdup(s1);
-  strcpy(s1, strltrim(strrtrim(STR1)));
-  i = strpos2(s1, " ", 1);
-  if (i == 0)
-    *s2 = '\0';
-  else {
-    STR3 = (Char*)Malloc(strlen(s1) -i +2);
-    sprintf(STR3, "%.*s", (int)(strlen(s1) - i + 1L), s1 + i - 1);
-    strcpy(s2, strltrim(STR3));
-    s1[i - 1] = '\0';
-    Free(STR3);
-/* p2c: loged.text, line 5898:
- * Note: Modification of string length may translate incorrectly [146] */
-  }
-  Free(STR1);
-}
-
-
-Static Void load20cmd()
-{
-  Char gname[256];
-
-  savedflag = (kbase == NULL);
-  parse(argument, gname);
-  if (*gname == '\0')
-    strcpy(gname, "*");
-  if (*argument != '\0')
-    strcpy(filename, argument);
-  if (*filename == '\0') {
-    strcpy(filename, "log.gate");
-    nc_gotoXY(0, (int)(scrheight - 5));
-    printf("Using file name %s\n", filename);
-    nc_gotoXY(0, (int)(scrheight - 3));
-  }
-  roshapes(filename, gname);
-  if (strcmp(gname, "*"))
-    *filename = '\0';
-}
-
-
-Static Void loadcmd()
-{
-  Char gname[256];
-
-  savedflag = (kbase == NULL);
-  parse(argument, gname);
-  if (*gname == '\0')
-    strcpy(gname, "*");
-  if (*argument != '\0')
-    strcpy(filename, argument);
-  if (*filename == '\0') {
-    strcpy(filename, "log.gate");
-    nc_gotoXY(0, (int)(scrheight - 5));
-    printf("Using file name %s\n", filename);
-    nc_gotoXY(0, (int)(scrheight - 3));
-  }
-  readfile(filename, gname);
-  if (strcmp(gname, "*"))
-    *filename = '\0';
-}
-
-
-Static Void readcmd()
-{
-  Char fname[256], gname[256];
-
-  savedflag = (kbase == NULL);
-  parse(argument, gname);
-  if (*gname == '\0')
-    strcpy(gname, "*");
-  if (*argument == '\0') {
-    wrmsg("No file name to read");
-    return;
-  }
-  strcpy(fname, argument);
-  newci_fixfname(fname, "def", "");
-  if (access(fname, F_OK) != 0) {
-    strcpy(fname, argument);
-    newci_fixfname(fname, "text", "");
-  }
-  readfile(fname, gname);
-}
-
-
-
-Static Void savecmd()
-{
-  Char gname[256];
-  Char ch;
-
-  flushcurkind();
-  ch = 'Y';
-  parse(argument, gname);
-  if (*argument != '\0')
-    strcpy(filename, argument);
-  else if (*filename == '\0')
-    wrmsg("No file name");
-  else {
-    printf("Use file \"%s\" ? ", filename);
-    ch = readyn("YN");
-  }
-  if (*filename != '\0' && ch == 'Y')
-    writefile(filename, gname);
-}
-
-
-Static Void writecmd()
-{
-  Char buf[256], gname[256];
-
-  flushcurkind();
-  parse(argument, gname);
-  if (*argument == '\0' && *gname != '\0') {
-    strcpy(buf, gname);
-    strword(buf, argument);
-  } else if (*argument == '\0' && curkind != NULL) {
-    strcpy(argument, kind.name);
-    strcpy(gname, kind.name);
-  }
-  if (*argument == '\0')
-    wrmsg("No file name");
-  else {
-    newci_fixfname(argument, "text", "");
-    writefile(argument, gname);
-  }
-}
-
-
-
-Static Void editcmd(argument_)
-Char *argument_;
-{
-  Char argument[256], fn[256];
-
-  strcpy(argument, argument_);
-  sprintf(fn, "/tmp/loged%03ld.text", ma_rand2(0L, 999L));
-  if (*argument == '\0' && curkind != NULL)
-    strcpy(argument, kind.name);
-  writefile(fn, argument);
-  TRY(try15);
-    newci_fulleditescape(fn, "", 1L, 1L);
-    readfile(fn, "");
-    savedflag = false;
-  RECOVER(try15);
-    newci_nullrecover();
-  ENDTRY(try15);
-  unlink(fn);
-  dim();
-  menuflag = true;
-  needrefr = true;
-}
-
-
-
-Static Void helpcmd()
-{
-  TRY(try16);
-    if (helpdsc == 0) {
-      help_init(helpdsc, helpfile);
-/* p2c: loged.text, line 6050:
- * Warning: Symbol 'HELP_INIT' is not defined [221] */
-      help_index(helpdsc, "[loged]");
-/* p2c: loged.text, line 6051:
- * Warning: Symbol 'HELP_INDEX' is not defined [221] */
-    }
-    help_do(helpdsc);
-  RECOVER(try16);
-/* p2c: loged.text, line 6053:
- * Warning: Symbol 'HELP_DO' is not defined [221] */
-    wrmsg("Help is not available");
-  ENDTRY(try16);
-}
-
-
-Static Void memorycmd()
-{
-  Char STR2[256];
-
-  nc_gotoXY(0, (int)(scrheight - 5));
-  TRY(try17);
-    printf("Memory available: %ld bytes.\n", memavail());
-  RECOVER(try17);
-    puts(_ShowEscape(STR2, P_escapecode, P_ioresult, "na_memavail"));
-  ENDTRY(try17);
-}
-
-
-Static Void docommand PP((Char *command));
-
-Local Void docmd()
-{
-  Char savecmd[256], gname[256], ggroup[256];
-  krec *k, *k2;
-  short i;
-  boolean flag;
-
-  errorflag = false;
-  i = strpos2(argument, " ", 1);
-  if (i <= 1)
-    return;
-  sprintf(gname, "%.*s", i - 1, argument);
-  strcpy(argument, argument + i);
-  strcpy(savecmd, strltrim(argument));
-  wildcards(gname, ggroup, &flag);
-  k = kbase;
-  while (k != NULL && !errorflag) {
-    k2 = k->next;
-    if (comparestr(k->name, gname) && comparegroup(k->group, ggroup)) {
-      flushcurkind();
-      curkind = k;
-      kind = *curkind;
-      autoscale(1L);
-      docommand(savecmd);
-      menuflag = true;
-      needrefr = true;
-    }
-    k = k2;
-  }
-}
-
-
-
-
-Static Void docommand(command_)
-Char *command_;
-{
-  Char command[256];
-
-  strcpy(command, command_);
-  parse(command, argument);
-  strupper(command, command);
-  if (strbegins("LIB", command)) {
-    libcmd();
-    return;
-  }
-  if (strbegins("GATE", command)) {
-    gatecmd();
-    return;
-  }
-  if (strbegins("NEXT", command)) {
-    nextcmd(false);
-    return;
-  }
-  if (strbegins("PREV", command)) {
-    prevcmd(false);
-    return;
-  }
-  if (strbegins("DRAW", command)) {
-    drawcmd();
-    return;
-  }
-  if (strbegins("DEF", command)) {
-    defcmd();
-    return;
-  }
-  if (strbegins("FLAG", command)) {
-    flagcmd(&kind, argument, 0L);
-    return;
-  }
-  if (strbegins("LABEL", command)) {
-    labelcmd();
-    return;
-  }
-  if (strbegins("GROUP", command)) {
-    groupcmd();
-    return;
-  }
-  if (strbegins("COPY", command)) {
-    copycmd();
-    return;
-  }
-  if (strbegins("RENAME", command)) {
-    renamecmd();
-    return;
-  }
-  if (strbegins("DELETE", command)) {
-    deletecmd();
-    return;
-  }
-  if (strbegins("LOAD", command)) {
-    loadcmd();
-    return;
-  }
-  if (strbegins("LOAD20", command)) {
-    load20cmd();
-    return;
-  }
-  if (strbegins("READ", command)) {
-    readcmd();
-    return;
-  }
-  if (strbegins("SAVE", command)) {
-    savecmd();
-    return;
-  }
-  if (strbegins("WRITE", command)) {
-    writecmd();
-    return;
-  }
-  if (strbegins("EDIT", command)) {
-    editcmd(argument);
-    return;
-  }
-  if (strbegins("HELP", command) || strbegins("?", command)) {
-    helpcmd();
-    return;
-  }
-  if (strbegins("EXIT", command) || strbegins("QUIT", command)) {
-    exitflag = true;
-    return;
-  }
-  if (strbegins("SIMTYPE", command)) {
-    simtypecmd();
-    return;
-  }
-  if (strbegins("CONNECT", command)) {
-    connectcmd();
-    return;
-  }
-  if (strbegins("MEMORY", command)) {
-    memorycmd();
-    return;
-  }
-  if (strbegins("DO", command)) {
-    docmd();
-    return;
-  }
-  if (strbegins("DUMP", command)) {
-    dumpcmd();
-    return;
-  }
-  if (!(strbegins("NEW", command) || strbegins("OLD", command))) {
-    wrmsg("Command Error");
-    return;
-  }
-  grid();
-  refresh1();
-}
-
-
-
-Static Void commandline()
-{
-  long i;
-  Char s[256];
-  long FORLIM;
-  Char STR1[256];
-  Char STR2[256];
-
-  if (P_argc < 2)
-    return;
-  strcpy(filename, P_argv[1]);
-  *s = '\0';
-  FORLIM = P_argc;
-  for (i = 2; i < FORLIM; i++)
-    sprintf(s + strlen(s), " %s", P_argv[i]);
-  strcpy(STR2, strltrim(strrtrim(strcpy(STR1, s))));
-  strcpy(s, STR2);
-  readfile(filename, s);
-}
-
-
-
-
-
-main(argc, argv)
-int argc;
-Char *argv[];
-{  /*main*/
-  Char STR2[256];
-  Char STR3[256];
-
-  nc_text_in_window = 1;
-  PASCAL_MAIN(argc, argv);
-
-  if (P_argc > 1 && !strcmp(P_argv[1], "-p")) {  /* piped mode */
-    nc_text_in_window = 0;
-    newci_eatargument();
-  }
-
-  *filename = '\0';
-  firsthelp = false;
-  savedflag = true;
-  kbase = NULL;
-  helpdsc = 0;
-  newsimtype = 0;
-  firstpin = 1;
-  initscreen();
-  gg.host = log_host_loged;
-  gg.runstamp = timers_sysclock();
-  gg.traceflag = false;
-  gg.traceopen = false;
-  gg.dumpopen = false;
-  gg.verbose = false;
-  gg.quiet = true;
-  gg.resetflag = false;
-  gg.pwrflag = false;
-  gg.refrflag = false;
-  gg.rndseed = timers_sysclock();
-  *gg.func = '\0';
-  gg.time = 0.0;
-  gg.simstate = simst_null;
-  gg.homedirname = NULL;
-  gg.actstr = (Char *)Malloc(256);
-  clearalpha();
-  curkind = NULL;
-  shadowkind = NULL;
-  autoscale(1L);
-  veckind = 'v';
-  curcolor = 1;
-  firsttime = true;
-  if (!onescreen)
-    grid();
-  commandline();
-  do {
-    TRY(try18);
-      exitflag = false;
-      menuflag = false;
-      needrefr = true;
-      do {
-	clearalpha();
-        bright();
-	if (firsttime) {
-	  printf("Welcome to New, Improved LOGED!\n\n");
-	  printf("LOGED now works on Bobcats as well as Chipmunks.\n\n");
-	  printf("The DRAW command has been totally redone and is now,\n");
-/* p2c: loged.text, line 6245: Note: Characters >= 128 encountered [281] */
-/* p2c: loged.text, line 6245:
- * Note: WRITE statement contains color/attribute characters [203] */
-	  printf("incredibly enough, \213\202*reasonably nice to use*\200\210!\n");
-	  printf("The program now uses LOG-like pen motions to draw,\n");
-	  printf("move, and throw away lines and pin numbers.\n");
-	  printf("(To create a pin, grab a number from the left edge.)\n");
-	  printf("Hit '?' in DRAW for further commands.\n\n");
-	  printf("The command OLD switches to old-style DRAW mode, and NEW\n");
-	  printf("switches back to the new DRAW editor.  The old version of\n");
-	  printf("the program is available as OLOGED.\n\n");
-	  printf("Please let me know what you think,\n");
-	  printf("                                                     -- Dave\n");
-	} else {
-	  printf("\n\nLIB [gates]          to list all gates\n");
-	  printf("GATE name            to choose or make a gate\n");
-	  printf("DRAW [name]          to edit a gate's picture\n");
-	  printf("DEF [name]           to edit a gate's definition\n");
-	  printf("SIMTYPE [num [pin]]  to edit a gate's simulation type (0-255)\n");
-	  printf("CONNECT pin1 [pin2]  to edit a gate's connectivity\n");
-	  printf("LABEL [name]         to edit a gate's labels\n");
-	  printf("GROUP [code]         to edit a gate's group number (0-8)\n");
-	  printf("COPY name            to make a copy of this gate\n");
-	  printf("RENAME name          to rename this gate\n");
-	  printf("DELETE [gates]       to delete a gate (or this gate)\n");
-	  printf("NEXT [gates]         to move to the next gate\n");
-	  printf("LOAD file [gates]    to load a gates file\n");
-	  printf("SAVE [file]          to save the gates\n");
-	  printf("DUMP [file.ps]       to print gate info \n");
-	  printf("HELP                 to get Help\n");
-	  printf("EXIT                 to exit the program\n");
-	}
-	refrkind = !firsttime;
-	menuflag = false;
-	do {
-	  dim();
-	  if (needrefr) {
-	    needrefr = false;
-	    if (!onescreen) {
-	      if (curkind != NULL)
-		refresh();
-	      else
-		grid();
-	    }
-	  }
-	  m_alpha_on();
-	  if (refrkind) {
-	    nc_gotoXY(0, (int)P_imax2(scrheight - 24, 0L));
-	    if (curkind != NULL)
-	      printf("Current gate:  %s\t", kind.name);
-	    else
-	      printf("No gate selected\t");
-	    refrname();
-	    refrkind = false;
-	  }
-	  nc_gotoXY(0, (int)(scrheight - 4));
-	  printf("-> \013");
-	  gets(command);
-	  if (firsttime) {
-	    printf("\f");
-	    menuflag = true;
-	    firsttime = false;
-	  }
-	  nc_gotoXY(0, (int)(scrheight - 5));
-	  putchar('\t');
-	  nc_gotoXY(0, (int)(scrheight - 3));
-	  strcpy(STR3, strltrim(command));
-	  strcpy(command, STR3);
-	  TRY(try19);
-	    if (*command == '\0' && P_eof(stdin)) {
-	      rewind(stdin);
-	      strcpy(command, "QUIT");
-	    }
-	    if (*command == '!') {
-	      newci_fullshellescape(strcpy(STR3, strltrim(command)), "I");
-	      initscreen();
-	      menuflag = true;
-	      needrefr = true;
-	    } else
-	      docommand(command);
-	  RECOVER(try19);
-	    if (P_escapecode != -20)
-	      goto _Ltry18;
-	    putchar('\007');
-	    menuflag = true;
-	    needrefr = true;
-	  ENDTRY(try19);
-	} while (!(menuflag || exitflag));
-      } while (!exitflag);
-      if (!savedflag) {
-	if (*filename == '\0') {
-	  printf("Save file? ");
-	  if (readyn("YNQ") == 'Y') {
-	    printf("Enter name of file to save: ");
-	    gets(argument);
-	    if (*argument != '\0')
-	      writefile(argument, "");
-	    else {
-	      printf("Enter name of file to save: ");
-	      gets(argument);
-	      if (*argument != '\0')
-		writefile(argument, "");
-	      else
-		savedflag = true;
-	    }
-	  } else
-	    savedflag = true;
-	} else {
-	  printf("Save file \"%s\"? ", filename);
-	  if (readyn("YNQ") == 'Y')
-	    writefile(filename, "");
-	  else
-	    savedflag = true;
-	}
-	exitflag = savedflag;
-      }
-    RECOVER2(try18,_Ltry18);
-      iores = P_ioresult;
-      esc = P_escapecode;
-      if (esc != -20) {
-	printf("\007%s\n\n", _ShowEscape(STR2, esc, iores, "Internal error"));
-	printf("Press Enter key to continue.");
-	scanf("%*[^\n]");
-	getchar();
-      }
-      initscreen();
-      printf("\f");
-      if (esc == -20)
-	_Escape((int)esc);
-    ENDTRY(try18);
-  } while (!exitflag);
-  exit(0);
-}
-
-
-
-
-
-
-
-
-
-
-/* End. */
diff --git a/log/src/loghier.c b/log/src/loghier.c
index 175fdfe..c1c93db 100644
--- a/log/src/loghier.c
+++ b/log/src/loghier.c
@@ -30,28 +30,20 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /* LOG hierarchy module           David Gillespie 1/7/89 */
 /* version for LOG 4.1 */
 
-
-
-
-
-
 #include <p2c/p2c.h>
-
-
-#define LOGHIER_G
 #include "loghier.h"
 
 
 
-Static log_action *lact;
+static log_action *lact;
 
-Static log_krec *attrkind;
-Static short attrinstof, attrinstname;
+static log_krec *attrkind;
+static short attrinstof, attrinstname;
 
 
 
 
-Void hier_init(act)
+void hier_init(act)
 log_action *act;
 {
   lact = act;
@@ -59,11 +51,11 @@ log_action *act;
 }
 
 
-boolean commandlabel(lp, cmd, args)
+int commandlabel(lp, cmd, args)
 log_lrec *lp;
-Char *cmd, *args;
+char *cmd, *args;
 {
-  boolean Result;
+  int Result;
   long i, j;
 
   Result = false;
@@ -113,7 +105,7 @@ log_lrec *lp;
 short pg;
 {
   log_brec *bp, *bp2;
-  Char STR2[256];
+  char STR2[256];
 
   bp2 = NULL;
   bp = lact->bbase[pg - 1];
@@ -138,7 +130,7 @@ short pg;
 
 
 
-boolean pointinbox(bp, x, y)
+int pointinbox(bp, x, y)
 log_brec *bp;
 short x, y;
 {
@@ -147,7 +139,7 @@ short x, y;
 }
 
 
-boolean gateinbox(bp, g)
+int gateinbox(bp, g)
 log_brec *bp;
 log_grec *g;
 {
@@ -156,7 +148,7 @@ log_grec *g;
 }
 
 
-boolean labelinbox(bp, l)
+int labelinbox(bp, l)
 log_brec *bp;
 log_lrec *l;
 {
@@ -166,7 +158,7 @@ log_lrec *l;
 }
 
 
-boolean boxinbox(bp, bp2)
+int boxinbox(bp, bp2)
 log_brec *bp, *bp2;
 {
   return (bp == NULL || (bp->x1 <= bp2->x1 && bp2->x2 <= bp->x2 &&
@@ -174,7 +166,7 @@ log_brec *bp, *bp2;
 }
 
 
-boolean boxtouchbox(bp, bp2)
+int boxtouchbox(bp, bp2)
 log_brec *bp, *bp2;
 {
   return (bp != NULL && bp2 != NULL &&
@@ -186,7 +178,7 @@ log_brec *bp, *bp2;
 
 
 
-boolean isinstgate(g)
+int isinstgate(g)
 log_grec *g;
 {
   if (g->kind == attrkind)
@@ -198,7 +190,7 @@ log_grec *g;
 }
 
 
-boolean isgenericinstgate(g)
+int isgenericinstgate(g)
 log_grec *g;
 {
 short num;
@@ -211,8 +203,8 @@ short num;
 }
 
 
-Char *gateinstof(Result, g)
-Char *Result;
+char *gateinstof(Result, g)
+char *Result;
 log_grec *g;
 {
   log_gattrrec *WITH;
@@ -230,8 +222,8 @@ log_grec *g;
 
 
 
-Char *gateinstname(Result, g)
-Char *Result;
+char *gateinstname(Result, g)
+char *Result;
 log_grec *g;
 {
   if (g->kind != attrkind) {
@@ -251,15 +243,15 @@ log_grec *g;
 na_strlist *defndirectory(pg)
 short pg;
 {
-  Char buf[256], buf2[256];
+  char buf[256], buf2[256];
   na_strlist *dir, *l1, *l2, **lprev;
   log_lrec *lp;
   log_brec *bp;
   log_grec *g;
-  boolean boxed, boxless, errors;
+  int boxed, boxless, errors;
   long numdefs;
-  Char STR1[256];
-  Char STR3[256];
+  char STR1[256];
+  char STR3[256];
 
   dir = NULL;
   errors = false;
@@ -294,7 +286,7 @@ short pg;
 	  g = g->next;
 	}
 	l1 = strlist_insert(lprev, buf2);
-	l1->value = (Anyptr)bp;
+	l1->value = (void *)bp;
 	numdefs++;
       }
     }
@@ -330,12 +322,12 @@ short pg;
 
 
 
-Void examinetemplate(g, pp, ppsize, isgeneric, pnum, lastnorth, lasteast,
+void examinetemplate(g, pp, ppsize, isgeneric, pnum, lastnorth, lasteast,
 		     lastsouth, lastwest)
 log_grec *g;
 log_nrec **pp;
 long ppsize;
-boolean isgeneric;
+int isgeneric;
 short **pnum;
 long *lastnorth, *lasteast, *lastsouth, *lastwest;
 {
@@ -450,27 +442,27 @@ long *lastnorth, *lasteast, *lastsouth, *lastwest;
 typedef struct ginstinfo {
   short instattr, nameattr, dispattr;
   long oldgattrstamp;
-  Char *wasdrawn;
+  char *wasdrawn;
 } ginstinfo;
 
 
 
 
 
-Void Log_7_ginst(act)
+void Log_7_ginst(act)
 log_action *act;
 {
   ginstinfo *ii;
-  Char newname[256];
-  boolean drawflag;
+  char newname[256];
+  int drawflag;
   short drawx, drawy;
   na_strlist *sl1;
   log_action *WITH;
   log_gattrrec *WITH1;
-  Char STR2[256];
+  char STR2[256];
   log_grec *WITH2;
   ginstinfo *WITH3;
-  Char STR3[256];
+  char STR3[256];
 
   WITH = act;
   switch (WITH->action) {
@@ -486,7 +478,7 @@ log_action *act;
 				&ii->dispattr);
     ii->wasdrawn = NULL;
     ii->oldgattrstamp = 0;
-    WITH->actgate->info = (Anyptr)ii;
+    WITH->actgate->info = (void *)ii;
     break;
 
   case act_disposegate:
diff --git a/log/src/loghier.h b/log/src/loghier.h
index 48c57b4..13089ec 100644
--- a/log/src/loghier.h
+++ b/log/src/loghier.h
@@ -1,59 +1,33 @@
-/* Header for module loghier, generated by p2c */
 #ifndef LOGHIER_H
 #define LOGHIER_H
 
-
-
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-
-#ifdef LOGHIER_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-
-
 typedef short log_shintarray[log_million];
 
 
-extern Void hier_init PP((log_action *act));
-extern boolean commandlabel PP((log_lrec *lp, Char *cmd, Char *args));
-extern log_brec *labelbox PP((log_lrec *lp, int pg));
-extern boolean pointinbox PP((log_brec *bp, int x, int y));
-extern boolean gateinbox PP((log_brec *bp, log_grec *g));
-extern boolean labelinbox PP((log_brec *bp, log_lrec *l));
-extern boolean boxinbox PP((log_brec *bp, log_brec *bp2));
-extern boolean boxtouchbox PP((log_brec *bp, log_brec *bp2));
-extern boolean isinstgate PP((log_grec *g));
-extern boolean isgenericinstgate PP((log_grec *g));
-extern Char *gateinstof PP((Char *Result, log_grec *g));
-extern Char *gateinstname PP((Char *Result, log_grec *g));
-extern na_strlist *defndirectory PP((int pg));
-extern Void examinetemplate PP((log_grec *g, log_nrec **pp, long ppsize,
+extern void hier_init (log_action *act);
+extern int commandlabel (log_lrec *lp, char *cmd, char *args);
+extern log_brec *labelbox (log_lrec *lp, int pg);
+extern int pointinbox (log_brec *bp, int x, int y);
+extern int gateinbox (log_brec *bp, log_grec *g);
+extern int labelinbox (log_brec *bp, log_lrec *l);
+extern int boxinbox (log_brec *bp, log_brec *bp2);
+extern int boxtouchbox (log_brec *bp, log_brec *bp2);
+extern int isinstgate (log_grec *g);
+extern int isgenericinstgate (log_grec *g);
+extern char *gateinstof (char *Result, log_grec *g);
+extern char *gateinstname (char *Result, log_grec *g);
+extern na_strlist *defndirectory (int pg);
+extern void examinetemplate (log_grec *g, log_nrec **pp, long ppsize,
 				int isgeneric, short **pnum, long *lastnorth,
 				long *lasteast, long *lastsouth,
-				long *lastwest));
-
-
+				long *lastwest);
 
-extern Void Log_7_ginst PP((log_action *act));
 
 
-#undef vextern
+extern void Log_7_ginst (log_action *act);
 
 #endif /*LOGHIER_H*/
 
diff --git a/log/src/logntk.c b/log/src/logntk.c
index b72e0a2..74c0367 100644
--- a/log/src/logntk.c
+++ b/log/src/logntk.c
@@ -35,23 +35,14 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /* Modified  7/27/88 to support digital hierarchy */
 
 
-
-
-
-
 #include <p2c/p2c.h>
-
-
-#define LOGNTK_G
 #include "logntk.h"
 
-
 extern char *my_strdup(char *s);
 #undef strdup
 #define strdup my_strdup
 
 
-
 #define main_name       "-Main-"
 
 
@@ -63,15 +54,15 @@ typedef enum {
 
 
 typedef struct transrec {
-  Char name[82];
-  Char kind;
+  char name[82];
+  char kind;
   signed char strength;
   struct transrec *next;
 } transrec;
 
 typedef struct cellrec {
-  Char name[82], cname[82];
-  Char fname[256];
+  char name[82], cname[82];
+  char fname[256];
   na_strlist *port;
   long ccount;
   unsigned loaded : 1, complain1 : 1;
@@ -79,39 +70,39 @@ typedef struct cellrec {
 } cellrec;
 
 typedef struct primrec {
-  Char name[82], cname[82];
+  char name[82], cname[82];
   long ccount;
   struct primrec *next;
 } primrec;
 
 
-Static transrec *transbase, *savetransbase;
-Static cellrec *cellbase, *savecellbase;
-Static primrec *primbase, *saveprimbase;
-Static na_strlist *filebase, *filecellbase;
-Static boolean autotop, maincell;
-Static long default_size, default_strength;
-Static na_strlist *saveglobals, *saveorphans, *saveignored, *saveprims,
+static transrec *transbase, *savetransbase;
+static cellrec *cellbase, *savecellbase;
+static primrec *primbase, *saveprimbase;
+static na_strlist *filebase, *filecellbase;
+static int autotop, maincell;
+static long default_size, default_strength;
+static na_strlist *saveglobals, *saveorphans, *saveignored, *saveprims,
 		  *savetrans, *savelibdirs, *ports, *globals, *orphans,
 		  *ignored, *prims, *trans, *libdirs, *notfoundlist,
 		  *wignlist;
-Static log_grec *gtempl;
-Static log_brec *mybox;
-Static topnesskind topness, savetopness;
-Static boolean john_L_mode, savejohn;
-Static short identifycolor, nodecount;
-Static Char *filename, *cellname;
-Static Char nodeprefix[11];
+static log_grec *gtempl;
+static log_brec *mybox;
+static topnesskind topness, savetopness;
+static int john_L_mode, savejohn;
+static short identifycolor, nodecount;
+static char *filename, *cellname;
+static char nodeprefix[11];
 
 
 
 
 
-Static na_strlist *strlist_find_r(l1, wrd_)
+static na_strlist *strlist_find_r(l1, wrd_)
 na_strlist *l1;
-Char *wrd_;
+char *wrd_;
 {
-  Char wrd[256];
+  char wrd[256];
 
   strcpy(wrd, wrd_);
   while (l1 != NULL && !re_compare(wrd, l1->s))
@@ -125,13 +116,13 @@ Char *wrd_;
 
 
 
-Static boolean tryreset(f, fn)
+static int tryreset(f, fn)
 FILE **f;
-Char *fn;
+char *fn;
 {
   na_strlist *l1;
-  Char buf[256];
-  boolean found;
+  char buf[256];
+  int found;
 
   if (strlist_find(notfoundlist, fn) != NULL) {
     found = false;
@@ -166,19 +157,19 @@ Char *fn;
 }
 
 
-/* Local variables for Log_logntk_proc: */
+/* variables for Log_logntk_proc: */
 struct LOC_Log_logntk_proc {
   log_action *act;
-  boolean errflag;
+  int errflag;
 } ;
 
 
-Local Void message(s_, LINK)
-Char *s_;
+void message(s_, LINK)
+char *s_;
 struct LOC_Log_logntk_proc *LINK;
 {
-  Char s[256];
-  Char STR1[256];
+  char s[256];
+  char STR1[256];
 
   strcpy(s, s_);
   sprintf(STR1, "LOGNTK:  %s", s);
@@ -186,12 +177,12 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-Local Void emessage(s_, LINK)
-Char *s_;
+void emessage(s_, LINK)
+char *s_;
 struct LOC_Log_logntk_proc *LINK;
 {
-  Char s[256];
-  Char STR1[256];
+  char s[256];
+  char STR1[256];
 
   strcpy(s, s_);
   sprintf(STR1, "LOGNTK:  %s", s);
@@ -200,12 +191,12 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-Local Void vmessage(s_, LINK)
-Char *s_;
+void vmessage(s_, LINK)
+char *s_;
 struct LOC_Log_logntk_proc *LINK;
 {
-  Char s[256];
-  Char STR1[256];
+  char s[256];
+  char STR1[256];
 
   strcpy(s, s_);
   sprintf(STR1, "LOGNTK:  %s", s);
@@ -213,11 +204,11 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-Local Void addlabel(s_, LINK)
-Char *s_;
+void addlabel(s_, LINK)
+char *s_;
 struct LOC_Log_logntk_proc *LINK;
 {
-  Char s[256];
+  char s[256];
   log_lrec *l1;
 
   strcpy(s, s_);
@@ -225,16 +216,16 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-Local Void getword(buf, w, LINK)
-Char *buf, *w;
+void getword(buf, w, LINK)
+char *buf, *w;
 struct LOC_Log_logntk_proc *LINK;
 {
   (*LINK->act->hook.getword)(buf, w);   /*converts to upper case*/
 }
 
 
-Local Void getint(buf, i, def, LINK)
-Char *buf;
+void getint(buf, i, def, LINK)
+char *buf;
 long *i, def;
 struct LOC_Log_logntk_proc *LINK;
 {
@@ -242,13 +233,13 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-Local Void readstrlist(buf, l1, LINK)
-Char *buf;
+void readstrlist(buf, l1, LINK)
+char *buf;
 na_strlist **l1;
 struct LOC_Log_logntk_proc *LINK;
 {
   na_strlist *l2;
-  Char arg[256];
+  char arg[256];
 
   do {
     strword(buf, arg);
@@ -258,13 +249,13 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-Local Void readstrlista(buf, l1, LINK)
-Char *buf;
+void readstrlista(buf, l1, LINK)
+char *buf;
 na_strlist **l1;
 struct LOC_Log_logntk_proc *LINK;
 {
   na_strlist *l2;
-  Char arg[256];
+  char arg[256];
 
   do {
     strword(buf, arg);
@@ -276,14 +267,14 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-Local Void readstrlistr(buf, l1, named, LINK)
-Char *buf;
+void readstrlistr(buf, l1, named, LINK)
+char *buf;
 na_strlist **l1;
-boolean named;
+int named;
 struct LOC_Log_logntk_proc *LINK;
 {
   na_strlist *l2;
-  Char arg[256], rex[256];
+  char arg[256], rex[256];
 
   do {
     strword(buf, arg);
@@ -292,16 +283,16 @@ struct LOC_Log_logntk_proc *LINK;
       if (strlist_find(*l1, rex) == NULL) {
 	l2 = strlist_append(l1, rex);
 	if (named)
-	  *(Char **)((Char **)(&l2->value)) = strdup(arg);
+	  *(char **)((char **)(&l2->value)) = strdup(arg);
       }
     }
   } while (*buf != '\0');
 }
 
 
-Local Void addcell(c1, name, cname, fname, LINK)
+void addcell(c1, name, cname, fname, LINK)
 cellrec **c1;
-Char *name, *cname, *fname;
+char *name, *cname, *fname;
 struct LOC_Log_logntk_proc *LINK;
 {
   *c1 = (cellrec *)Malloc(sizeof(cellrec));
@@ -316,19 +307,19 @@ struct LOC_Log_logntk_proc *LINK;
   cellbase = *c1;
 }
 
-Local Void docommand(buf1_, buf_, complain, LINK)
-Char *buf1_, *buf_;
-boolean complain;
+void docommand(buf1_, buf_, complain, LINK)
+char *buf1_, *buf_;
+int complain;
 struct LOC_Log_logntk_proc *LINK;
 {
-  Char buf1[256], buf[256], buf2[256], buf3[256];
+  char buf1[256], buf[256], buf2[256], buf3[256];
   cellrec *c1;
   transrec *t1;
   primrec *p1;
   na_strlist *l1;
   long i;
-  Char STR1[256];
-  Char STR3[256];
+  char STR1[256];
+  char STR3[256];
 
   strcpy(buf1, buf1_);
   strcpy(buf, buf_);
@@ -453,15 +444,15 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-Local Void namenode(n, LINK)
+void namenode(n, LINK)
 log_nrec *n;
 struct LOC_Log_logntk_proc *LINK;
 {
-  Char buf[256], buf2[256];
+  char buf[256], buf2[256];
   na_strlist *l1;
   long i, FORLIM;
 
-  if ((Char *)n->temp != NULL)
+  if ((char *)n->temp != NULL)
     return;
   *buf = '\0';
   *buf2 = '\0';
@@ -475,11 +466,11 @@ struct LOC_Log_logntk_proc *LINK;
     }
   }
   if (*buf2 != '\0') {
-    *(Char **)((Char **)(&n->temp)) = strdup(buf2);
+    *(char **)((char **)(&n->temp)) = strdup(buf2);
     return;
   }
   if (*buf != '\0') {
-    *(Char **)((Char **)(&n->temp)) = strdup(buf);
+    *(char **)((char **)(&n->temp)) = strdup(buf);
     return;
   }
   nodecount++;
@@ -493,22 +484,22 @@ struct LOC_Log_logntk_proc *LINK;
 /* p2c: logntk.text, line 408:
  * Note: Using % for possibly-negative arguments [317] */
   }
-  *(Char **)((Char **)(&n->temp)) = strdup(buf);
+  *(char **)((char **)(&n->temp)) = strdup(buf);
 }
 
 
-Local boolean trynamegate(g, LINK)
+int trynamegate(g, LINK)
 log_grec *g;
 struct LOC_Log_logntk_proc *LINK;
 {
-  Char name[256];
+  char name[256];
 
-  if ((Char *)g->temp != NULL)
+  if ((char *)g->temp != NULL)
     return true;
   else {
     gateinstname(name, g);
     if (*name != '\0') {
-      *(Char **)((Char **)(&g->temp)) = strdup(name);
+      *(char **)((char **)(&g->temp)) = strdup(name);
       return true;
     } else
       return false;
@@ -516,7 +507,7 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-Local Void namecellgates(c, LINK)
+void namecellgates(c, LINK)
 cellrec *c;
 struct LOC_Log_logntk_proc *LINK;
 {
@@ -525,8 +516,8 @@ struct LOC_Log_logntk_proc *LINK;
   long lastn, laste, lasts, lastw;
   short *pnumlist;
   short i;
-  Char STR1[256];
-  Char STR3[256];
+  char STR1[256];
+  char STR3[256];
 
   g = LINK->act->gbase[LINK->act->curpage - 1];
   while (g != NULL) {
@@ -534,7 +525,7 @@ struct LOC_Log_logntk_proc *LINK;
       if (!trynamegate(g, LINK)) {
 	c->ccount++;
 	sprintf(STR3, "%s%ld", c->cname, c->ccount);
-	*(Char **)((Char **)(&g->temp)) = strdup(STR3);
+	*(char **)((char **)(&g->temp)) = strdup(STR3);
       }
       portlist = (log_nrec **)Malloc(g->kind->numpins * sizeof(log_nrec *));
       pnumlist = NULL;
@@ -550,15 +541,15 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-Local Void nameprimgates(p, LINK)
+void nameprimgates(p, LINK)
 primrec *p;
 struct LOC_Log_logntk_proc *LINK;
 {
-  Char buf[256];
+  char buf[256];
   log_grec *g;
   short i;
   long pos, last;
-  Char STR3[256];
+  char STR3[256];
   short FORLIM;
 
   g = LINK->act->gbase[LINK->act->curpage - 1];
@@ -572,7 +563,7 @@ struct LOC_Log_logntk_proc *LINK;
 	}
 	p->ccount++;
 	sprintf(STR3, "%s_%ld", buf, p->ccount);
-	*(Char **)((Char **)(&g->temp)) = strdup(STR3);
+	*(char **)((char **)(&g->temp)) = strdup(STR3);
       }
       FORLIM = g->kind->numpins;
       for (i = 0; i < FORLIM; i++)
@@ -583,17 +574,17 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-Local Void prolog(args_, bp, LINK)
-Char *args_;
+void prolog(args_, bp, LINK)
+char *args_;
 log_brec *bp;
 struct LOC_Log_logntk_proc *LINK;
 {
-  Char args[256];
+  char args[256];
   log_lrec *lb1;
   cellrec *c;
   transrec *t;
   primrec *p;
-  Char buf[256], buf2[256];
+  char buf[256], buf2[256];
   log_nrec **portlist;
   na_strlist *l1;
   long i, tcount, lastn, laste, lasts, lastw;
@@ -601,8 +592,8 @@ struct LOC_Log_logntk_proc *LINK;
   short *pnumlist;
   log_nrec *n;
   log_grec *g;
-  Char STR1[256];
-  Char STR3[256];
+  char STR1[256];
+  char STR3[256];
   long FORLIM;
 
   strcpy(args, args_);
@@ -674,11 +665,11 @@ struct LOC_Log_logntk_proc *LINK;
 	    examinetemplate(g, portlist, (long)g->kind->numpins, true,
 			    &pnumlist, &lastn, &laste, &lasts, &lastw);
 	    for (i = 0; i < lastw; i++) {
-	      if ((Char *)portlist[i]->temp != NULL)
+	      if ((char *)portlist[i]->temp != NULL)
 		emessage("Template has pins shorted together", LINK);
 	      else {
 		namenode(portlist[i], LINK);
-		l1 = strlist_append(&ports, (Char *)portlist[i]->temp);
+		l1 = strlist_append(&ports, (char *)portlist[i]->temp);
 	      }
 	    }
 	    Free(portlist);
@@ -714,7 +705,7 @@ struct LOC_Log_logntk_proc *LINK;
       if (t != NULL) {
 	tcount++;
 	sprintf(STR3, "Transistor-#%ld", tcount);
-	*(Char **)((Char **)(&g->temp)) = strdup(STR3);
+	*(char **)((char **)(&g->temp)) = strdup(STR3);
 	FORLIM = g->kind->numpins;
 	for (i = 0; i < FORLIM; i++)
 	  namenode(g->pin[i], LINK);
@@ -739,7 +730,7 @@ struct LOC_Log_logntk_proc *LINK;
       LINK->act->actflag = false;
       (*LINK->act->hook2->send_gengate)(g, "CONSTPINS");
       if (LINK->act->actstrlist != NULL || LINK->act->actflag) {
-	if ((Char *)g->temp == NULL &&
+	if ((char *)g->temp == NULL &&
 	    strlist_find_r(orphans, g->kind->name) == NULL &&
 	    strlist_find_r(ignored, g->kind->name) == NULL)
 	      /*suppress "gate was ignored" message*/
@@ -750,7 +741,7 @@ struct LOC_Log_logntk_proc *LINK;
 	  if (pnum != 0) {
 	    n = (log_nrec *)l1->value;
 	    namenode(n, LINK);
-	    *(Char **)((Char **)(&g->pin[pnum - 1]->temp)) = strdup((Char *)n->temp);
+	    *(char **)((char **)(&g->pin[pnum - 1]->temp)) = strdup((char *)n->temp);
 	  }
 	  l1 = l1->next;
 	}
@@ -763,16 +754,16 @@ struct LOC_Log_logntk_proc *LINK;
     return;
   n = LINK->act->nbase;
   while (n != NULL) {
-    if ((Char *)n->temp != NULL &&
-	strlist_find_r(globals, (Char *)n->temp) != NULL &&
-	strlist_cifind(ports, (Char *)n->temp) == NULL)
-      l1 = strlist_append(&ports, (Char *)n->temp);
+    if ((char *)n->temp != NULL &&
+	strlist_find_r(globals, (char *)n->temp) != NULL &&
+	strlist_cifind(ports, (char *)n->temp) == NULL)
+      l1 = strlist_append(&ports, (char *)n->temp);
     n = n->next;
   }
 }
 
 
-Local Void epilog(LINK)
+void epilog(LINK)
 struct LOC_Log_logntk_proc *LINK;
 {
   cellrec *c;
@@ -783,12 +774,12 @@ struct LOC_Log_logntk_proc *LINK;
 
   n = LINK->act->nbase;
   while (n != NULL) {
-    strdispose((Char **)((Char **)(&n->temp)));
+    strdispose((char **)((char **)(&n->temp)));
     n = n->next;
   }
   g = LINK->act->gbase[LINK->act->curpage - 1];
   while (g != NULL) {
-    strdispose((Char **)((Char **)(&g->temp)));
+    strdispose((char **)((char **)(&g->temp)));
     g = g->next;
   }
   c = cellbase;
@@ -835,13 +826,13 @@ struct LOC_Log_logntk_proc *LINK;
 
 
 
-Local Void addbogusname(newcmd, newthing, LINK)
-Char *newcmd, *newthing;
+void addbogusname(newcmd, newthing, LINK)
+char *newcmd, *newthing;
 struct LOC_Log_logntk_proc *LINK;
 {
   log_lrec *l1;
-  Char cmd[256], args[256];
-  Char STR2[256];
+  char cmd[256], args[256];
+  char STR2[256];
 
   l1 = LINK->act->lbase[LINK->act->curpage - 1];
   while (l1 != NULL && !(commandlabel(l1, cmd, args) &&
@@ -854,7 +845,7 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-Local na_strlist *mydefndirectory(pg, LINK)
+na_strlist *mydefndirectory(pg, LINK)
 short pg;
 struct LOC_Log_logntk_proc *LINK;
 {
@@ -871,26 +862,26 @@ struct LOC_Log_logntk_proc *LINK;
   return l1;
 }
 
-/* Local variables for dologntk: */
+/* variables for dologntk: */
 struct LOC_dologntk {
   struct LOC_Log_logntk_proc *LINK;
   FILE *outf;
 } ;
 
-/* Local variables for readcells: */
+/* variables for readcells: */
 struct LOC_readcells {
   struct LOC_dologntk *LINK;
   FILE *f2;
-  Char s[256], s2[256], name[256];
+  char s[256], s2[256], name[256];
 } ;
 
-Local Void readcellfile(fn, LINK)
-Char *fn;
+void readcellfile(fn, LINK)
+char *fn;
 struct LOC_readcells *LINK;
 {
   na_strlist *l1;
-  boolean done, copying;
-  Char *TEMP;
+  int done, copying;
+  char *TEMP;
 
   if (strlist_find(filebase, fn) != NULL)
     return;
@@ -940,19 +931,19 @@ struct LOC_readcells *LINK;
   }
 }
 
-Local Void readcells(LINK)
+void readcells(LINK)
 struct LOC_dologntk *LINK;
 {
   struct LOC_readcells V;
   log_grec *g;
   cellrec *c;
   na_strlist *p, *l1;
-  boolean found;
-  Char STR1[256];
-  Char STR2[256];
-  Char STR3[256];
-  Char STR4[256];
-  Char *TEMP;
+  int found;
+  char STR1[256];
+  char STR2[256];
+  char STR3[256];
+  char STR4[256];
+  char *TEMP;
 
   V.LINK = LINK;
   V.f2 = NULL;
@@ -1050,14 +1041,14 @@ struct LOC_dologntk *LINK;
     fclose(V.f2);
 }
 
-/* Local variables for writefile: */
+/* variables for writefile: */
 struct LOC_writefile {
   struct LOC_dologntk *LINK;
   long linelen;
 } ;
 
-Local Void writeword(w, LINK)
-Char *w;
+void writeword(w, LINK)
+char *w;
 struct LOC_writefile *LINK;
 {
   if (LINK->linelen + strlen(w) > 78) {
@@ -1068,7 +1059,7 @@ struct LOC_writefile *LINK;
   LINK->linelen += strlen(w) + 1;
 }
 
-Local Void writefile(LINK)
+void writefile(LINK)
 struct LOC_dologntk *LINK;
 {
   struct LOC_writefile V;
@@ -1078,15 +1069,15 @@ struct LOC_dologntk *LINK;
   cellrec *c;
   primrec *p;
   na_strlist *havedone, *l1;
-  Char s[256], w[256], ginstname[256];
+  char s[256], w[256], ginstname[256];
   log_nrec **portlist;
   long lastn, laste, lasts, lastw;
   short *pnumlist;
-  boolean handled;
+  int handled;
   long i, j;
-  Char STR1[256], STR2[256];
-  Char STR3[110];
-  Char STR4[112];
+  char STR1[256], STR2[256];
+  char STR3[110];
+  char STR4[112];
   long FORLIM;
 
   V.LINK = LINK;
@@ -1142,10 +1133,10 @@ struct LOC_dologntk *LINK;
   havedone = NULL;
   n = LINK->LINK->act->nbase;
   while (n != NULL) {
-    if ((Char *)n->temp != NULL &&
-	strlist_cifind(havedone, (Char *)n->temp) == NULL &&
-	(maincell || strlist_cifind(ports, (Char *)n->temp) == NULL))
-      l1 = strlist_add(&havedone, (Char *)n->temp);
+    if ((char *)n->temp != NULL &&
+	strlist_cifind(havedone, (char *)n->temp) == NULL &&
+	(maincell || strlist_cifind(ports, (char *)n->temp) == NULL))
+      l1 = strlist_add(&havedone, (char *)n->temp);
     n = n->next;
   }
   l1 = havedone;
@@ -1189,16 +1180,16 @@ struct LOC_dologntk *LINK;
 	if ( g->kind->numpins == 3)
 	  {
 	    fprintf(LINK->outf, "%c %ld %s %s %s ;\n",
-		    tolower(t->kind), i, (Char *)g->pin[0]->temp,
-		    (Char *)g->pin[2]->temp, (Char *)g->pin[1]->temp);
+		    tolower(t->kind), i, (char *)g->pin[0]->temp,
+		    (char *)g->pin[2]->temp, (char *)g->pin[1]->temp);
 	    handled = true;
 	  } 
 	else 
 	  {
 	    fprintf(LINK->outf, "%c %ld %s %s %s %s ;\n",
-		    tolower(t->kind), i, (Char *)g->pin[0]->temp,
-		    (Char *)g->pin[2]->temp,(Char *)g->pin[1]->temp, 
-		    (Char *)g->pin[3]->temp );
+		    tolower(t->kind), i, (char *)g->pin[0]->temp,
+		    (char *)g->pin[2]->temp,(char *)g->pin[1]->temp, 
+		    (char *)g->pin[3]->temp );
 	    handled = true;
 	  }
 	handled = true;
@@ -1210,7 +1201,7 @@ struct LOC_dologntk *LINK;
 	putc('h', LINK->outf);
 	V.linelen = 1;
 	writeword(c->cname, &V);
-	writeword((Char *)g->temp, &V);
+	writeword((char *)g->temp, &V);
 	portlist = (log_nrec **)Malloc(g->kind->numpins * sizeof(log_nrec *));
 	pnumlist = NULL;
 	examinetemplate(g, portlist, (long)g->kind->numpins, isgenericinstgate(g),
@@ -1221,12 +1212,12 @@ struct LOC_dologntk *LINK;
 	  if (strlist_find_r(globals, l1->s) == NULL) {
 	    i++;
 	    if (i <= lastw) {
-	      if ((Char *)portlist[i - 1]->temp == NULL) {
+	      if ((char *)portlist[i - 1]->temp == NULL) {
 		sprintf(STR1, "Internal error: node on %s was never named",
-			(Char *)g->temp);
+			(char *)g->temp);
 		emessage(STR1, LINK->LINK);
 	      } else
-		writeword((Char *)portlist[i - 1]->temp, &V);
+		writeword((char *)portlist[i - 1]->temp, &V);
 	    }
 	  } else {
 	    j = 1;
@@ -1235,8 +1226,8 @@ struct LOC_dologntk *LINK;
 		    strcicmp(LINK->LINK->act->signaltab[j - 1].name, l1->s) != 0))
 	      j++;
 	    if (j <= LINK->LINK->act->lastsignal &&
-		(Char *)LINK->LINK->act->signaltab[j - 1].np->temp != NULL)
-	      writeword((Char *)LINK->LINK->act->signaltab[j - 1].np->temp,
+		(char *)LINK->LINK->act->signaltab[j - 1].np->temp != NULL)
+	      writeword((char *)LINK->LINK->act->signaltab[j - 1].np->temp,
 			&V);
 	    else
 	      writeword(l1->s, &V);
@@ -1285,10 +1276,10 @@ struct LOC_dologntk *LINK;
 	putc('h', LINK->outf);
 	V.linelen = 1;
 	writeword(s, &V);
-	writeword((Char *)g->temp, &V);
+	writeword((char *)g->temp, &V);
 	FORLIM = g->kind->numpins;
 	for (i = 0; i < FORLIM; i++)
-	  writeword((Char *)g->pin[i]->temp, &V);
+	  writeword((char *)g->pin[i]->temp, &V);
 	fprintf(LINK->outf, " ;\n");
 	handled = true;
       }
@@ -1325,12 +1316,12 @@ struct LOC_dologntk *LINK;
   fprintf(LINK->outf, " ;\n");
 }
 
-Local Void showports(LINK)
+void showports(LINK)
 struct LOC_dologntk *LINK;
 {
-  Char buf[256];
+  char buf[256];
   na_strlist *l1;
-  Char STR1[256];
+  char STR1[256];
 
   strcpy(buf, "Using port list:");
   l1 = ports;
@@ -1343,18 +1334,18 @@ struct LOC_dologntk *LINK;
 }
 
 
-Local Void dologntk(args_, LINK)
-Char *args_;
+void dologntk(args_, LINK)
+char *args_;
 struct LOC_Log_logntk_proc *LINK;
 {
   struct LOC_dologntk V;
-  Char args[256];
+  char args[256];
   na_strlist *l1, *defndir, *argslist;
   log_nrec *n1;   /*pointer to "node" record*/
   log_grec *g1;   /*pointer to "gate instance" record*/
   log_krec *k1;   /*pointer to "gate kind" record*/
-  Char STR1[256], STR2[256];
-  Char STR3[256];
+  char STR1[256], STR2[256];
+  char STR3[256];
 
   V.LINK = LINK;
   strcpy(args, args_);
@@ -1366,7 +1357,7 @@ struct LOC_Log_logntk_proc *LINK;
     l1 = strlist_find_r(argslist, defndir->s);
     if (argslist == NULL || l1 != NULL) {
       if (l1 != NULL)
-	strdispose((Char **)((Char **)(&l1->value)));
+	strdispose((char **)((char **)(&l1->value)));
       prolog(defndir->s, (log_brec *)defndir->value, LINK);
       autotop = false;
       if (*filename == '\0' && strcmp(cellname, main_name)) {
@@ -1434,10 +1425,10 @@ struct LOC_Log_logntk_proc *LINK;
   }
   l1 = argslist;
   while (l1 != NULL) {
-    if ((Char *)l1->value != NULL) {
-      sprintf(STR2, "Unable to find cell %s", (Char *)l1->value);
+    if ((char *)l1->value != NULL) {
+      sprintf(STR2, "Unable to find cell %s", (char *)l1->value);
       message(STR2, LINK);
-      strdispose((Char **)((Char **)(&l1->value)));
+      strdispose((char **)((char **)(&l1->value)));
     }
     l1 = l1->next;
   }
@@ -1447,12 +1438,12 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-Local Void probecommand(LINK)
+void probecommand(LINK)
 struct LOC_Log_logntk_proc *LINK;
 {
   na_strlist *defndir, *l1, *curdef;
-  boolean exitflag, boxed;
-  Char buf[256], obuf[256], temp[256];
+  int exitflag, boxed;
+  char buf[256], obuf[256], temp[256];
   log_grec *probegate, *redgate, *g;
   log_nrec *probenode, *rednode;
   log_brec *curbox;
@@ -1561,23 +1552,23 @@ struct LOC_Log_logntk_proc *LINK;
 	  "Gate:                                   Node:                                 ");
 	strcpy(temp, "---");
 	if (probegate != NULL) {
-	  if ((Char *)probegate->temp == NULL) {
+	  if ((char *)probegate->temp == NULL) {
 	    if (probegate == gtempl)
 	      strcpy(temp, "(template)");
 	    else
 	      strcpy(temp, "(unnamed)");
 	  } else
-	    strcpy(temp, (Char *)(probegate->temp));
+	    strcpy(temp, (char *)(probegate->temp));
 	}
 	if (strlen(temp) > 30)
 	  temp[30] = '\0';
 	strmove(strlen(temp), temp, 1, buf, 7);
 	strcpy(temp, "---");
 	if (probenode != NULL) {
-	  if ((Char *)probenode->temp == NULL)
+	  if ((char *)probenode->temp == NULL)
 	    strcpy(temp, "(unnamed)");
 	  else
-	    strcpy(temp, (Char *)(probenode->temp));
+	    strcpy(temp, (char *)(probenode->temp));
 	}
 	if (strlen(temp) > 30)
 	  temp[30] = '\0';
@@ -1596,17 +1587,17 @@ struct LOC_Log_logntk_proc *LINK;
 }
 
 
-Local Void identifycommand(args_, LINK)
-Char *args_;
+void identifycommand(args_, LINK)
+char *args_;
 struct LOC_Log_logntk_proc *LINK;
 {
-  Char args[256];
+  char args[256];
   na_strlist *defndir, *arglist, *argl;
-  Char buf[256];
+  char buf[256];
   log_grec *g;
   log_nrec *n;
-  boolean first;
-  Char STR1[256];
+  int first;
+  char STR1[256];
 
   strcpy(args, args_);
   (*LINK->act->hook.clearfunc)();
@@ -1624,11 +1615,11 @@ struct LOC_Log_logntk_proc *LINK;
     while (argl != NULL) {
       strcpy(buf, argl->s);
       g = LINK->act->gbase[LINK->act->curpage - 1];
-      while (g != NULL && (!gateinbox(mybox, g) || (Char *)g->temp == NULL ||
-			   strcicmp((Char *)g->temp, buf) != 0))
+      while (g != NULL && (!gateinbox(mybox, g) || (char *)g->temp == NULL ||
+			   strcicmp((char *)g->temp, buf) != 0))
 	g = g->next;
       if (g != NULL) {
-	sprintf(STR1, "Identifying gate %s", (Char *)g->temp);
+	sprintf(STR1, "Identifying gate %s", (char *)g->temp);
 	vmessage(STR1, LINK);
 	argl->value = (na_long)1;
 	(*LINK->act->hook.clip)();
@@ -1636,11 +1627,11 @@ struct LOC_Log_logntk_proc *LINK;
 	(*LINK->act->hook.noclip)();
       } else {
 	n = LINK->act->nbase;
-	while (n != NULL && ((Char *)n->temp == NULL ||
-			     strcicmp((Char *)n->temp, buf) != 0))
+	while (n != NULL && ((char *)n->temp == NULL ||
+			     strcicmp((char *)n->temp, buf) != 0))
 	  n = n->next;
 	if (n != NULL) {
-	  sprintf(STR1, "Identifying node %s", (Char *)n->temp);
+	  sprintf(STR1, "Identifying node %s", (char *)n->temp);
 	  vmessage(STR1, LINK);
 	  argl->value = (na_long)1;
 	  (*LINK->act->hook.clip)();
@@ -1668,13 +1659,13 @@ struct LOC_Log_logntk_proc *LINK;
 
 
 
-Void Log_logntk_proc(act_)
+void Log_logntk_proc(act_)
 log_action *act_;
 {
   struct LOC_Log_logntk_proc V;
   long esc, ior;
   log_action *WITH;
-  Char STR1[256];
+  char STR1[256];
 
 
   V.act = act_;
@@ -1687,9 +1678,9 @@ log_action *act_;
     strcpy(WITH->acttool->shortname, "LOGNTK");   /*this is my brief name*/
     if (*WITH->acttool->comment == '\0')   /*this is my long name*/
       strcpy(WITH->acttool->comment, "LOG-to-NTK converter");
-    filename = (Char *)Malloc(256);
+    filename = (char *)Malloc(256);
     *filename = '\0';
-    cellname = (Char *)Malloc(256);
+    cellname = (char *)Malloc(256);
     *cellname = '\0';
     ports = NULL;
     globals = NULL;
diff --git a/log/src/logntk.h b/log/src/logntk.h
index 3948829..838024a 100644
--- a/log/src/logntk.h
+++ b/log/src/logntk.h
@@ -1,58 +1,16 @@
-/* Header for module logntk, generated by p2c */
 #ifndef LOGNTK_H
 #define LOGNTK_H
 
-
-
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef LOGHIER_H
 #include "loghier.h"
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef NEWKBD_H
 #include <p2c/newkbd.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-#ifndef NEWCRT_H
 #include <p2c/newcrt.h>
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef REGEX_H
 #include <p2c/regex.h>
-#endif
-
-
-#ifdef LOGNTK_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-
-
-
-
-extern Void Log_logntk_proc PP((log_action *act));
-
 
-#undef vextern
+extern void Log_logntk_proc (log_action *act);
 
 #endif /*LOGNTK_H*/
 
diff --git a/log/src/logsim.c b/log/src/logsim.c
index b366288..6883bb2 100644
--- a/log/src/logsim.c
+++ b/log/src/logsim.c
@@ -39,15 +39,11 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-#define LOGSIM_G
 #include "logsim.h"
 
 
-
 #define newci_findprocedure  findprocedure
-extern boolean findprocedure PP((Char *name, Void (**start)()));
+extern int findprocedure (char *name, void (**start)());
 
 
 /*$ if debugging $
@@ -72,13 +68,13 @@ typedef tlist ttable[(long)log_one - (long)log_none + 1];
 typedef long histcolortabletype[12];
 
 
-static Const ttable bcomb = {
+static const ttable bcomb = {
   { log_none, log_zero, log_one },
   { log_zero, log_zero, log_one },
   { log_one, log_one, log_one }
 };
 
-static Const histcolortabletype histcolortable = {
+static const histcolortabletype histcolortable = {
   log_cyan, log_orange, log_yellow, log_pink, log_green, log_red, log_white,
   log_mred, log_lgray, log_dcyan, log_dyellow, log_dred
 };
@@ -86,19 +82,19 @@ static Const histcolortabletype histcolortable = {
 
 
 
-Static long rndseed, newsystime, oldsystime, stabtime, resetcounter;
-Static log_sigrec *vddsig, *gndsig, *resetsig;
-Static boolean isstable, stabilizing, passready, maketimebid;
-Static double nexttimebid;
-Static boolean noprogloaded;
-Static log_krec *kbase_16;
+static long rndseed, newsystime, oldsystime, stabtime, resetcounter;
+static log_sigrec *vddsig, *gndsig, *resetsig;
+static int isstable, stabilizing, passready, maketimebid;
+static double nexttimebid;
+static int noprogloaded;
+static log_krec *kbase_16;
 
-Static na_strlistrec *diglbl;
-Static short dignumattrs;
-Static log_kattrrec *digkattr;
-Static log_gattrrec *diggattr;
+static na_strlistrec *diglbl;
+static short dignumattrs;
+static log_kattrrec *digkattr;
+static log_gattrrec *diggattr;
 
-Static short backgrcolor, ledoncolor, ledoffcolor, scopecolor, scopescancolor;
+static short backgrcolor, ledoncolor, ledoffcolor, scopecolor, scopescancolor;
 
 
 
@@ -108,7 +104,7 @@ Static short backgrcolor, ledoncolor, ledoffcolor, scopecolor, scopescancolor;
 /* The following routines are exported so that users' gates can use them. */
 
 
-Static Void log_16_input(lact, n, v)
+static void log_16_input(lact, n, v)
 log_action *lact;
 log_nrec *n;
 log_16_value *v;
@@ -121,7 +117,7 @@ log_16_value *v;
 
 
 
-Static Void log_16_output(lact, n, v)
+static void log_16_output(lact, n, v)
 log_action *lact;
 log_nrec *n;
 log_16_value v;
@@ -139,7 +135,7 @@ log_16_value v;
 
 
 
-Static Void log_16_ocoutput(lact, n, v)
+static void log_16_ocoutput(lact, n, v)
 log_action *lact;
 log_nrec *n;
 log_16_value v;
@@ -157,7 +153,7 @@ log_16_value v;
 
 
 
-Static Void getpointmark(num, defx, defy, x, y)
+static void getpointmark(num, defx, defy, x, y)
 short num, defx, defy, *x, *y;
 {
   log_action *WITH;
@@ -174,7 +170,7 @@ short num, defx, defy, *x, *y;
 
 
 
-Static Void log_16_led(lact, x, y, v)
+static void log_16_led(lact, x, y, v)
 log_action *lact;
 short x, y;
 log_16_value v;
@@ -201,7 +197,7 @@ log_16_value v;
 
 
 
-Static Void log_16_eraled(lact, x, y)
+static void log_16_eraled(lact, x, y)
 log_action *lact;
 short x, y;
 {
@@ -214,13 +210,13 @@ short x, y;
 
 
 
-Static Void log_16_plotled(lact, x, y, v)
+static void log_16_plotled(lact, x, y, v)
 log_action *lact;
 short x, y;
 log_16_value v;
 {
   na_strlistrec *l1;
-  Char STR2[256];
+  char STR2[256];
 
   if (v == log_none)
     return;
@@ -250,7 +246,7 @@ log_16_value v;
 /* The following routines control LOG's standard non-GDL gates. */
 
 
-Void Log_16_ledgate(act)
+void Log_16_ledgate(act)
 log_16_action *act;
 {
   nodeinfo *pin1;
@@ -299,7 +295,7 @@ log_16_action *act;
 
 
 
-Void Log_16_ledgate2(act)
+void Log_16_ledgate2(act)
 log_16_action *act;
 {
   long i;
@@ -370,7 +366,7 @@ log_16_action *act;
 
 
 
-Void Log_16_clock(act)
+void Log_16_clock(act)
 log_16_action *act;
 {
   log_action *WITH;
@@ -512,27 +508,27 @@ log_16_action *act;
 
 
 
-Static Void makeconstpin(act, num, val)
+static void makeconstpin(act, num, val)
 log_16_action *act;
 long num;
-boolean val;
+int val;
 {
   na_strlistrec *l1;
-  Char STR1[256];
+  char STR1[256];
 
   if (act->lact->actgate->pin[num - 1]->ref <= 1)
     return;
   sprintf(STR1, "%ld", num);
   l1 = strlist_append(&act->lact->actstrlist, STR1);
   if (val)
-    l1->value = (Anyptr)vddsig->np;
+    l1->value = (void *)vddsig->np;
   else
-    l1->value = (Anyptr)gndsig->np;
+    l1->value = (void *)gndsig->np;
 }
 
 
 
-Void Log_16_switch(act)
+void Log_16_switch(act)
 log_16_action *act;
 {
   short xx, yy;
@@ -587,7 +583,7 @@ log_16_action *act;
 
 
 
-Void Log_16_pulse(act)
+void Log_16_pulse(act)
 log_16_action *act;
 {
   log_action *WITH;
@@ -609,7 +605,7 @@ log_16_action *act;
 
 
 
-Void Log_16_break(act)
+void Log_16_break(act)
 log_16_action *act;
 {
   log_action *WITH;
@@ -638,10 +634,10 @@ log_16_action *act;
 
 
 
-Void Log_16_scope(act)
+void Log_16_scope(act)
 log_16_action *act;
 {
-  boolean flag;
+  int flag;
   nodeinfo *pin1, *pin2;
   short tx, ty;
   log_action *WITH;
@@ -762,17 +758,17 @@ log_16_action *act;
 }
 
 
-/* Local variables for Log_16_7seg: */
+/* variables for Log_16_7seg: */
 struct LOC_Log_16_7seg {
   log_16_action *act;
   na_strlistrec *l1;
 } ;
 
-Local Void plotline(x1, y1, x2, y2, LINK)
+void plotline(x1, y1, x2, y2, LINK)
 short x1, y1, x2, y2;
 struct LOC_Log_16_7seg *LINK;
 {
-  Char STR2[256];
+  char STR2[256];
 
   sprintf(STR2, "line %d %d %d %d", x1, y1, x2, y2);
   LINK->l1 = strlist_append(&LINK->act->lact->actstrlist, STR2);
@@ -780,7 +776,7 @@ struct LOC_Log_16_7seg *LINK;
 
 
 
-Void Log_16_7seg(act_)
+void Log_16_7seg(act_)
 log_16_action *act_;
 {
   struct LOC_Log_16_7seg V;
@@ -905,7 +901,7 @@ log_16_action *act_;
 
 
 
-Void Log_16_keypad(act)
+void Log_16_keypad(act)
 log_16_action *act;
 {
   short x1, y1, n;
@@ -1030,7 +1026,7 @@ log_16_action *act;
 /* The following routines run the digital simulation. */
 
 
-Static short digglowcol(n, nonecolor)
+static short digglowcol(n, nonecolor)
 log_nrec *n;
 short nonecolor;
 {
@@ -1056,10 +1052,10 @@ short nonecolor;
 }
 
 
-Static boolean digtrigger(n)
+static int digtrigger(n)
 log_nrec *n;
 {
-  boolean Result;
+  int Result;
   nodeinfo *ni;
 
   ni = (nodeinfo *)n->info;
@@ -1071,7 +1067,7 @@ log_nrec *n;
 
 
 
-Static Void callallgates(kind)
+static void callallgates(kind)
 log_16_actionkinds kind;
 {
   short pg;
@@ -1099,7 +1095,7 @@ log_16_actionkinds kind;
 
 
 
-Static Void callkind(kind)
+static void callkind(kind)
 log_16_actionkinds kind;
 {
   kindinfo *ki;
@@ -1120,7 +1116,7 @@ log_16_actionkinds kind;
 
 
 
-Static Void callallkinds(kind)
+static void callallkinds(kind)
 log_16_actionkinds kind;
 {
   kindinfo *ki;
@@ -1141,7 +1137,7 @@ log_16_actionkinds kind;
 
 
 
-Static Void pass_16(act)
+static void pass_16(act)
 log_16_action *act;
 {
   short pg;
@@ -1208,12 +1204,12 @@ log_16_action *act;
 
 
 
-Static Void tstep_16(act)
+static void tstep_16(act)
 log_16_action *act;
 {
   log_nrec *n;
   nodeinfo *ni;
-  boolean stable;
+  int stable;
   log_action *WITH;
 
   WITH = act->lact;
@@ -1244,7 +1240,7 @@ log_16_action *act;
 /* The following procedures are exported for the LOGSIMA module to use. */
 
 
-Void log_16_conf(act, n)
+void log_16_conf(act, n)
 log_16_action *act;
 log_nrec *n;
 {
@@ -1252,10 +1248,10 @@ log_nrec *n;
 }
 
 
-Void log_16_noprog(act)
+void log_16_noprog(act)
 log_16_action *act;
 {
-  Char STR1[44];
+  char STR1[44];
 
   if (!noprogloaded) {
     sprintf(STR1, "No program loaded for digital gate %s",
@@ -1266,7 +1262,7 @@ log_16_action *act;
 }
 
 
-Static Void nullkindproc(act)
+static void nullkindproc(act)
 log_16_action *act;
 {
   /* ignore all calls */
@@ -1280,10 +1276,10 @@ log_16_action *act;
 /* This procedure runs the "status" screen. */
 
 
-Static Void status_16(flag)
-boolean *flag;
+static void status_16(flag)
+int *flag;
 {
-  Char s[256];
+  char s[256];
   log_action *WITH;
 
   WITH = logsima_action.lact;
@@ -1302,10 +1298,10 @@ boolean *flag;
 /* These routines handle the simtype 16 interface to LOG. */
 
 
-Static Void parseicommand(lact)
+static void parseicommand(lact)
 log_action *lact;
 {
-  boolean flag;
+  int flag;
   log_action *WITH;
 
   WITH = lact;
@@ -1345,7 +1341,7 @@ log_action *lact;
 }
 
 
-Static Void parsecommand(lact)
+static void parsecommand(lact)
 log_action *lact;
 {
   log_action *WITH;
@@ -1358,7 +1354,7 @@ log_action *lact;
 }
 
 
-Static Char *log_actionkinds_NAMES[] = {
+static char *log_actionkinds_NAMES[] = {
   "ACT_INIT", "ACT_ENDINIT", "ACT_EXIT", "ACT_CLEARMSG", "ACT_STATUS",
   "ACT_CNF", "ACT_IMMED", "ACT_FUNC", "ACT_COLOR", "ACT_SELECT", "ACT_CLEAR",
   "ACT_EDIT", "ACT_PASS", "ACT_TSTEP", "ACT_ERASEGATE", "ACT_TOUCHGATE",
@@ -1375,12 +1371,12 @@ Static Char *log_actionkinds_NAMES[] = {
 
 
 
-Static Char *actionname(Result, action)
-Char *Result;
+static char *actionname(Result, action)
+char *Result;
 log_actionkinds action;
 {
   long i;
-  Char s[33];
+  char s[33];
 
 /* p2c: logsim.text, line 1069: Note:
  * Line breaker spent 0.0+2.00 seconds, 5000 tries on line 1304 [251] */
@@ -1394,11 +1390,11 @@ log_actionkinds action;
 
 
 
-Static Void showgatepins(g)
+static void showgatepins(g)
 log_grec *g;
 {
   short i, FORLIM;
-  Char STR1[256];
+  char STR1[256];
 
   FORLIM = g->kind->numpins;
   for (i = 1; i <= FORLIM; i++) {
@@ -1416,7 +1412,7 @@ log_grec *g;
 
 
 
-Static Void newnode_16(lact, n)
+static void newnode_16(lact, n)
 log_action *lact;
 log_nrec **n;
 {
@@ -1429,7 +1425,7 @@ log_nrec **n;
 }
 
 
-Static Void disposenode_16(lact, n)
+static void disposenode_16(lact, n)
 log_action *lact;
 log_nrec **n;
 {
@@ -1442,12 +1438,12 @@ log_nrec **n;
 
 
 
-Static Void digproc1()
+static void digproc1()
 {
 }
 
 
-Static Void digproc2()
+static void digproc2()
 {
   log_gattrrec *WITH;
 
@@ -1463,21 +1459,21 @@ Static Void digproc2()
 }
 
 
-Static Void digproc3()
+static void digproc3()
 {
 }
 
 
-/* Local variables for Log_16_proc: */
+/* variables for Log_16_proc: */
 struct LOC_Log_16_proc {
   kindinfo *ki;
 } ;
 
-Local Void setupkindproc(LINK)
+void setupkindproc(LINK)
 struct LOC_Log_16_proc *LINK;
 {
   short pc, i, len;
-  Char procname[256];
+  char procname[256];
   log_krec *WITH;
 
   WITH = logsima_action.lact->actkind;
@@ -1497,14 +1493,14 @@ struct LOC_Log_16_proc *LINK;
   for (i = 0; i < len; i++)
     procname[i] = WITH->proc[pc + i];
   LINK->ki->hasproc = newci_findprocedure(procname,
-      (Void(**) PV())(&LINK->ki->kindproc));
+      (void(**) ())(&LINK->ki->kindproc));
   if (!LINK->ki->hasproc)
     LINK->ki->kindproc = log_16_noprog;
 }
 
 
 
-Void Log_16_proc(lact)
+void Log_16_proc(lact)
 log_action *lact;
 {
   struct LOC_Log_16_proc V;
@@ -1514,13 +1510,13 @@ log_action *lact;
   na_strlistrec *l1;
   short i;
   double val1, val2;
-  Char STR1[33];
-  Char STR2[46];
-  Char STR3[40];
+  char STR1[33];
+  char STR2[46];
+  char STR3[40];
   log_action *WITH;
-  Void (*TEMP) PV();
-  Void (*TEMP1) PV();
-  Void (*TEMP2) PV();
+  void (*TEMP) ();
+  void (*TEMP1) ();
+  void (*TEMP2) ();
   short FORLIM;
 
   logsima_action.lact = lact;
@@ -1638,7 +1634,7 @@ log_action *lact;
     setupkindproc(&V);
     V.ki->knext = kbase_16;
     kbase_16 = WITH->actkind;
-    WITH->actkind->info = (Anyptr)V.ki;
+    WITH->actkind->info = (void *)V.ki;
     callkind(act_16_newkind);
     break;
 
@@ -1781,10 +1777,10 @@ log_action *lact;
 
       /* code initializing ppins should go here */
 
-      gi->pvars = (Char *)Malloc((long)V.ki->numpvars);
+      gi->pvars = (char *)Malloc((long)V.ki->numpvars);
       if (V.ki->numpvars != 0)
-	memset((Anyptr)gi->pvars, 0, (long)V.ki->numpvars);
-      WITH->actgate->info = (Anyptr)gi;
+	memset((void *)gi->pvars, 0, (long)V.ki->numpvars);
+      WITH->actgate->info = (void *)gi;
 
     }
     callgate(act_16_new);
@@ -1813,10 +1809,10 @@ log_action *lact;
 
       /* code initializing ppins should go here */
 
-      gi->pvars = (Char *)Malloc((long)V.ki->numpvars);
+      gi->pvars = (char *)Malloc((long)V.ki->numpvars);
       if (V.ki->numpvars != 0)
-	memmove((Anyptr)gi2->pvars, (Anyptr)gi->pvars, (long)V.ki->numpvars);
-      WITH->actgate->info = (Anyptr)gi;
+	memmove((void *)gi2->pvars, (void *)gi->pvars, (long)V.ki->numpvars);
+      WITH->actgate->info = (void *)gi;
     }
     callgate(act_16_copy);
     break;
@@ -1869,7 +1865,7 @@ log_action *lact;
 
   case act_newnode:
     ni = (nodeinfo *)Malloc(sizeof(nodeinfo));
-    WITH->actnode->info = (Anyptr)ni;
+    WITH->actnode->info = (void *)ni;
     ni->v = log_none;
     ni->v0 = log_none;
     ni->v00 = log_none;
@@ -1886,7 +1882,7 @@ log_action *lact;
     ni = (nodeinfo *)Malloc(sizeof(nodeinfo));
     ni2 = (nodeinfo *)WITH->actnode2->info;
     *ni = *ni2;
-    WITH->actnode->info = (Anyptr)ni;
+    WITH->actnode->info = (void *)ni;
     break;
 
   case act_combineintonode:
diff --git a/log/src/logsim.h b/log/src/logsim.h
index 4a847af..b241ea9 100644
--- a/log/src/logsim.h
+++ b/log/src/logsim.h
@@ -1,80 +1,35 @@
-/* Header for module logsim, generated by p2c */
 #ifndef LOGSIM_H
 #define LOGSIM_H
 
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifndef LOGDIG_H
 #include "logdig.h"
-#endif
-
-#ifndef LOGSIMA_H
 #include "logsima.h"
-#endif
-
-
-#ifndef LOGSIMED_H
 #include "logsimed.h"
-#endif
-
-#ifndef RND_H
 #include <p2c/rnd.h>
-#endif
-
-#ifndef NEWKBD_H
 #include <p2c/newkbd.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-#ifndef NEWCRT_H
 #include <p2c/newcrt.h>
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-
-#ifdef LOGSIM_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-
-
-extern Void Log_16_proc PP((log_action *lact));
-extern Void Log_16_7seg PP((log_16_action *act));
-extern Void Log_16_break PP((log_16_action *act));
-extern Void Log_16_clock PP((log_16_action *act));
-extern Void Log_16_keypad PP((log_16_action *act));
-extern Void Log_16_ledgate PP((log_16_action *act));
-extern Void Log_16_ledgate2 PP((log_16_action *act));
-extern Void Log_16_pulse PP((log_16_action *act));
-extern Void Log_16_scope PP((log_16_action *act));
 
-extern Void Log_16_switch PP((log_16_action *act));
-extern Void log_16_conf PP((log_16_action *act, log_nrec *n));
+extern void Log_16_proc (log_action *lact);
+extern void Log_16_7seg (log_16_action *act);
+extern void Log_16_break (log_16_action *act);
+extern void Log_16_clock (log_16_action *act);
+extern void Log_16_keypad (log_16_action *act);
+extern void Log_16_ledgate (log_16_action *act);
+extern void Log_16_ledgate2 (log_16_action *act);
+extern void Log_16_pulse (log_16_action *act);
+extern void Log_16_scope (log_16_action *act);
 
+extern void Log_16_switch (log_16_action *act);
+extern void log_16_conf (log_16_action *act, log_nrec *n);
 
 
-extern Void log_16_noprog PP((log_16_action *act));
 
+extern void log_16_noprog (log_16_action *act);
 
-#undef vextern
 
 #endif /*LOGSIM_H*/
 
diff --git a/log/src/logsima.h b/log/src/logsima.h
index 565c932..f45c9cf 100644
--- a/log/src/logsima.h
+++ b/log/src/logsima.h
@@ -1,32 +1,11 @@
-/* Header for module logsima, generated by p2c */
 #ifndef LOGSIMA_H
 #define LOGSIMA_H
 
 
-#ifndef LOGSIM_H
 #include "logsim.h"
-#endif
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifndef LOGDIG_H
 #include "logdig.h"
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-
-#ifdef LOGSIMA_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
 
 typedef struct nodeinfo {
   log_16_value v, v0, v00, defv, truev;
@@ -34,33 +13,30 @@ typedef struct nodeinfo {
 
 typedef struct kindinfo {
   na_long info;
-  boolean hasproc, instance;
+  int hasproc, instance;
   short numppins, numpvars;
-  Void (*kindproc) PP((log_16_action *act));
+  void (*kindproc) (log_16_action *act);
   log_krec *knext;
 } kindinfo;
 
 typedef struct gateinfo {
   log_nrec **ppins;
-  Char *pvars;
+  char *pvars;
 } gateinfo;
 
 
-vextern log_tool *logsima_tool_16;
-vextern log_16_action logsima_action;
-vextern Void (*logsima_dig_inst) PP((log_16_action *act));
-
-
-extern Void logsima_init PV();
-extern Void executegates PP((boolean *active, log_grec *g));
-extern Void executeprog PP((uchar *pr, log_nrec **pins, gateinfo *ginfo,
-			    na_long *vars));
-extern Void clearnodes PP((log_nrec *n));
-extern Void copynodes PP((log_nrec *n, boolean *stable));
-extern Void callgate PP((log_16_actionkinds action));
+extern log_tool *logsima_tool_16;
+extern log_16_action logsima_action;
+extern void (*logsima_dig_inst) (log_16_action *act);
 
 
-#undef vextern
+extern void logsima_init ();
+extern void executegates (int *active, log_grec *g);
+extern void executeprog (uchar *pr, log_nrec **pins, gateinfo *ginfo,
+			    na_long *vars);
+extern void clearnodes (log_nrec *n);
+extern void copynodes (log_nrec *n, int *stable);
+extern void callgate (log_16_actionkinds action);
 
 #endif /*LOGSIMA_H*/
 
diff --git a/log/src/logsimasm.c b/log/src/logsimasm.c
index 7c4c8b7..665b4e4 100644
--- a/log/src/logsimasm.c
+++ b/log/src/logsimasm.c
@@ -25,16 +25,10 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
    Dave Gillespie, 3/27/90 */
 
 
-
-
 #include <p2c/p2c.h>
-
-#define LOGSIMA_G
 #include "logsima.h"
 
-
-
-Static int trace_16 = 0;
+static int trace_16 = 0;
 #define trace_16  (logsima_action.lact->quiet ? -1 : 0)
 
 #define TRACE_ENBL  0
@@ -46,15 +40,15 @@ Static int trace_16 = 0;
 
 
 
-extern boolean findprocedure PP((Char *name, Void (**start)()));
+extern int findprocedure (char *name, void (**start)());
 
 
-Static int callcache_next;
-Static Void (*callcache[255-32])(log_16_action *);   /* first 32 are unused */
+static int callcache_next;
+static void (*callcache[255-32])(log_16_action *);   /* first 32 are unused */
 
 
 
-Static Void nullproc_16(act)
+static void nullproc_16(act)
 log_16_action *act;
 {
   /* do nothing */
@@ -69,7 +63,7 @@ void logsima_init()
 
 
 
-Void clearnodes(n)
+void clearnodes(n)
 register log_nrec *n;
 {
   register log_tool *tool16 = logsima_action.lact->acttool;
@@ -85,9 +79,9 @@ register log_nrec *n;
 }
 
 
-Void copynodes(n, stable)
+void copynodes(n, stable)
 register log_nrec *n;
-boolean *stable;
+int *stable;
 {
   register log_tool *tool16 = logsima_action.lact->acttool;
   register nodeinfo *nip;
@@ -113,20 +107,20 @@ boolean *stable;
 
 
 
-Static log_grec *g_gate;
-Static uchar *g_proc;
-Static long g_vars;
-Static log_nrec **g_pins;
-Static gateinfo *g_info;
+static log_grec *g_gate;
+static uchar *g_proc;
+static long g_vars;
+static log_nrec **g_pins;
+static gateinfo *g_info;
 
 
-static Void processcall(action)
+static void processcall(action)
 log_16_actionkinds action;
 {
   uchar num;
   int len;
   char namebuf[256];
-  Void (*myproc)(log_16_action *);
+  void (*myproc)(log_16_action *);
 
   logsima_action.action = action;
   logsima_action.lact->actkind = logsima_action.lact->actgate->kind;
@@ -137,7 +131,7 @@ log_16_actionkinds action;
   } else {
     namebuf[len] = 0;
     strncpy(namebuf, (char *)g_proc, len);
-    if (findprocedure(namebuf, (Void(**)())(&myproc))) {
+    if (findprocedure(namebuf, (void(**)())(&myproc))) {
       if (callcache_next < 254) {
 	num = g_proc[-2] = callcache_next++;
 	callcache[num - 32] = myproc;
@@ -156,7 +150,7 @@ log_16_actionkinds action;
 }
 
 
-Void callgate(action)
+void callgate(action)
 log_16_actionkinds action;
 {
   uchar *save_proc = g_proc;
@@ -177,7 +171,7 @@ log_16_actionkinds action;
 
 
 
-Static Void record_conflict(np)
+static void record_conflict(np)
 log_nrec *np;
 {
   (*logsima_action.lact->hook.nodeconflict)(np);
@@ -215,7 +209,7 @@ static int not_table[3] = { log_none, log_one,  log_zero };
 static int fix_table[3] = { log_zero, log_zero, log_one  };
 
 
-Static char *debug_dasm()
+static char *debug_dasm()
 {
 #define SAFETY_MARGIN 256
   long pc = 1;
@@ -228,15 +222,15 @@ Static char *debug_dasm()
     buf = NULL;
   }
   if (*g_proc) {
-    tmp = (Char*)dasm_16(g_proc, &pc);
-    buf = (Char*)Malloc(strlen(tmp) + SAFETY_MARGIN); 
+    tmp = (char*)dasm_16(g_proc, &pc);
+    buf = (char*)Malloc(strlen(tmp) + SAFETY_MARGIN); 
     strcpy(buf, "\"");
     strcat(buf, tmp);
     strcat(buf, "\"  <");
     Free(tmp);
     pc--;
   } else {
-    buf = (Char*)Malloc(SAFETY_MARGIN);
+    buf = (char*)Malloc(SAFETY_MARGIN);
     strcpy(buf, "\"<");
   }
 
@@ -251,7 +245,7 @@ Static char *debug_dasm()
 }
 
 
-Static log_nrec *g_pinnum()
+static log_nrec *g_pinnum()
 {
   register uchar ch;
 
@@ -381,7 +375,7 @@ static log_16_value g_expr()
 }
 
 
-Static Void g_stmts()
+static void g_stmts()
 {
   register uchar ch, ch2;
   register int temp;
@@ -627,7 +621,7 @@ Static Void g_stmts()
 }
 
 
-Void executeprog(pr, pins, ginfo, vars)
+void executeprog(pr, pins, ginfo, vars)
 uchar *pr;
 log_nrec **pins;
 gateinfo *ginfo;
@@ -655,8 +649,8 @@ na_long *vars;
 }
 
 
-Void executegates(active, g)
-boolean *active;
+void executegates(active, g)
+int *active;
 register log_grec *g;
 {
   register log_tool *tool16 = logsima_action.lact->acttool;
diff --git a/log/src/logsimed.c b/log/src/logsimed.c
index e1138a1..81a77bd 100644
--- a/log/src/logsimed.c
+++ b/log/src/logsimed.c
@@ -39,43 +39,40 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 #include <p2c/p2c.h>
-
-
-#define LOGSIMED_G
 #include "logsimed.h"
 
 
-/* Local variables for dasm_16: */
+/* variables for dasm_16: */
 struct LOC_dasm_16 {
-  Char *buf;
+  char *buf;
   int bufsiz;
   uchar *proc;
   long *pc;
 } ;
 
-Local Void dasmop PP((struct LOC_dasm_16 *LINK));
+void dasmop (struct LOC_dasm_16 *LINK);
 
-/* Local variables for dasmop: */
+/* variables for dasmop: */
 struct LOC_dasmop {
   struct LOC_dasm_16 *LINK;
 } ;
 
-Local Void append PP((struct LOC_dasm_16 *LINK, Char *s));
+void append (struct LOC_dasm_16 *LINK, char *s);
 
 /* append to the local buffer. */
 /* the buf and bufsiz are initialized in dasm_16() */
-Local Void append(LINK, s)
+void append(LINK, s)
 struct LOC_dasm_16 *LINK;
-Char *s;
+char *s;
 {
 #define GROW_SIZE 1024
-Char *tmp;
+char *tmp;
 
   if (strlen(LINK->buf) + strlen(s) + 1 > LINK->bufsiz) {
     tmp = strdup(LINK->buf);
     Free(LINK->buf);
     LINK->bufsiz = strlen(tmp) + strlen(s) + 1 + GROW_SIZE;  
-    LINK->buf = (Char*)Malloc(LINK->bufsiz);
+    LINK->buf = (char*)Malloc(LINK->bufsiz);
     strcpy(LINK->buf, tmp);
     Free(tmp);
   }
@@ -85,20 +82,20 @@ Char *tmp;
 }
 
 
-Local Char vr(i, LINK)
+char vr(i, LINK)
 long i;
 struct LOC_dasmop *LINK;
 {
-  return ((Char)((i & 15) + 65));
+  return ((char)((i & 15) + 65));
 }
 
-Local long getpseudo(LINK)
+long getpseudo(LINK)
 struct LOC_dasmop *LINK;
 {
   long Result;
 
   if (LINK->LINK->proc[*LINK->LINK->pc - 1] < 128) {
-/* p2c: logsimed.text, line 184: Note: Character >= 128 encountered [281] */
+/* p2c: logsimed.text, line 184: Note: character >= 128 encountered [281] */
     Result = LINK->LINK->proc[*LINK->LINK->pc - 1] - 64;
     (*LINK->LINK->pc)++;
   } else {
@@ -109,7 +106,7 @@ struct LOC_dasmop *LINK;
   return Result;
 }
 
-Local Void dasmoppar(z, LINK)
+void dasmoppar(z, LINK)
 uchar z;
 struct LOC_dasmop *LINK;
 {
@@ -120,20 +117,20 @@ struct LOC_dasmop *LINK;
     dasmop(LINK->LINK);
     return;
   }
-/* p2c: logsimed.text, line 202: Note: Character >= 128 encountered [281] */
-/* p2c: logsimed.text, line 202: Note: Character >= 128 encountered [281] */
+/* p2c: logsimed.text, line 202: Note: character >= 128 encountered [281] */
+/* p2c: logsimed.text, line 202: Note: character >= 128 encountered [281] */
   append(LINK->LINK, "(");
   dasmop(LINK->LINK);
   append(LINK->LINK, ")");
 }
 
-Local Void dasmop(LINK)
+void dasmop(LINK)
 struct LOC_dasm_16 *LINK;
 {
   struct LOC_dasmop V;
   uchar ch;
   long i;
-  Char STR1[256];
+  char STR1[256];
 
   V.LINK = LINK;
   ch = LINK->proc[*LINK->pc - 1];
@@ -648,14 +645,14 @@ struct LOC_dasm_16 *LINK;
 
 /* dasm_16() returns a pointer to allocated memory. */
 /* the caller must ensure it is freed. */
-Char *dasm_16(proc_, pc_)
+char *dasm_16(proc_, pc_)
 uchar *proc_;
 long *pc_;
 {
   struct LOC_dasm_16 V;
 
   V.bufsiz = 256;
-  V.buf = (Char*)Malloc(V.bufsiz);
+  V.buf = (char*)Malloc(V.bufsiz);
   V.proc = proc_;
   V.pc = pc_;
   *V.buf = '\0';
@@ -698,13 +695,13 @@ long pc;
 }
 
 
-/* Local variables for length_16: */
+/* variables for length_16: */
 struct LOC_length_16 {
   uchar *proc;
   long pc;
 } ;
 
-Local Void instlen(LINK)
+void instlen(LINK)
 struct LOC_length_16 *LINK;
 {
   uchar ch;
@@ -740,7 +737,7 @@ struct LOC_length_16 *LINK;
     case 1:
     case 8:
       LINK->pc += (LINK->proc[LINK->pc - 1] >= 128) + 1;
-/* p2c: logsimed.text, line 605: Note: Character >= 128 encountered [281] */
+/* p2c: logsimed.text, line 605: Note: character >= 128 encountered [281] */
       instlen(LINK);
       break;
 
@@ -748,7 +745,7 @@ struct LOC_length_16 *LINK;
     case 10:
     case 11:
       LINK->pc += (LINK->proc[LINK->pc - 1] >= 128) + 1;
-/* p2c: logsimed.text, line 609: Note: Character >= 128 encountered [281] */
+/* p2c: logsimed.text, line 609: Note: character >= 128 encountered [281] */
       break;
 
     case 6:
@@ -830,7 +827,7 @@ struct LOC_length_16 *LINK;
     case 11:
     case 12:
       LINK->pc += (LINK->proc[LINK->pc - 1] >= 128) + 1;
-/* p2c: logsimed.text, line 643: Note: Character >= 128 encountered [281] */
+/* p2c: logsimed.text, line 643: Note: character >= 128 encountered [281] */
       break;
     }
     break;
@@ -855,18 +852,18 @@ long pc_;
 }
 
 
-/* Local variables for assem_16: */
+/* variables for assem_16: */
 struct LOC_assem_16 {
   uchar *proc;
   long *pc;
-  Char *s;
-  boolean snerr;
+  char *s;
+  int snerr;
   long procsiz;
 } ;
 
-Local Void assem PP((struct LOC_assem_16 *LINK));
+void assem (struct LOC_assem_16 *LINK);
 
-Local Void store(b, LINK)
+void store(b, LINK)
 short b;
 struct LOC_assem_16 *LINK;
 {
@@ -874,9 +871,9 @@ struct LOC_assem_16 *LINK;
   LINK->proc[*LINK->pc - 1] = b;
 }
 
-Local boolean strcheck(s, pref, LINK)
-Char *s;
-Char *pref;
+int strcheck(s, pref, LINK)
+char *s;
+char *pref;
 struct LOC_assem_16 *LINK;
 {
   if (strbegins(s, pref)) {
@@ -886,17 +883,17 @@ struct LOC_assem_16 *LINK;
     return false;
 }
 
-/* Local variables for assem: */
+/* variables for assem: */
 struct LOC_assem {
   struct LOC_assem_16 *LINK;
 } ;
 
-Local Void factor(LINK)
+void factor(LINK)
 struct LOC_assem *LINK;
 {
   long i, j, FORLIM;
-  Char STR2[6];
-  Char STR3[256];
+  char STR2[6];
+  char STR3[256];
 
   if (LINK->LINK->s[0] == '\0') {
     LINK->LINK->snerr = true;
@@ -1163,7 +1160,7 @@ struct LOC_assem *LINK;
       store((int)(i + 224), LINK->LINK);
       return;
     }
-    sprintf(STR2, "NOT%c", (Char)(i + 65));
+    sprintf(STR2, "NOT%c", (char)(i + 65));
     if (strcheck(LINK->LINK->s, STR2, LINK->LINK)) {
       store((int)(i + 112), LINK->LINK);
       return;
@@ -1226,7 +1223,7 @@ struct LOC_assem *LINK;
   }
 }
 
-Local Void assem(LINK)
+void assem(LINK)
 struct LOC_assem_16 *LINK;
 {
   struct LOC_assem V;
@@ -1259,7 +1256,7 @@ struct LOC_assem_16 *LINK;
 	if (j == 1 || j == 3)
 	  j--;
       }
-      LINK->proc[i - 1] = (Char)(j + 160);
+      LINK->proc[i - 1] = (char)(j + 160);
     }
   } while (j != -1);
 }
@@ -1267,15 +1264,15 @@ struct LOC_assem_16 *LINK;
 
 
 long assem_16(buf_, proc_, pc_)
-Char *buf_;
+char *buf_;
 uchar *proc_;
 long *pc_;
 {
   struct LOC_assem_16 V;
   long Result;
-  Char *buf;
+  char *buf;
   long i, j, savepc;
-  Char *STR2;
+  char *STR2;
   long FORLIM;
 
 
@@ -1341,17 +1338,17 @@ long *pc_;
 }
 
 
-/* Local variables for edit_16: */
+/* variables for edit_16: */
 struct LOC_edit_16 {
    uchar **proc;
    long *proclen;
-   Char name[9];
+   char name[9];
    long x, y, pc, pctop, indtop, indent, instrptr, height;
    uchar instr[1023];
    uchar ch;
 } ;
 
-Local Void resizeproc(len, LINK)
+void resizeproc(len, LINK)
 long len;
 struct LOC_edit_16 *LINK;
 {
@@ -1364,17 +1361,17 @@ struct LOC_edit_16 *LINK;
   while (newlen < len)
     newlen *= 2;
   newproc = (uchar *)Malloc(newlen);
-  memmove((Anyptr)newproc, (Anyptr)(*LINK->proc), *LINK->proclen);
+  memmove((void *)newproc, (void *)(*LINK->proc), *LINK->proclen);
   Free(*LINK->proc);
   *LINK->proclen = newlen;
   *LINK->proc = newproc;
 }
 
-Local Void dasminst(LINK)
+void dasminst(LINK)
 struct LOC_edit_16 *LINK;
 {
   long ind;
-  Char *buf;
+  char *buf;
 
   ind = indent_16(*LINK->proc, LINK->pc);
   if (ind < 0) {
@@ -1391,7 +1388,7 @@ struct LOC_edit_16 *LINK;
   Free(buf);
 }
 
-Local Void showdef(LINK)
+void showdef(LINK)
 struct LOC_edit_16 *LINK;
 {
   long i, pc0, FORLIM;
@@ -1427,7 +1424,7 @@ struct LOC_edit_16 *LINK;
   LINK->pc = pc0;
 }
 
-Local boolean insertinst(p, n, LINK)
+int insertinst(p, n, LINK)
 long p, n;
 struct LOC_edit_16 *LINK;
 {
@@ -1447,7 +1444,7 @@ struct LOC_edit_16 *LINK;
     return false;
 }
 
-Local Void deleteinst(p, n, LINK)
+void deleteinst(p, n, LINK)
 long p, n;
 struct LOC_edit_16 *LINK;
 {
@@ -1460,9 +1457,9 @@ struct LOC_edit_16 *LINK;
   } while ((*LINK->proc)[i - 2] != '\0');
 }
 
-Local long doassem(s, repl, LINK)
-Char *s;
-boolean repl;
+long doassem(s, repl, LINK)
+char *s;
+int repl;
 struct LOC_edit_16 *LINK;
 {
   long Result, i, FORLIM;
@@ -1481,9 +1478,9 @@ struct LOC_edit_16 *LINK;
   return Result;
 }
 
-Local Void bogusreadln(s, hasdef, LINK)
-Char *s;
-boolean hasdef;
+void bogusreadln(s, hasdef, LINK)
+char *s;
+int hasdef;
 struct LOC_edit_16 *LINK;
 {
   long pos;
@@ -1496,23 +1493,23 @@ struct LOC_edit_16 *LINK;
 /* p2c: logsimed.text, line 1282:
  * Warning: Type mismatch in VAR parameter term [295] */
   newci_inputstring(s, im_keep, "\015\n\037\003\004", 
-		    (Char *)&LINK->ch, false, &pos);
+		    (char *)&LINK->ch, false, &pos);
 }
 
 
 
-Void edit_16(proc_, proclen_, name_)
+void edit_16(proc_, proclen_, name_)
 uchar **proc_;
 long *proclen_;
-Char *name_;
+char *name_;
 {
   struct LOC_edit_16 V;
   long x1, y1, pc0, pc1, sx, sy;
-  Char *sbuf=NULL;
-  Char *recallbuf=NULL;
-  boolean editing;
-  Char *STR1;
-  Char *STR2;
+  char *sbuf=NULL;
+  char *recallbuf=NULL;
+  int editing;
+  char *STR1;
+  char *STR2;
 
   V.proc = proc_;
   V.proclen = proclen_;
@@ -1544,14 +1541,14 @@ Char *name_;
 	if (pc0 == V.pc)
 	  putchar(137);
 /* p2c: logsimed.text, line 1313:
- * Note: Character >= 128 encountered [281] */
+ * Note: character >= 128 encountered [281] */
 /* p2c: logsimed.text, line 1313:
  * Note: WRITE statement contains color/attribute characters [203] */
 	printf("%.2X", (*V.proc)[pc0 - 1] & 0xff);
 	if (pc0 == V.pc)
 	  putchar(136);
 /* p2c: logsimed.text, line 1316:
- * Note: Character >= 128 encountered [281] */
+ * Note: character >= 128 encountered [281] */
 /* p2c: logsimed.text, line 1316:
  * Note: WRITE statement contains color/attribute characters [203] */
 	pc0++;
@@ -1567,7 +1564,7 @@ Char *name_;
       else
 	printf("00\n");
 /* p2c: logsimed.text, line 1328:
- * Note: Characters >= 128 encountered [281] */
+ * Note: characters >= 128 encountered [281] */
 /* p2c: logsimed.text, line 1328:
  * Note: WRITE statement contains color/attribute characters [203] */
       printf("Press any key to continue...");
@@ -1576,7 +1573,7 @@ Char *name_;
       showdef(&V);              /* was 152 */
     } else if (V.ch == 25) {  /* changed to 25 for recall buffer == ^Y */
       if (recallbuf && *recallbuf != '\0') {
-	STR2 = (Char*)Malloc(strlen(recallbuf));
+	STR2 = (char*)Malloc(strlen(recallbuf));
 	x1 = strposb(recallbuf, "\0", strlen(recallbuf) - 1L);
 	y1 = doassem(strpart(STR2, recallbuf, (int)(x1 + 1),
 			     (int)(strlen(recallbuf) - 1L)), false, &V);
@@ -1589,23 +1586,23 @@ Char *name_;
     } else if (V.ch == '\b' || (V.ch >= 150 && V.ch <= 162) ||
 	       (V.ch >= ' ' && V.ch <= '\177')) {
 /* p2c: logsimed.text, line 1346:
- * Note: Character >= 128 encountered [281] */
+ * Note: character >= 128 encountered [281] */
 /* p2c: logsimed.text, line 1346:
- * Note: Character >= 128 encountered [281] */
+ * Note: character >= 128 encountered [281] */
       editing = (V.ch == '\b' || (V.ch >= 157 && V.ch <= 162) || V.ch == 154 ||
 		 V.ch == 153 || V.ch == 151 || V.ch == 150);
 /* p2c: logsimed.text, line 1349:
- * Note: Character >= 128 encountered [281] */
+ * Note: character >= 128 encountered [281] */
 /* p2c: logsimed.text, line 1349:
- * Note: Character >= 128 encountered [281] */
+ * Note: character >= 128 encountered [281] */
 /* p2c: logsimed.text, line 1349:
- * Note: Character >= 128 encountered [281] */
+ * Note: character >= 128 encountered [281] */
 /* p2c: logsimed.text, line 1349:
- * Note: Character >= 128 encountered [281] */
+ * Note: character >= 128 encountered [281] */
 /* p2c: logsimed.text, line 1349:
- * Note: Character >= 128 encountered [281] */
+ * Note: character >= 128 encountered [281] */
 /* p2c: logsimed.text, line 1349:
- * Note: Character >= 128 encountered [281] */
+ * Note: character >= 128 encountered [281] */
       if (editing) {
 	pc0 = V.pc;
         if (sbuf)
@@ -1614,22 +1611,22 @@ Char *name_;
 	if (V.ch == 161) {   /*EDIT key*/
 	  V.ch = 150;
 /* p2c: logsimed.text, line 1355:
- * Note: Character >= 128 encountered [281] */
+ * Note: character >= 128 encountered [281] */
 	}
 /* p2c: logsimed.text, line 1354:
- * Note: Character >= 128 encountered [281] */
+ * Note: character >= 128 encountered [281] */
       } else {
 	nc_getXY(&sx, &sy);
 	nc_insLine((int)sy, 1); 
       }
       if (sbuf == NULL) {
-        sbuf = (Char*)Malloc(1024);
+        sbuf = (char*)Malloc(1024);
       }
       bogusreadln(sbuf, editing, &V);
       y1 = doassem(sbuf, editing, &V);
       if (y1 == 0) {
 	putchar('\007');
-        STR1 = (Char*)Malloc(strlen(sbuf) + strlen("# ") + 1);
+        STR1 = (char*)Malloc(strlen(sbuf) + strlen("# ") + 1);
 	sprintf(STR1, "# %s", sbuf);
 	y1 = doassem(STR1, false, &V);
         Free(STR1);
@@ -1735,7 +1732,7 @@ Char *name_;
         } else {
           STR2 = strdup(recallbuf);
           Free(recallbuf);
-	  recallbuf = (Char*)Malloc(strlen(STR2) + strlen(sbuf) + 1 );  
+	  recallbuf = (char*)Malloc(strlen(STR2) + strlen(sbuf) + 1 );  
 	  strcpy(recallbuf,STR2);
 	  strcat(recallbuf, sbuf);
           Free(STR2);
@@ -1748,33 +1745,33 @@ Char *name_;
   newci_inputunmap();
 
 /* p2c: logsimed.text, line 1336:
- * Note: Character >= 128 encountered [281] */
+ * Note: character >= 128 encountered [281] */
   if (sbuf)
     Free(sbuf);
   if (recallbuf)
     Free(recallbuf);
   /*RECALL*/
 /* p2c: logsimed.text, line 1454:
- * Note: Character >= 128 encountered [281] */
+ * Note: character >= 128 encountered [281] */
   /*INS LN*/
 /* p2c: logsimed.text, line 1460:
- * Note: Character >= 128 encountered [281] */
+ * Note: character >= 128 encountered [281] */
   /*DEL LN*/
 }
 
 
 
 
-Void dump_16(proc, sl, indenting)
+void dump_16(proc, sl, indenting)
 uchar **proc;
 na_strlist **sl;
-boolean indenting;
+int indenting;
 {
   long pc, indent, oindent, proclen;
   na_strlist *l1;
-  Char *buf;
-  Char *STR1;
-  Char STR2[256];
+  char *buf;
+  char *STR1;
+  char STR2[256];
 
   proclen = 1;
   while ((*proc)[proclen - 1] != '\0')
@@ -1790,7 +1787,7 @@ boolean indenting;
     if ((*proc)[pc - 1] < 32 && ((1L << (*proc)[pc - 1]) & 0xfff8L) != 0)
       indent += 3;
     buf = dasm_16(*proc, &pc);
-    STR1 = (Char*)Malloc(strlen(buf) + oindent +1);
+    STR1 = (char*)Malloc(strlen(buf) + oindent +1);
     sprintf(STR1, "%*s%s", (int)oindent, "", buf);
     l1 = strlist_append(sl, STR1);
     Free(STR1);
@@ -1808,7 +1805,7 @@ boolean indenting;
 
 
 
-Void read_16(proc, proclen, sl)
+void read_16(proc, proclen, sl)
 uchar **proc;
 long *proclen;
 na_strlist *sl;
@@ -1816,7 +1813,7 @@ na_strlist *sl;
   long pc, instrptr, i, newlen;
   uchar instr[1023];
   na_strlist *l1;
-  Char *STR1;
+  char *STR1;
 
   pc = 1;
   l1 = sl;
@@ -1827,7 +1824,7 @@ na_strlist *sl;
       pc += instrptr;
     else {
       instrptr = 1;
-      STR1 = (Char*)Malloc(strlen(l1->s) + strlen("# ") + 1);
+      STR1 = (char*)Malloc(strlen(l1->s) + strlen("# ") + 1);
       sprintf(STR1, "# %s", l1->s);
       i = assem_16(STR1, instr, &instrptr);
       pc += instrptr;
@@ -1851,7 +1848,7 @@ na_strlist *sl;
     i = assem_16(l1->s, *proc, &instrptr);
     if (instrptr < pc) {
       instrptr = pc;
-      STR1 = (Char*)Malloc(strlen(l1->s) +2 +1);
+      STR1 = (char*)Malloc(strlen(l1->s) +2 +1);
       sprintf(STR1, "# %s", l1->s);
       i = assem_16(STR1, *proc, &instrptr);
       Free(STR1);
diff --git a/log/src/logsimed.h b/log/src/logsimed.h
index c795dfc..c3208b8 100644
--- a/log/src/logsimed.h
+++ b/log/src/logsimed.h
@@ -1,59 +1,25 @@
-/* Header for module logsimed, generated by p2c */
 #ifndef LOGSIMED_H
 #define LOGSIMED_H
 
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifndef LOGDIG_H
 #include "logdig.h"
-#endif
-
-#ifndef NEWKBD_H
 #include <p2c/newkbd.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-#ifndef NEWCRT_H
 #include <p2c/newcrt.h>
-#endif
-
-
-#ifdef LOGSIMED_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-
-extern Void edit_16 PP((uchar **proc, long *proclen, Char *name));
-extern Void dump_16 PP((uchar **proc, na_strlist **sl, int indenting));
-
-extern Void read_16 PP((uchar **proc, long *proclen, na_strlist *sl));
-extern Char *dasm_16 PP((uchar *proc, long *pc));
-extern long indent_16 PP((uchar *proc, long pc));
-extern long length_16 PP((uchar *proc, long pc));
-
-
 
 
+extern void edit_16 (uchar **proc, long *proclen, char *name);
+extern void dump_16 (uchar **proc, na_strlist **sl, int indenting);
 
-extern long assem_16 PP((Char *buf, uchar *proc, long *pc));
+extern void read_16 (uchar **proc, long *proclen, na_strlist *sl);
+extern char *dasm_16 (uchar *proc, long *pc);
+extern long indent_16 (uchar *proc, long pc);
+extern long length_16 (uchar *proc, long pc);
 
+extern long assem_16 (char *buf, uchar *proc, long *pc);
 
-#undef vextern
 
 #endif /*LOGSIMED_H*/
 
diff --git a/log/src/logsimh.c b/log/src/logsimh.c
index 64ea5a0..8b0db12 100644
--- a/log/src/logsimh.c
+++ b/log/src/logsimh.c
@@ -35,11 +35,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 */
 
 
-
 #include <p2c/p2c.h>
-
-
-#define LOGSIMH_G
 #include "logsimh.h"
 
 
@@ -62,38 +58,38 @@ typedef enum {
 } optmodes;
 
 typedef struct instinfo {
-  boolean attrchg, okay, wasokay;
+  int attrchg, okay, wasokay;
   struct hdefrec *hdef;
   long hdefstamp, clearstamp, oldnetstamp, numpins, numppins, numpvars;
   log_nrec **pins;
   gateinfo ginfo;
   long recstamp, oldattrstamp;
   short instattr, nameattr, dispattr;
-  Char *wasdrawn;
+  char *wasdrawn;
 } instinfo;
 
 typedef struct controlinfo {
   struct hdefrec *hdef;
   short pgnum;
-  Char message[81], oldmessage[81], message2[81], oldmessage2[81];
-  boolean welcomeflag;
+  char message[81], oldmessage[81], message2[81], oldmessage2[81];
+  int welcomeflag;
   short oldoptcolor, olddumpcolor;
   dumpmodes olddumpmode;
 } controlinfo;
 
 typedef struct pdrec {
-  boolean isinput, isoutput;
+  int isinput, isoutput;
 } pdrec;
 
 typedef pdrec pdarray[log_million];
 
 typedef struct hdefrec {
-  Char *name;
+  char *name;
   struct hdefrec *next;
   short pgnum;
   long oldlabelstamp, oldboxstamp, oldpagestamp, curstamp, clearstamp,
        oldshowstamp;
-  boolean defined_;
+  int defined_;
   log_brec *defbox;
   log_regrec *defreg;
   log_grec *gtempl, *gcontrol;
@@ -104,12 +100,12 @@ typedef struct hdefrec {
   long lastnorth, lasteast, lastsouth, numports;
       /*north<=south<=west<=numports*/
   long numppins, numpvars;
-  boolean wantnote, wantstats;
+  int wantnote, wantstats;
   short optlevel;
-  boolean optflag, nextoptflag, dumphighlight, optdelay;
+  int optflag, nextoptflag, dumphighlight, optdelay;
   dumpmodes dumpmode;
   optmodes optmode;
-  Char *writefile;
+  char *writefile;
 } hdefrec;
 
 typedef struct dependrec {
@@ -147,31 +143,31 @@ typedef struct instrrec {
 typedef log_16_value unarytype[3];
 
 
-static Const unarytype unarynot = {
+static const unarytype unarynot = {
   log_none, log_one, log_zero
 };
 
 
 
-Static long currunstamp;
+static long currunstamp;
 
-Static log_sigrec *vddsig, *gndsig;
-Static long curstamp, currecstamp, viserrorstamp;
-Static na_strlist *viserrors;
-Static long oldcolorstamp, showstamp;
+static log_sigrec *vddsig, *gndsig;
+static long curstamp, currecstamp, viserrorstamp;
+static na_strlist *viserrors;
+static long oldcolorstamp, showstamp;
 
-Static short templatecolor, kindcolor, darkwordcolor;
+static short templatecolor, kindcolor, darkwordcolor;
 
-Static hdefrec *hdefbase;
+static hdefrec *hdefbase;
 
 
 
 
 
 
-Static short findgattr(g, name, kinds, def)
+static short findgattr(g, name, kinds, def)
 log_grec *g;
-Char *name, *kinds;
+char *name, *kinds;
 short def;
 {
   na_strlist *l1;
@@ -193,8 +189,8 @@ short def;
 
 
 
-Static Char *namegattr(Result, g, i)
-Char *Result;
+static char *namegattr(Result, g, i)
+char *Result;
 log_grec *g;
 short i;
 {
@@ -224,7 +220,7 @@ short i;
 
 
 
-Static Void refrcontrol(g, force)
+static void refrcontrol(g, force)
 log_grec *g;
 short force;
 {
@@ -332,9 +328,9 @@ short force;
 #undef messagespc
 
 
-Static Void showcontrol(hdef, msg)
+static void showcontrol(hdef, msg)
 hdefrec *hdef;
-Char *msg;
+char *msg;
 {
   controlinfo *cip;
   long i, j, limit;
@@ -373,11 +369,11 @@ Char *msg;
 
 
 
-Static Void showerrormsg(hdef, msg_)
+static void showerrormsg(hdef, msg_)
 hdefrec *hdef;
-Char *msg_;
+char *msg_;
 {
-  Char msg[256];
+  char msg[256];
   na_strlist *l1;
 
   strcpy(msg, msg_);
@@ -397,12 +393,12 @@ Char *msg_;
 
 
 
-Static Void dasmhdef(f, hdef, incldef)
+static void dasmhdef(f, hdef, incldef)
 FILE *f;
 hdefrec *hdef;
-boolean incldef;
+int incldef;
 {
-  Char *buf;
+  char *buf;
   long pc, indent;
 
   pc = 1;
@@ -430,9 +426,9 @@ boolean incldef;
 
 
 
-Static hdefrec *findhdef(name, make)
-Char *name;
-boolean make;
+static hdefrec *findhdef(name, make)
+char *name;
+int make;
 {
   hdefrec *hdef;
 
@@ -478,7 +474,7 @@ boolean make;
 
 
 
-Static Void grabcontrolattrs(hdef, g)
+static void grabcontrolattrs(hdef, g)
 hdefrec *hdef;
 log_grec *g;
 {
@@ -545,7 +541,7 @@ log_grec *g;
 
 
 
-Static Void storecontrolattrs(hdef, g)
+static void storecontrolattrs(hdef, g)
 hdefrec *hdef;
 log_grec *g;
 {
@@ -629,11 +625,11 @@ log_grec *g;
 
 
 
-Static hdefrec *isinstance(g)
+static hdefrec *isinstance(g)
 log_grec *g;
 {
   long i;
-  Char STR2[12];
+  char STR2[12];
 
   if (g->kind->simtype != logsima_tool_16 || g->kind->proc[0] != '\022' ||
       g->kind->proc[2] != strlen(want) + 128)
@@ -661,7 +657,7 @@ log_grec *g;
 
 
 
-Static Void updateinstance PP((log_grec *g));
+static void updateinstance (log_grec *g);
 
 
 #define setmax          200000L   /*was 8000*/
@@ -671,7 +667,7 @@ Static Void updateinstance PP((log_grec *g));
 typedef struct noderec {
   long poss, nextposs;
   short isused, wasused, isdef, wasdef;
-  boolean alwaysconn, strong, wasstrong, loopflag;
+  int alwaysconn, strong, wasstrong, loopflag;
   instrrec *defn;
   long level;
   short truenum;
@@ -683,12 +679,12 @@ typedef struct trailrec {
   struct trailrec *next;
   long num;
   long oldposs;
-  boolean oldstrong;
+  int oldstrong;
   long oldlevel;
 } trailrec;
 
 
-Static Char *instrops_NAMES[] = {
+static char *instrops_NAMES[] = {
   "OP_IF", "OP_IFNONE", "OP_IFZERO", "OP_IFONE", "OP_IFCONN", "OP_IFZN",
   "OP_PINEQ", "OP_PINOC", "OP_VAREQ", "OP_PULLUP", "OP_PULLDN", "OP_IFTRUE",
   "OP_IFFALSE", "OP_AND", "OP_NAND", "OP_OR", "OP_NOR", "OP_XOR", "OP_SAME",
@@ -709,16 +705,16 @@ typedef struct gaterec {
 typedef gaterec gatearray[log_million];
 
 
-/* Local variables for compilepage: */
+/* variables for compilepage: */
 struct LOC_compilepage {
   hdefrec *hdef;
   long starttime;
   instrrec *ip1, *ipbase;
   log_grec *g, *gtempl, *gcontrol;
   log_nrec *n;
-  boolean okay, truevars, hasstats, isverbose, bigdump;
+  int okay, truevars, hasstats, isverbose, bigdump;
   long optlevel;
-  boolean optdelay;
+  int optdelay;
   long pc, simppasscount, gatecount, subcount, inertcount, forcecount,
        instrcount, oldinstrcount, curppin, curpvar, savecurpvar, baseppin,
        basepvar, numvar, numports, numthings, thingnodes, thingvars;
@@ -727,13 +723,13 @@ struct LOC_compilepage {
   log_brec *mybox;
   uchar *proc;
   log_nrec **gpins;
-  boolean changed;
+  int changed;
 } ;
 
-Local instrrec *parseterm PP((struct LOC_compilepage *LINK));
+instrrec *parseterm (struct LOC_compilepage *LINK);
 
-Local Void error(msg, LINK)
-Char *msg;
+void error(msg, LINK)
+char *msg;
 struct LOC_compilepage *LINK;
 {
   /* if act.lact^.curpage = act.lact^.showpage then */
@@ -741,7 +737,7 @@ struct LOC_compilepage *LINK;
   LINK->okay = false;
 }
 
-Local Void newinstr(ip, LINK)
+void newinstr(ip, LINK)
 instrrec **ip;
 struct LOC_compilepage *LINK;
 {
@@ -753,7 +749,7 @@ struct LOC_compilepage *LINK;
   (*ip)->UU.U1.next = NULL;
 }
 
-Local Void disposetree(ip, LINK)
+void disposetree(ip, LINK)
 instrrec **ip;
 struct LOC_compilepage *LINK;
 {
@@ -766,16 +762,16 @@ struct LOC_compilepage *LINK;
   Free(*ip);
 }
 
-/* Local variables for dumptree: */
+/* variables for dumptree: */
 struct LOC_dumptree {
   struct LOC_compilepage *LINK;
   FILE *f;
   instrrec *iphigh;
-  Char buf[256];
+  char buf[256];
   long i;
 } ;
 
-Local Void dump(ip, indent, LINK)
+void dump(ip, indent, LINK)
 instrrec *ip;
 long indent;
 struct LOC_dumptree *LINK;
@@ -785,7 +781,7 @@ struct LOC_dumptree *LINK;
   while (ip != NULL) {
     if (ip == LINK->iphigh) {
       putc(140, LINK->f);
-/* p2c: logsimh.text, line 707: Note: Character >= 128 encountered [281] */
+/* p2c: logsimh.text, line 707: Note: character >= 128 encountered [281] */
     }
     strcpy(LINK->buf, instrops_NAMES[(long)ip->opcode]);
     LINK->i = strlen(LINK->buf) + 1;
@@ -824,12 +820,12 @@ struct LOC_dumptree *LINK;
     }
     if (ip == LINK->iphigh)
       putc(136, LINK->f);
-/* p2c: logsimh.text, line 746: Note: Character >= 128 encountered [281] */
+/* p2c: logsimh.text, line 746: Note: character >= 128 encountered [281] */
     ip = ip->UU.U1.next;
   }
 }
 
-Local Void dumptree(f_, ip, iphigh_, LINK)
+void dumptree(f_, ip, iphigh_, LINK)
 FILE *f_;
 instrrec *ip, *iphigh_;
 struct LOC_compilepage *LINK;
@@ -843,7 +839,7 @@ struct LOC_compilepage *LINK;
   putc('\n', V.f);
 }
 
-Local Void debugtree(ip, iphigh, LINK)
+void debugtree(ip, iphigh, LINK)
 instrrec *ip, *iphigh;
 struct LOC_compilepage *LINK;
 {
@@ -853,7 +849,7 @@ struct LOC_compilepage *LINK;
 }
 
 
-Local boolean isinert(g, LINK)
+int isinert(g, LINK)
 log_grec *g;
 struct LOC_compilepage *LINK;
 {
@@ -861,25 +857,25 @@ struct LOC_compilepage *LINK;
 	  strlist_find(LINK->inertlist, g->kind->name) != NULL);
 }
 
-/* Local variables for parseterm: */
+/* variables for parseterm: */
 struct LOC_parseterm {
   struct LOC_compilepage *LINK;
   instrrec *ip;
   long ins;
-  boolean done;
+  int done;
 } ;
 
-Local Void badop(LINK)
+void badop(LINK)
 struct LOC_parseterm *LINK;
 {
-  Char STR2[256];
+  char STR2[256];
 
   sprintf(STR2, "%s: bad opcode (%.2lX)",
 	  LINK->LINK->g->kind->name, LINK->ins & 0xff);
   error(STR2, LINK->LINK);
 }
 
-Local instrrec *parsepin(LINK)
+instrrec *parsepin(LINK)
 struct LOC_parseterm *LINK;
 {
   instrrec *ip;
@@ -892,13 +888,13 @@ struct LOC_parseterm *LINK;
   return ip;
 }
 
-Local long getpnum(LINK)
+long getpnum(LINK)
 struct LOC_parseterm *LINK;
 {
   long Result;
 
   if (LINK->LINK->proc[LINK->LINK->pc - 1] < 128) {
-/* p2c: logsimh.text, line 802: Note: Character >= 128 encountered [281] */
+/* p2c: logsimh.text, line 802: Note: character >= 128 encountered [281] */
     Result = LINK->LINK->proc[LINK->LINK->pc - 1] - 64;
     LINK->LINK->pc++;
   } else {
@@ -909,14 +905,14 @@ struct LOC_parseterm *LINK;
   return Result;
 }
 
-Local long findpin(i, LINK)
+long findpin(i, LINK)
 long i;
 struct LOC_parseterm *LINK;
 {
   return ((long)LINK->LINK->gpins[i - 1]->temp);
 }
 
-Local long findvar(i, LINK)
+long findvar(i, LINK)
 long i;
 struct LOC_parseterm *LINK;
 {
@@ -928,12 +924,12 @@ struct LOC_parseterm *LINK;
   return Result;
 }
 
-Local Void checkcomment(LINK)
+void checkcomment(LINK)
 struct LOC_parseterm *LINK;
 {
-  Char s[256];
+  char s[256];
   long i, FORLIM;
-  Char STR1[256], STR2[256];
+  char STR1[256], STR2[256];
 
   s[LINK->LINK->proc[LINK->LINK->pc - 1] - 32] = '\0';
   FORLIM = strlen(s);
@@ -954,14 +950,14 @@ struct LOC_parseterm *LINK;
 
 /* Parse a GDL definition into a tree */
 
-Local instrrec *parseterm(LINK)
+instrrec *parseterm(LINK)
 struct LOC_compilepage *LINK;
 {
   struct LOC_parseterm V;
   instrrec *ip1, **ipp;
   long i;
   na_long tempvars;
-  Char STR1[54];
+  char STR1[54];
 
   V.LINK = LINK;
   newinstr(&V.ip, LINK);
@@ -1075,7 +1071,7 @@ struct LOC_compilepage *LINK;
 	    V.ip->opcode = op_iftrue;
 	    ipp = &V.ip->UU.U1.arg2;
 	    for (i = 0; i <= 15; i++) {   /*ord('P') - i*/
-	      if (strposc(logsima_action.lact->actstr, (Char)(i + 'A'), 1L) !=
+	      if (strposc(logsima_action.lact->actstr, (char)(i + 'A'), 1L) !=
 		  0) {
 		LINK->oldinstrcount++;
 		newinstr(ipp, LINK);
@@ -1365,7 +1361,7 @@ struct LOC_compilepage *LINK;
 
 
 /* Find out which pins are inputs and which are outputs */
-Local Void getpindata(pindata, numpins, proc, LINK)
+void getpindata(pindata, numpins, proc, LINK)
 pdrec **pindata;
 long numpins;
 uchar *proc;
@@ -1401,12 +1397,12 @@ struct LOC_compilepage *LINK;
     case 29:   /*pull-up or pull-down*/
       pc++;
       if (proc[pc - 1] == 176) {
-/* p2c: logsimh.text, line 1244: Note: Character >= 128 encountered [281] */
+/* p2c: logsimh.text, line 1244: Note: character >= 128 encountered [281] */
 	(*pindata)[proc[pc]].isoutput = true;
 	pc += 2;
       } else if (proc[pc - 1] >= 192 && proc[pc - 1] <= 223) {
-/* p2c: logsimh.text, line 1249: Note: Character >= 128 encountered [281] */
-/* p2c: logsimh.text, line 1249: Note: Character >= 128 encountered [281] */
+/* p2c: logsimh.text, line 1249: Note: character >= 128 encountered [281] */
+/* p2c: logsimh.text, line 1249: Note: character >= 128 encountered [281] */
 	(*pindata)[proc[pc - 1] & 31].isoutput = true;
 	pc++;
       }
@@ -1421,7 +1417,7 @@ struct LOC_compilepage *LINK;
     case 171:
     case 172:
       pc += (proc[pc] >= 128) + 2;
-/* p2c: logsimh.text, line 1256: Note: Character >= 128 encountered [281] */
+/* p2c: logsimh.text, line 1256: Note: character >= 128 encountered [281] */
       break;
 
     case 18:
@@ -1448,19 +1444,19 @@ struct LOC_compilepage *LINK;
 }
 
 
-Local long setbytes(bits, LINK)
+long setbytes(bits, LINK)
 long bits;
 struct LOC_compilepage *LINK;
 {
   return ((bits + 63) / 32 * 4);
 }
 
-/* Local variables for parsegates: */
+/* variables for parsegates: */
 struct LOC_parsegates {
   struct LOC_compilepage *LINK;
 } ;
 
-Local Void subupdate(g1, LINK)
+void subupdate(g1, LINK)
 log_grec *g1;
 struct LOC_parsegates *LINK;
 {
@@ -1490,7 +1486,7 @@ struct LOC_parsegates *LINK;
 }
 
 
-Local Void parsegates(LINK)
+void parsegates(LINK)
 struct LOC_compilepage *LINK;
 {
   struct LOC_parsegates V;
@@ -1502,9 +1498,9 @@ struct LOC_compilepage *LINK;
   dependrec *dep;
   instrrec *ip, **ipp;
   log_16_kindinfo *ki;
-  boolean any;
+  int any;
   gaterec *WITH;
-  Char STR2[256];
+  char STR2[256];
   long FORLIM, FORLIM1;
   long SET[257];
   long SET1[257];
@@ -1643,7 +1639,7 @@ struct LOC_compilepage *LINK;
 	if (i == first)
 	  i++;
 	else
-	  na_exch((Anyptr)(&glist[i - 1]), (Anyptr)(&glist[first - 1]),
+	  na_exch((void *)(&glist[i - 1]), (void *)(&glist[first - 1]),
 		  sizeof(gaterec));
 	P_setunion(defs, defs, glist[first - 1].outs);
 	first++;
@@ -1660,7 +1656,7 @@ struct LOC_compilepage *LINK;
 	  j = i;
 	}
       }
-      na_exch((Anyptr)(&glist[j - 1]), (Anyptr)(&glist[first - 1]),
+      na_exch((void *)(&glist[j - 1]), (void *)(&glist[first - 1]),
 	      sizeof(gaterec));
       P_setunion(defs, defs, glist[first - 1].outs);
       first++;
@@ -1730,11 +1726,11 @@ struct LOC_compilepage *LINK;
 
 /* Simplify a procedure tree */
 
-Local boolean checkconn(ip, LINK)
+int checkconn(ip, LINK)
 instrrec *ip;
 struct LOC_compilepage *LINK;
 {
-  boolean Result;
+  int Result;
 
   switch (ip->opcode) {
 
@@ -1773,7 +1769,7 @@ struct LOC_compilepage *LINK;
   return Result;
 }
 
-Local boolean cmptrees(ip1, ip2, LINK)
+int cmptrees(ip1, ip2, LINK)
 instrrec *ip1, *ip2;
 struct LOC_compilepage *LINK;
 {
@@ -1801,7 +1797,7 @@ struct LOC_compilepage *LINK;
     return true;
 }
 
-Local boolean treecontains(ip1, ip2, LINK)
+int treecontains(ip1, ip2, LINK)
 instrrec *ip1, *ip2;
 struct LOC_compilepage *LINK;
 {
@@ -1814,12 +1810,12 @@ struct LOC_compilepage *LINK;
 	    treecontains(ip1->UU.U1.arg3, ip2, LINK));
 }
 
-Local boolean treerefers(ip, num, LINK)
+int treerefers(ip, num, LINK)
 instrrec *ip;
 long num;
 struct LOC_compilepage *LINK;
 {
-  boolean Result;
+  int Result;
 
   if (ip == NULL)
     return false;
@@ -1867,13 +1863,13 @@ $end$*/
   return Result;
 }
 
-Local boolean cyclicdefn(ip, num, inside, LINK)
+int cyclicdefn(ip, num, inside, LINK)
 instrrec *ip;
 long num;
-boolean inside;
+int inside;
 struct LOC_compilepage *LINK;
 {
-  boolean Result;
+  int Result;
   noderec *WITH;
 
   if (ip == NULL)
@@ -1906,7 +1902,7 @@ struct LOC_compilepage *LINK;
   return Result;
 }
 
-Local Void swapinstrs(ip1, ip2, LINK)
+void swapinstrs(ip1, ip2, LINK)
 instrrec **ip1, **ip2;
 struct LOC_compilepage *LINK;
 {
@@ -1918,7 +1914,7 @@ struct LOC_compilepage *LINK;
   LINK->changed = true;
 }
 
-Local instrrec *makeinstr0(code, LINK)
+instrrec *makeinstr0(code, LINK)
 instrops code;
 struct LOC_compilepage *LINK;
 {
@@ -1934,7 +1930,7 @@ struct LOC_compilepage *LINK;
   return ip;
 }
 
-Local instrrec *makeinstr1(code, a1, LINK)
+instrrec *makeinstr1(code, a1, LINK)
 instrops code;
 instrrec *a1;
 struct LOC_compilepage *LINK;
@@ -1951,7 +1947,7 @@ struct LOC_compilepage *LINK;
   return ip;
 }
 
-Local instrrec *makeinstr2(code, a1, a2, LINK)
+instrrec *makeinstr2(code, a1, a2, LINK)
 instrops code;
 instrrec *a1, *a2;
 struct LOC_compilepage *LINK;
@@ -1968,7 +1964,7 @@ struct LOC_compilepage *LINK;
   return ip;
 }
 
-Local instrrec *makeinstr3(code, a1, a2, a3, LINK)
+instrrec *makeinstr3(code, a1, a2, a3, LINK)
 instrops code;
 instrrec *a1, *a2, *a3;
 struct LOC_compilepage *LINK;
@@ -1985,21 +1981,21 @@ struct LOC_compilepage *LINK;
   return ip;
 }
 
-Local instrrec *makefix0(arg, LINK)
+instrrec *makefix0(arg, LINK)
 instrrec *arg;
 struct LOC_compilepage *LINK;
 {
   return (makeinstr1(op_fix0, arg, LINK));
 }
 
-Local instrrec *makefix1(arg, LINK)
+instrrec *makefix1(arg, LINK)
 instrrec *arg;
 struct LOC_compilepage *LINK;
 {
   return (makeinstr1(op_fix1, arg, LINK));
 }
 
-Local instrrec *copytree(ip, LINK)
+instrrec *copytree(ip, LINK)
 instrrec *ip;
 struct LOC_compilepage *LINK;
 {
@@ -2035,7 +2031,7 @@ struct LOC_compilepage *LINK;
   return Result;
 }
 
-Local Void replacetree(ip, ip2, LINK)
+void replacetree(ip, ip2, LINK)
 instrrec **ip, *ip2;
 struct LOC_compilepage *LINK;
 {
@@ -2044,7 +2040,7 @@ struct LOC_compilepage *LINK;
   LINK->changed = true;
 }
 
-Local Void chgop(ip, opc, LINK)
+void chgop(ip, opc, LINK)
 instrrec *ip;
 instrops opc;
 struct LOC_compilepage *LINK;
@@ -2055,7 +2051,7 @@ struct LOC_compilepage *LINK;
   }
 }
 
-Local Void killstmt(ip, LINK)
+void killstmt(ip, LINK)
 instrrec *ip;
 struct LOC_compilepage *LINK;
 {
@@ -2067,7 +2063,7 @@ struct LOC_compilepage *LINK;
 }
 
 /* Change in "goodness" if we did makenot(arg) */
-Local long invertable(arg, LINK)
+long invertable(arg, LINK)
 instrrec *arg;
 struct LOC_compilepage *LINK;
 {
@@ -2111,7 +2107,7 @@ struct LOC_compilepage *LINK;
   return Result;
 }
 
-Local instrrec *makenot(arg, LINK)
+instrrec *makenot(arg, LINK)
 instrrec *arg;
 struct LOC_compilepage *LINK;
 {
@@ -2143,7 +2139,7 @@ struct LOC_compilepage *LINK;
   return Result;
 }
 
-Local long exprcost(ip, LINK)
+long exprcost(ip, LINK)
 instrrec *ip;
 struct LOC_compilepage *LINK;
 {
@@ -2164,7 +2160,7 @@ struct LOC_compilepage *LINK;
   return Result;
 }
 
-Local long expansioncost(ip, LINK)
+long expansioncost(ip, LINK)
 instrrec *ip;
 struct LOC_compilepage *LINK;
 {
@@ -2195,17 +2191,17 @@ struct LOC_compilepage *LINK;
   return Result;
 }
 
-/* Local variables for simplify: */
+/* variables for simplify: */
 struct LOC_simplify {
   struct LOC_compilepage *LINK;
   long simplevel;
   trailrec *tbase;
 } ;
 
-Local Void chgposs2(i, newposs, newstrong, LINK)
+void chgposs2(i, newposs, newstrong, LINK)
 long i;
 long newposs;
-boolean newstrong;
+int newstrong;
 struct LOC_simplify *LINK;
 {
   trailrec *t, **tp;
@@ -2231,7 +2227,7 @@ struct LOC_simplify *LINK;
   WITH->strong = newstrong;
 }
 
-Local Void chgposs(i, newposs, LINK)
+void chgposs(i, newposs, LINK)
 long i;
 long newposs;
 struct LOC_simplify *LINK;
@@ -2239,7 +2235,7 @@ struct LOC_simplify *LINK;
   chgposs2(i, newposs, LINK->LINK->things[i].strong, LINK);
 }
 
-Local Void arith(ip, ident, LINK)
+void arith(ip, ident, LINK)
 instrrec **ip;
 instrops ident;
 struct LOC_simplify *LINK;
@@ -2251,12 +2247,12 @@ struct LOC_simplify *LINK;
 
 }
 
-Local Void simplexpr(ip, nonelike, LINK)
+void simplexpr(ip, nonelike, LINK)
 instrrec **ip;
 log_16_value nonelike;
 struct LOC_simplify *LINK;
 {
-  boolean oldch;
+  int oldch;
   long i;
   noderec *WITH;
 
@@ -2656,13 +2652,13 @@ struct LOC_simplify *LINK;
   LINK->LINK->changed = oldch;
 }
 
-/* Local variables for simplstmt: */
+/* variables for simplstmt: */
 struct LOC_simplstmt {
   struct LOC_simplify *LINK;
   instrrec **ipbase, *ip, **ipp;
 } ;
 
-Local long iftonumber(ip, LINK)
+long iftonumber(ip, LINK)
 instrrec *ip;
 struct LOC_simplstmt *LINK;
 {
@@ -2708,7 +2704,7 @@ struct LOC_simplstmt *LINK;
   return Result;
 }
 
-Local instrops numbertoif(i, LINK)
+instrops numbertoif(i, LINK)
 long i;
 struct LOC_simplstmt *LINK;
 {
@@ -2751,16 +2747,16 @@ struct LOC_simplstmt *LINK;
   return Result;
 }
 
-Local Void untrail(tp, LINK)
+void untrail(tp, LINK)
 trailrec *tp;
 struct LOC_simplstmt *LINK;
 {
-  boolean tflag;
+  int tflag;
   noderec *WITH;
 
   while (tp != NULL) {
     WITH = &LINK->LINK->LINK->things[tp->num];
-    na_exch((Anyptr)(&WITH->poss), (Anyptr)(&tp->oldposs), sizeof(long));
+    na_exch((void *)(&WITH->poss), (void *)(&tp->oldposs), sizeof(long));
     tflag = WITH->strong;
     WITH->strong = tp->oldstrong;
     tp->oldstrong = tflag;
@@ -2770,7 +2766,7 @@ struct LOC_simplstmt *LINK;
   }
 }
 
-Local Void eattrail(tb, LINK)
+void eattrail(tb, LINK)
 trailrec **tb;
 struct LOC_simplstmt *LINK;
 {
@@ -2782,7 +2778,7 @@ struct LOC_simplstmt *LINK;
 }
 
 /* Append list ip2 to end of list ip */
-Local Void appendlist(ip, ip2, LINK)
+void appendlist(ip, ip2, LINK)
 instrrec **ip, *ip2;
 struct LOC_simplstmt *LINK;
 {
@@ -2801,7 +2797,7 @@ struct LOC_simplstmt *LINK;
 }
 
 /* Insert list ip2 at front of list ip */
-Local Void insertlist(ip, ip2, LINK)
+void insertlist(ip, ip2, LINK)
 instrrec **ip, *ip2;
 struct LOC_simplstmt *LINK;
 {
@@ -2816,7 +2812,7 @@ struct LOC_simplstmt *LINK;
   *ip = ip2;
 }
 
-Local Void cleanpineq(ip, ival, LINK)
+void cleanpineq(ip, ival, LINK)
 instrrec *ip;
 long ival;
 struct LOC_simplstmt *LINK;
@@ -2828,7 +2824,7 @@ struct LOC_simplstmt *LINK;
   }
 }
 
-Local Void builddefvusev(ip, defv, usev, LINK)
+void builddefvusev(ip, defv, usev, LINK)
 instrrec *ip;
 long *defv, *usev;
 struct LOC_simplstmt *LINK;
@@ -2860,10 +2856,10 @@ struct LOC_simplstmt *LINK;
   }
 }
 
-Local Void checkdefvusev(ip, defv, usev, good, LINK)
+void checkdefvusev(ip, defv, usev, good, LINK)
 instrrec *ip;
 long *defv, *usev;
-boolean *good;
+int *good;
 struct LOC_simplstmt *LINK;
 {
   instrrec *ip2;
@@ -2896,12 +2892,12 @@ struct LOC_simplstmt *LINK;
 }
 
 /*try to combine two "if x"'s into one*/
-Local Void trymoveif(LINK)
+void trymoveif(LINK)
 struct LOC_simplstmt *LINK;
 {
   instrrec *ip2, *ip3, **ipp2;
   long *defv1, *usev1, *defv2, *usev2;
-  boolean good1, good2, localchg;
+  int good1, good2, localchg;
   instrops otherif;
   long i;
 
@@ -2975,7 +2971,7 @@ struct LOC_simplstmt *LINK;
 }
 
 /*try to factor common statements out of "if" and "else" branches*/
-Local Void tryfactorif(LINK)
+void tryfactorif(LINK)
 struct LOC_simplstmt *LINK;
 {
   instrrec *ip2, *ip3, *ip4;
@@ -2999,12 +2995,12 @@ struct LOC_simplstmt *LINK;
   killstmt(ip3, LINK->LINK->LINK);
 }
 
-Local Void simplstmt(ipbase_, LINK)
+void simplstmt(ipbase_, LINK)
 instrrec **ipbase_;
 struct LOC_simplify *LINK;
 {
   struct LOC_simplstmt V;
-  boolean oldch;
+  int oldch;
   instrrec *ip1;
   trailrec *oldtrail, *thentrail, *elsetrail;
   long num, ifnum;
@@ -3444,12 +3440,12 @@ struct LOC_simplify *LINK;
   /*both parts*/
 }
 
-Local Void simplify(ipbase, LINK)
+void simplify(ipbase, LINK)
 instrrec **ipbase;
 struct LOC_compilepage *LINK;
 {
   struct LOC_simplify V;
-  Char STR2[256];
+  char STR2[256];
 
   V.LINK = LINK;
   LINK->simppasscount++;
@@ -3464,7 +3460,7 @@ struct LOC_compilepage *LINK;
 
 
 /* Scan to find usage of variables and nodes */
-Local Void scan(ip, scanlevel, LINK)
+void scan(ip, scanlevel, LINK)
 instrrec *ip;
 long scanlevel;
 struct LOC_compilepage *LINK;
@@ -3548,7 +3544,7 @@ struct LOC_compilepage *LINK;
 
 /* Assign optimal variable names; also assign internal node numbers */
 /* Concentrates most often-used variables in the faster A through P */
-Local Void assignvars(LINK)
+void assignvars(LINK)
 struct LOC_compilepage *LINK;
 {
   long i, max, done, FORLIM;
@@ -3597,7 +3593,7 @@ struct LOC_compilepage *LINK;
 
 /* Clean up node and variable numbers */
 
-Local Void clean(ip, LINK)
+void clean(ip, LINK)
 instrrec *ip;
 struct LOC_compilepage *LINK;
 {
@@ -3638,25 +3634,25 @@ struct LOC_compilepage *LINK;
   }
 }
 
-/* Local variables for codegen: */
+/* variables for codegen: */
 struct LOC_codegen {
   struct LOC_compilepage *LINK;
-  boolean genflag;
+  int genflag;
   uchar *proc;
 } ;
 
-Local Void store(b, LINK)
+void store(b, LINK)
 long b;
 struct LOC_codegen *LINK;
 {
   LINK->LINK->pc++;
   if (LINK->genflag)
-    LINK->proc[LINK->LINK->pc - 1] = (Char)b;
+    LINK->proc[LINK->LINK->pc - 1] = (char)b;
 }
 
-Local Void storepnum(i, twobytes, LINK)
+void storepnum(i, twobytes, LINK)
 long i;
-boolean twobytes;
+int twobytes;
 struct LOC_codegen *LINK;
 {
   if (i >= 64) {
@@ -3669,11 +3665,11 @@ struct LOC_codegen *LINK;
     store(32L, LINK);
 }
 
-Local Void genlist(ip, LINK)
+void genlist(ip, LINK)
 instrrec *ip;
 struct LOC_codegen *LINK;
 {
-  Char STR2[256];
+  char STR2[256];
 
   while (ip != NULL) {
     switch (ip->opcode) {
@@ -3917,8 +3913,8 @@ struct LOC_codegen *LINK;
 
 /* Generate a GDL definition from a tree */
 
-Local Void codegen(genflag_, LINK)
-boolean genflag_;
+void codegen(genflag_, LINK)
+int genflag_;
 struct LOC_compilepage *LINK;
 {
   struct LOC_codegen V;
@@ -3948,12 +3944,12 @@ struct LOC_compilepage *LINK;
 }  /*codegen*/
 
 
-Local Void writestats(f, pref, LINK)
+void writestats(f, pref, LINK)
 FILE *f;
-Char *pref;
+char *pref;
 struct LOC_compilepage *LINK;
 {
-  Char STR2[256];
+  char STR2[256];
 
   fprintf(f, "%sDump of %s on %s by %s\n",
 	  pref, LINK->hdef->name, strdate(STR2, "$X"), cuserid(NULL));
@@ -3982,7 +3978,7 @@ struct LOC_compilepage *LINK;
     if (LINK->curpvar > 17)
       fprintf(f, "-V%ld", LINK->curpvar - 17);
   } else if (LINK->curpvar > 1)
-    fprintf(f, "A-%c", (Char)(LINK->curpvar + 64));
+    fprintf(f, "A-%c", (char)(LINK->curpvar + 64));
   else if (LINK->curpvar == 1)
     putc('A', f);
   else
@@ -3999,12 +3995,12 @@ struct LOC_compilepage *LINK;
 }
 
 
-Local Void dodump(LINK)
+void dodump(LINK)
 struct LOC_compilepage *LINK;
 {
   FILE *f;
-  Char buf[256];
-  Char STR2[256];
+  char buf[256];
+  char STR2[256];
 
   f = NULL;
   sprintf(buf, "/spool/apple.text/dig%ld", ma_rand2(1000L, 9999L));
@@ -4031,13 +4027,13 @@ struct LOC_compilepage *LINK;
 }
 
 
-Local Void dowritefile(fn_, LINK)
-Char *fn_;
+void dowritefile(fn_, LINK)
+char *fn_;
 struct LOC_compilepage *LINK;
 {
-  Char fn[256];
+  char fn[256];
   FILE *f;
-  Char STR1[256];
+  char STR1[256];
 
   strcpy(fn, fn_);
   f = NULL;
@@ -4062,13 +4058,13 @@ struct LOC_compilepage *LINK;
 }
 
 
-Local Void showstats(LINK)
+void showstats(LINK)
 struct LOC_compilepage *LINK;
 {
-  Char buf[256];
+  char buf[256];
   log_action *WITH;
-  Char STR1[256];
-  Char STR2[256];
+  char STR1[256];
+  char STR2[256];
 
   WITH = logsima_action.lact;
   sprintf(buf, "Compilation of %s took %s seconds",
@@ -4098,25 +4094,25 @@ struct LOC_compilepage *LINK;
    It works by converting each GDL procedure into tree form, combining the
    trees, simplifying, then converting the resulting tree back into GDL. */
 
-Static Void compilepage(hdef_)
+static void compilepage(hdef_)
 hdefrec *hdef_;
 {
   struct LOC_compilepage V;
   controlinfo *cip;
-  boolean wantstats, dumpflag;
-  Char writefile[256];
+  int wantstats, dumpflag;
+  char writefile[256];
   long i, extrarpt;
   log_nrec **templs;
   short *pnumlist;
   na_strlist *l1;
   dependrec *dep;
   log_lrec *lp;
-  Char buf[256], wrd[256];
+  char buf[256], wrd[256];
   log_sigrec *sig;
   log_action *WITH;
-  Char STR1[256];
-  Char STR2[256];
-  Char STR3[256];
+  char STR1[256];
+  char STR2[256];
+  char STR3[256];
   long FORLIM;
   noderec *WITH1;
 
@@ -4535,20 +4531,20 @@ hdefrec *hdef_;
 
 /* Make sure hdef's compiled information is up-to-date */
 
-Static Void updatehdef(hdef)
+static void updatehdef(hdef)
 hdefrec *hdef;
 {
-  Char buf[256], wrd[256];
+  char buf[256], wrd[256];
   long i, j, newstamp;
   dependrec *dep;
   log_lrec *lp, *mylabel;
   log_brec *mybox;
-  boolean chglabels, wasdefined;
+  int chglabels, wasdefined;
   log_grec *g1;
   instinfo *ii1;
   log_action *WITH;
   long FORLIM;
-  Char STR1[256], STR2[256];
+  char STR1[256], STR2[256];
 
   WITH = logsima_action.lact;
   chglabels = (WITH->labelstamp != hdef->oldlabelstamp ||
@@ -4642,8 +4638,8 @@ hdefrec *hdef;
 
 /* Reallocate if necessary a gate's ports, internal nodes, and internal variables */
 
-Static Char *instname(Result, g)
-Char *Result;
+static char *instname(Result, g)
+char *Result;
 log_grec *g;
 {
   short i;
@@ -4658,9 +4654,9 @@ log_grec *g;
 }
 
 
-Static Void reallocgate(g, clearit)
+static void reallocgate(g, clearit)
 log_grec *g;
-boolean clearit;
+int clearit;
 {
   instinfo *ii;
   hdefrec *hdef;
@@ -4668,8 +4664,8 @@ boolean clearit;
   log_nrec **newpins;
   log_action *WITH;
   long FORLIM;
-  Char STR1[256];
-  Char STR4[256];
+  char STR1[256];
+  char STR4[256];
 
   WITH = logsima_action.lact;
   ii = (instinfo *)g->info;
@@ -4702,14 +4698,14 @@ boolean clearit;
     if (ii->numpvars > 0)
       Free(ii->ginfo.pvars);
     if (hdef->numpvars > 0) {
-      ii->ginfo.pvars = (Char *)Malloc(hdef->numpvars);
+      ii->ginfo.pvars = (char *)Malloc(hdef->numpvars);
       clearit = true;
     }
     ii->numpvars = hdef->numpvars;
     g->vars = (na_long)0;   /*just to be consistent*/
   }
   if (clearit && hdef->numpvars > 0)
-    memset((Anyptr)ii->ginfo.pvars, 0, hdef->numpvars);
+    memset((void *)ii->ginfo.pvars, 0, hdef->numpvars);
   if (hdef->gtempl == NULL) {  /*defined by port list*/
     if (ii->numpins > 0)
       Free(ii->pins);
@@ -4736,19 +4732,19 @@ boolean clearit;
 }
 
 
-/* Local variables for reconnectgate: */
+/* variables for reconnectgate: */
 struct LOC_reconnectgate {
   log_grec *g;
   instinfo *ii;
   long lastwest;
 } ;
 
-Local Void check(dir, conn, port, LINK)
-Char *dir;
+void check(dir, conn, port, LINK)
+char *dir;
 long conn, port;
 struct LOC_reconnectgate *LINK;
 {
-  Char buf[256], STR1[256];
+  char buf[256], STR1[256];
 
   if (conn == port)
     return;
@@ -4772,7 +4768,7 @@ struct LOC_reconnectgate *LINK;
 
 /* Reconnect a gate's ports to its pins */
 
-Static Void reconnectgate(g_)
+static void reconnectgate(g_)
 log_grec *g_;
 {
   struct LOC_reconnectgate V;
@@ -4805,15 +4801,15 @@ log_grec *g_;
 
 /* Make sure an instance gate is up-to-date */
 
-Static Void updateinstance(g)
+static void updateinstance(g)
 log_grec *g;
 {
   instinfo *ii;
   hdefrec *hdef;
   long i;
   log_action *WITH;
-  Char STR2[12];
-  Char STR3[38];
+  char STR2[12];
+  char STR3[38];
 
   WITH = logsima_action.lact;
   ii = (instinfo *)g->info;
@@ -4871,7 +4867,7 @@ log_grec *g;
 
 
 
-Static Void initcolors_h()
+static void initcolors_h()
 {
   log_action *WITH;
 
@@ -4889,7 +4885,7 @@ Static Void initcolors_h()
 
 
 
-Static Void showinstpins(g)
+static void showinstpins(g)
 log_grec *g;
 {
   instinfo *ii;
@@ -4898,7 +4894,7 @@ log_grec *g;
   short *pnum;
   long lastnorth, lasteast, lastsouth, numports;
   short FORLIM;
-  Char STR1[256];
+  char STR1[256];
 
   k = g->kind;
   ii = (instinfo *)g->info;
@@ -4925,25 +4921,25 @@ log_grec *g;
 
 
 
-Void Log_16_inst(act)
+void Log_16_inst(act)
 log_16_action *act;
 {
   log_grec *curgate;
   instinfo *ii, *ii2;
   long i, j;
   short drawx, drawy;
-  boolean drawflag, attr2;
-  Char attr1[256];
+  int drawflag, attr2;
+  char attr1[256];
   hdefrec *hdef;
   na_strlist *sl1;
   log_action *WITH;
   log_grec *WITH1;
   log_gattrrec *WITH2;
-  Char STR1[256];
-  Char STR2[256];
+  char STR1[256];
+  char STR2[256];
   long FORLIM;
   log_nrec *WITH3;
-  Char STR3[256];
+  char STR3[256];
 
   WITH = act->lact;
   WITH1 = WITH->actgate;
@@ -4986,14 +4982,14 @@ log_16_action *act;
       ii2 = (instinfo *)WITH->actgate2->info;
       ii->numpvars = ii2->numpvars;
       if (ii->numpvars > 0) {
-	ii->ginfo.pvars = (Char *)Malloc(ii->numpvars);
-	memmove((Anyptr)ii->ginfo.pvars, (Anyptr)ii2->ginfo.pvars,
+	ii->ginfo.pvars = (char *)Malloc(ii->numpvars);
+	memmove((void *)ii->ginfo.pvars, (void *)ii2->ginfo.pvars,
 		ii->numpvars);
       }
     } else
       ii->numpvars = 0;
     ii->recstamp = 0;
-    WITH1->info = (Anyptr)ii;
+    WITH1->info = (void *)ii;
     initcolors_h();
     break;
 
@@ -5184,22 +5180,22 @@ log_16_action *act;
 
 
 
-Void Log_dig_inst(act)
+void Log_dig_inst(act)
 log_16_action *act;
 {
   Log_16_inst(act);
 }
 
 
-Void Log_16_digh(act)
+void Log_16_digh(act)
 log_16_action *act;
 {
   controlinfo *cip;
-  Char aname[256];
+  char aname[256];
   log_action *WITH;
   log_grec *WITH1;
   log_gattrrec *WITH2;
-  Char STR1[256];
+  char STR1[256];
 
   WITH = act->lact;
   WITH1 = WITH->actgate;
@@ -5212,7 +5208,7 @@ log_16_action *act;
   case act_16_new:
   case act_16_copy:
     cip = (controlinfo *)Malloc(sizeof(controlinfo));
-    WITH1->info = (Anyptr)cip;
+    WITH1->info = (void *)cip;
     cip->hdef = NULL;
     cip->pgnum = -99;
     *cip->message = '\0';
diff --git a/log/src/logsimh.h b/log/src/logsimh.h
index 4905344..cef3900 100644
--- a/log/src/logsimh.h
+++ b/log/src/logsimh.h
@@ -1,66 +1,22 @@
-/* Header for module logsimh, generated by p2c */
 #ifndef LOGSIMH_H
 #define LOGSIMH_H
 
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef LOGHIER_H
 #include "loghier.h"
-#endif
-
-
-#ifndef LOGDIG_H
 #include "logdig.h"
-#endif
-
-#ifndef LOGSIMA_H
 #include "logsima.h"
-#endif
-
-
-#ifndef LOGSIMED_H
 #include "logsimed.h"
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef MATH_H
-#include <p2c/math.h>
-#endif
-
-#ifndef CITINFOMOD_H
 #include <p2c/citinfomod.h>
-#endif
-
-
-#ifdef LOGSIMH_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-extern Void Log_16_inst PP((log_16_action *act));
-extern Void Log_dig_inst PP((log_16_action *act));
 
+extern void Log_16_inst (log_16_action *act);
+extern void Log_dig_inst (log_16_action *act);
 
-extern Void Log_16_digh PP((log_16_action *act));
 
+extern void Log_16_digh (log_16_action *act);
 
-#undef vextern
 
 #endif /*LOGSIMH_H*/
 
diff --git a/log/src/logspc.c b/log/src/logspc.c
index 8768368..544cd3b 100644
--- a/log/src/logspc.c
+++ b/log/src/logspc.c
@@ -133,8 +133,6 @@ char	pre_file[256] = "", post_file[256] = ""; /* for #include-esque stuff */
 
 
 #include <p2c/p2c.h>
-
-#define LOGSPC_G
 #include "logspc.h"
 
 extern double AnaVdd;
@@ -150,15 +148,15 @@ typedef enum {
 } topnesskind;
 
 typedef struct transrec {
-  Char name[82];
-  Char kind;
+  char name[82];
+  char kind;
   signed char strength;
   struct transrec *next;
 } transrec;
 
 typedef struct cellrec {
-  Char name[82], cname[82];
-  Char fname[256];
+  char name[82], cname[82];
+  char fname[256];
   na_strlist *port;
   long ccount;
   unsigned loaded : 1, complain1 : 1;
@@ -166,36 +164,36 @@ typedef struct cellrec {
 } cellrec;
 
 typedef struct primrec {
-  Char name[82], cname[82];
+  char name[82], cname[82];
   long ccount;
   struct primrec *next;
 } primrec;
 
 
-Static transrec *transbase, *savetransbase;
-Static cellrec *cellbase, *savecellbase;
-Static primrec *primbase, *saveprimbase;
-Static na_strlist *filebase, *filecellbase;
-Static boolean autotop, maincell;
-Static long default_size, default_strength;
-Static na_strlist *saveglobals, *saveorphans, *saveignored, *saveprims,
+static transrec *transbase, *savetransbase;
+static cellrec *cellbase, *savecellbase;
+static primrec *primbase, *saveprimbase;
+static na_strlist *filebase, *filecellbase;
+static int autotop, maincell;
+static long default_size, default_strength;
+static na_strlist *saveglobals, *saveorphans, *saveignored, *saveprims,
 		  *savetrans, *savelibdirs, *ports, *globals, *orphans,
 		  *ignored, *prims, *trans, *libdirs, *notfoundlist,
 		  *wignlist;
-Static log_grec *gtempl;
-Static log_brec *mybox;
-Static topnesskind topness, savetopness;
-Static boolean john_L_mode, savejohn;
-Static short identifycolor, nodecount;
-Static Char *filename, *cellname;
-Static Char nodeprefix[11];
+static log_grec *gtempl;
+static log_brec *mybox;
+static topnesskind topness, savetopness;
+static int john_L_mode, savejohn;
+static short identifycolor, nodecount;
+static char *filename, *cellname;
+static char nodeprefix[11];
 
 
-Static na_strlist *strlist_find_r(l1, wrd_)
+static na_strlist *strlist_find_r(l1, wrd_)
 na_strlist *l1;
-Char *wrd_;
+char *wrd_;
 {
-  Char wrd[256];
+  char wrd[256];
 
   strcpy(wrd, wrd_);
   while (l1 != NULL && !re_compare(wrd, l1->s))
@@ -204,13 +202,13 @@ Char *wrd_;
 }
 
 
-Static boolean tryreset(f, fn)
+static int tryreset(f, fn)
 FILE **f;
-Char *fn;
+char *fn;
 {
   na_strlist *l1;
-  Char buf[256];
-  boolean found;
+  char buf[256];
+  int found;
 
   if (strlist_find(notfoundlist, fn) != NULL) {
     found = false;
@@ -245,19 +243,19 @@ Char *fn;
 }
 
 
-/* Local variables for Log_logspc_proc: */
+/* variables for Log_logspc_proc: */
 struct LOC_Log_logspc_proc {
   log_action *act;
-  boolean errflag;
+  int errflag;
 } ;
 
 
-Local Void message(s_, LINK)
-Char *s_;
+void message(s_, LINK)
+char *s_;
 struct LOC_Log_logspc_proc *LINK;
 {
-  Char s[256];
-  Char STR1[256];
+  char s[256];
+  char STR1[256];
 
   strcpy(s, s_);
   sprintf(STR1, "LOGSPC:  %s", s);
@@ -265,12 +263,12 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-Local Void emessage(s_, LINK)
-Char *s_;
+void emessage(s_, LINK)
+char *s_;
 struct LOC_Log_logspc_proc *LINK;
 {
-  Char s[256];
-  Char STR1[256];
+  char s[256];
+  char STR1[256];
 
   strcpy(s, s_);
   sprintf(STR1, "LOGSPC:  %s", s);
@@ -279,12 +277,12 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-Local Void vmessage(s_, LINK)
-Char *s_;
+void vmessage(s_, LINK)
+char *s_;
 struct LOC_Log_logspc_proc *LINK;
 {
-  Char s[256];
-  Char STR1[256];
+  char s[256];
+  char STR1[256];
 
   strcpy(s, s_);
   sprintf(STR1, "LOGSPC:  %s", s);
@@ -292,11 +290,11 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-Local Void addlabel(s_, LINK)
-Char *s_;
+void addlabel(s_, LINK)
+char *s_;
 struct LOC_Log_logspc_proc *LINK;
 {
-  Char s[256];
+  char s[256];
   log_lrec *l1;
 
   strcpy(s, s_);
@@ -304,20 +302,20 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-Local Void getword(buf, w, LINK)
-Char *buf, *w;
+void getword(buf, w, LINK)
+char *buf, *w;
 struct LOC_Log_logspc_proc *LINK;
 {
   (*LINK->act->hook.getword)(buf, w);   /*converts to upper case*/
 }
 
 
-Local Void spice_strword(s, word, filePtr)
-register Char *s, *word;
+void spice_strword(s, word, filePtr)
+register char *s, *word;
 FILE *filePtr;
 {
-    register Char *s1 = s;
-    register Char *s2 = s;
+    register char *s1 = s;
+    register char *s2 = s;
     long curPos;
 
     while (isspace(*s1))	/* skip leading spaces */
@@ -351,8 +349,8 @@ FILE *filePtr;
 }
 
 
-Local Void getint(buf, i, def, LINK)
-Char *buf;
+void getint(buf, i, def, LINK)
+char *buf;
 long *i, def;
 struct LOC_Log_logspc_proc *LINK;
 {
@@ -360,13 +358,13 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-Local Void readstrlist(buf, l1, LINK)
-Char *buf;
+void readstrlist(buf, l1, LINK)
+char *buf;
 na_strlist **l1;
 struct LOC_Log_logspc_proc *LINK;
 {
   na_strlist *l2;
-  Char arg[256];
+  char arg[256];
 
   do {
     strword(buf, arg);
@@ -376,13 +374,13 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-Local Void readstrlista(buf, l1, LINK)
-Char *buf;
+void readstrlista(buf, l1, LINK)
+char *buf;
 na_strlist **l1;
 struct LOC_Log_logspc_proc *LINK;
 {
   na_strlist *l2;
-  Char arg[256];
+  char arg[256];
 
   do {
     strword(buf, arg);
@@ -394,14 +392,14 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-Local Void readstrlistr(buf, l1, named, LINK)
-Char *buf;
+void readstrlistr(buf, l1, named, LINK)
+char *buf;
 na_strlist **l1;
-boolean named;
+int named;
 struct LOC_Log_logspc_proc *LINK;
 {
   na_strlist *l2;
-  Char arg[256], rex[256];
+  char arg[256], rex[256];
 
   do {
     strword(buf, arg);
@@ -410,16 +408,16 @@ struct LOC_Log_logspc_proc *LINK;
       if (strlist_find(*l1, rex) == NULL) {
 	l2 = strlist_append(l1, rex);
 	if (named)
-	  *(Char **)((Char **)(&l2->value)) = strdup(arg);
+	  *(char **)((char **)(&l2->value)) = strdup(arg);
       }
     }
   } while (*buf != '\0');
 }
 
 
-Local Void addcell(c1, name, cname, fname, LINK)
+void addcell(c1, name, cname, fname, LINK)
 cellrec **c1;
-Char *name, *cname, *fname;
+char *name, *cname, *fname;
 struct LOC_Log_logspc_proc *LINK;
 {
   *c1 = (cellrec *)Malloc(sizeof(cellrec));
@@ -435,19 +433,19 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-Local Void docommand(buf1_, buf_, complain, LINK)
-Char *buf1_, *buf_;
-boolean complain;
+void docommand(buf1_, buf_, complain, LINK)
+char *buf1_, *buf_;
+int complain;
 struct LOC_Log_logspc_proc *LINK;
 {
-  Char buf1[256], buf[256], buf2[256], buf3[256];
+  char buf1[256], buf[256], buf2[256], buf3[256];
   cellrec *c1;
   transrec *t1;
   primrec *p1;
   na_strlist *l1;
   long i;
-  Char STR1[256];
-  Char STR3[256];
+  char STR1[256];
+  char STR3[256];
 
   strcpy(buf1, buf1_);
   strcpy(buf, buf_);
@@ -635,15 +633,15 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-Local Void namenode(n, LINK)
+void namenode(n, LINK)
 log_nrec *n;
 struct LOC_Log_logspc_proc *LINK;
 {
-  Char buf[256], buf2[256];
+  char buf[256], buf2[256];
   na_strlist *l1;
   long i, FORLIM;
 
-  if ((Char *)n->temp != NULL)
+  if ((char *)n->temp != NULL)
     return;
   *buf = '\0';
   *buf2 = '\0';
@@ -657,11 +655,11 @@ struct LOC_Log_logspc_proc *LINK;
     }
   }
   if (*buf2 != '\0') {
-    *(Char **)((Char **)(&n->temp)) = strdup(buf2);
+    *(char **)((char **)(&n->temp)) = strdup(buf2);
     return;
   }
   if (*buf != '\0') {
-    *(Char **)((Char **)(&n->temp)) = strdup(buf);
+    *(char **)((char **)(&n->temp)) = strdup(buf);
     return;
   }
   nodecount++;
@@ -675,22 +673,22 @@ struct LOC_Log_logspc_proc *LINK;
 /* p2c: logspc.text, line 408:
  * Note: Using % for possibly-negative arguments [317] */
   }
-  *(Char **)((Char **)(&n->temp)) = strdup(buf);
+  *(char **)((char **)(&n->temp)) = strdup(buf);
 }
 
 
-Local boolean trynamegate(g, LINK)
+int trynamegate(g, LINK)
 log_grec *g;
 struct LOC_Log_logspc_proc *LINK;
 {
-  Char name[256];
+  char name[256];
 
-  if ((Char *)g->temp != NULL)
+  if ((char *)g->temp != NULL)
     return true;
   else {
     gateinstname(name, g);
     if (*name != '\0') {
-      *(Char **)((Char **)(&g->temp)) = strdup(name);
+      *(char **)((char **)(&g->temp)) = strdup(name);
       return true;
     } else
       return false;
@@ -698,7 +696,7 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-Local Void namecellgates(c, LINK)
+void namecellgates(c, LINK)
 cellrec *c;
 struct LOC_Log_logspc_proc *LINK;
 {
@@ -707,8 +705,8 @@ struct LOC_Log_logspc_proc *LINK;
   long lastn, laste, lasts, lastw;
   short *pnumlist;
   short i;
-  Char STR1[256];
-  Char STR3[256];
+  char STR1[256];
+  char STR3[256];
 
   g = LINK->act->gbase[LINK->act->curpage - 1];
   while (g != NULL) {
@@ -716,7 +714,7 @@ struct LOC_Log_logspc_proc *LINK;
       if (!trynamegate(g, LINK)) {
 	c->ccount++;
 	sprintf(STR3, "%s%ld", c->cname, c->ccount);
-	*(Char **)((Char **)(&g->temp)) = strdup(STR3);
+	*(char **)((char **)(&g->temp)) = strdup(STR3);
       }
       portlist = (log_nrec **)Malloc(g->kind->numpins * sizeof(log_nrec *));
       pnumlist = NULL;
@@ -732,15 +730,15 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-Local Void nameprimgates(p, LINK)
+void nameprimgates(p, LINK)
 primrec *p;
 struct LOC_Log_logspc_proc *LINK;
 {
-  Char buf[256];
+  char buf[256];
   log_grec *g;
   short i;
   long pos, last;
-  Char STR3[256];
+  char STR3[256];
   short FORLIM;
 
   g = LINK->act->gbase[LINK->act->curpage - 1];
@@ -754,7 +752,7 @@ struct LOC_Log_logspc_proc *LINK;
 	}
 	p->ccount++;
 	sprintf(STR3, "%s_%ld", buf, p->ccount);
-	*(Char **)((Char **)(&g->temp)) = strdup(STR3);
+	*(char **)((char **)(&g->temp)) = strdup(STR3);
       }
       FORLIM = g->kind->numpins;
       for (i = 0; i < FORLIM; i++)
@@ -765,17 +763,17 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-Local Void prolog(args_, bp, LINK)
-Char *args_;
+void prolog(args_, bp, LINK)
+char *args_;
 log_brec *bp;
 struct LOC_Log_logspc_proc *LINK;
 {
-  Char args[256];
+  char args[256];
   log_lrec *lb1;
   cellrec *c;
   transrec *t;
   primrec *p;
-  Char buf[256], buf2[256];
+  char buf[256], buf2[256];
   log_nrec **portlist;
   na_strlist *l1;
   long i, tcount, lastn, laste, lasts, lastw;
@@ -783,8 +781,8 @@ struct LOC_Log_logspc_proc *LINK;
   short *pnumlist;
   log_nrec *n;
   log_grec *g;
-  Char STR1[256];
-  Char STR3[256];
+  char STR1[256];
+  char STR3[256];
   long FORLIM;
 
   strcpy(args, args_);
@@ -856,11 +854,11 @@ struct LOC_Log_logspc_proc *LINK;
 	    examinetemplate(g, portlist, (long)g->kind->numpins, true,
 			    &pnumlist, &lastn, &laste, &lasts, &lastw);
 	    for (i = 0; i < lastw; i++) {
-	      if ((Char *)portlist[i]->temp != NULL)
+	      if ((char *)portlist[i]->temp != NULL)
 		emessage("Template has pins shorted together", LINK);
 	      else {
 		namenode(portlist[i], LINK);
-		l1 = strlist_append(&ports, (Char *)portlist[i]->temp);
+		l1 = strlist_append(&ports, (char *)portlist[i]->temp);
 	      }
 	    }
 	    Free(portlist);
@@ -896,7 +894,7 @@ struct LOC_Log_logspc_proc *LINK;
       if (t != NULL) {
 	tcount++;
 	sprintf(STR3, "Transistor-#%ld", tcount);
-	*(Char **)((Char **)(&g->temp)) = strdup(STR3);
+	*(char **)((char **)(&g->temp)) = strdup(STR3);
 	FORLIM = g->kind->numpins;
 	for (i = 0; i < FORLIM; i++)
 	  namenode(g->pin[i], LINK);
@@ -921,7 +919,7 @@ struct LOC_Log_logspc_proc *LINK;
       LINK->act->actflag = false;
       (*LINK->act->hook2->send_gengate)(g, "CONSTPINS");
       if (LINK->act->actstrlist != NULL || LINK->act->actflag) {
-	if ((Char *)g->temp == NULL &&
+	if ((char *)g->temp == NULL &&
 	    strlist_find_r(orphans, g->kind->name) == NULL &&
 	    strlist_find_r(ignored, g->kind->name) == NULL)
 	      /*suppress "gate was ignored" message*/
@@ -932,7 +930,7 @@ struct LOC_Log_logspc_proc *LINK;
 	  if (pnum != 0) {
 	    n = (log_nrec *)l1->value;
 	    namenode(n, LINK);
-	    *(Char **)((Char **)(&g->pin[pnum - 1]->temp)) = strdup((Char *)n->temp);
+	    *(char **)((char **)(&g->pin[pnum - 1]->temp)) = strdup((char *)n->temp);
 	  }
 	  l1 = l1->next;
 	}
@@ -945,16 +943,16 @@ struct LOC_Log_logspc_proc *LINK;
     return;
   n = LINK->act->nbase;
   while (n != NULL) {
-    if ((Char *)n->temp != NULL &&
-	strlist_find_r(globals, (Char *)n->temp) != NULL &&
-	strlist_cifind(ports, (Char *)n->temp) == NULL)
-      l1 = strlist_append(&ports, (Char *)n->temp);
+    if ((char *)n->temp != NULL &&
+	strlist_find_r(globals, (char *)n->temp) != NULL &&
+	strlist_cifind(ports, (char *)n->temp) == NULL)
+      l1 = strlist_append(&ports, (char *)n->temp);
     n = n->next;
   }
 }
 
 
-Local Void epilog(LINK)
+void epilog(LINK)
 struct LOC_Log_logspc_proc *LINK;
 {
   cellrec *c;
@@ -965,12 +963,12 @@ struct LOC_Log_logspc_proc *LINK;
 
   n = LINK->act->nbase;
   while (n != NULL) {
-    strdispose((Char **)((Char **)(&n->temp)));
+    strdispose((char **)((char **)(&n->temp)));
     n = n->next;
   }
   g = LINK->act->gbase[LINK->act->curpage - 1];
   while (g != NULL) {
-    strdispose((Char **)((Char **)(&g->temp)));
+    strdispose((char **)((char **)(&g->temp)));
     g = g->next;
   }
   c = cellbase;
@@ -1015,13 +1013,13 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-Local Void addbogusname(newcmd, newthing, LINK)
-Char *newcmd, *newthing;
+void addbogusname(newcmd, newthing, LINK)
+char *newcmd, *newthing;
 struct LOC_Log_logspc_proc *LINK;
 {
   log_lrec *l1;
-  Char cmd[256], args[256];
-  Char STR2[256];
+  char cmd[256], args[256];
+  char STR2[256];
 
   l1 = LINK->act->lbase[LINK->act->curpage - 1];
   while (l1 != NULL && !(commandlabel(l1, cmd, args) &&
@@ -1034,7 +1032,7 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-Local na_strlist *mydefndirectory(pg, LINK)
+na_strlist *mydefndirectory(pg, LINK)
 short pg;
 struct LOC_Log_logspc_proc *LINK;
 {
@@ -1052,29 +1050,29 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-/* Local variables for dologspc: */
+/* variables for dologspc: */
 struct LOC_dologspc {
   struct LOC_Log_logspc_proc *LINK;
   FILE *outf;
 } ;
 
 
-/* Local variables for readcells: */
+/* variables for readcells: */
 struct LOC_readcells {
   struct LOC_dologspc *LINK;
   FILE *f2;
-  Char s[256], s2[256], name[256];
+  char s[256], s2[256], name[256];
 } ;
 
 
-Local Void readcellfile(fn, LINK)
-Char *fn;
+void readcellfile(fn, LINK)
+char *fn;
 struct LOC_readcells *LINK;
 {
   na_strlist *l1;
-  boolean done, copying, prewarp;
-  Char *TEMP;
-  Char spcstring[256], spcword[256], endsubckt[256];
+  int done, copying, prewarp;
+  char *TEMP;
+  char spcstring[256], spcword[256], endsubckt[256];
 
   if (strlist_find(filebase, fn) != NULL)
     return;
@@ -1147,19 +1145,19 @@ struct LOC_readcells *LINK;
 }
 
 
-Local Void readcells(LINK)
+void readcells(LINK)
 struct LOC_dologspc *LINK;
 {
   struct LOC_readcells V;
   log_grec *g;
   cellrec *c;
   na_strlist *p, *l1;
-  boolean found;
-  Char STR1[256];
-  Char STR2[256];
-  Char STR3[256];
-  Char STR4[256];
-  Char *TEMP;
+  int found;
+  char STR1[256];
+  char STR2[256];
+  char STR3[256];
+  char STR4[256];
+  char *TEMP;
 
   V.LINK = LINK;
   V.f2 = NULL;
@@ -1276,15 +1274,15 @@ struct LOC_dologspc *LINK;
 }
 
 
-/* Local variables for writefile: */
+/* variables for writefile: */
 struct LOC_writefile {
   struct LOC_dologspc *LINK;
   long linelen;
 } ;
 
 
-Local Void writeword(w, LINK)
-Char *w;
+void writeword(w, LINK)
+char *w;
 struct LOC_writefile *LINK;
 {
   if (LINK->linelen + strlen(w) > 77)
@@ -1301,7 +1299,7 @@ struct LOC_writefile *LINK;
 }
 
 
-Local Void writefile(LINK)
+void writefile(LINK)
 struct LOC_dologspc *LINK;
 {
   struct LOC_writefile V;
@@ -1311,16 +1309,16 @@ struct LOC_dologspc *LINK;
   cellrec *c;
   primrec *p;
   na_strlist *havedone, *l1;
-  Char s[256], w[256], ginstname[256];
+  char s[256], w[256], ginstname[256];
   log_nrec **portlist;
   long lastn, laste, lasts, lastw;
   short *pnumlist, pinCount, attrCount, strCount;
   na_strlistrec *na_slr;
-  boolean handled;
+  int handled;
   long i, j;
-  Char STR1[256], STR2[256];
-  Char STR3[110];
-  Char STR4[112];
+  char STR1[256], STR2[256];
+  char STR3[110];
+  char STR4[112];
   long FORLIM;
 
   long	split;		/* for numbers of transistors in parallel */
@@ -1385,10 +1383,10 @@ struct LOC_dologspc *LINK;
   havedone = NULL;
   n = LINK->LINK->act->nbase;
   while (n != NULL) {
-    if ((Char *)n->temp != NULL &&
-	strlist_cifind(havedone, (Char *)n->temp) == NULL &&
-	(maincell || strlist_cifind(ports, (Char *)n->temp) == NULL))
-      l1 = strlist_add(&havedone, (Char *)n->temp);
+    if ((char *)n->temp != NULL &&
+	strlist_cifind(havedone, (char *)n->temp) == NULL &&
+	(maincell || strlist_cifind(ports, (char *)n->temp) == NULL))
+      l1 = strlist_add(&havedone, (char *)n->temp);
     n = n->next;
   }
   l1 = havedone;
@@ -1450,7 +1448,7 @@ struct LOC_dologspc *LINK;
 	      s_ctr[t->strength-65]);
             pinCount = 0;
             while (pinCount < g->kind->numpins) {
-              fprintf (LINK->outf, " %s", (Char *)g->pin[pinCount]->temp);
+              fprintf (LINK->outf, " %s", (char *)g->pin[pinCount]->temp);
               pinCount ++;
             }
             attrCount = 0;
@@ -1513,49 +1511,49 @@ struct LOC_dologspc *LINK;
 	    fprintf (LINK->outf, "X%ld", x_ctr);
             pinCount = 0;
 	    while (pinCount < g->kind->numpins) {
-	      fprintf (LINK->outf, " %s", (Char *)g->pin[pinCount]->temp);
+	      fprintf (LINK->outf, " %s", (char *)g->pin[pinCount]->temp);
 	      pinCount ++;
 	    }
-            fprintf (LINK->outf, " %s %s\n", nBulk, (Char *)g->kind->name);
+            fprintf (LINK->outf, " %s %s\n", nBulk, (char *)g->kind->name);
 	    x_ctr ++;
 	    break;
 	  case 'g':	/* primitive subcircuit with PBULK appendage */
 	    fprintf (LINK->outf, "X%ld", x_ctr);
 	    pinCount = 0;
 	    while (pinCount < g->kind->numpins) {
-              fprintf (LINK->outf, " %s", (Char *)g->pin[pinCount]->temp);
+              fprintf (LINK->outf, " %s", (char *)g->pin[pinCount]->temp);
 	      pinCount ++;
             }
-	    fprintf (LINK->outf, " %s %s\n", pBulk, (Char *)g->kind->name);
+	    fprintf (LINK->outf, " %s %s\n", pBulk, (char *)g->kind->name);
 	    x_ctr ++;
 	    break;
 	  case 'a':	/* 3-pin NPN bipolar with implicit 4th pin */
 	    fprintf (LINK->outf, "Q%ld %s %s %s %s NPN1\n", npn_ctr,
-	      (Char *)g->pin[1]->temp,		/* collector */
-	      (Char *)g->pin[0]->temp,		/* base */
-	      (Char *)g->pin[2]->temp,		/* emitter */
+	      (char *)g->pin[1]->temp,		/* collector */
+	      (char *)g->pin[0]->temp,		/* base */
+	      (char *)g->pin[2]->temp,		/* emitter */
 	      pBulk);				/* externally-defined p-bulk */
 	    npn_ctr ++;
 	    break;
 	  case 'b':	/* 3-pin PNP bipolar with implicit 4th pin */
             fprintf (LINK->outf, "Q%ld %s %s %s %s PNP1\n", pnp_ctr,
-              (Char *)g->pin[1]->temp,          /* collector */
-              (Char *)g->pin[0]->temp,          /* base */
-              (Char *)g->pin[2]->temp,          /* emitter */
+              (char *)g->pin[1]->temp,          /* collector */
+              (char *)g->pin[0]->temp,          /* base */
+              (char *)g->pin[2]->temp,          /* emitter */
 	      nBulk);				/* externally-defined n-bulk */
             pnp_ctr ++;
             break;
 	  case 'e':	/* 2-pin diode */
             fprintf (LINK->outf, "D%ld %s %s DIODE1\n", d_ctr,
-              (Char *)g->pin[0]->temp,          /* positive node */
-              (Char *)g->pin[1]->temp);         /* negative node */
+              (char *)g->pin[0]->temp,          /* positive node */
+              (char *)g->pin[1]->temp);         /* negative node */
             d_ctr ++;
             break;
 	  case 'p':	/* 3-pin PFET with implicit 4th pin and geometry */
 	    fprintf (LINK->outf, "M%ld %s %s %s %s PMOS1 ", m_ctr,
-	      (Char *)g->pin[2]->temp,		/* p-source */
-	      (Char *)g->pin[0]->temp,		/* gate */
-	      (Char *)g->pin[1]->temp,		/* p-drain */
+	      (char *)g->pin[2]->temp,		/* p-source */
+	      (char *)g->pin[0]->temp,		/* gate */
+	      (char *)g->pin[1]->temp,		/* p-drain */
 	      nBulk);				/* n-bulk */
 	    m_ctr ++;
 	    fprintf (LINK->outf, "L=%gUM W=%gUM\n",
@@ -1563,9 +1561,9 @@ struct LOC_dologspc *LINK;
 	    break;
 	  case 'j':	/* 3-pin PFET7T */
 	    fprintf (LINK->outf, "M%ld %s %s %s %s PMOS1 ", m_ctr,
-	      (Char *)g->pin[2]->temp,		/* p-source */
-	      (Char *)g->pin[0]->temp,		/* gate */
-	      (Char *)g->pin[1]->temp,		/* p-drain */
+	      (char *)g->pin[2]->temp,		/* p-source */
+	      (char *)g->pin[0]->temp,		/* gate */
+	      (char *)g->pin[1]->temp,		/* p-drain */
 	      nBulk);				/* n-bulk */
 	    m_ctr ++;
 	    fprintf (LINK->outf, "L=%gUM W=%gUM\n",
@@ -1573,9 +1571,9 @@ struct LOC_dologspc *LINK;
 	    break;
 	  case 'n':	/* 3-pin NFET with implicit 4th pin and geometry */
 	    fprintf (LINK->outf, "M%ld %s %s %s %s NMOS1 ", m_ctr, 
-              (Char *)g->pin[1]->temp,          /* n-source */
-              (Char *)g->pin[0]->temp,          /* gate */
-              (Char *)g->pin[2]->temp,          /* n-drain */
+              (char *)g->pin[1]->temp,          /* n-source */
+              (char *)g->pin[0]->temp,          /* gate */
+              (char *)g->pin[2]->temp,          /* n-drain */
 	      pBulk);				/* p-bulk */
             m_ctr ++;
 	    fprintf (LINK->outf, "L=%gUM W=%gUM\n",
@@ -1583,9 +1581,9 @@ struct LOC_dologspc *LINK;
 	    break;
 	  case 'i':	/* 3-pin NFET7T */
 	    fprintf (LINK->outf, "M%ld %s %s %s %s NMOS1 ", m_ctr, 
-              (Char *)g->pin[1]->temp,          /* n-source */
-              (Char *)g->pin[0]->temp,          /* gate */
-              (Char *)g->pin[2]->temp,          /* n-drain */
+              (char *)g->pin[1]->temp,          /* n-source */
+              (char *)g->pin[0]->temp,          /* gate */
+              (char *)g->pin[2]->temp,          /* n-drain */
 	      pBulk);				/* p-bulk */
             m_ctr ++;
 	    fprintf (LINK->outf, "L=%gUM W=%gUM\n",
@@ -1596,10 +1594,10 @@ struct LOC_dologspc *LINK;
 		 split++)
 	    {
 	      fprintf (LINK->outf, "M%ld %s %s %s %s NMOS1 ", m_ctr,
-                (Char *)g->pin[1]->temp,          /* n-source */
-                (Char *)g->pin[0]->temp,          /* gate */
-                (Char *)g->pin[2]->temp,          /* n-drain */
-                (Char *)g->pin[3]->temp);         /* p-bulk */
+                (char *)g->pin[1]->temp,          /* n-source */
+                (char *)g->pin[0]->temp,          /* gate */
+                (char *)g->pin[2]->temp,          /* n-drain */
+                (char *)g->pin[3]->temp);         /* p-bulk */
 	      m_ctr ++;
               fprintf (LINK->outf, "L=%gUM W=%gUM\n",
                 g->attr[N_L - 1].UU.r,
@@ -1608,10 +1606,10 @@ struct LOC_dologspc *LINK;
             break;
 	  case 'k':	/* 4-pin NFET7F */
 	      fprintf (LINK->outf, "M%ld %s %s %s %s NMOS1 ", m_ctr,
-                (Char *)g->pin[1]->temp,          /* n-source */
-                (Char *)g->pin[0]->temp,          /* gate */
-                (Char *)g->pin[2]->temp,          /* n-drain */
-                (Char *)g->pin[3]->temp);         /* p-bulk */
+                (char *)g->pin[1]->temp,          /* n-source */
+                (char *)g->pin[0]->temp,          /* gate */
+                (char *)g->pin[2]->temp,          /* n-drain */
+                (char *)g->pin[3]->temp);         /* p-bulk */
 	      m_ctr ++;
               fprintf (LINK->outf, "L=%gUM W=%gUM\n",
                 lambda*g->attr[13].UU.r, lambda*g->attr[12].UU.r);
@@ -1621,10 +1619,10 @@ struct LOC_dologspc *LINK;
 		 split++)
             {
 	      fprintf (LINK->outf, "M%ld %s %s %s %s PMOS1 ", m_ctr,
-                (Char *)g->pin[2]->temp,          /* p-source */
-                (Char *)g->pin[0]->temp,          /* gate */
-                (Char *)g->pin[1]->temp,          /* p-drain */
-                (Char *)g->pin[3]->temp);         /* n-bulk */
+                (char *)g->pin[2]->temp,          /* p-source */
+                (char *)g->pin[0]->temp,          /* gate */
+                (char *)g->pin[1]->temp,          /* p-drain */
+                (char *)g->pin[3]->temp);         /* n-bulk */
               m_ctr ++;
 	      fprintf (LINK->outf, "L=%gUM W=%gUM\n",
                 g->attr[N_L - 1].UU.r,
@@ -1633,35 +1631,35 @@ struct LOC_dologspc *LINK;
             break;
 	  case 'l':	/* 4-pin PFET7F */
 	      fprintf (LINK->outf, "M%ld %s %s %s %s PMOS1 ", m_ctr,
-                (Char *)g->pin[2]->temp,          /* p-source */
-                (Char *)g->pin[0]->temp,          /* gate */
-                (Char *)g->pin[1]->temp,          /* p-drain */
-                (Char *)g->pin[3]->temp);         /* n-bulk */
+                (char *)g->pin[2]->temp,          /* p-source */
+                (char *)g->pin[0]->temp,          /* gate */
+                (char *)g->pin[1]->temp,          /* p-drain */
+                (char *)g->pin[3]->temp);         /* n-bulk */
               m_ctr ++;
 	      fprintf (LINK->outf, "L=%gUM W=%gUM\n",
                 lambda*g->attr[13].UU.r, lambda*g->attr[12].UU.r);
             break;
 	  case 'z':	/* 4-pin PFET with implicit geometry */
 	    fprintf (LINK->outf, "M%ld %s %s %s %s PMOS1 ", m_ctr,
-              (Char *)g->pin[2]->temp,          /* p-source */
-              (Char *)g->pin[0]->temp,          /* gate */
-              (Char *)g->pin[1]->temp,          /* p-drain */
-              (Char *)g->pin[3]->temp);         /* n-bulk */
+              (char *)g->pin[2]->temp,          /* p-source */
+              (char *)g->pin[0]->temp,          /* gate */
+              (char *)g->pin[1]->temp,          /* p-drain */
+              (char *)g->pin[3]->temp);         /* n-bulk */
             m_ctr ++;
             fprintf (LINK->outf, "L=%gUM W=%gUM\n",
               default_L, g->attr[N_Ratio_6 - 1].UU.r * default_L);
             break;
 	  case 'r':	/* 2-pin floating resistor */
 	    fprintf (LINK->outf, "R%ld %s %s %g\n", r_ctr,
-	      (Char *)g->pin[0]->temp,
-	      (Char *)g->pin[1]->temp,
+	      (char *)g->pin[0]->temp,
+	      (char *)g->pin[1]->temp,
 	      g->attr[N_Res - 1].UU.r);
 	    r_ctr ++;
 	    break;
 	  case 'c':	/* 2-pin floating capacitor */
             fprintf (LINK->outf, "C%ld %s %s %g\n", c_ctr,
-              (Char *)g->pin[0]->temp,
-              (Char *)g->pin[1]->temp,
+              (char *)g->pin[0]->temp,
+              (char *)g->pin[1]->temp,
               g->attr[N_Cap - 1].UU.r);
 	    c_ctr ++;
             break;
@@ -1670,16 +1668,16 @@ struct LOC_dologspc *LINK;
             {
               case 0:   /* dc mode */
                 fprintf (LINK->outf, "I%ld %s %s %g\n", i_ctr,
-                  (Char *)g->pin[0]->temp,
-                  (Char *)g->pin[1]->temp,
+                  (char *)g->pin[0]->temp,
+                  (char *)g->pin[1]->temp,
                   g->attr[N_Dc - 1].UU.r);
                 i_ctr ++;
                 break;
               case 1:
                 fprintf(LINK->outf,
                   "I%ld %s %s PULSE (%g %g %g %g %g %g %g)\n", i_ctr,
-                  (Char *)g->pin[0]->temp,
-                  (Char *)g->pin[1]->temp,
+                  (char *)g->pin[0]->temp,
+                  (char *)g->pin[1]->temp,
                   g->attr[N_pIinit - 1].UU.r,
                   g->attr[N_pIpulse - 1].UU.r,
                   g->attr[N_pDelay - 1].UU.r,
@@ -1692,8 +1690,8 @@ struct LOC_dologspc *LINK;
               case 2:
                 fprintf (LINK->outf,
                   "I%ld %s %s SIN (%g %g %g %g 0.0 %g)\n", i_ctr,
-                  (Char *)g->pin[0]->temp,
-                  (Char *)g->pin[1]->temp,
+                  (char *)g->pin[0]->temp,
+                  (char *)g->pin[1]->temp,
                   g->attr[N_sOffset - 1].UU.r,
                   g->attr[N_sAmp - 1].UU.r,
                   g->attr[N_sFreq - 1].UU.r,
@@ -1709,12 +1707,12 @@ struct LOC_dologspc *LINK;
               case 0:   /* dc mode */
                 fprintf (LINK->outf, "R%ld %s vNode%ld %g\n",
                   r_ctr,
-                  (Char *)g->pin[0]->temp,
+                  (char *)g->pin[0]->temp,
                   v_ctr,
                   g->attr[N_VRes - 1].UU.r);
                 fprintf (LINK->outf, "V%ld vNode%ld %s %g\n", v_ctr,
                   v_ctr,
-                  (Char *)g->pin[1]->temp,
+                  (char *)g->pin[1]->temp,
                   g->attr[N_Dc - 1].UU.r);
                 r_ctr ++;
                 v_ctr ++;
@@ -1722,13 +1720,13 @@ struct LOC_dologspc *LINK;
               case 1:
                 fprintf (LINK->outf, "R%ld %s vNode%ld %g\n",
                   r_ctr,
-                  (Char *)g->pin[0]->temp,
+                  (char *)g->pin[0]->temp,
                   v_ctr,
                   g->attr[N_VRes - 1].UU.r);
                 fprintf(LINK->outf,
                   "V%ld vNode%ld %s PULSE (%g %g %g %g %g %g %g)\n", v_ctr,
                   v_ctr,
-                  (Char *)g->pin[1]->temp,
+                  (char *)g->pin[1]->temp,
                   g->attr[N_pVinit - 1].UU.r,
                   g->attr[N_pVpulse - 1].UU.r,
                   g->attr[N_pDelay - 1].UU.r,
@@ -1742,13 +1740,13 @@ struct LOC_dologspc *LINK;
               case 2:
                 fprintf (LINK->outf, "R%ld %s vNode%ld %g\n",
                   r_ctr,
-                  (Char *)g->pin[0]->temp,
+                  (char *)g->pin[0]->temp,
                   v_ctr,
                   g->attr[N_VRes - 1].UU.r);
                 fprintf (LINK->outf,
                   "V%ld vNode%ld %s SIN (%g %g %g %g 0.0 %g)\n", v_ctr,
                   v_ctr,
-                  (Char *)g->pin[1]->temp,
+                  (char *)g->pin[1]->temp,
                   g->attr[N_sOffset - 1].UU.r,
                   g->attr[N_sAmp - 1].UU.r,
                   g->attr[N_sFreq - 1].UU.r,
@@ -1789,15 +1787,15 @@ struct LOC_dologspc *LINK;
 	    i++;
 	    if (i <= lastw)
 	    {
-	      if ((Char *)portlist[i - 1]->temp == NULL)
+	      if ((char *)portlist[i - 1]->temp == NULL)
 	      {
 		sprintf(STR1, "Internal error: node on %s was never named",
-			(Char *)g->temp);
+			(char *)g->temp);
 		emessage(STR1, LINK->LINK);
 	      }
 	      else
 	      {
-		writeword((Char *)portlist[i - 1]->temp, &V);
+		writeword((char *)portlist[i - 1]->temp, &V);
 	      }
 	    }
 	  }
@@ -1809,9 +1807,9 @@ struct LOC_dologspc *LINK;
 	        j++;
 
 	    if (j <= LINK->LINK->act->lastsignal &&
-		(Char *)LINK->LINK->act->signaltab[j - 1].np->temp != NULL)
+		(char *)LINK->LINK->act->signaltab[j - 1].np->temp != NULL)
 	    {
-	      writeword((Char *)LINK->LINK->act->signaltab[j - 1].np->temp, &V);
+	      writeword((char *)LINK->LINK->act->signaltab[j - 1].np->temp, &V);
             }
 	    else
 	    {
@@ -1866,10 +1864,10 @@ struct LOC_dologspc *LINK;
 	putc('h', LINK->outf);
 	V.linelen = 1;
 	writeword(s, &V);
-	writeword((Char *)g->temp, &V);
+	writeword((char *)g->temp, &V);
 	FORLIM = g->kind->numpins;
 	for (i = 0; i < FORLIM; i++)
-	  writeword((Char *)g->pin[i]->temp, &V);
+	  writeword((char *)g->pin[i]->temp, &V);
 	fprintf(LINK->outf, " ;\n");
 */
 	sprintf(STR1, "X%ld", x_ctr);
@@ -1878,7 +1876,7 @@ struct LOC_dologspc *LINK;
 	V.linelen = strlen(STR1);
 	FORLIM = g->kind->numpins;
 	for (i = 0; i < FORLIM; i++)
-          writeword((Char *)g->pin[i]->temp, &V);
+          writeword((char *)g->pin[i]->temp, &V);
 	writeword(s, &V);
 	fprintf(LINK->outf, "\n");
 	handled = true;
@@ -1919,12 +1917,12 @@ struct LOC_dologspc *LINK;
 }
 
 
-Local Void showports(LINK)
+void showports(LINK)
 struct LOC_dologspc *LINK;
 {
-  Char buf[256];
+  char buf[256];
   na_strlist *l1;
-  Char STR1[256];
+  char STR1[256];
 
   strcpy(buf, "Using port list:");
   l1 = ports;
@@ -1937,19 +1935,19 @@ struct LOC_dologspc *LINK;
 }
 
 
-Local Void dologspc(args_, LINK)
-Char *args_;
+void dologspc(args_, LINK)
+char *args_;
 struct LOC_Log_logspc_proc *LINK;
 {
   struct LOC_dologspc V;
-  Char args[256];
+  char args[256];
   na_strlist *l1, *defndir, *argslist, *libpath;
   FILE *incfp;
   log_nrec *n1;   /*pointer to "node" record*/
   log_grec *g1;   /*pointer to "gate instance" record*/
   log_krec *k1;   /*pointer to "gate kind" record*/
-  Char STR1[256], STR2[256];
-  Char STR3[256];
+  char STR1[256], STR2[256];
+  char STR3[256];
   int s_ctr_index;
 
   m_ctr = x_ctr = 1;	/* initialize spice counters */
@@ -1969,7 +1967,7 @@ struct LOC_Log_logspc_proc *LINK;
     l1 = strlist_find_r(argslist, defndir->s);
     if (argslist == NULL || l1 != NULL) {
       if (l1 != NULL)
-	strdispose((Char **)((Char **)(&l1->value)));
+	strdispose((char **)((char **)(&l1->value)));
       prolog(defndir->s, (log_brec *)defndir->value, LINK);
       autotop = false;
       if (*filename == '\0' && strcmp(cellname, main_name)) {
@@ -2121,10 +2119,10 @@ struct LOC_Log_logspc_proc *LINK;
   }
   l1 = argslist;
   while (l1 != NULL) {
-    if ((Char *)l1->value != NULL) {
-      sprintf(STR2, "Unable to find cell %s", (Char *)l1->value);
+    if ((char *)l1->value != NULL) {
+      sprintf(STR2, "Unable to find cell %s", (char *)l1->value);
       message(STR2, LINK);
-      strdispose((Char **)((Char **)(&l1->value)));
+      strdispose((char **)((char **)(&l1->value)));
     }
     l1 = l1->next;
   }
@@ -2134,12 +2132,12 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-Local Void probecommand(LINK)
+void probecommand(LINK)
 struct LOC_Log_logspc_proc *LINK;
 {
   na_strlist *defndir, *l1, *curdef;
-  boolean exitflag, boxed;
-  Char buf[256], obuf[256], temp[256];
+  int exitflag, boxed;
+  char buf[256], obuf[256], temp[256];
   log_grec *probegate, *redgate, *g;
   log_nrec *probenode, *rednode;
   log_brec *curbox;
@@ -2244,23 +2242,23 @@ struct LOC_Log_logspc_proc *LINK;
 	  "Gate:                                   Node:                                 ");
 	strcpy(temp, "---");
 	if (probegate != NULL) {
-	  if ((Char *)probegate->temp == NULL) {
+	  if ((char *)probegate->temp == NULL) {
 	    if (probegate == gtempl)
 	      strcpy(temp, "(template)");
 	    else
 	      strcpy(temp, "(unnamed)");
 	  } else
-	    strcpy(temp, (Char *)(probegate->temp));
+	    strcpy(temp, (char *)(probegate->temp));
 	}
 	if (strlen(temp) > 30)
 	  temp[30] = '\0';
 	strmove(strlen(temp), temp, 1, buf, 7);
 	strcpy(temp, "---");
 	if (probenode != NULL) {
-	  if ((Char *)probenode->temp == NULL)
+	  if ((char *)probenode->temp == NULL)
 	    strcpy(temp, "(unnamed)");
 	  else
-	    strcpy(temp, (Char *)(probenode->temp));
+	    strcpy(temp, (char *)(probenode->temp));
 	}
 	if (strlen(temp) > 30)
 	  temp[30] = '\0';
@@ -2279,17 +2277,17 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-Local Void identifycommand(args_, LINK)
-Char *args_;
+void identifycommand(args_, LINK)
+char *args_;
 struct LOC_Log_logspc_proc *LINK;
 {
-  Char args[256];
+  char args[256];
   na_strlist *defndir, *arglist, *argl;
-  Char buf[256];
+  char buf[256];
   log_grec *g;
   log_nrec *n;
-  boolean first;
-  Char STR1[256];
+  int first;
+  char STR1[256];
 
   strcpy(args, args_);
   (*LINK->act->hook.clearfunc)();
@@ -2307,11 +2305,11 @@ struct LOC_Log_logspc_proc *LINK;
     while (argl != NULL) {
       strcpy(buf, argl->s);
       g = LINK->act->gbase[LINK->act->curpage - 1];
-      while (g != NULL && (!gateinbox(mybox, g) || (Char *)g->temp == NULL ||
-			   strcicmp((Char *)g->temp, buf) != 0))
+      while (g != NULL && (!gateinbox(mybox, g) || (char *)g->temp == NULL ||
+			   strcicmp((char *)g->temp, buf) != 0))
 	g = g->next;
       if (g != NULL) {
-	sprintf(STR1, "Identifying gate %s", (Char *)g->temp);
+	sprintf(STR1, "Identifying gate %s", (char *)g->temp);
 	vmessage(STR1, LINK);
 	argl->value = (na_long)1;
 	(*LINK->act->hook.clip)();
@@ -2319,11 +2317,11 @@ struct LOC_Log_logspc_proc *LINK;
 	(*LINK->act->hook.noclip)();
       } else {
 	n = LINK->act->nbase;
-	while (n != NULL && ((Char *)n->temp == NULL ||
-			     strcicmp((Char *)n->temp, buf) != 0))
+	while (n != NULL && ((char *)n->temp == NULL ||
+			     strcicmp((char *)n->temp, buf) != 0))
 	  n = n->next;
 	if (n != NULL) {
-	  sprintf(STR1, "Identifying node %s", (Char *)n->temp);
+	  sprintf(STR1, "Identifying node %s", (char *)n->temp);
 	  vmessage(STR1, LINK);
 	  argl->value = (na_long)1;
 	  (*LINK->act->hook.clip)();
@@ -2347,13 +2345,13 @@ struct LOC_Log_logspc_proc *LINK;
 }
 
 
-Void Log_logspc_proc(act_)
+void Log_logspc_proc(act_)
 log_action *act_;
 {
   struct LOC_Log_logspc_proc V;
   long esc, ior;
   log_action *WITH;
-  Char STR1[256];
+  char STR1[256];
 
   V.act = act_;
   WITH = V.act;
@@ -2365,9 +2363,9 @@ log_action *act_;
     strcpy(WITH->acttool->shortname, "LOGSPC");   /*this is my brief name*/
     if (*WITH->acttool->comment == '\0')   /*this is my long name*/
       strcpy(WITH->acttool->comment, "LOG-to-SPC converter");
-    filename = (Char *)Malloc(256);
+    filename = (char *)Malloc(256);
     *filename = '\0';
-    cellname = (Char *)Malloc(256);
+    cellname = (char *)Malloc(256);
     *cellname = '\0';
     ports = NULL;
     globals = NULL;
diff --git a/log/src/logspc.h b/log/src/logspc.h
index f14e4e3..56b58ae 100644
--- a/log/src/logspc.h
+++ b/log/src/logspc.h
@@ -1,58 +1,16 @@
-/* Header for module logspc, generated by p2c */
 #ifndef LOGSPC_H
 #define LOGSPC_H
 
-
-
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef LOGHIER_H
 #include "loghier.h"
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef NEWKBD_H
 #include <p2c/newkbd.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-#ifndef NEWCRT_H
 #include <p2c/newcrt.h>
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-#ifndef REGEX_H
 #include <p2c/regex.h>
-#endif
-
-
-#ifdef LOGSPC_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-
-
-
-
-extern Void Log_logspc_proc PP((log_action *act));
-
 
-#undef vextern
+extern void Log_logspc_proc (log_action *act);
 
 #endif /*LOGSPC_H*/
 
diff --git a/log/src/logstuff.c b/log/src/logstuff.c
index 1b09efe..c9b1712 100644
--- a/log/src/logstuff.c
+++ b/log/src/logstuff.c
@@ -195,7 +195,7 @@ void BEEPER(int x, int y)
 }
 
 
-boolean nk_setcapslock(boolean newval)
+int nk_setcapslock(int newval)
 {
   return false;
 }
@@ -222,7 +222,7 @@ char *my_strdup(char *s)
 
 extern struct ext_proc ext_proc_table[];
 
-boolean findprocedure(char *name, Void (**proc)())
+int findprocedure(char *name, void (**proc)())
 {
   int i;
 
diff --git a/log/src/logstuff.h b/log/src/logstuff.h
index f13a2ba..885b3f0 100644
--- a/log/src/logstuff.h
+++ b/log/src/logstuff.h
@@ -1,11 +1,10 @@
 
-
 extern void init_X_screen(void);
 extern void recolor_log_cursors(int color, int force);
 extern void choose_log_cursor(int curs);
 
 struct ext_proc {
   char *name;
-  Void (*proc)();
+  void (*proc)();
 };
 
diff --git a/log/src/lplot.c b/log/src/lplot.c
index fece2ab..5059bbe 100644
--- a/log/src/lplot.c
+++ b/log/src/lplot.c
@@ -1,7 +1,3 @@
-/* Output from p2c, the Pascal-to-C translator */
-/* From input file "lplot.text" */
-
-
 /* "LOG", the circuit editing and simulation system,
    "DigLOG", the digital simulator for LOG.
    Copyright (C) 1985, 1990 David Gillespie.
@@ -34,24 +30,10 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 /* 7/12/88 -- Changed newasm_ to na_ -- DAVE */
 
 
-
-/*$debug${*/
-
-
-
 #include <p2c/p2c.h>
-
-
-#define LPLOT_G
 #include "lplot.h"
 
 
-
-
-
-
-
-
 #define defcolor        "BLACK"
 
 #define numscreenpens   6
@@ -109,10 +91,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 #define EXEC            '\003'
 
-
-
-
-
 typedef enum {
   lplot_nodev, lplot_screen, lplot_plotter, lplot_file
 } lplot_dev;
@@ -147,51 +125,47 @@ typedef struct snapplotrec {
 #define dft_siz        (50L)     /* default gate text size */
 
 
-Static log_action *lp_gg;
-
-
-Static ne_desc nedesc;
-
+static log_action *lp_gg;
 
-Static na_strlist *lplotlbl;
-Static short lplotnumattrs;
-Static log_kattrrec *lplotkattr;
-Static log_gattrrec *lplotgattr;
 
-Static na_strlist *filelbl;
-Static short filenumattrs;
-Static log_kattrrec *filekattr;
-Static log_gattrrec *filegattr;
+static ne_desc nedesc;
 
-Static na_strlist *datalbl;
-Static short datanumattrs;
-Static log_kattrrec *datakattr;
-Static log_gattrrec *datagattr;
-Static Char xfun[256], yfun[256];
 
-Static na_strlist *varslbl;
-Static short varsnumattrs;
-Static log_kattrrec *varskattr;
-Static log_gattrrec *varsgattr;
+static na_strlist *lplotlbl;
+static short lplotnumattrs;
+static log_kattrrec *lplotkattr;
+static log_gattrrec *lplotgattr;
 
-Static na_strlist *nosoldergates, *noplotgates;
+static na_strlist *filelbl;
+static short filenumattrs;
+static log_kattrrec *filekattr;
+static log_gattrrec *filegattr;
 
-Static na_strlist *colors, *pencolors;
-Static short screenpen[numscreenpens];
+static na_strlist *datalbl;
+static short datanumattrs;
+static log_kattrrec *datakattr;
+static log_gattrrec *datagattr;
+static char xfun[256], yfun[256];
 
+static na_strlist *varslbl;
+static short varsnumattrs;
+static log_kattrrec *varskattr;
+static log_gattrrec *varsgattr;
 
+static na_strlist *nosoldergates, *noplotgates;
 
+static na_strlist *colors, *pencolors;
+static short screenpen[numscreenpens];
 
 
-
-Static Void lplotproc1()
+static void lplotproc1()
 {
 }
 
 
-Static Void lplotproc2()
+static void lplotproc2()
 {
-  Char buf[256];
+  char buf[256];
   log_action *WITH;
   log_gattrrec *WITH1;
 
@@ -235,16 +209,16 @@ Static Void lplotproc2()
 }
 
 
-Static Void lplotproc3()
+static void lplotproc3()
 {
 }
 
 
-Static Void configlplot()
+static void configlplot()
 {
-  Void (*TEMP) PV();
-  Void (*TEMP1) PV();
-  Void (*TEMP2) PV();
+  void (*TEMP) ();
+  void (*TEMP1) ();
+  void (*TEMP2) ();
 
   TEMP = lplotproc1;
   TEMP1 = lplotproc2;
@@ -254,13 +228,11 @@ Static Void configlplot()
 }
 
 
-
-Static Void fileproc1()
+static void fileproc1()
 {
 }
 
-
-Static Void fileproc2()
+static void fileproc2()
 {
   log_action *WITH;
   log_gattrrec *WITH1;
@@ -277,16 +249,16 @@ Static Void fileproc2()
 }
 
 
-Static Void fileproc3()
+static void fileproc3()
 {
 }
 
 
-Static Void configfile()
+static void configfile()
 {
-  Void (*TEMP) PV();
-  Void (*TEMP1) PV();
-  Void (*TEMP2) PV();
+  void (*TEMP) ();
+  void (*TEMP1) ();
+  void (*TEMP2) ();
 
   TEMP = fileproc1;
   TEMP1 = fileproc2;
@@ -296,13 +268,11 @@ Static Void configfile()
 }
 
 
-
-Static Void dataproc1()
+static void dataproc1()
 {
 }
 
-
-Static Void changexfunc()
+static void changexfunc()
 {
   log_gattrrec *WITH;
 
@@ -317,7 +287,7 @@ Static Void changexfunc()
 }
 
 
-Static Void changeyfunc()
+static void changeyfunc()
 {
   log_gattrrec *WITH;
 
@@ -332,7 +302,7 @@ Static Void changeyfunc()
 }
 
 
-Local Void swap_(i, j)
+void swap_(i, j)
 long i, j;
 {
   double r;
@@ -345,7 +315,7 @@ long i, j;
 }
 
 
-Static Void dataproc2()
+static void dataproc2()
 {
   log_action *WITH;
   log_gattrrec *WITH1;
@@ -401,16 +371,16 @@ Static Void dataproc2()
 }
 
 
-Static Void dataproc3()
+static void dataproc3()
 {
 }
 
 
-Static Void configdata()
+static void configdata()
 {
-  Void (*TEMP) PV();
-  Void (*TEMP1) PV();
-  Void (*TEMP2) PV();
+  void (*TEMP) ();
+  void (*TEMP1) ();
+  void (*TEMP2) ();
 
   strcpy(xfun, datagattr[x_func - 1].UU.c);
   strcpy(yfun, datagattr[y_func - 1].UU.c);
@@ -423,12 +393,12 @@ Static Void configdata()
 
 
 
-Static Void varsproc1()
+static void varsproc1()
 {
 }
 
 
-Static Void varsproc2()
+static void varsproc2()
 {
   log_action *WITH;
   log_gattrrec *WITH1;
@@ -444,16 +414,16 @@ Static Void varsproc2()
 }
 
 
-Static Void varsproc3()
+static void varsproc3()
 {
 }
 
 
-Static Void configvars()
+static void configvars()
 {
-  Void (*TEMP) PV();
-  Void (*TEMP1) PV();
-  Void (*TEMP2) PV();
+  void (*TEMP) ();
+  void (*TEMP1) ();
+  void (*TEMP2) ();
 
   TEMP = varsproc1;
   TEMP1 = varsproc2;
@@ -489,7 +459,7 @@ typedef enum {
 typedef double realarray[log_million];
 
 
-static Char *log_actionkinds_NAMES[] = {
+static char *log_actionkinds_NAMES[] = {
   "ACT_INIT", "ACT_ENDINIT", "ACT_EXIT", "ACT_CLEARMSG", "ACT_STATUS",
   "ACT_CNF", "ACT_IMMED", "ACT_FUNC", "ACT_COLOR", "ACT_SELECT", "ACT_CLEAR",
   "ACT_EDIT", "ACT_PASS", "ACT_TSTEP", "ACT_ERASEGATE", "ACT_TOUCHGATE",
@@ -505,26 +475,26 @@ static Char *log_actionkinds_NAMES[] = {
 } ;
 
 
-/* Local variables for Log_lplot_proc: */
+/* variables for Log_lplot_proc: */
 struct LOC_Log_lplot_proc {
-  Char pspipe[256], psfilenm[256];
+  char pspipe[256], psfilenm[256];
   lplot_dev plotdev;
   FILE *outf;
   long quality;
-  Char prefstr[2];
+  char prefstr[2];
   short baseline, menuy1, menuy2;
-  boolean psfile;
+  int psfile;
 } ;
 
 
-Local long getcolor(name_, def, LINK)
-Char *name_, *def;
+long getcolor(name_, def, LINK)
+char *name_, *def;
 struct LOC_Log_lplot_proc *LINK;
 {
-  Char name[256];
+  char name[256];
   na_strlist *l1, *l2;
-  Char STR1[256];
-  Char STR2[256];
+  char STR1[256];
+  char STR2[256];
 
   strcpy(name, name_);
   strcpy(STR1, strltrim(strrtrim(strupper(STR2, name))));
@@ -552,16 +522,16 @@ struct LOC_Log_lplot_proc *LINK;
 }
 
 
-Local Void initplotter(device, LINK)
+void initplotter(device, LINK)
 lplot_dev device;
 struct LOC_Log_lplot_proc *LINK;
 {
   long addr, i;
-  Char size;
-  Char fn[256];
+  char size;
+  char fn[256];
   log_action *WITH;
   long FORLIM;
-  Char STR2[256];
+  char STR2[256];
 
   *LINK->pspipe = '\0';
   WITH = lp_gg;
@@ -688,7 +658,7 @@ struct LOC_Log_lplot_proc *LINK;
 #undef baselineoff
 
 
-Local Void setwindow(x1, y1, x2, y2, LINK)
+void setwindow(x1, y1, x2, y2, LINK)
 long x1, y1, x2, y2;
 struct LOC_Log_lplot_proc *LINK;
 {
@@ -732,7 +702,7 @@ struct LOC_Log_lplot_proc *LINK;
 }
 
 
-Local Void finish(LINK)
+void finish(LINK)
 struct LOC_Log_lplot_proc *LINK;
 {
   if (LINK->plotdev == lplot_nodev)
@@ -774,19 +744,19 @@ struct LOC_Log_lplot_proc *LINK;
 }
 
 
-Local Void drawstr2(x, y, str_, LINK)
+void drawstr2(x, y, str_, LINK)
 long x, y;
-Char *str_;
+char *str_;
 struct LOC_Log_lplot_proc *LINK;
 {
-  Char str[256];
+  char str[256];
 
   strcpy(str, str_);
   (*lp_gg->hook.drawstr)((int)x, (int)y, str);
 }
 
 
-Local Void sortints(x, y, LINK)
+void sortints(x, y, LINK)
 long *x, *y;
 struct LOC_Log_lplot_proc *LINK;
 {
@@ -799,20 +769,20 @@ struct LOC_Log_lplot_proc *LINK;
   *y = t;
 }
 
-/* Local variables for munchlabel: */
+/* variables for munchlabel: */
 struct LOC_munchlabel {
   struct LOC_Log_lplot_proc *LINK;
-  Char *s;
+  char *s;
   long i;
-  Char mode[256];
+  char mode[256];
 } ;
 
-Local Void modestr(s1, LINK)
-Char *s1;
+void modestr(s1, LINK)
+char *s1;
 struct LOC_munchlabel *LINK;
 {
   long j, FORLIM;
-  Char STR1[256];
+  char STR1[256];
 
   if (!strcmp(s1, LINK->mode))
     return;
@@ -831,14 +801,14 @@ struct LOC_munchlabel *LINK;
 }
 
 
-Local Void munchlabel(s_, LINK)
-Char *s_;
+void munchlabel(s_, LINK)
+char *s_;
 struct LOC_Log_lplot_proc *LINK;
 {
   struct LOC_munchlabel V;
   uchar ch;
-  Char STR1[4];
-  Char STR3[8];
+  char STR1[4];
+  char STR3[8];
 
   V.LINK = LINK;
   V.s = s_;
@@ -847,7 +817,7 @@ struct LOC_Log_lplot_proc *LINK;
   while (V.i <= strlen(V.s)) {
     ch = V.s[V.i - 1];
     if (ch >= 128) {
-/* p2c: lplot.text, line 649: Note: Character >= 128 encountered [281] */
+/* p2c: lplot.text, line 649: Note: character >= 128 encountered [281] */
       if (*LINK->prefstr == '\0') {
 	strcpy_overlap(V.s + V.i - 1, V.s + V.i);
 	V.i--;
@@ -918,8 +888,8 @@ struct LOC_Log_lplot_proc *LINK;
 #undef second
 
 
-Local Void refrplot(high, LINK)
-boolean high;
+void refrplot(high, LINK)
+int high;
 struct LOC_Log_lplot_proc *LINK;
 {
   if (high)
@@ -930,8 +900,8 @@ struct LOC_Log_lplot_proc *LINK;
   XFlush(m_display);
 }
 
-Local Void refrfile(high, LINK)
-boolean high;
+void refrfile(high, LINK)
+int high;
 struct LOC_Log_lplot_proc *LINK;
 {
   if (high)
@@ -942,13 +912,13 @@ struct LOC_Log_lplot_proc *LINK;
   XFlush(m_display);
 }
 
-/* Local variables for doplotfile: */
+/* variables for doplotfile: */
 struct LOC_doplotfile {
   struct LOC_Log_lplot_proc *LINK;
-  boolean lrefrflag;
+  int lrefrflag;
 } ;
 
-/* Local variables for plotfile: */
+/* variables for plotfile: */
 struct LOC_plotfile {
   struct LOC_doplotfile *LINK;
   long xx1, yy1, xx2, yy2, i;
@@ -956,7 +926,7 @@ struct LOC_plotfile {
   log_srec *mysbase;
 } ;
 
-Local Void bound(x, y, LINK)
+void bound(x, y, LINK)
 short x, y;
 struct LOC_plotfile *LINK;
 {
@@ -970,7 +940,7 @@ struct LOC_plotfile *LINK;
     LINK->yy2 = y;
 }
 
-Local Void addtempsolder(LINK)
+void addtempsolder(LINK)
 struct LOC_plotfile *LINK;
 {
   directions dir;
@@ -1086,12 +1056,12 @@ struct LOC_plotfile *LINK;
   }
 }
 
-Local Void plottext(v, LINK)
+void plottext(v, LINK)
 log_vectorrec *v;
 struct LOC_plotfile *LINK;
 {
   long xx, yy, tx, ty;
-  Char STR3[256];
+  char STR3[256];
 
   if (LINK->LINK->LINK->plotdev == lplot_screen
 	&& v->UU.U116.tsize < filegattr[gate_text_limit -1].UU.U73.i1)
@@ -1119,15 +1089,15 @@ struct LOC_plotfile *LINK;
   plot_genstring(xx, yy, STR3, v->UU.U116.sp);
 }
 
-Local Char *nodename(Result, num, LINK)
-Char *Result;
+char *nodename(Result, num, LINK)
+char *Result;
 long num;
 struct LOC_plotfile *LINK;
 {
-  Char STR1[256], STR2[256];
+  char STR1[256], STR2[256];
 
   if (num < 26) {
-    sprintf(Result, "%c", (Char)(num + 'A'));
+    sprintf(Result, "%c", (char)(num + 'A'));
     return Result;
   } else {
     sprintf(Result, "%s%s",
@@ -1139,7 +1109,7 @@ struct LOC_plotfile *LINK;
   }
 }
 
-Local Void plotfile(device, LINK)
+void plotfile(device, LINK)
 lplot_dev device;
 struct LOC_doplotfile *LINK;
 {
@@ -1148,8 +1118,8 @@ struct LOC_doplotfile *LINK;
   double rx1, ry1, rx2, ry2, rx3, ry3, rx4, ry4;
   long xarr[4], yarr[4];
   short rxx, rxy, ryx, ryy;
-  Char name[256], st[256];
-  Char ch;
+  char name[256], st[256];
+  char ch;
   log_krec *k;
   log_grec *g;
   log_hwrec *hw, *hw1;
@@ -1159,12 +1129,12 @@ struct LOC_doplotfile *LINK;
   log_brec *b;
   log_nrec *n;
   double soldersize;
-  boolean swap, horiz, flag, enabled;
+  int swap, horiz, flag, enabled;
   na_strlist *sl1, *sl2;
   log_action *WITH;
   long FORLIM;
   log_vectorrec *WITH2;
-  Char STR1[256];
+  char STR1[256];
 
   V.LINK = LINK;
   WITH = lp_gg;
@@ -1820,11 +1790,11 @@ $end$*/
 follows this is a quick hack to get something somewhat usable, we should
 go back later and make it cleaner --jl */
 
-Local Void zoomincommand(LINK)
+void zoomincommand(LINK)
 struct LOC_doplotfile *LINK;
 {
   long x1, y1, xx1, yy1, x2, y2, xx2, yy2;
-  Char ch;
+  char ch;
   log_action *WITH;
 
   WITH = lp_gg;
@@ -1872,11 +1842,11 @@ struct LOC_doplotfile *LINK;
 
 #endif
 
-Local Void zoomincommand(LINK)
+void zoomincommand(LINK)
 struct LOC_doplotfile *LINK;
 {
   long x1, y1, xx1, yy1, x2, y2, xx2, yy2;
-  Char ch;
+  char ch;
   log_action *WITH;
   
   m_colormode((long)m_xor);
@@ -1926,7 +1896,7 @@ struct LOC_doplotfile *LINK;
 }
 
 
-Local Void refrscreen(LINK)
+void refrscreen(LINK)
 struct LOC_doplotfile *LINK;
 {
   m_nocursor();
@@ -1945,12 +1915,12 @@ struct LOC_doplotfile *LINK;
 
 
 
-Local Void doplotfile(LINK)
+void doplotfile(LINK)
 struct LOC_Log_lplot_proc *LINK;
 {
   struct LOC_doplotfile V;
-  boolean exitflag;
-  Char ch;
+  int exitflag;
+  char ch;
   log_action *WITH;
 
   V.LINK = LINK;
@@ -2031,8 +2001,8 @@ struct LOC_Log_lplot_proc *LINK;
     case ' ':
     case 250:
     case 251:
-/* p2c: lplot.text, line 1685: Note: Character >= 128 encountered [281] */
-/* p2c: lplot.text, line 1685: Note: Character >= 128 encountered [281] */
+/* p2c: lplot.text, line 1685: Note: character >= 128 encountered [281] */
+/* p2c: lplot.text, line 1685: Note: character >= 128 encountered [281] */
       V.lrefrflag = true;
       break;
     }
@@ -2042,10 +2012,10 @@ struct LOC_Log_lplot_proc *LINK;
 #undef sc0
 #undef sc_
 
-/* Local variables for doplotdata: */
+/* variables for doplotdata: */
 struct LOC_doplotdata {
   struct LOC_Log_lplot_proc *LINK;
-  boolean lrefrflag;
+  int lrefrflag;
   na_strlist *timesym, *timesym2, *constants;
   double time;
   double *sigs, *vars;
@@ -2053,13 +2023,13 @@ struct LOC_doplotdata {
   long size, finalsize, numsigs;
 } ;
 
-Local Void initsymtab(LINK)
+void initsymtab(LINK)
 struct LOC_doplotdata *LINK;
 {
   na_strlist *l1;
   long i;
   log_hnrec *hn, *hn2;
-  Char name[256];
+  char name[256];
 
   LINK->constants = NULL;
   LINK->numsigs = 0;
@@ -2102,7 +2072,7 @@ struct LOC_doplotdata *LINK;
   }
   LINK->vars = (double *)Malloc(numuvars * sizeof(double));
   for (i = 1; i <= numuvars; i++) {
-    sprintf(name, "%c", (Char)(i + 64));
+    sprintf(name, "%c", (char)(i + 64));
     if (strlist_find(nedesc.symtab, name) == NULL) {
       l1 = strlist_append(&nedesc.symtab, name);
       ne_makerealvar(l1, &LINK->vars[i - 1]);
@@ -2111,7 +2081,7 @@ struct LOC_doplotdata *LINK;
   }
 }
 
-Local Void disposesymtab(LINK)
+void disposesymtab(LINK)
 struct LOC_doplotdata *LINK;
 {
   Free(LINK->sigs);
@@ -2120,8 +2090,8 @@ struct LOC_doplotdata *LINK;
   strlist_empty(&LINK->constants);
 }
 
-Local Char *neerror(Result, err, LINK)
-Char *Result;
+char *neerror(Result, err, LINK)
+char *Result;
 ne_errorkind err;
 struct LOC_doplotdata *LINK;
 {
@@ -2162,7 +2132,7 @@ struct LOC_doplotdata *LINK;
   return Result;
 }
 
-Local ne_errorkind whicherror(LINK)
+ne_errorkind whicherror(LINK)
 struct LOC_doplotdata *LINK;
 {
   ne_errorkind Result;
@@ -2196,29 +2166,29 @@ struct LOC_doplotdata *LINK;
   return Result;
 }
 
-Local Char *printnex(Result, nex, LINK)
-Char *Result;
+char *printnex(Result, nex, LINK)
+char *Result;
 ne_nexrec *nex;
 struct LOC_doplotdata *LINK;
 {
-  Char buf[256];
+  char buf[256];
 
   ne_uncompile(nex, buf, &nedesc);
   return strcpy(Result, buf);
 }
 
-Local Void computedata(LINK)
+void computedata(LINK)
 struct LOC_doplotdata *LINK;
 {
   ne_nexrec *xnex, *ynex;
   log_htrec *ht;
   long i, p;
   double xval, yval;
-  boolean nogood, nofuncs;
+  int nogood, nofuncs;
   long xerr, yerr;
   ne_errorkind err;
   long FORLIM;
-  Char STR1[256], STR4[256];
+  char STR1[256], STR4[256];
 
   nogood = false;
   nofuncs = false;
@@ -2238,7 +2208,7 @@ struct LOC_doplotdata *LINK;
       RECOVER(try7);
 	sprintf(STR4, "%s while computing %c",
 		neerror(STR1, (ne_errorkind)nedesc.error, LINK),
-		(Char)(i + 64));
+		(char)(i + 64));
 	(*lp_gg->hook.message)(STR4);
 	nogood = true;
 	if (P_escapecode == -20)
@@ -2352,15 +2322,15 @@ struct LOC_doplotdata *LINK;
   ENDTRY(try6);
 }
 
-Local Void disposedata(LINK)
+void disposedata(LINK)
 struct LOC_doplotdata *LINK;
 {
   Free(LINK->xvec);
   Free(LINK->yvec);
 }
 
-Local Char *isitlog(Result, n)
-Char *Result;
+char *isitlog(Result, n)
+char *Result;
 long n;
 {
   if (datagattr[n - 1].UU.nv == 1)
@@ -2369,14 +2339,14 @@ long n;
     return strcpy(Result, "linear");
 }
 
-Local Void plotdata(device, LINK)
+void plotdata(device, LINK)
 lplot_dev device;
 struct LOC_doplotdata *LINK;
 {
   double stupid;
   long x1, y1, x2, y2, i;
   log_action *WITH;
-  Char STR1[17], STR2[17];
+  char STR1[17], STR2[17];
   log_gattrrec *WITH1;
   double mintmp,maxtmp,inttmp;
 
@@ -2455,12 +2425,12 @@ struct LOC_doplotdata *LINK;
   finish(LINK->LINK);
 }
 
-Local Void zoomincommand_(LINK)
+void zoomincommand_(LINK)
 struct LOC_doplotdata *LINK;
 {
 }
 
-Local Void zoomoutcommand(LINK)
+void zoomoutcommand(LINK)
 struct LOC_doplotdata *LINK;
 {
   datagattr[x_min - 1].blnk = true;
@@ -2470,7 +2440,7 @@ struct LOC_doplotdata *LINK;
   LINK->lrefrflag = true;
 }
 
-Local Void refrscreen_(LINK)
+void refrscreen_(LINK)
 struct LOC_doplotdata *LINK;
 {
   m_nocursor();
@@ -2490,14 +2460,14 @@ struct LOC_doplotdata *LINK;
 
 
 
-Local Void doplotdata(xfunc_, yfunc_, LINK)
-Char *xfunc_, *yfunc_;
+void doplotdata(xfunc_, yfunc_, LINK)
+char *xfunc_, *yfunc_;
 struct LOC_Log_lplot_proc *LINK;
 {
   struct LOC_doplotdata V;
-  Char xfunc[256], yfunc[256];
-  boolean exitflag;
-  Char ch;
+  char xfunc[256], yfunc[256];
+  int exitflag;
+  char ch;
   log_action *WITH;
 
   V.LINK = LINK;
@@ -2599,8 +2569,8 @@ struct LOC_Log_lplot_proc *LINK;
     case ' ':
     case 250:
     case 251:
-/* p2c: lplot.text, line 2177: Note: Character >= 128 encountered [281] */
-/* p2c: lplot.text, line 2177: Note: Character >= 128 encountered [281] */
+/* p2c: lplot.text, line 2177: Note: character >= 128 encountered [281] */
+/* p2c: lplot.text, line 2177: Note: character >= 128 encountered [281] */
       V.lrefrflag = true;
       break;
     }
@@ -2612,21 +2582,21 @@ struct LOC_Log_lplot_proc *LINK;
 #undef next2pos
 
 
-Local boolean setupcomplete(LINK)
+int setupcomplete(LINK)
 struct LOC_Log_lplot_proc *LINK;
 {
   return true;
 }
 
 
-Local Void doit(args_, LINK)
-Char *args_;
+void doit(args_, LINK)
+char *args_;
 struct LOC_Log_lplot_proc *LINK;
 {
-  Char args[256], cmd[256], cmd2[256];
+  char args[256], cmd[256], cmd2[256];
   long esc, ior;
   log_action *WITH;
-  Char STR3[256];
+  char STR3[256];
 
   strcpy(args, args_);
   LINK->plotdev = lplot_nodev;
@@ -2665,20 +2635,20 @@ struct LOC_Log_lplot_proc *LINK;
   (*lp_gg->hook.redrawscreen)();
 }
 
-/* Local variables for parsecommand: */
+/* variables for parsecommand: */
 struct LOC_parsecommand {
   struct LOC_Log_lplot_proc *LINK;
-  Char args[256];
+  char args[256];
   na_strlist *l1;
 } ;
 
-Local na_strlist *getpenname(LINK)
+na_strlist *getpenname(LINK)
 struct LOC_parsecommand *LINK;
 {
-  Char word[256], buf[256];
+  char word[256], buf[256];
   long i;
   log_action *WITH;
-  Char STR1[256];
+  char STR1[256];
 
   WITH = lp_gg;
   (*WITH->hook.getword)(LINK->args, word);
@@ -2708,7 +2678,7 @@ struct LOC_parsecommand *LINK;
   }
 }
 
-Local Void getintattr(ga, LINK)
+void getintattr(ga, LINK)
 log_gattrrec *ga;
 struct LOC_parsecommand *LINK;
 {
@@ -2723,17 +2693,17 @@ struct LOC_parsecommand *LINK;
 }
 
 
-Local Void parsecommand(cmd_, args_, LINK)
-Char *cmd_, *args_;
+void parsecommand(cmd_, args_, LINK)
+char *cmd_, *args_;
 struct LOC_Log_lplot_proc *LINK;
 {
   struct LOC_parsecommand V;
-  Char cmd[256], buf[256];
+  char cmd[256], buf[256];
   na_strlist *l2;
   long i;
   log_action *WITH;
   log_gattrrec *WITH1;
-  Char STR3[256];
+  char STR3[256];
   double lw;
 
   V.LINK = LINK;
@@ -2763,7 +2733,7 @@ struct LOC_Log_lplot_proc *LINK;
       l2 = getpenname(&V);
       if (l2 != NULL) {
 	V.l1 = strlist_add(&colors, buf);
-	V.l1->value = (Anyptr)l2;
+	V.l1->value = (void *)l2;
       }
     }
   } else if (!strcmp(cmd, "PENS")) {
@@ -2852,7 +2822,7 @@ struct LOC_Log_lplot_proc *LINK;
 }
 
 
-Local Void status_lplot(LINK)
+void status_lplot(LINK)
 struct LOC_Log_lplot_proc *LINK;
 {
   na_strlist *l1;
@@ -2883,12 +2853,12 @@ struct LOC_Log_lplot_proc *LINK;
 }
 
 
-Local Void init_lplot(LINK)
+void init_lplot(LINK)
 struct LOC_Log_lplot_proc *LINK;
 {
   na_strlist *l1;
   log_action *WITH;
-  Char STR2[26];
+  char STR2[26];
 
   WITH = lp_gg;
   colors = NULL;
@@ -2916,14 +2886,8 @@ struct LOC_Log_lplot_proc *LINK;
   l1 = strlist_append(&lplotlbl, "I:Plotter HP-IB address:");
   l1 = strlist_append(&lplotlbl, "");
   l1 = strlist_append(&lplotlbl, "VPostScript,HPGL,FF:Output file type:");
-#ifdef OS2
-/* In the string below, : is not allowed. So, cannot set the drive letter. */
-    l1 = strlist_append(&lplotlbl,
- 		    "PostScript;C/tcpip/tmp/*.ps | lpr  *:Output file name:");
-#else
   l1 = strlist_append(&lplotlbl,
 		    "PostScript;C/tmp/*.ps | lpr  *:Output file name:");
-#endif
   l1 = strlist_append(&lplotlbl, "HPGL;Clplot.hpgl:Output file name:");
   l1 = strlist_append(&lplotlbl, "FF;Clplot.ff:Output file name:");
   (*WITH->hook.parselabel)(&lplotlbl, &lplotnumattrs, &lplotkattr);
@@ -2986,13 +2950,13 @@ struct LOC_Log_lplot_proc *LINK;
 }
 
 
-Local Char *actionname(Result, action, LINK)
-Char *Result;
+char *actionname(Result, action, LINK)
+char *Result;
 log_actionkinds action;
 struct LOC_Log_lplot_proc *LINK;
 {
   long i;
-  Char s[33];
+  char s[33];
 
 /* p2c: lplot.text, line 2541: Note:
  * Line breaker spent 0.0+2.00 seconds, 5000 tries on line 491 [251] */
@@ -3006,21 +2970,14 @@ struct LOC_Log_lplot_proc *LINK;
 
 
 
-
-
-
-
-Void Log_lplot_proc(lact)
-log_action *lact;
+void Log_lplot_proc(log_action *lact)
 {
   struct LOC_Log_lplot_proc V;
-  Char buf[256];
-  Char STR1[33];
-  Char STR2[44];
+  char buf[256];
+  char STR1[33];
+  char STR2[44];
   log_action *WITH;
 
-
-
   V.outf = NULL;
   sprintf(STR2, "LPLOT got %s", actionname(STR1, lact->action, &V));
   (*lact->hook.trace)(STR2);
@@ -3078,13 +3035,4 @@ log_action *lact;
     fclose(V.outf);
 }
 
-
-
-
-
-
-
-
-
-
 /* End. */
diff --git a/log/src/lplot.h b/log/src/lplot.h
index db644f0..0ac3a4e 100644
--- a/log/src/lplot.h
+++ b/log/src/lplot.h
@@ -1,68 +1,23 @@
-/* Header for module lplot, generated by p2c */
 #ifndef LPLOT_H
 #define LPLOT_H
 
 
-
-
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-#ifndef PLOT_H
 #include <p2c/plot.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef NEWCRT_H
 #include <p2c/newcrt.h>
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
 
 /*homeless orphans*/
 
-#ifndef FILEPACK_H
 #include <p2c/filepack.h>
-#endif
-
-#ifndef NUMEX_H
 #include <p2c/numex.h>
-#endif
-
-#ifndef PLOT_ROUTINES_H
 #include <p2c/plot_routines.h>
-#endif
-
-#ifndef CITINFOMOD_H
 #include <p2c/citinfomod.h>
-#endif
-
-
-#ifdef LPLOT_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-
-
-
-extern Void Log_lplot_proc PP((log_action *lact));
-
 
+extern void Log_lplot_proc (log_action *lact);
 
-#undef vextern
 
 #endif /*LPLOT_H*/
 
diff --git a/log/src/munch b/log/src/munch
index 3521645..f8fe11b 100755
--- a/log/src/munch
+++ b/log/src/munch
@@ -14,7 +14,7 @@ echo '#include "logstuff.h"'
 echo ''
 echo '/* Do not modify this file.  It is created automatically by "munch". */'
 echo ''
-sed -n -e 's/^[^U]*[_ ]\('$pattern'\).*$/extern Void \1();/p' munch.temp | sort
+sed -n -e 's/^[^U]*[_ ]\('$pattern'\).*$/extern void \1();/p' munch.temp | sort
 echo ''
 echo 'struct ext_proc ext_proc_table[] = {'
 cat munch.temp | sed -n -e 's/^[^U]*[_ ]\('$pattern'\).*$/  "\1", \1,/p' | sort
diff --git a/log/src/munch.coff b/log/src/munch.coff
deleted file mode 100755
index 58e514b..0000000
--- a/log/src/munch.coff
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-
-# create an initialization table from a list of .o files
-# for use with COFF-format systems. Tested on Apple AUX machines only
-# contributed by Michael Godfrey, Stanford
-# rename this file to be "munch" to enable it
-
-pattern=$1
-shift
-
-nm $* > munch.temp
-
-echo '#include <p2c/p2c.h>'
-echo '#include "logstuff.h"'
-echo ''
-echo '/* Do not modify this file.  It is created automatically by "munch". */'
-echo ''
-  echo '/* Output for COFF format */'
-  sed -n -e 's/^\('$pattern'\).*$/extern Void \1();/p' munch.temp | sort
-
-echo ''
-echo 'struct ext_proc ext_proc_table[] = {'
-  cat munch.temp | sed -n -e 's/^\('$pattern'\).*$/  "\1", \1,/p' | sort
-
-echo '  NULL, NULL'
-echo '};'
-echo ''
-
-
-
diff --git a/log/src/munch.default b/log/src/munch.default
deleted file mode 100755
index 3521645..0000000
--- a/log/src/munch.default
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-# create an initialization table from a list of .o files
-# use for linux, SunOS and 68K/based HPUX machines; for other machines, 
-# rename the appropriate munch.XXXX files to be munch
-
-pattern=$1
-shift
-
-nm $* > munch.temp
-
-echo '#include <p2c/p2c.h>'
-echo '#include "logstuff.h"'
-echo ''
-echo '/* Do not modify this file.  It is created automatically by "munch". */'
-echo ''
-sed -n -e 's/^[^U]*[_ ]\('$pattern'\).*$/extern Void \1();/p' munch.temp | sort
-echo ''
-echo 'struct ext_proc ext_proc_table[] = {'
-cat munch.temp | sed -n -e 's/^[^U]*[_ ]\('$pattern'\).*$/  "\1", \1,/p' | sort
-echo '  NULL, NULL'
-echo '};'
-echo ''
-
diff --git a/log/src/munch.hp800 b/log/src/munch.hp800
deleted file mode 100755
index a450973..0000000
--- a/log/src/munch.hp800
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-# create an initialization table from a list of .o files
-# for use with HP Series 800 machines only
-# contributed by Tobi Delbruck, Caltech
-# rename this file to be "munch" to enable it
-
-pattern=$1
-shift
-nm $* > munch.temp
-echo '#include <p2c/p2c.h>'
-echo '#include "logstuff.h"'
-echo ''
-echo '/* Do not modify this file.  It is created automatically by "munch". */'
-echo ''
-sed -n -e 's/^\('$pattern'\).*$/extern Void \1();/p' munch.temp | sort
-echo ''
-echo 'struct ext_proc ext_proc_table[] = {'
-cat munch.temp | sed -n -e 's/^\('$pattern'\).*$/  "\1", \1,/p' | sort
-echo '  NULL, NULL'
-echo '};'
-echo ''
-
diff --git a/log/src/munch.rs6000 b/log/src/munch.rs6000
deleted file mode 100755
index 7db0e0c..0000000
--- a/log/src/munch.rs6000
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-# create an initialization table from a list of .o files
-# for use with IBM 6000 series machines only
-# contributed by Gary Liu, Caltech Physics
-# rename this file to be "munch" to enable it
-
-pattern=$1
-shift
-
-/usr/ucb/nm $* > munch.temp
-
-echo '#include <p2c/p2c.h>'
-echo '#include "logstuff.h"'
-echo ''
-echo '/* Do not modify this file.  It is created automatically by "munch". */'
-echo ''
-sed -n -e 's/^[^U]*[\.]\('$pattern'\).*$/extern Void \1();/p' munch.temp | sort
-echo ''
-echo 'struct ext_proc ext_proc_table[] = {'
-cat munch.temp | sed -n -e 's/^[^U]*[\.]\('$pattern'\).*$/  "\1", \1,/p' | sort
-echo '  NULL, NULL'
-echo '};'
-echo ''
-
diff --git a/log/src/munch.solaris2 b/log/src/munch.solaris2
deleted file mode 100755
index c76fc32..0000000
--- a/log/src/munch.solaris2
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-# create an initialization table from a list of .o files
-# use for sparc and hp300 machines; for other machines, 
-# rename the appropriate munch.XXXX files to be munch
-
-pattern=$1
-shift
-
-nm -p $* > munch.temp
-
-echo '#include <p2c/p2c.h>'
-echo '#include "logstuff.h"'
-echo ''
-echo '/* Do not modify this file.  It is created automatically by "munch". */'
-echo ''
-sed -n -e 's/^[^U]*[_ ]\('$pattern'\).*$/extern Void \1();/p' munch.temp | sort
-echo ''
-echo 'struct ext_proc ext_proc_table[] = {'
-cat munch.temp | sed -n -e 's/^[^U]*[_ ]\('$pattern'\).*$/  "\1", \1,/p' | sort
-echo '  NULL, NULL'
-echo '};'
-echo ''
-
diff --git a/log/src/munch.temp b/log/src/munch.temp
index b98f593..d846b1c 100644
--- a/log/src/munch.temp
+++ b/log/src/munch.temp
@@ -1,32 +1,35 @@
 
 logcom.o:
-00000011 b drawtime
-00000030 t edit_1.isra.3
+00000470 T attrsame
+00000550 T checkcolors
+000003a0 T displaystate
+00000014 b drawtime
+00000030 t edit_1.isra.1
          U findprocedure
          U free
          U _GLOBAL_OFFSET_TABLE_
-000007d7 t .L197
-000018b0 t .L224
-000018d0 t .L226
-00001bc0 t .L228
-000019b0 t .L229
-00001b80 t .L230
-00001a00 t .L231
-000019f0 t .L232
-00001bd8 t .L233
-00001420 t .L234
-00001960 t .L235
-00001900 t .L236
-000007b0 t .L67
-000007e0 t .L69
-000007d0 t .L71
-00000b18 t .L73
-00000b90 t .L74
-00000ae0 t .L75
-00000958 t .L76
-000003f0 t .L77
-00000930 t .L78
-000008f0 t .L79
+00000b60 t .L100
+000005d0 t .L101
+00000b38 t .L102
+00000af0 t .L103
+000009ca t .L221
+00001af0 t .L248
+00001b10 t .L250
+00001e00 t .L252
+00001bf0 t .L253
+00001dc0 t .L254
+00001c40 t .L255
+00001c30 t .L256
+00001e18 t .L257
+00001660 t .L258
+00001ba0 t .L259
+00001b40 t .L260
+00000998 t .L91
+000009d8 t .L93
+000009c0 t .L95
+00000d20 t .L97
+00000da0 t .L98
+00000ce8 t .L99
 00000000 r .LC0
 00000003 r .LC1
 00000000 r .LC10
@@ -49,11 +52,11 @@ logcom.o:
 00000064 r .LC8
 00000072 r .LC9
 00000350 T Log_0_proc
-00002020 T Log_17_proc
+00002290 T Log_17_proc
 00000370 T Log_1_proc
-00001340 T Log_2_proc
-000013e0 T Log_7_proc
-000003a0 T Log_7_time
+00001580 T Log_2_proc
+00001620 T Log_7_proc
+00000580 T Log_7_time
          U malloc
          U __MallocTemp__
          U m_centerstr
@@ -67,9 +70,9 @@ logcom.o:
          U nc_printf
 00000000 t nullproc
 0000000c b numprocs_7
-000000d0 b old3simstate
-000000d4 b oldoldsimstate
-00000018 b oldperftime
+000000f8 b old3simstate
+000000fc b oldoldsimstate
+00000020 b oldperftime
          U _OutMem
 00000008 b procs_7
 00000010 b refrtime
@@ -88,18 +91,21 @@ logcom.o:
          U strsub
          U strupper
          U sysclock
-00000020 b timeattr
-000000c9 b timechanged
-000000cc b timecolor
-000000ca b timeexists
-0000001c b timeinfo
-000000c8 b timeinit
+00000040 b timeattr
+000000ec b timechanged
+000000f4 b timecolor
+000000f0 b timeexists
+00000024 b timeinfo
+000000e8 b timeinit
+000004e0 T touchwatch
 00000004 b unfoundkind
 00000000 b unfoundshown
-00000012 b watchflag
-00000014 b watchtime
+00000018 b watchflag
+0000001c b watchtime
+00000000 T __x86.get_pc_thunk.ax
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.dx
+00000000 T __x86.get_pc_thunk.si
 
 logsim.o:
 000001a0 r bcomb
@@ -115,7 +121,7 @@ logsim.o:
 00000010 b dignumattrs
 00000020 t digproc1
 00000030 t digproc2
-00000540 t digproc3
+000004a0 t digproc3
          U dump_16
          U edit_16
          U executegates
@@ -123,60 +129,60 @@ logsim.o:
          U floor
          U free
          U _GLOBAL_OFFSET_TABLE_
-00000030 b gndsig
+0000003c b gndsig
 00000160 r histcolortable
          U _IO_getc
          U __isoc99_fscanf
-0000002b b isstable
+00000034 b isstable
 00000018 b kbase_16
-0000090d t .L104
-00000918 t .L106
-000009d0 t .L108
-000009a0 t .L109
-00000878 t .L110
-00000940 t .L111
-000020d0 t .L320
-00002d40 t .L322
-00001f10 t .L323
-00001fc0 t .L324
-00002050 t .L325
-000020a0 t .L326
-00002220 t .L327
-00002250 t .L328
-000022a0 t .L329
-000022c0 t .L330
-00002300 t .L331
-00002360 t .L332
-00002458 t .L333
-00002470 t .L334
-00002490 t .L335
-000024b0 t .L336
-00002528 t .L337
-000025a8 t .L338
-000025c0 t .L339
-000025e0 t .L340
-00002610 t .L341
-00002640 t .L342
-00002690 t .L343
-00002670 t .L344
-000026c0 t .L345
-00002738 t .L346
-00002ff0 t .L347
+00000880 t .L100
+00000930 t .L102
+00000908 t .L103
+000007d8 t .L104
+000008a8 t .L105
+00002260 t .L346
 00003010 t .L348
-00002df0 t .L349
-00002e78 t .L350
-00002f60 t .L351
-00002fa0 t .L352
-00002760 t .L353
-000027d0 t .L354
-00002888 t .L355
-000029b8 t .L356
-00002a70 t .L357
-00002de0 t .L358
-00002b10 t .L359
-00001f90 t .L649
+000020a0 t .L349
+00002150 t .L350
+000021e0 t .L351
+00002230 t .L352
+000023b0 t .L353
+000023e0 t .L354
+00002430 t .L355
+00002450 t .L356
+00002490 t .L357
+000024f8 t .L358
+000025a0 t .L359
+000025c0 t .L360
+000025e0 t .L361
+00002600 t .L362
+00002680 t .L363
+00002708 t .L364
+00002720 t .L365
+00002740 t .L366
+00002770 t .L367
+000027a0 t .L368
+00002a88 t .L369
+00002800 t .L370
+00003168 t .L371
+000027d0 t .L372
+00002cd0 t .L373
+00002cf0 t .L374
+00002ac0 t .L375
+00002b50 t .L376
+00002c40 t .L377
+00002c80 t .L378
+00002828 t .L379
+000028a0 t .L380
+00002958 t .L381
+000030b0 t .L382
+00002d10 t .L383
+00002db8 t .L384
+00002dd0 t .L385
+00002120 t .L639
+0000086f t .L98
 00000000 r .LC1
-00000028 r .LC10
+0000004a r .LC10
 0000005b r .LC11
 00000060 r .LC12
 00000066 r .LC13
@@ -215,7 +221,7 @@ logsim.o:
 000001dc r .LC45
 000001e0 r .LC46
 00000008 r .LC47
-00000042 r .LC5
+00000000 r .LC5
 00000000 r .LC50
 00000008 r .LC51
 000001e6 r .LC52
@@ -225,37 +231,37 @@ logsim.o:
 000000bc r .LC56
 00000208 r .LC57
 00000211 r .LC58
-00000000 r .LC6
-00000046 r .LC7
-0000004c r .LC8
-00000051 r .LC9
+00000035 r .LC6
+0000003b r .LC7
+00000040 r .LC8
+00000028 r .LC9
 00000004 b ledoffcolor
 00000006 b ledoncolor
-000013b0 T Log_16_7seg
-00000ec0 T Log_16_break
+000013d0 T Log_16_7seg
+00000e30 T Log_16_break
          U log_16_bv
-00000840 T Log_16_clock
-00001ea0 T log_16_conf
+000007a0 T Log_16_clock
+00001ee0 T log_16_conf
 00000160 t log_16_eraled
 00000000 t log_16_input
          U log_16_iv
-00001b00 T Log_16_keypad
+00001b30 T Log_16_keypad
 00000080 t log_16_led
-00000580 T Log_16_ledgate
-000006c0 T Log_16_ledgate2
-000004c0 T log_16_noprog
-00000550 t log_16_ocoutput
-000003a0 t log_16_output
+000004e0 T Log_16_ledgate
+00000620 T Log_16_ledgate2
+00000420 T log_16_noprog
+000004b0 t log_16_ocoutput
+00000310 t log_16_output
 00000200 t log_16_plotled
-00001ec0 T Log_16_proc
-00000e80 T Log_16_pulse
-00000f30 T Log_16_scope
-00000c00 T Log_16_switch
+00002050 T Log_16_proc
+00000df0 T Log_16_pulse
+00000eb0 T Log_16_scope
+00000b70 T Log_16_switch
          U log_16_vi
          U logsima_action
          U logsima_init
          U logsima_tool_16
-00000410 t makeconstpin
+00000380 t makeconstpin.isra.6
 00000028 b maketimebid
          U malloc
          U __MallocTemp__
@@ -267,48 +273,49 @@ logsim.o:
          U nc_fprintf
          U nc_gotoXY
          U nc_printf
-00000044 b newsystime
+00000050 b newsystime
 00000020 b nexttimebid
 0000001c b noprogloaded
 00000010 t nullkindproc
-00000040 b oldsystime
+0000004c b oldsystime
          U _OutMem
-00000029 b passready
-00000310 t plotline
+0000002c b passready
+00001330 T plotline
          U P_rand
          U read_16
-00000038 b resetcounter
-0000002c b resetsig
+00000044 b resetcounter
+00000038 b resetsig
 00000002 b scopecolor
 00000000 b scopescancolor
+00001f00 T setupkindproc
          U sprintf
-0000002a b stabilizing
-0000003c b stabtime
+00000030 b stabilizing
+00000048 b stabtime
          U __stack_chk_fail_local
          U strlist_append
          U strlist_init
          U strlist_insert
          U timers_sysclock
-00000034 b vddsig
+00000040 b vddsig
 00000000 T __x86.get_pc_thunk.ax
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.dx
 
 logdig.o:
 00000000 R log_16_bv
-0000000c R log_16_iv
+00000014 R log_16_iv
 00000008 R log_16_vb
-0000001c R log_16_vi
+00000024 R log_16_vi
 
 logsimasm.o:
 00000520 r and_table
 00000020 b callcache
 0000039c b callcache_next
-00000c40 T callgate
+00000c30 T callgate
 00000b70 T clearnodes
 00000bc0 T copynodes
-00000d60 T executegates
-00000cc0 T executeprog
+00000d50 T executegates
+00000cb0 T executeprog
          U findprocedure
 00000400 r fix_table
 000000d0 t g_expr
@@ -370,10 +377,8 @@ logsimasm.o:
 00000998 t .L82
 00000000 r .LC0
          U log_16_noprog
-00000020 C logsima_action
-00000004 C logsima_dig_inst
+         U logsima_action
 00000b40 T logsima_init
-00000004 C logsima_tool_16
 000004e0 r nand_table
          U nc_printf
 00000460 r nor_table
@@ -391,170 +396,175 @@ logsimasm.o:
 00000420 r xor_table
 
 logsimed.o:
-00000160 t append.isra.4
-00001740 t assem
-00002e70 T assem_16
+000001b0 T append
+000013e0 T assem
+00002af0 T assem_16
+00003590 T bogusreadln
          U __ctype_b_loc
-00002a40 T dasm_16
-00001b40 t dasmop
-000032b0 t doassem
-00004400 T dump_16
-000033d0 T edit_16
+00001140 T dasm_16
+00002fd0 T dasminst
+00000310 T dasmop
+000010c0 T dasmoppar
+00003430 T deleteinst
+00003470 T doassem
+00004790 T dump_16
+00003620 T edit_16
          U _Escape
-00000470 t factor
+000017f0 T factor
          U free
+000002d0 T getpseudo
          U _GLOBAL_OFFSET_TABLE_
-00002dd0 T indent_16
-000002e0 t insertinst
-00000000 t instlen.part.2
+000012c0 T indent_16
+000032b0 T insertinst
+000012f0 T instlen
+00000000 t instlen.part.0
 00000064 t .L1
 00000048 t .L11
+00000ec8 t .L116
+00000b47 t .L117
+00000b55 t .L119
+00000a31 t .L120
+00000a49 t .L121
+00000aa9 t .L122
+00000b39 t .L123
+00000ab4 t .L124
+00000af3 t .L125
+00000b09 t .L126
+00000b21 t .L127
+00000ba3 t .L128
+00000bb1 t .L129
+00000bbf t .L130
+00000bcd t .L131
+00000c54 t .L132
+00000d3a t .L133
+00000d8e t .L134
+00000e70 t .L135
 000000f0 t .L14
 00000140 t .L15
 00000128 t .L16
 00000110 t .L17
+0000061c t .L204
 000000d0 t .L21
 000000b0 t .L22
 000000d8 t .L23
 00000050 t .L3
-00001bd0 t .L351
-00001eb0 t .L352
-00001bf0 t .L353
-00001b98 t .L355
-00001e80 t .L356
-00001e58 t .L357
-00001e10 t .L358
-00001dc8 t .L359
-00001d50 t .L360
-00001d10 t .L361
-00001cc0 t .L362
-00001c58 t .L363
-00001c40 t .L364
-00002815 t .L365
-00001ef8 t .L366
-00001f0d t .L368
-00001f29 t .L369
-00001f45 t .L370
-00001f61 t .L371
-00001f7d t .L372
-00001f99 t .L373
-00001fb5 t .L374
-00002827 t .L377
-00002029 t .L378
-000022a7 t .L380
-00002397 t .L381
-000021ef t .L382
-0000220b t .L383
-00002259 t .L384
-000022ff t .L385
-00001fca t .L386
-00001ec8 t .L387
-000020e0 t .L388
-00002164 t .L389
-00002081 t .L390
-000020d5 t .L391
-00002731 t .L409
-000023b3 t .L411
-00002408 t .L412
-0000241c t .L413
-00002473 t .L414
-0000247b t .L415
-000024d7 t .L416
-000024df t .L417
-00002520 t .L418
-00002501 t .L419
-00002515 t .L420
-00002534 t .L421
-0000253f t .L422
-0000254a t .L423
-000025c0 t .L424
-00002699 t .L425
-0000273c t .L426
-000026e5 t .L427
-00001ef1 t .L474
 00000070 t .L5
+0000039c t .L59
+000005d8 t .L60
+000003c0 t .L61
+00000370 t .L63
+000005b0 t .L64
+00000590 t .L65
+00000550 t .L66
+00000508 t .L67
+000004b0 t .L68
+00000490 t .L69
 00000090 t .L7
+00000448 t .L70
+000003f0 t .L71
+000003d8 t .L72
+00000623 t .L74
+0000063b t .L76
+00000649 t .L77
+00000657 t .L78
+00000665 t .L79
 00000058 t .L8
+00000673 t .L80
+00000681 t .L81
+0000068f t .L82
+000006e6 t .L86
+000009be t .L88
+00000a11 t .L89
+000008a4 t .L90
+000008c4 t .L91
+00000903 t .L92
+00000942 t .L93
+000006a7 t .L94
+000005f0 t .L95
+00000780 t .L96
+00000811 t .L97
+00000739 t .L98
+00000772 t .L99
 00000000 r .LC0
-00000002 r .LC1
-00000027 r .LC10
-0000002c r .LC11
-0000002f r .LC12
-00000034 r .LC13
-00000039 r .LC14
-0000003e r .LC15
-00000042 r .LC16
-00000047 r .LC17
-0000004a r .LC18
-0000004f r .LC19
-00000005 r .LC2
-00000053 r .LC20
-00000055 r .LC21
-0000005a r .LC22
-0000005f r .LC23
-00000061 r .LC24
-00000067 r .LC25
-00000069 r .LC26
-0000006e r .LC27
-00000072 r .LC28
-00000079 r .LC29
-00000007 r .LC3
-0000007f r .LC30
-00000087 r .LC31
-0000008b r .LC32
-00000090 r .LC33
-00000093 r .LC34
-00000097 r .LC35
-0000009b r .LC36
-000000a0 r .LC37
-000000a4 r .LC38
-000000ac r .LC39
-0000000f r .LC4
-000000b4 r .LC40
-000000bb r .LC41
-000000c3 r .LC42
-000000c9 r .LC43
-000000cf r .LC44
-000000d3 r .LC45
-000000d7 r .LC46
-000000db r .LC47
-000000e1 r .LC48
-000000e4 r .LC49
-00000017 r .LC5
-000000e7 r .LC50
-000000e9 r .LC51
-000000eb r .LC52
-000000f4 r .LC53
-000000fc r .LC54
-00000103 r .LC55
-0000010d r .LC56
-00000117 r .LC57
-0000011f r .LC58
-00000125 r .LC59
-0000001d r .LC6
-0000012c r .LC60
-00000131 r .LC61
-00000137 r .LC62
-0000013d r .LC63
-00000142 r .LC64
-00000148 r .LC65
-0000014e r .LC66
-00000155 r .LC67
-0000015a r .LC68
-0000015f r .LC69
-0000001f r .LC7
-00000164 r .LC70
-0000016c r .LC71
+00000004 r .LC1
+0000003b r .LC10
+0000003f r .LC11
+00000043 r .LC12
+00000047 r .LC13
+0000004d r .LC14
+00000050 r .LC15
+00000053 r .LC16
+00000058 r .LC17
+0000005a r .LC18
+0000005c r .LC19
+00000008 r .LC2
+0000005e r .LC20
+00000067 r .LC21
+0000006f r .LC22
+00000076 r .LC23
+00000080 r .LC24
+0000008a r .LC25
+0000008c r .LC26
+00000094 r .LC27
+00000096 r .LC28
+00000098 r .LC29
+00000010 r .LC3
+0000009e r .LC30
+000000a5 r .LC31
+000000aa r .LC32
+000000b0 r .LC33
+000000b6 r .LC34
+000000bb r .LC35
+000000c1 r .LC36
+000000c7 r .LC37
+000000cc r .LC38
+000000d0 r .LC39
+00000018 r .LC4
+000000d7 r .LC40
+000000dc r .LC41
+000000e1 r .LC42
+000000e6 r .LC43
+000000ee r .LC44
+000000f1 r .LC45
+000000f5 r .LC46
+000000fa r .LC47
+000000fd r .LC48
+00000101 r .LC49
+0000001f r .LC5
+00000105 r .LC50
+0000010a r .LC51
+00000112 r .LC52
+0000011a r .LC53
+00000120 r .LC54
+00000122 r .LC55
+00000124 r .LC56
+00000127 r .LC57
+0000012c r .LC58
+00000131 r .LC59
+00000027 r .LC6
+00000136 r .LC60
+00000139 r .LC61
+0000013d r .LC62
+00000142 r .LC63
+00000147 r .LC64
+00000149 r .LC65
+0000014f r .LC66
+00000151 r .LC67
+00000156 r .LC68
+0000015a r .LC69
+0000002d r .LC7
+00000161 r .LC70
+00000167 r .LC71
 0000016f r .LC72
-00000173 r .LC73
-00000177 r .LC74
-0000017b r .LC75
+00000171 r .LC73
+00000175 r .LC74
+00000179 r .LC75
 0000017d r .LC76
-00000182 r .LC77
+00000183 r .LC77
 00000188 r .LC78
-0000018c r .LC79
-00000021 r .LC8
-000001a9 r .LC81
+0000018e r .LC79
+00000032 r .LC8
+00000192 r .LC80
 000001af r .LC82
 000001b4 r .LC83
 000001b8 r .LC84
@@ -562,8 +572,8 @@ logsimed.o:
 000001bd r .LC86
 00000000 r .LC87
 00000020 r .LC88
-00000023 r .LC9
-00002e00 T length_16
+00000038 r .LC9
+00001300 T length_16
          U malloc
          U __MallocTemp__
          U memcpy
@@ -584,15 +594,18 @@ logsimed.o:
          U _OutMem
          U P_escapecode
          U P_imax2
-00004680 T read_16
+00004a10 T read_16
+00002f30 T resizeproc
          U _setjmp
-00002bb0 t showdef
+00003090 T showdef
          U sprintf
          U __stack_chk_fail_local
          U stdout
+00001370 T store
          U strbegins
          U strcat
-00000290 t strcheck.isra.5
+00001390 T strcheck
+00000160 t strcheck.constprop.3
          U strcpy
          U strcpy_overlap
          U strdup
@@ -601,19 +614,23 @@ logsimed.o:
          U strpart
          U strposb
          U __top_jb
+000002c0 T vr
 00000000 T __x86.get_pc_thunk.ax
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.di
 00000000 T __x86.get_pc_thunk.si
 
 diggates.o:
-00000480 t configchgate
+00000f60 T cleardisp
+000000f0 T configchgate
 00000004 b crtcolor
 00000000 b crtfont
-00000000 t drawchar
+00001090 T drawchar
+00000cf0 T erasedisp
          U _Escape
          U fclose
          U fgets
+00000ba0 T findorg
          U fopen
          U fprintf
          U free
@@ -621,60 +638,61 @@ diggates.o:
          U _IO_getc
          U _IO_putc
          U __isoc99_fscanf
-0000004d t .L1
-00000160 t .L10
-00000290 t .L11
-00000bd8 t .L116
-00000bf8 t .L118
-00000220 t .L12
-00000b70 t .L120
-00000d90 t .L121
-00000d30 t .L122
-00000cb0 t .L123
-00000c50 t .L124
-00000c38 t .L125
-00000c10 t .L126
-000002b0 t .L13
-00001108 t .L152
-00001128 t .L154
-000012a0 t .L156
-000010d0 t .L157
-00001268 t .L158
-00001250 t .L159
-000011a0 t .L160
-00000140 t .L4
-00000124 t .L42
-00000741 t .L49
-000004e6 t .L50
-0000063e t .L52
-00000778 t .L53
-00000789 t .L54
-000002d0 t .L6
-000001b8 t .L7
-000000f8 t .L8
-00000180 t .L9
+000010e6 t .L124
+000011d0 t .L127
+00001370 t .L129
+0000049d t .L13
+00001248 t .L130
+00001188 t .L131
+00001210 t .L132
+000011f0 t .L133
+00001330 t .L134
+000012b8 t .L135
+00001350 t .L136
+0000015d t .L14
+000002b6 t .L16
+000011b4 t .L165
+00000477 t .L17
+000015b0 t .L170
+000015d0 t .L172
+000016f0 t .L174
+00001570 t .L175
+000016b0 t .L176
+00001698 t .L177
+000015f0 t .L178
+0000048b t .L18
+000006e8 t .L64
+00000708 t .L66
+00000a70 t .L68
+00000880 t .L69
+00000820 t .L70
+000007a0 t .L71
+00000740 t .L72
+00000728 t .L73
+000006c0 t .L74
 00000000 r .LC0
-00000002 r .LC1
-00000032 r .LC10
-00000037 r .LC11
-0000003b r .LC12
-00000044 r .LC13
-00000048 r .LC14
-00000000 r .LC16
-00000040 r .LC17
-0000000b r .LC2
-00000013 r .LC3
-0000001d r .LC4
-0000001e r .LC5
-00000022 r .LC6
-00000024 r .LC7
-0000002b r .LC8
-00000030 r .LC9
+00000001 r .LC1
+0000002a r .LC10
+0000002c r .LC11
+00000035 r .LC12
+0000003d r .LC13
+00000047 r .LC14
+00000000 r .LC15
+00000000 r .LC17
+00000040 r .LC18
+00000005 r .LC2
+00000007 r .LC3
+0000000e r .LC4
+00000013 r .LC5
+00000015 r .LC6
+0000001a r .LC7
+0000001e r .LC8
+00000027 r .LC9
          U log_16_bv
          U log_16_vb
-00001090 T Log_mygates_ascdisp
-000015e0 T Log_mygates_asckbd
-00000b30 T Log_mygates_sram8k
+00001530 T Log_mygates_ascdisp
+00001860 T Log_mygates_asckbd
+00000680 T Log_mygates_sram8k
          U malloc
          U __MallocTemp__
          U m_color
@@ -688,9 +706,13 @@ diggates.o:
          U m_setfont
          U newci_fixfname
          U _OutMem
+00000000 T peek
          U P_escapecode
          U P_ibetween
          U P_ioresult
+00000080 T poke
+00000da0 T refrdisp
+00000fb0 T scrollup
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
@@ -703,6 +725,7 @@ diggates.o:
          U __top_jb
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.di
+00000c20 T xorcursor
 
 loghier.o:
 00000000 b attrinstname
@@ -711,23 +734,23 @@ loghier.o:
 000004f0 T boxinbox
 00000530 T boxtouchbox
 00000020 T commandlabel
-00000890 T defndirectory
-00000c70 T examinetemplate
+000008a0 T defndirectory
+00000c90 T examinetemplate
          U free
 00000400 T gateinbox
-000007e0 T gateinstname
-00000720 T gateinstof
+000007f0 T gateinstname
+00000730 T gateinstof
          U _GLOBAL_OFFSET_TABLE_
 00000000 T hier_init
-00000690 T isgenericinstgate
+000006a0 T isgenericinstgate
 000005f0 T isinstgate
-00001578 t .L340
-000015a0 t .L342
-00001508 t .L344
-00001770 t .L345
-00001810 t .L346
-00001700 t .L347
-00001640 t .L348
+00001598 t .L332
+000015c0 t .L334
+00001528 t .L336
+00001800 t .L337
+000018a0 t .L338
+00001790 t .L339
+00001660 t .L340
 00000200 T labelbox
 00000480 T labelinbox
 00000008 b lact
@@ -751,7 +774,7 @@ loghier.o:
 00000025 r .LC7
 00000027 r .LC8
 00000030 r .LC9
-000014c0 T Log_7_ginst
+000014e0 T Log_7_ginst
          U malloc
          U __MallocTemp__
          U m_centerstr
@@ -785,379 +808,412 @@ loghier.o:
 00000000 T __x86.get_pc_thunk.si
 
 logsimh.o:
-000032d0 t badop.isra.20
-00000a90 t builddefvusev
-00003990 t check
-00000b50 t checkcomment
-00000000 t checkconn
-000029a0 t checkdefvusev
-00000410 t chgposs2
-00003cc0 t clean
-00001690 t cmptrees
-00002a70 t codegen.constprop.29
+00006140 T appendlist
+00004f00 T arith
+00008fa0 T assignvars
+00001d80 T badop
+00006ab0 T builddefvusev
+0000a700 T check
+00001f20 T checkcomment
+00003190 T checkconn
+00006b60 T checkdefvusev
+00004090 T chgop
+00004e00 T chgposs
+00004d00 T chgposs2
+00009110 T clean
+000061a0 T cleanpineq
+00003250 T cmptrees
+00009d40 T codegen
          U commandlabel
-00000320 t copytree
-00000520 r CSWTCH.342
+00003860 T copytree
+00000540 r CSWTCH.346
 0000001c b currecstamp
 00000028 b currunstamp
          U cuserid
-000000b0 t cyclicdefn
+000034c0 T cyclicdefn
 00000004 b darkwordcolor
          U dasm_16
-000014c0 t dasmhdef
-00000580 t disposetree
-00000f30 t dump
+00000730 t dasmhdef.isra.3
+00001cc0 T debugtree
+00001920 T disposetree
+0000a1e0 T dodump
+0000a350 T dowritefile
+00001990 T dump
          U dump_16
+00001c30 T dumptree
+00006110 T eattrail
+000017c0 T error
          U _EscIO
          U examinetemplate
          U executeprog
-00000250 t exprcost
+00004c60 T expansioncost
+00004c00 T exprcost
          U fclose
-00002d40 t findgattr.constprop.32
-00002dd0 t findgattr.constprop.33
-00002c00 t findhdef.constprop.31
+00000c80 t findgattr.constprop.16
+00000d10 t findgattr.constprop.17
+00000b30 t findhdef.constprop.15
+00001ee0 T findpin
+00001f00 T findvar
          U fopen
          U free
          U gateinbox
-00001d40 t genlist
-00002710 t getpindata.isra.23.part.24
+00009340 T genlist
+000030b0 T getpindata
+000008f0 t getpindata.part.4
+00001e90 T getpnum
          U _GLOBAL_OFFSET_TABLE_
 00000020 b gndsig
 00000000 b hdefbase
          U hier_init
-000033e0 t instname
+00005fe0 T iftonumber
+00006170 T insertlist
+00001210 t instname
 00000000 d instrops_NAMES
-000001b0 t invertable
+00004a50 T invertable
          U isgenericinstgate
-00002e60 t isinstance
-00004cd0 t killstmt
+00001d00 T isinert
+000010a0 t isinstance
+000040b0 T killstmt
 00000006 b kindcolor
-00000030 t .L10
-000042d0 t .L1011
-00004240 t .L1012
-00003eb0 t .L1014
-00003ee0 t .L1015
-00004058 t .L1016
-00003f28 t .L1017
-00003fc8 t .L1018
-00004080 t .L1019
-00004170 t .L1020
-000041c8 t .L1021
-00004220 t .L1022
-000041b0 t .L1023
-000049e1 t .L1030
-00004959 t .L1032
-000049f7 t .L1033
-000049ce t .L1034
-000049ec t .L1035
-000049d6 t .L1036
-000044c4 t .L1044
-0000447f t .L1046
-000044d5 t .L1047
-0000445b t .L1048
-000046f1 t .L1049
-00004697 t .L1050
-0000461d t .L1051
-00004607 t .L1052
-000045a8 t .L1053
-00004580 t .L1054
-0000450f t .L1055
-000044f9 t .L1056
-0000441f t .L1057
-0000490f t .L1088
-000048c2 t .L1089
-0000474a t .L1091
-00004838 t .L1092
-00004370 t .L1093
-000048f1 t .L1094
-000048b3 t .L1095
-00004877 t .L1096
-00004847 t .L1097
-00004829 t .L1098
-00004809 t .L1099
-000047e9 t .L1100
-000047cb t .L1101
-000047bf t .L1102
-000047b3 t .L1103
-000047a7 t .L1104
-0000477b t .L1105
-000048e2 t .L1106
-0000647a t .L1488
-00006490 t .L1489
-000067a0 t .L1491
-000064e0 t .L1492
-000065e0 t .L1493
-00006460 t .L1494
-00006740 t .L1495
-000068c0 t .L1496
-00006ab8 t .L1497
-00006998 t .L1498
-000069c0 t .L1499
-000068f8 t .L1500
-00006c50 t .L1501
-00006ae0 t .L1502
-00006b70 t .L1503
-00007275 t .L1574
-00007098 t .L1576
-00007254 t .L1577
-00007233 t .L1578
-0000720e t .L1579
-0000718b t .L1580
-00007119 t .L1581
-000070b9 t .L1582
-000071a0 t .L1583
-000071d7 t .L1584
-0000671c t .L1686
-00007dc0 t .L1749
-000077e8 t .L1750
-00007860 t .L1752
-00007c08 t .L1753
-00007c78 t .L1754
-00007de8 t .L1755
-00007e78 t .L1756
-00007ce8 t .L1757
-00007dd0 t .L1758
-000083e0 t .L1759
-000083b0 t .L1762
-000083a0 t .L1763
-000085a8 t .L1802
-00008427 t .L1803
-00008487 t .L1805
-000084b9 t .L1806
-00008541 t .L1807
-00008553 t .L1808
-000084da t .L1809
-00008b9e t .L1838
-00008934 t .L1839
-00008b43 t .L1841
-00008b50 t .L1842
-00008b5d t .L1843
-00008b6a t .L1844
-00008b77 t .L1845
-00008b91 t .L1847
-00008380 t .L1951
-000080d0 t .L1952
-00008358 t .L1953
-00008b84 t .L1957
-0000009d t .L2
-0000c7e0 t .L2946
-0000cbb0 t .L2948
-0000c8a0 t .L2950
-0000c800 t .L2951
-0000cc08 t .L2952
-0000cc38 t .L2953
-0000cb40 t .L2954
-0000c600 t .L2955
-0000cac8 t .L2956
-0000c928 t .L2957
-0000ca60 t .L2958
-0000d230 t .L3057
-0000d250 t .L3059
-0000d470 t .L3061
-0000d448 t .L3062
-0000d430 t .L3063
-0000d358 t .L3064
-0000d4a0 t .L3065
-0000d1c8 t .L3066
-0000d340 t .L3067
-0000d308 t .L3068
-0000d2f8 t .L3069
-0000d260 t .L3070
-0000d2d0 t .L3071
-000001f3 t .L31
-000001f0 t .L32
-00001838 t .L338
-00001820 t .L339
-000018f8 t .L341
-00001910 t .L342
-00001850 t .L343
-000018a0 t .L344
-000001e0 t .L35
-00000200 t .L36
-00000220 t .L37
-000022c0 t .L429
-00001e08 t .L430
-00001e88 t .L432
-00002270 t .L433
-00002248 t .L434
-00002220 t .L435
-000021f8 t .L436
-000021d0 t .L437
-00002190 t .L438
-00002170 t .L439
-00002138 t .L440
-00002110 t .L441
-000020e8 t .L442
-000020c0 t .L443
-00002098 t .L444
-00002070 t .L445
-00001e40 t .L446
-00002050 t .L447
-00002030 t .L449
-00002008 t .L450
-00001f90 t .L451
-00001f48 t .L452
-00001f00 t .L453
-00001ed0 t .L454
-000025bd t .L455
-000025a0 t .L456
-00001d98 t .L458
-00002549 t .L459
-00002566 t .L460
-00002583 t .L461
-00000070 t .L5
-00001e6a t .L595
-00000090 t .L6
-00000040 t .L7
-00003d80 t .L985
-00003d28 t .L986
-00003db0 t .L988
-00003d98 t .L989
-00003dc0 t .L990
+00004a9b t .L1013
+00004a98 t .L1014
+00004a80 t .L1017
+00004aa8 t .L1018
+00004ac8 t .L1019
+00004fb6 t .L1102
+00004fd0 t .L1105
+00005bf9 t .L1107
+00005060 t .L1108
+000057bb t .L1109
+00004f98 t .L1110
+00005100 t .L1111
+00005158 t .L1112
+000051a0 t .L1113
+00005240 t .L1114
+00005270 t .L1115
+00005380 t .L1116
+00005490 t .L1117
+00005580 t .L1118
+00005678 t .L1119
+00005b8c t .L1190
+00005aea t .L1191
+00005b3a t .L1193
+00005b16 t .L1196
+00005a17 t .L1197
+000059b3 t .L1198
+00005aad t .L1199
+00005a70 t .L1200
+00005a36 t .L1201
+000058a0 t .L1304
+00005880 t .L1305
+00006060 t .L1350
+00006050 t .L1351
+00006040 t .L1352
+00006030 t .L1353
+00006020 t .L1354
+00006010 t .L1355
+00006008 t .L1356
+00006000 t .L1358
+00006f40 t .L1530
+00006f00 t .L1531
+00006ef0 t .L1533
+00006ee0 t .L1534
+00006f30 t .L1535
+00006f20 t .L1536
+00006ed0 t .L1537
+00006f10 t .L1539
+00006c70 t .L1585
+00007ef8 t .L1784
+00007cc0 t .L1785
+00007d40 t .L1787
+00007da8 t .L1788
+00008040 t .L1789
+00007f28 t .L1790
+00007fa8 t .L1791
+00007e20 t .L1792
+00007f10 t .L1793
+00008590 t .L1794
+00008550 t .L1797
+00008560 t .L1798
+000086f8 t .L1838
+000085d4 t .L1839
+00008641 t .L1841
+00008671 t .L1842
+00008691 t .L1843
+0000869c t .L1844
+00008755 t .L1845
+00008500 t .L1919
+00008528 t .L1920
+00008260 t .L1921
+00008de0 t .L2038
+00008dc0 t .L2039
+00008eb0 t .L2041
+00008ed0 t .L2042
+00008df8 t .L2043
+00008e50 t .L2044
+000091f0 t .L2108
+00009190 t .L2109
+00009228 t .L2111
+00009208 t .L2112
+00009238 t .L2113
+00009910 t .L2151
+00009428 t .L2152
+00009460 t .L2154
+000098c0 t .L2155
+00009898 t .L2156
+00009870 t .L2157
+00009848 t .L2158
+00009820 t .L2159
+000097c8 t .L2160
+000097a0 t .L2161
+00009778 t .L2162
+00009750 t .L2163
+00009728 t .L2164
+00009700 t .L2165
+000096e0 t .L2166
+000096c0 t .L2167
+00009670 t .L2168
+00009650 t .L2169
+00009630 t .L2170
+00009610 t .L2171
+00009590 t .L2172
+00009518 t .L2173
+000094c8 t .L2174
+000095d0 t .L2175
+000094a0 t .L2176
+00009bfe t .L2177
+00009b86 t .L2178
+00009ba4 t .L2180
+00009bc2 t .L2181
+00009be0 t .L2182
+000093a3 t .L2183
+0000d610 t .L3105
+0000dad0 t .L3107
+0000d6d0 t .L3109
+0000d630 t .L3110
+0000db28 t .L3111
+0000db58 t .L3112
+0000da58 t .L3113
+0000d970 t .L3114
+0000d8f8 t .L3115
+0000d758 t .L3116
+0000d890 t .L3117
+0000e0b0 t .L3215
+0000e0d0 t .L3217
+0000e2f0 t .L3219
+0000e2c8 t .L3220
+0000e2b0 t .L3221
+0000e1d8 t .L3222
+0000e320 t .L3223
+0000e048 t .L3224
+0000e1c0 t .L3225
+0000e188 t .L3226
+0000e178 t .L3227
+0000e0e0 t .L3228
+0000e150 t .L3229
+000027c0 t .L541
+00002730 t .L542
+000023c0 t .L544
+000023f0 t .L545
+00002560 t .L546
+00002430 t .L547
+000024d0 t .L548
+00002580 t .L549
+00002700 t .L550
+00002688 t .L551
+000026e0 t .L552
+00002670 t .L553
+000027e8 t .L554
+00002e15 t .L560
+00002d7f t .L562
+00002dff t .L563
+00002df7 t .L564
+00002e20 t .L565
+00002e0a t .L566
+000028ef t .L573
+00002b06 t .L575
+00002af6 t .L576
+00002acd t .L577
+00002a85 t .L578
+00002a3d t .L579
+000029d5 t .L580
+00002997 t .L581
+00002938 t .L582
+00002bbe t .L583
+00002b46 t .L584
+00002b30 t .L585
+00002b1a t .L586
+00002d50 t .L605
+00002c6d t .L607
+00002d23 t .L608
+00002830 t .L609
+00002c9e t .L610
+00002c5e t .L611
+00002c2f t .L612
+00002bfa t .L613
+00002d14 t .L614
+00002d05 t .L615
+00002cf6 t .L616
+00002beb t .L617
+00002d41 t .L618
+00002cea t .L619
+00002cde t .L620
+00002cad t .L621
+00002d32 t .L622
+00003241 t .L696
+00003210 t .L699
+00003230 t .L700
+000031d0 t .L701
+000031c0 t .L703
          U labelbox
          U labelinbox
 00000000 r .LC0
 00000009 r .LC1
-0000003d r .LC10
-00000348 r .LC100
-00000353 r .LC101
-0000036c r .LC102
-00000384 r .LC103
-00000386 r .LC104
-00000389 r .LC105
-00000399 r .LC106
-000003b7 r .LC107
-000003ba r .LC108
-000003c7 r .LC109
-00000040 r .LC11
-000002cc r .LC110
-000003d4 r .LC111
-000003da r .LC112
-000003df r .LC113
-000003e5 r .LC114
-000003ea r .LC115
-000003f9 r .LC116
-00000402 r .LC117
-0000040b r .LC118
-00000414 r .LC119
-00000043 r .LC12
-00000416 r .LC120
-00000419 r .LC121
-0000041e r .LC122
-00000429 r .LC123
-0000043f r .LC124
-000002ec r .LC125
-00000448 r .LC126
-00000465 r .LC127
-0000046e r .LC128
-00000480 r .LC129
-0000005d r .LC13
-0000048e r .LC130
-000004a5 r .LC131
-000004bc r .LC132
-00000000 r .LC14
-00000000 r .LC15
-00000034 r .LC16
-0000007a r .LC17
-00000097 r .LC18
-000000b0 r .LC19
+00000000 r .LC10
+0000037d r .LC100
+00000381 r .LC101
+00000385 r .LC102
+0000038e r .LC103
+000003a9 r .LC104
+000003ae r .LC105
+00000248 r .LC106
+000003b4 r .LC107
+000003b8 r .LC108
+00000278 r .LC109
+00000024 r .LC11
+000002a0 r .LC110
+000002c4 r .LC111
+000003bc r .LC112
+000003be r .LC113
+000003cf r .LC114
+000003da r .LC115
+000003ea r .LC116
+000003f9 r .LC117
+00000402 r .LC118
+0000040b r .LC119
+00000000 r .LC12
+00000414 r .LC120
+00000416 r .LC121
+00000419 r .LC122
+0000041e r .LC123
+00000429 r .LC124
+0000043f r .LC125
+000002ec r .LC126
+00000448 r .LC127
+00000465 r .LC128
+0000046e r .LC129
+0000002f r .LC13
+00000480 r .LC130
+0000048e r .LC131
+000004a5 r .LC132
+000004bc r .LC133
+00000031 r .LC14
+00000033 r .LC15
+00000037 r .LC16
+00000039 r .LC17
+00000042 r .LC18
+0000004c r .LC19
 0000000f r .LC2
-000000b5 r .LC20
-00000058 r .LC21
-000000bf r .LC22
-000000dc r .LC23
-000000f8 r .LC24
-00000104 r .LC25
-00000122 r .LC26
-0000013b r .LC27
-00000143 r .LC28
-00000149 r .LC29
+00000051 r .LC20
+00000057 r .LC21
+0000005c r .LC22
+0000005e r .LC23
+00000069 r .LC24
+0000006c r .LC25
+00000074 r .LC26
+00000079 r .LC27
+00000050 r .LC28
+00000083 r .LC29
 00000014 r .LC3
-0000014e r .LC30
-00000153 r .LC31
-0000016d r .LC32
-00000177 r .LC33
-0000017b r .LC34
-00000197 r .LC35
-0000019c r .LC36
-00000098 r .LC37
-000000bc r .LC38
-000001a0 r .LC39
-00000022 r .LC4
-000001a2 r .LC40
-000001a8 r .LC41
-000000e8 r .LC42
-000001ad r .LC43
-000001af r .LC44
-000001b2 r .LC45
-000001ba r .LC46
-000001bf r .LC47
-000001c1 r .LC48
-000001c5 r .LC49
-0000002d r .LC5
-000001c7 r .LC50
-000001d0 r .LC51
-000001da r .LC52
-000001df r .LC53
-000001e5 r .LC54
-000001ea r .LC55
-000001ec r .LC56
-000001f7 r .LC57
-0000020e r .LC58
-00000118 r .LC59
-00000030 r .LC6
-00000218 r .LC60
-00000236 r .LC61
-00000247 r .LC62
-0000013c r .LC63
-0000024d r .LC64
-0000016c r .LC65
-00000252 r .LC66
-0000025f r .LC67
-0000026e r .LC68
-00000272 r .LC69
-00000035 r .LC7
-00000276 r .LC70
-0000027e r .LC71
-00000285 r .LC72
-0000028a r .LC73
-0000028e r .LC74
-00000297 r .LC75
-0000029b r .LC76
-0000029f r .LC77
-000002a8 r .LC78
-000002c3 r .LC79
-00000038 r .LC8
-000002c8 r .LC80
-00000190 r .LC81
-000002ce r .LC82
-000002d2 r .LC83
-000001c0 r .LC84
-000001e8 r .LC85
-0000020c r .LC86
-000002d6 r .LC87
-000002d8 r .LC88
-000002dc r .LC89
-00000039 r .LC9
-00000234 r .LC90
-000002e1 r .LC91
-000002ea r .LC92
-00000301 r .LC93
-00000254 r .LC94
-00000312 r .LC95
-0000032d r .LC96
-00000278 r .LC97
-000002ac r .LC98
-00000331 r .LC99
+00000086 r .LC30
+0000008b r .LC31
+0000008e r .LC32
+00000091 r .LC33
+00000095 r .LC34
+0000009a r .LC35
+000000b1 r .LC36
+000000bf r .LC37
+000000ca r .LC38
+00000074 r .LC39
+00000016 r .LC4
+000000d0 r .LC40
+000000a4 r .LC41
+000000e7 r .LC42
+000000ea r .LC43
+00000104 r .LC44
+000000d4 r .LC45
+00000000 r .LC46
+00000108 r .LC47
+00000121 r .LC48
+0000013e r .LC49
+0000001c r .LC5
+00000157 r .LC50
+0000015c r .LC51
+0000012c r .LC52
+00000166 r .LC53
+00000183 r .LC54
+0000019f r .LC55
+000001ab r .LC56
+000001c9 r .LC57
+000001e2 r .LC58
+000001ea r .LC59
+00000021 r .LC6
+000001f0 r .LC60
+000001f5 r .LC61
+000001fa r .LC62
+00000214 r .LC63
+0000021e r .LC64
+00000222 r .LC65
+0000023e r .LC66
+00000257 r .LC67
+0000026f r .LC68
+00000271 r .LC69
+00000026 r .LC7
+00000274 r .LC70
+00000292 r .LC71
+00000295 r .LC72
+000002a2 r .LC73
+0000016c r .LC74
+000002af r .LC75
+000002ca r .LC76
+00000190 r .LC77
+000001c4 r .LC78
+000002ce r .LC79
+00000027 r .LC8
+000002e5 r .LC80
+00000303 r .LC81
+000001e4 r .LC82
+00000314 r .LC83
+0000031a r .LC84
+0000031f r .LC85
+00000325 r .LC86
+00000204 r .LC87
+0000032a r .LC88
+00000333 r .LC89
+0000002b r .LC9
+00000224 r .LC90
+00000338 r .LC91
+00000345 r .LC92
+00000354 r .LC93
+00000358 r .LC94
+0000035c r .LC95
+00000364 r .LC96
+0000036b r .LC97
+00000370 r .LC98
+00000374 r .LC99
          U length_16
-0000d180 T Log_16_digh
-0000c5b0 T Log_16_inst
-0000d170 T Log_dig_inst
+0000e000 T Log_16_digh
+0000d410 T Log_16_inst
+0000dff0 T Log_dig_inst
          U logsima_action
          U logsima_tool_16
-000002b0 t makeinstr1
-00000510 t makeinstr2
-00003bb0 t makenot
+00003780 T makefix0
+000037f0 T makefix1
+000035d0 T makeinstr0
+00003630 T makeinstr1
+000036a0 T makeinstr2
+00003710 T makeinstr3
+00004b00 T makenot
          U malloc
          U __MallocTemp__
          U ma_rand2
@@ -1176,13 +1232,16 @@ logsimh.o:
          U nc_putc
          U nc_putchar
          U newci_fixfname
-00001a50 t newinstr.isra.13
+000018b0 T newinstr
+00000ac0 t newinstr.constprop.14
+00006070 T numbertoif
 00000010 b oldcolorstamp
          U _OutMem
          U P_addset
          U P_addsetr
-00004ba0 t parsepin
-00003df0 t parseterm
+0000ad50 T parsegates
+00002f70 T parsepin
+00002300 T parseterm
          U P_expset
          U P_imax2
          U P_imin2
@@ -1192,19 +1251,24 @@ logsimh.o:
          U P_setdiff
          U P_setunion
          U P_subset
-000034e0 t reallocgate
-000005e0 t refrcontrol
-000017b0 t scan
-00001ac0 t showcontrol.isra.18
-00001c70 t showerrormsg
+00001310 t reallocgate
+00000000 t refrcontrol
+00003960 T replacetree
+00008d40 T scan
+00003170 T setbytes
+000004b0 t showcontrol.isra.0
+00000660 t showerrormsg
 0000000c b showstamp
-00006400 t simplexpr
-00007770 t simplstmt
+0000a4c0 T showstats
+00004f40 T simplexpr
+00008c90 T simplify
+00007c40 T simplstmt
          U sprintf
          U __stack_chk_fail_local
          U stdout
-00002fd0 t storecontrolattrs
-000019b0 t storepnum
+00009270 T store
+00000da0 t storecontrolattrs
+000092a0 T storepnum
          U stpcpy
          U strchange
          U strcicmp
@@ -1226,20 +1290,27 @@ logsimh.o:
          U strtol
          U strupper
          U strword
+0000ac50 T subupdate
+000035a0 T swapinstrs
 00000008 b templatecolor
          U timers_sysclock
-00001710 t treerefers
-00000540 r unarynot
-00009010 t updatehdef
-0000c200 t updateinstance
+00003300 T treecontains
+000033f0 T treerefers
+000072d0 T tryfactorif
+00006c30 T trymoveif
+00000560 r unarynot
+00006090 T untrail
+0000b9b0 t updatehdef
+0000a930 t updateinstance
 00000024 b vddsig
 00000014 b viserrors
 00000018 b viserrorstamp
-000011c0 t writestats
-00000000 T __x86.get_pc_thunk.bp
+00009ed0 T writestats
+00000000 T __x86.get_pc_thunk.ax
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
 00000000 T __x86.get_pc_thunk.di
+00000000 T __x86.get_pc_thunk.dx
 00000000 T __x86.get_pc_thunk.si
 
 swap.o:
@@ -1257,59 +1328,59 @@ swap.o:
 
 ana/globals.o:
 00000008 C AnaAccum
-00000a00 T AnaAddcommand
-00000480 T AnaAnalog_ChangeReset
-000018c0 T AnaCapattrinsert
-00001600 T AnaCapattrload
-000017e0 T AnaCapattrread
-00001730 T AnaCapattrwrite
-00000fc0 T AnaCapCopy
-00001230 T AnaCapDispose
-00001450 T AnaCapex
-000015c0 T AnaCapIin
-00000e70 T AnaCapInit
-000012a0 T AnaCappass1
-00001320 T AnaCappass2
-00001260 T AnaCapReset
-00001410 T AnaCapUpdate
+000009b0 T AnaAddcommand
+00000430 T AnaAnalog_ChangeReset
+00001870 T AnaCapattrinsert
+000015b0 T AnaCapattrload
+00001790 T AnaCapattrread
+000016e0 T AnaCapattrwrite
+00000f70 T AnaCapCopy
+000011e0 T AnaCapDispose
+00001400 T AnaCapex
+00001570 T AnaCapIin
+00000e20 T AnaCapInit
+00001250 T AnaCappass1
+000012d0 T AnaCappass2
+00001210 T AnaCapReset
+000013c0 T AnaCapUpdate
 00000001 C AnaCh
-00000001 C AnaChanged
-00000001 C AnaChangedDt
-00000001 C AnaChangedP
+00000004 C AnaChanged
+00000004 C AnaChangedDt
+00000004 C AnaChangedP
 00000004 C AnaClist
 00000018 C AnaColormap
-00000d50 T AnaCrange
-00000001 C AnaDebugset
+00000cf0 T AnaCrange
+00000004 C AnaDebugset
 00000004 C AnaDebugsize
-00001f00 T AnaDiffdump
-00000001 C AnaDifficult
-00000001 C AnaDimgate
-00000df0 T AnaDisplayrange
-00000001 C AnaDone
+00001ed0 T AnaDiffdump
+00000004 C AnaDifficult
+00000004 C AnaDimgate
+00000da0 T AnaDisplayrange
+00000004 C AnaDone
 00000008 C AnaDt
 00000004 C AnaDtcount
 00000008 C AnaDtlast
 00000008 C AnaDtmax
-00001050 T AnaDummyGate
-00000310 T AnaDummyInit
+00001000 T AnaDummyGate
+00000320 T AnaDummyInit
 00000004 C AnaEpoch
 00000008 C AnaEqn_Epsilon
-00000001 C AnaErase
-00000001 C AnaError
-00000001 C AnaExact
-00000c40 T AnaExpo
+00000004 C AnaErase
+00000004 C AnaError
+00000004 C AnaExact
+00000c00 T AnaExpo
 00000004 C AnaGateHystercount
-00000e20 T AnaGate_On_Display
+00000dd0 T AnaGate_On_Display
 00000220 C AnaGenFab
-00000960 T AnaGetcommand
-00000ab0 T AnaGetvar
+00000910 T AnaGetcommand
+00000a60 T AnaGetvar
 000001a0 T AnaGlowVal
 00000004 C Anagndnode
 00000004 C Anagndsig
 00000008 C AnaHighest
 00000004 C AnaHysteresis
 00000004 C AnaInt_nodelist
-00000001 C AnaInuse
+00000004 C AnaInuse
 00000004 C AnaItercount
 00000004 C AnaIterfirstmax
 00000004 C AnaItermax
@@ -1328,7 +1399,7 @@ ana/globals.o:
 00000004 C AnaLogglobals
 00000004 C AnaLogIglobals
 00000008 C AnaLowest
-00001b10 T AnaMatdump
+00001ac0 T AnaMatdump
 00000220 C AnaMaxGenFab
 00000094 C AnaMaxNFab
 00000094 C AnaMaxPFab
@@ -1340,67 +1411,67 @@ ana/globals.o:
 00000094 C AnaNFab
 00000008 C AnaNodecap
 00000004 C AnaNodeHystercount
-00000001 C AnaOldmodel
-00000001 C AnaOverflow
-000024c0 T AnaParamUpdate
+00000004 C AnaOldmodel
+00000004 C AnaOverflow
+000024b0 T AnaParamUpdate
 00000094 C AnaPFab
 00000038 C AnaPhysical
-00000a70 T AnaPopcommand
+00000a20 T AnaPopcommand
 000000d0 T AnaProbeAmpStr
-00000001 C AnaProbeOn
+00000004 C AnaProbeOn
 00000004 C AnaProbeprec
 00000000 T AnaProbeVoltStr
-00002430 T AnaQuit
-00000001 C AnaReady
+00002420 T AnaQuit
+00000004 C AnaReady
 00000004 C AnaRelaxcount
-00000610 T AnaScoreboard
+000005c0 T AnaScoreboard
 00000008 C AnaSmall
-00000c90 T AnaSqrt
+00000c50 T AnaSqrt
 00000008 C AnaSrange
 00000004 C AnaS_Section
-00000001 C AnaStart
+00000004 C AnaStart
 00000004 C AnaStoptime
-00000001 C AnaSuccess
+00000004 C AnaSuccess
 00000004 C AnaSysCol
 00000004 C AnaSysRow
 00000004 C AnaSystem
-00000bb0 T AnaTanch
+00000b60 T AnaTanch
 00000008 C AnaTimefactor
 00000004 C AnaTimeincrease
-00002470 T AnaTimeinit
+00002460 T AnaTimeinit
 00000008 C AnaTimemin
 00000008 C AnaTimerelax
 00000220 T AnaTimeReset
-00000001 C AnaTimermode
-00000001 C AnaTimerstate
+00000004 C AnaTimermode
+00000004 C AnaTimerstate
 00000004 C AnaTimerval
 00000004 C AnaTimestate
 00000008 C AnaTol
-00000001 C AnaToobig
-00000001 C AnaToomany
-00000001 C AnaToosmall
+00000004 C AnaToobig
+00000004 C AnaToomany
+00000004 C AnaToosmall
 00000008 C AnaVardone_Epsilon
 00000008 C AnaVdd
 00000004 C AnaVddnode
 00000004 C AnaVddsig
-00000cf0 T AnaVrange
+00000c90 T AnaVrange
 00000008 C AnaVshift
 00000008 C AnaVstep
          U _Escape
          U exp
          U free
+         U fscanf
          U _GLOBAL_OFFSET_TABLE_
          U _IO_getc
-         U __isoc99_fscanf
 00000000 r .LC0
 00000004 r .LC11
 00000008 r .LC12
-00000008 r .LC13
+00000020 r .LC13
 0000000c r .LC14
-00000010 r .LC15
+00000030 r .LC15
 00000010 r .LC16
-00000010 r .LC17
-00000020 r .LC18
+00000040 r .LC17
+00000050 r .LC18
 00000013 r .LC19
 00000000 r .LC2
 0000001a r .LC20
@@ -1414,15 +1485,15 @@ ana/globals.o:
 0000008b r .LC28
 00000014 r .LC29
 00000002 r .LC3
-00000018 r .LC30
-00000020 r .LC31
-00000028 r .LC32
-00000030 r .LC33
-00000038 r .LC34
-00000040 r .LC35
-00000048 r .LC37
+00000060 r .LC30
+00000070 r .LC31
+00000080 r .LC32
+00000090 r .LC33
+000000a0 r .LC34
+000000b0 r .LC35
+00000000 r .LC37
 00000018 r .LC39
-00000000 r .LC5
+00000010 r .LC5
 00000000 r .LC6
 00000004 r .LC7
 00000006 r .LC8
@@ -1430,14 +1501,13 @@ ana/globals.o:
          U malloc
          U __MallocTemp__
          U m_alpha_on
-         U memcpy
          U m_graphics_on
          U nc_fprintf
          U nc_fputs
          U nc_gets
          U nc_printf
          U nc_putc
-00000730 t NodevalSet
+000006e0 t NodevalSet
          U _OutMem
          U pow
          U _setjmp
@@ -1445,7 +1515,6 @@ ana/globals.o:
          U sqrt
          U __stack_chk_fail_local
 00000000 B stepcount
-         U stpcpy
          U strcmp
          U strcpy
          U strtod
@@ -1469,8 +1538,10 @@ ana/nsolver.o:
          U AnaSysCol
          U AnaSysRow
          U AnaSystem
+00000000 T BestRow
          U _GLOBAL_OFFSET_TABLE_
-00000000 T Solve
+00000390 T Solve
+00000000 T __x86.get_pc_thunk.bp
 00000000 T __x86.get_pc_thunk.si
 
 ana/main.o:
@@ -1521,22 +1592,22 @@ ana/main.o:
          U AnaLastpage
          U AnaLevelmap
          U AnaLimits
-000061d0 T Analog_Cleanup
-00006210 T Analog_GlobalCommand
+00006350 T Analog_Cleanup
+00006390 T Analog_GlobalCommand
          U AnaLogglobals
 000001b0 t Analog_Guess
-00000fe0 T Analog_InitTechnology
-00001430 T Analog_InitVar
-00005b00 T Analog_Newkind
-00006830 T Analog_Probemode
-00005a60 T Analog_Refresh
-000058d0 T Analog_Reset
-00005c60 T Analog_Setup
-00006ca0 T Analog_Simulate
-00000a70 T Analog_Status
-00001810 T Analog_Systeminit
-000028f0 T Analog_TechnologyCnf
-00006b10 T Analog_Tstep
+00001020 T Analog_InitTechnology
+00001470 T Analog_InitVar
+00005c20 T Analog_Newkind
+00006a00 T Analog_Probemode
+00005b80 T Analog_Refresh
+000059e0 T Analog_Reset
+00005d80 T Analog_Setup
+00006e80 T Analog_Simulate
+00000aa0 T Analog_Status
+00001870 T Analog_Systeminit
+000029e0 T Analog_TechnologyCnf
+00006ce0 T Analog_Tstep
          U AnaLowest
          U AnaMatdump
          U AnaMaxGenFab
@@ -1592,17 +1663,17 @@ ana/main.o:
          U AnaVshift
          U AnaVstep
          U _Escape
-00000770 t Evaluate
+00000780 t Evaluate
          U findprocedure
          U _GLOBAL_OFFSET_TABLE_
-00000ef0 t .L208
-00000e10 t .L210
-00000e30 t .L211
-00000e50 t .L212
-00000e70 t .L213
-00000e90 t .L214
-00000eb0 t .L215
-00000ed0 t .L216
+00000f30 t .L208
+00000e50 t .L210
+00000e70 t .L211
+00000e90 t .L212
+00000eb0 t .L213
+00000ed0 t .L214
+00000ef0 t .L215
+00000f10 t .L216
 00000000 r .LC0
 00000000 r .LC1
 000000d2 r .LC10
@@ -1620,149 +1691,150 @@ ana/main.o:
 000003c0 r .LC110
 0000024b r .LC112
 00000252 r .LC113
-00000018 r .LC114
-00000256 r .LC115
-00000058 r .LC116
-00000060 r .LC117
-0000025c r .LC118
-00000262 r .LC119
+000003d0 r .LC114
+00000018 r .LC115
+00000256 r .LC116
+000003e0 r .LC117
+00000058 r .LC118
+0000025c r .LC119
 0000010e r .LC12
-0000001c r .LC120
-00000020 r .LC121
-00000269 r .LC122
-00000024 r .LC123
-00000271 r .LC124
-00000028 r .LC125
-00000278 r .LC126
-0000002c r .LC127
-00000030 r .LC128
-0000027e r .LC129
+00000262 r .LC120
+0000001c r .LC121
+00000020 r .LC122
+00000269 r .LC123
+00000024 r .LC124
+00000271 r .LC125
+00000028 r .LC126
+00000278 r .LC127
+0000002c r .LC128
+00000030 r .LC129
 0000012c r .LC13
-00000068 r .LC130
-00000282 r .LC131
-00000070 r .LC132
-0000028e r .LC133
-0000029e r .LC134
-00000034 r .LC135
-000002a9 r .LC136
-00000078 r .LC137
-000002b1 r .LC138
-000002be r .LC139
+0000027e r .LC130
+000003f0 r .LC131
+00000282 r .LC132
+00000400 r .LC133
+0000028e r .LC134
+0000029e r .LC135
+00000034 r .LC136
+000002a9 r .LC137
+00000410 r .LC138
+000002b1 r .LC139
 0000014a r .LC14
-000002cb r .LC140
-000002d5 r .LC141
-00000080 r .LC142
-00000038 r .LC143
-000002dd r .LC144
-000002e6 r .LC145
-0000003c r .LC146
-000002e8 r .LC147
-00000088 r .LC148
-000002ea r .LC149
+000002be r .LC140
+000002cb r .LC141
+000002d5 r .LC142
+00000420 r .LC143
+00000038 r .LC144
+000002dd r .LC145
+000002e6 r .LC146
+0000003c r .LC147
+000002e8 r .LC148
+00000060 r .LC149
 00000028 r .LC15
-00000090 r .LC150
-000002ec r .LC151
-00000098 r .LC152
-000002f0 r .LC153
-000000a0 r .LC154
-000002f4 r .LC155
-000000a8 r .LC156
-000002f9 r .LC157
-000000b0 r .LC158
-00000300 r .LC159
+000002ea r .LC150
+00000068 r .LC151
+000002ec r .LC152
+00000070 r .LC153
+000002f0 r .LC154
+00000430 r .LC155
+000002f4 r .LC156
+00000440 r .LC157
+000002f9 r .LC158
+00000078 r .LC159
 00000168 r .LC16
-00000309 r .LC160
-00000312 r .LC161
-0000031a r .LC162
-00000321 r .LC163
-000000b8 r .LC164
-00000325 r .LC165
-000000c0 r .LC166
-00000329 r .LC167
-000000c8 r .LC168
-0000032c r .LC169
+00000300 r .LC160
+00000309 r .LC161
+00000312 r .LC162
+0000031a r .LC163
+00000321 r .LC164
+00000080 r .LC165
+00000325 r .LC166
+00000088 r .LC167
+00000329 r .LC168
+00000090 r .LC169
 00000182 r .LC17
-000000d0 r .LC170
-00000330 r .LC171
-000000d8 r .LC172
-00000337 r .LC173
-000000e0 r .LC174
-0000033e r .LC175
-00000346 r .LC176
-000000e8 r .LC177
-0000034e r .LC178
-000000f0 r .LC179
+0000032c r .LC170
+00000098 r .LC171
+00000330 r .LC172
+000000a0 r .LC173
+00000337 r .LC174
+000000a8 r .LC175
+0000033e r .LC176
+00000346 r .LC177
+000000b0 r .LC178
+0000034e r .LC179
 0000019c r .LC18
-00000352 r .LC180
-000000f8 r .LC181
-0000035b r .LC182
-00000100 r .LC183
-00000362 r .LC184
-00000108 r .LC185
-00000369 r .LC186
-00000110 r .LC187
-0000036e r .LC188
-00000118 r .LC189
+000000b8 r .LC180
+00000352 r .LC181
+000000c0 r .LC182
+0000035b r .LC183
+000000c8 r .LC184
+00000362 r .LC185
+000000d0 r .LC186
+00000369 r .LC187
+000000d8 r .LC188
+0000036e r .LC189
 000001b6 r .LC19
-00000040 r .LC190
-00000120 r .LC191
-00000377 r .LC192
-00000380 r .LC193
-00000387 r .LC194
-00000128 r .LC195
-0000038b r .LC196
-00000393 r .LC197
-00000130 r .LC198
-00000138 r .LC199
+000000e0 r .LC190
+00000040 r .LC191
+000000e8 r .LC192
+00000377 r .LC193
+00000380 r .LC194
+00000387 r .LC195
+000000f0 r .LC196
+0000038b r .LC197
+00000393 r .LC198
+000000f8 r .LC199
 00000012 r .LC2
 000001d0 r .LC20
-0000039a r .LC200
-0000039d r .LC201
-000001c8 r .LC202
-000003b1 r .LC203
-000003c8 r .LC204
-000003d7 r .LC205
-000003f4 r .LC206
-000003f6 r .LC207
-0000040c r .LC208
-0000041f r .LC209
+00000100 r .LC200
+0000039a r .LC201
+0000039d r .LC202
+000001c8 r .LC203
+000003b1 r .LC204
+000003c8 r .LC205
+000003d7 r .LC206
+000003f4 r .LC207
+000003f6 r .LC208
+0000040c r .LC209
 000001ea r .LC21
-00000423 r .LC210
-00000425 r .LC211
-0000043a r .LC212
-00000440 r .LC213
-00000455 r .LC214
-0000045b r .LC215
-0000046e r .LC216
-00000476 r .LC217
-00000488 r .LC218
-000001e8 r .LC219
+0000041f r .LC210
+00000423 r .LC211
+00000425 r .LC212
+0000043a r .LC213
+00000440 r .LC214
+00000455 r .LC215
+0000045b r .LC216
+0000046e r .LC217
+00000476 r .LC218
+00000488 r .LC219
 00000204 r .LC22
-00000491 r .LC220
-00000210 r .LC221
-0000049a r .LC222
-000004a0 r .LC223
-000004ae r .LC224
-000004bd r .LC225
-000004c3 r .LC226
-000004cc r .LC227
-000004d6 r .LC228
-000004e0 r .LC229
+000001e8 r .LC220
+00000491 r .LC221
+00000210 r .LC222
+0000049a r .LC223
+000004a0 r .LC224
+000004ae r .LC225
+000004bd r .LC226
+000004c3 r .LC227
+000004cc r .LC228
+000004d6 r .LC229
 0000021e r .LC23
-000004f2 r .LC230
-000004f6 r .LC231
-00000238 r .LC232
-00000513 r .LC233
-0000051d r .LC234
-00000534 r .LC235
-0000053f r .LC236
-00000551 r .LC237
-00000565 r .LC238
-0000025c r .LC239
+000004e0 r .LC230
+000004f2 r .LC231
+000004f6 r .LC232
+00000238 r .LC233
+00000513 r .LC234
+0000051d r .LC235
+00000534 r .LC236
+0000053f r .LC237
+00000551 r .LC238
+00000565 r .LC239
 0000005c r .LC24
-00000280 r .LC240
-000002a0 r .LC241
-000002cc r .LC242
+0000025c r .LC240
+00000280 r .LC241
+000002a0 r .LC242
+000002cc r .LC243
 00000088 r .LC25
 000000b4 r .LC26
 000000e0 r .LC27
@@ -1861,7 +1933,7 @@ ana/main.o:
          U strtod
          U strtol
          U __top_jb
-00000990 t Update
+000009c0 t Update
 00000000 T __x86.get_pc_thunk.ax
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
@@ -1902,127 +1974,125 @@ ana/inter.o:
          U _Escape
          U free
          U _GLOBAL_OFFSET_TABLE_
-00001334 t .L212
-00001310 t .L214
-000013c0 t .L216
-00001390 t .L217
-00001358 t .L218
-00001340 t .L219
-00001535 t .L243
-00001948 t .L245
-000014d0 t .L248
-00001540 t .L249
-00001848 t .L250
-00001a80 t .L251
-00001ad0 t .L252
-00001a10 t .L253
-00001a28 t .L254
-00001a60 t .L255
-00001a70 t .L256
-000015a0 t .L257
-000015b0 t .L258
-000015c0 t .L259
-000015d0 t .L260
-000015e0 t .L261
-000015f0 t .L262
-00001600 t .L263
-00001620 t .L264
-00001640 t .L265
-00001658 t .L266
-00001690 t .L267
-000016a0 t .L268
-000016b0 t .L269
-000016c0 t .L270
-000016d0 t .L271
-00001700 t .L272
-00001838 t .L273
-000019d0 t .L274
-00001a00 t .L275
-00001870 t .L276
-00001880 t .L277
-0000158d t .L293
-00001be4 t .L302
-00001bf0 t .L304
-00001e10 t .L306
-00001de0 t .L307
-00001d78 t .L308
-00001d60 t .L309
-00001d30 t .L310
-00001d18 t .L311
-00001d00 t .L312
-00001bb0 t .L313
-00001c40 t .L314
+00000f37 t .L166
+00000f10 t .L168
+00000fc0 t .L170
+00000f90 t .L171
+00000f58 t .L172
+00000f40 t .L173
+00001418 t .L241
+00001910 t .L243
+000013b0 t .L246
+00001420 t .L247
+00001738 t .L248
+00001a50 t .L249
+00001aa0 t .L250
+000019e0 t .L251
+000019f8 t .L252
+00001a30 t .L253
+00001a40 t .L254
+00001488 t .L255
+00001498 t .L256
+000014a8 t .L257
+000014b8 t .L258
+000014c8 t .L259
+000014d8 t .L260
+000014e8 t .L261
+00001508 t .L262
+00001528 t .L263
+00001540 t .L264
+00001580 t .L265
+00001590 t .L266
+000015a0 t .L267
+000015b0 t .L268
+000015c0 t .L269
+000015f0 t .L270
+00001728 t .L271
+000019a0 t .L272
+000019d0 t .L273
+00001768 t .L274
+00001780 t .L275
+0000146d t .L291
+00001d03 t .L300
+00001d10 t .L302
+00001ec0 t .L304
+00001e90 t .L305
+00001e28 t .L306
+00001e10 t .L307
+00001de0 t .L308
+00001dc0 t .L309
+00001da8 t .L310
+00001d68 t .L311
+00001b80 t .L312
 00000000 r .LC0
-000000af r .LC10
-000000b0 r .LC11
-000000c5 r .LC12
-000000e3 r .LC13
-000000ff r .LC14
-00000113 r .LC15
-00000128 r .LC16
-0000012c r .LC17
-00000131 r .LC18
-00000139 r .LC19
+00000043 r .LC10
+00000044 r .LC11
+00000000 r .LC12
+00000062 r .LC13
+00000064 r .LC14
+00000078 r .LC15
+0000008d r .LC16
+00000020 r .LC17
+00000000 r .LC18
+000000a8 r .LC19
 00000000 r .LC2
-0000013d r .LC20
-0000013f r .LC21
-0000014d r .LC22
-00000000 r .LC23
-0000016b r .LC24
-00000189 r .LC25
-0000018b r .LC26
-0000019f r .LC27
-000001b4 r .LC28
-00000000 r .LC29
-00000000 r .LC3
-00000008 r .LC30
-00000004 r .LC31
-000001cf r .LC32
-000001d6 r .LC33
-000001dd r .LC34
-000001e6 r .LC35
-000001f0 r .LC36
-000001f8 r .LC37
-000001fe r .LC38
-00000204 r .LC39
-00000015 r .LC4
-0000020a r .LC40
-00000210 r .LC41
-00000216 r .LC42
-0000021c r .LC43
-00000222 r .LC44
-00000234 r .LC45
-00000245 r .LC46
-00000256 r .LC47
-0000002c r .LC5
-00000048 r .LC6
-00000064 r .LC7
-00000080 r .LC8
-00000094 r .LC9
+000000bd r .LC20
+000000d4 r .LC21
+000000f0 r .LC22
+0000010c r .LC23
+00000128 r .LC24
+0000013c r .LC25
+00000157 r .LC26
+00000004 r .LC27
+0000016c r .LC28
+00000173 r .LC29
+00000004 r .LC3
+0000017a r .LC30
+00000183 r .LC31
+0000018d r .LC32
+00000195 r .LC33
+0000019b r .LC34
+000001a1 r .LC35
+000001a7 r .LC36
+000001ad r .LC37
+000001b3 r .LC38
+000001b9 r .LC39
+00000009 r .LC4
+000001bf r .LC40
+000001d1 r .LC41
+000001e2 r .LC42
+000001f3 r .LC43
+00000204 r .LC44
+00000222 r .LC45
+0000023e r .LC46
+00000252 r .LC47
+00000011 r .LC5
+00000015 r .LC6
+00000017 r .LC7
+00000025 r .LC8
+00000010 r .LC9
          U log
-000014a0 T Log_32_proc
-00001b80 T Log_33_proc
+00001380 T Log_32_proc
+00001b50 T Log_33_proc
 000000e0 t log_configchgate_32
-000012e0 t log_configchhist_32.constprop.8
+00000ee0 t log_configchhist_32.isra.2
 00000250 t log_configgate_32
-00000550 t log_copygate_32
+00000560 t log_copygate_32
 00000070 t log_disconnectgate_32
-00000c20 t log_disposegate_32
-00001030 t log_edit_32.isra.6
+00000a90 t log_disposegate_32
+00000ff0 t log_edit_32.isra.9
 00000000 t log_egate_32
-00000fa0 t log_func_32
-00000770 t log_histinit_32
-00000d70 t log_histstr_32
-000013e0 t log_histval_32.constprop.9
+00000e50 t log_func_32
+00000be0 t log_histstr_32
+000012b0 t log_histval_32.isra.11
 00000330 t log_newgate_32
-00000940 t log_pass_32
+00000790 t log_pass_32
 00000170 t log_readgate_32
 000002c0 t log_touchgate_32
 000001e0 t log_writegate_32
          U m_across
          U malloc
          U __MallocTemp__
-         U memcpy
          U m_inkey
          U nc_fprintf
          U nc_gets
@@ -2031,7 +2101,6 @@ ana/inter.o:
          U _OutMem
          U sprintf
          U __stack_chk_fail_local
-         U stpcpy
          U strcpy
          U strlen
          U strlist_append
@@ -2088,153 +2157,176 @@ ana/numbers.o:
          U AnaVdd
          U AnaVshift
          U AnaVstep
+00000910 T Attr_Numbers
+00002820 T Copygate_Numbers
+00002880 T Dispose_Numbers
+00002260 T Erase_Numbers
          U fprintf
          U free
-00000000 t GetCnf_Numbers
+         U fscanf
+00000610 T GetCnf_Numbers
          U _GLOBAL_OFFSET_TABLE_
+00000780 T initlib_NUMBERS
          U _IO_getc
-         U __isoc99_fscanf
-000014d0 t .L100
-00001a58 t .L102
-00001a70 t .L103
-00001aa0 t .L104
-00001ab8 t .L105
-00001a88 t .L106
-00002329 t .L126
-0000231b t .L127
-00002424 t .L129
-00002464 t .L130
-00002477 t .L131
-0000248a t .L132
-000024b0 t .L133
-0000249d t .L134
-0000237e t .L135
-0000235e t .L136
-000023ec t .L138
-000023fa t .L139
-00002408 t .L140
-00002416 t .L141
-00002437 t .L142
-00002445 t .L143
-000026cd t .L147
-00002710 t .L148
-00002730 t .L150
-0000273a t .L151
-00002744 t .L152
-0000274e t .L153
-00002758 t .L154
-00002762 t .L155
-0000228f t .L162
-000022b0 t .L164
-000022bb t .L165
-000022c6 t .L166
-000022d1 t .L167
-000022dc t .L168
-000022e7 t .L169
-00001dc3 t .L170
-00001de2 t .L172
-00001e01 t .L173
-00001e20 t .L174
-00001e3f t .L175
-00001e5e t .L176
-00001e7d t .L177
-00000460 t .L26
-00000aa2 t .L264
-000005b0 t .L28
-000005d0 t .L29
-000005f0 t .L30
-00000610 t .L31
-00000630 t .L32
-00000650 t .L33
-00000670 t .L34
-00000aa8 t .L53
-00000ad0 t .L55
-000014c0 t .L57
-000014a0 t .L58
-00001438 t .L59
-00001290 t .L60
-00001270 t .L61
-00001200 t .L62
-00001100 t .L63
-00001088 t .L64
-00000c60 t .L65
-000007b8 t .L66
-00000c40 t .L67
+00001120 t .L127
+0000109f t .L128
+000015f0 t .L129
+00000300 t .L13
+00001070 t .L131
+00001650 t .L132
+00001638 t .L133
+00001620 t .L134
+00001608 t .L135
+00000450 t .L15
+00001890 t .L155
+0000187b t .L156
+00001b47 t .L158
+00001b60 t .L159
+00000470 t .L16
+00001b79 t .L160
+00001b92 t .L161
+00001bab t .L162
+00001bc4 t .L163
+000018c8 t .L164
+00001ab5 t .L165
+00001b00 t .L167
+00001b08 t .L168
+00001b10 t .L169
+00000490 t .L17
+00001b18 t .L170
+00001b20 t .L171
+00001b28 t .L172
+00001c60 t .L176
+00001bfb t .L177
+00001c20 t .L179
+000004b0 t .L18
+00001c2b t .L180
+00001c36 t .L181
+00001c41 t .L182
+00001c4c t .L183
+00001c57 t .L184
+000004d0 t .L19
+00001a38 t .L191
+00001a60 t .L193
+00001a70 t .L194
+00001a80 t .L195
+00001a90 t .L196
+00001aa0 t .L197
+00001ab0 t .L198
+000017a8 t .L199
+000004f0 t .L20
+00001860 t .L201
+00001820 t .L202
+00001840 t .L203
+000017c8 t .L204
+000017e8 t .L205
+00001808 t .L206
+00000510 t .L21
+00002ae0 t .L296
+00002c30 t .L298
+00002c50 t .L299
+00002c70 t .L300
+00002c90 t .L301
+00002cb0 t .L302
+00002cd0 t .L303
+00002cf0 t .L304
+00002e63 t .L323
+00002e70 t .L325
+00003010 t .L327
+00003000 t .L328
+00002f90 t .L329
+00002f80 t .L330
+00002f60 t .L331
+00002e20 t .L332
+00002f50 t .L333
+00002ed0 t .L334
+00002ec0 t .L335
+00002eb0 t .L336
+00002ea0 t .L337
+00002e90 t .L338
+000009ae t .L60
+00000a10 t .L62
+000009b8 t .L64
+00000bb8 t .L65
+00000948 t .L66
+00000b50 t .L67
 00000af0 t .L68
-00001d28 t .L72
-00001ac9 t .L74
-00001b60 t .L75
-00001bb0 t .L76
-00001c18 t .L77
-00001cd9 t .L78
-00001b20 t .L79
-00001d78 t .L80
-00001e95 t .L83
-00001ea2 t .L85
-00001eaf t .L86
-00001ec1 t .L87
-00001ece t .L88
-00001edb t .L89
-00001ee8 t .L90
-00001ef5 t .L91
-000014ff t .L99
+00000ab0 t .L69
+00000a60 t .L70
+00000cf0 t .L73
+00000cfd t .L75
+00000d0a t .L76
+00000d1c t .L77
+00000d29 t .L78
+00000d36 t .L79
+00000d43 t .L80
+00000d50 t .L81
+000009ac t .L96
 00000000 r .LC0
-00000008 r .LC1
-00000066 r .LC10
-00000075 r .LC11
-00000085 r .LC12
-00000094 r .LC13
-000000a5 r .LC14
-000000b7 r .LC15
-000000c6 r .LC16
-000000d3 r .LC17
-000000e4 r .LC18
-000000f7 r .LC19
-00000010 r .LC2
-00000108 r .LC20
-0000011b r .LC21
-0000012a r .LC22
-00000133 r .LC23
-00000135 r .LC24
+0000000e r .LC1
+00000075 r .LC10
+00000084 r .LC11
+00000095 r .LC12
+000000a7 r .LC13
+000000b6 r .LC14
+000000c3 r .LC15
+000000d4 r .LC16
+000000e7 r .LC17
+000000f8 r .LC18
+0000010b r .LC19
+00000017 r .LC2
+0000011a r .LC20
+00000123 r .LC21
+00000125 r .LC22
+00000130 r .LC23
+00000138 r .LC24
 00000140 r .LC25
-00000146 r .LC26
-0000014c r .LC27
+00000151 r .LC26
+00000157 r .LC27
 0000015d r .LC28
 00000161 r .LC29
-0000001e r .LC3
+00000022 r .LC3
 00000167 r .LC30
 0000016b r .LC31
 00000171 r .LC32
 00000179 r .LC33
 0000017f r .LC34
 00000185 r .LC35
-0000018c r .LC36
+0000018d r .LC36
 00000194 r .LC37
 00000196 r .LC38
 000001ab r .LC39
-00000027 r .LC4
+0000002b r .LC4
 000001c0 r .LC40
 000001d3 r .LC41
-00000032 r .LC5
-0000003b r .LC6
+00000036 r .LC5
+00000044 r .LC6
 00000046 r .LC7
-00000054 r .LC8
-00000056 r .LC9
-00000770 T Log_numbers_initlib_32
+00000056 r .LC8
+00000065 r .LC9
+00002df0 T Log_numbers_initlib_32
          U malloc
          U __MallocTemp__
          U m_centerstr
          U m_color
          U m_drawstr
-00000160 t Openconfig_Numbers.isra.0.part.1
+00001030 T Message_Numbers
+000026c0 T Newgate_Numbers
+00000d90 T Openconfig_Numbers
+00000000 t Openconfig_Numbers.part.0
          U _OutMem
-00000360 t Probe_Numbers.isra.11
+000029e0 T Probe_Numbers
+00000200 t Probe_Numbers.constprop.1
+00000db0 T Readgate_Numbers
+00001c70 T Refresh_Numbers
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
          U strcmp
          U strcpy
          U __top_jb
+000028b0 T Touch_Numbers
+00000fb0 T Writegate_Numbers
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
 00000000 T __x86.get_pc_thunk.dx
@@ -2247,53 +2339,63 @@ ana/mmeter.o:
          U AnaLogglobals
          U AnaScoreboard
          U AnaVardone_Epsilon
-00000b10 t Attr_Mmeter
-000005b0 t Disconnect_Mmeter.isra.10
+000011d0 T Attr_Mmeter
+00001e10 T Copygate_Mmeter
+00001af0 T Disconnect_Mmeter
+000004d0 T Display_Mmeter
+00000b40 T Erase_Mmeter
          U free
-000002b0 t GetCnf_Mmeter.constprop.13
+00000d40 T GetCnf_Mmeter
          U _GLOBAL_OFFSET_TABLE_
-0000101d t .L109
-00000f60 t .L111
-00001055 t .L112
-00001039 t .L113
-00000ee8 t .L124
-00000ec8 t .L126
-00000f08 t .L127
-00000e10 t .L128
-00001218 t .L159
-00001450 t .L161
-00001238 t .L163
-00001640 t .L164
-00001630 t .L165
-000015f0 t .L166
-000015b0 t .L167
-000015a0 t .L168
-00001590 t .L169
-00001470 t .L170
-000013e0 t .L171
-00001380 t .L172
-00001370 t .L173
-000012b0 t .L174
-000018f8 t .L184
-00001914 t .L186
-00001849 t .L187
-00001930 t .L188
-000017b0 t .L197
-00001720 t .L199
-000017f0 t .L200
-000017d0 t .L201
-00001830 t .L207
-00001810 t .L209
-00001700 t .L210
-00001170 t .L211
-00000700 t .L55
-00000648 t .L57
-00000740 t .L58
-00000720 t .L59
-00000a20 t .L74
-000009a0 t .L76
-00000a40 t .L77
-00000a60 t .L78
+00000b30 T Iin_Mmeter
+000010c0 T INITLIB_Mmeter
+000000c0 T Itot
+000009d8 t .L105
+00000918 t .L107
+000009f8 t .L108
+00000a18 t .L109
+00000c50 t .L129
+00000ba0 t .L131
+00000c90 t .L132
+00000c70 t .L133
+000016d0 t .L202
+00001620 t .L204
+00001708 t .L205
+000016ec t .L206
+000015a8 t .L217
+00001588 t .L219
+000015c8 t .L220
+000014d0 t .L221
+00001a00 t .L259
+00001980 t .L261
+00001a20 t .L262
+00001a40 t .L263
+00001c48 t .L285
+00001b90 t .L287
+00001c88 t .L288
+00001c68 t .L289
+00000020 t .L3
+00001f8c t .L309
+00002030 t .L311
+00001f10 t .L313
+000020b0 t .L314
+000020a0 t .L315
+00002090 t .L316
+00002080 t .L317
+00002070 t .L318
+00002060 t .L319
+00002050 t .L320
+00002020 t .L321
+00001fc0 t .L322
+00001fb0 t .L323
+00001f98 t .L324
+00000060 t .L5
+000000a0 t .L6
+00000650 t .L62
+00000580 t .L64
+00000690 t .L65
+00000670 t .L66
+00000080 t .L7
 00000000 r .LC1
 00000000 r .LC2
 00000002 r .LC3
@@ -2302,27 +2404,31 @@ ana/mmeter.o:
 00000011 r .LC6
 00000017 r .LC7
 0000001c r .LC8
-00001130 T Log_mmeter_initlib_32
+00001ee0 T Log_mmeter_initlib_32
          U malloc
          U __MallocTemp__
          U m_color
          U m_drawstr
-         U memcpy
+00000000 T Mmeter_Locate
          U m_rightstr
+00001d20 T Newgate_Mmeter
          U _OutMem
-00000000 t PreUpdate_Mmeter
-000007d0 t Reset_Mmeter.isra.9
+00000750 T Pass1_Mmeter
+00000170 T PreUpdate_Mmeter
+00001eb0 T Probe_Mmeter
+000008b0 T Refresh_Mmeter
+000017d0 T Reset_Mmeter
          U _setjmp
          U __stack_chk_fail_local
-         U stpcpy
          U strcmp
          U strcpy
          U strltrim
          U strrtrim
          U strtol
          U __top_jb
+00000440 T Update_Mmeter
+00000000 T __x86.get_pc_thunk.ax
 00000000 T __x86.get_pc_thunk.bx
-00000000 T __x86.get_pc_thunk.dx
 
 ana/iscope.o:
          U AnaColormap
@@ -2331,77 +2437,91 @@ ana/iscope.o:
          U AnaGetcommand
          U AnaLogglobals
          U AnaScoreboard
-000008c0 t Attr_Iscope
-000003a0 t Disconnect_Iscope.isra.10
+00001020 T Attr_Iscope
+00001930 T Copygate_Iscope
+00001630 T Disconnect_Iscope
+00000360 T Display_Iscope
+00000980 T Erase_Iscope
          U free
-00000090 t GetCnf_Iscope.constprop.13
+00000b80 T GetCnf_Iscope
          U _GLOBAL_OFFSET_TABLE_
-00000000 t Itot.isra.0
-00000cc0 t .L103
-00000fb0 t .L105
-00000ce0 t .L107
-00001188 t .L108
-00001178 t .L109
-00001140 t .L110
-00001100 t .L111
-00001200 t .L112
-000010f0 t .L113
-00000fd0 t .L114
-00000f40 t .L115
-00000ee0 t .L116
-00000e18 t .L117
-00000d58 t .L118
-0000147e t .L133
-000013e7 t .L135
-0000149a t .L136
-000014b6 t .L137
-00001280 t .L142
-00000c30 t .L144
-000012c0 t .L145
-000012a0 t .L146
-00001380 t .L152
-000012e0 t .L154
-000013c0 t .L155
-000013a0 t .L156
-000004f0 t .L34
-00000438 t .L36
-00000530 t .L37
-00000510 t .L38
-000007f0 t .L53
-00000770 t .L55
-00000810 t .L56
-00000830 t .L57
-00000b00 t .L81
-00000a18 t .L83
-00000b40 t .L84
-00000b20 t .L85
+00000970 T Iin_Iscope
+00000f10 T INITLIB_ISCOPE
+00000000 T Iscope_Locate
+000000c0 T Itot
+00000a90 t .L109
+000009e0 t .L111
+00000ad0 t .L112
+00000ab0 t .L113
+00001260 t .L177
+00001180 t .L179
+000012a0 t .L180
+00001280 t .L181
+00001560 t .L204
+000014e0 t .L206
+00001580 t .L207
+000015a0 t .L208
+00001788 t .L228
+000016d0 t .L230
+000017c8 t .L231
+000017a8 t .L232
+00001aac t .L252
+00001b50 t .L254
+00001a30 t .L256
+00001bd0 t .L257
+00001bc0 t .L258
+00001bb0 t .L259
+00001ba0 t .L260
+00001b90 t .L261
+00001b80 t .L262
+00001b70 t .L263
+00001b40 t .L264
+00001ae0 t .L265
+00001ad0 t .L266
+00001ab8 t .L267
+00000020 t .L3
+000004b0 t .L44
+00000408 t .L46
+000004f0 t .L47
+000004d0 t .L48
+00000060 t .L5
+000000a0 t .L6
+00000080 t .L7
+00000840 t .L83
+00000768 t .L85
+00000860 t .L86
+00000880 t .L87
 00000000 r .LC1
-00000007 r .LC2
-0000000d r .LC3
-00000013 r .LC4
-00000000 r .LC5
-00000018 r .LC6
+00000000 r .LC2
+00000002 r .LC3
+00000009 r .LC4
+0000000f r .LC5
+00000015 r .LC6
 0000001a r .LC7
-00000bf0 T Log_iscope_initlib_32
+00001a00 T Log_iscope_initlib_32
          U malloc
          U __MallocTemp__
          U m_color
          U m_drawstr
-         U memcpy
          U m_rightstr
+00001860 T Newgate_Iscope
          U _OutMem
-000005c0 t Reset_Iscope.isra.9
+000005a0 T Pass1_Iscope
+00000170 T PreUpdate_Iscope
+000019d0 T Probe_Iscope
+00000700 T Refresh_Iscope
+00001350 T Reset_Iscope
          U _setjmp
          U __stack_chk_fail_local
-         U stpcpy
          U strcmp
          U strcpy
          U strltrim
          U strrtrim
          U strtol
          U __top_jb
+000002d0 T Update_Iscope
+00000000 T __x86.get_pc_thunk.ax
 00000000 T __x86.get_pc_thunk.bx
-00000000 T __x86.get_pc_thunk.dx
 
 ana/devtechp.o:
          U AnaChangedP
@@ -2413,34 +2533,41 @@ ana/devtechp.o:
          U AnaOldmodel
          U AnaParamUpdate
          U AnaPFab
+00000260 T Attr_Devtechp
          U _GLOBAL_OFFSET_TABLE_
-000002c0 t .L10
-00000228 t .L11
-0000049e t .L14
-000004f8 t .L16
-00000550 t .L17
-000005b0 t .L18
-00000610 t .L19
-00000670 t .L20
-000006d0 t .L21
-00000720 t .L22
-00000770 t .L23
-000007c0 t .L25
-00000266 t .L26
-00000810 t .L27
-00000860 t .L28
-000008b0 t .L29
-00000900 t .L30
-00000496 t .L31
-00000262 t .L4
-000002f0 t .L6
-000002e0 t .L8
-000002b1 t .L9
-00000200 T Log_DEVTECHP_initlib_32
+00000000 T initlib_Devtechp
+00000400 t .L10
+00000840 t .L12
+000007e8 t .L13
+00000790 t .L14
+00000738 t .L15
+000006e0 t .L16
+00000690 t .L17
+00000640 t .L18
+000005f0 t .L19
+000005a0 t .L21
+00000550 t .L22
+00000500 t .L23
+000004b0 t .L24
+00000458 t .L25
+00000298 t .L26
+000003f0 t .L27
+000003f7 t .L8
+00000ac9 t .L85
+00000ad0 t .L87
+00000b00 t .L89
+00000af0 t .L90
+00000ae0 t .L91
+00000a90 t .L92
+00000a60 T Log_DEVTECHP_initlib_32
          U malloc
          U __MallocTemp__
+00000a00 T Newgate_Devtechp
+000008e0 T Openconfig_Devtechp
          U _OutMem
-00000000 t Reload_Devtechp.isra.1
+00000900 T Readgate_Devtechp
+00000060 T Reload_Devtechp
+         U __stack_chk_fail_local
          U strcpy
 00000000 T __x86.get_pc_thunk.bx
 
@@ -2472,122 +2599,145 @@ ana/vdiff.o:
          U AnaSysCol
          U AnaSystem
          U AnaVdd
+00001cb0 T Attr_Vdiff
+00002430 T Clear_Vdiff
+00001f60 T Copygate_Vdiff
+00002520 T Display_VDiff
+00002010 T Dispose_Vdiff
+00002680 T Erase_Vdiff
          U _Escape
+00000380 T Ex_Vdiff
          U fprintf
          U free
-000005b0 t GetCnf_Vdiff.constprop.16
+         U fscanf
+000009f0 T GetCnf_Vdiff
          U _GLOBAL_OFFSET_TABLE_
+00000650 T Iin_Vdiff
+00001610 T initlib_Vdiff
          U _IO_getc
-         U __isoc99_fscanf
-00001340 t .L150
-00001368 t .L152
-000011e8 t .L153
-00001380 t .L154
-000014f8 t .L155
-00001520 t .L156
-000015b0 t .L157
-00001940 t .L158
-00001910 t .L159
-000019a0 t .L160
-00001800 t .L161
-00001830 t .L162
-00001860 t .L163
-000018e0 t .L164
-000017e0 t .L165
-00001d50 t .L166
-00001cf0 t .L167
-00001d70 t .L168
-000019d0 t .L169
-00001a20 t .L170
-00001a60 t .L171
-00001ba0 t .L172
-00001dec t .L192
-00001e78 t .L194
-00001e9f t .L195
-00001ed2 t .L196
-00001f2a t .L197
-00001f80 t .L198
-00001fa7 t .L199
-00002004 t .L200
-00002020 t .L201
-00002062 t .L202
-0000209d t .L203
-000020ae t .L204
-000020f7 t .L205
-000020fe t .L230
-00001310 t .L285
+000017e0 t .L185
+00001c60 t .L187
+00001c20 t .L188
+00001bb8 t .L189
+00001b58 t .L190
+00001b10 t .L191
+00001aa0 t .L192
+00001a30 t .L193
+000019e0 t .L194
+00001998 t .L195
+00001930 t .L196
+00001948 t .L197
+00001820 t .L198
+00001c98 t .L199
+00002a13 t .L335
+00002a20 t .L337
+00002a40 t .L339
+00002a50 t .L340
+00002a60 t .L341
+00002a70 t .L342
+00002a88 t .L343
+00002b28 t .L344
+000029c0 t .L345
+00002d68 t .L346
+00002d98 t .L347
+00002c50 t .L348
+00002c80 t .L349
+00002cb0 t .L350
+00002d40 t .L351
+00002b40 t .L352
+00002b58 t .L353
+00002b70 t .L354
+00002b80 t .L355
+00002b90 t .L356
+00002bd8 t .L357
+00002c28 t .L358
+00002c40 t .L359
 00000000 r .LC0
-00000000 r .LC1
-00000059 r .LC10
-00000070 r .LC11
-00000076 r .LC12
-0000007d r .LC13
-00000080 r .LC14
-00000008 r .LC15
-00000084 r .LC16
-00000089 r .LC17
-0000008e r .LC18
-00000094 r .LC19
-0000000f r .LC2
-00000097 r .LC21
-0000000c r .LC22
-0000009e r .LC23
-00000010 r .LC24
-000000a2 r .LC25
-00000014 r .LC26
-000000a7 r .LC27
-000000ad r .LC28
-000000b3 r .LC29
-00000017 r .LC3
-000000b9 r .LC30
-00000018 r .LC31
-000000c0 r .LC32
-0000001c r .LC33
-000000c5 r .LC34
-000000ca r .LC35
-000000d0 r .LC36
-00000020 r .LC37
-000000d7 r .LC38
-000000de r .LC39
-00000022 r .LC4
-000000e4 r .LC40
-00000024 r .LC41
-00000000 r .LC42
-00000008 r .LC43
-00000010 r .LC44
-00000028 r .LC45
-0000002c r .LC46
-00000018 r .LC47
-00000020 r .LC48
-000000ea r .LC49
-00000004 r .LC5
-000000f4 r .LC50
-00000105 r .LC51
-0000010c r .LC52
-00000110 r .LC53
-0000002c r .LC6
-0000003f r .LC7
-00000041 r .LC8
-00000049 r .LC9
-000000f0 t Limitfill
-000011a0 T Log_vdiff_initlib_32
+00000004 r .LC1
+00000033 r .LC10
+00000038 r .LC11
+0000003e r .LC12
+00000041 r .LC14
+0000000c r .LC15
+00000048 r .LC16
+00000010 r .LC17
+0000004c r .LC18
+00000014 r .LC19
+00000000 r .LC2
+00000051 r .LC20
+00000057 r .LC21
+0000005d r .LC22
+00000063 r .LC23
+00000018 r .LC24
+0000006a r .LC25
+0000001c r .LC26
+0000006f r .LC27
+00000074 r .LC28
+0000007a r .LC29
+00000000 r .LC3
+00000020 r .LC30
+00000081 r .LC31
+00000010 r .LC32
+00000000 r .LC33
+00000024 r .LC34
+00000028 r .LC35
+00000020 r .LC36
+00000030 r .LC37
+00000040 r .LC38
+00000088 r .LC39
+0000001a r .LC4
+00000092 r .LC40
+000000a3 r .LC41
+000000a9 r .LC42
+000000af r .LC43
+000000b6 r .LC44
+00000050 r .LC45
+000000ba r .LC46
+000000c9 r .LC47
+000000d1 r .LC48
+000000dc r .LC49
+00000020 r .LC5
+0000002c r .LC50
+000000e6 r .LC51
+000000f9 r .LC52
+000000fb r .LC53
+00000103 r .LC54
+00000113 r .LC55
+00000027 r .LC6
+0000002a r .LC7
+00000008 r .LC8
+0000002e r .LC9
+00000130 T Limitfill
+00002990 T Log_vdiff_initlib_32
          U malloc
          U __MallocTemp__
          U m_color
          U m_fillrect
+00001d10 T Newgate_Vdiff
          U _OutMem
-00000330 t Probe_Vdiff.isra.15
-00000000 t Pulsemaker
+00002460 T PreUpdate_VDiff
+000026e0 T Probe_Vdiff
+00000240 T Pulsemaker
          U puts
+00002050 T Readgate_Vdiff
+000026b0 T Refresh_Vdiff
+00002350 T Reset_Vdiff
          U _setjmp
+00002400 T Set_Vdiff
          U sin
          U sprintf
          U __stack_chk_fail_local
          U strtod
-00000200 t Switchfill
+00000000 T Switchfill
          U __top_jb
+00002610 T Touch_Vdiff
+000024c0 T Update_VDiff
+000017b0 T Vdiffcheck
+00002220 T Writegate_Vdiff
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
+00000000 T __x86.get_pc_thunk.si
 
 ana/vswitch.o:
          U AnaAccum
@@ -2618,99 +2768,121 @@ ana/vswitch.o:
          U AnaSysCol
          U AnaSystem
          U AnaVdd
-00000000 t Bistablemaker
+000015c0 T Attr_Vswitch
+00000330 T Bistablemaker
+00001850 T Copygate_Vswitch
+00001e20 T Display_Vswitch
+000018c0 T Dispose_Vswitch
+00001fb0 T Erase_Vswitch
          U _Escape
+00000530 T Ex_Vswitch
          U fprintf
          U free
-000005a0 t GetCnf_Vswitch.constprop.18
+         U fscanf
+00000840 T GetCnf_Vswitch
          U _GLOBAL_OFFSET_TABLE_
+000006d0 T Iin_Vswitch
+000010e0 T initlib_Vswitch
          U _IO_getc
-         U __isoc99_fscanf
-00000fc0 t .L122
-00000fe8 t .L124
-00000e70 t .L125
-00001000 t .L126
-00001188 t .L127
-000011b0 t .L128
-00001208 t .L129
-00001898 t .L130
-000015e0 t .L131
-00001920 t .L132
-000014c0 t .L133
-00001860 t .L134
-000017f0 t .L135
-00001950 t .L136
-000013d8 t .L137
-00001618 t .L138
-000013f0 t .L139
-00001470 t .L140
-00001510 t .L141
-00001560 t .L142
-00001630 t .L143
-000016f0 t .L144
-000019d8 t .L161
-00001a3b t .L163
-00001996 t .L164
-00001a7a t .L165
-00001a07 t .L166
-000019af t .L204
-00000f90 t .L228
+000014e0 t .L169
+00001498 t .L171
+00001340 t .L172
+000013e8 t .L173
+000013a0 t .L174
+000012f0 t .L191
+00002253 t .L287
+00002260 t .L289
+00002280 t .L291
+00002290 t .L292
+000022a0 t .L293
+000022b0 t .L294
+000022c8 t .L295
+00002320 t .L296
+000024e0 t .L297
+00002478 t .L298
+000024b0 t .L299
+000023f0 t .L300
+00002440 t .L301
+000024f0 t .L302
+00002500 t .L303
+00002330 t .L304
+00002348 t .L305
+00002360 t .L306
+00002210 t .L307
+00002370 t .L308
+000023e0 t .L309
+000023c0 t .L310
+000023d0 t .L311
 00000000 r .LC0
-00000000 r .LC1
-00000078 r .LC10
-00000088 r .LC11
-0000009f r .LC12
-000000a7 r .LC13
-00000008 r .LC14
-000000ab r .LC15
-000000b0 r .LC16
-000000bb r .LC17
-000000c4 r .LC18
-00000004 r .LC2
-000000ca r .LC20
-000000d1 r .LC21
-0000000c r .LC22
-000000d6 r .LC23
-000000db r .LC24
-000000e1 r .LC25
-000000e4 r .LC26
+00000045 r .LC10
+0000004c r .LC11
+00000008 r .LC12
+00000051 r .LC13
+00000056 r .LC14
+0000005c r .LC15
+0000005f r .LC16
+0000000c r .LC17
+00000000 r .LC18
+00000008 r .LC19
+00000000 r .LC2
+00000000 r .LC20
+00000065 r .LC21
+0000006f r .LC22
+00000080 r .LC23
+00000086 r .LC24
+0000008c r .LC25
+00000093 r .LC26
 00000010 r .LC27
-000000ea r .LC28
-000000f0 r .LC29
-00000016 r .LC3
-00000000 r .LC30
-00000008 r .LC31
-00000010 r .LC32
-00000018 r .LC33
-000000f6 r .LC34
-00000100 r .LC35
-00000111 r .LC36
-00000118 r .LC37
-0000011c r .LC38
-00000029 r .LC4
-0000002b r .LC5
-00000039 r .LC6
-00000048 r .LC7
-00000058 r .LC8
-00000069 r .LC9
-000001e0 t Limitfill
-00000e20 T Log_vswitch_initlib_32
+00000097 r .LC28
+00000010 r .LC29
+0000001a r .LC3
+000000ad r .LC30
+000000c0 r .LC31
+000000c2 r .LC32
+000000d0 r .LC33
+000000df r .LC34
+000000ef r .LC35
+00000100 r .LC36
+0000010f r .LC37
+0000011f r .LC38
+00000022 r .LC4
+00000004 r .LC5
+00000026 r .LC6
+0000002b r .LC7
+00000036 r .LC8
+0000003f r .LC9
+00000220 T Limitfill
+000021e0 T Log_vswitch_initlib_32
          U malloc
          U __MallocTemp__
          U m_color
          U m_fillrect
-000002f0 t Monostablemaker.part.0
+00000410 T Monostablemaker
+00000000 t Monostablemaker.part.0
+00001620 T Newgate_Vswitch
          U _OutMem
-000003b0 t Probe_Vswitch.isra.17
+00001d10 T PreUpdate_Vswitch
+00001ff0 T Probe_Vswitch
          U puts
+00001900 T Readgate_Vswitch
+00001f70 T Refresh_Vswitch
+00001230 T ResetInit_Vswitch
+00001c20 T Reset_Vswitch
          U _setjmp
+00001cc0 T Set_Vswitch
          U sprintf
          U __stack_chk_fail_local
          U strtod
          U __top_jb
-000000b0 t Vswitchfill
+00001ea0 T Touch_Vswitch
+00001dc0 T Update_Vswitch
+000012c0 T Vswitchcheck
+000000f0 T Vswitchfill
+00001ae0 T Writegate_Vswitch
+00000000 T __x86.get_pc_thunk.ax
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
 
 ana/stairs.o:
          U AnaCapattrinsert
@@ -2740,95 +2912,118 @@ ana/stairs.o:
          U AnaSysCol
          U AnaSystem
          U AnaVdd
+000010a0 T Attr_Stairs
+00001730 T Clear_Stairs
+00001260 T Copygate_Stairs
+00001820 T Display_Stairs
+00001310 T Dispose_Stairs
+000019a0 T Erase_Stairs
          U _Escape
+00000400 T Ex_Stairs
          U fprintf
          U free
-00000500 t GetCnf_Stairs.constprop.16
+         U fscanf
+00000740 T GetCnf_Stairs
          U _GLOBAL_OFFSET_TABLE_
+00000590 T Iin_Stairs
+00000d80 T initlib_Stairs
          U _IO_getc
-         U __isoc99_fscanf
-00001190 t .L100
-00001220 t .L101
-00001080 t .L102
-000010b0 t .L103
-000010e0 t .L104
-00001160 t .L105
-00001060 t .L106
-00001598 t .L107
-00001538 t .L108
-000015b0 t .L109
-00001250 t .L110
-000012a0 t .L111
-000012e0 t .L112
-00001440 t .L113
-0000162c t .L129
-00001680 t .L131
-00001698 t .L132
-000016c8 t .L133
-000016f8 t .L134
-00001709 t .L135
-00001752 t .L136
-00001759 t .L153
-00000c80 t .L179
-00000cb0 t .L91
-00000cd8 t .L93
-00000b58 t .L94
-00000cf0 t .L95
-00000e68 t .L96
-00000e90 t .L97
-00000f20 t .L98
-000011c0 t .L99
+00000f00 t .L121
+00001060 t .L123
+00001018 t .L124
+00000fd8 t .L125
+00000fc0 t .L126
+00000f80 t .L127
+00000f40 t .L128
+00001088 t .L129
+00001c43 t .L228
+00001c50 t .L230
+00001c70 t .L232
+00001c80 t .L233
+00001c90 t .L234
+00001ca0 t .L235
+00001cb8 t .L236
+00001d58 t .L237
+00001bf0 t .L238
+00001f98 t .L239
+00001fc8 t .L240
+00001e80 t .L241
+00001eb0 t .L242
+00001ee0 t .L243
+00001f70 t .L244
+00001d70 t .L245
+00001d88 t .L246
+00001da0 t .L247
+00001db0 t .L248
+00001dc0 t .L249
+00001e08 t .L250
+00001e58 t .L251
+00001e70 t .L252
 00000000 r .LC1
-0000005f r .LC10
-00000066 r .LC11
-00000069 r .LC12
-00000008 r .LC13
-0000006d r .LC14
-00000072 r .LC15
-0000007c r .LC16
-00000083 r .LC17
-00000088 r .LC18
-00000091 r .LC19
+0000003e r .LC10
+00000045 r .LC11
+0000004a r .LC12
+00000053 r .LC13
+00000008 r .LC14
+0000005c r .LC15
+00000061 r .LC16
+00000000 r .LC17
+00000000 r .LC18
+00000010 r .LC19
 00000000 r .LC2
-0000000c r .LC20
-0000009a r .LC21
-0000009f r .LC22
-000000a6 r .LC23
-000000ac r .LC24
-00000000 r .LC25
-00000008 r .LC26
-00000010 r .LC27
-000000b2 r .LC28
-000000bc r .LC29
-00000004 r .LC3
-000000cd r .LC30
-000000d4 r .LC31
-000000d8 r .LC32
-00000014 r .LC4
-00000027 r .LC5
-00000029 r .LC6
-00000031 r .LC7
-00000041 r .LC8
-00000058 r .LC9
-00000120 t Limitfill
-00000b10 T Log_stairs_initlib_32
+00000020 r .LC20
+00000068 r .LC21
+00000072 r .LC22
+00000083 r .LC23
+00000089 r .LC24
+0000008f r .LC25
+00000096 r .LC26
+00000030 r .LC27
+0000009a r .LC28
+0000000c r .LC29
+0000001a r .LC3
+000000ae r .LC30
+000000c1 r .LC31
+000000c3 r .LC32
+000000cb r .LC33
+000000db r .LC34
+00000021 r .LC4
+00000028 r .LC5
+0000002b r .LC6
+00000004 r .LC7
+0000002f r .LC8
+00000034 r .LC9
+00000130 T Limitfill
+00001bc0 T Log_stairs_initlib_32
          U malloc
          U __MallocTemp__
          U m_color
          U m_fillrect
+00001100 T Newgate_Stairs
          U _OutMem
-00000360 t Probe_Stairs.isra.15
+00001760 T PreUpdate_Stairs
+00001a00 T Probe_Stairs
          U puts
+00001350 T Readgate_Stairs
+000019d0 T Refresh_Stairs
+00001650 T Reset_Stairs
          U _setjmp
+00001700 T Set_Stairs
          U sprintf
          U __stack_chk_fail_local
-00000000 t Stairmaker
+00000240 T Stairmaker
+00000ed0 T Stairscheck
          U strtod
          U strtol
-00000230 t Switchfill
+00000000 T Switchfill
          U __top_jb
+00001930 T Touch_Stairs
+000017c0 T Update_Stairs
+00001520 T Writegate_Stairs
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
+00000000 T __x86.get_pc_thunk.si
 
 ana/runspec.o:
          U AnaChangedP
@@ -2841,25 +3036,31 @@ ana/runspec.o:
          U AnaOldmodel
          U AnaParamUpdate
          U AnaPFab
+00000140 T Attr_Runspec
          U _GLOBAL_OFFSET_TABLE_
-00000200 t .L10
-000002c8 t .L11
-00000110 t .L14
-00000440 t .L16
-000003a0 t .L17
-000003f0 t .L18
-00000310 t .L19
-000001b0 t .L20
-00000360 t .L21
-000001a4 t .L4
-00000230 t .L6
-00000220 t .L8
-000001ef t .L9
-000000e0 T Log_RUNSPEC_initlib_32
+00000000 T initlib_Runspec
+00000240 t .L10
+000003d0 t .L12
+00000380 t .L13
+00000330 t .L14
+000002e0 t .L15
+00000290 t .L16
+00000178 t .L17
+00000769 t .L50
+00000770 t .L52
+000007a0 t .L54
+00000790 t .L55
+00000780 t .L56
+00000730 t .L57
+00000237 t .L8
+00000700 T Log_RUNSPEC_initlib_32
          U malloc
          U __MallocTemp__
+00000620 T Newgate_Runspec
+00000470 T Openconfig_Runspec
          U _OutMem
-00000000 t Reload_Runspec.isra.1
+00000560 T Readgate_Runspec
+00000060 T Reload_Runspec
          U strcpy
 00000000 T __x86.get_pc_thunk.bx
 
@@ -2890,126 +3091,150 @@ ana/idiff.o:
          U AnaSysCol
          U AnaSystem
          U AnaVdd
+00001e90 T Attr_IDiff
+000025b0 T Clear_Idiff
+00002140 T Copygate_IDiff
+00002690 T Display_IDiff
+000021e0 T Dispose_IDiff
+000027f0 T Erase_Idiff
          U _Escape
+00000380 T Ex_IDiff
          U fprintf
          U free
-000005b0 t GetCnf_IDiff.constprop.16
+         U fscanf
+00000bd0 T GetCnf_IDiff
          U _GLOBAL_OFFSET_TABLE_
+000019e0 T IDiffcheck
+00000700 T Iin_IDiff
+00001820 T initlib_IDiff
          U _IO_getc
-         U __isoc99_fscanf
-000013b0 t .L154
-000013d8 t .L156
-000013f0 t .L157
-000014f0 t .L158
-00001630 t .L159
-00001650 t .L160
-000016c0 t .L161
-00001a40 t .L162
-00001a10 t .L163
-00001aa0 t .L164
-00001900 t .L165
-00001930 t .L166
-00001960 t .L167
-000019e0 t .L168
-000018e8 t .L169
-00001d20 t .L170
-00001cc0 t .L171
-00001d40 t .L172
-00001ad0 t .L173
-00001b20 t .L174
-00001218 t .L175
-00001b60 t .L176
-00001da3 t .L199
-00001e48 t .L201
-00001e6f t .L202
-00001ea2 t .L203
-00001ee5 t .L204
-00001f42 t .L205
-00001f7b t .L206
-00001fd8 t .L207
-00002035 t .L208
-0000206f t .L209
-000020a2 t .L210
-000020b3 t .L211
-000020e5 t .L212
-000020ec t .L245
-00001380 t .L308
+00001a10 t .L210
+00001e40 t .L212
+00001e00 t .L213
+00001db0 t .L214
+00001d48 t .L215
+00001d00 t .L216
+00001c90 t .L217
+00001c20 t .L218
+00001be0 t .L219
+00001ba0 t .L220
+00001b50 t .L221
+00001b68 t .L222
+00001a50 t .L223
+00001e78 t .L224
+00002b63 t .L364
+00002b70 t .L366
+00002b90 t .L368
+00002ba0 t .L369
+00002bb0 t .L370
+00002bc0 t .L371
+00002bd8 t .L372
+00002c60 t .L373
+00002b10 t .L374
+00002e88 t .L375
+00002eb8 t .L376
+00002d70 t .L377
+00002da0 t .L378
+00002dd0 t .L379
+00002e60 t .L380
+00002c70 t .L381
+00002c88 t .L382
+00002ca0 t .L383
+00002cb0 t .L384
+00002cc0 t .L385
+00002d08 t .L386
+00002d50 t .L387
+00002d60 t .L388
 00000000 r .LC0
-00000000 r .LC1
-00000068 r .LC10
-00000077 r .LC11
-0000007d r .LC12
-00000084 r .LC13
-00000087 r .LC14
-00000000 r .LC15
-0000008f r .LC16
-00000094 r .LC17
-00000099 r .LC18
-0000009f r .LC19
-0000000f r .LC2
-00000008 r .LC20
-000000a2 r .LC21
-00000010 r .LC22
-000000a9 r .LC23
-000000ad r .LC24
-00000008 r .LC25
-000000b2 r .LC26
-000000b8 r .LC28
-000000be r .LC29
-00000017 r .LC3
-000000c4 r .LC30
-00000018 r .LC31
-0000000c r .LC32
-000000cb r .LC33
-00000010 r .LC34
-000000d0 r .LC35
-000000d5 r .LC36
-000000db r .LC37
-00000014 r .LC38
-000000e2 r .LC39
-00000022 r .LC4
-000000e9 r .LC40
-000000ef r .LC41
-00000000 r .LC42
-00000010 r .LC43
-00000018 r .LC44
-00000020 r .LC45
-0000001c r .LC46
-00000028 r .LC47
-00000030 r .LC48
-00000020 r .LC49
-00000004 r .LC5
-00000024 r .LC50
-00000038 r .LC51
-00000040 r .LC52
-000000f5 r .LC53
-000000ff r .LC54
-00000110 r .LC55
-00000117 r .LC56
-0000011b r .LC57
-0000002c r .LC6
-0000003f r .LC7
-00000041 r .LC8
-00000051 r .LC9
-000000f0 t Limitfill
-000011d0 T Log_idiff_initlib_32
+00000027 r .LC10
+0000002a r .LC11
+00000000 r .LC12
+00000032 r .LC13
+00000037 r .LC14
+0000003c r .LC15
+00000042 r .LC16
+00000008 r .LC17
+00000045 r .LC18
+00000010 r .LC19
+0000004c r .LC20
+00000050 r .LC21
+0000000c r .LC22
+00000055 r .LC23
+0000005b r .LC24
+00000061 r .LC25
+00000067 r .LC26
+00000018 r .LC27
+00000010 r .LC28
+0000006e r .LC29
+00000004 r .LC3
+00000014 r .LC30
+00000073 r .LC31
+00000078 r .LC32
+0000007e r .LC33
+00000018 r .LC34
+00000085 r .LC35
+00000020 r .LC36
+00000030 r .LC37
+00000040 r .LC38
+00000020 r .LC39
+00000000 r .LC4
+0000001c r .LC40
+00000020 r .LC41
+00000050 r .LC42
+00000060 r .LC43
+00000070 r .LC44
+0000008c r .LC45
+00000096 r .LC46
+000000a7 r .LC47
+000000ad r .LC48
+000000b3 r .LC49
+00000010 r .LC5
+000000ba r .LC50
+00000080 r .LC51
+000000be r .LC52
+000000cd r .LC53
+000000d5 r .LC54
+000000e0 r .LC55
+00000024 r .LC56
+000000ea r .LC57
+000000fd r .LC58
+000000ff r .LC59
+00000008 r .LC6
+0000010f r .LC60
+00000126 r .LC61
+00000000 r .LC7
+0000001a r .LC8
+00000020 r .LC9
+00000130 T Limitfill
+00002ae0 T Log_idiff_initlib_32
          U malloc
          U __MallocTemp__
          U m_color
          U m_fillrect
+00001ef0 T Newgate_IDiff
          U _OutMem
-00000330 t Probe_Idiff.isra.15
-00000000 t Pulsemaker
+000025e0 T PreUpdate_IDiff
+00002850 T Probe_Idiff
+00000240 T Pulsemaker
          U puts
+00002220 T Readgate_IDiff
+00002820 T Refresh_Idiff
+000024d0 T Reset_IDiff
+00002580 T Set_Idiff
          U _setjmp
          U sin
          U sprintf
          U __stack_chk_fail_local
          U strtod
-00000200 t Switchfill
+00000000 T Switchfill
          U __top_jb
+00002780 T Touch_IDiff
+00002640 T Update_IDiff
+000023b0 T Writegate_IDiff
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
+00000000 T __x86.get_pc_thunk.si
 
 ana/iswitch1.o:
          U AnaAccum
@@ -3039,102 +3264,125 @@ ana/iswitch1.o:
          U AnaSysCol
          U AnaSystem
          U AnaVdd
-00000000 t Bistablemaker
+000016b0 T Attr_Iswitch1
+00000330 T Bistablemaker
+00001930 T Copygate_Iswitch1
+00001ed0 T Display_Iswitch1
+000019a0 T Dispose_Iswitch1
+00002050 T Erase_Iswitch1
          U _Escape
+00000530 T Ex_Iswitch1
          U fprintf
          U free
-000005a0 t GetCnf_Iswitch1.constprop.18
+         U fscanf
+00000970 T GetCnf_Iswitch1
          U _GLOBAL_OFFSET_TABLE_
+00000770 T Iin_Iswitch1
+00001200 T initlib_Iswitch1
          U _IO_getc
-         U __isoc99_fscanf
-000000b0 t Iswitch1fill
-00000f70 t .L122
-00000f98 t .L124
-00000fb0 t .L125
-000010c0 t .L126
-00001240 t .L127
-00001260 t .L128
-00001308 t .L129
-00001990 t .L130
-00001668 t .L131
-00001a18 t .L132
-00001540 t .L133
-00001950 t .L134
-000018d8 t .L135
-00001a40 t .L136
-000014d0 t .L137
-000016a0 t .L138
-00000e88 t .L139
-000014f0 t .L140
-00001590 t .L141
-000015e0 t .L142
-000016c0 t .L143
-000017d0 t .L144
-00001ac8 t .L164
-00001af8 t .L166
-00001a86 t .L167
-00001b28 t .L168
-00001bb8 t .L169
-00001a9d t .L211
-00000f40 t .L243
+000013e0 T Iswitch1check
+000000f0 T Iswitch1fill
+000015d0 t .L186
+00001590 t .L188
+00001450 t .L189
+000014e8 t .L190
+000014b0 t .L191
+00001410 t .L207
+000022f3 t .L303
+00002300 t .L305
+00002320 t .L307
+00002330 t .L308
+00002340 t .L309
+00002350 t .L310
+00002368 t .L311
+000023c0 t .L312
+00002580 t .L313
+00002518 t .L314
+00002550 t .L315
+00002490 t .L316
+000024e0 t .L317
+00002590 t .L318
+000025a0 t .L319
+000023d0 t .L320
+000023e8 t .L321
+00002400 t .L322
+000022b0 t .L323
+00002410 t .L324
+00002480 t .L325
+00002460 t .L326
+00002470 t .L327
 00000000 r .LC0
-00000000 r .LC1
-00000078 r .LC10
-00000088 r .LC11
-0000009f r .LC12
-000000a8 r .LC13
-00000000 r .LC14
-000000b0 r .LC15
-000000b5 r .LC16
-000000c0 r .LC17
-000000c9 r .LC18
-00000004 r .LC2
-000000cf r .LC20
-00000008 r .LC21
-000000d6 r .LC22
-00000008 r .LC23
-000000db r .LC24
-000000e0 r .LC25
-000000e6 r .LC26
-000000e9 r .LC27
-0000000c r .LC28
-000000ef r .LC29
-00000016 r .LC3
-000000f5 r .LC30
-00000000 r .LC31
-00000010 r .LC32
+0000003b r .LC10
+00000044 r .LC11
+0000004a r .LC12
+00000008 r .LC13
+00000051 r .LC14
+00000008 r .LC15
+00000056 r .LC16
+0000005b r .LC17
+00000061 r .LC18
+00000064 r .LC19
+00000000 r .LC2
+0000000c r .LC20
+00000010 r .LC21
+00000010 r .LC22
+00000018 r .LC23
+00000020 r .LC24
+0000006a r .LC25
+00000074 r .LC26
+00000085 r .LC27
+0000008b r .LC28
+00000091 r .LC29
+00000004 r .LC3
+00000098 r .LC30
+00000030 r .LC31
+0000009c r .LC32
 00000010 r .LC33
-00000018 r .LC34
-00000020 r .LC35
-00000028 r .LC36
-000000fb r .LC37
-00000105 r .LC38
-00000116 r .LC39
-00000029 r .LC4
-0000011d r .LC40
-00000121 r .LC41
-0000002b r .LC5
-00000039 r .LC6
-00000048 r .LC7
-00000058 r .LC8
-00000069 r .LC9
-000001e0 t Limitfill
-00000e40 T Log_iswitch1_initlib_32
+000000b2 r .LC34
+000000c5 r .LC35
+000000c7 r .LC36
+000000d5 r .LC37
+000000e4 r .LC38
+000000f4 r .LC39
+00000000 r .LC4
+00000105 r .LC40
+00000114 r .LC41
+00000124 r .LC42
+0000001a r .LC5
+00000023 r .LC6
+00000000 r .LC7
+0000002b r .LC8
+00000030 r .LC9
+00000220 T Limitfill
+00002280 T Log_iswitch1_initlib_32
          U malloc
          U __MallocTemp__
          U m_color
          U m_fillrect
-000002f0 t Monostablemaker.part.0
+00000410 T Monostablemaker
+00000000 t Monostablemaker.part.0
+00001710 T Newgate_Iswitch1
          U _OutMem
-000003b0 t Probe_Iswitch1.isra.17
+00001dd0 T PreUpdate_Iswitch1
+00002090 T Probe_Iswitch1
          U puts
+000019e0 T Readgate_Iswitch1
+00002010 T Refresh_Iswitch1
+00001350 T ResetInit_Iswitch1
+00001ce0 T Reset_Iswitch1
+00001d80 T Set_Iswitch1
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
          U strtod
          U __top_jb
+00001f50 T Touch_Iswitch1
+00001e70 T Update_Iswitch1
+00001bb0 T Writegate_Iswitch1
+00000000 T __x86.get_pc_thunk.ax
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
 
 ana/iswitch2.o:
          U AnaAccum
@@ -3164,102 +3412,125 @@ ana/iswitch2.o:
          U AnaSysCol
          U AnaSystem
          U AnaVdd
-00000000 t Bistablemaker
+00001690 T Attr_Iswitch2
+00000330 T Bistablemaker
+00001910 T Copygate_Iswitch2
+00001eb0 T Display_Iswitch2
+00001980 T Dispose_Iswitch2
+00002030 T Erase_Iswitch2
          U _Escape
+00000530 T Ex_Iswitch2
          U fprintf
          U free
-000005a0 t GetCnf_Iswitch2.constprop.18
+         U fscanf
+00000950 T GetCnf_Iswitch2
          U _GLOBAL_OFFSET_TABLE_
+00000770 T Iin_Iswitch2
+000011e0 T initlib_Iswitch2
          U _IO_getc
-         U __isoc99_fscanf
-000000b0 t Iswitch2fill
-00000f70 t .L122
-00000f98 t .L124
-00000fb0 t .L125
-000010c0 t .L126
-00001240 t .L127
-00001260 t .L128
-00001308 t .L129
-00001970 t .L130
-00001660 t .L131
-000019f8 t .L132
-00001540 t .L133
-00001930 t .L134
-000018b8 t .L135
-00001a20 t .L136
-000014d0 t .L137
-00001690 t .L138
-00000e88 t .L139
-000014f0 t .L140
-00001590 t .L141
-000015e0 t .L142
-000016b0 t .L143
-000017b0 t .L144
-00001aa8 t .L164
-00001ad8 t .L166
-00001a66 t .L167
-00001b08 t .L168
-00001b98 t .L169
-00001a7d t .L211
-00000f40 t .L243
+000013c0 T Iswitch2check
+000000f0 T Iswitch2fill
+000015b0 t .L186
+00001570 t .L188
+00001430 t .L189
+000014c8 t .L190
+00001490 t .L191
+000013f0 t .L207
+000022d3 t .L303
+000022e0 t .L305
+00002300 t .L307
+00002310 t .L308
+00002320 t .L309
+00002330 t .L310
+00002348 t .L311
+000023a0 t .L312
+00002560 t .L313
+000024f8 t .L314
+00002530 t .L315
+00002470 t .L316
+000024c0 t .L317
+00002570 t .L318
+00002580 t .L319
+000023b0 t .L320
+000023c8 t .L321
+000023e0 t .L322
+00002290 t .L323
+000023f0 t .L324
+00002460 t .L325
+00002440 t .L326
+00002450 t .L327
 00000000 r .LC0
-00000000 r .LC1
-00000076 r .LC10
-00000086 r .LC11
-0000009d r .LC12
-000000a6 r .LC13
-00000000 r .LC14
-000000ae r .LC15
-000000b3 r .LC16
-000000be r .LC17
-000000c7 r .LC18
-00000004 r .LC2
-000000cd r .LC20
-00000008 r .LC21
-000000d4 r .LC22
-00000008 r .LC23
-000000d9 r .LC24
-000000de r .LC25
-000000e4 r .LC26
-000000e7 r .LC27
-0000000c r .LC28
-000000ed r .LC29
-00000014 r .LC3
-000000f3 r .LC30
-00000000 r .LC31
-00000010 r .LC32
-00000010 r .LC33
-00000018 r .LC34
-00000020 r .LC35
-00000028 r .LC36
-000000f9 r .LC37
-00000103 r .LC38
-00000114 r .LC39
-00000027 r .LC4
-0000011b r .LC40
-0000011f r .LC41
-00000029 r .LC5
-00000037 r .LC6
-00000046 r .LC7
-00000056 r .LC8
-00000067 r .LC9
-000001e0 t Limitfill
-00000e40 T Log_iswitch2_initlib_32
+0000003b r .LC10
+00000044 r .LC11
+0000004a r .LC12
+00000008 r .LC13
+00000051 r .LC14
+00000008 r .LC15
+00000056 r .LC16
+0000005b r .LC17
+00000061 r .LC18
+00000064 r .LC19
+00000000 r .LC2
+0000000c r .LC20
+00000010 r .LC21
+00000010 r .LC22
+00000018 r .LC23
+00000020 r .LC24
+0000006a r .LC25
+00000074 r .LC26
+00000085 r .LC27
+0000008b r .LC28
+00000091 r .LC29
+00000004 r .LC3
+00000098 r .LC30
+00000030 r .LC31
+0000009c r .LC32
+00000010 r .LC33
+000000b0 r .LC34
+000000c3 r .LC35
+000000c5 r .LC36
+000000d3 r .LC37
+000000e2 r .LC38
+000000f2 r .LC39
+00000000 r .LC4
+00000103 r .LC40
+00000112 r .LC41
+00000122 r .LC42
+0000001a r .LC5
+00000023 r .LC6
+00000000 r .LC7
+0000002b r .LC8
+00000030 r .LC9
+00000220 T Limitfill
+00002260 T Log_iswitch2_initlib_32
          U malloc
          U __MallocTemp__
          U m_color
          U m_fillrect
-000002f0 t Monostablemaker.part.0
+00000410 T Monostablemaker
+00000000 t Monostablemaker.part.0
+000016f0 T Newgate_Iswitch2
          U _OutMem
-000003b0 t Probe_Iswitch2.isra.17
+00001db0 T PreUpdate_Iswitch2
+00002070 T Probe_Iswitch2
          U puts
+000019c0 T Readgate_Iswitch2
+00001ff0 T Refresh_Iswitch2
+00001330 T ResetInit_Iswitch2
+00001cc0 T Reset_Iswitch2
+00001d60 T Set_Iswitch2
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
          U strtod
          U __top_jb
+00001f30 T Touch_Iswitch2
+00001e50 T Update_Iswitch2
+00001b90 T Writegate_Iswitch2
+00000000 T __x86.get_pc_thunk.ax
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
 
 ana/devtechn.o:
          U AnaChangedP
@@ -3271,34 +3542,41 @@ ana/devtechn.o:
          U AnaNFab
          U AnaOldmodel
          U AnaParamUpdate
+00000260 T Attr_Devtechn
          U _GLOBAL_OFFSET_TABLE_
-000002c0 t .L10
-00000228 t .L11
-0000049e t .L14
-000004f8 t .L16
-00000550 t .L17
-000005b0 t .L18
-00000610 t .L19
-00000670 t .L20
-000006d0 t .L21
-00000720 t .L22
-00000770 t .L23
-000007c0 t .L25
-00000266 t .L26
-00000810 t .L27
-00000860 t .L28
-000008b0 t .L29
-00000900 t .L30
-00000496 t .L31
-00000262 t .L4
-000002f0 t .L6
-000002e0 t .L8
-000002b1 t .L9
-00000200 T Log_DEVTECHN_initlib_32
+00000000 T initlib_Devtechn
+00000400 t .L10
+00000840 t .L12
+000007e8 t .L13
+00000790 t .L14
+00000738 t .L15
+000006e0 t .L16
+00000690 t .L17
+00000640 t .L18
+000005f0 t .L19
+000005a0 t .L21
+00000550 t .L22
+00000500 t .L23
+000004b0 t .L24
+00000458 t .L25
+00000298 t .L26
+000003f0 t .L27
+000003f7 t .L8
+00000ac9 t .L85
+00000ad0 t .L87
+00000b00 t .L89
+00000af0 t .L90
+00000ae0 t .L91
+00000a90 t .L92
+00000a60 T Log_DEVTECHN_initlib_32
          U malloc
          U __MallocTemp__
+00000a00 T Newgate_Devtechn
+000008e0 T Openconfig_Devtechn
          U _OutMem
-00000000 t Reload_Devtechn.isra.1
+00000900 T Readgate_Devtechn
+00000060 T Reload_Devtechn
+         U __stack_chk_fail_local
          U strcpy
 00000000 T __x86.get_pc_thunk.bx
 
@@ -3322,44 +3600,53 @@ ana/resfloat.o:
          U AnaScoreboard
          U AnaSysCol
          U AnaSystem
+00000470 T Attr_Resfloat
+000005a0 T Copygate_Resfloat
+00000610 T Dispose_Resfloat
          U _Escape
+00000000 T Ex_Resfloat
          U free
-00000280 t GetCnf_Resfloat.constprop.8
+000001c0 T GetCnf_Resfloat
          U _GLOBAL_OFFSET_TABLE_
-00000487 t .L38
-00000490 t .L40
-000007b8 t .L42
-000007a0 t .L43
-00000770 t .L44
-00000750 t .L45
-00000700 t .L46
-00000698 t .L47
-00000680 t .L48
-00000640 t .L49
-00000628 t .L50
-00000610 t .L51
-000005c0 t .L52
-000005a8 t .L53
-000004b0 t .L54
-000003f0 t .L55
+00000120 T Iin_Resfloat
+00000310 T initlib_Resfloat
+00000b30 t .L100
+00000b00 t .L101
+00000ae0 t .L102
+00000a88 t .L103
+00000a20 t .L104
+00000a08 t .L105
+00000940 t .L106
+000009f0 t .L107
+000009e0 t .L108
+000009d0 t .L109
+000009c0 t .L110
+000009b0 t .L111
+000009a0 t .L112
+00000973 t .L95
+00000980 t .L97
+00000b48 t .L99
 00000000 r .LC0
-00000000 r .LC1
-00000000 r .LC10
-00000008 r .LC11
-00000034 r .LC12
-00000009 r .LC2
-00000018 r .LC3
-0000001a r .LC5
-0000001f r .LC6
-00000027 r .LC7
-00000030 r .LC8
-00000004 r .LC9
-000003c0 T Log_resfloat_initlib_32
+0000001a r .LC1
+00000030 r .LC10
+0000003f r .LC11
+00000041 r .LC12
+00000046 r .LC13
+00000023 r .LC2
+00000000 r .LC3
+00000000 r .LC4
+00000000 r .LC6
+00000004 r .LC8
+00000027 r .LC9
+00000910 T Log_resfloat_initlib_32
          U malloc
          U __MallocTemp__
+00000520 T Newgate_Resfloat
          U _OutMem
-00000000 t Probe_Resfloat.isra.7
+00000690 T Probe_Resfloat
          U puts
+00000650 T Readgate_Resfloat
+000003f0 T Resfloatcheck
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
@@ -3367,6 +3654,8 @@ ana/resfloat.o:
          U __top_jb
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
+00000000 T __x86.get_pc_thunk.si
 
 ana/capfloat.o:
          U AnaCapattrinsert
@@ -3390,43 +3679,53 @@ ana/capfloat.o:
          U AnaScoreboard
          U AnaSysCol
          U AnaSystem
+000004d0 T Attr_Capfloat
+00000470 T Capfloatcheck
+000005e0 T Copygate_Capfloat
+00000650 T Dispose_Capfloat
          U _Escape
+00000000 T Ex_Capfloat
          U free
-00000280 t GetCnf_Capfloat.constprop.8
+00000220 T GetCnf_Capfloat
          U _GLOBAL_OFFSET_TABLE_
-000004a1 t .L38
-000004b0 t .L40
-000007f0 t .L42
-000007d8 t .L43
-000007c0 t .L44
-000007a0 t .L45
-00000748 t .L46
-000006e8 t .L47
-000006d0 t .L48
-00000690 t .L49
-00000678 t .L50
-00000660 t .L51
-00000600 t .L52
-000005e8 t .L53
-000004d0 t .L54
-00000400 t .L55
+00000170 T Iin_Capfloat
+00000380 T initlib_Capfloat
+00000b00 t .L100
+00000ab0 t .L101
+00000a50 t .L102
+00000a38 t .L103
+00000970 t .L104
+00000a20 t .L105
+00000a10 t .L106
+00000a00 t .L107
+000009f0 t .L108
+000009e0 t .L109
+000009d0 t .L110
+000009a3 t .L93
+000009b0 t .L95
+00000b50 t .L97
+00000b38 t .L98
+00000b20 t .L99
 00000000 r .LC0
-00000000 r .LC1
-00000004 r .LC10
-00000035 r .LC11
-0000000a r .LC2
-00000019 r .LC3
-0000001b r .LC5
-00000020 r .LC6
-00000028 r .LC7
-00000031 r .LC8
-00000000 r .LC9
-000003d0 T Log_capfloat_initlib_32
+0000001a r .LC1
+00000040 r .LC10
+00000042 r .LC11
+00000047 r .LC12
+00000023 r .LC2
+00000000 r .LC3
+00000000 r .LC4
+00000000 r .LC6
+00000004 r .LC7
+00000027 r .LC8
+00000031 r .LC9
+00000940 T Log_capfloat_initlib_32
          U malloc
          U __MallocTemp__
+00000560 T Newgate_Capfloat
          U _OutMem
-00000000 t Probe_Capfloat.isra.7
+000006c0 T Probe_Capfloat
          U puts
+00000690 T Readgate_Capfloat
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
@@ -3434,6 +3733,7 @@ ana/capfloat.o:
          U __top_jb
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
 
 ana/nfet4.o:
          U AnaCapattrinsert
@@ -3462,75 +3762,84 @@ ana/nfet4.o:
          U AnaSystem
          U AnaTanch
          U AnaVdd
+000025e0 T Attr_Nfet4
+000028d0 T Copygate_Nfet4
+00002940 T Dispose_Nfet4
          U _Escape
+00000000 T Ex_NFET4
          U free
-00000390 t GetCnf_Nfet4.constprop.8
+000017d0 T GetCnf_Nfet4
          U _GLOBAL_OFFSET_TABLE_
-00000be8 t .L100
-00001070 t .L101
-00001e22 t .L125
-00001bdd t .L127
-00001c70 t .L128
-00001da9 t .L129
-00001cd3 t .L130
-00001d26 t .L131
-00001042 t .L206
-00001050 t .L86
-000016b0 t .L88
-00001698 t .L89
-000015c0 t .L90
-000015a0 t .L91
-00001548 t .L92
-00001360 t .L93
-00001348 t .L94
-00001300 t .L95
-000012e8 t .L96
-000012d0 t .L97
-00001168 t .L98
-00001150 t .L99
+00001180 T Iin_NFET4
+00002000 T initlib_NFET4
+00002228 t .L148
+00002170 t .L150
+00002450 t .L151
+00002390 t .L152
+00002328 t .L153
+00002270 t .L154
+00002fb5 t .L249
+00002fc0 t .L251
+00003118 t .L253
+00003100 t .L254
+000030f0 t .L255
+000030d8 t .L256
+00003080 t .L257
+00003068 t .L258
+00003050 t .L259
+00002f80 t .L260
+00003038 t .L261
+00003020 t .L262
+00003010 t .L263
+00003000 t .L264
+00002ff0 t .L265
+00002fe0 t .L266
 00000000 r .LC0
 00000000 r .LC1
-0000003d r .LC10
-00000008 r .LC11
-00000041 r .LC12
-00000000 r .LC13
-00000044 r .LC14
-00000008 r .LC15
-00000047 r .LC16
-00000010 r .LC17
-00000051 r .LC18
-00000018 r .LC19
-00000005 r .LC2
-00000057 r .LC20
-00000020 r .LC21
-0000005b r .LC22
-0000005f r .LC23
-00000063 r .LC24
-00000067 r .LC25
-0000006b r .LC26
-0000000c r .LC27
-00000000 r .LC28
-00000010 r .LC29
-00000014 r .LC3
-00000020 r .LC30
-00000030 r .LC31
-00000028 r .LC32
-00000010 r .LC33
-00000030 r .LC34
-00000014 r .LC35
-00000071 r .LC36
-00000004 r .LC4
-00000016 r .LC5
+00000008 r .LC10
+0000002a r .LC11
+00000010 r .LC12
+00000034 r .LC13
+00000018 r .LC14
+0000003a r .LC15
+00000020 r .LC16
+0000003e r .LC17
+00000042 r .LC18
+00000046 r .LC19
+0000004a r .LC20
+0000004e r .LC21
+00000008 r .LC22
+00000010 r .LC23
+00000020 r .LC24
+00000030 r .LC25
+00000040 r .LC26
+00000050 r .LC27
+00000028 r .LC28
+0000000c r .LC29
+00000004 r .LC3
+00000010 r .LC30
+00000054 r .LC31
+00000059 r .LC32
+00000068 r .LC33
+0000006a r .LC34
+00000074 r .LC35
+00000079 r .LC36
+00000082 r .LC37
+00000000 r .LC4
+0000001a r .LC5
 00000020 r .LC6
-00000025 r .LC7
-0000002e r .LC8
-00000037 r .LC9
-00000bb0 T Log_nfet4_initlib_32
+00000024 r .LC7
+00000000 r .LC8
+00000027 r .LC9
+00002f50 T Log_nfet4_initlib_32
          U malloc
          U __MallocTemp__
+00002670 T Newgate_Nfet4
+00002130 T Nfetcheck
          U _OutMem
-00000000 t Probe_Nfet4.isra.7
+00002bb0 T Probe_Nfet4
          U puts
+00002980 T Readgate_Nfet4
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
@@ -3566,75 +3875,84 @@ ana/pfet4.o:
          U AnaSystem
          U AnaTanch
          U AnaVdd
+000025f0 T Attr_Pfet4
+000028e0 T Copygate_Pfet4
+00002950 T Dispose_Pfet4
          U _Escape
+00000000 T Ex_PFET4
          U free
-00000390 t GetCnf_Pfet4.constprop.8
+000017e0 T GetCnf_Pfet4
          U _GLOBAL_OFFSET_TABLE_
-00000be8 t .L100
-00001060 t .L101
-00001e09 t .L125
-00001bc5 t .L127
-00001c58 t .L128
-00001d90 t .L129
-00001cbb t .L130
-00001d0e t .L131
-00001032 t .L206
-00001040 t .L86
-000016a0 t .L88
-00001688 t .L89
-000015b0 t .L90
-00001590 t .L91
-00001538 t .L92
-00001350 t .L93
-00001338 t .L94
-000012f0 t .L95
-000012d8 t .L96
-000012c0 t .L97
-00001158 t .L98
-00001140 t .L99
+00001180 T Iin_PFET4
+00002010 T initlib_PFET4
+00002238 t .L148
+00002180 t .L150
+00002460 t .L151
+000023a0 t .L152
+00002338 t .L153
+00002280 t .L154
+00002fc5 t .L249
+00002fd0 t .L251
+00003128 t .L253
+00003110 t .L254
+00003100 t .L255
+000030e8 t .L256
+00003090 t .L257
+00003078 t .L258
+00003060 t .L259
+00002f90 t .L260
+00003048 t .L261
+00003030 t .L262
+00003020 t .L263
+00003010 t .L264
+00003000 t .L265
+00002ff0 t .L266
 00000000 r .LC0
 00000000 r .LC1
-0000003d r .LC10
-00000008 r .LC11
-00000041 r .LC12
-00000000 r .LC13
-00000044 r .LC14
-00000008 r .LC15
-00000047 r .LC16
-00000010 r .LC17
-00000051 r .LC18
-00000018 r .LC19
-00000005 r .LC2
-00000057 r .LC20
-00000020 r .LC21
-0000005b r .LC22
-0000005f r .LC23
-00000063 r .LC24
-00000067 r .LC25
-0000006b r .LC26
-0000000c r .LC27
-00000000 r .LC28
-00000010 r .LC29
-00000014 r .LC3
-00000020 r .LC30
-00000030 r .LC31
-00000028 r .LC32
-00000010 r .LC33
-00000030 r .LC34
-00000014 r .LC35
-00000071 r .LC36
-00000004 r .LC4
-00000016 r .LC5
+00000008 r .LC10
+0000002a r .LC11
+00000010 r .LC12
+00000034 r .LC13
+00000018 r .LC14
+0000003a r .LC15
+00000020 r .LC16
+0000003e r .LC17
+00000042 r .LC18
+00000046 r .LC19
+0000004a r .LC20
+0000004e r .LC21
+00000008 r .LC22
+00000010 r .LC23
+00000020 r .LC24
+00000030 r .LC25
+00000040 r .LC26
+00000050 r .LC27
+00000028 r .LC28
+0000000c r .LC29
+00000004 r .LC3
+00000010 r .LC30
+00000054 r .LC31
+00000059 r .LC32
+00000068 r .LC33
+0000006a r .LC34
+00000074 r .LC35
+00000079 r .LC36
+00000082 r .LC37
+00000000 r .LC4
+0000001a r .LC5
 00000020 r .LC6
-00000025 r .LC7
-0000002e r .LC8
-00000037 r .LC9
-00000bb0 T Log_pfet4_initlib_32
+00000024 r .LC7
+00000000 r .LC8
+00000027 r .LC9
+00002f60 T Log_pfet4_initlib_32
          U malloc
          U __MallocTemp__
+00002680 T Newgate_Pfet4
          U _OutMem
-00000000 t Probe_Pfet4.isra.7
+00002140 T Pfetcheck
+00002bc0 T Probe_Pfet4
          U puts
+00002990 T Readgate_Pfet4
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
@@ -3669,74 +3987,83 @@ ana/nfet5.o:
          U AnaSysCol
          U AnaSystem
          U AnaVdd
+00001850 T Attr_Nfet5
+00001b20 T Copygate_Nfet5
+00001b90 T Dispose_Nfet5
          U _Escape
+00000000 T Ex_NFET5
          U free
-00000390 t GetCnf_Nfet5.constprop.8
+00000b70 T GetCnf_Nfet5
          U _GLOBAL_OFFSET_TABLE_
-00000bc8 t .L100
-00000fd0 t .L101
-00001a4e t .L125
-0000183d t .L127
-000018b0 t .L128
-00001910 t .L129
-00001998 t .L130
-000019eb t .L131
-00000fa2 t .L208
-00000fb0 t .L86
-000015c8 t .L88
-000015b0 t .L89
-00001508 t .L90
-000014e8 t .L91
-00001490 t .L92
-000012d0 t .L93
-000012b8 t .L94
-00001270 t .L95
-00001258 t .L96
-00001240 t .L97
-000010c8 t .L98
-000010b0 t .L99
+000007e0 T Iin_NFET5
+00001380 T initlib_NFET5
+00001580 t .L148
+000014f0 t .L150
+00001780 t .L151
+00001690 t .L152
+00001630 t .L153
+000015c8 t .L154
+000021e5 t .L253
+000021f0 t .L255
+00002348 t .L257
+00002330 t .L258
+00002320 t .L259
+00002308 t .L260
+000022b0 t .L261
+00002298 t .L262
+00002280 t .L263
+000021b0 t .L264
+00002268 t .L265
+00002250 t .L266
+00002240 t .L267
+00002230 t .L268
+00002220 t .L269
+00002210 t .L270
 00000000 r .LC0
-00000000 r .LC1
 00000008 r .LC10
-0000003c r .LC11
-00000000 r .LC12
-0000003f r .LC13
-00000008 r .LC14
-00000044 r .LC15
-0000004a r .LC16
-00000010 r .LC17
-0000004f r .LC18
-00000018 r .LC19
-00000006 r .LC2
-00000053 r .LC20
-00000057 r .LC21
-0000005b r .LC22
-0000005f r .LC23
-00000063 r .LC24
-0000000c r .LC25
-00000000 r .LC26
-00000010 r .LC27
-00000020 r .LC28
-00000030 r .LC29
-00000015 r .LC3
-00000020 r .LC30
-00000010 r .LC31
-00000028 r .LC32
-00000014 r .LC33
-00000069 r .LC34
-00000004 r .LC4
-00000017 r .LC5
-00000021 r .LC6
-00000026 r .LC7
-0000002f r .LC8
-00000038 r .LC9
+0000002c r .LC11
+00000032 r .LC12
+00000010 r .LC13
+00000037 r .LC14
+00000018 r .LC15
+0000003b r .LC16
+0000003f r .LC17
+00000043 r .LC18
+00000047 r .LC19
+00000000 r .LC2
+0000004b r .LC20
+00000008 r .LC21
+00000010 r .LC22
+00000020 r .LC23
+00000030 r .LC24
+00000040 r .LC25
+00000050 r .LC26
+00000020 r .LC27
+0000000c r .LC28
+00000010 r .LC29
+00000004 r .LC3
+00000051 r .LC30
+00000060 r .LC31
+00000062 r .LC32
+0000006c r .LC33
+00000071 r .LC34
+0000007a r .LC35
+00000000 r .LC4
+0000001a r .LC5
+00000020 r .LC6
+00000024 r .LC7
+00000000 r .LC8
+00000027 r .LC9
          U log
-00000b90 T Log_NFET5_INITLIB_32
+00002180 T Log_NFET5_INITLIB_32
          U malloc
          U __MallocTemp__
+000018e0 T Newgate_Nfet5
+000014b0 T Nfetcheck
          U _OutMem
-00000000 t Probe_Nfet5.isra.7
+00001de0 T Probe_Nfet5
          U puts
+00001bd0 T Readgate_Nfet5
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
@@ -3744,6 +4071,7 @@ ana/nfet5.o:
          U __top_jb
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
 
 ana/pfet5.o:
          U AnaCapattrinsert
@@ -3771,74 +4099,84 @@ ana/pfet5.o:
          U AnaSysCol
          U AnaSystem
          U AnaVdd
+00001860 T Attr_Pfet5
+00001b40 T Copygate_Pfet5
+00001bb0 T Dispose_Pfet5
          U _Escape
+00000000 T Ex_PFET5
          U free
-00000390 t GetCnf_Pfet5.constprop.8
+00000b60 T GetCnf_Pfet5
          U _GLOBAL_OFFSET_TABLE_
-00000bc8 t .L100
-00000ff0 t .L101
-00001ab7 t .L125
-0000186d t .L127
-00001908 t .L128
-00001a31 t .L129
-00001978 t .L130
-000019cf t .L131
-00000fc2 t .L207
-00000fd0 t .L86
-00001608 t .L88
-000015f0 t .L89
-00001538 t .L90
-00001518 t .L91
-000014c0 t .L92
-000012f0 t .L93
-000012d8 t .L94
-00001290 t .L95
-00001278 t .L96
-00001260 t .L97
-000010e8 t .L98
-000010d0 t .L99
+000007e0 T Iin_PFET5
+00001370 T initlib_PFET5
+000015a8 t .L148
+000014e0 t .L150
+00001710 t .L151
+000016b0 t .L152
+00001650 t .L153
+000015f0 t .L154
+00002215 t .L251
+00002220 t .L253
+00002378 t .L255
+00002360 t .L256
+00002350 t .L257
+00002338 t .L258
+000022e0 t .L259
+000022c8 t .L260
+000022b0 t .L261
+000021e0 t .L262
+00002298 t .L263
+00002280 t .L264
+00002270 t .L265
+00002260 t .L266
+00002250 t .L267
+00002240 t .L268
 00000000 r .LC0
-00000000 r .LC1
-00000008 r .LC10
-0000003c r .LC11
-00000000 r .LC12
-0000003f r .LC13
-00000008 r .LC14
-00000044 r .LC15
-0000004a r .LC16
-00000010 r .LC17
-0000004f r .LC18
-00000018 r .LC19
-00000006 r .LC2
-00000053 r .LC20
-00000057 r .LC21
-0000005b r .LC22
-0000005f r .LC23
-00000063 r .LC24
-0000000c r .LC25
-00000000 r .LC26
-00000010 r .LC27
+00000004 r .LC1
+00000027 r .LC10
+00000008 r .LC11
+0000002c r .LC12
+00000032 r .LC13
+00000010 r .LC14
+00000037 r .LC15
+00000018 r .LC16
+0000003b r .LC17
+0000003f r .LC18
+00000043 r .LC19
+00000047 r .LC20
+0000004b r .LC21
+0000000c r .LC22
+00000010 r .LC23
+00000020 r .LC24
+00000030 r .LC25
+00000040 r .LC26
+00000050 r .LC27
 00000020 r .LC28
-00000030 r .LC29
-00000015 r .LC3
-00000020 r .LC31
-00000010 r .LC32
-00000028 r .LC33
-00000014 r .LC34
-00000069 r .LC35
-00000004 r .LC4
-00000017 r .LC5
-00000021 r .LC6
-00000026 r .LC7
-0000002f r .LC8
-00000038 r .LC9
+00000010 r .LC29
+00000000 r .LC3
+00000014 r .LC30
+00000051 r .LC31
+00000060 r .LC32
+00000062 r .LC33
+0000006c r .LC34
+00000071 r .LC35
+0000007a r .LC36
+00000008 r .LC4
+00000000 r .LC5
+0000001a r .LC6
+00000020 r .LC7
+00000024 r .LC8
+00000000 r .LC9
          U log
-00000b90 T Log_PFET5_INITLIB_32
+000021b0 T Log_PFET5_INITLIB_32
          U malloc
          U __MallocTemp__
+000018f0 T Newgate_Pfet5
          U _OutMem
-00000000 t Probe_Pfet5.isra.7
+000014a0 T Pfetcheck
+00001e10 T Probe_Pfet5
          U puts
+00001bf0 T Readgate_Pfet5
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
@@ -3846,6 +4184,7 @@ ana/pfet5.o:
          U __top_jb
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
 
 ana/pfet6.o:
          U AnaCapattrinsert
@@ -3873,82 +4212,91 @@ ana/pfet6.o:
          U AnaSysCol
          U AnaSystem
          U AnaVdd
+00001b40 T Attr_Pfet6
+00001e60 T Copygate_Pfet6
+00001ed0 T Dispose_Pfet6
          U _Escape
+00000000 T Ex_PFET6
          U free
-000003f0 t GetCnf_Pfet6.constprop.8
+00000d60 T GetCnf_Pfet6
          U _GLOBAL_OFFSET_TABLE_
-000003c8 t .L10
-00001690 t .L100
-000014a0 t .L101
-00001488 t .L102
-00001440 t .L103
-00001428 t .L104
-00001410 t .L105
-00001358 t .L106
-00001340 t .L107
-00000ce8 t .L108
-00001260 t .L109
-00000350 t .L12
-00000390 t .L13
-00001cc0 t .L134
-00001d5d t .L136
-00001b6d t .L137
-00001bd8 t .L138
-00001c6d t .L139
-000002c0 t .L14
-00001d05 t .L140
-000003a0 t .L15
-0000122e t .L222
-00001240 t .L94
-000017e0 t .L96
-000017c8 t .L97
-00001708 t .L98
-000016e8 t .L99
+00000980 T Iin_PFET6
+00001630 T initlib_PFET6
+00001860 t .L156
+000017a0 t .L158
+000019e0 t .L159
+00001980 t .L160
+00001920 t .L161
+000018a8 t .L162
+00002548 t .L239
+000024d0 t .L241
+00002510 t .L242
+00002448 t .L243
+00002520 t .L244
+000025d5 t .L263
+000025e0 t .L265
+00002738 t .L267
+00002720 t .L268
+00002710 t .L269
+000026f8 t .L270
+000026a0 t .L271
+00002688 t .L272
+00002670 t .L273
+000025a0 t .L274
+00002658 t .L275
+00002640 t .L276
+00002630 t .L277
+00002620 t .L278
+00002610 t .L279
+00002600 t .L280
 00000000 r .LC0
-00000000 r .LC1
-00000042 r .LC10
+00000027 r .LC10
 00000008 r .LC11
-00000046 r .LC12
-00000000 r .LC13
-00000049 r .LC14
-00000008 r .LC15
-0000004e r .LC16
-00000054 r .LC17
-00000010 r .LC18
-00000059 r .LC19
-00000006 r .LC2
-00000018 r .LC20
-0000005d r .LC21
-00000061 r .LC22
-00000065 r .LC23
-00000069 r .LC24
-0000006d r .LC25
-00000071 r .LC26
-0000000c r .LC27
-00000000 r .LC28
-00000010 r .LC29
-00000015 r .LC3
+0000002c r .LC12
+00000032 r .LC13
+00000010 r .LC14
+00000037 r .LC15
+00000018 r .LC16
+0000003b r .LC17
+0000003f r .LC18
+00000043 r .LC19
+00000047 r .LC20
+0000004b r .LC21
+0000004f r .LC22
+00000008 r .LC23
+00000010 r .LC24
+00000020 r .LC25
+00000030 r .LC26
+00000040 r .LC27
+00000050 r .LC28
+00000060 r .LC29
+00000000 r .LC3
 00000020 r .LC30
-00000030 r .LC31
-00000040 r .LC32
-00000020 r .LC34
-00000010 r .LC35
-00000028 r .LC36
-00000014 r .LC37
-00000077 r .LC38
+0000000c r .LC31
+00000010 r .LC32
+00000055 r .LC33
+00000064 r .LC34
+00000066 r .LC35
+00000070 r .LC36
+00000075 r .LC37
+0000007f r .LC38
+00000088 r .LC39
 00000004 r .LC4
-00000017 r .LC5
-00000021 r .LC6
-00000026 r .LC7
-00000030 r .LC8
-00000039 r .LC9
+00000000 r .LC5
+0000001a r .LC6
+00000020 r .LC7
+00000024 r .LC8
+00000000 r .LC9
          U log
-00000cb0 T Log_PFET6_INITLIB_32
+00002570 T Log_PFET6_INITLIB_32
          U malloc
          U __MallocTemp__
+00001bd0 T Newgate_Pfet6
          U _OutMem
-00000000 t Probe_Pfet6.isra.7
+00001760 T Pfetcheck
+00002170 T Probe_Pfet6
          U puts
+00001f10 T Readgate_Pfet6
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
@@ -3956,6 +4304,7 @@ ana/pfet6.o:
          U __top_jb
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
 
 ana/pspc1.o:
          U AnaCapattrinsert
@@ -3984,103 +4333,113 @@ ana/pspc1.o:
          U AnaSysCol
          U AnaSystem
          U AnaVdd
+00002150 T Attr_Pspc1
+000024d0 T Copygate_Pspc1
+00002540 T Dispose_Pspc1
          U drawnum3
          U _Escape
+000003f0 T Ex_PSPC1
          U free
-00000760 t GetCnf_Pspc1.constprop.7
+00001140 T GetCnf_Pspc1
          U _GLOBAL_OFFSET_TABLE_
-00001728 t .L116
-00001712 t .L118
-00001d88 t .L119
-00001c88 t .L120
-00001d68 t .L121
-00001c30 t .L122
-000019e0 t .L123
-000019c0 t .L124
-00001708 t .L125
-000019a8 t .L126
-00001960 t .L127
-00001948 t .L128
-00001930 t .L129
-00001878 t .L130
-00001850 t .L131
-00001838 t .L132
-000011a8 t .L133
-00001750 t .L134
-000024e0 t .L159
-000021be t .L161
-00002238 t .L162
-000022b9 t .L163
-00002354 t .L164
-000023a7 t .L165
-00002440 t .L166
-000016f8 t .L252
-00000738 t .L26
-00000620 t .L28
-000006b0 t .L29
-000006d0 t .L30
-00000710 t .L31
+00000d70 T Iin_PSPC1
+00001b60 T initlib_PSPC1
+00001d80 t .L180
+00001cd0 t .L182
+00002020 t .L183
+00001f50 t .L184
+00001ef0 t .L185
+00001e58 t .L186
+00001dd0 t .L187
+00002c78 t .L270
+00002b68 t .L272
+00002bf8 t .L273
+00002c10 t .L274
+00002c50 t .L275
+00002d05 t .L293
+00002d30 t .L295
+00002d20 t .L297
+00002ec0 t .L298
+00002eb0 t .L299
+00002e98 t .L300
+00002e40 t .L301
+00002e30 t .L302
+00002e18 t .L303
+00002d10 t .L304
+00002e00 t .L305
+00002cd0 t .L306
+00002de8 t .L307
+00002dd0 t .L308
+00002db8 t .L309
+00002d88 t .L310
+00002d70 t .L311
+00002d60 t .L312
+00002d50 t .L313
 00000000 r .LC0
 00000000 r .LC1
 00000004 r .LC10
-00000000 r .LC11
-00000006 r .LC12
-00000015 r .LC13
-00000008 r .LC14
-00000017 r .LC15
-00000021 r .LC16
-00000026 r .LC17
-00000030 r .LC18
-00000039 r .LC19
-00000008 r .LC2
-00000042 r .LC20
-0000000c r .LC21
-00000049 r .LC22
-00000010 r .LC23
-0000004b r .LC24
-0000004d r .LC25
-00000048 r .LC26
-00000050 r .LC27
-00000050 r .LC28
-00000055 r .LC29
-00000010 r .LC3
-0000005b r .LC30
-00000058 r .LC31
-00000060 r .LC32
-00000060 r .LC33
-00000063 r .LC34
-00000067 r .LC35
-0000006b r .LC36
-0000006f r .LC37
-00000073 r .LC38
-00000077 r .LC39
-00000018 r .LC4
-00000014 r .LC40
-00000000 r .LC41
-00000010 r .LC42
+00000008 r .LC11
+00000090 r .LC13
+0000000c r .LC14
+00000000 r .LC15
+0000001a r .LC16
+00000020 r .LC17
+00000027 r .LC18
+00000010 r .LC19
+00000010 r .LC2
+00000029 r .LC20
+0000002b r .LC21
+00000000 r .LC22
+0000002e r .LC23
+00000008 r .LC24
+00000033 r .LC25
+00000039 r .LC26
+00000010 r .LC27
+0000003e r .LC28
+00000018 r .LC29
+00000020 r .LC3
+00000041 r .LC30
+00000045 r .LC31
+00000049 r .LC32
+0000004d r .LC33
+00000051 r .LC34
+00000055 r .LC35
+00000014 r .LC36
+000000a0 r .LC37
+000000b0 r .LC38
+000000c0 r .LC39
+00000030 r .LC4
+000000d0 r .LC40
+000000e0 r .LC41
+000000f0 r .LC42
 00000020 r .LC43
-00000030 r .LC44
-00000040 r .LC45
-00000068 r .LC47
-00000018 r .LC48
-00000070 r .LC49
-00000020 r .LC5
-0000001c r .LC50
-0000007d r .LC51
-00000028 r .LC6
-00000030 r .LC7
-00000038 r .LC8
-00000040 r .LC9
+00000018 r .LC44
+0000001c r .LC45
+0000005b r .LC46
+0000006a r .LC47
+0000006c r .LC48
+00000076 r .LC49
+00000040 r .LC5
+0000007b r .LC50
+00000085 r .LC51
+0000008e r .LC52
+00000050 r .LC6
+00000060 r .LC7
+00000070 r .LC8
+00000080 r .LC9
          U log1p
-00001170 T Log_PSPC1_INITLIB_32
+00002ca0 T Log_PSPC1_INITLIB_32
          U malloc
          U __MallocTemp__
          U m_color
+000021e0 T Newgate_Pspc1
          U _OutMem
-00000350 t Probe_Pspc1.isra.6
+00001c90 T Pfetcheck
+00002880 T Probe_Pspc1
          U puts
+00002580 T Readgate_Pspc1
          U _setjmp
-00000000 t Show_W_L
+00000000 T Show_W_L
          U sprintf
          U __stack_chk_fail_local
          U strtod
@@ -4115,106 +4474,116 @@ ana/nspc1.o:
          U AnaSysCol
          U AnaSystem
          U AnaVdd
-000012e0 T drawnum3
+000023c0 T Attr_Nspc1
+00002740 T Copygate_Nspc1
+000027b0 T Dispose_Nspc1
+00000560 T drawnum3
          U _Escape
+00000660 T Ex_NSPC1
          U free
-00000410 t GetCnf_Nspc1.constprop.7
+00001380 T GetCnf_Nspc1
          U _GLOBAL_OFFSET_TABLE_
-000003e8 t .L10
-000002d8 t .L12
-00000368 t .L13
-00001d60 t .L130
-00001d48 t .L132
-00001d30 t .L133
-00001c58 t .L134
-00001c38 t .L135
-00001be0 t .L136
-00001990 t .L137
-00001980 t .L138
-00001968 t .L139
-00000380 t .L14
-00001ef0 t .L140
-00001ea8 t .L141
-00001e90 t .L142
-00001e78 t .L143
-00001f08 t .L144
-00001950 t .L145
-00001fc0 t .L146
-00001418 t .L147
-00001d88 t .L148
-000003c0 t .L15
-00002700 t .L173
-000023e6 t .L175
-00002458 t .L176
-000024d9 t .L177
-00002574 t .L178
-000025c7 t .L179
-00002668 t .L180
-00001945 t .L266
+00000fb0 T Iin_NSPC1
+00001da0 T initlib_NSPC1
+00001fd0 t .L194
+00001f20 t .L196
+00002290 t .L197
+000021c0 t .L198
+00002158 t .L199
+000020b0 t .L200
+00002020 t .L201
+00002ee8 t .L284
+00002dd8 t .L286
+00002e68 t .L287
+00002e80 t .L288
+00002ec0 t .L289
+00002f75 t .L307
+00003090 t .L309
+00003078 t .L311
+00003060 t .L312
+00003050 t .L313
+00003038 t .L314
+00002fe0 t .L315
+00002fc8 t .L316
+00002fb0 t .L317
+00002f98 t .L318
+00003140 t .L319
+00002f40 t .L320
+00003128 t .L321
+00003110 t .L322
+000030f8 t .L323
+00002f80 t .L324
+000030e0 t .L325
+000030d0 t .L326
+000030b8 t .L327
 00000000 r .LC0
 00000000 r .LC1
-00000042 r .LC10
+00000004 r .LC10
 00000008 r .LC11
-00000049 r .LC12
-0000000c r .LC13
-0000004b r .LC14
-0000004d r .LC15
-00000000 r .LC16
-00000050 r .LC17
-00000008 r .LC18
-00000055 r .LC19
-00000006 r .LC2
-0000005b r .LC20
-00000010 r .LC21
-00000060 r .LC22
-00000063 r .LC23
-00000018 r .LC24
-00000067 r .LC25
-0000006b r .LC26
-0000006f r .LC27
-00000073 r .LC28
-00000077 r .LC29
-00000015 r .LC3
-00000010 r .LC30
-00000014 r .LC31
-00000020 r .LC32
-00000028 r .LC33
-00000030 r .LC34
-00000038 r .LC35
-00000040 r .LC36
-00000048 r .LC37
-00000050 r .LC38
-00000058 r .LC39
-00000004 r .LC4
-00000060 r .LC40
-00000000 r .LC41
-00000010 r .LC42
-00000020 r .LC43
-00000030 r .LC44
-00000040 r .LC45
-00000050 r .LC46
-00000068 r .LC48
-00000018 r .LC49
-00000017 r .LC5
-00000070 r .LC50
-0000001c r .LC51
-0000007d r .LC52
-00000021 r .LC6
-00000026 r .LC7
-00000030 r .LC8
-00000039 r .LC9
+00000090 r .LC13
+0000000c r .LC14
+00000000 r .LC15
+0000001a r .LC16
+00000020 r .LC17
+00000027 r .LC18
+00000010 r .LC19
+00000010 r .LC2
+00000029 r .LC20
+0000002b r .LC21
+00000000 r .LC22
+0000002e r .LC23
+00000008 r .LC24
+00000033 r .LC25
+00000039 r .LC26
+00000010 r .LC27
+0000003e r .LC28
+00000041 r .LC29
+00000020 r .LC3
+00000018 r .LC30
+00000045 r .LC31
+00000049 r .LC32
+0000004d r .LC33
+00000051 r .LC34
+00000055 r .LC35
+00000014 r .LC36
+000000a0 r .LC37
+000000b0 r .LC38
+000000c0 r .LC39
+00000030 r .LC4
+000000d0 r .LC40
+000000e0 r .LC41
+000000f0 r .LC42
+00000100 r .LC43
+00000020 r .LC44
+00000018 r .LC45
+0000001c r .LC46
+0000005b r .LC47
+0000006a r .LC48
+0000006c r .LC49
+00000040 r .LC5
+00000076 r .LC50
+0000007b r .LC51
+00000085 r .LC52
+0000008e r .LC53
+00000050 r .LC6
+00000060 r .LC7
+00000070 r .LC8
+00000080 r .LC9
          U log1p
-000013e0 T Log_NSPC1_INITLIB_32
+00002f10 T Log_NSPC1_INITLIB_32
          U malloc
          U __MallocTemp__
          U m_color
          U m_displaytext
          U m_move
+00002450 T Newgate_Nspc1
+00001ee0 T Nfetcheck
          U _OutMem
-00000000 t Probe_Nspc1.isra.6
+00002af0 T Probe_Nspc1
          U puts
+000027f0 T Readgate_Nspc1
          U _setjmp
-00000e20 t Show_W_L
+00000000 T Show_W_L
          U sprintf
          U __stack_chk_fail_local
          U strtod
@@ -4251,84 +4620,95 @@ ana/nfet7t.o:
          U AnaSqrt
          U AnaSysCol
          U AnaSystem
+00001dc0 T Attr_Nfet7T
+00001fc0 T Copygate_Nfet7T
+00002030 T Dispose_Nfet7T
          U _Escape
+00000440 T Ex_NFET7T
          U free
-00000660 t GetCnf_Nfet7T.constprop.9
+000014f0 T GetCnf_Nfet7T
          U _GLOBAL_OFFSET_TABLE_
-000019a3 t .L109
-00001afa t .L111
-00001a45 t .L112
-00001a70 t .L113
-00001a9e t .L114
-00001acc t .L115
-000019e8 t .L116
-00001a20 t .L117
-0000118e t .L70
-000011a0 t .L72
-00001700 t .L74
-000016e8 t .L75
-00001590 t .L76
-00001570 t .L77
-00001870 t .L78
-00001718 t .L79
-000018c8 t .L80
-00001540 t .L81
-00001328 t .L82
-00001310 t .L83
-00001340 t .L84
-00001288 t .L85
-00000bb8 t .L86
-000011c0 t .L87
+00001030 T Iin_NFET7T
+00001a20 T initlib_NFET7T
+00001b70 t .L127
+00001bf0 t .L129
+00001d50 t .L130
+00001d18 t .L131
+00001ce0 t .L132
+00001ca0 t .L133
+00001c68 t .L134
+00001c30 t .L135
+00002674 t .L230
+00002680 t .L232
+00002858 t .L234
+00002840 t .L235
+00002830 t .L236
+00002818 t .L237
+000027c0 t .L238
+000027a8 t .L239
+00002790 t .L240
+00002650 t .L241
+00002778 t .L242
+00002760 t .L243
+00002750 t .L244
+000026c0 t .L245
+000026b0 t .L246
+000026a0 t .L247
 00000000 r .LC0
 00000004 r .LC1
-00000016 r .LC10
-00000018 r .LC11
-00000022 r .LC12
-00000027 r .LC13
-00000030 r .LC14
-00000039 r .LC15
-00000018 r .LC16
-00000040 r .LC17
-0000001c r .LC18
-00000047 r .LC19
+00000021 r .LC10
+00000010 r .LC11
+00000028 r .LC12
+00000014 r .LC13
+0000002f r .LC14
+00000008 r .LC15
+00000035 r .LC16
+0000003b r .LC17
+00000044 r .LC18
+0000004d r .LC19
 00000000 r .LC2
 00000010 r .LC20
-0000004d r .LC21
-00000053 r .LC22
-0000005c r .LC23
-00000065 r .LC24
-00000000 r .LC26
-00000010 r .LC27
-00000020 r .LC28
-00000018 r .LC29
-00000008 r .LC3
-00000020 r .LC30
-00000028 r .LC31
-00000020 r .LC32
-00000024 r .LC33
-0000006f r .LC34
+00000020 r .LC21
+00000030 r .LC22
+00000040 r .LC23
+00000050 r .LC24
+00000060 r .LC25
+00000070 r .LC26
+00000018 r .LC27
+0000001c r .LC28
+00000020 r .LC29
+00000000 r .LC3
+00000057 r .LC30
+00000066 r .LC31
+00000068 r .LC32
+00000072 r .LC33
+00000077 r .LC34
+00000080 r .LC35
 00000008 r .LC4
 0000000c r .LC5
-00000010 r .LC6
-00000014 r .LC7
 00000000 r .LC8
-00000007 r .LC9
+0000001a r .LC9
          U log
-00000b80 T Log_NFET7T_INITLIB_32
+00002620 T Log_NFET7T_INITLIB_32
          U malloc
          U __MallocTemp__
-00000000 t Nfetconsts.isra.1
+00001e40 T Newgate_Nfet7T
+00001b40 T Nfetcheck
+00000000 T Nfetconsts
          U _OutMem
-000002d0 t Probe_Nfet7T.isra.8
+000021e0 T Probe_Nfet7T
          U puts
+00002070 T Readgate_Nfet7T
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
          U strtod
          U tanh
          U __top_jb
+00002580 T Update_Nfet7T
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
 
 ana/nfet7f.o:
          U AnaCapattrinsert
@@ -4359,92 +4739,105 @@ ana/nfet7f.o:
          U AnaSqrt
          U AnaSysCol
          U AnaSystem
+000020e0 T Attr_Nfet7F
+00002300 T Copygate_Nfet7F
+00002370 T Dispose_Nfet7F
          U _Escape
+00000460 T Ex_NFET7F
          U free
-000006e0 t GetCnf_Nfet7F.constprop.9
+000016f0 T GetCnf_Nfet7F
          U _GLOBAL_OFFSET_TABLE_
-00001cd3 t .L118
-00001e3e t .L120
-00001e80 t .L121
-00001d20 t .L122
-00001d5e t .L123
-00001d89 t .L124
-00001db4 t .L125
-00001de2 t .L126
-00001e10 t .L127
-000006b8 t .L13
-00000640 t .L15
-00000680 t .L16
-000005b8 t .L17
-00000690 t .L18
-0000145d t .L78
-00001470 t .L80
-00001878 t .L82
-00001860 t .L83
-000016e8 t .L84
-000016c8 t .L85
-00001a10 t .L86
-00001890 t .L87
-000016b0 t .L88
-00001688 t .L89
-000015e0 t .L90
-000015c8 t .L91
-000015f8 t .L92
-00001560 t .L93
-00000cf8 t .L94
-00001490 t .L95
+00001220 T Iin_NFET7F
+00001ce0 T initlib_NFET7F
+00001e20 t .L136
+00002070 t .L138
+00002020 t .L139
+00001fe8 t .L140
+00001fb0 t .L141
+00001f70 t .L142
+00001f30 t .L143
+00001ef0 t .L144
+00001eb0 t .L145
+00002918 t .L226
+000028a0 t .L228
+000028e0 t .L229
+00002818 t .L230
+000028f0 t .L231
+00002a14 t .L252
+00002a20 t .L254
+00002bd8 t .L256
+00002bc0 t .L257
+00002bb0 t .L258
+00002b98 t .L259
+00002b40 t .L260
+00002b28 t .L261
+00002b10 t .L262
+000029f0 t .L263
+00002af8 t .L264
+00002ae0 t .L265
+00002ac8 t .L266
+00002a60 t .L267
+00002a50 t .L268
+00002a40 t .L269
 00000000 r .LC0
 00000004 r .LC1
-00000018 r .LC11
-00000022 r .LC12
-00000027 r .LC13
-00000031 r .LC14
-0000003a r .LC15
-00000043 r .LC16
-00000014 r .LC17
-0000004a r .LC18
-00000018 r .LC19
+00000021 r .LC10
+00000010 r .LC11
+00000028 r .LC12
+00000014 r .LC13
+0000002f r .LC14
+00000008 r .LC15
+00000035 r .LC16
+0000003b r .LC17
+00000010 r .LC18
+00000041 r .LC19
 00000000 r .LC2
-00000051 r .LC20
-00000010 r .LC21
-00000057 r .LC22
-0000005d r .LC23
-00000063 r .LC24
-0000006c r .LC25
-00000075 r .LC26
-00000000 r .LC28
-00000010 r .LC29
-00000008 r .LC3
-00000020 r .LC30
-00000030 r .LC31
-00000018 r .LC32
-00000020 r .LC33
-00000028 r .LC34
-0000001c r .LC35
-00000020 r .LC36
-0000007f r .LC37
+0000004a r .LC20
+00000053 r .LC21
+00000010 r .LC22
+00000020 r .LC23
+00000030 r .LC24
+00000040 r .LC25
+00000050 r .LC26
+00000060 r .LC27
+00000070 r .LC28
+00000080 r .LC29
+00000000 r .LC3
+00000018 r .LC30
+0000001c r .LC31
+00000020 r .LC32
+0000005d r .LC33
+0000006c r .LC34
+0000006e r .LC35
+00000078 r .LC36
+0000007d r .LC37
+00000087 r .LC38
+00000090 r .LC39
 00000008 r .LC4
 0000000c r .LC5
-00000010 r .LC6
-00000000 r .LC7
-00000007 r .LC8
-00000016 r .LC9
+00000000 r .LC8
+0000001a r .LC9
          U log
-00000cc0 T Log_NFET7F_INITLIB_32
+000029c0 T Log_NFET7F_INITLIB_32
          U malloc
          U __MallocTemp__
-00000000 t Nfetconsts.isra.1
+00002160 T Newgate_Nfet7F
+00001df0 T Nfetcheck
+00000000 T Nfetconsts
          U _OutMem
-000002f0 t Probe_Nfet7F.isra.8
+00002540 T Probe_Nfet7F
          U puts
+000023b0 T Readgate_Nfet7F
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
          U strtod
          U tanh
          U __top_jb
+00002940 T Update_Nfet7F
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
 
 ana/pfet7t.o:
          U AnaCapattrinsert
@@ -4476,84 +4869,95 @@ ana/pfet7t.o:
          U AnaSysCol
          U AnaSystem
          U AnaVdd
+00001e00 T Attr_Pfet7T
+00002000 T Copygate_Pfet7T
+00002070 T Dispose_Pfet7T
          U _Escape
+00000440 T Ex_PFET7T
          U free
-00000660 t GetCnf_Pfet7T.constprop.9
+00001530 T GetCnf_Pfet7T
          U _GLOBAL_OFFSET_TABLE_
-000019f3 t .L109
-00001b4a t .L111
-00001a95 t .L112
-00001ac0 t .L113
-00001aee t .L114
-00001b1c t .L115
-00001a38 t .L116
-00001a70 t .L117
-000011c8 t .L70
-000011d8 t .L72
-00001750 t .L74
-00001738 t .L75
-000015e0 t .L76
-000015c0 t .L77
-000018c0 t .L78
-00001768 t .L79
-00001918 t .L80
-00001598 t .L81
-00001368 t .L82
-00001350 t .L83
-00001380 t .L84
-000012c8 t .L85
-00000bb8 t .L86
-00001200 t .L87
+00001060 T Iin_PFET7T
+00001a60 T initlib_PFET7T
+00001bb0 t .L126
+00001c30 t .L128
+00001d90 t .L129
+00001d58 t .L130
+00001d20 t .L131
+00001ce0 t .L132
+00001ca8 t .L133
+00001c70 t .L134
+000026b4 t .L229
+000026c0 t .L231
+00002898 t .L233
+00002880 t .L234
+00002870 t .L235
+00002858 t .L236
+00002800 t .L237
+000027e8 t .L238
+000027d0 t .L239
+00002690 t .L240
+000027b8 t .L241
+000027a0 t .L242
+00002790 t .L243
+00002700 t .L244
+000026f0 t .L245
+000026e0 t .L246
 00000000 r .LC0
 00000004 r .LC1
-00000016 r .LC10
-00000018 r .LC11
-00000022 r .LC12
-00000027 r .LC13
-00000030 r .LC14
-00000039 r .LC15
-00000018 r .LC16
-00000040 r .LC17
-0000001c r .LC18
-00000047 r .LC19
+00000021 r .LC10
+00000010 r .LC11
+00000028 r .LC12
+00000014 r .LC13
+0000002f r .LC14
+00000008 r .LC15
+00000035 r .LC16
+0000003b r .LC17
+00000044 r .LC18
+0000004d r .LC19
 00000000 r .LC2
 00000010 r .LC20
-0000004d r .LC21
-00000053 r .LC22
-0000005c r .LC23
-00000065 r .LC24
-00000000 r .LC26
-00000010 r .LC27
-00000020 r .LC28
-00000018 r .LC29
-00000008 r .LC3
-00000020 r .LC30
-00000028 r .LC31
-00000020 r .LC32
-00000024 r .LC33
-0000006f r .LC34
+00000020 r .LC21
+00000030 r .LC22
+00000040 r .LC23
+00000050 r .LC24
+00000060 r .LC25
+00000070 r .LC26
+00000018 r .LC27
+0000001c r .LC28
+00000020 r .LC29
+00000000 r .LC3
+00000057 r .LC30
+00000066 r .LC31
+00000068 r .LC32
+00000072 r .LC33
+00000077 r .LC34
+00000080 r .LC35
 00000008 r .LC4
 0000000c r .LC5
-00000010 r .LC6
-00000014 r .LC7
 00000000 r .LC8
-00000007 r .LC9
+0000001a r .LC9
          U log
-00000b80 T Log_PFET7T_INITLIB_32
+00002660 T Log_PFET7T_INITLIB_32
          U malloc
          U __MallocTemp__
+00001e80 T Newgate_Pfet7T
          U _OutMem
-00000000 t Pfetconsts.isra.1
-000002d0 t Probe_Pfet7T.isra.8
+00001b80 T Pfetcheck
+00000000 T Pfetconsts
+00002220 T Probe_Pfet7T
          U puts
+000020b0 T Readgate_Pfet7T
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
          U strtod
          U tanh
          U __top_jb
+000025c0 T Update_Pfet7T
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
 
 ana/pfet7f.o:
          U AnaCapattrinsert
@@ -4584,92 +4988,105 @@ ana/pfet7f.o:
          U AnaSqrt
          U AnaSysCol
          U AnaSystem
+000020f0 T Attr_Pfet7F
+00002310 T Copygate_Pfet7F
+00002380 T Dispose_Pfet7F
          U _Escape
+00000470 T Ex_PFET7F
          U free
-000006e0 t GetCnf_Pfet7F.constprop.9
+00001700 T GetCnf_Pfet7F
          U _GLOBAL_OFFSET_TABLE_
-00001d09 t .L118
-00001e76 t .L120
-00001eb8 t .L121
-00001d58 t .L122
-00001d96 t .L123
-00001dc1 t .L124
-00001dec t .L125
-00001e1a t .L126
-00001e48 t .L127
-000006b8 t .L13
-00000640 t .L15
-00000680 t .L16
-000005b0 t .L17
-00000690 t .L18
-00001494 t .L78
-000014a0 t .L80
-000018a8 t .L82
-00001890 t .L83
-00001718 t .L84
-000016f8 t .L85
-00001a40 t .L86
-000018c0 t .L87
-000016e0 t .L88
-000016b8 t .L89
-00001610 t .L90
-000015f8 t .L91
-00001628 t .L92
-00001590 t .L93
-00000cf8 t .L94
-000014c0 t .L95
+00001230 T Iin_PFET7F
+00001cf0 T initlib_PFET7F
+00001e30 t .L135
+00002080 t .L137
+00002030 t .L138
+00001ff8 t .L139
+00001fc0 t .L140
+00001f80 t .L141
+00001f40 t .L142
+00001f00 t .L143
+00001ec0 t .L144
+00002928 t .L225
+000028b0 t .L227
+000028f0 t .L228
+00002828 t .L229
+00002900 t .L230
+00002a24 t .L251
+00002a30 t .L253
+00002be8 t .L255
+00002bd0 t .L256
+00002bc0 t .L257
+00002ba8 t .L258
+00002b50 t .L259
+00002b38 t .L260
+00002b20 t .L261
+00002a00 t .L262
+00002b08 t .L263
+00002af0 t .L264
+00002ad8 t .L265
+00002a70 t .L266
+00002a60 t .L267
+00002a50 t .L268
 00000000 r .LC0
 00000004 r .LC1
-00000018 r .LC11
-00000022 r .LC12
-00000027 r .LC13
-00000031 r .LC14
-0000003a r .LC15
-00000043 r .LC16
-00000014 r .LC17
-0000004a r .LC18
-00000018 r .LC19
+00000021 r .LC10
+00000010 r .LC11
+00000028 r .LC12
+00000014 r .LC13
+0000002f r .LC14
+00000008 r .LC15
+00000035 r .LC16
+0000003b r .LC17
+00000010 r .LC18
+00000041 r .LC19
 00000000 r .LC2
-00000051 r .LC20
-00000010 r .LC21
-00000057 r .LC22
-0000005d r .LC23
-00000063 r .LC24
-0000006c r .LC25
-00000075 r .LC26
-00000000 r .LC28
-00000010 r .LC29
-00000008 r .LC3
-00000020 r .LC30
-00000030 r .LC31
-00000018 r .LC32
-00000020 r .LC33
-00000028 r .LC34
-0000001c r .LC35
-00000020 r .LC36
-0000007f r .LC37
+0000004a r .LC20
+00000053 r .LC21
+00000010 r .LC22
+00000020 r .LC23
+00000030 r .LC24
+00000040 r .LC25
+00000050 r .LC26
+00000060 r .LC27
+00000070 r .LC28
+00000080 r .LC29
+00000000 r .LC3
+00000018 r .LC30
+0000001c r .LC31
+00000020 r .LC32
+0000005d r .LC33
+0000006c r .LC34
+0000006e r .LC35
+00000078 r .LC36
+0000007d r .LC37
+00000087 r .LC38
+00000090 r .LC39
 00000008 r .LC4
 0000000c r .LC5
-00000010 r .LC6
-00000000 r .LC7
-00000007 r .LC8
-00000016 r .LC9
+00000000 r .LC8
+0000001a r .LC9
          U log
-00000cc0 T Log_PFET7F_INITLIB_32
+000029d0 T Log_PFET7F_INITLIB_32
          U malloc
          U __MallocTemp__
+00002170 T Newgate_Pfet7F
          U _OutMem
-00000000 t Pfetconsts.isra.1
-000002f0 t Probe_Pfet7F.isra.8
+00001e00 T Pfetcheck
+00000000 T Pfetconsts
+00002550 T Probe_Pfet7F
          U puts
+000023c0 T Readgate_Pfet7F
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
          U strtod
          U tanh
          U __top_jb
+00002950 T Update_Pfet7F
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
 
 ana/thermal.o:
          U AnaChangedP
@@ -4679,46 +5096,55 @@ ana/thermal.o:
          U AnaOldmodel
          U AnaParamUpdate
          U AnaPhysical
+000004e0 T Attr_Thermal
+00000a20 T Copygate_Thermal
+00000a80 T Dispose_Thermal
+00000430 T Erase_Thermal
          U free
-000001b0 t GetCnf_Thermal.isra.3.constprop.10
+00000000 T GetCnf_Thermal
          U _GLOBAL_OFFSET_TABLE_
-000003d8 t .L27
-00000400 t .L29
-000006f0 t .L31
-00000690 t .L32
-00000620 t .L33
-00000520 t .L34
-000004a8 t .L35
-00000498 t .L36
-00000390 t .L37
-00000420 t .L38
+000001b0 T initlib_Thermal
+00000b55 t .L85
+00000b60 t .L87
+00000c80 t .L89
+00000c10 t .L90
+00000bc0 t .L91
+00000bb0 t .L92
+00000ba0 t .L93
+00000b90 t .L94
+00000b80 t .L95
+00000ae0 t .L96
 00000000 r .LC0
-00000002 r .LC1
+00000008 r .LC1
 00000008 r .LC10
 0000000c r .LC12
-00000008 r .LC13
-00000010 r .LC14
-00000000 r .LC2
-00000004 r .LC3
-00000000 r .LC4
-00000004 r .LC5
-00000006 r .LC6
-0000000e r .LC7
-00000014 r .LC8
-0000001c r .LC9
-00000350 T Log_THERMAL_initlib_32
+00000010 r .LC13
+00000020 r .LC14
+0000000e r .LC2
+00000016 r .LC3
+00000021 r .LC4
+00000023 r .LC5
+00000000 r .LC6
+00000025 r .LC7
+00000000 r .LC8
+00000004 r .LC9
+00000ab0 T Log_THERMAL_initlib_32
          U malloc
          U __MallocTemp__
          U m_centerstr
          U m_color
+00000850 T Newgate_Thermal
+00000770 T Openconfig_Thermal
          U _OutMem
-00000000 t Refresh_Thermal.isra.9
+000007f0 T Readgate_Thermal
+00000250 T Refresh_Thermal
          U _setjmp
          U __stack_chk_fail_local
          U strcpy
          U __top_jb
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
 
 ana/tc.o:
 00000000 b AmpRange
@@ -4749,170 +5175,172 @@ ana/tc.o:
          U AnaSystem
          U AnaTanch
          U AnaVdd
-00000ab0 t Attr_TCAmp
+000001f0 t Attr_TCAmp
          U _Escape
-00001e10 t Ex_Abs.isra.4
-00000ec0 t Ex_TCAmp.isra.3
+00004a00 T Ex_Abs
+00002200 T Ex_TCAmp
          U free
-000035b0 t GetCnf_TCAmp.constprop.15
+00001500 t GetCnf_TCAmp.constprop.13
          U _GLOBAL_OFFSET_TABLE_
-00000110 t Iin_TCAmp
-00004150 t INITLIB_TCAMP.isra.1
-00000df0 t .L114
-000042ed t .L418
-000042f8 t .L420
-00004538 t .L422
-00004520 t .L423
-00004550 t .L424
-000042d8 t .L425
-000044d0 t .L426
-000044b8 t .L427
-00004498 t .L428
-00004480 t .L429
-00004430 t .L430
-00004420 t .L431
-00004408 t .L432
-000043f0 t .L433
-000043e0 t .L434
-00004390 t .L435
-00004350 t .L436
-00004340 t .L437
-00004330 t .L438
-00004320 t .L439
-000045bd t .L447
-000045c8 t .L449
-00004808 t .L451
-000047f0 t .L452
-00004820 t .L453
-000045a8 t .L454
-000047a0 t .L455
-00004788 t .L456
-00004768 t .L457
-00004750 t .L458
-00004700 t .L459
-000046f0 t .L460
-000046d8 t .L461
-000046c0 t .L462
-000046b0 t .L463
-00004660 t .L464
-00004620 t .L465
-00004610 t .L466
-00004600 t .L467
-000045f0 t .L468
-00004929 t .L476
-00004938 t .L478
-00004ba8 t .L480
-00004b90 t .L481
-00004bc0 t .L482
-00004b70 t .L483
-00004b18 t .L484
-00004b00 t .L485
-00004ae0 t .L486
-00004ac8 t .L487
-00004a60 t .L488
-00004a48 t .L489
-00004ab0 t .L490
-00004a30 t .L491
-00004880 t .L492
-000049e0 t .L493
-000049a8 t .L494
-00004990 t .L495
-00004978 t .L496
-00004960 t .L497
-00005259 t .L548
-00005268 t .L550
-000054d8 t .L552
-000054c0 t .L553
-000054f0 t .L554
-000054a0 t .L555
-00005448 t .L556
-00005430 t .L557
-00005410 t .L558
-000053f8 t .L559
-00005390 t .L560
-00005378 t .L561
-000053e0 t .L562
-00005360 t .L563
-000051b0 t .L564
-00005310 t .L565
-000052d8 t .L566
-000052c0 t .L567
-000052a8 t .L568
-00005290 t .L569
-00000d48 t .L81
-00000d00 t .L83
-00000cb0 t .L84
-00000c08 t .L85
-00000e30 t .L86
-00000e00 t .L87
-00000be8 t .L88
-00000b40 t .L89
+00005dd0 T Iin_Abs
+00003de0 T Iin_TCAmp
+000020a0 t INITLIB_TCAMP.isra.2
+000004d0 t .L32
+00000488 t .L34
+00000430 t .L35
+00000348 t .L36
+00000610 t .L37
+000005e0 t .L38
+00000328 t .L39
+00000280 t .L40
+0000670b t .L470
+00006718 t .L472
+00006948 t .L474
+00006930 t .L475
+00006960 t .L476
+000066f8 t .L477
+000068e0 t .L478
+000068d0 t .L479
+000068b0 t .L480
+00006898 t .L481
+00006840 t .L482
+00006830 t .L483
+00006818 t .L484
+00006800 t .L485
+000067f0 t .L486
+000067a8 t .L487
+00006770 t .L488
+00006760 t .L489
+00006750 t .L490
+00006740 t .L491
+000069cb t .L499
+000069d8 t .L501
+00006c08 t .L503
+00006bf0 t .L504
+00006c20 t .L505
+000069b8 t .L506
+00006ba0 t .L507
+00006b90 t .L508
+00006b70 t .L509
+00006b58 t .L510
+00006b00 t .L511
+00006af0 t .L512
+00006ad8 t .L513
+00006ac0 t .L514
+00006ab0 t .L515
+00006a68 t .L516
+00006a30 t .L517
+00006a20 t .L518
+00006a10 t .L519
+00006a00 t .L520
+00006c8b t .L528
+00006c98 t .L530
+00006ec8 t .L532
+00006eb0 t .L533
+00006ee0 t .L534
+00006c78 t .L535
+00006e60 t .L536
+00006e50 t .L537
+00006e30 t .L538
+00006e18 t .L539
+00006dc0 t .L540
+00006db0 t .L541
+00006d98 t .L542
+00006d80 t .L543
+00006d70 t .L544
+00006d28 t .L545
+00006cf0 t .L546
+00006ce0 t .L547
+00006cd0 t .L548
+00006cc0 t .L549
+00006f4b t .L557
+00006f58 t .L559
+00007188 t .L561
+00007170 t .L562
+000071a0 t .L563
+00006f38 t .L564
+00007120 t .L565
+00007110 t .L566
+000070f0 t .L567
+000070d8 t .L568
+00007080 t .L569
+00007070 t .L570
+00007058 t .L571
+00007040 t .L572
+00007030 t .L573
+00006fe8 t .L574
+00006fb0 t .L575
+00006fa0 t .L576
+00006f90 t .L577
+00006f80 t .L578
+000005d0 t .L65
 00000000 r .LC0
-0000003e r .LC10
-00000052 r .LC11
-00000014 r .LC12
-00000066 r .LC13
-00000073 r .LC14
-00000075 r .LC15
-0000008e r .LC16
-000000a4 r .LC17
-000000ae r .LC18
-000000ba r .LC19
-00000000 r .LC2
-000000c9 r .LC20
-000000d7 r .LC21
-000000e4 r .LC22
-000000ec r .LC23
-000000f2 r .LC24
-000000f8 r .LC25
-000000fc r .LC26
-00000100 r .LC27
-00000108 r .LC28
-0000010d r .LC29
-00000004 r .LC3
-00000112 r .LC30
-00000008 r .LC31
-00000119 r .LC32
-00000010 r .LC33
-0000011c r .LC34
-00000018 r .LC35
-0000011f r .LC36
+0000004c r .LC10
+00000059 r .LC11
+0000005b r .LC12
+00000074 r .LC13
+0000008a r .LC14
+00000094 r .LC15
+000000a0 r .LC16
+000000af r .LC17
+000000bd r .LC18
+000000ca r .LC19
+00000004 r .LC2
+000000d2 r .LC20
+000000d8 r .LC21
+000000de r .LC22
+000000e2 r .LC23
+000000e6 r .LC24
+000000ee r .LC25
+000000f3 r .LC26
+000000f8 r .LC27
+00000000 r .LC28
+000000ff r .LC29
+00000008 r .LC3
+00000008 r .LC30
+00000102 r .LC31
+00000010 r .LC32
+00000105 r .LC33
+00000014 r .LC34
+0000010b r .LC35
+00000111 r .LC36
 00000018 r .LC37
-00000125 r .LC38
-0000012b r .LC39
-00000000 r .LC4
-00000020 r .LC40
+00000119 r .LC38
+00000121 r .LC39
+0000000c r .LC4
+0000012a r .LC40
 00000133 r .LC41
-0000013b r .LC42
-00000144 r .LC43
-0000014d r .LC44
-00000157 r .LC45
-0000015f r .LC46
-00000000 r .LC47
-00000010 r .LC48
-00000020 r .LC49
-00000008 r .LC5
-00000030 r .LC50
-00000040 r .LC51
-0000000c r .LC6
-00000010 r .LC7
-0000001a r .LC8
-0000002f r .LC9
+0000013d r .LC42
+00000145 r .LC43
+00000000 r .LC44
+00000010 r .LC45
+00000020 r .LC46
+00000030 r .LC47
+00000040 r .LC48
+00000050 r .LC49
+00000000 r .LC5
+00000060 r .LC50
+00000018 r .LC51
+0000014d r .LC52
+00000015 r .LC6
+00000024 r .LC7
+00000038 r .LC8
+00000010 r .LC9
 00000000 t Limitfill
-00005170 T Log_fwr_initlib_32
-00004840 T Log_hwr_initlib_32
-000042a0 T Log_opamp_initlib_32
-00004570 T Log_wramp_initlib_32
+00006f00 T Log_fwr_initlib_32
+00006c40 T Log_hwr_initlib_32
+000066c0 T Log_opamp_initlib_32
+00006980 T Log_wramp_initlib_32
          U malloc
          U __MallocTemp__
          U m_color
          U m_fillrect
-00002930 t Newgate_TCAmp.isra.10
+00000720 t Newgate_TCAmp.isra.8
          U _OutMem
-000009d0 t PreUpdate_TCAmp.isra.0
-00002ef0 t Probe_TCAmp.isra.14
+00000110 t PreUpdate_TCAmp.isra.0
+00000db0 t Probe_TCAmp.isra.12
          U puts
-00002c30 t Readgate_TCAmp.isra.13
+00000a90 t Readgate_TCAmp.isra.11
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
@@ -4920,6 +5348,7 @@ ana/tc.o:
          U __top_jb
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.di
 
 ana/moscap.o:
          U AnaCapattrinsert
@@ -4947,72 +5376,82 @@ ana/moscap.o:
          U AnaSysCol
          U AnaSystem
          U AnaVdd
+00000ad0 T Attr_Moscap
+00000c50 T Copygate_Moscap
+00000cd0 T Dispose_Moscap
          U _Escape
+00000000 T Ex_Moscap
          U free
-00000200 t GetCnf_Moscap.constprop.8
+00000320 T GetCnf_Moscap
          U _GLOBAL_OFFSET_TABLE_
-00000766 t .L106
-00000770 t .L55
-00000ae0 t .L57
-00000ac8 t .L58
-00000a80 t .L59
-00000a60 t .L60
-000009f0 t .L61
-00000908 t .L62
-000008f0 t .L63
-000008c0 t .L64
-000008a8 t .L65
-00000890 t .L66
-00000840 t .L67
-00000828 t .L68
-00000790 t .L69
-000006a0 t .L70
-00000ca6 t .L81
-00000cf8 t .L83
-00000dce t .L84
-00000d4d t .L85
-00000d8a t .L86
-00000dbd t .L87
-00000e2a t .L96
-00000000 r .LC0
-0000000a r .LC1
-0000005b r .LC10
-00000065 r .LC11
-0000006c r .LC12
+00000210 T Iin_Moscap
+000007a0 T initlib_Moscap
+000010ad t .L121
+000010b8 t .L123
+000011e8 t .L125
+000011d0 t .L126
+000011c0 t .L127
+000011a8 t .L128
+00001048 t .L129
+00001198 t .L130
+00001180 t .L131
+00001150 t .L132
+00001138 t .L133
+00001120 t .L134
+00001110 t .L135
+00001100 t .L136
+000010f0 t .L137
+000010e0 t .L138
+000008f8 t .L58
+00000a40 t .L60
+000009e0 t .L61
+000009a0 t .L62
+00000978 t .L63
+00000960 t .L64
+00000aa0 t .L65
+00000000 r .LC1
+00000047 r .LC10
+0000004b r .LC11
+00000010 r .LC12
 00000000 r .LC13
-00000073 r .LC14
-0000007d r .LC15
-00000008 r .LC16
-00000081 r .LC17
-00000085 r .LC18
-00000010 r .LC19
-00000011 r .LC2
-00000000 r .LC20
-00000010 r .LC21
-00000004 r .LC22
-00000008 r .LC24
-0000000c r .LC25
-0000008b r .LC26
-00000000 r .LC3
-0000001b r .LC4
-00000028 r .LC5
-0000002a r .LC6
-00000032 r .LC7
+00000010 r .LC14
+00000000 r .LC16
+00000004 r .LC17
+00000051 r .LC18
+0000005b r .LC19
+0000001a r .LC2
+00000062 r .LC20
+00000008 r .LC21
+0000006c r .LC22
+00000079 r .LC23
+0000007b r .LC24
+00000083 r .LC25
+00000094 r .LC26
+00000021 r .LC3
+0000002b r .LC4
+00000032 r .LC5
+00000000 r .LC6
+00000039 r .LC7
 00000043 r .LC8
-00000054 r .LC9
-00000670 T Log_moscap_initlib_32
+00000008 r .LC9
+00001020 T Log_moscap_initlib_32
          U malloc
          U __MallocTemp__
+000008c0 T Moscapcheck
+00000b30 T Newgate_Moscap
          U _OutMem
-00000000 t Probe_MosCap.isra.7
+00000e20 T Probe_MosCap
          U puts
+00000d10 T Readgate_Moscap
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
          U strtod
          U __top_jb
+00000000 T __x86.get_pc_thunk.bp
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
 
 ana/ganglion.o:
          U AnaCapattrinsert
@@ -5041,95 +5480,112 @@ ana/ganglion.o:
          U AnaSysCol
          U AnaSystem
          U AnaVdd
+00001070 T Attr_Ganglion
+000013a0 T Copygate_Ganglion
+000017b0 T Display_Ganglion
+00001410 T Dispose_Ganglion
+00001830 T Erase_Ganglion
          U _Escape
+00001850 T Ex_Ganglion
          U free
-00000340 t GetCnf_Ganglion.constprop.14
+00000be0 T Ganglioncheck
+00000110 T GetCnf_Ganglion
          U _GLOBAL_OFFSET_TABLE_
-00001280 t .L100
-00001238 t .L101
-000012c8 t .L102
-00001220 t .L103
-00001198 t .L104
-00001150 t .L105
-00001120 t .L106
-000010f0 t .L107
-00000ce8 t .L108
-00000ff0 t .L109
-00001aad t .L124
-00001b20 t .L126
-00001bd6 t .L127
-00001c23 t .L128
-00001cd6 t .L129
-00001d2e t .L130
-00001cf9 t .L131
-00000fc3 t .L185
-00001bcc t .L188
-00000fd0 t .L90
-000015a0 t .L92
-00001588 t .L93
-000015b8 t .L94
-00001568 t .L95
-00001510 t .L96
-00001310 t .L97
-000012f8 t .L98
-000012e0 t .L99
+00002020 T Iin_Ganglion
+00000a90 T INITLIB_GANGLION
+00000fb8 t .L112
+00002635 t .L231
+00002640 t .L233
+00002888 t .L235
+00002870 t .L236
+000028a0 t .L237
+00002858 t .L238
+00002800 t .L239
+000027f0 t .L240
+000027e0 t .L241
+000027c0 t .L242
+00002760 t .L243
+00002600 t .L244
+00002748 t .L245
+00002730 t .L246
+00002720 t .L247
+000026e0 t .L248
+000026b0 t .L249
+00002680 t .L250
+00002670 t .L251
+00002660 t .L252
+00000c20 t .L84
+00000ec0 t .L86
+00000e60 t .L87
+00000d80 t .L88
+00000ce0 t .L89
+00000ca0 t .L90
+00000c68 t .L91
 00000000 r .LC0
-00000000 r .LC1
-00000052 r .LC10
-00000008 r .LC11
-0000005d r .LC12
-00000010 r .LC13
-00000067 r .LC14
-00000008 r .LC15
-0000006e r .LC16
-00000018 r .LC17
-00000077 r .LC18
-0000000c r .LC19
-00000009 r .LC2
-00000081 r .LC20
-00000020 r .LC21
-00000084 r .LC22
-00000028 r .LC23
-00000087 r .LC24
-0000008d r .LC25
+00000009 r .LC1
+00000018 r .LC10
+00000038 r .LC11
+00000004 r .LC12
+00000042 r .LC13
+00000020 r .LC14
+00000045 r .LC15
+00000028 r .LC16
+00000048 r .LC17
+0000004e r .LC18
+00000030 r .LC19
+00000000 r .LC2
+00000054 r .LC20
+0000005a r .LC21
+00000061 r .LC22
+00000000 r .LC23
+00000010 r .LC24
+00000020 r .LC25
 00000030 r .LC26
-00000093 r .LC27
-00000099 r .LC28
-000000a0 r .LC29
-00000018 r .LC3
-00000000 r .LC31
-00000010 r .LC32
-00000020 r .LC33
-00000030 r .LC34
-00000040 r .LC35
-00000050 r .LC36
-00000010 r .LC37
-00000038 r .LC38
-00000014 r .LC39
-0000001a r .LC4
-00000018 r .LC40
-000000a8 r .LC41
-00000004 r .LC5
-00000034 r .LC6
-0000003f r .LC7
-00000048 r .LC8
-00000000 r .LC9
-00000000 t Limitfill
-00000cb0 T Log_ganglion_initlib_32
+00000040 r .LC27
+00000050 r .LC28
+00000060 r .LC29
+00000013 r .LC3
+00000038 r .LC31
+00000008 r .LC33
+0000000c r .LC34
+00000010 r .LC35
+00000069 r .LC36
+00000014 r .LC37
+00000083 r .LC38
+0000008c r .LC39
+00000008 r .LC4
+0000009b r .LC40
+0000009d r .LC41
+000000b7 r .LC42
+0000001e r .LC5
+00000010 r .LC6
+00000028 r .LC7
+00000000 r .LC8
+0000002f r .LC9
+00000000 T Limitfill
+000025d0 T Log_ganglion_initlib_32
          U malloc
          U __MallocTemp__
          U m_color
          U m_fillrect
+00001100 T Newgate_Ganglion
          U _OutMem
-00000110 t Probe_Ganglion.isra.13
+00001740 T PreUpdate_Ganglion
+00002380 T Probe_Ganglion
          U puts
+00001450 T Readgate_Ganglion
+00001810 T Refresh_Ganglion
+000016c0 T Reset_Ganglion
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
          U strtod
          U __top_jb
+00001770 T Update_Ganglion
+00000000 T __x86.get_pc_thunk.bp
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
 
 ana/hres.o:
          U AnaCapattrinsert
@@ -5159,100 +5615,117 @@ ana/hres.o:
          U AnaSystem
          U AnaTanch
          U AnaVdd
+00001200 T Attr_Hres
+00001580 T Copygate_Hres
+00001a10 T Display_Hres
+000015f0 T Dispose_Hres
+00001aa0 T Erase_Hres
          U _Escape
+00001ad0 T Ex_Hres
          U free
-00000580 t GetCnf_Hres.constprop.14
+00000110 T GetCnf_Hres
          U _GLOBAL_OFFSET_TABLE_
-000019f0 t .L130
-00001e90 t .L132
-00001e78 t .L133
-00001ea8 t .L134
-00001e58 t .L135
-00001e00 t .L136
-00001bc0 t .L137
-00001ba8 t .L138
-00001b80 t .L139
-00002010 t .L140
-00001fd0 t .L141
-00001fb8 t .L142
-00001fa0 t .L143
-000020a0 t .L144
-00002060 t .L145
-00001b48 t .L146
-00001b10 t .L147
-00001088 t .L148
-00001a10 t .L149
-00002802 t .L164
-00002888 t .L166
-000029fc t .L167
-000028d8 t .L168
-0000298b t .L169
-000028bc t .L170
-00002a82 t .L171
-00002a45 t .L172
-000019e4 t .L226
-00002afb t .L229
+00000d30 T Hrescheck
+00002dc0 T Iin_Hres
+00000bf0 T INITLIB_Hres
+00000e10 t .L100
+00001128 t .L121
+00003c35 t .L279
+00003c40 t .L281
+00003eb8 t .L283
+00003ea0 t .L284
+00003ed0 t .L285
+00003e88 t .L286
+00003e30 t .L287
+00003e20 t .L288
+00003e10 t .L289
+00003de8 t .L290
+00003d80 t .L291
+00003c00 t .L292
+00003d68 t .L293
+00003d50 t .L294
+00003d40 t .L295
+00003cf0 t .L296
+00003cb8 t .L297
+00003c80 t .L298
+00003c70 t .L299
+00003c60 t .L300
+00000d68 t .L92
+00001038 t .L94
+00000fe0 t .L95
+00000ef8 t .L96
+00000e90 t .L97
+00000e70 t .L98
+00000e50 t .L99
 00000000 r .LC0
-00000000 r .LC1
-0000008f r .LC10
-0000009a r .LC11
-000000a6 r .LC12
-000000b5 r .LC13
-000000ba r .LC14
-000000c2 r .LC16
-000000c7 r .LC17
-000000cc r .LC18
-00000000 r .LC19
-00000014 r .LC2
-000000d3 r .LC20
-00000008 r .LC21
-000000d6 r .LC22
-00000010 r .LC23
-000000d9 r .LC24
-00000008 r .LC25
-000000df r .LC26
-000000e5 r .LC27
-00000018 r .LC28
-000000ed r .LC29
-00000021 r .LC3
-000000f6 r .LC30
-000000ff r .LC31
-00000106 r .LC32
-0000010e r .LC33
-00000116 r .LC34
-00000000 r .LC35
-00000010 r .LC36
-00000020 r .LC37
-00000030 r .LC38
-00000040 r .LC39
-00000023 r .LC4
-00000020 r .LC40
-0000000c r .LC41
-00000010 r .LC42
-00000014 r .LC43
-00000018 r .LC44
-0000011f r .LC45
-0000003c r .LC5
-00000004 r .LC6
-00000053 r .LC7
-0000005d r .LC8
-00000077 r .LC9
-00000000 t Limitfill
-00001050 T Log_hres_initlib_32
+00000005 r .LC1
+00000021 r .LC10
+00000010 r .LC11
+00000024 r .LC12
+00000000 r .LC13
+0000002a r .LC14
+00000030 r .LC15
+00000018 r .LC16
+00000038 r .LC17
+00000041 r .LC18
+0000004a r .LC19
+00000051 r .LC20
+00000059 r .LC21
+00000061 r .LC22
+00000000 r .LC23
+00000010 r .LC24
+00000020 r .LC25
+00000030 r .LC26
+00000040 r .LC27
+00000050 r .LC28
+00000004 r .LC29
+0000000d r .LC3
+00000008 r .LC30
+0000000c r .LC31
+00000060 r .LC32
+00000010 r .LC33
+0000006a r .LC34
+00000084 r .LC35
+00000014 r .LC36
+00000098 r .LC37
+000000a5 r .LC38
+000000a7 r .LC39
+000000c0 r .LC40
+000000d7 r .LC41
+000000e1 r .LC42
+000000fb r .LC43
+00000113 r .LC44
+0000011e r .LC45
+0000012a r .LC46
+00000012 r .LC5
+00000017 r .LC6
+00000000 r .LC7
+0000001e r .LC8
+00000008 r .LC9
+00000000 T Limitfill
+00003bd0 T Log_hres_initlib_32
          U malloc
          U __MallocTemp__
          U m_color
          U m_fillrect
+00001290 T Newgate_Hres
          U _OutMem
-00000110 t Probe_Hres.isra.13
+00001960 T PreUpdate_Hres
+00003710 T Probe_Hres
          U puts
+00001630 T Readgate_Hres
+00001a70 T Refresh_Hres
+000018e0 T Reset_Hres
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
          U strtod
          U __top_jb
+000019c0 T Update_Hres
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.di
+00000000 T __x86.get_pc_thunk.dx
 
 ana/physical.o:
          U AnaChangedP
@@ -5264,25 +5737,31 @@ ana/physical.o:
          U AnaOldmodel
          U AnaParamUpdate
          U AnaPhysical
+00000160 T Attr_Physical
          U _GLOBAL_OFFSET_TABLE_
-000001c0 t .L10
-00000120 t .L11
-000002d0 t .L16
-00000318 t .L17
-00000370 t .L18
-000003c0 t .L19
-00000410 t .L20
-00000160 t .L21
-000002c2 t .L22
-0000015a t .L4
-000001f0 t .L6
-000001e0 t .L8
-000001ab t .L9
-000000f0 T Log_PHYSICAL_initlib_32
+00000000 T initlib_Physical
+00000260 t .L12
+00000198 t .L13
+000003a0 t .L14
+00000350 t .L15
+00000300 t .L16
+000002b0 t .L17
+00000250 t .L18
+00000739 t .L50
+00000740 t .L52
+00000770 t .L54
+00000760 t .L55
+00000750 t .L56
+00000700 t .L57
+00000257 t .L8
+000006d0 T Log_PHYSICAL_initlib_32
          U malloc
          U __MallocTemp__
+000005d0 T Newgate_Physical
+00000430 T Openconfig_Physical
          U _OutMem
-00000000 t Reload_Physical.isra.0
+00000540 T Readgate_Physical
+00000060 T Reload_Physical
 00000000 T __x86.get_pc_thunk.bx
 
 ana/npn1.o:
@@ -5311,85 +5790,102 @@ ana/npn1.o:
          U AnaScoreboard
          U AnaSysCol
          U AnaSystem
+00001a10 T Attr_NPN1
+00001d00 T Copygate_NPN1
+00002480 T Display_NPN1
+00001d70 T Dispose_NPN1
+00002500 T Erase_NPN1
          U _Escape
+00000110 T Ex_NPN1
          U free
-000004b0 t GetCnf_NPN1.constprop.14
+00000cf0 T GetCnf_NPN1
          U _GLOBAL_OFFSET_TABLE_
-000011b0 t .L100
-00001188 t .L101
-000015e8 t .L102
-000015a0 t .L103
-00001588 t .L104
-00001570 t .L105
-00001668 t .L106
-00001630 t .L107
-00001158 t .L108
-00001108 t .L109
-00000c48 t .L110
-00001030 t .L111
-00001cf0 t .L133
-00001abd t .L135
-00001b28 t .L136
-00001bc2 t .L137
-00001c60 t .L138
-00000ffa t .L90
-00001008 t .L92
-00001440 t .L94
-00001428 t .L95
-00001458 t .L96
-00001408 t .L97
-000013b0 t .L98
-000011c8 t .L99
-00000000 r .LC0
-00000000 r .LC1
-00000064 r .LC10
-00000004 r .LC11
-0000006a r .LC12
-00000000 r .LC13
-00000070 r .LC14
-00000076 r .LC16
-00000008 r .LC17
-00000079 r .LC18
-00000010 r .LC19
-00000005 r .LC2
-0000007e r .LC20
-00000018 r .LC21
-00000082 r .LC22
-00000086 r .LC23
-0000008c r .LC24
-00000092 r .LC25
-00000000 r .LC26
-00000010 r .LC27
-00000020 r .LC28
-00000030 r .LC29
-00000014 r .LC3
-00000020 r .LC31
-00000008 r .LC32
-00000028 r .LC33
-0000000c r .LC34
-00000098 r .LC35
-00000016 r .LC4
-00000020 r .LC5
-0000002f r .LC6
-0000003c r .LC7
-00000045 r .LC8
-0000005b r .LC9
-00000000 t Limitfill
-00000c10 T Log_NPN1_INITLIB_32
+00000850 T Iin_NPN1
+00001460 T initlib_NPN1
+00001680 t .L117
+000015c0 t .L119
+000017d0 t .L120
+00001770 t .L121
+000018b0 t .L122
+00002585 t .L228
+00002590 t .L230
+000027f8 t .L232
+000027e0 t .L233
+00002810 t .L234
+000027c8 t .L235
+00002770 t .L236
+00002760 t .L237
+00002750 t .L238
+00002730 t .L239
+000026d0 t .L240
+00002550 t .L241
+000026b8 t .L242
+000026a0 t .L243
+00002690 t .L244
+00002650 t .L245
+00002620 t .L246
+000025d0 t .L247
+000025c0 t .L248
+000025b0 t .L249
+00000008 r .LC10
+00000034 r .LC11
+00000010 r .LC12
+00000039 r .LC13
+00000018 r .LC14
+0000003d r .LC15
+00000041 r .LC16
+00000047 r .LC17
+0000004d r .LC18
+00000000 r .LC19
+00000000 r .LC2
+00000010 r .LC20
+00000020 r .LC21
+00000030 r .LC22
+00000040 r .LC23
+00000050 r .LC24
+00000004 r .LC25
+00000060 r .LC26
+00000008 r .LC27
+0000000c r .LC28
+00000053 r .LC29
+0000001a r .LC3
+00000062 r .LC30
+00000064 r .LC31
+0000006e r .LC32
+0000007d r .LC33
+0000008a r .LC34
+00000093 r .LC35
+000000a9 r .LC36
+0000001f r .LC4
+00000000 r .LC5
+00000025 r .LC6
+00000000 r .LC7
+0000002b r .LC8
+00000031 r .LC9
+00000000 T Limitfill
+00002520 T Log_NPN1_INITLIB_32
          U malloc
          U __MallocTemp__
          U m_color
          U m_fillrect
+00001aa0 T Newgate_NPN1
+00001580 T NPN1check
          U _OutMem
-00000110 t Probe_Npn1.isra.13
+000023e0 T PreUpdate_NPN1
+00002000 T Probe_Npn1
          U puts
+00001db0 T Readgate_Npn1
+000024e0 T Refresh_NPN1
+00002360 T Reset_NPN1
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
          U strtod
          U __top_jb
+00002440 T Update_NPN1
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
 
 ana/pnp1.o:
          U AnaCapattrinsert
@@ -5417,85 +5913,102 @@ ana/pnp1.o:
          U AnaScoreboard
          U AnaSysCol
          U AnaSystem
+000019b0 T Attr_PNP1
+00001ca0 T Copygate_PNP1
+00002470 T Display_PNP1
+00001d10 T Dispose_PNP1
+000024f0 T Erase_PNP1
          U _Escape
+00000110 T Ex_PNP1
          U free
-000004a0 t GetCnf_PNP1.constprop.14
+00000c90 T GetCnf_PNP1
          U _GLOBAL_OFFSET_TABLE_
-000011e0 t .L100
-000011b8 t .L101
-00001618 t .L102
-000015d0 t .L103
-000015b8 t .L104
-000015a0 t .L105
-00001698 t .L106
-00001660 t .L107
-00001188 t .L108
-00001138 t .L109
-00000c38 t .L110
-00001060 t .L111
-00001d00 t .L133
-00001b0d t .L135
-00001b78 t .L136
-00001c12 t .L137
-00001c68 t .L138
-00001028 t .L90
-00001038 t .L92
-00001470 t .L94
-00001458 t .L95
-00001488 t .L96
-00001438 t .L97
-000013e0 t .L98
-000011f8 t .L99
-00000000 r .LC0
-00000000 r .LC1
-00000064 r .LC10
-00000004 r .LC11
-0000006a r .LC12
-00000000 r .LC13
-00000070 r .LC14
-00000076 r .LC16
-00000008 r .LC17
-00000079 r .LC18
-00000010 r .LC19
-00000005 r .LC2
-0000007e r .LC20
-00000018 r .LC21
-00000082 r .LC22
-00000086 r .LC23
-0000008c r .LC24
-00000092 r .LC25
-00000000 r .LC26
-00000010 r .LC27
-00000020 r .LC28
-00000030 r .LC29
-00000014 r .LC3
-00000020 r .LC31
-00000008 r .LC32
-00000028 r .LC33
-0000000c r .LC34
-00000098 r .LC35
-00000016 r .LC4
-00000020 r .LC5
-0000002f r .LC6
-0000003c r .LC7
-00000045 r .LC8
-0000005b r .LC9
-00000000 t Limitfill
-00000c00 T Log_PNP1_INITLIB_32
+00000810 T Iin_PNP1
+00001400 T initlib_PNP1
+00001620 t .L118
+00001560 t .L120
+00001770 t .L121
+00001710 t .L122
+00001850 t .L123
+00002575 t .L232
+00002580 t .L234
+000027e8 t .L236
+000027d0 t .L237
+00002800 t .L238
+000027b8 t .L239
+00002760 t .L240
+00002750 t .L241
+00002740 t .L242
+00002720 t .L243
+000026c0 t .L244
+00002540 t .L245
+000026a8 t .L246
+00002690 t .L247
+00002680 t .L248
+00002640 t .L249
+00002610 t .L250
+000025c0 t .L251
+000025b0 t .L252
+000025a0 t .L253
+00000008 r .LC10
+00000034 r .LC11
+00000010 r .LC12
+00000039 r .LC13
+00000018 r .LC14
+0000003d r .LC15
+00000041 r .LC16
+00000047 r .LC17
+0000004d r .LC18
+00000000 r .LC19
+00000000 r .LC2
+00000010 r .LC20
+00000020 r .LC21
+00000030 r .LC22
+00000040 r .LC23
+00000050 r .LC24
+00000004 r .LC25
+00000060 r .LC26
+00000008 r .LC27
+0000000c r .LC28
+00000053 r .LC29
+0000001a r .LC3
+00000062 r .LC30
+00000064 r .LC31
+0000006e r .LC32
+0000007d r .LC33
+0000008a r .LC34
+00000093 r .LC35
+000000a9 r .LC36
+0000001f r .LC4
+00000000 r .LC5
+00000025 r .LC6
+00000000 r .LC7
+0000002b r .LC8
+00000031 r .LC9
+00000000 T Limitfill
+00002510 T Log_PNP1_INITLIB_32
          U malloc
          U __MallocTemp__
          U m_color
          U m_fillrect
+00001a40 T Newgate_PNP1
          U _OutMem
-00000110 t Probe_PNP1.isra.13
+00001520 T PNP1check
+000023d0 T PreUpdate_PNP1
+00001fa0 T Probe_PNP1
          U puts
+00001d50 T Readgate_PNP1
+000024d0 T Refresh_PNP1
+00002350 T Reset_PNP1
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
          U strtod
          U __top_jb
+00002430 T Update_PNP1
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
 
 ana/npn2.o:
          U AnaCapattrinsert
@@ -5523,89 +6036,106 @@ ana/npn2.o:
          U AnaScoreboard
          U AnaSysCol
          U AnaSystem
+00001c30 T Attr_NPN2
+00001f40 T Copygate_NPN2
+000026f0 T Display_NPN2
+00001fb0 T Dispose_NPN2
+00002770 T Erase_NPN2
          U _Escape
+00000110 T Ex_NPN2
          U free
-000004b0 t GetCnf_NPN2.constprop.14
+00000db0 T GetCnf_NPN2
          U _GLOBAL_OFFSET_TABLE_
-00001598 t .L100
-00001548 t .L101
-000014f0 t .L102
-000012d8 t .L103
-000012c0 t .L104
-000012a0 t .L105
-00001728 t .L106
-000016e0 t .L107
-000016c8 t .L108
-000016b0 t .L109
-000017a8 t .L110
-00001770 t .L111
-00001270 t .L112
-00001220 t .L113
-00000d18 t .L114
-00001130 t .L115
-00001d83 t .L137
-00001e7b t .L139
-00001daf t .L140
-00001f18 t .L141
-00001c55 t .L142
-00001cd8 t .L143
-000010fc t .L94
-00001110 t .L96
-00001580 t .L98
-00001568 t .L99
-00000000 r .LC0
-00000000 r .LC1
-00000064 r .LC10
-00000004 r .LC11
-0000006a r .LC12
-00000000 r .LC13
-00000070 r .LC14
-00000008 r .LC15
-00000076 r .LC16
-00000010 r .LC17
-00000079 r .LC18
-00000008 r .LC19
-00000005 r .LC2
-0000007c r .LC20
-00000018 r .LC21
-00000081 r .LC22
-00000020 r .LC23
-00000085 r .LC24
-00000089 r .LC25
-0000008f r .LC26
-00000095 r .LC27
-00000000 r .LC28
-00000010 r .LC29
-00000014 r .LC3
-00000020 r .LC30
-00000030 r .LC31
-00000028 r .LC34
-0000000c r .LC35
-00000030 r .LC36
-00000010 r .LC37
-0000009b r .LC38
-00000016 r .LC4
-00000020 r .LC5
-0000002f r .LC6
-0000003c r .LC7
-00000045 r .LC8
-0000005b r .LC9
-00000000 t Limitfill
-00000ce0 T Log_NPN2_INITLIB_32
+000008f0 T Iin_NPN2
+000015f0 T initlib_NPN2
+00001820 t .L123
+00001770 t .L125
+00001b10 t .L126
+00001a60 t .L127
+00001a00 t .L128
+00001920 t .L129
+000027f5 t .L239
+00002800 t .L241
+00002a68 t .L243
+00002a50 t .L244
+00002a80 t .L245
+00002a38 t .L246
+000029e0 t .L247
+000029d0 t .L248
+000029c0 t .L249
+000029a0 t .L250
+00002940 t .L251
+000027c0 t .L252
+00002928 t .L253
+00002910 t .L254
+00002900 t .L255
+000028c0 t .L256
+00002890 t .L257
+00002840 t .L258
+00002830 t .L259
+00002820 t .L260
+00000031 r .LC10
+00000010 r .LC11
+00000034 r .LC12
+00000004 r .LC13
+00000037 r .LC14
+00000018 r .LC15
+0000003c r .LC16
+00000020 r .LC17
+00000040 r .LC18
+00000044 r .LC19
+00000000 r .LC2
+0000004a r .LC20
+00000050 r .LC21
+00000000 r .LC22
+00000010 r .LC23
+00000020 r .LC24
+00000030 r .LC25
+00000040 r .LC26
+00000050 r .LC27
+00000008 r .LC28
+00000060 r .LC29
+0000001a r .LC3
+0000000c r .LC30
+00000010 r .LC31
+00000056 r .LC32
+00000065 r .LC33
+00000067 r .LC34
+00000071 r .LC35
+00000080 r .LC36
+0000008d r .LC37
+00000096 r .LC38
+000000ac r .LC39
+0000001f r .LC4
+00000000 r .LC5
+00000025 r .LC6
+00000000 r .LC7
+0000002b r .LC8
+00000008 r .LC9
+00000000 T Limitfill
+00002790 T Log_NPN2_INITLIB_32
          U malloc
          U __MallocTemp__
          U m_color
          U m_fillrect
+00001cc0 T Newgate_NPN2
+00001730 T NPN2check
          U _OutMem
-00000110 t Probe_Npn2.isra.13
+00002650 T PreUpdate_NPN2
+00002270 T Probe_Npn2
          U puts
+00001ff0 T Readgate_Npn2
+00002750 T Refresh_NPN2
+000025d0 T Reset_NPN2
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
          U strtod
          U __top_jb
+000026b0 T Update_NPN2
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
 
 ana/pnp2.o:
          U AnaCapattrinsert
@@ -5633,88 +6163,105 @@ ana/pnp2.o:
          U AnaScoreboard
          U AnaSysCol
          U AnaSystem
+00001c00 T Attr_PNP2
+00001f10 T Copygate_PNP2
+00002710 T Display_PNP2
+00001f80 T Dispose_PNP2
+00002790 T Erase_PNP2
          U _Escape
+00000110 T Ex_PNP2
          U free
-000004a0 t GetCnf_PNP2.constprop.14
+00000da0 T GetCnf_PNP2
          U _GLOBAL_OFFSET_TABLE_
-00001590 t .L100
-00001548 t .L101
-000014f0 t .L102
-000012d8 t .L103
-000012c0 t .L104
-000012a0 t .L105
-00001720 t .L106
-000016d8 t .L107
-000016c0 t .L108
-000016a8 t .L109
-000017a0 t .L110
-00001768 t .L111
-00001270 t .L112
-00001220 t .L113
-00000ce8 t .L114
-00001130 t .L115
-00001d72 t .L137
-00001e6a t .L139
-00001d9e t .L140
-00001f08 t .L141
-00001c4d t .L142
-00001cc8 t .L143
-00001106 t .L94
-00001110 t .L96
-00001580 t .L98
-00001568 t .L99
-00000000 r .LC0
-00000000 r .LC1
-00000064 r .LC10
-00000004 r .LC11
-0000006a r .LC12
-00000000 r .LC13
-00000070 r .LC14
+000008d0 T Iin_PNP2
+000015c0 T initlib_PNP2
+000017f0 t .L123
+00001740 t .L125
+00001ae0 t .L126
+00001a30 t .L127
+000019d0 t .L128
+000018f0 t .L129
+00002815 t .L242
+00002820 t .L244
+00002a88 t .L246
+00002a70 t .L247
+00002aa0 t .L248
+00002a58 t .L249
+00002a00 t .L250
+000029f0 t .L251
+000029e0 t .L252
+000029c0 t .L253
+00002960 t .L254
+000027e0 t .L255
+00002948 t .L256
+00002930 t .L257
+00002920 t .L258
+000028e0 t .L259
+000028b0 t .L260
+00002860 t .L261
+00002850 t .L262
+00002840 t .L263
+00000031 r .LC10
+00000008 r .LC11
+00000034 r .LC12
+00000010 r .LC13
+00000039 r .LC14
 00000008 r .LC15
-00000076 r .LC16
-00000008 r .LC17
-00000079 r .LC18
-00000010 r .LC19
-00000005 r .LC2
-0000007e r .LC20
-0000000c r .LC21
-00000081 r .LC22
-00000085 r .LC23
-00000089 r .LC24
-0000008f r .LC25
-00000095 r .LC26
-00000000 r .LC27
-00000010 r .LC28
-00000020 r .LC29
-00000014 r .LC3
-00000030 r .LC30
-00000018 r .LC33
-00000010 r .LC34
-00000020 r .LC35
-00000014 r .LC36
-0000009b r .LC37
-00000016 r .LC4
-00000020 r .LC5
-0000002f r .LC6
-0000003c r .LC7
-00000045 r .LC8
-0000005b r .LC9
-00000000 t Limitfill
-00000cb0 T Log_PNP2_INITLIB_32
+0000003c r .LC16
+00000040 r .LC17
+00000044 r .LC18
+0000004a r .LC19
+00000000 r .LC2
+00000050 r .LC20
+00000000 r .LC21
+00000010 r .LC22
+00000020 r .LC23
+00000030 r .LC24
+00000040 r .LC25
+00000050 r .LC26
+0000000c r .LC27
+00000060 r .LC28
+00000010 r .LC29
+0000001a r .LC3
+00000014 r .LC30
+00000056 r .LC31
+00000065 r .LC32
+00000067 r .LC33
+00000071 r .LC34
+00000080 r .LC35
+0000008d r .LC36
+00000096 r .LC37
+000000ac r .LC38
+0000001f r .LC4
+00000000 r .LC5
+00000025 r .LC6
+00000000 r .LC7
+0000002b r .LC8
+00000004 r .LC9
+00000000 T Limitfill
+000027b0 T Log_PNP2_INITLIB_32
          U malloc
          U __MallocTemp__
          U m_color
          U m_fillrect
+00001c90 T Newgate_PNP2
          U _OutMem
-00000110 t Probe_PNP2.isra.13
+00001700 T PNP2check
+00002670 T PreUpdate_PNP2
+00002240 T Probe_PNP2
          U puts
+00001fc0 T Readgate_PNP2
+00002770 T Refresh_PNP2
+000025f0 T Reset_PNP2
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
          U strtod
          U __top_jb
+000026d0 T Update_PNP2
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
 
 ana/diode1.o:
          U AnaCapattrinsert
@@ -5739,68 +6286,84 @@ ana/diode1.o:
          U AnaScoreboard
          U AnaSysCol
          U AnaSystem
+00000b90 T Attr_Diode1
+00000d40 T Copygate_Diode1
+000009a0 T Diode1check
+000012b0 T Display_Diode1
+00000de0 T Dispose_Diode1
+00001330 T Erase_Diode1
          U _Escape
+00000110 T Ex_Diode1
          U free
-00000380 t GetCnf_Diode1.constprop.14
+00000460 T GetCnf_Diode1
          U _GLOBAL_OFFSET_TABLE_
-00000833 t .L62
-00000840 t .L64
-00000cd0 t .L66
-00000cb8 t .L67
-00000ce0 t .L68
-00000c98 t .L69
-00000c18 t .L70
-00000b10 t .L71
-00000af8 t .L72
-00000ad8 t .L73
-00000da0 t .L74
-000007d0 t .L75
-00000d88 t .L76
-00000d70 t .L77
-00000e20 t .L78
-00000de8 t .L79
-00000e80 t .L80
-00000aa0 t .L81
-00000928 t .L82
-00000860 t .L83
-00000000 r .LC0
+00000300 T Iin_Diode1
+00000890 T initlib_Diode1
+00001392 t .L149
+000013a0 t .L151
+00001648 t .L153
+00001630 t .L154
+00001658 t .L155
+00001610 t .L156
+00001580 t .L157
+00001570 t .L158
+00001560 t .L159
+00001378 t .L160
+00001500 t .L161
+000014d0 t .L162
+000014b8 t .L163
+000014a0 t .L164
+00001490 t .L165
+00001450 t .L166
+00001420 t .L167
+000013e0 t .L168
+000013d0 t .L169
+000013c0 t .L170
 00000000 r .LC1
-00000008 r .LC10
-00000044 r .LC11
-00000010 r .LC12
-0000004a r .LC13
-00000018 r .LC14
-00000050 r .LC15
-00000000 r .LC16
-00000010 r .LC17
+00000018 r .LC10
+00000036 r .LC11
+00000000 r .LC12
+00000010 r .LC13
+00000020 r .LC14
+00000030 r .LC15
+00000000 r .LC17
 00000004 r .LC18
-00000020 r .LC19
-00000007 r .LC2
-00000008 r .LC21
-00000056 r .LC22
-00000016 r .LC3
-00000018 r .LC4
-0000001d r .LC5
-00000025 r .LC6
-0000003b r .LC7
-00000000 r .LC8
-0000003e r .LC9
-00000000 t Limitfill
-000007a0 T Log_Diode1_INITLIB_32
+0000003c r .LC19
+0000001a r .LC2
+0000004b r .LC20
+0000004d r .LC21
+00000052 r .LC22
+0000005a r .LC23
+00000021 r .LC3
+00000000 r .LC4
+00000024 r .LC5
+00000008 r .LC6
+0000002a r .LC7
+00000010 r .LC8
+00000030 r .LC9
+00000000 T Limitfill
+00001350 T Log_Diode1_INITLIB_32
          U malloc
          U __MallocTemp__
          U m_color
          U m_fillrect
+00000bf0 T Newgate_Diode1
          U _OutMem
-00000110 t Probe_Diode1.isra.13
+00001230 T PreUpdate_Diode1
+00000f30 T Probe_Diode1
          U puts
+00000e20 T Readgate_Diode1
+00001310 T Refresh_Diode1
+000011b0 T Reset_Diode1
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
          U strtod
          U __top_jb
+00001270 T Update_Diode1
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
 
 ana/pwl.o:
          U AnaCapattrinsert
@@ -5823,79 +6386,101 @@ ana/pwl.o:
          U AnaScoreboard
          U AnaSysCol
          U AnaSystem
-00000270 t CheckPWLFile.part.1
+00001a30 T Attr_PWL
+00001300 T CheckPWLFile
+00000000 t CheckPWLFile.part.1
+00001cb0 T Copygate_PWL
+00002150 T Display_PWL
+00001d20 T Dispose_PWL
+000021e0 T Erase_PWL
          U _Escape
          U exit
+00000530 T Ex_PWL
          U fclose
          U fgets
+000009a0 T findcircle
          U fopen
          U free
          U fwrite
-00000740 t GetCnf_PWL.constprop.15
+000014f0 T GetCnf_PWL
          U _GLOBAL_OFFSET_TABLE_
-00000350 t interp
-         U __isoc99_sscanf
-000015f0 t .L206
-00001610 t .L208
-00001a90 t .L210
-00001a78 t .L211
-00001aa0 t .L212
-00001a58 t .L213
-00001a00 t .L214
-00001950 t .L215
-00001928 t .L216
-00001908 t .L217
-000018a0 t .L218
-00001838 t .L219
-000018f0 t .L220
-00001820 t .L221
-000017a0 t .L222
-00001760 t .L223
-00001720 t .L224
-000016e0 t .L225
-000014e0 t .L226
-00001630 t .L227
+00000780 T Iin_PWL
+000017f0 T initlib_PWL
+000003c0 T interp
+0000225f t .L345
+00002270 t .L347
+000024f8 t .L349
+000024e0 t .L350
+00002510 t .L351
+000024c8 t .L352
+00002470 t .L353
+00002458 t .L354
+00002448 t .L355
+00002240 t .L356
+000023f0 t .L357
+000023c0 t .L358
+000023a8 t .L359
+00002390 t .L360
+00002380 t .L361
+00002330 t .L362
+000022f8 t .L363
+000022b0 t .L364
+000022a0 t .L365
+00002290 t .L366
 00000000 r .LC0
-0000003b r .LC10
-00000040 r .LC11
-00000042 r .LC12
-00000004 r .LC13
-00000008 r .LC14
-0000000c r .LC15
-00000000 r .LC16
-00000000 r .LC17
-00000010 r .LC18
-00000000 r .LC19
-00000000 r .LC2
-00000024 r .LC20
-00000008 r .LC3
-00000010 r .LC4
-0000001f r .LC5
-00000021 r .LC6
-00000026 r .LC7
-0000002e r .LC8
-00000032 r .LC9
-00000000 t Limitfill
-00000a20 t LoadPWLVar
-000014a0 T Log_PWL_INITLIB_32
+00000008 r .LC10
+0000000a r .LC11
+0000000e r .LC12
+00000017 r .LC13
+0000001c r .LC14
+00000030 r .LC15
+00000024 r .LC16
+0000000c r .LC17
+00000023 r .LC18
+0000002b r .LC19
+0000003a r .LC20
+0000003c r .LC21
+00000041 r .LC22
+00000000 r .LC3
+00000000 r .LC4
+00000004 r .LC5
+00000008 r .LC6
+00000000 r .LC7
+00000010 r .LC8
+00000020 r .LC9
+000000e0 T Limitfill
+00001320 T LoadPWLVar
+00000350 T locate
+00002210 T Log_PWL_INITLIB_32
          U malloc
          U __MallocTemp__
          U m_color
          U memcpy
          U m_fillrect
+00001bc0 T Newgate_PWL
          U _OutMem
-000004c0 t Probe_PWL.isra.14
+00002090 T PreUpdate_PWL
+00001da0 T Probe_PWL
+00000d30 T pwl2c
+000018e0 T PWLcheck
+00001d60 T Readgate_PWL
+000021b0 T Refresh_PWL
+00002020 T Reset_PWL
          U rewind
          U _setjmp
          U sprintf
          U sqrt
+         U sscanf
          U __stack_chk_fail_local
          U stderr
          U strcpy
          U strtod
          U __top_jb
+00002100 T Update_PWL
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.di
+00000000 T __x86.get_pc_thunk.dx
 
 ana/rtd.o:
          U AnaCapattrinsert
@@ -5919,78 +6504,89 @@ ana/rtd.o:
          U AnaScoreboard
          U AnaSysCol
          U AnaSystem
+00001fb0 T Attr_RTD
+000022a0 T Copygate_RTD
+00002330 T Dispose_RTD
          U _Escape
          U exp
+00000070 T Ex_RTD
          U free
          U fwrite
-00000280 t GetCnf_RTD.constprop.9
+000011b0 T GetCnf_RTD
          U _GLOBAL_OFFSET_TABLE_
-00001ad0 t .L118
-00001a52 t .L120
-00001968 t .L121
-00001a41 t .L122
-00001920 t .L123
-00001ba0 t .L193
-00000e80 t .L292
-00000e90 t .L78
-000015b0 t .L80
-00001590 t .L81
-000014f0 t .L82
-000014d0 t .L83
-00001450 t .L84
-000012a8 t .L85
-00001290 t .L86
-00001260 t .L87
-00001248 t .L88
-00001230 t .L89
-00000fb8 t .L90
-00000fa0 t .L91
-00000a58 t .L92
-00000eb8 t .L93
-00000000 r .LC0
+000009c0 T Iin_RTD
+00001960 T initlib_RTD
+00001c78 t .L236
+00001bd0 t .L238
+00001ac8 t .L239
+00001d30 t .L240
+00001b78 t .L241
+00001d48 t .L254
+00002841 t .L337
+00002848 t .L339
+00002968 t .L341
+00002950 t .L342
+00002940 t .L343
+00002928 t .L344
+000027d0 t .L345
+00002918 t .L346
+00002900 t .L347
+000028d8 t .L348
+000028c0 t .L349
+000028b0 t .L350
+000028a0 t .L351
+00002890 t .L352
+00002880 t .L353
+00002870 t .L354
 00000000 r .LC1
-00000004 r .LC10
-0000003b r .LC11
-00000000 r .LC12
-00000041 r .LC13
-00000008 r .LC14
-00000047 r .LC15
-00000010 r .LC16
-0000004d r .LC17
-00000018 r .LC18
-00000053 r .LC19
-00000004 r .LC2
-00000059 r .LC20
-00000063 r .LC21
-0000006b r .LC22
-00000020 r .LC23
-00000071 r .LC24
-00000008 r .LC25
-00000028 r .LC27
-00000030 r .LC28
-00000038 r .LC29
-00000013 r .LC3
-00000000 r .LC30
-00000010 r .LC31
-00000020 r .LC32
-00000030 r .LC33
-0000000c r .LC34
-00000010 r .LC35
-00000040 r .LC36
-00000048 r .LC37
-00000077 r .LC38
-00000014 r .LC39
-00000090 r .LC40
-00000015 r .LC5
-0000001a r .LC6
-00000022 r .LC7
-00000027 r .LC8
-00000031 r .LC9
-00000a20 T Log_rtd_initlib_32
+00000000 r .LC10
+0000001b r .LC11
+0000001f r .LC12
+00000024 r .LC13
+0000002e r .LC14
+00000010 r .LC15
+00000038 r .LC16
+00000018 r .LC17
+0000003e r .LC18
+00000020 r .LC19
+00000000 r .LC2
+00000044 r .LC20
+00000028 r .LC21
+0000004a r .LC22
+00000030 r .LC23
+00000050 r .LC24
+00000056 r .LC25
+00000060 r .LC26
+00000068 r .LC27
+00000038 r .LC28
+0000006e r .LC29
+00000004 r .LC3
+00000010 r .LC30
+00000020 r .LC31
+00000030 r .LC32
+00000040 r .LC33
+00000050 r .LC34
+00000040 r .LC35
+00000074 r .LC36
+00000014 r .LC37
+0000008d r .LC38
+0000009c r .LC39
+00000008 r .LC4
+0000009e r .LC40
+000000a3 r .LC41
+00000000 r .LC6
+00000008 r .LC7
+00000010 r .LC8
+0000000c r .LC9
+000027a0 T Log_rtd_initlib_32
          U malloc
          U __MallocTemp__
+00002010 T Newgate_RTD
          U _OutMem
-00000000 t Probe_RTD.isra.8
+00002520 T Probe_RTD
+00002370 T Readgate_RTD
+00001a90 T RTDcheck
+00000000 T SafeExp
          U _setjmp
          U sprintf
          U __stack_chk_fail_local
@@ -5999,256 +6595,279 @@ ana/rtd.o:
          U __top_jb
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.dx
 
 lplot.o:
-00000120 t changexfunc
-000001c0 t changeyfunc
+00009360 T actionname
+00001bb0 T addtempsolder
+00001b60 T bound
+00000050 t changexfunc
+000000f0 t changeyfunc
 00000010 b colors
-00002340 t computedata
+000061d0 T computedata
          U __ctype_b_loc
 00000240 b datagattr
 00000244 b datakattr
 0000024c b datalbl
 00000248 b datanumattrs
-00002300 t dataproc1
-00000260 t dataproc2
-00002310 t dataproc3
-00006ee0 t doit
+00000810 t dataproc1
+00000190 t dataproc2
+00000820 t dataproc3
+00007030 T disposedata
+00005f10 T disposesymtab
+00007e10 T doit
+000077a0 T doplotdata
+000057a0 T doplotfile
+00001580 T drawstr2
          U _Escape
          U fclose
 00000250 b filegattr
 00000254 b filekattr
 0000025c b filelbl
 00000258 b filenumattrs
-000022e0 t fileproc1
+000007f0 t fileproc1
 00000010 t fileproc2
-000022f0 t fileproc3
-00001100 t finish
+00000800 t fileproc3
+00001380 T finish
          U floor
          U fopen
          U fp_remove
          U free
          U freopen
-00002030 t getcolor.isra.15
+00000970 T getcolor
+00000680 t getcolor.constprop.7
+000081b0 T getintattr
+00008050 T getpenname
          U _GLOBAL_OFFSET_TABLE_
-000009e0 t initplotter
+00008e60 T init_lplot
+00000ad0 T initplotter
+00005b30 T initsymtab
+00007070 T isitlog
          U __isoc99_sscanf
-00008a80 t .L1298
-00008ac0 t .L1299
-00008c40 t .L1301
-00008c20 t .L1302
-00008b60 t .L1303
-00008530 t .L1304
-000002dd t .L24
-000002e0 t .L26
-00000390 t .L28
-00000388 t .L29
-00000290 t .L30
-00000340 t .L31
-00000330 t .L32
-00002000 t .L320
-00001ed0 t .L321
-00001fd8 t .L323
-00001fb0 t .L324
-00001f80 t .L325
-00001f50 t .L326
-00001f20 t .L327
-00001f00 t .L328
-00005468 t .L716
-000053a0 t .L717
-00005488 t .L719
-00005620 t .L720
-000056d0 t .L721
-00005970 t .L722
-00005aa8 t .L723
-00005820 t .L724
-00005e5c t .L730
-00004ab9 t .L732
-00005e08 t .L733
-00005e17 t .L734
-00005e23 t .L735
-00005e32 t .L736
-00005e41 t .L737
-00005e50 t .L738
-00006d8a t .L753
-00006d83 t .L755
-00006d72 t .L756
-00006d7c t .L757
-00006cd3 t .L758
-00006d24 t .L759
-00006d3e t .L760
-00006d58 t .L761
-00000670 t .L87
-00000620 t .L89
-00000720 t .L91
-000006f8 t .L92
-000006e0 t .L93
-00000690 t .L94
+000060d0 t .L1080
+00005fa0 t .L1081
+000060a8 t .L1083
+00006080 t .L1084
+00006050 t .L1085
+00006020 t .L1086
+00005ff0 t .L1087
+00005fd0 t .L1088
+000099d0 t .L1528
+00009a10 t .L1529
+00009b98 t .L1531
+00009b70 t .L1532
+00009ab0 t .L1533
+00009480 t .L1534
+0000020d t .L18
+00000210 t .L20
+000002c0 t .L22
+000002b8 t .L23
+000001c0 t .L24
+00000270 t .L25
+00000260 t .L26
+00003990 t .L504
+000038d0 t .L505
+00003ef0 t .L507
+00003f10 t .L508
+00003c70 t .L509
+000039b0 t .L510
+00003ad0 t .L511
+00003db0 t .L512
+0000300d t .L515
+000041c3 t .L517
+0000418a t .L518
+00004199 t .L519
+000041a5 t .L520
+000041b4 t .L521
+00004174 t .L522
+0000417e t .L523
+000050e3 t .L538
+0000505e t .L540
+000050af t .L541
+00005115 t .L542
+00005104 t .L543
+0000510b t .L544
+000050c9 t .L545
+000050ea t .L546
+000003f0 t .L59
+000003a0 t .L61
+000004a8 t .L63
+00000480 t .L64
+00000460 t .L65
+00000410 t .L66
+00000650 t .L91
+00000520 t .L92
+00000628 t .L94
+00000600 t .L95
+000005d0 t .L96
+000005a0 t .L97
+00000570 t .L98
+00000550 t .L99
 00000000 r .LC1
-00000033 r .LC10
-00000309 r .LC100
-00000311 r .LC101
-0000031a r .LC102
-0000031f r .LC103
-00000329 r .LC104
-00000347 r .LC105
-00000363 r .LC106
+00000037 r .LC10
+00000337 r .LC100
+00000344 r .LC101
+00000351 r .LC102
+0000035d r .LC103
+00000366 r .LC104
+00000370 r .LC105
+000000cc r .LC106
 0000037e r .LC107
-0000038b r .LC108
-0000039e r .LC109
-00000027 r .LC11
-000003b7 r .LC110
-000003c9 r .LC111
-000003d9 r .LC112
-000000f0 r .LC113
-00000110 r .LC114
-00000134 r .LC115
-0000016c r .LC116
-000001a4 r .LC117
-000001c4 r .LC118
-000003f3 r .LC119
-0000002b r .LC12
-0000040f r .LC120
-000001f4 r .LC121
-0000021c r .LC122
-00000250 r .LC123
-00000274 r .LC124
-00000428 r .LC125
-00000445 r .LC126
-0000045b r .LC127
-0000046f r .LC128
-00000483 r .LC129
-0000002f r .LC13
-00000498 r .LC130
-000004ab r .LC131
-000004bd r .LC132
-000004d2 r .LC133
-000004e4 r .LC134
-000004f4 r .LC135
-00000508 r .LC136
-00000522 r .LC137
-00000535 r .LC138
-00000540 r .LC139
-00000000 r .LC14
-00000294 r .LC140
-0000054b r .LC141
-0000055e r .LC142
-00000571 r .LC143
-00000584 r .LC144
-000002bc r .LC145
-000002f0 r .LC146
-00000348 r .LC147
-00000594 r .LC148
-000005a7 r .LC149
-0000005d r .LC15
-000005b6 r .LC150
-000005c5 r .LC151
-000005d4 r .LC152
-000005e3 r .LC153
-000005f2 r .LC154
-00000601 r .LC155
-0000061c r .LC156
-00000623 r .LC157
-00000635 r .LC158
-0000063d r .LC159
-00000062 r .LC16
-0000064d r .LC160
-0000037c r .LC161
+00000390 r .LC108
+00000398 r .LC109
+00000000 r .LC11
+000003a8 r .LC110
+000000f0 r .LC111
+000003ac r .LC112
+000003be r .LC113
+000003ce r .LC114
+00000118 r .LC115
+00000138 r .LC116
+0000015c r .LC117
+00000194 r .LC118
+000001cc r .LC119
+0000003c r .LC12
+000001ec r .LC120
+000003e8 r .LC121
+00000404 r .LC122
+0000021c r .LC123
+00000244 r .LC124
+00000278 r .LC125
+0000029c r .LC126
+0000041d r .LC127
+0000043a r .LC128
+00000450 r .LC129
+00000041 r .LC13
+00000464 r .LC130
+00000478 r .LC131
+0000048d r .LC132
+000004a0 r .LC133
+000004b2 r .LC134
+000004c7 r .LC135
+000004d9 r .LC136
+000004e9 r .LC137
+000004fd r .LC138
+00000517 r .LC139
+00000044 r .LC14
+0000052a r .LC140
+00000535 r .LC141
+000002bc r .LC142
+00000540 r .LC143
+00000553 r .LC144
+00000566 r .LC145
+00000579 r .LC146
+000002e4 r .LC147
+00000318 r .LC148
+00000370 r .LC149
+0000004c r .LC15
+00000589 r .LC150
+0000059c r .LC151
+000005ab r .LC152
+000005ba r .LC153
+000005c9 r .LC154
+000005d8 r .LC155
+000005e7 r .LC156
+000005f6 r .LC157
+00000603 r .LC158
+00000616 r .LC159
+00000020 r .LC16
+0000062f r .LC160
+0000064a r .LC161
 00000651 r .LC162
 00000656 r .LC163
 0000065b r .LC164
 00000660 r .LC165
 00000665 r .LC166
 0000066a r .LC167
-00000065 r .LC17
-0000006d r .LC18
-00000020 r .LC19
-00000003 r .LC2
-0000006f r .LC21
-00000078 r .LC22
-0000007d r .LC23
-00000094 r .LC24
-00000048 r .LC25
-0000009a r .LC26
-0000009e r .LC27
-000000a3 r .LC28
-000000b6 r .LC29
-00000008 r .LC3
-000000bd r .LC30
-000000cb r .LC31
-000000d0 r .LC32
-000000d7 r .LC33
-000000de r .LC34
-000000e6 r .LC35
-000000f0 r .LC36
-000000f8 r .LC37
-000000fd r .LC38
-00000104 r .LC39
-00000014 r .LC4
-0000010a r .LC40
-00000111 r .LC41
-00000116 r .LC42
-00000120 r .LC43
-00000128 r .LC44
-00000136 r .LC45
-00000145 r .LC46
-00000152 r .LC47
-0000015f r .LC48
-0000016b r .LC49
+0000004e r .LC18
+0000007d r .LC19
+0000000c r .LC2
+00000055 r .LC20
+00000068 r .LC21
+0000005c r .LC22
+00000060 r .LC23
+00000064 r .LC24
+00000000 r .LC25
+00000010 r .LC26
+00000020 r .LC27
+00000092 r .LC28
+00000097 r .LC29
+0000000d r .LC3
+00000000 r .LC30
+0000009c r .LC34
+000000a2 r .LC35
+000000a7 r .LC36
+000000b7 r .LC37
+000000bd r .LC38
+000000d9 r .LC39
+00000010 r .LC4
+000000e1 r .LC40
+000000ea r .LC41
+000000ee r .LC42
+000000f6 r .LC43
+000000fb r .LC44
+00000101 r .LC45
+00000103 r .LC46
+00000108 r .LC47
+0000010f r .LC48
+00000112 r .LC49
 00000015 r .LC5
-00000174 r .LC50
-0000017e r .LC51
-0000006c r .LC52
-0000018c r .LC53
-00000197 r .LC54
-0000019d r .LC55
-000001a8 r .LC56
-000001af r .LC57
-000001c5 r .LC58
-000001e0 r .LC59
+00000115 r .LC50
+0000011a r .LC51
+00000121 r .LC52
+0000012b r .LC53
+00000133 r .LC54
+00000136 r .LC55
+0000013c r .LC56
+00000145 r .LC57
+0000014a r .LC58
+0000014f r .LC59
 00000018 r .LC6
-000001fb r .LC60
-00000090 r .LC61
-00000211 r .LC62
-000000b0 r .LC63
-00000227 r .LC64
-00000241 r .LC65
-000000d0 r .LC66
-0000025b r .LC67
-00000260 r .LC68
+00000165 r .LC60
+00000180 r .LC61
+0000019b r .LC62
+00000048 r .LC63
+000001b1 r .LC64
+00000068 r .LC65
+000001c7 r .LC66
+000001e1 r .LC67
+00000088 r .LC68
 00000000 r .LC69
-0000001d r .LC7
-00000265 r .LC70
-00000000 r .LC71
-00000010 r .LC72
-00000020 r .LC73
-0000026b r .LC74
-00000270 r .LC75
-00000000 r .LC76
-00000048 r .LC8
-00000275 r .LC80
-0000027a r .LC81
-0000028a r .LC82
-00000290 r .LC83
-000002ac r .LC84
-000002b4 r .LC85
-000002bd r .LC86
-000002c1 r .LC87
-000002c9 r .LC88
-000002ce r .LC89
-00000020 r .LC9
-000002d4 r .LC90
-000002d6 r .LC91
-000002db r .LC92
-000002e2 r .LC93
-000002e5 r .LC94
-000002e8 r .LC95
-000002ed r .LC96
-000002f4 r .LC97
-000002fe r .LC98
-00000306 r .LC99
+00000023 r .LC7
+000001fb r .LC70
+00000201 r .LC71
+00000206 r .LC72
+00000210 r .LC73
+00000218 r .LC74
+00000236 r .LC75
+00000252 r .LC76
+000000a8 r .LC77
+0000026d r .LC78
+00000271 r .LC79
+00000029 r .LC8
+0000027a r .LC80
+0000027f r .LC81
+00000296 r .LC82
+0000029b r .LC83
+000002ae r .LC84
+000002b5 r .LC85
+000002c3 r .LC86
+000002c8 r .LC87
+000002cf r .LC88
+000002d6 r .LC89
+00000034 r .LC9
+000002de r .LC90
+000002e8 r .LC91
+000002f0 r .LC92
+000002f5 r .LC93
+000002fc r .LC94
+00000303 r .LC95
+00000308 r .LC96
+00000312 r .LC97
+0000031a r .LC98
+00000328 r .LC99
 00000000 d log_actionkinds_NAMES
-00008480 T Log_lplot_proc
+000093d0 T Log_lplot_proc
          U log_rotxx
          U log_rotxy
          U log_rotyx
@@ -6259,8 +6878,8 @@ lplot.o:
 0000026c b lplotlbl
 00000268 b lplotnumattrs
 00000000 t lplotproc1
-000005d0 t lplotproc2
-000022d0 t lplotproc3
+00000350 t lplotproc2
+000007e0 t lplotproc3
          U m_across
          U malloc
          U __MallocTemp__
@@ -6290,9 +6909,9 @@ lplot.o:
          U m_inkeyn
          U m_noclip
          U m_nocursor
-00000420 t modestr
+00001620 T modestr
          U m_pollkbd
-00000770 t munchlabel
+00001750 T munchlabel
          U my_toupper
          U na_srtor
          U nc_gotoXY
@@ -6302,18 +6921,20 @@ lplot.o:
 00000280 b nedesc
          U ne_dispose
          U ne_disposesymtab
-00001ea0 t neerror.isra.6
+00005f70 T neerror
+000004f0 t neerror.constprop.6
          U ne_init
          U ne_makerealvar
          U ne_revalexpr
          U ne_revaluate
          U ne_uncompile
          U newci_fixfname
-00000050 t nodename
+000022a0 T nodename
+00000850 t nodename.part.0
 00000014 b noplotgates
 00000018 b nosoldergates
          U _OutMem
-000012f0 t parsecommand
+00008230 T parsecommand
          U P_citinfo
 0000000c b pencolors
          U P_escapecode
@@ -6329,10 +6950,10 @@ lplot.o:
          U plot_clip
          U plot_color
          U plot_ctrlchars
-00003180 t plotdata
+000070c0 T plotdata
          U plot_draw
          U plot_fast
-00003910 t plotfile
+00002300 T plotfile
          U plot_finish
          U plot_fontfile
          U plot_genstring
@@ -6360,16 +6981,25 @@ lplot.o:
          U plot_rroundbox
          U plot_screenpen
          U plot_selfont
+000020c0 T plottext
          U plot_unxform
          U plot_view
          U plot_warminitscreen
          U plot_window
          U plot_xform
+00006160 T printnex
+00001a90 T refrfile
+000019c0 T refrplot
+00005570 T refrscreen
+00007530 T refrscreen_
 00000000 b screenpen
          U _setjmp
-00002180 t setwindow.isra.16
+00007e00 T setupcomplete
+00001230 T setwindow
+00001600 T sortints
          U sprintf
          U __stack_chk_fail_local
+00008d30 T status_lplot
          U stpcpy
          U strcicmp
          U strcmp
@@ -6393,6 +7023,7 @@ lplot.o:
          U strtol
          U strupper
          U strword
+00000930 T swap_
          U system
          U timers_sysclock
          U __top_jb
@@ -6400,40 +7031,49 @@ lplot.o:
 00000020 b varskattr
 00000028 b varslbl
 00000024 b varsnumattrs
-00002320 t varsproc1
-00002330 t varsproc2
-000022c0 t varsproc3
+00000830 t varsproc1
+00000840 t varsproc2
+000007d0 t varsproc3
+00006100 T whicherror
 00000000 T __x86.get_pc_thunk.ax
-00000000 T __x86.get_pc_thunk.bp
 00000000 T __x86.get_pc_thunk.bx
 00000000 T __x86.get_pc_thunk.cx
+00000000 T __x86.get_pc_thunk.di
+00000000 T __x86.get_pc_thunk.dx
 00000000 T __x86.get_pc_thunk.si
          U XFlush
 00000140 b xfun
 00000040 b yfun
+00005250 T zoomincommand
+000074f0 T zoomincommand_
+00007500 T zoomoutcommand
 
 logspc.o:
-000001e0 t addbogusname
+000030b0 T addbogusname
+00000c20 T addcell
+000007b0 T addlabel
          U AnaVdd
-00000271 b autotop
+00000278 b autotop
 00000004 C c_ctr
-00000288 b cellbase
+00000290 b cellbase
 0000020c b cellname
          U commandlabel
          U __ctype_b_loc
 00000004 C d_ctr
 00000008 C default_L
-0000026c b default_size
-00000268 b default_strength
+00000270 b default_size
+0000026c b default_strength
          U defndirectory
-00000b80 t docommand
-000002f0 t epilog.isra.9
+00000ce0 T docommand
+00006230 T dologspc
+000006a0 T emessage
+00002e80 T epilog
          U _Escape
          U _EscIO
          U examinetemplate
          U fclose
-00000278 b filebase
-00000274 b filecellbase
+00000280 b filebase
+0000027c b filecellbase
 00000210 b filename
          U fopen
          U free
@@ -6443,199 +7083,205 @@ logspc.o:
          U gateinbox
          U gateinstname
          U gateinstof
+00000990 T getint
+00000820 T getword
          U _GLOBAL_OFFSET_TABLE_
-00000248 b globals
-00000228 b gtempl
+0000024c b globals
+0000022c b gtempl
          U hier_init
 00000004 C i_ctr
 00000216 b identifycolor
-00000240 b ignored
+000079f0 T identifycommand
+00000244 b ignored
          U isgenericinstgate
          U isinstgate
          U __isoc99_sscanf
-00000219 b john_L_mode
-000047c8 t .L555
-000045de t .L556
-0000450f t .L558
-00004635 t .L559
-00002c16 t .L560
-000042c6 t .L561
-00004299 t .L562
-000044e1 t .L563
-0000447f t .L564
-00004797 t .L565
-000043fc t .L566
-00004769 t .L567
-00004704 t .L568
-0000422f t .L569
-00004195 t .L570
-000040e0 t .L571
-000040bc t .L572
-00004092 t .L573
-00004065 t .L574
-00004019 t .L575
-000048db t .L583
-0000484a t .L584
-0000493e t .L586
-000048a3 t .L587
-0000492c t .L588
-00004950 t .L589
-00004961 t .L590
-0000498f t .L591
+0000021c b john_L_mode
+00005b9a t .L788
+0000596c t .L789
+0000588d t .L791
+000059c3 t .L792
+00003f85 t .L793
+00005648 t .L794
+0000561b t .L795
+0000585f t .L796
+00005804 t .L797
+00005b2f t .L798
+0000577e t .L799
+00005b01 t .L800
+00005a9c t .L801
+000055ae t .L802
+00005514 t .L803
+0000545f t .L804
+0000543b t .L805
+00005411 t .L806
+000053e4 t .L807
+00005395 t .L808
+00005cb0 t .L816
+00005c1f t .L817
+00005d13 t .L819
+00005c78 t .L820
+00005d01 t .L821
+00005d25 t .L822
+00005d36 t .L823
+00005d64 t .L824
          U labelinbox
 00000008 C lambda
 00000000 r .LC0
-0000000c r .LC1
-00000044 r .LC10
-00000000 r .LC100
-0000032a r .LC101
-00000334 r .LC102
-00000339 r .LC103
-00000340 r .LC104
-00000284 r .LC105
-000002c8 r .LC106
-0000034b r .LC107
-00000355 r .LC108
-0000030c r .LC109
-00000049 r .LC11
-0000035a r .LC110
-0000035f r .LC111
-00000379 r .LC112
-00000394 r .LC113
-00000358 r .LC114
-00000396 r .LC115
-0000039f r .LC116
-0000037c r .LC117
-000003b4 r .LC118
-000003cb r .LC119
-00000000 r .LC12
-000003e7 r .LC120
-000003f2 r .LC121
-000003fd r .LC122
-000003a0 r .LC123
-0000040a r .LC124
-00000412 r .LC125
-00000417 r .LC126
-000003c0 r .LC127
-0000041b r .LC128
-000003f4 r .LC129
-0000004f r .LC13
-0000042d r .LC130
-00000444 r .LC131
-00000418 r .LC132
-00000458 r .LC133
-0000045c r .LC134
-000004ac r .LC135
-0000045d r .LC136
-00000479 r .LC137
-00000481 r .LC138
-00000495 r .LC139
-00000056 r .LC14
-0000005e r .LC15
-00000073 r .LC16
-0000007a r .LC17
-00000082 r .LC18
-00000089 r .LC19
-00000022 r .LC2
-0000008d r .LC20
-00000092 r .LC21
-00000097 r .LC22
-0000009c r .LC23
-000000a5 r .LC24
-000000aa r .LC25
-000000ab r .LC26
-000000af r .LC27
-000000b5 r .LC28
-000000bb r .LC29
-00000027 r .LC3
-000000c1 r .LC30
-00000030 r .LC32
-000000c5 r .LC34
-00000058 r .LC35
-000000cc r .LC36
-000000d0 r .LC37
-000000d5 r .LC38
-000000db r .LC39
-0000002c r .LC4
-000000f9 r .LC40
-000000fe r .LC41
-00000108 r .LC42
-00000110 r .LC43
-00000114 r .LC44
-00000119 r .LC45
-0000011f r .LC46
-0000013c r .LC47
-00000080 r .LC48
-00000143 r .LC49
-00000031 r .LC5
-0000014a r .LC50
-00000154 r .LC51
-00000164 r .LC52
-00000169 r .LC53
-0000016f r .LC54
-00000173 r .LC55
-00000176 r .LC56
-00000178 r .LC57
-0000017c r .LC58
-00000184 r .LC59
-00000038 r .LC6
-00000188 r .LC60
-0000018b r .LC61
-0000018d r .LC62
-0000019e r .LC63
-000001bc r .LC64
-000001ca r .LC65
-000001d1 r .LC66
-000001d5 r .LC67
-000001d9 r .LC68
-000001dd r .LC69
-0000003a r .LC7
-000001e2 r .LC70
-000001ea r .LC71
-00000201 r .LC72
-00000218 r .LC73
-0000022b r .LC74
-00000243 r .LC75
-00000252 r .LC76
-0000026a r .LC77
-00000279 r .LC78
-00000288 r .LC79
-0000003c r .LC8
-000000a0 r .LC80
-000000cc r .LC81
-00000297 r .LC82
-000002ac r .LC83
-000000f4 r .LC84
-00000124 r .LC85
-000002c1 r .LC86
-00000150 r .LC87
-0000017c r .LC88
-000001ac r .LC89
-0000003e r .LC9
-000001cc r .LC90
-000001ec r .LC91
-0000020c r .LC92
-000002df r .LC93
-000002e6 r .LC94
-00000303 r .LC95
-0000022c r .LC96
-0000025c r .LC97
-0000030e r .LC98
-00000321 r .LC99
-00000234 b libdirs
-00004d40 T Log_logspc_proc
-00000270 b maincell
+00000002 r .LC1
+0000002c r .LC10
+00000170 r .LC100
+0000019c r .LC101
+000001cc r .LC102
+000001ec r .LC103
+0000020c r .LC104
+0000022c r .LC105
+0000036a r .LC106
+00000387 r .LC107
+0000024c r .LC108
+0000027c r .LC109
+00000041 r .LC11
+00000392 r .LC110
+00000000 r .LC111
+000003a5 r .LC112
+000003ac r .LC113
+000002a4 r .LC114
+000002e8 r .LC115
+000003b7 r .LC116
+000003c1 r .LC117
+0000032c r .LC118
+000003c6 r .LC119
+00000046 r .LC12
+000003cb r .LC120
+000003e5 r .LC121
+00000400 r .LC122
+00000402 r .LC123
+0000040b r .LC124
+00000378 r .LC125
+0000039c r .LC126
+00000420 r .LC127
+00000432 r .LC128
+000003d0 r .LC129
+00000020 r .LC13
+000003f4 r .LC130
+00000418 r .LC131
+00000449 r .LC132
+0000045c r .LC133
+000004ac r .LC134
+0000044e r .LC135
+0000046a r .LC136
+0000047e r .LC137
+00000492 r .LC138
+0000049b r .LC139
+0000004c r .LC14
+000004af r .LC140
+00000053 r .LC15
+0000005b r .LC16
+00000062 r .LC17
+0000006a r .LC18
+00000071 r .LC19
+00000004 r .LC2
+00000075 r .LC20
+0000007a r .LC21
+0000007f r .LC22
+00000084 r .LC23
+0000008d r .LC24
+00000092 r .LC25
+00000093 r .LC26
+00000097 r .LC27
+0000009d r .LC28
+000000a3 r .LC29
+00000000 r .LC3
+000000a9 r .LC30
+00000050 r .LC32
+000000ad r .LC34
+00000078 r .LC35
+000000b4 r .LC36
+000000b8 r .LC37
+000000bd r .LC38
+000000c3 r .LC39
+00000006 r .LC4
+000000e1 r .LC40
+000000e6 r .LC41
+000000f0 r .LC42
+000000f8 r .LC43
+000000fc r .LC44
+00000101 r .LC45
+00000107 r .LC46
+00000124 r .LC47
+00000129 r .LC48
+0000012e r .LC49
+0000000d r .LC5
+00000133 r .LC50
+0000013a r .LC51
+00000140 r .LC52
+00000147 r .LC53
+000000a0 r .LC54
+0000014e r .LC55
+00000158 r .LC56
+00000168 r .LC57
+0000017e r .LC58
+0000018c r .LC59
+00000015 r .LC6
+00000196 r .LC60
+0000019b r .LC61
+000001b2 r .LC62
+000001ce r .LC63
+000001d9 r .LC64
+000001e1 r .LC65
+000001ee r .LC66
+000001f9 r .LC67
+000001fd r .LC68
+00000200 r .LC69
+0000001a r .LC7
+00000204 r .LC70
+00000209 r .LC71
+0000020f r .LC72
+00000213 r .LC73
+00000216 r .LC74
+00000218 r .LC75
+00000229 r .LC76
+00000247 r .LC77
+00000255 r .LC78
+0000025c r .LC79
+0000001c r .LC8
+00000260 r .LC80
+00000264 r .LC81
+00000268 r .LC82
+0000026d r .LC83
+00000275 r .LC84
+0000028c r .LC85
+000002a3 r .LC86
+000002b6 r .LC87
+000002ce r .LC88
+000002dd r .LC89
+00000020 r .LC9
+000002f5 r .LC90
+00000304 r .LC91
+00000313 r .LC92
+000000c0 r .LC93
+000000ec r .LC94
+00000322 r .LC95
+00000337 r .LC96
+00000114 r .LC97
+00000144 r .LC98
+0000034c r .LC99
+00000238 b libdirs
+00007e80 T Log_logspc_proc
+00000274 b maincell
          U malloc
          U __MallocTemp__
          U m_alpha_on
 00000004 C m_ctr
          U memcpy
-00000160 t message.isra.6
-00000224 b mybox
+00000620 T message
+00000228 b mybox
+000031d0 T mydefndirectory
          U my_strdup
          U my_tolower
-00000950 t namecellgates
-00000520 t namenode.isra.10
+00001e40 T namecellgates
+00001b90 T namenode
+00002080 T nameprimgates
 00000052 C nBulk
          U nc_fgets
          U nc_fprintf
@@ -6648,9 +7294,9 @@ logspc.o:
          U newci_fixfname
 00000214 b nodecount
 00000200 b nodeprefix
-00000230 b notfoundlist
+00000234 b notfoundlist
 00000004 C npn_ctr
-00000244 b orphans
+00000248 b orphans
          U _OutMem
 00000052 C pBulk
          U P_eof
@@ -6658,31 +7304,39 @@ logspc.o:
          U P_ioresult
 00000004 C pnp_ctr
          U pointinbox
-0000024c b ports
+00000250 b ports
 00000000 B post_file
 00000100 B pre_file
-00000280 b primbase
-0000023c b prims
-00001a20 t prolog
+00000288 b primbase
+00000240 b prims
+000070d0 T probecommand
+00002270 T prolog
 00000004 C r_ctr
+00003280 T readcellfile
+00000220 t readcellfile.part.3
+000032c0 T readcells
+000009a0 T readstrlist
+00000a40 T readstrlista
+00000ae0 T readstrlistr
          U re_cicompile
          U re_compare
          U re_replace
-00000284 b savecellbase
-00000264 b saveglobals
-0000025c b saveignored
+0000028c b savecellbase
+00000268 b saveglobals
+00000260 b saveignored
 00000218 b savejohn
-00000250 b savelibdirs
-00000260 b saveorphans
-0000027c b saveprimbase
-00000258 b saveprims
-0000021c b savetopness
-00000254 b savetrans
-0000028c b savetransbase
+00000254 b savelibdirs
+00000264 b saveorphans
+00000284 b saveprimbase
+0000025c b saveprims
+00000220 b savetopness
+00000258 b savetrans
+00000294 b savetransbase
 00000068 C s_ctr
          U _setjmp
          U _ShowEscape
-00000000 t spice_strword
+00006120 T showports
+00000830 T spice_strword
          U sprintf
          U __stack_chk_fail_local
          U stdout
@@ -6710,34 +7364,41 @@ logspc.o:
          U strword
          U strword2
          U __top_jb
-00000220 b topness
-00000238 b trans
-00000290 b transbase
-00000730 t tryreset.part.11
+00000224 b topness
+0000023c b trans
+00000298 b transbase
+00001db0 T trynamegate
+00000000 t tryreset.part.0
 00000004 C v_ctr
-0000022c b wignlist
-00002780 t writefile
+00000730 T vmessage
+00000230 b wignlist
+00003ae0 T writefile
+00003a40 T writeword
 00000000 T __x86.get_pc_thunk.ax
 00000000 T __x86.get_pc_thunk.bx
 00000004 C x_ctr
 
 logntk.o:
-00000080 t addbogusname
-00000071 b autotop
-00000088 b cellbase
+00002810 T addbogusname
+000006c0 T addcell
+000003b0 T addlabel
+00000078 b autotop
+00000090 b cellbase
 0000000c b cellname
          U commandlabel
-0000006c b default_size
-00000068 b default_strength
+00000070 b default_size
+0000006c b default_strength
          U defndirectory
-00000a20 t docommand
-00000190 t epilog.isra.9
+00000780 T docommand
+00004ea0 T dologntk
+000002a0 T emessage
+000025e0 T epilog
          U _Escape
          U _EscIO
          U examinetemplate
          U fclose
-00000078 b filebase
-00000074 b filecellbase
+00000080 b filebase
+0000007c b filecellbase
 00000010 b filename
          U fopen
          U free
@@ -6745,125 +7406,131 @@ logntk.o:
          U gateinbox
          U gateinstname
          U gateinstof
+00000430 T getint
+00000420 T getword
          U _GLOBAL_OFFSET_TABLE_
-00000048 b globals
-00000028 b gtempl
+0000004c b globals
+0000002c b gtempl
          U hier_init
 00000016 b identifycolor
-00000040 b ignored
+00006170 T identifycommand
+00000044 b ignored
          U isgenericinstgate
          U isinstgate
-00000019 b john_L_mode
+0000001c b john_L_mode
          U labelinbox
 00000000 r .LC0
-0000000c r .LC1
-00000044 r .LC10
-00000049 r .LC11
-00000000 r .LC12
-0000004f r .LC13
-00000056 r .LC14
-0000005e r .LC15
-00000073 r .LC16
-0000007a r .LC17
-00000082 r .LC18
-00000089 r .LC19
-00000022 r .LC2
-0000008d r .LC20
-00000092 r .LC21
-00000097 r .LC22
-0000009c r .LC23
-000000a5 r .LC24
-000000aa r .LC25
-000000ab r .LC26
-000000af r .LC27
-000000b5 r .LC28
-000000ba r .LC29
-00000027 r .LC3
-000000c4 r .LC30
-000000cc r .LC31
-000000d0 r .LC32
-000000d5 r .LC33
-000000db r .LC34
-000000f8 r .LC35
+00000002 r .LC1
+00000041 r .LC10
+00000048 r .LC11
+00000050 r .LC12
+00000057 r .LC13
+0000005b r .LC14
+00000060 r .LC15
+00000065 r .LC16
+0000006a r .LC17
+00000073 r .LC18
+00000078 r .LC19
+00000004 r .LC2
+00000079 r .LC20
+0000007d r .LC21
+00000083 r .LC22
+00000088 r .LC23
+00000092 r .LC24
+0000009a r .LC25
+0000009e r .LC26
+000000a3 r .LC27
+000000a9 r .LC28
+000000c6 r .LC29
+00000006 r .LC3
+000000cb r .LC30
+000000d0 r .LC31
+000000d5 r .LC32
+000000dc r .LC33
+000000e2 r .LC34
+000000e9 r .LC35
 00000030 r .LC36
-000000ff r .LC37
-00000106 r .LC38
-00000110 r .LC39
-0000002c r .LC4
+000000f0 r .LC37
+000000fa r .LC38
+0000010a r .LC39
+00000012 r .LC4
 00000120 r .LC40
-00000129 r .LC41
-00000130 r .LC42
-0000013a r .LC43
-0000013f r .LC44
-00000146 r .LC45
-00000050 r .LC46
-00000094 r .LC47
-00000151 r .LC48
-0000015b r .LC49
-00000031 r .LC5
-000000d8 r .LC50
-00000160 r .LC51
-00000165 r .LC52
-0000017f r .LC53
-0000019a r .LC54
-0000019c r .LC55
-000001b3 r .LC56
-000001cf r .LC57
-000001da r .LC58
-00000124 r .LC59
-00000038 r .LC6
-000001dc r .LC60
-000001e1 r .LC61
-000001e5 r .LC62
-000001e7 r .LC63
-00000148 r .LC64
-000001eb r .LC65
-000001ed r .LC66
-000001f1 r .LC67
-000001f5 r .LC68
-00000208 r .LC69
-0000003a r .LC7
-0000016c r .LC70
-00000198 r .LC71
-000001c8 r .LC72
-000001e8 r .LC73
-00000208 r .LC74
-00000228 r .LC75
-0000021e r .LC76
-0000023b r .LC77
-0000023e r .LC78
-0000024f r .LC79
-0000003c r .LC8
-00000248 r .LC80
-00000257 r .LC81
-0000026e r .LC82
+0000012e r .LC41
+00000138 r .LC42
+00000050 r .LC43
+0000013d r .LC44
+00000142 r .LC45
+00000146 r .LC46
+00000148 r .LC47
+0000015f r .LC48
+0000017b r .LC49
+00000027 r .LC5
+00000186 r .LC50
+00000188 r .LC51
+0000018c r .LC52
+00000190 r .LC53
+00000192 r .LC54
+00000196 r .LC55
+000001a9 r .LC56
+00000074 r .LC57
+000000a0 r .LC58
+000000d0 r .LC59
+0000002c r .LC6
+000000f0 r .LC60
+00000110 r .LC61
+00000130 r .LC62
+000001bf r .LC63
+000001c6 r .LC64
+000001e3 r .LC65
+000001e6 r .LC66
+000001f7 r .LC67
+00000150 r .LC68
+000001ff r .LC69
+00000000 r .LC7
+00000180 r .LC70
+0000020b r .LC71
+0000021e r .LC72
+00000225 r .LC73
+000001a8 r .LC74
+000001ec r .LC75
+00000230 r .LC76
+0000023a r .LC77
+00000230 r .LC78
+0000023f r .LC79
+00000032 r .LC8
+00000244 r .LC80
+0000025e r .LC81
+00000279 r .LC82
 0000027c r .LC83
-00000282 r .LC84
-000002c0 r .LC85
-00000310 r .LC86
-00000287 r .LC87
-000002a3 r .LC88
-00000360 r .LC89
-0000003e r .LC9
-000002ab r .LC90
-00000390 r .LC91
-000002b7 r .LC92
-000002ca r .LC93
-000002de r .LC94
-00000034 b libdirs
-000022f0 T Log_logntk_proc
-00000070 b maincell
+000002a0 r .LC84
+0000027b r .LC85
+000002d4 r .LC86
+00000292 r .LC87
+00000318 r .LC88
+00000368 r .LC89
+00000039 r .LC9
+00000297 r .LC90
+000002b3 r .LC91
+000002c7 r .LC92
+000002db r .LC93
+000002e4 r .LC94
+000002f8 r .LC95
+00000038 b libdirs
+00006600 T Log_logntk_proc
+00000074 b maincell
          U malloc
          U __MallocTemp__
          U m_alpha_on
          U memcpy
-00000000 t message.isra.6
+00000220 T message
          U m_graphics_on
-00000024 b mybox
+00000028 b mybox
+00002930 T mydefndirectory
          U my_strdup
          U my_tolower
-000007f0 t namecellgates
-000003c0 t namenode.isra.10
+00001590 T namecellgates
+000012e0 T namenode
+000017d0 T nameprimgates
          U nc_fgets
          U nc_fprintf
          U nc_fputs
@@ -6875,33 +7542,40 @@ logntk.o:
          U newci_fixfname
 00000014 b nodecount
 00000000 b nodeprefix
-00000030 b notfoundlist
-00000044 b orphans
+00000034 b notfoundlist
+00000048 b orphans
          U _OutMem
          U P_eof
          U P_escapecode
          U P_ioresult
          U pointinbox
-0000004c b ports
-00000080 b primbase
-0000003c b prims
-00001590 t prolog
+00000050 b ports
+00000088 b primbase
+00000040 b prims
+00005850 T probecommand
+000019c0 T prolog
+000029e0 T readcellfile
+00002cb0 T readcells
+00000440 T readstrlist
+000004e0 T readstrlista
+00000580 T readstrlistr
          U re_cicompile
          U re_compare
          U re_replace
-00000084 b savecellbase
-00000064 b saveglobals
-0000005c b saveignored
+0000008c b savecellbase
+00000068 b saveglobals
+00000060 b saveignored
 00000018 b savejohn
-00000050 b savelibdirs
-00000060 b saveorphans
-0000007c b saveprimbase
-00000058 b saveprims
-0000001c b savetopness
-00000054 b savetrans
-0000008c b savetransbase
+00000054 b savelibdirs
+00000064 b saveorphans
+00000084 b saveprimbase
+0000005c b saveprims
+00000020 b savetopness
+00000058 b savetrans
+00000094 b savetransbase
          U _setjmp
          U _ShowEscape
+00004d90 T showports
          U sprintf
          U __stack_chk_fail_local
          U stdout
@@ -6929,10 +7603,14 @@ logntk.o:
          U strword
          U strword2
          U __top_jb
-00000020 b topness
-00000038 b trans
-00000090 b transbase
-000005d0 t tryreset.part.13
-0000002c b wignlist
+00000024 b topness
+0000003c b trans
+00000098 b transbase
+00001500 T trynamegate
+00000000 t tryreset.part.0
+00000330 T vmessage
+00000030 b wignlist
+000034f0 T writefile
+00003460 T writeword
 00000000 T __x86.get_pc_thunk.ax
 00000000 T __x86.get_pc_thunk.bx
diff --git a/log/src/mygates.h b/log/src/mygates.h
index 7f96354..bc0a558 100644
--- a/log/src/mygates.h
+++ b/log/src/mygates.h
@@ -1,47 +1,18 @@
-/* Header for module mygates, generated by p2c */
 #ifndef MYGATES_H
 #define MYGATES_H
 
 
-#ifndef LOGDEF_H
 #include "logdef.h"
-#endif
-
-
-#ifndef LOGDIG_H
 #include "logdig.h"
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-#ifndef MYLIB_H
 #include <p2c/mylib.h>
-#endif
-
-
-#ifdef MYGATES_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-
-extern Void Log_mygates_sram8k PP((log_16_action *act));
-extern Void Log_mygates_ascdisp PP((log_16_action *act));
-
-
 
-extern Void Log_mygates_asckbd PP((log_16_action *act));
+extern void Log_mygates_sram8k (log_16_action *act);
+extern void Log_mygates_ascdisp (log_16_action *act);
 
+extern void Log_mygates_asckbd (log_16_action *act);
 
-#undef vextern
 
 #endif /*MYGATES_H*/
 
diff --git a/log/src/simdir.c b/log/src/simdir.c
index 6458574..7fb5af0 100644
--- a/log/src/simdir.c
+++ b/log/src/simdir.c
@@ -3,14 +3,14 @@
 
 /* Do not modify this file.  It is created automatically by "munch". */
 
-extern Void Log_0_proc();
-extern Void Log_16_proc();
-extern Void Log_17_proc();
-extern Void Log_1_proc();
-extern Void Log_2_proc();
-extern Void Log_32_proc();
-extern Void Log_33_proc();
-extern Void Log_7_proc();
+extern void Log_0_proc();
+extern void Log_16_proc();
+extern void Log_17_proc();
+extern void Log_1_proc();
+extern void Log_2_proc();
+extern void Log_32_proc();
+extern void Log_33_proc();
+extern void Log_7_proc();
 
 struct ext_proc ext_proc_table[] = {
   "Log_0_proc", Log_0_proc,
diff --git a/log/src/simdir.os2 b/log/src/simdir.os2
deleted file mode 100644
index 6458574..0000000
--- a/log/src/simdir.os2
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <p2c/p2c.h>
-#include "logstuff.h"
-
-/* Do not modify this file.  It is created automatically by "munch". */
-
-extern Void Log_0_proc();
-extern Void Log_16_proc();
-extern Void Log_17_proc();
-extern Void Log_1_proc();
-extern Void Log_2_proc();
-extern Void Log_32_proc();
-extern Void Log_33_proc();
-extern Void Log_7_proc();
-
-struct ext_proc ext_proc_table[] = {
-  "Log_0_proc", Log_0_proc,
-  "Log_16_proc", Log_16_proc,
-  "Log_17_proc", Log_17_proc,
-  "Log_1_proc", Log_1_proc,
-  "Log_2_proc", Log_2_proc,
-  "Log_32_proc", Log_32_proc,
-  "Log_33_proc", Log_33_proc,
-  "Log_7_proc", Log_7_proc,
-  NULL, NULL
-};
-
diff --git a/log/src/swap.c b/log/src/swap.c
index 5cf290f..013807c 100644
--- a/log/src/swap.c
+++ b/log/src/swap.c
@@ -1,15 +1,28 @@
+#include "swap.h"
 
-#include <stdio.h>
-#include <ctype.h>
-#include <p2c/p2c.h>
+    
+short shortsw(short sh)
+{
+    swap2 s1;
+	swap2 s2;
+    
+	s1.ival = sh;
 
-typedef union swap2 {
-        short ival;
-        unsigned char c[2];
-} swap2;
+    if (bigendian)
+    {
+        s2.c[1] = s1.c[1];
+        s2.c[0] = s1.c[0];
+    }
+    else
+    {
+        s2.c[0] = s1.c[1];
+        s2.c[1] = s1.c[0];
+    }
+    return s2.ival;
+}
 
-short getshortsw(char * c)
-  {
+short getshortsw(char *c)
+{
     swap2 s;
 
     if (bigendian)
@@ -24,33 +37,9 @@ short getshortsw(char * c)
       }
     
     return s.ival;
-  }
-     
-short shortsw(short sh)
-
-  {
-    swap2 s1,s2;
-    s1.ival = sh;
-
-    if (bigendian)
-      {
-        s2.c[1] = s1.c[1];
-        s2.c[0] = s1.c[0];
-      }
-    else
-      {
-        s2.c[0] = s1.c[1];
-        s2.c[1] = s1.c[0];
-      }
-     return s2.ival;
- }
-
-typedef union swap4 {
-        long ival;
-        unsigned char c[4];
-} swap4;
-
-long getintsw(char * c)
+}
+ 
+long getintsw(char *c)
 {
     swap4 s;
 
@@ -96,18 +85,11 @@ long intsw(long ii)
 
 short reverse(short s)
 {
-    short b = 0,i;
+    short b = 0;
+	short i;
     b = s & 0x1;
-    for (i=0;i<15;i++)
-        b = (b<<1) | ((s = s>>1)&1);
+    for (i = 0; i < 15; i++)
+        b = (b<<1) | ((s = s >> 1) & 1);
     return b;
 }
 
-
-
-
-
-
-
-
-
diff --git a/log/src/swap.h b/log/src/swap.h
index 4cb4397..8f72d5e 100644
--- a/log/src/swap.h
+++ b/log/src/swap.h
@@ -1,4 +1,3 @@
-
 #include <stdio.h>
 #include <ctype.h>
 #include <p2c/p2c.h>
@@ -21,12 +20,3 @@ extern long intsw(long ii);
 extern short reverse(short s);
 
 
-
-
-
-
-
-
-
-
-
diff --git a/log/src/tooldir.c b/log/src/tooldir.c
index c169636..c521453 100644
--- a/log/src/tooldir.c
+++ b/log/src/tooldir.c
@@ -3,75 +3,75 @@
 
 /* Do not modify this file.  It is created automatically by "munch". */
 
-extern Void Log_0_proc();
-extern Void Log_16_7seg();
-extern Void Log_16_break();
-extern Void Log_16_clock();
-extern Void Log_16_digh();
-extern Void Log_16_inst();
-extern Void Log_16_keypad();
-extern Void Log_16_ledgate();
-extern Void Log_16_ledgate2();
-extern Void Log_16_proc();
-extern Void Log_16_pulse();
-extern Void Log_16_scope();
-extern Void Log_16_switch();
-extern Void Log_17_proc();
-extern Void Log_1_proc();
-extern Void Log_2_proc();
-extern Void Log_32_proc();
-extern Void Log_33_proc();
-extern Void Log_7_ginst();
-extern Void Log_7_proc();
-extern Void Log_7_time();
-extern Void Log_capfloat_initlib_32();
-extern Void Log_DEVTECHN_initlib_32();
-extern Void Log_DEVTECHP_initlib_32();
-extern Void Log_dig_inst();
-extern Void Log_Diode1_INITLIB_32();
-extern Void Log_fwr_initlib_32();
-extern Void Log_ganglion_initlib_32();
-extern Void Log_hres_initlib_32();
-extern Void Log_hwr_initlib_32();
-extern Void Log_idiff_initlib_32();
-extern Void Log_iscope_initlib_32();
-extern Void Log_iswitch1_initlib_32();
-extern Void Log_iswitch2_initlib_32();
-extern Void Log_logntk_proc();
-extern Void Log_logspc_proc();
-extern Void Log_lplot_proc();
-extern Void Log_mmeter_initlib_32();
-extern Void Log_moscap_initlib_32();
-extern Void Log_mygates_ascdisp();
-extern Void Log_mygates_asckbd();
-extern Void Log_mygates_sram8k();
-extern Void Log_nfet4_initlib_32();
-extern Void Log_NFET5_INITLIB_32();
-extern Void Log_NFET7F_INITLIB_32();
-extern Void Log_NFET7T_INITLIB_32();
-extern Void Log_NPN1_INITLIB_32();
-extern Void Log_NPN2_INITLIB_32();
-extern Void Log_NSPC1_INITLIB_32();
-extern Void Log_numbers_initlib_32();
-extern Void Log_opamp_initlib_32();
-extern Void Log_pfet4_initlib_32();
-extern Void Log_PFET5_INITLIB_32();
-extern Void Log_PFET6_INITLIB_32();
-extern Void Log_PFET7F_INITLIB_32();
-extern Void Log_PFET7T_INITLIB_32();
-extern Void Log_PHYSICAL_initlib_32();
-extern Void Log_PNP1_INITLIB_32();
-extern Void Log_PNP2_INITLIB_32();
-extern Void Log_PSPC1_INITLIB_32();
-extern Void Log_PWL_INITLIB_32();
-extern Void Log_resfloat_initlib_32();
-extern Void Log_rtd_initlib_32();
-extern Void Log_RUNSPEC_initlib_32();
-extern Void Log_stairs_initlib_32();
-extern Void Log_THERMAL_initlib_32();
-extern Void Log_vdiff_initlib_32();
-extern Void Log_vswitch_initlib_32();
-extern Void Log_wramp_initlib_32();
+extern void Log_0_proc();
+extern void Log_16_7seg();
+extern void Log_16_break();
+extern void Log_16_clock();
+extern void Log_16_digh();
+extern void Log_16_inst();
+extern void Log_16_keypad();
+extern void Log_16_ledgate();
+extern void Log_16_ledgate2();
+extern void Log_16_proc();
+extern void Log_16_pulse();
+extern void Log_16_scope();
+extern void Log_16_switch();
+extern void Log_17_proc();
+extern void Log_1_proc();
+extern void Log_2_proc();
+extern void Log_32_proc();
+extern void Log_33_proc();
+extern void Log_7_ginst();
+extern void Log_7_proc();
+extern void Log_7_time();
+extern void Log_capfloat_initlib_32();
+extern void Log_DEVTECHN_initlib_32();
+extern void Log_DEVTECHP_initlib_32();
+extern void Log_dig_inst();
+extern void Log_Diode1_INITLIB_32();
+extern void Log_fwr_initlib_32();
+extern void Log_ganglion_initlib_32();
+extern void Log_hres_initlib_32();
+extern void Log_hwr_initlib_32();
+extern void Log_idiff_initlib_32();
+extern void Log_iscope_initlib_32();
+extern void Log_iswitch1_initlib_32();
+extern void Log_iswitch2_initlib_32();
+extern void Log_logntk_proc();
+extern void Log_logspc_proc();
+extern void Log_lplot_proc();
+extern void Log_mmeter_initlib_32();
+extern void Log_moscap_initlib_32();
+extern void Log_mygates_ascdisp();
+extern void Log_mygates_asckbd();
+extern void Log_mygates_sram8k();
+extern void Log_nfet4_initlib_32();
+extern void Log_NFET5_INITLIB_32();
+extern void Log_NFET7F_INITLIB_32();
+extern void Log_NFET7T_INITLIB_32();
+extern void Log_NPN1_INITLIB_32();
+extern void Log_NPN2_INITLIB_32();
+extern void Log_NSPC1_INITLIB_32();
+extern void Log_numbers_initlib_32();
+extern void Log_opamp_initlib_32();
+extern void Log_pfet4_initlib_32();
+extern void Log_PFET5_INITLIB_32();
+extern void Log_PFET6_INITLIB_32();
+extern void Log_PFET7F_INITLIB_32();
+extern void Log_PFET7T_INITLIB_32();
+extern void Log_PHYSICAL_initlib_32();
+extern void Log_PNP1_INITLIB_32();
+extern void Log_PNP2_INITLIB_32();
+extern void Log_PSPC1_INITLIB_32();
+extern void Log_PWL_INITLIB_32();
+extern void Log_resfloat_initlib_32();
+extern void Log_rtd_initlib_32();
+extern void Log_RUNSPEC_initlib_32();
+extern void Log_stairs_initlib_32();
+extern void Log_THERMAL_initlib_32();
+extern void Log_vdiff_initlib_32();
+extern void Log_vswitch_initlib_32();
+extern void Log_wramp_initlib_32();
 
 struct ext_proc ext_proc_table[] = {
   "Log_0_proc", Log_0_proc,
diff --git a/log/src/tooldir.os2 b/log/src/tooldir.os2
deleted file mode 100644
index 54b9794..0000000
--- a/log/src/tooldir.os2
+++ /dev/null
@@ -1,142 +0,0 @@
-#include <p2c/p2c.h>
-#include "logstuff.h"
-
-/* Do not modify this file.  It is created automatically by "munch". */
-
-extern Void Log_0_proc();
-extern Void Log_16_7seg();
-extern Void Log_16_break();
-extern Void Log_16_clock();
-extern Void Log_16_digh();
-extern Void Log_16_inst();
-extern Void Log_16_keypad();
-extern Void Log_16_ledgate();
-extern Void Log_16_ledgate2();
-extern Void Log_16_proc();
-extern Void Log_16_pulse();
-extern Void Log_16_scope();
-extern Void Log_16_switch();
-extern Void Log_17_proc();
-extern Void Log_1_proc();
-extern Void Log_2_proc();
-extern Void Log_32_proc();
-extern Void Log_33_proc();
-extern Void Log_7_proc();
-extern Void Log_7_time();
-extern Void Log_DEVTECHN_initlib_32();
-extern Void Log_DEVTECHP_initlib_32();
-extern Void Log_Diode1_INITLIB_32();
-extern Void Log_NFET5_INITLIB_32();
-extern Void Log_NFET7F_INITLIB_32();
-extern Void Log_NFET7T_INITLIB_32();
-extern Void Log_NPN1_INITLIB_32();
-extern Void Log_NSPC1_INITLIB_32();
-extern Void Log_PFET5_INITLIB_32();
-extern Void Log_PFET6_INITLIB_32();
-extern Void Log_PFET7F_INITLIB_32();
-extern Void Log_PFET7T_INITLIB_32();
-extern Void Log_PHYSICAL_initlib_32();
-extern Void Log_PNP1_INITLIB_32();
-extern Void Log_PSPC1_INITLIB_32();
-extern Void Log_PWL_INITLIB_32();
-extern Void Log_RUNSPEC_initlib_32();
-extern Void Log_THERMAL_initlib_32();
-extern Void Log_capfloat_initlib_32();
-extern Void Log_dig_inst();
-extern Void Log_fwr_initlib_32();
-extern Void Log_ganglion_initlib_32();
-extern Void Log_hres_initlib_32();
-extern Void Log_hwr_initlib_32();
-extern Void Log_idiff_initlib_32();
-extern Void Log_iscope_initlib_32();
-extern Void Log_iswitch1_initlib_32();
-extern Void Log_iswitch2_initlib_32();
-extern Void Log_logntk_proc();
-extern Void Log_logspc_proc();
-extern Void Log_lplot_proc();
-extern Void Log_mmeter_initlib_32();
-extern Void Log_moscap_initlib_32();
-extern Void Log_mygates_ascdisp();
-extern Void Log_mygates_asckbd();
-extern Void Log_mygates_sram8k();
-extern Void Log_nfet4_initlib_32();
-extern Void Log_numbers_initlib_32();
-extern Void Log_opamp_initlib_32();
-extern Void Log_pfet4_initlib_32();
-extern Void Log_resfloat_initlib_32();
-extern Void Log_rtd_initlib_32();
-extern Void Log_stairs_initlib_32();
-extern Void Log_vdiff_initlib_32();
-extern Void Log_vswitch_initlib_32();
-extern Void Log_wramp_initlib_32();
-
-struct ext_proc ext_proc_table[] = {
-  "Log_0_proc", Log_0_proc,
-  "Log_16_7seg", Log_16_7seg,
-  "Log_16_break", Log_16_break,
-  "Log_16_clock", Log_16_clock,
-  "Log_16_digh", Log_16_digh,
-  "Log_16_inst", Log_16_inst,
-  "Log_16_keypad", Log_16_keypad,
-  "Log_16_ledgate", Log_16_ledgate,
-  "Log_16_ledgate2", Log_16_ledgate2,
-  "Log_16_proc", Log_16_proc,
-  "Log_16_pulse", Log_16_pulse,
-  "Log_16_scope", Log_16_scope,
-  "Log_16_switch", Log_16_switch,
-  "Log_17_proc", Log_17_proc,
-  "Log_1_proc", Log_1_proc,
-  "Log_2_proc", Log_2_proc,
-  "Log_32_proc", Log_32_proc,
-  "Log_33_proc", Log_33_proc,
-  "Log_7_proc", Log_7_proc,
-  "Log_7_time", Log_7_time,
-  "Log_DEVTECHN_initlib_32", Log_DEVTECHN_initlib_32,
-  "Log_DEVTECHP_initlib_32", Log_DEVTECHP_initlib_32,
-  "Log_Diode1_INITLIB_32", Log_Diode1_INITLIB_32,
-  "Log_NFET5_INITLIB_32", Log_NFET5_INITLIB_32,
-  "Log_NFET7F_INITLIB_32", Log_NFET7F_INITLIB_32,
-  "Log_NFET7T_INITLIB_32", Log_NFET7T_INITLIB_32,
-  "Log_NPN1_INITLIB_32", Log_NPN1_INITLIB_32,
-  "Log_NSPC1_INITLIB_32", Log_NSPC1_INITLIB_32,
-  "Log_PFET5_INITLIB_32", Log_PFET5_INITLIB_32,
-  "Log_PFET6_INITLIB_32", Log_PFET6_INITLIB_32,
-  "Log_PFET7F_INITLIB_32", Log_PFET7F_INITLIB_32,
-  "Log_PFET7T_INITLIB_32", Log_PFET7T_INITLIB_32,
-  "Log_PHYSICAL_initlib_32", Log_PHYSICAL_initlib_32,
-  "Log_PNP1_INITLIB_32", Log_PNP1_INITLIB_32,
-  "Log_PSPC1_INITLIB_32", Log_PSPC1_INITLIB_32,
-  "Log_PWL_INITLIB_32", Log_PWL_INITLIB_32,
-  "Log_RUNSPEC_initlib_32", Log_RUNSPEC_initlib_32,
-  "Log_THERMAL_initlib_32", Log_THERMAL_initlib_32,
-  "Log_capfloat_initlib_32", Log_capfloat_initlib_32,
-  "Log_dig_inst", Log_dig_inst,
-  "Log_fwr_initlib_32", Log_fwr_initlib_32,
-  "Log_ganglion_initlib_32", Log_ganglion_initlib_32,
-  "Log_hres_initlib_32", Log_hres_initlib_32,
-  "Log_hwr_initlib_32", Log_hwr_initlib_32,
-  "Log_idiff_initlib_32", Log_idiff_initlib_32,
-  "Log_iscope_initlib_32", Log_iscope_initlib_32,
-  "Log_iswitch1_initlib_32", Log_iswitch1_initlib_32,
-  "Log_iswitch2_initlib_32", Log_iswitch2_initlib_32,
-  "Log_logntk_proc", Log_logntk_proc,
-  "Log_logspc_proc", Log_logspc_proc,
-  "Log_lplot_proc", Log_lplot_proc,
-  "Log_mmeter_initlib_32", Log_mmeter_initlib_32,
-  "Log_moscap_initlib_32", Log_moscap_initlib_32,
-  "Log_mygates_ascdisp", Log_mygates_ascdisp,
-  "Log_mygates_asckbd", Log_mygates_asckbd,
-  "Log_mygates_sram8k", Log_mygates_sram8k,
-  "Log_nfet4_initlib_32", Log_nfet4_initlib_32,
-  "Log_numbers_initlib_32", Log_numbers_initlib_32,
-  "Log_opamp_initlib_32", Log_opamp_initlib_32,
-  "Log_pfet4_initlib_32", Log_pfet4_initlib_32,
-  "Log_resfloat_initlib_32", Log_resfloat_initlib_32,
-  "Log_rtd_initlib_32", Log_rtd_initlib_32,
-  "Log_stairs_initlib_32", Log_stairs_initlib_32,
-  "Log_vdiff_initlib_32", Log_vdiff_initlib_32,
-  "Log_vswitch_initlib_32", Log_vswitch_initlib_32,
-  "Log_wramp_initlib_32", Log_wramp_initlib_32,
-  NULL, NULL
-};
-
diff --git a/psys/include/p2c/asm.h b/psys/include/p2c/asm.h
deleted file mode 100644
index 704f179..0000000
--- a/psys/include/p2c/asm.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Header for module asm, generated by p2c */
-#ifndef ASM_H
-#define ASM_H
-
-
-
-#ifndef SYSGLOBALS_H
-#include <p2c/sysglobals.h>
-#endif
-
-
-
-#ifdef ASM_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
-
-extern Void asm_moveleft PP((long *s, long *d, long z));
-extern Void asm_moveright PP((long *s, long *d, long z));
-extern Void asm_fastmove PP((Anyptr s, Anyptr d, long z));
-extern Void asm_newbytes PP((Anyptr *p, long z));
-extern Void asm_powerup PV();
-extern Void asm_errmsg PV();
-extern Void asm_findroms PV();
-extern Void asm_f_pwr_on PV();
-extern Void asm_flpyread PP((long sector, long *buffer));
-extern Void asm_flpy_wrt PP((long sector, long *buffer));
-extern Void asm_flpymread PP((long sector_count, long sector, long *buffer));
-extern Void asm_flpymwrite PP((long sector_count, long sector, long *buffer));
-extern Void asm_flpyinit PP((Anyptr ptr, int i));
-extern Void asm_setintlevel PP((long level));
-extern long asm_intlevel PV();
-extern Void asm_newwords PP((Anyptr *p, long wordsize));
-extern Void asm_userprogram PP((long execloc, long initsp));
-extern Void asm_sappend PP((Char *dest, int MAX_dest, Char *src));
-extern long asm_iand PP((long a, long b));
-extern long asm_ior PP((long a, long b));
-extern Void asm_ci_switch PV();
-extern Void asm_initvects PV();
-extern Void asm_cpymsg PP((Char *msg));
-#define asm_memavail()        10000000
-/*  extern long asm_memavail PV();  */
-extern long asm_ticker PV();
-extern Void asm_cache_on PV();
-extern Void asm_cache_off PV();
-extern Void asm_icache_off PV();
-extern Void asm_icache_on PV();
-extern Void asm_flush_icache PV();
-
-
-
-#undef vextern
-
-#endif /*ASM_H*/
-
-/* End. */
-
diff --git a/psys/include/p2c/citinfomod.h b/psys/include/p2c/citinfomod.h
index a469035..ceeed4a 100644
--- a/psys/include/p2c/citinfomod.h
+++ b/psys/include/p2c/citinfomod.h
@@ -1,13 +1,7 @@
-/* Header for module citinfomod, generated by p2c */
 #ifndef CITINFOMOD_H
 #define CITINFOMOD_H
 
-
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
 
 
 #ifdef CITINFOMOD_G
@@ -17,25 +11,22 @@
 #endif
 
 
-
 #define P_citStandAlone 0
 #define P_citCS10Land   1
 #define P_citCES        2
 #define P_citWatson     3
 
 
-
 typedef struct P_citinforec {
-    Char username[31];
-    Char homepath[fidleng + 1];
+    char username[31];
+    char homepath[fidleng + 1];
     datetimerec loginat;
     short node, userid, groupid;
-    Char machine[20];
-    boolean novice;
+    char machine[20];
+    int novice;
 } P_citinforec;
 
 
-
 vextern P_citinforec *P_citinfo;
 vextern _PROCEDURE P_changeCitInfoHook;
 vextern long P_citSystem;
diff --git a/psys/include/p2c/filepack.h b/psys/include/p2c/filepack.h
index f546c02..d6c01f1 100644
--- a/psys/include/p2c/filepack.h
+++ b/psys/include/p2c/filepack.h
@@ -1,19 +1,11 @@
-/* Header for module filepack, generated by p2c */
 #ifndef FILEPACK_H
 #define FILEPACK_H
 
-
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
 
 /*homeless orphans*/
 
-#ifndef MISC_H
 #include <p2c/misc.h>
-#endif
-
 
 
 #ifdef FILEPACK_G
@@ -23,8 +15,7 @@
 #endif
 
 
-
-typedef Char fp_volumearray[50][26];
+typedef char fp_volumearray[50][26];
 
 typedef enum {
     fp_keepit, fp_purgeit
@@ -34,49 +25,49 @@ typedef misc_passentry fp_passarray[201];
 
 
 
-extern Void fp_volumes PP((Char **v));
-extern Void fp_filecopy PP((Char *filename1, Char *filename2, int writeover));
-extern Void fp_filecopy2 PP((Char *filename1, Char *filename2, int writeover,
-			     int saveDate));
-extern Void fp_duplicate PP((Char *filename1, Char *filename2, int purgeold));
-extern Void fp_change PP((Char *filename1, Char *filename2));
-extern Void fp_makefile PP((Char *filename));
-extern Void fp_makedir PP((Char *filename));
-extern Void fp_remove PP((Char *filename));
-extern Void fp_prefix PP((Char *filename, int unitonly, int sysvol));
-extern boolean fp_getwd PP((Char *path, Char *rootname));
-extern boolean fp_f_readable PP((Char *filename));
-extern boolean fp_f_exists PP((Char *filename));
-extern Void fp_f_flush PP((fib *outfib));
-extern Void fp_stat PP((Char *path, misc_catentry *cat));
-extern Void fp_fstat PP((fib *f, misc_catentry *cat));
-extern Void fp_setFileTimes PP((Char *fn, int set_access, int set_create,
-				misc_catentry *cat));
-extern Void fp_fSetFileTimes PP((fib *f, int set_access, int set_create,
-				 misc_catentry *cat));
-extern Void fp_open_parentdir PP((fib *dirfib, Char *dirname,
-				  misc_catentry *dirinfo));
-extern Void fp_open_dir PP((fib *dirfib, Char *dirname,
-			    misc_catentry *dirinfo));
-extern Void fp_open_dir0 PP((fib *dirfib, Char *dirname,
-			     misc_catentry *dirinfo));
-extern Void fp_close_dir PP((fib *dfib));
-extern Void fp_cat_dir PP((fib *dfib, short *numfiles, Anyptr *where));
-extern Void fp_close_pass PP((fib *pfib));
-extern Void fp_open_pass PP((fib *pfib, Char *fname, misc_passentry **owords));
-extern Void fp_cat_pass PP((fib *pfib, short *numpass, misc_passentry *pwords));
-extern Void fp_add_pass PP((fib *pfib, misc_passentry *entry_));
-extern Void fp_bits_to_words PP((long b, misc_passentry *ow, Char *s));
-extern Void fp_words_to_bits PP((Char *s, misc_passentry *ow, long *b));
-extern Void fp_iocheck PV();
-extern Void fp_badio PP((int iocode));
-extern Void fp_setup_fib PP((Char *filename, fib *lfib, int needdirec));
-extern Void fp_openinfile PP((fib *infib, Char *filename));
-extern Void fp_openoutfile PP((fib *outfib, Char *filename));
-extern Void fp_closeinfile PP((fib *infib));
-extern Void fp_closeoutfile PP((fib *outfib, int option));
-extern long fp_uwrite PP((fib *f, Char *buffer, long request));
-extern long fp_uread PP((fib *f, Char *buffer, long request));
+extern void fp_volumes (char **v);
+extern void fp_filecopy (char *filename1, char *filename2, int writeover);
+extern void fp_filecopy2 (char *filename1, char *filename2, int writeover,
+			     int saveDate);
+extern void fp_duplicate (char *filename1, char *filename2, int purgeold);
+extern void fp_change (char *filename1, char *filename2);
+extern void fp_makefile (char *filename);
+extern void fp_makedir (char *filename);
+extern void fp_remove (char *filename);
+extern void fp_prefix (char *filename, int unitonly, int sysvol);
+extern int fp_getwd (char *path, char *rootname);
+extern int fp_f_readable (char *filename);
+extern int fp_f_exists (char *filename);
+extern void fp_f_flush (fib *outfib);
+extern void fp_stat (char *path, misc_catentry *cat);
+extern void fp_fstat (fib *f, misc_catentry *cat);
+extern void fp_setFileTimes (char *fn, int set_access, int set_create,
+				misc_catentry *cat);
+extern void fp_fSetFileTimes (fib *f, int set_access, int set_create,
+				 misc_catentry *cat);
+extern void fp_open_parentdir (fib *dirfib, char *dirname,
+				  misc_catentry *dirinfo);
+extern void fp_open_dir (fib *dirfib, char *dirname,
+			    misc_catentry *dirinfo);
+extern void fp_open_dir0 (fib *dirfib, char *dirname,
+			     misc_catentry *dirinfo);
+extern void fp_close_dir (fib *dfib);
+extern void fp_cat_dir (fib *dfib, short *numfiles, void* *where);
+extern void fp_close_pass (fib *pfib);
+extern void fp_open_pass (fib *pfib, char *fname, misc_passentry **owords);
+extern void fp_cat_pass (fib *pfib, short *numpass, misc_passentry *pwords);
+extern void fp_add_pass (fib *pfib, misc_passentry *entry_);
+extern void fp_bits_to_words (long b, misc_passentry *ow, char *s);
+extern void fp_words_to_bits (char *s, misc_passentry *ow, long *b);
+extern void fp_iocheck ();
+extern void fp_badio (int iocode);
+extern void fp_setup_fib (char *filename, fib *lfib, int needdirec);
+extern void fp_openinfile (fib *infib, char *filename);
+extern void fp_openoutfile (fib *outfib, char *filename);
+extern void fp_closeinfile (fib *infib);
+extern void fp_closeoutfile (fib *outfib, int option);
+extern long fp_uwrite (fib *f, char *buffer, long request);
+extern long fp_uread (fib *f, char *buffer, long request);
 
 
 
diff --git a/psys/include/p2c/fs.h b/psys/include/p2c/fs.h
index 05462dc..242291b 100644
--- a/psys/include/p2c/fs.h
+++ b/psys/include/p2c/fs.h
@@ -1,30 +1,10 @@
-/* Header for module fs, generated by p2c */
 #ifndef FS_H
 #define FS_H
 
 
-
 /*file support*/
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef ASM_H
-#include <p2c/asm.h>
-#endif
-
-#ifndef MISC_H
 #include <p2c/misc.h>
-#endif
-
-
-
-#ifdef FS_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
 
 
 typedef enum {
@@ -38,89 +18,82 @@ typedef enum {
 typedef union fs_vptr {
     long j;
     short *i;
-    Char *s;
+    char *s;
 } fs_vptr;
 
 
 
-extern Void fs_fstripname PP((Char *s, Char *pvname, Char *ppath,
-			      Char *pfname));
-extern Void fs_fixname PP((Char *title, int kind));
-extern Void fs_zapspaces PP((Char *s));
-extern filekind fs_suffix PP((Char *ftitle));
-extern boolean fs_scantitle PP((Char *fname, Char *fvid, Char *ftitle,
-				long *fsegs, filekind *fkind));
-extern char fs_findvolume PP((Char *fvid, int verify));
-extern Void fs_doprefix PP((Char *dirname, Char *kvid, long *kunit,
-			    int findunit));
-extern Void fs_finitb PP((fib *f, Char *window_, long recbytes));
-extern Void fs_fhpopen PP((fib *f, int typ, Char *title, Char *option));
-extern Void fs_fhpreset PP((fib *f, int typ));
-extern Void fs_fcloseit PP((fib *f, Char *stype));
-extern Void fs_fclose PP((fib *f, int ftype));
-extern Void fs_fmaketype PP((fib *f, Char *title, Char *option,
-			     Char *typestring));
-extern Void fs_foverfile PP((fib *f, Char *title, Char *option,
-			     Char *typestring));
-extern Void fs_fanonfile PP((fib *f, Char *name, int kind, long size));
-extern Void fs_fseek PP((fib *f, long position));
-extern long fs_fposition PP((fib *f));
-extern long fs_fmaxpos PP((fib *f));
-extern Char *fs_fbufferref PP((fib *f));
-extern Void fs_fget PP((fib *f));
-extern Void fs_fput PP((fib *f));
-extern boolean fs_feof PP((fib *f));
-extern boolean fs_feoln PP((fib *f));
-extern Void fs_fwriteln PP((fib *f));
-extern Void fs_fread PP((fib *f, Char *buf));
-extern Void fs_fwrite PP((fib *f, Char *buf));
-extern Void fs_freadbytes PP((fib *f, Char *buf, long size));
-extern Void fs_fwritebytes PP((fib *f, Char *buf, long size));
-extern long fs_fblockio PP((fib *f, Char *buf, long nblocks, long rblock,
-			    int doread));
-extern Void fs_killchar PP((fib *f, long *sinx));
-extern Void fs_fpage PP((FILE *t));
-extern Void fs_foverprint PP((FILE *t));
-extern Void fs_fgotoxy PP((fib *f, long x, long y));
-extern Void fs_fgetxy PP((fib *f, long *x, long *y));
-extern Void fs_freadln PP((FILE *t));
-extern Void fs_fwritechar PP((FILE *t, int ch, int rleng));
-extern Void fs_freadchar PP((FILE *t, Char *ch));
-extern Void fs_freadword PP((FILE *t, short *i));
-extern Void fs_freadint PP((FILE *t, long *i));
-extern Void fs_fwriteword PP((FILE *t, int i, int rleng));
-extern Void fs_fwriteint PP((FILE *t, long i, int rleng));
-extern Void fs_fwritestr PP((FILE *t, Char *s, int rleng));
-extern Void fs_freadstr PP((FILE *t, Char *s));
-extern Void fs_fwritepaoc PP((FILE *t, Char *a, int aleng, int rleng));
-extern Void fs_freadpaoc PP((FILE *t, Char *a, int aleng));
-extern Void fs_freadenum PP((FILE *t, short *i, fs_vptr p));
-extern Void fs_fwriteenum PP((FILE *t, int i, int rleng, fs_vptr p));
-extern Void fs_freadbool PP((FILE *t, boolean *b));
-extern Void fs_fwritebool PP((FILE *t, int b, int rleng));
-extern Void fs_freadstrchar PP((Char *s, long *p2, Char *ch));
-extern Void fs_fwritestrchar PP((Char *s, long *p2, int ch, int rleng));
-extern Void fs_freadstrword PP((Char *s, long *p2, short *i));
-
-/*PROCEDURE FREADSTRINT (VAR S: STRING255;VAR P2,I: INTEGER);*/
-extern Void fs_fwritestrword PP((Char *s, long *p2, int i, int rleng));
-
-/*PROCEDURE FWRITESTRINT(VAR T: STRING; */
-/*                                VAR P2: INTEGER; I: INTEGER; RLENG: SHORTINT); */
-extern Void fs_freadstrstr PP((Char *t, long *p2, Char *s));
-extern Void fs_fwritestrstr PP((Char *s, long *p2, Char *t, int rleng));
-extern Void fs_fwritestrpaoc PP((Char *s, long *p2, Char *a, int aleng,
-				 int rleng));
-extern Void fs_freadstrpaoc PP((Char *s, long *p2, Char *a, int aleng));
-extern Void fs_freadstrenum PP((Char *s, long *p2, short *i, fs_vptr p));
-extern Void fs_fwritestrenum PP((Char *s, long *p2, int i, int rleng,
-				 fs_vptr p));
-extern Void fs_freadstrbool PP((Char *s, long *p2, boolean *b));
-extern Void fs_fwritestrbool PP((Char *s, long *p2, int b, int rleng));
-
-
-
-#undef vextern
+extern void fs_fstripname (char *s, char *pvname, char *ppath,
+			      char *pfname);
+extern void fs_fixname (char *title, int kind);
+extern void fs_remove_spaces (char *s);
+extern filekind fs_suffix (char *ftitle);
+extern int fs_scantitle (char *fname, char *fvid, char *ftitle,
+				long *fsegs, filekind *fkind);
+extern char fs_findvolume (char *fvid, int verify);
+extern void fs_doprefix (char *dirname, char *kvid, long *kunit,
+			    int findunit);
+extern void fs_finitb (fib *f, char *window_, long recbytes);
+extern void fs_fhpopen (fib *f, int typ, char *title, char *option);
+extern void fs_fhpreset (fib *f, int typ);
+extern void fs_fcloseit (fib *f, char *stype);
+extern void fs_fclose (fib *f, int ftype);
+extern void fs_fmaketype (fib *f, char *title, char *option,
+			     char *typestring);
+extern void fs_foverfile (fib *f, char *title, char *option,
+			     char *typestring);
+extern void fs_fanonfile (fib *f, char *name, int kind, long size);
+extern void fs_fseek (fib *f, long position);
+extern long fs_fposition (fib *f);
+extern long fs_fmaxpos (fib *f);
+extern char *fs_fbufferref (fib *f);
+extern void fs_fget (fib *f);
+extern void fs_fput (fib *f);
+extern int fs_feof (fib *f);
+extern int fs_feoln (fib *f);
+extern void fs_fwriteln (fib *f);
+extern void fs_fread (fib *f, char *buf);
+extern void fs_fwrite (fib *f, char *buf);
+extern void fs_freadbytes (fib *f, char *buf, long size);
+extern void fs_fwritebytes (fib *f, char *buf, long size);
+extern long fs_fblockio (fib *f, char *buf, long nblocks, long rblock,
+			    int doread);
+extern void fs_killchar (fib *f, long *sinx);
+extern void fs_fpage (FILE *t);
+extern void fs_foverprint (FILE *t);
+extern void fs_fgotoxy (fib *f, long x, long y);
+extern void fs_fgetxy (fib *f, long *x, long *y);
+extern void fs_freadln (FILE *t);
+extern void fs_fwritechar (FILE *t, int ch, int rleng);
+extern void fs_freadchar (FILE *t, char *ch);
+extern void fs_freadword (FILE *t, short *i);
+extern void fs_freadint (FILE *t, long *i);
+extern void fs_fwriteword (FILE *t, int i, int rleng);
+extern void fs_fwriteint (FILE *t, long i, int rleng);
+extern void fs_fwritestr (FILE *t, char *s, int rleng);
+extern void fs_freadstr (FILE *t, char *s);
+extern void fs_fwritepaoc (FILE *t, char *a, int aleng, int rleng);
+extern void fs_freadpaoc (FILE *t, char *a, int aleng);
+extern void fs_freadenum (FILE *t, short *i, fs_vptr p);
+extern void fs_fwriteenum (FILE *t, int i, int rleng, fs_vptr p);
+extern void fs_freadbool (FILE *t, int *b);
+extern void fs_fwritebool (FILE *t, int b, int rleng);
+extern void fs_freadstrchar (char *s, long *p2, char *ch);
+extern void fs_fwritestrchar (char *s, long *p2, int ch, int rleng);
+extern void fs_freadstrword (char *s, long *p2, short *i);
+
+extern void fs_fwritestrword (char *s, long *p2, int i, int rleng);
+
+extern void fs_freadstrstr (char *t, long *p2, char *s);
+extern void fs_fwritestrstr (char *s, long *p2, char *t, int rleng);
+extern void fs_fwritestrpaoc (char *s, long *p2, char *a, int aleng,
+				 int rleng);
+extern void fs_freadstrpaoc (char *s, long *p2, char *a, int aleng);
+extern void fs_freadstrenum (char *s, long *p2, short *i, fs_vptr p);
+extern void fs_fwritestrenum (char *s, long *p2, int i, int rleng,
+				 fs_vptr p);
+extern void fs_freadstrbool (char *s, long *p2, int *b);
+extern void fs_fwritestrbool (char *s, long *p2, int b, int rleng);
 
 #endif /*FS_H*/
 
diff --git a/psys/include/p2c/general_0.h b/psys/include/p2c/general_0.h
index c7652d2..29e6839 100644
--- a/psys/include/p2c/general_0.h
+++ b/psys/include/p2c/general_0.h
@@ -1,13 +1,7 @@
-/* Header for module GENERAL_0, generated by p2c */
 #ifndef GENERAL_0_H
 #define GENERAL_0_H
 
-
-
-#ifndef IODECLARATIONS_H
 #include <p2c/iodecl.h>
-#endif
-
 
 
 #ifdef GENERAL_0_G
@@ -17,23 +11,16 @@
 #endif
 
 
-
 vextern drv_table_type kbd_crt_drivers, dummy_drivers;
 
-
-
-extern short ioread_word PP((int select_code, int register_));
-extern Void iowrite_word PP((int select_code, int register_, int value));
-extern uchar ioread_byte PP((int select_code, int register_));
-extern Void iowrite_byte PP((int select_code, int register_, int value));
-extern short P_iostatus PP((int select_code, int register_));
-extern Void P_iocontrol PP((int select_code, int register_, int value));
-extern Void kernel_initialize PV( );
-extern Void io_system_reset PV( );
-
-
-
-#undef vextern
+extern short ioread_word (int select_code, int register_);
+extern void iowrite_word (int select_code, int register_, int value);
+extern uchar ioread_byte (int select_code, int register_);
+extern void iowrite_byte (int select_code, int register_, int value);
+extern short P_iostatus (int select_code, int register_);
+extern void P_iocontrol (int select_code, int register_, int value);
+extern void kernel_initialize ( );
+extern void io_system_reset ( );
 
 #endif /*GENERAL_0_H*/
 
diff --git a/psys/include/p2c/general_1.h b/psys/include/p2c/general_1.h
index 47a092a..13d13a4 100644
--- a/psys/include/p2c/general_1.h
+++ b/psys/include/p2c/general_1.h
@@ -1,32 +1,19 @@
-/* Header for module GENERAL_1, generated by p2c */
 #ifndef GENERAL_1_H
 #define GENERAL_1_H
 
 
-
-#ifndef IODECLARATIONS_H
 #include <p2c/iodecl.h>
-#endif
-
-
-
-#ifdef GENERAL_1_G
-# define vextern
-#else
-# define vextern extern
-#endif
-extern Void P_ioinitialize PV();
-extern Void P_iouninitialize PV();
-extern Void P_ioreset PP((int select_code));
-extern Void P_readchar PP((int select_code, Char *value));
-extern Void P_writechar PP((int select_code, int value));
-extern Void P_readword PP((int select_code, long *num));
-extern Void P_writeword PP((int select_code, long value));
-extern Void set_timeout PP((int select_code, double time));
 
 
+extern void P_ioinitialize ();
+extern void P_iouninitialize ();
+extern void P_ioreset (int select_code);
+extern void P_readchar (int select_code, char *value);
+extern void P_writechar (int select_code, int value);
+extern void P_readword (int select_code, long *num);
+extern void P_writeword (int select_code, long value);
+extern void set_timeout (int select_code, double time);
 
-#undef vextern
 
 #endif /*GENERAL_1_H*/
 
diff --git a/psys/include/p2c/general_2.h b/psys/include/p2c/general_2.h
index 871ddf3..9fc46a1 100644
--- a/psys/include/p2c/general_2.h
+++ b/psys/include/p2c/general_2.h
@@ -1,34 +1,20 @@
-/* Header for module GENERAL_2, generated by p2c */
 #ifndef GENERAL_2_H
 #define GENERAL_2_H
 
 
-
-#ifndef IODECLARATIONS_H
 #include <p2c/iodecl.h>
-#endif
-
-
-
-#ifdef GENERAL_2_G
-# define vextern
-#else
-# define vextern extern
-#endif
-extern Void P_readnumber PP((long device, double *num));
-extern Void P_writenumber PP((long device, double value));
-extern Void P_readstring PP((long device, Char *str));
-extern Void readstring_until PP((int term, long device, Char *str));
-extern Void P_writestring PP((long device, Char *str));
-extern Void P_readnumberln PP((long device, double *num));
-extern Void P_writenumberln PP((long device, double value));
-extern Void P_writestringln PP((long device, Char *str));
-extern Void P_readuntil PP((int term, long device));
-extern Void P_skipfor PP((long count, long device));
-
 
+extern void P_readnumber (long device, double *num);
+extern void P_writenumber (long device, double value);
+extern void P_readstring (long device, char *str);
+extern void readstring_until (int term, long device, char *str);
+extern void P_writestring (long device, char *str);
+extern void P_readnumberln (long device, double *num);
+extern void P_writenumberln (long device, double value);
+extern void P_writestringln (long device, char *str);
+extern void P_readuntil (int term, long device);
+extern void P_skipfor (long count, long device);
 
-#undef vextern
 
 #endif /*GENERAL_2_H*/
 
diff --git a/psys/include/p2c/general_3.h b/psys/include/p2c/general_3.h
index b498975..3041844 100644
--- a/psys/include/p2c/general_3.h
+++ b/psys/include/p2c/general_3.h
@@ -1,25 +1,10 @@
-/* Header for module GENERAL_3, generated by p2c */
 #ifndef GENERAL_3_H
 #define GENERAL_3_H
 
 
-
-#ifndef IODECLARATIONS_H
 #include <p2c/iodecl.h>
-#endif
-
-
-
-#ifdef GENERAL_3_G
-# define vextern
-#else
-# define vextern extern
-#endif
-extern Char *ioerror_message PP((Char *P_Result, long ioerror));
-
-
 
-#undef vextern
+extern char *ioerror_message (char *P_Result, long ioerror);
 
 #endif /*GENERAL_3_H*/
 
diff --git a/psys/include/p2c/hpib_0.h b/psys/include/p2c/hpib_0.h
index e1d6ed0..45da568 100644
--- a/psys/include/p2c/hpib_0.h
+++ b/psys/include/p2c/hpib_0.h
@@ -1,4 +1,3 @@
-/* Header for module hpib_0, generated by p2c */
 #ifndef HPIB_0_H
 #define HPIB_0_H
 
@@ -12,25 +11,12 @@
 /*                  */
 /*         */
 
-#ifndef IODECLARATIONS_H
 #include <p2c/iodecl.h>
-#endif
+extern void set_hpib (int select_code, int line);
+extern void clear_hpib (int select_code, int line);
+extern int hpib_line (int select_code, int line);
 
 
-
-#ifdef HPIB_0_G
-# define vextern
-#else
-# define vextern extern
-#endif
-extern Void set_hpib PP((int select_code, int line));
-extern Void clear_hpib PP((int select_code, int line));
-extern boolean hpib_line PP((int select_code, int line));
-
-
-
-#undef vextern
-
 #endif /*HPIB_0_H*/
 
 /* End. */
diff --git a/psys/include/p2c/hpib_1.h b/psys/include/p2c/hpib_1.h
index f045016..52672d6 100644
--- a/psys/include/p2c/hpib_1.h
+++ b/psys/include/p2c/hpib_1.h
@@ -1,4 +1,3 @@
-/* Header for module hpib_1, generated by p2c */
 #ifndef HPIB_1_H
 #define HPIB_1_H
 
@@ -12,31 +11,21 @@
 /*                  */
 /*         */
 
-#ifndef IODECLARATIONS_H
 #include <p2c/iodecl.h>
-#endif
 
 
+extern void send_command (int select_code, int command);
+extern char my_address (int select_code);
+extern int active_controller (int select_code);
+extern int system_controller (int select_code);
+extern char addr_to_talk (long device);
+extern char addr_to_listen (long device);
+extern char set_to_talk (long device);
+extern char set_to_listen (long device);
+extern int end_set (int select_code);
 
-#ifdef HPIB_1_G
-# define vextern
-#else
-# define vextern extern
-#endif
-extern Void send_command PP((int select_code, int command));
-extern char my_address PP((int select_code));
-extern boolean active_controller PP((int select_code));
-extern boolean system_controller PP((int select_code));
-extern char addr_to_talk PP((long device));
-extern char addr_to_listen PP((long device));
-extern char set_to_talk PP((long device));
-extern char set_to_listen PP((long device));
-extern boolean end_set PP((int select_code));
 
 
-
-#undef vextern
-
 #endif /*HPIB_1_H*/
 
 /* End. */
diff --git a/psys/include/p2c/hpib_2.h b/psys/include/p2c/hpib_2.h
index 4353179..08df508 100644
--- a/psys/include/p2c/hpib_2.h
+++ b/psys/include/p2c/hpib_2.h
@@ -1,4 +1,3 @@
-/* Header for module hpib_2, generated by p2c */
 #ifndef HPIB_2_H
 #define HPIB_2_H
 
@@ -13,35 +12,24 @@
 /*                  */
 /*         */
 
-#ifndef IODECLARATIONS_H
 #include <p2c/iodecl.h>
-#endif
 
 
+extern void abort_hpib (int select_code);
+extern void P_clear (long device);
+extern void P_listen (int select_code, int address);
+extern void P_local (long device);
+extern void local_lockout (int select_code);
+extern void pass_control (long device);
+extern void ppoll_configure (long device, long mask);
+extern void ppoll_unconfigure (long device);
+extern void P_remote (long device);
+extern void P_secondary (int select_code, int address);
+extern void P_talk (int select_code, int address);
+extern void P_trigger (long device);
+extern void P_unlisten (int select_code);
+extern void P_untalk (int select_code);
 
-#ifdef HPIB_2_G
-# define vextern
-#else
-# define vextern extern
-#endif
-extern Void abort_hpib PP((int select_code));
-extern Void P_clear PP((long device));
-extern Void P_listen PP((int select_code, int address));
-extern Void P_local PP((long device));
-extern Void local_lockout PP((int select_code));
-extern Void pass_control PP((long device));
-extern Void ppoll_configure PP((long device, long mask));
-extern Void ppoll_unconfigure PP((long device));
-extern Void P_remote PP((long device));
-extern Void P_secondary PP((int select_code, int address));
-extern Void P_talk PP((int select_code, int address));
-extern Void P_trigger PP((long device));
-extern Void P_unlisten PP((int select_code));
-extern Void P_untalk PP((int select_code));
-
-
-
-#undef vextern
 
 #endif /*HPIB_2_H*/
 
diff --git a/psys/include/p2c/hpib_3.h b/psys/include/p2c/hpib_3.h
index 46abe96..eee8143 100644
--- a/psys/include/p2c/hpib_3.h
+++ b/psys/include/p2c/hpib_3.h
@@ -1,4 +1,3 @@
-/* Header for module hpib_3, generated by p2c */
 #ifndef HPIB_3_H
 #define HPIB_3_H
 
@@ -13,29 +12,17 @@
 /*                  */
 /*         */
 
-#ifndef IODECLARATIONS_H
 #include <p2c/iodecl.h>
-#endif
 
 
-
-#ifdef HPIB_3_G
-# define vextern
-#else
-# define vextern extern
-#endif
-extern boolean P_requested PP((int select_code));
-extern long P_ppoll PP((int select_code));
-extern long P_spoll PP((long device));
-extern Void request_service PP((int select_code, long response));
-extern boolean P_listener PP((int select_code));
-extern boolean P_talker PP((int select_code));
-extern boolean P_remoted PP((int select_code));
-extern boolean locked_out PP((int select_code));
-
-
-
-#undef vextern
+extern int P_requested (int select_code);
+extern long P_ppoll (int select_code);
+extern long P_spoll (long device);
+extern void request_service (int select_code, long response);
+extern int P_listener (int select_code);
+extern int P_talker (int select_code);
+extern int P_remoted (int select_code);
+extern int locked_out (int select_code);
 
 #endif /*HPIB_3_H*/
 
diff --git a/psys/include/p2c/iodecl.h b/psys/include/p2c/iodecl.h
index 7c5de82..e36e091 100644
--- a/psys/include/p2c/iodecl.h
+++ b/psys/include/p2c/iodecl.h
@@ -1,12 +1,8 @@
-/* Header for module IODECLARATIONS, generated by p2c */
 #ifndef IODECLARATIONS_H
 #define IODECLARATIONS_H
 
 
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
 
 
 
@@ -148,52 +144,52 @@ typedef struct drv_table_type {
 typedef union io_funny_proc {
     _PROCEDURE real_proc;
     struct {
-	Anyptr *dummy_pr, *dummy_sl;
+	void* *dummy_pr, *dummy_sl;
     } U0;
 } io_funny_proc;
 
 typedef struct io_temp_type {
     isrib myisrib;
     io_funny_proc user_isr;
-    Anyptr *user_parm, *card_addr, *in_bufptr, *out_bufptr;
-    Char eirbyte;
+    void* *user_parm, *card_addr, *in_bufptr, *out_bufptr;
+    char eirbyte;
     uchar my_isc;
     long timeout;
     short addressed;
-    Char drv_misc[32];
+    char drv_misc[32];
 } io_temp_type;
 
 typedef struct io_temp_type2 {
     isrib myisrib;
     io_funny_proc user_isr;
-    Anyptr *user_parm, *card_addr, *in_bufptr, *out_bufptr;
-    Char eirbyte;
+    void* *user_parm, *card_addr, *in_bufptr, *out_bufptr;
+    char eirbyte;
     uchar my_isc;
     long timeout;
     short addressed;
-    Char drv_misc[128];
+    char drv_misc[128];
 } io_temp_type2;
 
 typedef struct io_temp_type3 {
     isrib myisrib;
     io_funny_proc user_isr;
-    Anyptr *user_parm, *card_addr, *in_bufptr, *out_bufptr;
-    Char eirbyte;
+    void* *user_parm, *card_addr, *in_bufptr, *out_bufptr;
+    char eirbyte;
     uchar my_isc;
     long timeout;
     short addressed;
-    Char drv_misc[160];
+    char drv_misc[160];
 } io_temp_type3;
 
 typedef struct io_temp_type4 {
     isrib myisrib;
     io_funny_proc user_isr;
-    Anyptr *user_parm, *card_addr, *in_bufptr, *out_bufptr;
-    Char eirbyte;
+    void* *user_parm, *card_addr, *in_bufptr, *out_bufptr;
+    char eirbyte;
     uchar my_isc;
     long timeout;
     short addressed;
-    Char drv_misc[164];
+    char drv_misc[164];
 } io_temp_type4;
 
 typedef struct isc_table_type {
@@ -202,7 +198,7 @@ typedef struct isc_table_type {
     short card_type;
     long user_time;
     short card_id;
-    Anyptr *card_ptr;
+    void* *card_ptr;
 } isc_table_type;
 
 typedef enum {
@@ -218,23 +214,23 @@ typedef enum {
     to_memory, from_memory
 } dir_of_tfr;
 
-typedef Char buf_type[];
+typedef char buf_type[];
 
 typedef struct buf_info_type {
     io_temp_type *drv_tmp_ptr;
     uchar active_isc;
     actual_tfr_type act_tfr;
     user_tfr_type usr_tfr;
-    boolean b_w_mode, end_mode;
+    int b_w_mode, end_mode;
     dir_of_tfr direction;
     short term_char;
     long term_count;
-    Char *buf_ptr;
+    char *buf_ptr;
     long buf_size;
-    Anyptr *buf_empty, *buf_fill;
+    void* *buf_empty, *buf_fill;
     io_funny_proc eot_proc;
-    Anyptr *eot_parm;
-    boolean dma_priority;
+    void* *eot_parm;
+    int dma_priority;
 } buf_info_type;
 
 
@@ -244,18 +240,16 @@ vextern uchar dma_isc_0;
 vextern io_funny_proc dma_ch_1;
 vextern uchar dma_isc_1;
 vextern isrib dma_isrib0, dma_isrib1;
-vextern boolean dma_here;
-vextern Char io_work_char;
+vextern int dma_here;
+vextern char io_work_char;
 vextern long ioe_result, ioe_isc;
 vextern isc_table_type isc_table[P_iomaxisc - P_iominisc + 1];
-vextern Char io_revid[97];
+vextern char io_revid[97];
 vextern _PROCEDURE io_error_link;
 
 
-
-extern Void io_escape PP((long my_code, long select_code));
-extern uchar io_find_isc PP((Anyptr *iod_temp));
-
+extern void io_escape (long my_code, long select_code);
+extern uchar io_find_isc (void* *iod_temp);
 
 
 #undef vextern
diff --git a/psys/include/p2c/loader.h b/psys/include/p2c/loader.h
index 4eb62e0..40e576d 100644
--- a/psys/include/p2c/loader.h
+++ b/psys/include/p2c/loader.h
@@ -1,18 +1,7 @@
 #ifndef LOADER_H
 #define LOADER_H
-#include <X11/Xlib.h>
-
-
-#ifdef LOADER_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
 
 
 extern void markuser(void);
 
-
-
 #endif /* LOADER_H */
diff --git a/psys/include/p2c/lunix_pas.h b/psys/include/p2c/lunix_pas.h
index 4bb9bf6..2e8d127 100644
--- a/psys/include/p2c/lunix_pas.h
+++ b/psys/include/p2c/lunix_pas.h
@@ -1,16 +1,8 @@
-/* Header for module lunix_pas, generated by p2c */
 #ifndef LUNIX_PAS_H
 #define LUNIX_PAS_H
 
-
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
 
 
 
@@ -33,7 +25,7 @@
 
 #define lunix_lunix_date lunix_lunix_date0
 
-vextern Const datetimerec lunix_null_dt;
+vextern const datetimerec lunix_null_dt;
 
 
 
@@ -57,29 +49,29 @@ typedef struct lunix_fasttimerec {
 
 
 
-extern boolean lunix_willprompt PV( );
-extern Void lunix_getargs PP((Char *p, _PROCEDURE main));
-extern Void lunix_getEscErrMsg PP((Char *s, long e));
-extern Void lunix_fperror PP((FILE *out, Char *s));
-extern Void lunix_perror PP((Char *s));
-extern Void lunix_xbomb PP((Char *s, int esc));
-extern Void lunix_bomb PP((Char *s));
-extern Void lunix_setlog PP((Char *fname));
-extern Void lunix_dolog PP((Char *s));
-extern Void lunix_dologerr PP((Char *s));
-extern Char *lunix_spoolname PP((Char *lunix_Result, Char *directory,
-				 Char *extension));
-extern long lunix_datetoint PP((daterec date, timerec time));
-extern Void lunix_intToDate (long idate, daterec *date, timerec *time);
-extern Void lunix_fasttime PP((lunix_fasttimerec *f));
-extern Void lunix_datetostr PP((datetimerec datetime, Char *s));
-extern Void lunix_qsort PP((Char *a, int n, int es, _PROCEDURE fc));
-extern Void lunix_xfixname PP((Char *name, Char *ext));
-extern Void lunix_moreln PV( );
-extern Void lunix_morestart PV( );
-extern Void lunix_moreend PV( );
-extern Char *lunix_depasswd PP((Char *lunix_Result, Char *s));
-extern Char *lunix_hexout PP((Char *lunix_Result, long value, long size));
+extern int lunix_willprompt ();
+extern void lunix_getargs (char *p, _PROCEDURE main);
+extern void lunix_getEscErrMsg (char *s, long e);
+extern void lunix_fperror (FILE *out, char *s);
+extern void lunix_perror (char *s);
+extern void lunix_xbomb (char *s, int esc);
+extern void lunix_bomb (char *s);
+extern void lunix_setlog (char *fname);
+extern void lunix_dolog (char *s);
+extern void lunix_dologerr (char *s);
+extern char *lunix_spoolname (char *lunix_Result, char *directory,
+				 char *extension);
+extern long lunix_datetoint (daterec date, timerec time);
+extern void lunix_intToDate (long idate, daterec *date, timerec *time);
+extern void lunix_fasttime (lunix_fasttimerec *f);
+extern void lunix_datetostr (datetimerec datetime, char *s);
+extern void lunix_qsort (char *a, int n, int es, _PROCEDURE fc);
+extern void lunix_xfixname (char *name, char *ext);
+extern void lunix_moreln ();
+extern void lunix_morestart ();
+extern void lunix_moreend ();
+extern char *lunix_depasswd (char *lunix_Result, char *s);
+extern char *lunix_hexout (char *lunix_Result, long value, long size);
 
 
 
diff --git a/psys/include/p2c/markrelease.h b/psys/include/p2c/markrelease.h
index 62b7176..07fcb61 100644
--- a/psys/include/p2c/markrelease.h
+++ b/psys/include/p2c/markrelease.h
@@ -1,18 +1,8 @@
 #ifndef MARKRELEASE_H
 #define MARKRELEASE_H
 
-#ifdef MARKRELEASE_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
 extern void mark();
 extern void release();
-extern char *fakemalloc();
-
-#define malloc(x) fakemalloc(x)
 
-#undef vextern
 
 #endif
diff --git a/psys/include/p2c/math.h b/psys/include/p2c/math.h
index c454b26..1a82b60 100644
--- a/psys/include/p2c/math.h
+++ b/psys/include/p2c/math.h
@@ -1,14 +1,7 @@
-/* Header for module math, generated by p2c */
 #ifndef MATH_H
 #define MATH_H
 
-
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-
 
 #ifdef MATH_G
 # define vextern
@@ -17,13 +10,11 @@
 #endif
 
 
-
 typedef struct ma_complex {
     double re, im;
 } ma_complex;
 
 
-
 #define ma_maxreal      1.797073134862315e308
 #define ma_eps          1.110765125711e-16
 #define ma_maxreal_     ma_maxreal
@@ -36,159 +27,156 @@ typedef struct ma_complex {
 #define ma_dr           0.0174532925199433
 #define ma_rd           57.2957795130823
 
-vextern Const ma_complex ma_c0;
-vextern Const ma_complex ma_c1;
-vextern Const ma_complex ma_cm1;
-vextern Const ma_complex ma_cI;
-vextern Const ma_complex ma_cmI;
-vextern Const ma_complex ma_cpi;
+vextern const ma_complex ma_c0;
+vextern const ma_complex ma_c1;
+vextern const ma_complex ma_cm1;
+vextern const ma_complex ma_cI;
+vextern const ma_complex ma_cmI;
+vextern const ma_complex ma_cpi;
 
 #define ma_fmt_vprec    1
 #define ma_fmt_usej     2
 #define ma_fmt_usespace 4
 #define ma_fmt_useparen 8
 
-
-
 vextern long ma_dummy;
 
 
-
 /* obsolete -- use initrandom/seedrandom */
-extern boolean ma_trapuf PP((int flag));
-extern double ma_rround PP((double r));
-extern double ma_rrounde PP((double r));
-extern double ma_rtrunc PP((double r));
-extern double ma_rfloor PP((double r));
-extern double ma_rceil PP((double r));
-extern double ma_rfrac PP((double r));
-extern boolean ma_isint PP((double r));
-extern boolean ma_isinteger PP((double r));
-extern boolean ma_rnequal PP((double a, double b, double eps));
-extern long ma_igcd PP((long a, long b));
-extern double ma_rmod PP((double a, double b));
-extern double ma_rmod2 PP((double a, double b, long *q));
-extern double ma_rrem PP((double a, double b));
-extern double rrem_ieee PP((double a, double b));
-extern long ma_sgn PP((double r));
-extern double ma_sgn2 PP((double r, double s));
-extern double ma_min2 PP((double a, double b));
-extern double ma_min3 PP((double a, double b, double c));
-extern double ma_min4 PP((double a, double b, double c, double d));
-extern double ma_max2 PP((double a, double b));
-extern double ma_max3 PP((double a, double b, double c));
-extern double ma_max4 PP((double a, double b, double c, double d));
-extern double ma_mean2 PP((double a, double b));
-extern double ma_mean3 PP((double a, double b, double c));
-extern double ma_mean4 PP((double a, double b, double c, double d));
-extern Void ma_rswap2 PP((double *a, double *b));
-extern Void ma_rsort2 PP((double *a, double *b));
-extern Void ma_rsort3 PP((double *a, double *b, double *c));
-extern Void ma_rsort4 PP((double *a, double *b, double *c, double *d));
-extern double ma_rbound PP((double min, double r, double max));
-extern boolean ma_between PP((double min, double r, double max));
-extern boolean ma_betweenm PP((double min, double r, double max,
-			       double margin));
-extern Void ma_amin PP((double *min, double r));
-extern Void ma_amax PP((double *max, double r));
-extern Void ma_aminmax PP((double *min, double *max, double r));
-extern double ma_rsucc PP((double r));
-extern double ma_rpred PP((double r));
-extern Char *ma_strfmtreal PP((Char *ma_Result, double r, long wid, long prec));
-extern Char *ma_strfmtreal2 PP((Char *ma_Result, double r, long wid,
+extern int ma_trapuf (int flag);
+extern double ma_rround (double r);
+extern double ma_rrounde (double r);
+extern double ma_rtrunc (double r);
+extern double ma_rfloor (double r);
+extern double ma_rceil (double r);
+extern double ma_rfrac (double r);
+extern int ma_isint (double r);
+extern int ma_isinteger (double r);
+extern int ma_rnequal (double a, double b, double eps);
+extern long ma_igcd (long a, long b);
+extern double ma_rmod (double a, double b);
+extern double ma_rmod2 (double a, double b, long *q);
+extern double ma_rrem (double a, double b);
+extern double rrem_ieee (double a, double b);
+extern long ma_sgn (double r);
+extern double ma_sgn2 (double r, double s);
+extern double ma_min2 (double a, double b);
+extern double ma_min3 (double a, double b, double c);
+extern double ma_min4 (double a, double b, double c, double d);
+extern double ma_max2 (double a, double b);
+extern double ma_max3 (double a, double b, double c);
+extern double ma_max4 (double a, double b, double c, double d);
+extern double ma_mean2 (double a, double b);
+extern double ma_mean3 (double a, double b, double c);
+extern double ma_mean4 (double a, double b, double c, double d);
+extern void ma_rswap2 (double *a, double *b);
+extern void ma_rsort2 (double *a, double *b);
+extern void ma_rsort3 (double *a, double *b, double *c);
+extern void ma_rsort4 (double *a, double *b, double *c, double *d);
+extern double ma_rbound (double min, double r, double max);
+extern int ma_between (double min, double r, double max);
+extern int ma_betweenm (double min, double r, double max,
+			       double margin);
+extern void ma_amin (double *min, double r);
+extern void ma_amax (double *max, double r);
+extern void ma_aminmax (double *min, double *max, double r);
+extern double ma_rsucc (double r);
+extern double ma_rpred (double r);
+extern char *ma_strfmtreal (char *ma_Result, double r, long wid, long prec);
+extern char *ma_strfmtreal2 (char *ma_Result, double r, long wid,
 				long prec, long flags, double min,
-				double max));
-extern double ma_log PP((double r));
-extern double ma_tentox PP((double x));
-extern double ma_mtentox PP((double x));
-extern double ma_ytoi PP((double y, long i));
-extern double ma_yrooti PP((double y, long i));
-extern double ma_ytox PP((double y, double x));
-extern double ma_mytox PP((double y, double x));
-extern double ma_hypot PP((double a, double b));
-extern Void ma_quadrsolve PP((double a, double b, double c, double *x1,
-			      double *x2));
-extern Void ma_sincos PP((double r, double *s, double *c));
-extern double ma_tan PP((double r));
-extern double ma_arcsin PP((double r));
-extern double ma_arccos PP((double r));
-extern double ma_arctan2 PP((double r1, double r2));
+				double max);
+extern double ma_log (double r);
+extern double ma_tentox (double x);
+extern double ma_mtentox (double x);
+extern double ma_ytoi (double y, long i);
+extern double ma_yrooti (double y, long i);
+extern double ma_ytox (double y, double x);
+extern double ma_mytox (double y, double x);
+extern double ma_hypot (double a, double b);
+extern void ma_quadrsolve (double a, double b, double c, double *x1,
+			      double *x2);
+extern void ma_sincos (double r, double *s, double *c);
+extern double ma_tan (double r);
+extern double ma_arcsin (double r);
+extern double ma_arccos (double r);
+extern double ma_arctan2 (double r1, double r2);
 
 /* = arctan(r1/r2) */
-extern Void ma_sincosd PP((double r, double *s, double *c));
-extern double ma_sind PP((double r));
-extern double ma_cosd PP((double r));
-extern double ma_tand PP((double r));
-extern double ma_arcsind PP((double r));
-extern double ma_arccosd PP((double r));
-extern double ma_arctand PP((double r));
-extern double ma_arctand2 PP((double r1, double r2));
-extern double ma_sinh PP((double r));
-extern double ma_cosh PP((double r));
-extern double ma_tanh PP((double r));
-extern double ma_arcsinh PP((double r));
-extern double ma_arccosh PP((double r));
-extern double ma_arctanh PP((double r));
-extern double ma_lngamma PP((double x, boolean *minus));
-extern double ma_rgamma PP((double x));
-extern long ma_ifactorial PP((long n));
-extern double ma_lnfactorial PP((long n));
-extern long ma_ibincoef PP((long a, long b));
+extern void ma_sincosd (double r, double *s, double *c);
+extern double ma_sind (double r);
+extern double ma_cosd (double r);
+extern double ma_tand (double r);
+extern double ma_arcsind (double r);
+extern double ma_arccosd (double r);
+extern double ma_arctand (double r);
+extern double ma_arctand2 (double r1, double r2);
+extern double ma_sinh (double r);
+extern double ma_cosh (double r);
+extern double ma_tanh (double r);
+extern double ma_arcsinh (double r);
+extern double ma_arccosh (double r);
+extern double ma_arctanh (double r);
+extern double ma_lngamma (double x, int *minus);
+extern double ma_rgamma (double x);
+extern long ma_ifactorial (long n);
+extern double ma_lnfactorial (long n);
+extern long ma_ibincoef (long a, long b);
 
 /*a >= b*/
-extern double ma_rbincoef PP((long a, long b));
-extern ma_complex ma_cmake PP((double r, double i));
-extern ma_complex ma_creal PP((double r));
-extern ma_complex ma_cimag PP((double i));
-extern ma_complex ma_cadd PP((ma_complex a, ma_complex b));
-extern ma_complex ma_csub PP((ma_complex a, ma_complex b));
-extern ma_complex ma_cmul PP((ma_complex a, ma_complex b));
-extern ma_complex ma_cdiv PP((ma_complex a, ma_complex b));
-extern ma_complex ma_csqr PP((ma_complex a));
-extern ma_complex ma_csqrt PP((ma_complex a));
-extern boolean ma_cequal PP((ma_complex a, ma_complex b));
-extern boolean ma_cnequal PP((ma_complex a, ma_complex b, double epssq));
-extern ma_complex ma_csmul PP((double r, ma_complex a));
-extern ma_complex ma_cconj PP((ma_complex a));
-extern ma_complex ma_cneg PP((ma_complex a));
-extern double ma_cangle PP((ma_complex a));
-extern double ma_cabs PP((ma_complex a));
-extern double ma_cabssqr PP((ma_complex a));
-extern double ma_cdiff PP((ma_complex a, ma_complex b));
-extern ma_complex ma_cexp PP((ma_complex a));
-extern ma_complex ma_cexpi PP((ma_complex a));
-extern ma_complex ma_cln PP((ma_complex a));
-extern ma_complex ma_csin PP((ma_complex a));
-extern ma_complex ma_ccos PP((ma_complex a));
-extern ma_complex ma_ctan PP((ma_complex a));
-extern ma_complex ma_carcsin PP((ma_complex a));
-extern ma_complex ma_carccos PP((ma_complex a));
-extern ma_complex ma_carctan PP((ma_complex a));
-extern ma_complex ma_csinh PP((ma_complex a));
-extern ma_complex ma_ccosh PP((ma_complex a));
-extern ma_complex ma_ctanh PP((ma_complex a));
-extern ma_complex ma_carcsinh PP((ma_complex a));
-extern ma_complex ma_carccosh PP((ma_complex a));
-extern ma_complex ma_carctanh PP((ma_complex a));
-extern Char *ma_strcomplex PP((Char *ma_Result, ma_complex a));
-extern Char *ma_strfmtcomplex PP((Char *ma_Result, ma_complex a, long wid,
-				  long prec));
-extern Char *ma_strfmtcomplex2 PP((Char *ma_Result, ma_complex a, long wid,
+extern double ma_rbincoef (long a, long b);
+extern ma_complex ma_cmake (double r, double i);
+extern ma_complex ma_creal (double r);
+extern ma_complex ma_cimag (double i);
+extern ma_complex ma_cadd (ma_complex a, ma_complex b);
+extern ma_complex ma_csub (ma_complex a, ma_complex b);
+extern ma_complex ma_cmul (ma_complex a, ma_complex b);
+extern ma_complex ma_cdiv (ma_complex a, ma_complex b);
+extern ma_complex ma_csqr (ma_complex a);
+extern ma_complex ma_csqrt (ma_complex a);
+extern int ma_cequal (ma_complex a, ma_complex b);
+extern int ma_cnequal (ma_complex a, ma_complex b, double epssq);
+extern ma_complex ma_csmul (double r, ma_complex a);
+extern ma_complex ma_cconj (ma_complex a);
+extern ma_complex ma_cneg (ma_complex a);
+extern double ma_cangle (ma_complex a);
+extern double ma_cabs (ma_complex a);
+extern double ma_cabssqr (ma_complex a);
+extern double ma_cdiff (ma_complex a, ma_complex b);
+extern ma_complex ma_cexp (ma_complex a);
+extern ma_complex ma_cexpi (ma_complex a);
+extern ma_complex ma_cln (ma_complex a);
+extern ma_complex ma_csin (ma_complex a);
+extern ma_complex ma_ccos (ma_complex a);
+extern ma_complex ma_ctan (ma_complex a);
+extern ma_complex ma_carcsin (ma_complex a);
+extern ma_complex ma_carccos (ma_complex a);
+extern ma_complex ma_carctan (ma_complex a);
+extern ma_complex ma_csinh (ma_complex a);
+extern ma_complex ma_ccosh (ma_complex a);
+extern ma_complex ma_ctanh (ma_complex a);
+extern ma_complex ma_carcsinh (ma_complex a);
+extern ma_complex ma_carccosh (ma_complex a);
+extern ma_complex ma_carctanh (ma_complex a);
+extern char *ma_strcomplex (char *ma_Result, ma_complex a);
+extern char *ma_strfmtcomplex (char *ma_Result, ma_complex a, long wid,
+				  long prec);
+extern char *ma_strfmtcomplex2 (char *ma_Result, ma_complex a, long wid,
 				   long prec, long flags, double min,
-				   double max));
-extern Void ma_strsubreadcomplex PP((Char *buf, long first, long *pos,
-				     ma_complex *a));
-extern ma_complex ma_strreadcomplex PP((Char *buf));
-extern double ma_rrand PV();
-extern long ma_rand2 PP((long min, long max));
-extern double ma_rrand2 PP((double min, double max));
-extern double ma_nrand2 PP((double mean, double sdev));
-extern Void ma_initrandom PP((Anyptr *s));
-extern Void ma_seedrandom PP((Anyptr *s, long seed));
-extern double ma_urandom PP((Anyptr s));
-extern long ma_irandom PP((Anyptr s, long min, long max));
-extern double ma_rrandom PP((Anyptr s, double min, double max));
-extern double ma_nrandom PP((Anyptr s, double mean, double sdev));
+				   double max);
+extern void ma_strsubreadcomplex (char *buf, long first, long *pos,
+				     ma_complex *a);
+extern ma_complex ma_strreadcomplex (char *buf);
+extern double ma_rrand ();
+extern long ma_rand2 (long min, long max);
+extern double ma_rrand2 (double min, double max);
+extern double ma_nrand2 (double mean, double sdev);
+extern void ma_initrandom (void * *s);
+extern void ma_seedrandom (void * *s, long seed);
+extern double ma_urandom (void * s);
+extern long ma_irandom (void * s, long min, long max);
+extern double ma_rrandom (void * s, double min, double max);
+extern double ma_nrandom (void * s, double mean, double sdev);
 
 
 
diff --git a/psys/include/p2c/misc.h b/psys/include/p2c/misc.h
index 10b65f8..24f89b4 100644
--- a/psys/include/p2c/misc.h
+++ b/psys/include/p2c/misc.h
@@ -1,19 +1,8 @@
-/* Header for module misc, generated by p2c */
 #ifndef MISC_H
 #define MISC_H
 
-
-
 /*homeless orphans*/
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef ASM_H
-#include <p2c/asm.h>
-#endif
-
-
 
 #ifdef MISC_G
 # define vextern
@@ -96,39 +85,35 @@
 /*comment or miscellaneous information*/
 
 typedef struct misc_catentry {
-    Char cname[tidleng + 1];
+    char cname[tidleng + 1];
     short ceft;
     filekind ckind;
     long cpsize, clsize, cstart, cblocksize;
     daterec ccreatedate, clastdate;
     timerec ccreatetime, clasttime;
     long cextra1, cextra2;
-    Char cinfo[21];
+    char cinfo[21];
 } misc_catentry;
 
 typedef struct misc_passentry {
     long pbits;
-    Char pword[passleng + 1];
+    char pword[passleng + 1];
 } misc_passentry;
 
-
-
 vextern uchar misc_idle;
 
 
-
 /* idle character -- 3.0 bug jws 3/20/84 */
-extern Void misc_getioerrmsg PP((Char *s, long lastior));
-extern Void misc_printerror PP((long errorcode, long lastior));
-extern Void misc_upc PP((Char *s));
-extern long misc_ueovbytes PP((int unit));
-extern Void misc_unblockeddam PP((fib *f, int unum, int request));
-extern Void misc_initfilekinds PV();
-extern Void misc_lockup PV();
-extern Void misc_lockdown PV();
-
-extern Char *tilde_expand PP( (Char *s) );
-
+extern void misc_getioerrmsg (char *s, long lastior);
+extern void misc_printerror (long errorcode, long lastior);
+extern void misc_upc (char *s);
+extern long misc_ueovbytes (int unit);
+extern void misc_unblockeddam (fib *f, int unum, int request);
+extern void misc_initfilekinds ();
+extern void misc_lockup ();
+extern void misc_lockdown ();
+
+extern char *tilde_expand  (char *s);
 
 #undef vextern
 
diff --git a/psys/include/p2c/mylib.h b/psys/include/p2c/mylib.h
index bb8d4ef..2a203a8 100644
--- a/psys/include/p2c/mylib.h
+++ b/psys/include/p2c/mylib.h
@@ -1,4 +1,3 @@
-/* Header for module mylib, generated by p2c */
 #ifndef MYLIB_H
 #define MYLIB_H
 
@@ -121,7 +120,7 @@ vextern _PROCEDURE m_usercolor[16];
 vextern _PROCEDURE m_fastusercolor;
 vextern uchar m_chgfrom, m_chgto;
 vextern m_colorarray m_chgtable;
-vextern boolean m_blackflag;
+vextern int m_blackflag;
 vextern long m_hitcount, m_across, m_down;
 #define m_machine "X"
 /*   vextern uchar m_machine[20];  */
@@ -139,99 +138,99 @@ extern XColor m_colors[ColorSets+1][ColorsInSet];
 /* Added X display name support.  stafford 7/17/91 */
 extern void m_set_display_name(char* display_name);
 extern char m_display_name[];
-extern boolean m_autoraise;
-
-extern void m_init_screen PV();
-extern void m_init_colors PV();
-extern void m_init_pen PP((int));
-extern void m_init_graphics PV();
-extern void m_init_graphics_nopen PV();
-extern void m_init_dzg PV();
-extern void m_modern PP((int));
-extern void m_version PP((int));
-extern long m_curversion PV();
+extern int m_autoraise;
+
+extern void m_init_screen ();
+extern void m_init_colors ();
+extern void m_init_pen (int);
+extern void m_init_graphics ();
+extern void m_init_graphics_nopen ();
+extern void m_init_dzg ();
+extern void m_modern (int);
+extern void m_version (int);
+extern long m_curversion ();
 extern void m_setplanes();
 extern long m_seeplanes();
-extern void m_clear PV();
-extern void m_clearwindow PP((int, int));
-extern void m_vsync PV();
-extern void m_clip PP((int, int, int, int));
-extern void m_noclip PV();
+extern void m_clear ();
+extern void m_clearwindow (int, int);
+extern void m_vsync ();
+extern void m_clip (int, int, int, int);
+extern void m_noclip ();
 extern void m_unclip();	
-extern void m_transform PP((int, int, int, int, int, int, int));
-extern void m_upside_down PV();
-extern void m_rotscale PP((double, double, int, int));
-extern void m_rotscaled PP((double, double, int, int));
-extern void m_notransform PV();
+extern void m_transform (int, int, int, int, int, int, int);
+extern void m_upside_down ();
+extern void m_rotscale (double, double, int, int);
+extern void m_rotscaled (double, double, int, int);
+extern void m_notransform ();
 extern void m_untransform();
-extern void m_cursor PP((int, int));
-extern void m_nocursor PV();
+extern void m_cursor (int, int);
+extern void m_nocursor ();
 extern void m_setcursor();
 extern void m_setcursorshape();	
-extern void m_choosecursor PP((int));
+extern void m_choosecursor (int);
 extern void m_seecursor();
-extern void m_color PP((int));
-extern void m_colormode PP((int c));
+extern void m_color (int);
+extern void m_colormode (int c);
 extern void m_uncolor();
-extern long m_curcolor PV();
-extern long m_curcolormode PV();
+extern long m_curcolor ();
+extern long m_curcolormode ();
 extern void m_setpattern();
 extern void m_seepattern();
 extern void m_scanpos();
 extern void m_setcolor();
-extern void m_seecolor PP((int, int *, int *, int *));
-extern void m_setcolors PP((m_colorarray, m_colorarray, m_colorarray));
-extern void m_seecolors PP((m_colorarray, m_colorarray, m_colorarray));
-extern void m_vsetcolors PP((int, int, m_vcolorarray, m_vcolorarray, m_vcolorarray));
-extern void m_vseecolors PP((int, int, m_vcolorarray, m_vcolorarray, m_vcolorarray));
-extern void m_choosecolors PP((int));
+extern void m_seecolor (int, int *, int *, int *);
+extern void m_setcolors (m_colorarray, m_colorarray, m_colorarray);
+extern void m_seecolors (m_colorarray, m_colorarray, m_colorarray);
+extern void m_vsetcolors (int, int, m_vcolorarray, m_vcolorarray, m_vcolorarray);
+extern void m_vseecolors (int, int, m_vcolorarray, m_vcolorarray, m_vcolorarray);
+extern void m_choosecolors (int);
 extern void m_nullusercolor();
 extern void m_pixelpos();
 extern void m_pixelptr();
 extern void m_nullfastusercolor();
-extern void m_linestyle PP((int));
-extern void m_nolinestyle PV();
+extern void m_linestyle (int);
+extern void m_nolinestyle ();
 extern void m_unlinestyle();
-extern long m_curlinestyle PV();
-extern void m_setlinestyle PP((int, int));
-extern void m_seelinestyle PP((int, int *));
-extern void m_linewidth PP((int));
-extern void m_nolinewidth PV();
+extern long m_curlinestyle ();
+extern void m_setlinestyle (int, int);
+extern void m_seelinestyle (int, int *);
+extern void m_linewidth (int);
+extern void m_nolinewidth ();
 extern void m_unlinewidth();
-extern void m_move PP((int, int));
-extern void m_moverel PP((int, int));
-extern void m_move2 PP((int, int));
-extern void m_moverel2 PP((int, int));
-extern void m_draw PP((int, int));
-extern void m_drawrel PP((int, int));
-extern void m_seeposn PP((int *, int *));
-extern void m_drawline PP((int, int, int, int));
-extern void m_drawrect PP((int, int, int, int));
-extern void m_fillrect PP((int, int, int, int));
-extern void m_grid PP((int, int, int, int, int, int, int, int));
-extern void m_drawpoint PP((int, int));
+extern void m_move (int, int);
+extern void m_moverel (int, int);
+extern void m_move2 (int, int);
+extern void m_moverel2 (int, int);
+extern void m_draw (int, int);
+extern void m_drawrel (int, int);
+extern void m_seeposn (int *, int *);
+extern void m_drawline (int, int, int, int);
+extern void m_drawrect (int, int, int, int);
+extern void m_fillrect (int, int, int, int);
+extern void m_grid (int, int, int, int, int, int, int, int);
+extern void m_drawpoint (int, int);
 extern long m_seepoint();
 extern void m_scanrect();
 extern void m_crt_out();
-extern void m_circle PP((int, int, int));
-extern void m_ellipse PP((int, int, int, int, int));
-extern void m_drawarc PP((long, long, long, long, double, double, double, long));
-extern void m_fillarc PP((long, long, long, long, double, double, double, long));
+extern void m_circle (int, int, int);
+extern void m_ellipse (int, int, int, int, int);
+extern void m_drawarc (long, long, long, long, double, double, double, long);
+extern void m_fillarc (long, long, long, long, double, double, double, long);
 extern void m_computearc3();
 extern void m_drawarc3();
 extern void m_fillarc3();
 extern void m_computearct();
 extern void m_drawarct();
 extern void m_fillarct();
-extern void m_roundrect PP((int, int, int, int, int, int, int));
-extern void m_bezier PP((int, int, int, int, int, int, int, int));
-extern void m_bezier2 PP((int, int, int, int, int, int, int, int, int));
-extern void m_cbezier PP((int, int, int, int, int, int, int, int, int));
-extern void m_polycurve PP((double, double, double, double, double, double, double, double, double, double, double, double));
+extern void m_roundrect (int, int, int, int, int, int, int);
+extern void m_bezier (int, int, int, int, int, int, int, int);
+extern void m_bezier2 (int, int, int, int, int, int, int, int, int);
+extern void m_cbezier (int, int, int, int, int, int, int, int, int);
+extern void m_polycurve (double, double, double, double, double, double, double, double, double, double, double, double);
 extern void m_drawarrow();
 extern void m_fillarrow();
-extern void m_drawpoly PP((int, int [], int []));
-extern void m_fillpoly PP((int, int [], int []));
+extern void m_drawpoly (int, int [], int []);
+extern void m_fillpoly (int, int [], int []);
 extern void m_floodfill();
 extern void m_boundaryfill();
 extern void m_areafill();
@@ -259,17 +258,17 @@ extern void m_blit();
 extern void m_loadfont();
 extern void m_drawchar();
 extern void m_displaytext();
-extern void m_drawstr PP((int, int, char *, char *));
-extern void m_centerstr PP((int, int, char *, char *));
-extern void m_rightstr PP((int, int, char *, char *));
-extern long m_strwidth PP((char *, char *));
+extern void m_drawstr (int, int, char *, char *);
+extern void m_centerstr (int, int, char *, char *);
+extern void m_rightstr (int, int, char *, char *);
+extern long m_strwidth (char *, char *);
 extern long m_strlength();
 extern void m_setfont();
 #define m_choosefont(x)
 /*  extern void m_choosefont();  */
 extern void m_seefont();
-extern void m_makechar PP((Anyptr *, long, long, long, long, long, long));
-extern void m_changechar PP((Anyptr *, long, long, long, long, long));
+extern void m_makechar (void* *, long, long, long, long, long, long);
+extern void m_changechar (void* *, long, long, long, long, long);
 extern void m_copychar();
 extern void m_disposechar();
 extern void m_loadcfont();
@@ -292,7 +291,7 @@ extern void m_readpen();
 extern void m_trackpen();
 extern void m_waitpen();
 extern void m_clipxy();
-extern boolean m_pollkbd();
+extern int m_pollkbd();
 extern uchar m_inkey();
 extern uchar m_inkeyn();
 extern uchar m_testkey();
diff --git a/psys/include/p2c/newasm.h b/psys/include/p2c/newasm.h
index 041fe43..6cc1ffe 100644
--- a/psys/include/p2c/newasm.h
+++ b/psys/include/p2c/newasm.h
@@ -3,29 +3,21 @@
 #define NEWASM_H
 
 
-#ifdef NEWASM_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
 #define na_scale        65536L
 
 #define na_rbias        1023
 
 
-
 /*32 bits*/
 
-typedef Char na_chararray[];
+typedef char na_chararray[];
 
 
 typedef union na_word {
   short i;
   unsigned short u;
   struct {
-    Char c1, c2;
+    char c1, c2;
   } U7;
   struct {
     uchar ub1, ub2;
@@ -36,12 +28,12 @@ typedef union na_word {
   unsigned short b4;
   unsigned short b2;
   unsigned short b;
-  Char str[2];
+  char str[2];
 } na_word;
 
 typedef na_word na_wordarray[];
 
-typedef Anyptr na_long;
+typedef void* na_long;
 #define na_long na_longword
 
 typedef union na_long {
@@ -57,28 +49,28 @@ typedef union na_long {
   } U4;
   struct {
     char fill1;
-    Signed int s3 : 24;
+    signed int s3 : 24;
   } U5;
   struct {
     uchar fill2;
     unsigned u3 : 24;
   } U6;
-  Char c[4];
+  char c[4];
   uchar ub[4];
   long sb;
   unsigned long b4;
   unsigned long b2;
   unsigned long b;
-  Anyptr sr;
-  Char str[4];
-  Char *sp;
-  Anyptr p;
+  void* sr;
+  char str[4];
+  char *sp;
+  void* p;
   double *rp;
   na_word *wp;
   union na_long *lp;
   union na_quadword *qp;
-  struct na_strlistrec *sl;
-  Char *cap;
+  struct na_strlist_t *sl;
+  char *cap;
   na_word *wap;
   union na_long *lap;
   union na_quadword *qap;
@@ -100,22 +92,25 @@ typedef union na_quadword {
   } U1;
   short si[4];
   unsigned short su[4];
-  Char c[8];
+  char c[8];
   uchar ub[8];
   short sb[4];
   uchar b4[8];
   uchar b2[8];
   uchar b[8];
   struct {
-    Anyptr sr1, sr2;
+    void* sr1;
+	void* sr2;
   } U13;
   double r;
-  Char str[8];
+  char str[8];
   struct {
-    Char *sp1, *sp2;
+    char *sp1;
+	char *sp2;
   } U16;
   struct {
-    Anyptr p1, p2;
+    void* p1;
+	void* p2;
   } U17;
   struct {
     double *rp1, *rp2;
@@ -130,10 +125,10 @@ typedef union na_quadword {
     union na_quadword *qp1, *qp2;
   } U21;
   struct {
-    struct na_strlistrec *sl1, *sl2;
+    struct na_strlist_t *sl1, *sl2;
   } U22;
   struct {
-    Char *cap1, *cap2;
+    char *cap1, *cap2;
   } U23;
   struct {
     na_word *wap1, *wap2;
@@ -157,216 +152,159 @@ typedef union na_quadword {
 
 typedef na_quadword na_quadwordarray[];
 
-typedef struct na_strlistrec {
-  struct na_strlistrec *next;
-  na_long value;   /*user-defined*/
-  Char kind;   /*user-defined*/
-  Char len;   /*for internal use*/
-  Char s[256];   /*not entirely allocated*/
-} na_strlistrec;
-
-
-
-/* p2c: newasm.imp, line 161:
- * Note: Absolute-addressed variable P_nil2 was generated [116] */
-extern Anyptr *P_nil2;
-
-
-typedef na_strlistrec na_strlist;
-
-extern Void na_fillbyte PP((long *d, long w, long n));
-extern Void na_fillword PP((long *d, long w, long n));
-extern Void na_fill PP((long *d, long w, long n));
-extern Void na_fillp PP((Anyptr d, long w, long n));
-extern Void na_move PP((long *s, long *d, long size));
-extern Void na_movep PP((Anyptr s, Anyptr d, long size));
-extern Void na_exch PP((long *s, long *d, long size));
-extern Void na_exchp PP((Anyptr s, Anyptr d, long size));
-extern long na_comp PP((long *a, long *b, long size));
-extern long na_compp PP((Anyptr a, Anyptr b, long size));
-extern long na_scaneq PP((long *s, long what, long size));
-extern long na_scaneqp PP((Anyptr s, long what, long size));
-extern long na_scanne PP((long *s, long what, long size));
-
-extern long na_scannep PP((Anyptr s, long what, long size));
-extern Void na_new PP((Anyptr *p, long s));
-extern Void na_dispose PP((Anyptr *p, long s));
-extern Void na_alloc PP((Anyptr *p, long s));
-extern Void na_outeralloc PP((Anyptr *p, long s, long parframe));
-extern Void na_free PP((Anyptr *p));
-
-extern long na_memavail PV();
-extern long na_and PP((long x, long y));
-extern long na_bic PP((long x, long y));
-extern long na_or PP((long x, long y));
-extern long na_xor PP((long x, long y));
-extern long na_not PP((long x));
-extern boolean na_mask PP((long x, long y));
-extern boolean na_test PP((long n, long x));
-extern Void na_set PP((long n, long *x));
-extern Void na_clear PP((long n, long *x));
-extern long na_log2 PP((long n));
-extern long na_po2 PP((long n));
-extern long na_lobits PP((long n));
-extern long na_hibits PP((long n));
-extern long na_asl PP((long n, long x));
-extern long na_lsl PP((long n, long x));
-
-extern long na_rol PP((long n, long x));
-extern Void na_bfclr PP((long *v, long offset, long size));
-extern Void na_bfset PP((long *v, long offset, long size));
-extern Void na_bfchg PP((long *v, long offset, long size));
-extern boolean na_bftst PP((long *v, long offset, long size));
-extern Void na_bffill PP((long *v, long offset, long size, int b));
-extern Void na_bfmove PP((long *s, long soff, long *d, long doff, long size));
-extern Void na_bfrev PP((long *v, long offset, long size));
-extern Void na_bfins PP((long *v, long offset, long size, long val));
-extern long na_bfextu PP((long *v, long offset, long size));
-extern long na_bfexts PP((long *v, long offset, long size));
-extern long na_bfffo PP((long *v, long offset, long size));
-extern long na_bfffz PP((long *v, long offset, long size));
-
-extern long na_bfcount PP((long *v, long offset, long size));
-extern long na_setcard PP((long *s));
-extern long na_setlast PP((long *s));
-extern long na_setnext PP((long *s, long offset));
-
-extern long na_setnextnot PP((long *s, long offset));
-extern long P_imax PP((long a, long b));
-extern long P_imin PP((long a, long b));
-extern long P_isgn PP((long a));
-extern double P_rmax PP((double a, double b));
-extern double P_rmin PP((double a, double b));
-
-extern long P_rsgn PP((double a));
-extern long P_imax2 PP((long a, long b));
-extern long P_imin2 PP((long a, long b));
-extern long P_imax3 PP((long a, long b, long c));
-extern long P_imin3 PP((long a, long b, long c));
-extern long P_imax4 PP((long a, long b, long c, long d));
-extern long P_imin4 PP((long a, long b, long c, long d));
-extern Void P_iswap2 PP((long *a, long *b));
-extern Void P_isort2 PP((long *a, long *b));
-extern Void P_isort3 PP((long *a, long *b, long *c));
-extern Void P_isort4 PP((long *a, long *b, long *c, long *d));
-extern long P_ibound PP((long min, long i, long max));
-extern boolean P_ibetween PP((long min, long i, long max));
-extern boolean P_ibetweenm PP((long min, long i, long max, long margin));
-extern Void P_iamin PP((long *min, long i));
-extern Void P_iamax PP((long *max, long i));
-
-extern Void P_iaminmax PP((long *min, long *max, long i));
-extern long P_isqrt PP((long n));
-
-extern long P_ipow PP((long y, long x));
-extern long na_add PP((long a, long b));
-extern long na_sub PP((long a, long b));
-extern Void na_addc PP((long *a, long b, boolean *c));
-extern Void na_subc PP((long *a, long b, boolean *c));
-extern long na_smul PP((long a, long b));
-extern long na_umul PP((long a, long b));
-extern na_quadword na_smul64 PP((long a, long b));
-extern na_quadword na_umul64 PP((long a, long b));
-extern Void na_udiv64 PP((na_quadword *q, long *r, na_quadword a, long b));
-
-extern Void na_sdiv64 PP((na_quadword *q, long *r, na_quadword a, long b));
-extern Void P_return PV();
-extern Void P_returnb PP((int b));
-extern Void P_returnc PP((int c));
-extern Void P_returni PP((long i));
-extern Void P_returnp PP((Anyptr p));
-
-extern Void P_returnr PP((double r));
-extern Anyptr na_rtosr PP((double r));
-
-extern double na_srtor PP((Anyptr sr));
-extern double na_stor PP((long s));
-extern long na_rtos PP((double r));
-extern long na_sm PP((long a, long b));
-extern long na_sd PP((long a, long b));
-extern long na_strunc PP((long s));
-extern long na_sround PP((long s));
-extern long na_sint PP((long s));
-extern long na_sfrac PP((long s));
-extern long na_itos PP((long s));
-
-extern long na_ssqrt PP((long s));
-extern Void na_compint PP((na_long a, na_long b, long *res));
-extern Void na_compstr PP((na_long a, na_long b, long *res));
-
-
-extern Void na_qsort PP((na_long *a, long n, _PROCEDURE comp));
-extern Void strsafeappend PP((Char *s, Char *s2));
-extern Void strappendc PP((Char *s, int ch));
-extern Char *strupper PP((Char *Result, Char *s));
-extern Char *strlower PP((Char *Result, Char *s));
-extern Char charupper PP((int ch));
-extern Char charlower PP((int ch));
-extern Char *strpart PP((Char *Result, Char *s, long first, long last));
-extern Char *strlast PP((Char *Result, Char *s, long num));
-extern Char *strljust PP((Char *Result, Char *s, long wid));
-extern Char *strrjust PP((Char *Result, Char *s, long wid));
-extern Char *strcjust PP((Char *Result, Char *s, long wid));
-extern boolean strbegins PP((Char *s1, Char *s2));
-extern boolean strends PP((Char *s1, Char *s2));
-extern boolean strcibegins PP((Char *s1, Char *s2));
-extern boolean strciends PP((Char *s1, Char *s2));
-extern boolean strequal PP((Char *s1, Char *s2));
-extern long strsubcmp PP((long n, Char *s1, long i1, Char *s2, long i2));
-extern boolean strcisubcmp PP((long n, Char *s1, long i1, Char *s2, long i2));
-extern Void strsubst PP((Char *repl, Char *s, long index, long size));
-extern Char *strint PP((Char *Result, long i));
-extern Char *strint2 PP((Char *Result, long i, long w));
-extern Char *strreal PP((Char *Result, double r));
-extern Char *strchar PP((Char *Result, int ch));
-extern long strreadint PP((Char *s));
-extern double strreadreal PP((Char *s));
-extern long strposb PP((Char *s1, Char *s2, long i));
-extern long strposc PP((Char *s1, int ch, long i));
-extern long strposcset PP((Char *s1, Char *s2, long i));
-extern long strposbcset PP((Char *s1, Char *s2, long i));
-extern long strcipos2 PP((Char *s1, Char *s2, long i));
-extern long strciposb PP((Char *s1, Char *s2, long i));
-extern boolean strcontains PP((Char *s1, Char *s2));
-extern boolean strsubset PP((Char *s1, Char *s2));
-extern boolean strcommon PP((Char *s1, Char *s2));
-extern long strlenv PP((Char *s));
-extern Char *strhex PP((Char *Result, long i, long w));
-extern Char *strbinary PP((Char *Result, long i, long w));
-extern Char *strdate PP((Char *Result, Char *opts));
-extern Void strword PP((Char *s, Char *word));
-extern Void strword2 PP((Char *s, Char *word));
-extern Void strcomment PP((Char *s, Char *bracket));
-extern Void strcompress PP((Char *s, Char *chars, int all));
-extern Void strdispose PP((Char **sp));
-
-extern Void strchange PP((Char **sp, Char *s));
-extern Void strlist_init PP((na_strlistrec **base));
-extern na_strlistrec *strlist_find PP((na_strlistrec *base, Char *s));
-extern na_strlistrec *strlist_cifind PP((na_strlistrec *base, Char *s));
-extern Void strlist_change PP((na_strlistrec **base, na_strlistrec **ptr,
-			       Char *s));
-extern Void strlist_remove PP((na_strlistrec **base, Char *s));
-extern Void strlist_delete PP((na_strlistrec **base, na_strlistrec *ptr));
-extern Void strlist_dispose PP((na_strlistrec **ptr));
-extern Void strlist_empty PP((na_strlistrec **base));
-extern Void strlist_copy PP((na_strlistrec **dest, na_strlistrec *src));
-
-extern Void na_bfand PP((long *s, long soff, long *d, long doff, long size));
-extern Void na_bfbic PP((long *s, long soff, long *d, long doff, long size));
-extern Void na_bfor PP((long *s, long soff, long *d, long doff, long size));
-extern Void na_bfxor PP((long *s, long soff, long *d, long doff, long size));
-extern Char *strnew PP((Char *s));
-extern na_strlist *strlist_add PP((na_strlist **base, Char *s));
-extern na_strlist *strlist_append PP((na_strlist **base, Char *s));
-extern na_strlist *strlist_insert PP((na_strlist **base, Char *s));
-
-extern Void strlist_dump PP((FILE *f, na_strlistrec *base));
-
-
-#undef vextern
-
-extern char * strcpy_overlap(char * dst, char * src);
+typedef struct na_strlist_t {
+  struct na_strlist_t *next;
+  na_long value;   /* user-defined */
+  char kind;       /* user-defined */
+  char len;        /* for internal use */
+  char s[256];     /* not entirely allocated */
+} na_strlist_t;
+
+
+extern void* *P_nil2;
+
+extern void na_fillbyte (long *d, long w, long n);
+extern void na_fillword (long *d, long w, long n);
+extern void na_fill (long *d, long w, long n);
+extern void na_fillp (void* d, long w, long n);
+extern void na_move (long *s, long *d, long size);
+extern void na_movep (void* s, void* d, long size);
+extern void na_exch (long *s, long *d, long size);
+extern void na_exchp (void* s, void* d, long size);
+extern long na_comp (long *a, long *b, long size);
+extern long na_compp (void* a, void* b, long size);
+extern long na_scaneq (long *s, long what, long size);
+extern long na_scaneqp (void* s, long what, long size);
+extern long na_scanne (long *s, long what, long size);
+
+extern long na_scannep (void* s, long what, long size);
+extern void na_new (void* *p, long s);
+extern void na_dispose (void* *p, long s);
+extern void na_alloc (void* *p, long s);
+extern void na_outeralloc (void* *p, long s, long parframe);
+extern void na_free (void* *p);
+
+extern long na_memavail ();
+extern long na_and (long x, long y);
+extern long na_bic (long x, long y);
+extern long na_or (long x, long y);
+extern long na_xor (long x, long y);
+extern long na_not (long x);
+extern int na_mask (long x, long y);
+extern int na_test (long n, long x);
+extern void na_set (long n, long *x);
+extern void na_clear (long n, long *x);
+extern long na_log2 (long n);
+extern long na_po2 (long n);
+extern long na_lobits (long n);
+extern long na_hibits (long n);
+extern long na_asl (long n, long x);
+extern long na_lsl (long n, long x);
+
+extern long na_rol (long n, long x);
+extern void na_bfclr (long *v, long offset, long size);
+extern void na_bfset (long *v, long offset, long size);
+extern void na_bfchg (long *v, long offset, long size);
+extern int na_bftst (long *v, long offset, long size);
+extern void na_bffill (long *v, long offset, long size, int b);
+extern void na_bfmove (long *s, long soff, long *d, long doff, long size);
+extern void na_bfrev (long *v, long offset, long size);
+extern void na_bfins (long *v, long offset, long size, long val);
+extern long na_bfextu (long *v, long offset, long size);
+extern long na_bfexts (long *v, long offset, long size);
+extern long na_bfffo (long *v, long offset, long size);
+extern long na_bfffz (long *v, long offset, long size);
+
+extern long na_bfcount (long *v, long offset, long size);
+extern long na_setcard (long *s);
+extern long na_setlast (long *s);
+extern long na_setnext (long *s, long offset);
+
+extern long na_setnextnot (long *s, long offset);
+extern long P_imax (long a, long b);
+extern long P_imin (long a, long b);
+extern long P_isgn (long a);
+extern double P_rmax (double a, double b);
+extern double P_rmin (double a, double b);
+
+extern long P_rsgn (double a);
+extern long P_imax2 (long a, long b);
+extern long P_imin2 (long a, long b);
+extern long P_imax3 (long a, long b, long c);
+extern long P_imin3 (long a, long b, long c);
+extern long P_imax4 (long a, long b, long c, long d);
+extern long P_imin4 (long a, long b, long c, long d);
+extern void P_iswap2 (long *a, long *b);
+extern void P_isort2 (long *a, long *b);
+extern void P_isort3 (long *a, long *b, long *c);
+extern void P_isort4 (long *a, long *b, long *c, long *d);
+extern long P_ibound (long min, long i, long max);
+extern int P_ibetween (long min, long i, long max);
+extern int P_ibetweenm (long min, long i, long max, long margin);
+extern void P_iamin (long *min, long i);
+extern void P_iamax (long *max, long i);
+
+extern void P_iaminmax (long *min, long *max, long i);
+extern long P_isqrt (long n);
+
+extern long P_ipow (long y, long x);
+extern long na_add (long a, long b);
+extern long na_sub (long a, long b);
+extern void na_addc (long *a, long b, int *c);
+extern void na_subc (long *a, long b, int *c);
+extern long na_smul (long a, long b);
+extern long na_umul (long a, long b);
+extern na_quadword na_smul64 (long a, long b);
+extern na_quadword na_umul64 (long a, long b);
+extern void na_udiv64 (na_quadword *q, long *r, na_quadword a, long b);
+
+extern void na_sdiv64 (na_quadword *q, long *r, na_quadword a, long b);
+extern void P_return ();
+extern void P_returnb (int b);
+extern void P_returnc (int c);
+extern void P_returni (long i);
+extern void P_returnp (void* p);
+
+extern void P_returnr (double r);
+extern void* na_rtosr (double r);
+
+extern double na_srtor (void* sr);
+extern double na_stor (long s);
+extern long na_rtos (double r);
+extern long na_sm (long a, long b);
+extern long na_sd (long a, long b);
+extern long na_strunc (long s);
+extern long na_sround (long s);
+extern long na_sint (long s);
+extern long na_sfrac (long s);
+extern long na_itos (long s);
+
+extern long na_ssqrt (long s);
+extern void na_compint (na_long a, na_long b, long *res);
+extern void na_compstr (na_long a, na_long b, long *res);
+extern void na_qsort (na_long *a, long n, _PROCEDURE comp);
+
+extern void strlist_init (na_strlist_t **base);
+extern na_strlist_t *strlist_find (na_strlist_t *base, char *s);
+extern na_strlist_t *strlist_cifind (na_strlist_t *base, char *s);
+extern void strlist_change (na_strlist_t **base, na_strlist_t **ptr,
+			       char *s);
+extern void strlist_remove (na_strlist_t **base, char *s);
+extern void strlist_delete (na_strlist_t **base, na_strlist_t *ptr);
+extern void strlist_dispose (na_strlist_t **ptr);
+extern void strlist_empty (na_strlist_t **base);
+extern void strlist_copy (na_strlist_t **dest, na_strlist_t *src);
+
+extern void na_bfand (long *s, long soff, long *d, long doff, long size);
+extern void na_bfbic (long *s, long soff, long *d, long doff, long size);
+extern void na_bfor (long *s, long soff, long *d, long doff, long size);
+extern void na_bfxor (long *s, long soff, long *d, long doff, long size);
+extern char *strnew (char *s);
+extern na_strlist_t *strlist_add (na_strlist_t **base, char *s);
+extern na_strlist_t *strlist_append (na_strlist_t **base, char *s);
+extern na_strlist_t *strlist_insert (na_strlist_t **base, char *s);
+
+extern void strlist_dump (FILE *f, na_strlist_t *base);
 
 #endif /*NEWASM_H*/
 
diff --git a/psys/include/p2c/newci.h b/psys/include/p2c/newci.h
index 0ee3f9c..9f67223 100644
--- a/psys/include/p2c/newci.h
+++ b/psys/include/p2c/newci.h
@@ -1,9 +1,7 @@
-/* Header for module newci, generated by p2c */
 #ifndef NEWCI_H
 #define NEWCI_H
 
 
-
 #ifdef NEWCI_G
 # define vextern
 #else
@@ -11,7 +9,6 @@
 #endif
 
 
-
 #define timers_userphase 0
 
 /*must be zero*/
@@ -23,16 +20,16 @@
 
 /*user defined*/
 
-typedef Char *newci_argarr[100001L];
+typedef char *newci_argarr[100001L];
 
 typedef struct newci_parserec {
-    Char switch_[4];
+    char switch_[4];
     uchar used;
-    Char kind;
+    char kind;
     union {
 	long i;
 	double r;
-	Char *s;
+	char *s;
 	_PROCEDURE p;
 	_PROCEDURE p1;
     } UU;
@@ -52,9 +49,9 @@ typedef struct timers_desc {
     long rate;
     _PROCEDURE proc;
     long count;
-    boolean perm;
+    int perm;
     struct timers_desc *next;
-    Anyptr *user;
+    void* *user;
 } timers_desc;
 
 
@@ -66,15 +63,15 @@ typedef struct timers_desc {
 vextern _PROCEDURE newci_progentryhook;
 vextern _PROCEDURE newci_progexithook;
 extern int P_argc;
-extern Char **P_argv;
-vextern Char *newci_programname;
-vextern Char *newci_programargs;
-vextern boolean newci_rediroutput, newci_redirinput;
-vextern Char newci_inputhighlight;
-vextern boolean newci_markuserflag, newci_ucfilenames, newci_verbose;
+extern char **P_argv;
+vextern char *newci_programname;
+vextern char *newci_programargs;
+vextern int newci_rediroutput, newci_redirinput;
+vextern char newci_inputhighlight;
+vextern int newci_markuserflag, newci_ucfilenames, newci_verbose;
 vextern short newci_errorcode;
-vextern Char *newci_shellname;
-vextern boolean newci_shellflag, respond_flag, respond_enable;
+vextern char *newci_shellname;
+vextern int newci_shellflag, respond_flag, respond_enable;
 vextern long newci_exitcode;
 vextern _PROCEDURE newci_checkrespondhook;
 vextern short timers_phase, timers_permphase;
@@ -83,95 +80,94 @@ vextern FILE **newci_stdterm;
 
 
 
-extern FILE **newci_stdin PV();
-extern FILE **newci_stdout PV();
-extern FILE **newci_stderr PV();
-extern Void newci_parseargs PP((Char *s));
-extern Void newci_parseswitch PP((newci_parserec *tab, long size, Char *bad));
-extern Void newci_eatargument PV();
-extern Void newci_fixfname PP((Char *s, Char *ext, Char *home));
-extern Void newci_forcefname PP((Char *s, Char *ext, Char *home));
-extern Void newci_chainprogram PP((Char *name));
-extern Void newci_markprogram PP((long *id));
-extern Void newci_loadprogram PP((Char *name));
-extern Void newci_reloadprogram PP((Char *name));
-extern Void newci_releaseprogram PP((long *id));
-extern Void newci_runprogram PP((Char *name));
-extern Void newci_shellrunprogram PP((Char *name, int debugging));
-extern Void newci_basicrunprogram PP((Char *name, int debugging));
-extern Void newci_shellescape PP((Char *args));
-extern Void newci_fullshellescape PP((Char *args, Char *opts));
-extern Void newci_fulleditescape PP((Char *fn, Char *opts, long ln, long pos));
-extern Void newci_permanentprogram PV();
-extern Void newci_unpermanentprogram PV();
-extern Void newci_recursiveprogram PV();
-extern Void newci_flushexecutionbits PV();
-extern Void newci_getenv PP((Char *variable, Char *value, boolean *exists));
-extern boolean newci_canreleaseprogram PP((long id));
-extern Void newci_exit PP((long code));
-extern Void newci_assert PP((int flag, Char *msg));
-extern Void newci_ferror PP((Char *msg));
-extern Void newci_merror PP((Char *s, Char *msg));
-extern Char *newci_showerror PP((Char *newci_Result, Char *msg));
-extern Void newci_fescape PP((long esc, long ior, Char *msg));
-extern Void newci_mescape PP((Char *s, long esc, long ior, Char *msg));
-extern Char *newci_showescape PP((Char *newci_Result, long esc, long ior,
-				  Char *msg));
-extern Void newci_nullrecover PV();
-extern Void newci_reescape PV();
-extern Void newci_checkior PV();
-extern Void newci_iorecover PV();
-extern Anyptr *newci_findsymbol PP((Char *name));
-extern Void newci_fixfname PP((Char *s, Char * ext, Char * home));
+extern FILE **newci_stdin ();
+extern FILE **newci_stdout ();
+extern FILE **newci_stderr ();
+extern void newci_parseargs (char *s);
+extern void newci_parseswitch (newci_parserec *tab, long size, char *bad);
+extern void newci_eatargument ();
+extern void newci_fixfname (char *s, char *ext, char *home);
+extern void newci_forcefname (char *s, char *ext, char *home);
+extern void newci_chainprogram (char *name);
+extern void newci_markprogram (long *id);
+extern void newci_loadprogram (char *name);
+extern void newci_reloadprogram (char *name);
+extern void newci_releaseprogram (long *id);
+extern void newci_runprogram (char *name);
+extern void newci_shellrunprogram (char *name, int debugging);
+extern void newci_basicrunprogram (char *name, int debugging);
+extern void newci_shellescape (char *args);
+extern void newci_fullshellescape (char *args, char *opts);
+extern void newci_fulleditescape (char *fn, char *opts, long ln, long pos);
+extern void newci_permanentprogram ();
+extern void newci_unpermanentprogram ();
+extern void newci_recursiveprogram ();
+extern void newci_flushexecutionbits ();
+extern void newci_getenv (char *variable, char *value, int *exists);
+extern int newci_canreleaseprogram (long id);
+extern void newci_exit (long code);
+extern void newci_assert (int flag, char *msg);
+extern void newci_ferror (char *msg);
+extern void newci_merror (char *s, char *msg);
+extern char *newci_showerror (char *newci_Result, char *msg);
+extern void newci_fescape (long esc, long ior, char *msg);
+extern void newci_mescape (char *s, long esc, long ior, char *msg);
+extern char *newci_showescape (char *newci_Result, long esc, long ior,
+				  char *msg);
+extern void newci_nullrecover ();
+extern void newci_reescape ();
+extern void newci_checkior ();
+extern void newci_iorecover ();
+extern void* *newci_findsymbol (char *name);
+extern void newci_fixfname (char *s, char * ext, char * home);
 
 
 /*case sensitive*/
-extern Void newci_initfindsymbol2 PP((newci_fshandle *handle));
-extern Anyptr *newci_findsymbol2 PP((Char *suffix, newci_fshandle *handle,
-				     Char *name));
-extern boolean newci_findprogram PP((Char *name));
-extern boolean newci_findprocedure PP((Char *name, _PROCEDURE *start));
-extern boolean newci_findprocedure2 PP((Char *name, _PROCEDURE *start));
-extern Anyptr *newci_findglobal PP((Char *name, long offset));
-extern Void newci_findabove PP((long *addr, Char *name));
-extern Void newci_findbelow PP((long *addr, Char *name));
-extern Void push_var PP((long *v));
+extern void newci_initfindsymbol2 (newci_fshandle *handle);
+extern void* *newci_findsymbol2 (char *suffix, newci_fshandle *handle,
+				     char *name);
+extern int newci_findprogram (char *name);
+extern int newci_findprocedure (char *name, _PROCEDURE *start);
+extern int newci_findprocedure2 (char *name, _PROCEDURE *start);
+extern void* *newci_findglobal (char *name, long offset);
+extern void newci_findabove (long *addr, char *name);
+extern void newci_findbelow (long *addr, char *name);
+extern void push_var (long *v);
 
 /*also records, arrays*/
-extern Void push_varstr PP((Char *s));
-extern Void push_boolean PP((int b));
-extern Void push_char PP((int c));
-extern Void push_shortint PP((long i));
+extern void push_varstr (char *s);
+extern void push_boolean (int b);
+extern void push_char (int c);
+extern void push_shortint (long i);
 
 /*also enumerated types, with ord()*/
-extern Void push_ptr PP((Anyptr *p));
-extern Void push_integer PP((long i));
-extern Void push_real PP((double r));
-extern Void push_string PP((Char *s));
-extern Void newci_callfunction PP((_PROCEDURE start, long *ret, long retsize));
-extern boolean newci_callboolean PP((_PROCEDURE start));
-extern Void newci_inputbegin PV();
-extern Void newci_inputmap PV();
-extern Void newci_inputunmap PV();
-extern Void newci_inputstring PP((Char *s, int mode, Char *possterm,
-				  Char *term, int echoterm, long *pos));
-extern Void newci_addrecallstr PP((Char *s));
-extern Void interrupt_input PP((int ch));
-extern Void newci_streamopen PP((Char *sfile, int report));
-extern Void newci_streamclose PV();
-extern Void check_respond PV();
-extern Void timers_add PP((timers_desc *t));
-extern Void timers_addperm PP((timers_desc *t));
-extern Void timers_remove PP((timers_desc *t));
-extern long timers_sysclock PV();
-extern Void timers_refreshclock PV();
-extern Void timers_clockon PV();
-extern Void timers_clockoff PV();
-extern Void timers_setalarm PP((long hour, long min));
-extern long newci_fullseconds PV();
-extern Void newci_fulltime PP((long *sec, long *csec));
-extern long newci_dayofweek PV();
-
+extern void push_ptr (void* *p);
+extern void push_integer (long i);
+extern void push_real (double r);
+extern void push_string (char *s);
+extern void newci_callfunction (_PROCEDURE start, long *ret, long retsize);
+extern int newci_callboolean (_PROCEDURE start);
+extern void newci_inputbegin ();
+extern void newci_inputmap ();
+extern void newci_inputunmap ();
+extern void newci_inputstring (char *s, int mode, char *possterm,
+				  char *term, int echoterm, long *pos);
+extern void newci_addrecallstr (char *s);
+extern void interrupt_input (int ch);
+extern void newci_streamopen (char *sfile, int report);
+extern void newci_streamclose ();
+extern void check_respond ();
+extern void timers_add (timers_desc *t);
+extern void timers_addperm (timers_desc *t);
+extern void timers_remove (timers_desc *t);
+extern long timers_sysclock ();
+extern void timers_refreshclock ();
+extern void timers_clockon ();
+extern void timers_clockoff ();
+extern void timers_setalarm (long hour, long min);
+extern long newci_fullseconds ();
+extern void newci_fulltime (long *sec, long *csec);
+extern long newci_dayofweek ();
 
 
 #undef vextern
diff --git a/psys/include/p2c/newcrt.h b/psys/include/p2c/newcrt.h
index bb34900..9d5bbc2 100644
--- a/psys/include/p2c/newcrt.h
+++ b/psys/include/p2c/newcrt.h
@@ -1,4 +1,3 @@
-/* Header for module newCRT, generated by p2c */
 #ifndef NEWCRT_H
 #define NEWCRT_H
 #include <X11/Xlib.h>
@@ -32,7 +31,7 @@ typedef struct nc_windowRec {
     short font, gcolor, gtop, gheight, gleft, gwidth, gminx, gmaxx, gminy,
 	  gmaxy, goffx, goffy, savex, savey, saveHigh;
     long saveSize;
-    Anyptr *saveArea;
+    void* *saveArea;
 } nc_windowRec;
 
 
@@ -93,7 +92,7 @@ typedef struct nc_fontRec {
 
 /* Command translation */
 
-typedef Char nc_commandArray[256];
+typedef char nc_commandArray[256];
 
 
 
@@ -110,7 +109,7 @@ typedef Char nc_commandArray[256];
 
 typedef union nc_crtword {
     struct {
-      Char h, c;
+      char h, c;
     } U1;
     short i;
 } nc_crtword;
@@ -137,7 +136,7 @@ vextern GC nc_gc;
 vextern short nc_highlight, nc_defaultHighlight;
 vextern nc_windowRec *nc_tempWindow;
 vextern nc_fontRec nc_fonts[nc_maxFonts + 1];
-vextern Char *nc_commands;
+vextern char *nc_commands;
 vextern _PROCEDURE nc_startAlphaHook, nc_endAlphaHook;
 vextern struct {
     short left, top, xincr, yincr, width, height, colors, gColors;
@@ -148,99 +147,99 @@ vextern uchar (*nc_colors)[256];
 
 
 /* Simulation routines.  Should GO AWAY. */
-extern Void nc_scrollDown PV();
-extern Void nc_scrollUp PV();
-extern Void nc_setWindow PP((int s, int l));
-extern Void nc_revCheck PP((Char *rev));
-extern Void nc_setbeep PP((int b));
-extern short nc_getNumPlanes PV();
-extern short nc_getAlphaPlanes PV();
-extern Void nc_setAlphaPlanes PP((int num));
-extern short nc_getGraphicsPlanes PV();
-extern Void nc_setGraphicsPlanes PP((int num));
-extern boolean nc_alphashared PV();
-extern Void nc_sharealpha PP((int b));
-extern Void nc_setAlpha PP((int on));
-extern Void nc_setGraphics PP((int on));
-extern short nc_getPlanes PV();
-extern Void nc_setPlanes PP((int mask));
-extern Void nc_putChar PP((int x, int y, int c));
-extern Void nc_putChars PP((int x, int y, int len, Char *c));
-extern Void nc_putStr PP((int x, int y, Char *s));
-extern Void nc_writeStr PP((int x, int y, Char *s));
-extern Char nc_getChar PP((int x, int y));
-extern Void nc_getChars PP((int x, int y, int len, Char *c));
-extern Void nc_getStr PP((int x, int y, Char *s));
-extern short nc_getHighlight PP((int x, int y));
-extern Void nc_setHighlight PP((int high));
-extern Void nc_writeHighlight PP((int x, int y, int len, int newhigh));
-extern Void nc_orHighlight PP((int x, int y, int len, int newhigh));
-extern Void nc_andnotHighlight PP((int x, int y, int len, int newhigh));
-extern Void nc_putWord PP((int x, int y, int w));
-extern Void nc_putWords PP((int x, int y, int len, short *w));
-extern short nc_getWord PP((int x, int y));
-extern Void nc_getWords PP((int x, int y, int len, short *w));
-extern Void nc_makeWindow PP((nc_windowRec *w, int ptop, int pheight,
-			      int pleft, int pwidth));
-extern Void nc_setWindow_ PP((nc_windowRec *w));
-extern Void nc_saveWindow PV();
-extern Void nc_restoreWindow PV();
-extern Void nc_exchangeWindow PV();
-extern Void nc_refreshON PV();
-extern Void nc_refreshOFF PV();
-extern Void nc_refreshXY PP((int x, int y, int dx, int dy));
-extern Void nc_refreshWindow PV();
-extern Void nc_refreshScreenXY PP((int x, int y, int dx, int dy));
-extern Void nc_refreshScreen PV();
-extern short nc_gType PV();
-extern Void nc_aCMap PP((int col, int r, int g, int b));
-extern Void nc_defaCMap PV();
-extern Void nc_gCMap PP((int col, int r, int g, int b));
-extern Void nc_defgCMap PV();
-extern Void nc_gColor PP((int col));
-extern Void nc_gLine PP((int x1, int y1, int x2, int y2));
-extern Void nc_gFillRect PP((int x1, int y1, int x2, int y2));
-extern Void nc_gBlit PP((int repl_rule, int dox, int doy, int sox, int soy,
-			 int width, int height));
-extern Void nc_gClear PV();
-extern Void nc_gClipToWindow PP((int x1, int y1, int x2, int y2));
-extern Void nc_gClipToHardware PP((int x1, int y1, int x2, int y2));
-extern Void nc_clearXY PP((int x, int y, int dx, int dy));
-extern Void nc_clear PV();
-extern Void nc_scrollUp_ PV();
-extern Void nc_scrollDown_ PV();
-extern Void nc_scrollLeft PV();
-extern Void nc_scrollRight PV();
-extern Void nc_scrollXY PP((int dx, int dy));
-extern Void nc_insChar PP((int x, int y, int numChars));
-extern Void nc_insLine PP((int y, int numLines));
-extern Void nc_getXY PP((long *x, long *y));
-extern Void nc_setXY PP((int x, int y));
-extern Void nc_gotoXY PP((int x, int y));
-extern Void nc_cursXY PP((int x, int y));
-extern Void nc_cursorOn PV();
-extern Void nc_cursorOff PV();
-extern Void nc_nothing PV();
-extern Void nc_unInit PV();
-extern Void nc_init PV();
-extern Void nc_setDevice PP((long newDevice));
-
-char *nc_fgets PP((char *s, int n, FILE *stream));
-char *nc_gets PP((char *s));
+extern void nc_scrollDown ();
+extern void nc_scrollUp ();
+extern void nc_setWindow (int s, int l);
+extern void nc_revCheck (char *rev);
+extern void nc_setbeep (int b);
+extern short nc_getNumPlanes ();
+extern short nc_getAlphaPlanes ();
+extern void nc_setAlphaPlanes (int num);
+extern short nc_getGraphicsPlanes ();
+extern void nc_setGraphicsPlanes (int num);
+extern int nc_alphashared ();
+extern void nc_sharealpha (int b);
+extern void nc_setAlpha (int on);
+extern void nc_setGraphics (int on);
+extern short nc_getPlanes ();
+extern void nc_setPlanes (int mask);
+extern void nc_putChar (int x, int y, int c);
+extern void nc_putChars (int x, int y, int len, char *c);
+extern void nc_putStr (int x, int y, char *s);
+extern void nc_writeStr (int x, int y, char *s);
+extern char nc_getChar (int x, int y);
+extern void nc_getChars (int x, int y, int len, char *c);
+extern void nc_getStr (int x, int y, char *s);
+extern short nc_getHighlight (int x, int y);
+extern void nc_setHighlight (int high);
+extern void nc_writeHighlight (int x, int y, int len, int newhigh);
+extern void nc_orHighlight (int x, int y, int len, int newhigh);
+extern void nc_andnotHighlight (int x, int y, int len, int newhigh);
+extern void nc_putWord (int x, int y, int w);
+extern void nc_putWords (int x, int y, int len, short *w);
+extern short nc_getWord (int x, int y);
+extern void nc_getWords (int x, int y, int len, short *w);
+extern void nc_makeWindow (nc_windowRec *w, int ptop, int pheight,
+			      int pleft, int pwidth);
+extern void nc_setWindow_ (nc_windowRec *w);
+extern void nc_saveWindow ();
+extern void nc_restoreWindow ();
+extern void nc_exchangeWindow ();
+extern void nc_refreshON ();
+extern void nc_refreshOFF ();
+extern void nc_refreshXY (int x, int y, int dx, int dy);
+extern void nc_refreshWindow ();
+extern void nc_refreshScreenXY (int x, int y, int dx, int dy);
+extern void nc_refreshScreen ();
+extern short nc_gType ();
+extern void nc_aCMap (int col, int r, int g, int b);
+extern void nc_defaCMap ();
+extern void nc_gCMap (int col, int r, int g, int b);
+extern void nc_defgCMap ();
+extern void nc_gColor (int col);
+extern void nc_gLine (int x1, int y1, int x2, int y2);
+extern void nc_gFillRect (int x1, int y1, int x2, int y2);
+extern void nc_gBlit (int repl_rule, int dox, int doy, int sox, int soy,
+			 int width, int height);
+extern void nc_gClear ();
+extern void nc_gClipToWindow (int x1, int y1, int x2, int y2);
+extern void nc_gClipToHardware (int x1, int y1, int x2, int y2);
+extern void nc_clearXY (int x, int y, int dx, int dy);
+extern void nc_clear ();
+extern void nc_scrollUp_ ();
+extern void nc_scrollDown_ ();
+extern void nc_scrollLeft ();
+extern void nc_scrollRight ();
+extern void nc_scrollXY (int dx, int dy);
+extern void nc_insChar (int x, int y, int numChars);
+extern void nc_insLine (int y, int numLines);
+extern void nc_getXY (long *x, long *y);
+extern void nc_setXY (int x, int y);
+extern void nc_gotoXY (int x, int y);
+extern void nc_cursXY (int x, int y);
+extern void nc_cursorOn ();
+extern void nc_cursorOff ();
+extern void nc_nothing ();
+extern void nc_unInit ();
+extern void nc_init ();
+extern void nc_setDevice (long newDevice);
+
+char *nc_fgets (char *s, int n, FILE *stream);
+char *nc_gets (char *s);
 
 /* added for C99 clang compatibility */
 
-void nc_putc PP((uchar c, FILE * outfile));
-void nc_putchar PP((uchar c));
-void nc_puts PP((Char * s));
-void nc_fputs PP((Char * s, FILE *outfile));
+void nc_putc (uchar c, FILE * outfile);
+void nc_putchar (uchar c);
+void nc_puts (char * s);
+void nc_fputs (char * s, FILE *outfile);
 
 #ifdef VARARGS
-void nc_printfPP((va_alist));
-void nc_fprintf PP((va_alist));
+void nc_printf(va_alist);
+void nc_fprintf (va_alist);
 #else
-void nc_printf PP((Char * fmt, ...));
-void nc_fprintf PP((FILE * outfile, Char * fmt, ...));
+void nc_printf (char * fmt, ...);
+void nc_fprintf (FILE * outfile, char * fmt, ...);
 #endif
 
 #define printf nc_printf 
diff --git a/psys/include/p2c/newkbd.h b/psys/include/p2c/newkbd.h
index f75cbdd..d15bbec 100644
--- a/psys/include/p2c/newkbd.h
+++ b/psys/include/p2c/newkbd.h
@@ -1,47 +1,19 @@
-/* Header for module NEWKBD, generated by p2c */
 #ifndef NEWKBD_H
 #define NEWKBD_H
 
 
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef SYSDEVS_H
 #include <p2c/sysdevs.h>
-#endif
-
-#ifndef ASM_H
-#include <p2c/asm.h>
-#endif
-
-#ifndef MISC_H
 #include <p2c/misc.h>
-#endif
-
-
-
-#ifdef NEWKBD_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
 
 #define nk_newkbddatestamp "Version of Jan 15, 1985 6:12 pm"
 
 
-
 typedef CRTWORD nk_scrtype[];
 
-
-
 /*caged stuff has been removed*/
 
-typedef Char nk_progkeys[20][72];
-
+typedef char nk_progkeys[20][72];
 
 
 #define nk_keylow       (-2)
@@ -81,7 +53,6 @@ typedef struct nk_keytransinfo {
 } nk_keytransinfo;
 
 
-
 typedef struct nk_userkeyrec {
     struct nk_userkeyrec *next;
     _PROCEDURE proc;
@@ -90,7 +61,6 @@ typedef struct nk_userkeyrec {
 } nk_userkeyrec;
 
 
-
 typedef struct nk_remap_info {
     short rnum, rmod;
     nk_keyinforec rinfo;
@@ -99,60 +69,56 @@ typedef struct nk_remap_info {
 typedef nk_remap_info nk_remap_array[];
 
 
-
-vextern Char nk_error_fid[fidleng + 1];
-vextern CRTWORD *nk_screen;
+extern char nk_error_fid[fidleng + 1];
+extern CRTWORD *nk_screen;
 #define nk_screenhigh        nc_highlight
 #define nk_screenwidth       (80)
 /*  vextern short nk_screenwidth, nk_screenhigh;  */
-vextern Char (*nk_k0k9)[72];
-vextern boolean nk_capslock;
+extern char (*nk_k0k9)[72];
+extern int nk_capslock;
 
 
 
-extern Void nk_lockkeyboard PV();
-extern Void nk_unlockkeyboard PV();
+extern void nk_lockkeyboard ();
+extern void nk_unlockkeyboard ();
 #define nk_keybufsize m_pollkbd
-/*  extern long nk_keybufsize PV();  */
-extern long nk_keybuffree PV();
-extern long nk_keybufmax PV();
-extern Void nk_keybufclear PV();
-extern Void nk_keylastclear PV();
+/*  extern long nk_keybufsize ();  */
+extern long nk_keybuffree ();
+extern long nk_keybufmax ();
+extern void nk_keybufclear ();
+extern void nk_keylastclear ();
 #define nk_getkey m_inkey
-/*  extern Char nk_getkey PV();  */
-extern Void nk_ungetkey PP((int c));
-extern Void nk_addkey PP((int c));
+/*  extern char nk_getkey PV();  */
+extern void nk_ungetkey (int c);
+extern void nk_addkey (int c);
 #define nk_testkey(x)        m_testkey()
-/*  extern Char nk_testkey PP((int whichkey));  */
-extern Void nk_getstr PP((Char *s));
-extern Void nk_getstruntil PP((int c, Char *s));
-extern Void nk_ungetstr PP((Char *s));
-extern Void nk_addstr PP((Char *s));
+/*  extern char nk_testkey (int whichkey);  */
+extern void nk_getstr (char *s);
+extern void nk_getstruntil (int c, char *s);
+extern void nk_ungetstr (char *s);
+extern void nk_addstr (char *s);
 #define nk_gotoxy(x,y)      nc_gotoXY(x,y)
 #define nk_getxy(x,y)       nc_getXY(x,y)
-/*  extern Void nk_gotoxy PP((int x, int y));  */
-/*  extern Void nk_getxy PP((long *x, long *y));  */
-extern Void nk_crtwritestr PP((int x, int y, Char *s, int field));
-extern Void nk_crtreadstr PP((int x, int y, Char *s));
-extern Void nk_getcomperr PP((long errnum, Char *errstr));
+/*  extern void nk_gotoxy (int x, int y);  */
+/*  extern void nk_getxy (long *x, long *y);  */
+extern void nk_crtwritestr (int x, int y, char *s, int field);
+extern void nk_crtreadstr (int x, int y, char *s);
+extern void nk_getcomperr (long errnum, char *errstr);
 #define nk_setrpgbufsize(x)     0
-/*  extern short nk_setrpgbufsize PP((int newsize));  */
-extern boolean nk_setcapslock PP((int newcaps));
-extern Void nk_settransarray PP((int opcode, nk_keytransinfo **table));
-extern Void nk_set_trans_array PP((int opcode, int rpgbuf,
-				   nk_keytransinfo **table));
-extern Void nk_adduserkey PP((int perm, int keynum, int keymod,
-			      _PROCEDURE proc, nk_userkeyrec *ukr));
-extern Void nk_deluserkey PP((nk_userkeyrec *ukr));
-extern Void nk_restoreuserkeys PV();
-extern Void nk_remap PP((int numkeys, nk_remap_info *newdefs));
-extern Void nk_unmap PP((int numkeys, nk_remap_info *newdefs));
-extern Void nk_newkbdinstall PV();
-extern Void nk_newkbdremove PV();
-
-
-
-#undef vextern
+/*  extern short nk_setrpgbufsize (int newsize);  */
+extern int nk_setcapslock (int newcaps);
+extern void nk_settransarray (int opcode, nk_keytransinfo **table);
+extern void nk_set_trans_array (int opcode, int rpgbuf,
+				   nk_keytransinfo **table);
+extern void nk_adduserkey (int perm, int keynum, int keymod,
+			      _PROCEDURE proc, nk_userkeyrec *ukr);
+extern void nk_deluserkey (nk_userkeyrec *ukr);
+extern void nk_restoreuserkeys ();
+extern void nk_remap (int numkeys, nk_remap_info *newdefs);
+extern void nk_unmap (int numkeys, nk_remap_info *newdefs);
+extern void nk_newkbdinstall ();
+extern void nk_newkbdremove ();
+
 
 #endif /*NEWKBD_H*/
 
diff --git a/psys/include/p2c/newtablet.h b/psys/include/p2c/newtablet.h
index 847e1cd..4b0e17f 100644
--- a/psys/include/p2c/newtablet.h
+++ b/psys/include/p2c/newtablet.h
@@ -1,9 +1,7 @@
-/* Header for module NEWTABLET, generated by p2c */
 #ifndef NEWTABLET_H
 #define NEWTABLET_H
 
 
-
 #ifdef NEWTABLET_G
 # define vextern
 #else
@@ -16,7 +14,7 @@ typedef enum {
     nt_none, nt_tablet, nt_mouse, nt_dials, nt_knob
 } nt_dev;
 
-typedef Char nt_mkeytype[4][1 - 0 + 1];
+typedef char nt_mkeytype[4][1 - 0 + 1];
 
 
 
@@ -30,28 +28,27 @@ typedef Char nt_mkeytype[4][1 - 0 + 1];
 
 vextern long nt_dial[9];
 vextern long nt_knobX, nt_knobY;
-vextern boolean nt_IsCursor[(long)nt_maxDev - (long)nt_minDev + 1];
+vextern int nt_IsCursor[(long)nt_maxDev - (long)nt_minDev + 1];
 vextern nt_mkeytype nt_MButtonKey;
 vextern nt_dev nt_PreferredTablet;
 
 
 
-extern boolean nt_install PV( );
-extern boolean nt_init PP((long device));
-extern boolean nt_read PP((long *x, long *y, long *status));
-extern Void nt_info PP((Char *s, long *xl, long *yl, long *xh, long *yh));
-extern Void nt_devname PP((Char *s, int dev));
-extern nt_dev nt_devtype PP((Char *s));
-extern boolean nt_HasDevice PP((int dev));
-extern Void nt_ReadDevice PP((int dev, long *x, long *y, long *status));
-extern Void nt_DevChange PP((int dev, long *dx, long *dy, long *status));
-extern Void nt_SetDevice PP((int dev, long x, long y));
-extern Void nt_ReadMouse PP((long *x, long *y, long *mstatus));
-extern Void nt_cleardials PV( );
-extern long nt_dialchange PP((long dial));
-extern Void nt_setdial PP((long dial, long val));
-extern Void nt_ResetMouseButtons PV( );
-
+extern int nt_install ();
+extern int nt_init (long device);
+extern int nt_read (long *x, long *y, long *status);
+extern void nt_info (char *s, long *xl, long *yl, long *xh, long *yh);
+extern void nt_devname (char *s, int dev);
+extern nt_dev nt_devtype (char *s);
+extern int nt_HasDevice (int dev);
+extern void nt_ReadDevice (int dev, long *x, long *y, long *status);
+extern void nt_DevChange (int dev, long *dx, long *dy, long *status);
+extern void nt_SetDevice (int dev, long x, long y);
+extern void nt_ReadMouse (long *x, long *y, long *mstatus);
+extern void nt_cleardials ();
+extern long nt_dialchange (long dial);
+extern void nt_setdial (long dial, long val);
+extern void nt_ResetMouseButtons ();
 
 
 #undef vextern
diff --git a/psys/include/p2c/numex.h b/psys/include/p2c/numex.h
index 5bd2734..87b0cac 100644
--- a/psys/include/p2c/numex.h
+++ b/psys/include/p2c/numex.h
@@ -1,16 +1,8 @@
-/* Header for module numex, generated by p2c */
 #ifndef NUMEX_H
 #define NUMEX_H
 
 
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-#ifndef MATH_H
-#include <p2c/math.h>
-#endif
-
 
 #ifdef NUMEX_G
 # define vextern
@@ -92,28 +84,28 @@ typedef struct ne_nexrec {
  * Field width for ERR assumes enum ne_errorkind has 9 elements [105] */
     long i;
     double r;
-    Char *s;
+    char *s;
     struct {
       long *ip;
-      na_strlist *ips;
+      na_strlist_t *ips;
       struct ne_nexrec *p1, *p2, *p3, *p4;
     } U10;
     struct {
       double *rp;
-      na_strlist *rps;
+      na_strlist_t *rps;
     } U11;
     struct {
-      Char **sp;
-      na_strlist *sps;
+      char **sp;
+      na_strlist_t *sps;
     } U12;
     struct {
       ne_functionrec *fp;
-      na_strlist *fps;
+      na_strlist_t *fps;
     } U15;
     struct {
       struct ne_nexrec **ep;
       /*!*/
-      na_strlist *eps;
+      na_strlist_t *eps;
     } U16;
     struct {
       na_quadword qw2;
@@ -124,12 +116,12 @@ typedef struct ne_nexrec {
 
 
 typedef struct ne_desc {
-  na_strlist *symtab;
+  na_strlist_t *symtab;
   unsigned casesens : 1, builtin : 1, scaled : 1, doubleeq : 1, isfunc : 1,
 	   dummy0 : 7, error : 4;
 /* p2c: numex.text, line 123: Note:
  * Field width for ERROR assumes enum ne_errorkind has 9 elements [105] */
-  Char units[6];
+  char units[6];
   long startident[9], ident[9];   /*must not contain #0*/
   _PROCEDURE symproc;
   na_long dummy1, dummy2;
@@ -158,85 +150,81 @@ typedef struct ne_desc {
 vextern na_quadword *ne_argarray;
 
 
-extern Void ne_init PP((ne_desc *desc));
-extern Void ne_compile PP((Char *ex, ne_nexrec **nex, ne_desc *desc));
+extern void ne_init (ne_desc *desc);
+extern void ne_compile (char *ex, ne_nexrec **nex, ne_desc *desc);
 /*
    procedure ne_intcompile(anyvar ex : na_chararray; var endp : integer;
                            var nex : ne_nexptr; var desc : ne_desc);
 */
-extern Void ne_intcompile PP((Char *ex, long *endp, ne_nexrec **nex,
-			      ne_desc *desc));
-extern Void ne_dump PP((ne_nexrec *nex));
-extern Void ne_uncompile PP((ne_nexrec *nex, Char *ex, ne_desc *desc));
-extern Void ne_copy PP((ne_nexrec *nex, ne_nexrec **newnex));
-extern Void ne_dispose PP((ne_nexrec **nex));
-extern Void ne_constant PP((ne_nexrec **nex, ne_desc *desc, Char *which));
-extern Void ne_notconstant PP((ne_nexrec **nex, ne_desc *desc, Char *which));
-extern Void ne_constantlist PP((ne_nexrec **nex, ne_desc *desc,
-				na_strlist *which));
-extern Void ne_notconstantlist PP((ne_nexrec **nex, ne_desc *desc,
-				   na_strlist *which));
-extern ne_nexrec *ne_makeerror PP((ne_errorkind err));
-extern ne_datatype ne_exprtype PP((ne_nexrec *nex));
-extern ne_nexrec *ne_typecast PP((ne_nexrec *nex, ne_datatype typ));
-extern Void ne_evaluate PP((ne_nexrec *nex, ne_nexrec *res));
-extern long ne_ievaluate PP((ne_nexrec *nex, ne_desc *desc));
-extern double ne_revaluate PP((ne_nexrec *nex, ne_desc *desc));
-extern Char *ne_sevaluate PP((Char *Result, ne_nexrec *nex, ne_desc *desc));
-extern long ne_ievalexpr PP((Char *ex, ne_desc *desc));
-extern double ne_revalexpr PP((Char *ex, ne_desc *desc));
-
-extern Char *ne_sevalexpr PP((Char *Result, Char *ex, ne_desc *desc));
-extern Void ne_makeintconst PP((na_strlist *sym, long i));
-extern Void ne_makesrealconst PP((na_strlist *sym, double r));
-extern Void ne_makerealconst PP((na_strlist *sym, double r));
-extern Void ne_makestrconst PP((na_strlist *sym, Char *s));
-extern Void ne_makeintvar PP((na_strlist *sym, long *i));
-extern Void ne_makerealvar PP((na_strlist *sym, double *r));
-extern Void ne_makerealxvar PP((na_strlist *sym, double *r));
-extern Void ne_makestrvar PP((na_strlist *sym, Char *s));
-extern Void ne_makestrptrvar PP((na_strlist *sym, Char **sp));
-extern Void ne_makeintfunc PP((na_strlist *sym, ne_datatype t1,
+extern void ne_intcompile (char *ex, long *endp, ne_nexrec **nex,
+			      ne_desc *desc);
+extern void ne_dump (ne_nexrec *nex);
+extern void ne_uncompile (ne_nexrec *nex, char *ex, ne_desc *desc);
+extern void ne_copy (ne_nexrec *nex, ne_nexrec **newnex);
+extern void ne_dispose (ne_nexrec **nex);
+extern void ne_constant (ne_nexrec **nex, ne_desc *desc, char *which);
+extern void ne_notconstant (ne_nexrec **nex, ne_desc *desc, char *which);
+extern void ne_constantlist (ne_nexrec **nex, ne_desc *desc,
+				na_strlist_t *which);
+extern void ne_notconstantlist (ne_nexrec **nex, ne_desc *desc,
+				   na_strlist_t *which);
+extern ne_nexrec *ne_makeerror (ne_errorkind err);
+extern ne_datatype ne_exprtype (ne_nexrec *nex);
+extern ne_nexrec *ne_typecast (ne_nexrec *nex, ne_datatype typ);
+extern void ne_evaluate (ne_nexrec *nex, ne_nexrec *res);
+extern long ne_ievaluate (ne_nexrec *nex, ne_desc *desc);
+extern double ne_revaluate (ne_nexrec *nex, ne_desc *desc);
+extern char *ne_sevaluate (char *Result, ne_nexrec *nex, ne_desc *desc);
+extern long ne_ievalexpr (char *ex, ne_desc *desc);
+extern double ne_revalexpr (char *ex, ne_desc *desc);
+
+extern char *ne_sevalexpr (char *Result, char *ex, ne_desc *desc);
+extern void ne_makeintconst (na_strlist_t *sym, long i);
+extern void ne_makesrealconst (na_strlist_t *sym, double r);
+extern void ne_makerealconst (na_strlist_t *sym, double r);
+extern void ne_makestrconst (na_strlist_t *sym, char *s);
+extern void ne_makeintvar (na_strlist_t *sym, long *i);
+extern void ne_makerealvar (na_strlist_t *sym, double *r);
+extern void ne_makerealxvar (na_strlist_t *sym, double *r);
+extern void ne_makestrvar (na_strlist_t *sym, char *s);
+extern void ne_makestrptrvar (na_strlist_t *sym, char **sp);
+extern void ne_makeintfunc (na_strlist_t *sym, ne_datatype t1,
 			       ne_datatype t2, ne_datatype t3,
-			       _PROCEDURE pr));
-extern Void ne_makerealfunc PP((na_strlist *sym, ne_datatype t1,
+			       _PROCEDURE pr);
+extern void ne_makerealfunc (na_strlist_t *sym, ne_datatype t1,
 				ne_datatype t2, ne_datatype t3,
-				_PROCEDURE pr));
-extern Void ne_makestrfunc PP((na_strlist *sym, ne_datatype t1,
+				_PROCEDURE pr);
+extern void ne_makestrfunc (na_strlist_t *sym, ne_datatype t1,
 			       ne_datatype t2, ne_datatype t3,
-			       _PROCEDURE pr));
-extern Void ne_makeintmfunc PP((na_strlist *sym, long nargs,
-				ne_datatype *args, _PROCEDURE pr));
-extern Void ne_makerealmfunc PP((na_strlist *sym, long nargs,
-				 ne_datatype *args, _PROCEDURE pr));
-extern Void ne_makestrmfunc PP((na_strlist *sym, long nargs,
-				ne_datatype *args, _PROCEDURE pr));
-extern Void ne_makeintsfunc PP((na_strlist *sym, long nargs,
-				ne_datatype *args, ne_nexrec **nex));
-extern Void ne_makerealsfunc PP((na_strlist *sym, long nargs,
-				 ne_datatype *args, ne_nexrec **nex));
-extern Void ne_makestrsfunc PP((na_strlist *sym, long nargs,
-				ne_datatype *args, ne_nexrec **nex));
-extern Void ne_makeintarg PP((na_strlist *sym, long i));
-extern Void ne_makerealarg PP((na_strlist *sym, long i));
-extern Void ne_makestrarg PP((na_strlist *sym, long i));
-extern Void ne_setminargs PP((na_strlist *sym, long minargs));
-extern Void ne_setmaxargs PP((na_strlist *sym, long maxargs));
-extern Void ne_makestaticfunc PP((na_strlist *sym));
-extern Void ne_disposesym PP((na_strlist *sym));
-
-extern Void ne_disposesymtab PP((na_strlist **symtab));
-extern boolean ne_condeval PP((ne_nexrec *nex));
-extern long ne_ieval PP((ne_nexrec *nex));
-extern double ne_reval PP((ne_nexrec *nex));
-
-extern Char *ne_seval PP((Char *Result, ne_nexrec *nex));
-
-
-
-
-
-extern boolean ne_readreal PP((Char *s, double *r, ne_desc *desc));
+			       _PROCEDURE pr);
+extern void ne_makeintmfunc (na_strlist_t *sym, long nargs,
+				ne_datatype *args, _PROCEDURE pr);
+extern void ne_makerealmfunc (na_strlist_t *sym, long nargs,
+				 ne_datatype *args, _PROCEDURE pr);
+extern void ne_makestrmfunc (na_strlist_t *sym, long nargs,
+				ne_datatype *args, _PROCEDURE pr);
+extern void ne_makeintsfunc (na_strlist_t *sym, long nargs,
+				ne_datatype *args, ne_nexrec **nex);
+extern void ne_makerealsfunc (na_strlist_t *sym, long nargs,
+				 ne_datatype *args, ne_nexrec **nex);
+extern void ne_makestrsfunc (na_strlist_t *sym, long nargs,
+				ne_datatype *args, ne_nexrec **nex);
+extern void ne_makeintarg (na_strlist_t *sym, long i);
+extern void ne_makerealarg (na_strlist_t *sym, long i);
+extern void ne_makestrarg (na_strlist_t *sym, long i);
+extern void ne_setminargs (na_strlist_t *sym, long minargs);
+extern void ne_setmaxargs (na_strlist_t *sym, long maxargs);
+extern void ne_makestaticfunc (na_strlist_t *sym);
+extern void ne_disposesym (na_strlist_t *sym);
+
+extern void ne_disposesymtab (na_strlist_t **symtab);
+extern int ne_condeval (ne_nexrec *nex);
+extern long ne_ieval (ne_nexrec *nex);
+extern double ne_reval (ne_nexrec *nex);
+
+extern char *ne_seval (char *Result, ne_nexrec *nex);
+
+extern int ne_readreal (char *s, double *r, ne_desc *desc);
 
 
 #undef vextern
diff --git a/psys/include/p2c/p2c.h b/psys/include/p2c/p2c.h
index 69c2bfc..d36279a 100644
--- a/psys/include/p2c/p2c.h
+++ b/psys/include/p2c/p2c.h
@@ -1,38 +1,11 @@
 #ifndef P2C_H
 #define P2C_H
 
-
-/* Header file for code generated by "p2c", the Pascal-to-C translator */
-
-/* "p2c"  Copyright (C) 1989 Dave Gillespie, version --VERSION--.
- * This file may be copied, modified, etc. in any way.  It is not restricted
- * by the licence agreement accompanying p2c itself.
- */
-
-
-#ifdef OS2
-/* The pragmas below are needed for OS/2 C++ due to _ prepend problem **mdg** */
-      #pragma map( access    , "_access"     )
-      #pragma map( read      , "_read"       )
-      #pragma map( execlp    , "_execlp"     )
-      #pragma map( cfree     , "_cfree"      )
-      #pragma map( wait      , "_wait"       )
-      #pragma map( link      , "_link"       )
-#endif
-  
 #include <stdio.h>
-#ifdef ultrix
-#include <stdlib.h>
-#define HAS_STDLIB
-#endif
 
 /* If the following heuristic fails, compile -DBSD=0 for non-BSD systems,
    or -DBSD=1 for BSD systems. */
 
-#ifdef M_XENIX
-# define BSD 0
-#endif
-
 #ifdef FILE       /* a #define in BSD, a typedef in SYSV (hp-ux, at least) */
 # ifndef BSD	  /*  (a convenient, but horrible kludge!) */
 #  define BSD 1
@@ -46,72 +19,32 @@
 #endif
 
 
-#if defined( __STDC__) || defined(OS2)
 # include <stddef.h>
 # include <stdlib.h>
 # define HAS_STDLIB
 # define __CAT__(a,b)a##b
-#else
-# ifndef BSD
-#  include <memory.h>
-# endif
-# ifdef hpux
-#  ifdef _INCLUDE__STDC__
-#   include <stddef.h>
-#   include <stdlib.h>
-#  endif
-# endif
-# include <sys/types.h>
-# define __ID__(a)a
-# define __CAT__(a,b)__ID__(a)b
-#endif
 
-#ifdef OS2
-#define getcwd(a, b) _getcwd(a, b)
-#endif
-  
+#include <string.h>
 
 #ifdef BSD
-#include <strings.h>
 #ifdef __MACHTEN__
 extern char *strdup(const char *);
 #endif
-#else
-# include <string.h>
 #endif
 
 #ifdef linux
-#include <string.h>
-#include <stdlib.h>
 #include <unistd.h>
 #endif
 
-#if (!defined(BSD) && !defined(__sgi) && !defined(__alpha__)) 
+#if (!defined(BSD) && !defined(__alpha__)) 
 # define log1p(X) log(1+(X))
 #endif
 
-#if defined(rs6000) || defined(ultrix)
-extern char *strdup();
-extern char *strpbrk(/* const char *s1, const char *s2 */);
-#endif
-
 #include <ctype.h>
 #include <math.h>
 #include <setjmp.h>
 #include <assert.h>
 
-/* Undefine these if your library has these */
-
-#if defined(rs6000) || defined(OS2)
-#else
-#define LACK_LABS      
-#endif
-
-#if defined(__sgi) || defined(OS2) || defined(ultrix) || defined(__hp9000s800) || defined(rs6000) || defined(linux)
-#else
-# define LACK_MEMMOVE 
-#endif
-
 typedef struct __p2c_jmp_buf {
     struct __p2c_jmp_buf *next;
     jmp_buf jbuf;
@@ -138,13 +71,6 @@ typedef struct __p2c_jmp_buf {
 #endif
 
 
-
-#ifdef M_XENIX  /* avoid compiler bug */
-# define SHORT_MAX  (32767)
-# define SHORT_MIN  (-32768)
-#endif
-
-
 /* The following definitions work only on twos-complement machines */
 #ifndef SHORT_MAX
 # define SHORT_MAX  ((short)(((unsigned short) -1) >> 1))
@@ -175,57 +101,8 @@ typedef struct __p2c_jmp_buf {
 
 #define SETBITS  32
 
-
-#if defined( __STDC__) || defined(OS2)
-# define Signed     signed
-# define Void       void      /* Void f() = procedure */
-# ifndef Const
-#  define Const     const
-# endif
-# ifndef Volatile
-# define Volatile  volatile
-# endif
-# define PP(x)      x         /* function prototype */
-# define PV()       (void)    /* null function prototype */
-typedef void *Anyptr;
-typedef const void *Constptr;
-#else
-# define Signed
-# define Void       void
-# ifndef Const
-#  define Const
-# endif
-# ifndef Volatile
-#  define Volatile
-# endif
-# define PP(x)      ()
-# define PV()       ()
-typedef char *Anyptr;
-typedef const char *Constptr;
-#endif
-
-#ifdef __GNUC__
-# define Inline     inline
-#else
-# define Inline
-#endif
-
-#define Register    register  /* Register variables */
-#define Char        char      /* Characters (not bytes) */
-
-#ifndef Static
-# define Static     static    /* Private global funcs and vars */
-#endif
-
-#ifndef Local
-# define Local      static    /* Nested functions */
-#endif
-
-typedef Signed   char schar;
-#if !( defined( __osf__ ) && defined( __GNUC__ ) )
+typedef signed char schar;
 typedef unsigned char uchar;
-#endif
-typedef unsigned char boolean;
 
 #ifndef true
 # define true    1
@@ -234,7 +111,8 @@ typedef unsigned char boolean;
 
 
 typedef struct {
-    Anyptr proc, link;
+    void* proc;
+	void* link;
 } _PROCEDURE;
 
 #ifndef _FNSIZE
@@ -242,91 +120,58 @@ typedef struct {
 #endif
 
 
-extern Void    PASCAL_MAIN  PP( (int, Char **) );
-extern Char    **P_argv;
+extern void    PASCAL_MAIN   (int, char **);
+extern char    **P_argv;
 extern int     P_argc;
 extern short   P_escapecode;
 extern int     P_ioresult;
 extern __p2c_jmp_buf *__top_jb;
 extern int     bigendian;
 
-#ifdef P2C_H_PROTO   /* if you have Ansi C but non-prototyped header files */
-extern Char    *strcat      PP( (Char *, Const Char *) );
-extern Char    *strchr      PP( (Const Char *, int) );
-extern int      strcmp      PP( (Const Char *, Const Char *) );
-extern Char    *strcpy      PP( (Char *, Const Char *) );
-extern size_t   strlen      PP( (Const Char *) );
-extern Char    *strncat     PP( (Char *, Const Char *, size_t) );
-extern int      strncmp     PP( (Const Char *, Const Char *, size_t) );
-extern Char    *strncpy     PP( (Char *, Const Char *, size_t) );
-extern Char    *strrchr     PP( (Const Char *, int) );
-
-extern Anyptr   memchr      PP( (Constptr, int, size_t) );
-extern Anyptr   memmove     PP( (Anyptr, Constptr, size_t) );
-extern Anyptr   memset      PP( (Anyptr, int, size_t) );
-#ifndef memcpy
-extern Anyptr   memcpy      PP( (Anyptr, Constptr, size_t) );
-extern int      memcmp      PP( (Constptr, Constptr, size_t) );
-#endif
-
-extern int      atoi        PP( (Const Char *) );
-extern double   atof        PP( (Const Char *) );
-extern long     atol        PP( (Const Char *) );
-extern double   strtod      PP( (Const Char *, Char **) );
-extern long     strtol      PP( (Const Char *, Char **, int) );
-#endif /*P2C_H_PROTO*/
-
-#ifndef HAS_STDLIB
-extern Anyptr   malloc      PP( (size_t) );
-extern Void     free        PP( (Anyptr) );
-#endif
-
-extern int      _OutMem     PV();
-extern int      _CaseCheck  PV();
-extern int      _NilCheck   PV();
-extern char   *_ShowEscape  PP( (char *, int, int, char *) );
-extern int	_Escape     PP( (int) );
-extern int	_EscIO      PP( (int) );
-
-extern int      microsleep   PP( (long) );
-extern long     ipow        PP( (long, long) );
-extern Char    *strsub      PP( (Char *, Char *, int, int) );
-extern Char    *strltrim    PP( (Char *) );
-extern Char    *strrtrim    PP( (Char *) );
-extern Char    *strrpt      PP( (Char *, Char *, int) );
-extern Char    *strpad      PP( (Char *, Char *, int, int) );
-extern int      strpos2     PP( (Char *, Char *, int) );
-extern void    strmove      PP((int len, char * s, int spos, char * d, int dpos));
-extern int     strcicmp     PP((char * s1, char * s2));
-extern int       my_toupper PP((int c));
-extern int       my_tolower PP((int c));
-extern long     memavail    PV();
-extern int      P_peek      PP( (FILE *) );
-extern int      P_eof       PP( (FILE *) );
-extern int      P_eoln      PP( (FILE *) );
-extern Void     P_readpaoc  PP( (FILE *, Char *, int) );
-extern Void     P_readlnpaoc PP( (FILE *, Char *, int) );
-extern long     P_maxpos    PP( (FILE *) );
-extern Char    *P_trimname  PP( (Char *, int) );
-extern long    *P_setunion  PP( (long *, long *, long *) );
-extern long    *P_setint    PP( (long *, long *, long *) );
-extern long    *P_setdiff   PP( (long *, long *, long *) );
-extern long    *P_setxor    PP( (long *, long *, long *) );
-extern int      P_inset     PP( (unsigned, long *) );
-extern int      P_setequal  PP( (long *, long *) );
-extern int      P_subset    PP( (long *, long *) );
-extern long    *P_addset    PP( (long *, unsigned) );
-extern long    *P_addsetr   PP( (long *, unsigned, unsigned) );
-extern long    *P_remset    PP( (long *, unsigned) );
-extern long    *P_setcpy    PP( (long *, long *) );
-extern long    *P_expset    PP( (long *, long) );
-extern long     P_packset   PP( (long *) );
-extern int      P_getcmdline PP( (int l, int h, Char *line) );
-extern Void     TimeStamp   PP( (int *Day, int *Month, int *Year,
-				 int *Hour, int *Min, int *Sec) );
-extern Void	P_sun_argv  PP( (char *, int, int) );
-
-extern void     _local_p2c_init PP((void));
+extern int      _OutMem     ();
+extern int      _CaseCheck  ();
+extern int      _NilCheck   ();
+extern char   *_ShowEscape   (char *, int, int, char *);
+extern int	_Escape      (int);
+extern int	_EscIO       (int);
+
+extern int      microsleep    (long);
+extern long     ipow         (long, long);
+extern char    *strsub       (char *, char *, int, int);
+extern char    *strltrim     (char *);
+extern char    *strrtrim     (char *);
+extern char    *strrpt       (char *, char *, int);
+extern char    *strpad       (char *, char *, int, int);
+extern int      strpos2      (char *, char *, int);
+extern void    strmove      (int len, char * s, int spos, char * d, int dpos);
+extern int     strcicmp     (char * s1, char * s2);
+extern long     memavail    ();
+extern int      P_peek       (FILE *);
+extern int      P_eof        (FILE *);
+extern int      P_eoln       (FILE *);
+extern void     P_readpaoc   (FILE *, char *, int);
+extern void     P_readlnpaoc  (FILE *, char *, int);
+extern long     P_maxpos     (FILE *);
+extern char    *P_trimname   (char *, int);
+extern long    *P_setunion   (long *, long *, long *);
+extern long    *P_setint     (long *, long *, long *);
+extern long    *P_setdiff    (long *, long *, long *);
+extern long    *P_setxor     (long *, long *, long *);
+extern int      P_inset      (unsigned, long *);
+extern int      P_setequal   (long *, long *);
+extern int      P_subset     (long *, long *);
+extern long    *P_addset     (long *, unsigned);
+extern long    *P_addsetr    (long *, unsigned, unsigned);
+extern long    *P_remset     (long *, unsigned);
+extern long    *P_setcpy     (long *, long *);
+extern long    *P_expset     (long *, long);
+extern long     P_packset    (long *);
+extern int      P_getcmdline  (int l, int h, char *line);
+extern void     TimeStamp    (int *Day, int *Month, int *Year,
+				 int *Hour, int *Min, int *Sec);
+extern void	P_sun_argv   (char *, int, int);
+
+extern void     _local_p2c_init (void);
 
 
 /* I/O error handling */
@@ -389,23 +234,23 @@ extern void     _local_p2c_init PP((void));
 
 typedef struct {
     FILE *f;
-    FILEBUFNC(f,Char);
-    Char name[_FNSIZE];
+    FILEBUFNC(f,char);
+    char name[_FNSIZE];
 } _TEXT;
 
 /* Memory allocation */
 #ifdef __GCC__
 #ifdef __alpha__
-# define Malloc(n)  (malloc((n) ? (n) : 1) ?: (Anyptr)(long)_OutMem())
+# define Malloc(n)  (malloc((n) ? (n) : 1) ?: (void*)(long)_OutMem())
 #else
-# define Malloc(n)  (malloc((n) ? (n) : 1) ?: (Anyptr)_OutMem())
+# define Malloc(n)  (malloc((n) ? (n) : 1) ?: (void*)_OutMem())
 #endif
 #else
-extern Anyptr __MallocTemp__;
-# define Malloc(n)  ((__MallocTemp__ = malloc((n) ? (n) : 1)) ? __MallocTemp__ : (Anyptr)_OutMem())
+extern void* __MallocTemp__;
+# define Malloc(n)  ((__MallocTemp__ = malloc((n) ? (n) : 1)) ? __MallocTemp__ : (void*)_OutMem())
 #endif
-#define FreeR(p)    (free((Anyptr)(p)))    /* used if arg is an rvalue */
-#define Free(p)     (free((Anyptr)(p)), (p)=NULL)
+#define FreeR(p)    (free((void*)(p)))    /* used if arg is an rvalue */
+#define Free(p)     (free((void*)(p)), (p)=NULL)
 
 /* sign extension */
 #define SEXT(x,n)   ((x) | -(((x) & (1L<<((n)-1))) << 1))
@@ -440,32 +285,6 @@ extern Anyptr __MallocTemp__;
 #define P_max(a,b)   ((a) > (b) ? (a) : (b))
 #define P_min(a,b)   ((a) < (b) ? (a) : (b))
 
-#if ! defined( __osf__ )
-
-/* Fix toupper/tolower on Suns and other stupid BSD systems */
-#ifdef toupper
-# undef toupper
-# undef tolower
-# define toupper(c)   my_toupper(c)
-# define tolower(c)   my_tolower(c)
-#endif
-
-#ifndef _toupper
-# if 'A' == 65 && 'a' == 97
-#  define _toupper(c)  ((c)-'a'+'A')
-#  define _tolower(c)  ((c)-'A'+'a')
-# else
-#  define _toupper(c)  toupper(c)
-#  define _tolower(c)  tolower(c)
-# endif
-#endif
-
-#endif
-  
-#ifdef ultrix
-extern double strtod();
-#endif
-
 #endif    /* P2C_H */
 
 /* ifdefs for microsleep here */
diff --git a/psys/include/p2c/passmod.h b/psys/include/p2c/passmod.h
index f2bdced..3fac381 100644
--- a/psys/include/p2c/passmod.h
+++ b/psys/include/p2c/passmod.h
@@ -3,16 +3,7 @@
 #define PASSWORDMOD_H
 
 
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef STRINGS_H
-#include <p2c/strings.h>
-#endif
-
-
 
 #ifdef PASSWORDMOD_G
 # define vextern
@@ -41,20 +32,20 @@
 /*No more than 6 SRMs on a system, oh no*/
 /*Really 1..MaxSRMs*/
 
-typedef Char mam_SRMnameArray[mam_MaxSRMs][vidleng + 1];
+typedef char mam_SRMnameArray[mam_MaxSRMs][vidleng + 1];
 
 typedef char mam_SRMnameList[50];
 
 
 
-vextern Char mam_PasswordDate[vidleng + 1];
+vextern char mam_PasswordDate[vidleng + 1];
 vextern _PROCEDURE mam_SRMsetPrefixHook;
-vextern boolean mam_PatchActive, mam_Verbose, mam_NoLowerCase, mam_AutoSRM;
-vextern Char mam_HomePassword[tidleng + 1];
+vextern int mam_PatchActive, mam_Verbose, mam_NoLowerCase, mam_AutoSRM;
+vextern char mam_HomePassword[tidleng + 1];
 vextern char mam_DefaultSRM;
-vextern Char mam_PasswordProgram[fidleng + 1];
+vextern char mam_PasswordProgram[fidleng + 1];
 vextern char mam_NumSRMs;
-vextern Char (*mam_SRMnames)[vidleng + 1];
+vextern char (*mam_SRMnames)[vidleng + 1];
 vextern char *mam_VolSRMs;
 
 
@@ -62,60 +53,58 @@ vextern char *mam_VolSRMs;
 /*How many SRMs actually online*/
 /*names of SRM units*/
 /*SRM number for each volume*/
-extern Void mam_InitDate PV();
-extern long mam_NumPasswords PV();
-extern Void mam_SpaceLeft PP((long *prefChars, long *maxPrefChars,
+extern void mam_InitDate ();
+extern long mam_NumPasswords ();
+extern void mam_SpaceLeft (long *prefChars, long *maxPrefChars,
 			      long *passChars, long *passNames,
 			      long *maxPassNames, long *aliaschars,
-			      long *aliasnames, long *maxAliasNames));
-extern Void mam_InitPrefixTable PP((long maxChars));
-extern boolean mam_ReadWD PP((long vol, Char *path, Char *rootname));
-extern long mam_ReadPrefix PP((long vol, int verbose));
-extern Void mam_ReadPrefixes PP((int verbose));
-extern Char *mam_VolumePrefix PP((long vol));
-extern Char *mam_VolumeSRM PP((long vol));
-extern boolean mam_StorePrefix PP((long vol, Char *prefix));
-extern Void mam_SuperUser PP((Char *vp));
-extern Void mam_PushSU PP((Char *vp));
-extern Void mam_PopSU PV();
-extern Char *mam_HomePath PP((Char *mam_Result));
-extern Void mam_ParseTwiddle PP((Char *name));
-extern Void mam_AddPrefix PP((long vol, Char *name));
-extern Void mam_StripPasswords PP((Char *name));
-extern Void mam_InitPathAliases PP((long maxChars, long maxNum));
-extern Void mam_ClearPathAliases PV();
-extern long mam_NumPathAliases PV();
-extern boolean mam_SetPathAlias PP((Char *alias, Char *path));
-extern Void mam_PathAliasAt PP((long index, Char *alias, Char *path));
-extern Char *mam_GetPathAlias PP((Char *mam_Result, Char *alias, long len));
-extern Void mam_InitPasswords PP((long maxChars, long maxPass));
-extern Void mam_ClearPasswords PV();
-extern Void mam_PasswordAt PP((long index, long *SRM, Char *name,
-			       Char *password));
-extern Void mam_RemovePassword PP((long vol, Char *filename));
-extern boolean mam_SetPassword PP((long vol, Char *filename, long len,
-				   Char *password));
-extern Char *mam_GetPassword PP((Char *mam_Result, long vol, Char *name,
-				 long len));
-extern Void mam_ParseDots PP((long vol, Char *name, int keepPrefix,
-			      long *nameStart));
-extern Void mam_ExpandName PP((Char *name, long *SRM, long *vol));
-extern Void mam_AddPasswords PP((long vol, int storeAll, Char *name,
-				 Char *newname, long newmax));
-extern Void SRM_DAM_Patch PP((fib *f, int vol, damrequesttype *request));
-extern Void New_ZapSpaces PP((Char *st));
-extern boolean mam_GetSystem PP((Char *name, short *sys));
-extern Void mam_GetSRM PP((Char *name, long *SRM, long *vol));
-extern boolean mam_PutSRM PP((long SRM, Char *name));
-extern Void mam_SRMfromFilename PP((Char *name, Char *SRMname));
-extern Void mam_SRMtoVolNum PP((Char *name));
-extern long mam_ReadPasswordFile PP((Char *name, Char *path, long sys));
-extern long mam_WritePasswordFile PP((Char *name, Char *path));
-extern Void mam_InitRoots PV();
-extern Void mam_FindWhere PP((int system, Char *fn, long *vol));
-extern Void mam_UserInit PP((Char *path));
-
-
+			      long *aliasnames, long *maxAliasNames);
+extern void mam_InitPrefixTable (long maxChars);
+extern int mam_ReadWD (long vol, char *path, char *rootname);
+extern long mam_ReadPrefix (long vol, int verbose);
+extern void mam_ReadPrefixes (int verbose);
+extern char *mam_VolumePrefix (long vol);
+extern char *mam_VolumeSRM (long vol);
+extern int mam_StorePrefix (long vol, char *prefix);
+extern void mam_SuperUser (char *vp);
+extern void mam_PushSU (char *vp);
+extern void mam_PopSU ();
+extern char *mam_HomePath (char *mam_Result);
+extern void mam_ParseTwiddle (char *name);
+extern void mam_AddPrefix (long vol, char *name);
+extern void mam_StripPasswords (char *name);
+extern void mam_InitPathAliases (long maxChars, long maxNum);
+extern void mam_ClearPathAliases ();
+extern long mam_NumPathAliases ();
+extern int mam_SetPathAlias (char *alias, char *path);
+extern void mam_PathAliasAt (long index, char *alias, char *path);
+extern char *mam_GetPathAlias (char *mam_Result, char *alias, long len);
+extern void mam_InitPasswords (long maxChars, long maxPass);
+extern void mam_ClearPasswords ();
+extern void mam_PasswordAt (long index, long *SRM, char *name,
+			       char *password);
+extern void mam_RemovePassword (long vol, char *filename);
+extern int mam_SetPassword (long vol, char *filename, long len,
+				   char *password);
+extern char *mam_GetPassword (char *mam_Result, long vol, char *name,
+				 long len);
+extern void mam_ParseDots (long vol, char *name, int keepPrefix,
+			      long *nameStart);
+extern void mam_ExpandName (char *name, long *SRM, long *vol);
+extern void mam_AddPasswords (long vol, int storeAll, char *name,
+				 char *newname, long newmax);
+extern void SRM_DAM_Patch (fib *f, int vol, damrequesttype *request);
+extern void New_ZapSpaces (char *st);
+extern int mam_GetSystem (char *name, short *sys);
+extern void mam_GetSRM (char *name, long *SRM, long *vol);
+extern int mam_PutSRM (long SRM, char *name);
+extern void mam_SRMfromFilename (char *name, char *SRMname);
+extern void mam_SRMtoVolNum (char *name);
+extern long mam_ReadPasswordFile (char *name, char *path, long sys);
+extern long mam_WritePasswordFile (char *name, char *path);
+extern void mam_InitRoots ();
+extern void mam_FindWhere (int system, char *fn, long *vol);
+extern void mam_UserInit (char *path);
 
 #undef vextern
 
diff --git a/psys/include/p2c/plot.h b/psys/include/p2c/plot.h
index bbb626d..100ff38 100644
--- a/psys/include/p2c/plot.h
+++ b/psys/include/p2c/plot.h
@@ -1,14 +1,8 @@
-/* Header for module plot, generated by p2c */
 #ifndef PLOT_H
 #define PLOT_H
 
 
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-
 
 #ifdef PLOT_G
 # define vextern
@@ -21,14 +15,12 @@
 #define plot_numscreenpens 8
 /* p2c: Note: Character >= 128 encountered (from plot.imp, line 43) */
 
-
-
 /*unused*/
 
 typedef long plot_coordarray[100000L];
 
 typedef struct plot_namerec {
-    Char s[9];
+    char s[9];
     short num;
     struct plot_namerec *next;
 } plot_namerec;
@@ -62,99 +54,99 @@ vextern long plot_screenpen[plot_numscreenpens];
 
 
 
-extern Void plot_p1p2 PP((long x1, long y1, long x2, long y2));
-extern Void plot_init PP((long addr, int sizecode));
-extern Void plot_initscreen PP((long x1, long y1, long x2, long y2));
-extern Void plot_warminitscreen PP((long x1, long y1, long x2, long y2));
-extern Void plot_initgen PP((Char *fn));
-extern Void plot_initfile PP((FILE **f, int sizecode, int hascircles));
-extern Void plot_initps PP((FILE **f));
-extern Void plot_initff PP((FILE **f));
-extern Void plot_init_fast PV();
-extern Void plot_initscreen_fast PV();
-extern Void plot_initgen_fast PP((Char *fn));
-extern Void plot_initfile_fast PP((Char *fn));
-extern Void plot_initps_fast PP((Char *fn));
-extern Void plot_inituser PP((_PROCEDURE devproc));
-extern Void plot_window PP((long x1, long y1, long x2, long y2));
-extern Void plot_nrwindow PP((long x1, long y1, long x2, long y2));
-extern Void plot_pwindow PP((long x1, long y1, long x2, long y2));
-extern Void plot_lwindow PP((long x1, long y1, long x2, long y2));
-extern Void plot_getwindow PP((long *x1, long *y1, long *x2, long *y2));
-extern Void plot_figtitle PP((Char *title));
-extern Void plot_out PP((Char *s));
-extern Void plot_headerfile PP((Char * fn, boolean incflag));
-extern Void plot_initfonts PP((void));
+extern void plot_p1p2 (long x1, long y1, long x2, long y2);
+extern void plot_init (long addr, int sizecode);
+extern void plot_initscreen (long x1, long y1, long x2, long y2);
+extern void plot_warminitscreen (long x1, long y1, long x2, long y2);
+extern void plot_initgen (char *fn);
+extern void plot_initfile (FILE **f, int sizecode, int hascircles);
+extern void plot_initps (FILE **f);
+extern void plot_initff (FILE **f);
+extern void plot_init_fast ();
+extern void plot_initscreen_fast ();
+extern void plot_initgen_fast (char *fn);
+extern void plot_initfile_fast (char *fn);
+extern void plot_initps_fast (char *fn);
+extern void plot_inituser (_PROCEDURE devproc);
+extern void plot_window (long x1, long y1, long x2, long y2);
+extern void plot_nrwindow (long x1, long y1, long x2, long y2);
+extern void plot_pwindow (long x1, long y1, long x2, long y2);
+extern void plot_lwindow (long x1, long y1, long x2, long y2);
+extern void plot_getwindow (long *x1, long *y1, long *x2, long *y2);
+extern void plot_figtitle (char *title);
+extern void plot_out (char *s);
+extern void plot_headerfile (char * fn, int incflag);
+extern void plot_initfonts (void);
 
 /*no longer supported*/
-extern Void plot_in PP((Char *s));
+extern void plot_in (char *s);
 
 /*no longer supported*/
-extern Void plot_lift PV();
-extern Void plot_view PV();
-extern Void plot_finish PV();
-extern Void plot_quality PV();
-extern Void plot_fast PV();
-extern Void plot_velocity PP((double vel));
-extern Void plot_color PP((long c));
-extern Void plot_prepare PV();
-extern Void plot_clip PV();
-extern Void plot_noclip PV();
-extern long plot_cm PP((double cm));
-extern Void plot_xform PP((long x, long y, long *xx, long *yy));
-extern Void plot_rxform PP((double x, double y, long *xx, long *yy));
-extern Void plot_unxform PP((long xx, long yy, long *x, long *y));
-extern Void plot_relxform PP((long x, long y, long *xx, long *yy));
-extern Void plot_rrelxform PP((double x, double y, long *xx, long *yy));
-extern Void plot_relunxform PP((long xx, long yy, long *x, long *y));
-extern Void plot_linestyle PP((long num));
-extern Void plot_linewidth PP((double num));
-extern Void plot_move PP((long x, long y));
-extern Void plot_draw PP((long x, long y));
-extern Void plot_rmove PP((double x, double y));
-extern Void plot_rdraw PP((double x, double y));
-extern Void plot_moverel PP((long dx, long dy));
-extern Void plot_drawrel PP((long dx, long dy));
-extern Void plot_line PP((long x1, long y1, long x2, long y2));
-extern Void plot_box PP((long x1, long y1, long x2, long y2, long pat));
-extern Void plot_circle PP((long x1, long y1, long r, long pat));
-extern Void plot_rellipse PP((long x1, long y1, double rx, double ry,
-			      long pat));
-extern Void plot_rrellipse PP((double x1, double y1, double rx, double ry,
-			       long pat));
-extern Void plot_bezier PP((long x1, long y1, long x2, long y2, long x3,
-			    long y3, long x4, long y4, long epsilon));
-extern Void plot_rbezier PP((double x1, double y1, double x2, double y2,
+extern void plot_lift ();
+extern void plot_view ();
+extern void plot_finish ();
+extern void plot_quality ();
+extern void plot_fast ();
+extern void plot_velocity (double vel);
+extern void plot_color (long c);
+extern void plot_prepare ();
+extern void plot_clip ();
+extern void plot_noclip ();
+extern long plot_cm (double cm);
+extern void plot_xform (long x, long y, long *xx, long *yy);
+extern void plot_rxform (double x, double y, long *xx, long *yy);
+extern void plot_unxform (long xx, long yy, long *x, long *y);
+extern void plot_relxform (long x, long y, long *xx, long *yy);
+extern void plot_rrelxform (double x, double y, long *xx, long *yy);
+extern void plot_relunxform (long xx, long yy, long *x, long *y);
+extern void plot_linestyle (long num);
+extern void plot_linewidth (double num);
+extern void plot_move (long x, long y);
+extern void plot_draw (long x, long y);
+extern void plot_rmove (double x, double y);
+extern void plot_rdraw (double x, double y);
+extern void plot_moverel (long dx, long dy);
+extern void plot_drawrel (long dx, long dy);
+extern void plot_line (long x1, long y1, long x2, long y2);
+extern void plot_box (long x1, long y1, long x2, long y2, long pat);
+extern void plot_circle (long x1, long y1, long r, long pat);
+extern void plot_rellipse (long x1, long y1, double rx, double ry,
+			      long pat);
+extern void plot_rrellipse (double x1, double y1, double rx, double ry,
+			       long pat);
+extern void plot_bezier (long x1, long y1, long x2, long y2, long x3,
+			    long y3, long x4, long y4, long epsilon);
+extern void plot_rbezier (double x1, double y1, double x2, double y2,
 			     double x3, double y3, double x4, double y4,
-			     long epsilon));
-extern Void plot_polygon PP((long n, long *x, long *y, long pat));
-extern Void plot_roundbox PP((long x1, long y1, long x2, long y2, long rx,
-			      long ry, long pat));
-extern Void plot_rroundbox PP((double x1, double y1, double x2, double y2,
-			       double rx, double ry, long pat));
-extern Void plot_readfont PP((Char *fn));
-extern Void plot_readfontset PP((Char *fn, long *which));
-extern Void plot_morefontset PP((Char *fn, long *which));
-extern Void plot_initfonts PV();
-extern Void plot_fontfile PP((Char *fn));
-extern Void plot_loadfonts PP((long *which));
-extern Void plot_ctrlchars PP((Char *pref, Char *chrs));
-extern Void plot_selfont PP((long num));
-extern long plot_height PV();
-extern Void plot_charsize PP((long num, long den, long scale));
-extern Void plot_charscale PP((long scale));
-extern Void plot_charorient PP((double theta, int mirrorx));
-extern Void plot_charaspect PP((long horiz, long vert, long den));
-extern long plot_charnum PP((int ch));
-extern long plot_charname PP((Char *s));
-extern Void plot_ssoffset PP((long sub, long sup, long den));
-extern Void plot_char PP((long x, long y, long num));
-extern Void plot_string PP((long x, long y, Char *s));
-extern Void plot_rightstring PP((long x, long y, Char *s));
-extern Void plot_centerstring PP((long x, long y, Char *s));
-extern Void plot_genstring PP((long x, long y, Char *orient, Char *s));
-extern Void plot_stringrel PP((Char *s));
-extern long plot_stringwidth PP((Char *s));
+			     long epsilon);
+extern void plot_polygon (long n, long *x, long *y, long pat);
+extern void plot_roundbox (long x1, long y1, long x2, long y2, long rx,
+			      long ry, long pat);
+extern void plot_rroundbox (double x1, double y1, double x2, double y2,
+			       double rx, double ry, long pat);
+extern void plot_readfont (char *fn);
+extern void plot_readfontset (char *fn, long *which);
+extern void plot_morefontset (char *fn, long *which);
+extern void plot_initfonts ();
+extern void plot_fontfile (char *fn);
+extern void plot_loadfonts (long *which);
+extern void plot_ctrlchars (char *pref, char *chrs);
+extern void plot_selfont (long num);
+extern long plot_height ();
+extern void plot_charsize (long num, long den, long scale);
+extern void plot_charscale (long scale);
+extern void plot_charorient (double theta, int mirrorx);
+extern void plot_charaspect (long horiz, long vert, long den);
+extern long plot_charnum (int ch);
+extern long plot_charname (char *s);
+extern void plot_ssoffset (long sub, long sup, long den);
+extern void plot_char (long x, long y, long num);
+extern void plot_string (long x, long y, char *s);
+extern void plot_rightstring (long x, long y, char *s);
+extern void plot_centerstring (long x, long y, char *s);
+extern void plot_genstring (long x, long y, char *orient, char *s);
+extern void plot_stringrel (char *s);
+extern long plot_stringwidth (char *s);
 
 
 
diff --git a/psys/include/p2c/plot_routines.h b/psys/include/p2c/plot_routines.h
index f5e3f96..a6443bc 100644
--- a/psys/include/p2c/plot_routines.h
+++ b/psys/include/p2c/plot_routines.h
@@ -1,20 +1,10 @@
-/* Header for module plot_routines, generated by p2c */
 #ifndef PLOT_ROUTINES_H
 #define PLOT_ROUTINES_H
 
 
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
-#ifndef PLOT_H
 #include <p2c/plot.h>
-#endif
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
 
 
 
@@ -53,148 +43,145 @@ typedef double mam_vectorarray[3000];
 
 
 
-extern Void mam_init_plotter PV( );
-extern Void mam_init_screen PV( );
-extern Void mam_init_file PP((Char *fname));
-extern Void mam_init_ps PP((Char *fname));
+extern void mam_init_plotter ( );
+extern void mam_init_screen ( );
+extern void mam_init_file (char *fname);
+extern void mam_init_ps (char *fname);
 
 /*obsolete*/
-extern Void mam_init_generic PV( );
-extern Void mam_setup_generic PV( );
-extern Void mam_quality PV( );
-extern Void mam_close PV( );
-extern Void mam_close_generic PV( );
+extern void mam_init_generic ( );
+extern void mam_setup_generic ( );
+extern void mam_quality ( );
+extern void mam_close ( );
+extern void mam_close_generic ( );
 
 /*Allocate a variable-sized vector*/
-extern Void mam_new PP((double **vec, long size));
-extern Void mam_dispose PP((double **vec, long size));
+extern void mam_new (double **vec, long size);
+extern void mam_dispose (double **vec, long size);
 
 /*Scaling the data*/
-extern double mam_log PP((double x));
+extern double mam_log (double x);
 
 /*see also log(x) in MATH module*/
-extern Void mam_scale PP((double **x, double **y, long len));
-extern Void mam_scalenormal PP((double **x, double **y, long len,
-				double **normalx));
-extern Void mam_rscale PP((double **x, double **y, long len));
-extern Void mam_scale_generic PP((long axis, double **x, long len));
-extern Void mam_range PP((long axis, double min, double max));
-extern Void mam_fullrange PP((long axis, double min, double max,
-			      double interval));
-extern Void mam_getrange PP((long axis, double *min, double *max,
-			     double *interval));
-extern Void mam_intlabel PP((long axis));
+extern void mam_scale (double **x, double **y, long len);
+extern void mam_scalenormal (double **x, double **y, long len,
+				double **normalx);
+extern void mam_rscale (double **x, double **y, long len);
+extern void mam_scale_generic (long axis, double **x, long len);
+extern void mam_range (long axis, double min, double max);
+extern void mam_fullrange (long axis, double min, double max,
+			      double interval);
+extern void mam_getrange (long axis, double *min, double *max,
+			     double *interval);
+extern void mam_intlabel (long axis);
 
 /*integers only*/
-extern Void mam_englabel PP((long axis));
+extern void mam_englabel (long axis);
 
 /*engineering notation*/
-extern Void mam_fltlabel PP((long axis));
+extern void mam_fltlabel (long axis);
 
 /*floating notation*/
-extern Void mam_fixlabel PP((long axis));
+extern void mam_fixlabel (long axis);
 
 /*decimal notation*/
-extern Void mam_gridaxis PP((long axis));
-extern Void mam_grid PV( );
-extern Void mam_mirroraxis PP((long axis));
+extern void mam_gridaxis (long axis);
+extern void mam_grid ( );
+extern void mam_mirroraxis (long axis);
 
 /*Setting & drawing the axes*/
-extern Void mam_axis PP((Char *xtitle, Char *xunits, Char *xplottype,
-			 Char *ytitle, Char *yunits, Char *yplottype));
-extern Void mam_axis3 PP((Char *xtitle, Char *xunits, Char *xplottype,
-			  Char *y1title, Char *y1units, Char *y1plottype,
-			  Char *y2title, Char *y2units, Char *y2plottype));
-extern Void mam_drawborder PV( );
-extern Void mam_drawaxes PV( );
+extern void mam_axis (char *xtitle, char *xunits, char *xplottype,
+			 char *ytitle, char *yunits, char *yplottype);
+extern void mam_axis3 (char *xtitle, char *xunits, char *xplottype,
+			  char *y1title, char *y1units, char *y1plottype,
+			  char *y2title, char *y2units, char *y2plottype);
+extern void mam_drawborder ( );
+extern void mam_drawaxes ( );
 
 /*Low-level graphics*/
-extern Void mam_move PP((double xto, double yto, long yaxis));
+extern void mam_move (double xto, double yto, long yaxis);
 
 /*These names are BAD to export!*/
-extern Void mam_draw PP((double xto, double yto, long yaxis));
+extern void mam_draw (double xto, double yto, long yaxis);
 
 /* -- DAVE 11/10/87*/
-extern Void mam_move_ PP((double xto, double yto, long yaxis));
-extern Void mam_draw_ PP((double xto, double yto, long yaxis));
-extern Void mam_transform PP((double x, double y, long yaxis, double *tx,
-			      double *ty));
-extern Void mam_rtransform PP((double dx, double dy, long yaxis, double *tdx,
-			       double *tdy));
-extern Void mam_untransform PP((double tx, double ty, long yaxis, double *x,
-				double *y));
-extern Void mam_runtransform PP((double tdx, double tdy, long yaxis,
-				 double *dx, double *dy));
+extern void mam_move_ (double xto, double yto, long yaxis);
+extern void mam_draw_ (double xto, double yto, long yaxis);
+extern void mam_transform (double x, double y, long yaxis, double *tx,
+			      double *ty);
+extern void mam_rtransform (double dx, double dy, long yaxis, double *tdx,
+			       double *tdy);
+extern void mam_untransform (double tx, double ty, long yaxis, double *x,
+				double *y);
+extern void mam_runtransform (double tdx, double tdy, long yaxis,
+				 double *dx, double *dy);
 
 /*Plotting the data*/
-extern Void mam_plot PP((double **x, double **y, long len));
-extern Void mam_plotnormal PP((double **x, double **y, long len,
-			       double **normalx));
-extern Void mam_plot3 PP((double **x, double **y, long len));
-extern Void mam_splot PP((double **x, double **y, long len, int symbol));
-extern Void mam_splot3 PP((double **x, double **y, long len, int symbol));
+extern void mam_plot (double **x, double **y, long len);
+extern void mam_plotnormal (double **x, double **y, long len,
+			       double **normalx);
+extern void mam_plot3 (double **x, double **y, long len);
+extern void mam_splot (double **x, double **y, long len, int symbol);
+extern void mam_splot3 (double **x, double **y, long len, int symbol);
 
 /*Plotting other stuff*/
-extern Void mam_title PP((Char *s));
-extern Void mam_date PV( );
-extern Void mam_plotstring PP((Char *s, double x, double y));
+extern void mam_title (char *s);
+extern void mam_date ( );
+extern void mam_plotstring (char *s, double x, double y);
 
 /* MAS 11/4/86 */
-extern Void mam_tex PV( );
+extern void mam_tex ( );
 
 /*Setting up internal parameters*/
-extern Void mam_charsize PP((double frac));
+extern void mam_charsize (double frac);
 
 /*size of all characters*/
-extern Void mam_font PP((long num));
+extern void mam_font (long num);
 
 /*font for everything*/
-extern Void mam_color PP((long col));
+extern void mam_color (long col);
 
 /*color for everything*/
-extern Void mam_axissize PP((double frac));
+extern void mam_axissize (double frac);
 
 /*set size of axis names only*/
-extern Void mam_axisfont PP((long num));
-extern Void mam_axiscolor PP((long col));
-extern Void mam_labelsize PP((double frac));
+extern void mam_axisfont (long num);
+extern void mam_axiscolor (long col);
+extern void mam_labelsize (double frac);
 
 /*set size of axis values only*/
-extern Void mam_labelfont PP((long num));
-extern Void mam_labelcolor PP((long col));
-extern Void mam_titlesize PP((double frac));
+extern void mam_labelfont (long num);
+extern void mam_labelcolor (long col);
+extern void mam_titlesize (double frac);
 
 /*set size of title string only*/
-extern Void mam_titlefont PP((long num));
-extern Void mam_titlecolor PP((long col));
-extern Void mam_symbolsize PP((double frac));
+extern void mam_titlefont (long num);
+extern void mam_titlecolor (long col);
+extern void mam_symbolsize (double frac);
 
 /*set size of symbol character only*/
-extern Void mam_symbolfont PP((long num));
-extern Void mam_symbolcolor PP((long col));
-extern Void mam_symboloffset PP((double xfrac, double yfrac));
-extern Void mam_setfontfile PP((Char *fn));
-extern Void mam_ticksize PP((double frac));
+extern void mam_symbolfont (long num);
+extern void mam_symbolcolor (long col);
+extern void mam_symboloffset (double xfrac, double yfrac);
+extern void mam_setfontfile (char *fn);
+extern void mam_ticksize (double frac);
 
 /*size of tick marks*/
-extern Void mam_tickcolor PP((long col));
-extern Void mam_bordercolor PP((long col));
-extern Void mam_datacolor PP((long col));
-extern Void mam_datastyle PP((long style));
-extern Void mam_drawlabel PP((double x, double y, Char *lbl));
+extern void mam_tickcolor (long col);
+extern void mam_bordercolor (long col);
+extern void mam_datacolor (long col);
+extern void mam_datastyle (long style);
+extern void mam_drawlabel (double x, double y, char *lbl);
 
 /* *** some random data analysis stuff, added by Mass *** */
-extern double mam_mean PP((double **x, long len));
-extern double mam_stddev PP((double **x, long len));
-extern double mam_normal PP((double mean, double stddev, double x));
-extern Void mam_lower_title PP((Char *s));
-
+extern double mam_mean (double **x, long len);
+extern double mam_stddev (double **x, long len);
+extern double mam_normal (double mean, double stddev, double x);
+extern void mam_lower_title (char *s);
 
 
 vextern long lowerfudge;
 
-
-
 #undef vextern
 
 #endif /*PLOT_ROUTINES_H*/
diff --git a/psys/include/p2c/regex.h b/psys/include/p2c/regex.h
index cac1d7c..f767f64 100644
--- a/psys/include/p2c/regex.h
+++ b/psys/include/p2c/regex.h
@@ -1,43 +1,25 @@
-/* Header for module regex, generated by p2c */
 #ifndef REGEX_H
 #define REGEX_H
 
 
-
-#ifndef NEWASM_H
 #include <p2c/newasm.h>
-#endif
-
-
-
-#ifdef REGEX_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
 
 
 #define re_defchars     "\\[]^-*?+$.|~(){}:=<>"
 #define re_shellchars   "\\[]^-    ?       *  "
 
+extern void re_compile (char *ex, char *rex, char *chars);
+extern void re_cicompile (char *ex, char *rex, char *chars);
+extern void re_dump (char *rex);
+extern void re_search (char *s, char *rex, long *pos, long *last, long dir);
+extern int re_compare (char *s, char *rex);
+extern void re_replace (char *s, char *rex, char *rpl, long *pos,
+			   long *last);
+extern int re_matchstr (char *s, char *pat);
+extern int re_matchsubstr (char *s, char *pat, long start, long *last);
+extern void re_grepl (char *s, char *pat, char *rpl);
 
 
-extern Void re_compile PP((Char *ex, Char *rex, Char *chars));
-extern Void re_cicompile PP((Char *ex, Char *rex, Char *chars));
-extern Void re_dump PP((Char *rex));
-extern Void re_search PP((Char *s, Char *rex, long *pos, long *last, long dir));
-extern boolean re_compare PP((Char *s, Char *rex));
-extern Void re_replace PP((Char *s, Char *rex, Char *rpl, long *pos,
-			   long *last));
-extern boolean re_matchstr PP((Char *s, Char *pat));
-extern boolean re_matchsubstr PP((Char *s, Char *pat, long start, long *last));
-extern Void re_grepl PP((Char *s, Char *pat, Char *rpl));
-
-
-
-#undef vextern
-
 #endif /*REGEX_H*/
 
 /* End. */
diff --git a/psys/include/p2c/rnd.h b/psys/include/p2c/rnd.h
index 6d2b463..129d368 100644
--- a/psys/include/p2c/rnd.h
+++ b/psys/include/p2c/rnd.h
@@ -1,16 +1,7 @@
 #ifndef RND_H
 #define RND_H
 
-#ifdef RND_G
-# define vextern
-#else
-# define vextern extern
-#endif
-
-
 extern void P_random();
 extern long P_rand();
 
-#undef vextern
-
 #endif /* RND_H */
diff --git a/psys/include/p2c/strings.h b/psys/include/p2c/strings.h
index c0aef21..19abf98 100644
--- a/psys/include/p2c/strings.h
+++ b/psys/include/p2c/strings.h
@@ -1,66 +1,48 @@
-/* Header for module Strings, generated by p2c */
-#ifndef STRINGS_H
-#define STRINGS_H
+#ifndef P2C_STRING_H
+#define P2C_STRING_H
+
+void strsafeappend(char *s, char *s2);
+//void strappendc(char *s, int ch);
+char *strupper (char *result, char *s);
+char *strlower (char *result, char *s);
+char *strpart (char *result, char *s, long fist, long last);
+char *strlast (char *result, char *s, long num);
+char *strljust (char *result, char *s, long wid);
+char *strrjust (char *result, char *s, long wid);
+char *strcjust (char *result, char *s, long wid);
+int strbegins (char *s1, char *s2);
+int strends (char *s1, char *s2);
+int strcibegins (char *s1, char *s2);
+int strciends (char *s1, char *s2);
+long strsubcmp (long n, char *s1, long i1, char *s2, long i2);
+int strcisubcmp (long n, char *s1, long i1, char *s2, long i2);
+void strsubst (char *repl, char *s, long index, long size);
+char *strint (char *result, long i);
+char *strint2 (char *result, long i, long w);
+char *streal (char *result, double r);
+char *strchar (char *result, int ch);
+long strreadint (char *s);
+double strreadreal (char *s);
+long strposb (char *s1, char *s2, long i);
+long strposc (char *s1, char ch, long i);
+long strposcset (char *s1, char *s2, long i);
+long strposbcset (char *s1, char *s2, long i);
+long strpcipos2 (char *s1, char *s2, long i);
+long strpciposb (char *s1, char *s2, long i);
+int strpcontains (char *s1, char *s2);
+int strsubset (char *s1, char *s2);
+int strcommon (char *s1, char *s2);
+long strlenv (char *s);
+char *strhex (char * Result, long i, long w);
+char *strbinary (char *Result, long i, long w);
+char *stadate (char *Result, char *opts);
+void strword (char *s, char *s2);
+void strword2 (char *s, char *s2);
+void strcomment (char *s, char* bracket);
+void strcompress (char *s, char *chars, int all);
+void strdispose (char **sp);
+void strchange (char** sp, char *);
+char *strcpy_overlap(char *dst, char *src);
 
-
-
-#ifdef STRINGS_G
-# define vextern
-#else
-# define vextern extern
 #endif
 
-
-
-/********************************************************************/
-
-
-
-#define pstr_EmptyString ""
-
-
-
-/*A constant empty string*/
-/*Pointer to the chars*/
-/*Maximum size*/
-/*Number of chars now stored*/
-/*Pointer to the array of string-pointers*/
-/*Maximum string index*/
-/*Max used string index (used for tables)*/
-/*Used in sorting lists*/
-
-typedef Char pstr_StrBuf[];
-
-typedef Char *pstr_StrAdr[];
-
-typedef struct pstr_Buffer {
-    Char *bufp;
-    long bufsiz, buflen;
-    Char **adrp;
-    long adrsiz, adrlen;
-} pstr_Buffer;
-
-
-
-extern Void pstr_NewPAC PP((Char **bufp, long siz));
-extern Void pstr_NewBuffer PP((pstr_Buffer *buf, long bsiz, long adsiz));
-extern Void pstr_ClearBuffer PP((pstr_Buffer *buf));
-extern Char *pstr_StringAt PP((pstr_Buffer *buf, long index));
-extern boolean pstr_StringAtPut PP((pstr_Buffer *buf, long index, Char *st));
-extern Void pstr_StringDelete PP((pstr_Buffer *buf, long index));
-extern Void pstr_CopyBuffer PP((pstr_Buffer *src, pstr_Buffer *dest));
-extern long pstr_LookUp PP((pstr_Buffer buf, Char *name));
-extern boolean pstr_GetValue PP((pstr_Buffer buf, Char *name, Char **value));
-extern boolean pstr_PutValue PP((pstr_Buffer *buf, Char *name, Char *value));
-extern Void pstr_SortBuffer PP((pstr_Buffer *buf, long recsize, long max,
-				_PROCEDURE proc));
-extern Void pstr_NullSwapProc PP((long i, long j));
-
-
-
-#undef vextern
-
-#endif /*STRINGS_H*/
-
-/* End. */
-
diff --git a/psys/include/p2c/sysdevs.h b/psys/include/p2c/sysdevs.h
index 4485e07..d2963e5 100644
--- a/psys/include/p2c/sysdevs.h
+++ b/psys/include/p2c/sysdevs.h
@@ -1,13 +1,7 @@
-/* Header for module SYSDEVS, generated by p2c */
 #ifndef SYSDEVS_H
 #define SYSDEVS_H
 
-
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
-
 
 
 #ifdef SYSDEVS_G
@@ -33,7 +27,7 @@
 
 typedef union CRTWORD {
     struct {
-	Char HIGHLIGHTBYTE, CHARACTER;
+	char HIGHLIGHTBYTE, CHARACTER;
     } U1;
     short WHOLEWORD;
 } CRTWORD;
@@ -48,11 +42,11 @@ typedef enum {
 } DBCRTOPS;
 
 typedef struct DBCINFO {
-    Char *SAVEAREA;
+    char *SAVEAREA;
     long SAVESIZE, DCURSORADDR;
     short XMIN, XMAX, YMIN, YMAX, CURSX, CURSY;
-    Char C;
-    boolean AREAISDBCRT, CHARISMAPPED;
+    char C;
+    int AREAISDBCRT, CHARISMAPPED;
     short DEBUGHIGHLIGHT;
 } DBCINFO;
 
@@ -68,9 +62,9 @@ typedef unsigned short b9;
 typedef unsigned short b14;
 
 typedef struct crtcrec {
-    Char rlf, ndfs, eraseeol, eraseeos, home, escape, backspace;
+    char rlf, ndfs, eraseeol, eraseeos, home, escape, backspace;
     uchar fillcount;
-    Char clearscreen, clearline;
+    char clearscreen, clearline;
     unsigned short prefixed;
 } crtcrec;
 
@@ -79,7 +73,7 @@ typedef struct crtirec {
     long crtmemaddr, crtcontroladdr, keybufferaddr, progstateinfoaddr;
     short keybuffersize;
     crtconsttype crtcon;
-    Char right, left, down, up, badch, chardel, stop, break_, flush, eof,
+    char right, left, down, up, badch, chardel, stop, break_, flush, eof,
 	 altmode, linedel, backspace, etx, prefix;
     unsigned short prefixed;
     long cursormask, spare;
@@ -215,13 +209,13 @@ typedef enum {
     KGETCHAR, KAPPEND, KNONADVANCE, KCLEAR, KDISPLAY, KGETLAST, KPUTFIRST
 } KOPTYPE;
 
-typedef Char KBUFTYPE[KMAXBUFSIZE + 1];
+typedef char KBUFTYPE[KMAXBUFSIZE + 1];
 
 typedef struct KBUFREC {
-    boolean ECHO;
-    Char NON_CHAR;
+    int ECHO;
+    char NON_CHAR;
     long MAXSIZE, SIZE, INP, OUTP;
-    Char *BUFFER;
+    char *BUFFER;
 } KBUFREC;
 
 
@@ -244,19 +238,19 @@ typedef enum {
 
 typedef struct LANGCOMREC {
     uchar STATUS, DATA;
-    Char KEY;
+    char KEY;
     KEYTYPE RESULT;
-    boolean SHIFT, CONTROL, EXTENSION;
+    int SHIFT, CONTROL, EXTENSION;
 } LANGCOMREC;
 
 typedef struct LANGKEYREC {
-    boolean NO_CAPSLOCK, NO_SHIFT, NO_CONTROL, NO_EXTENSION;
+    int NO_CAPSLOCK, NO_SHIFT, NO_CONTROL, NO_EXTENSION;
     KEYTYPE KEYCLASS;
-    Char KEYS[2];
+    char KEYS[2];
 } LANGKEYREC;
 
 typedef struct LANGRECORD {
-    boolean CAN_NONADV;
+    int CAN_NONADV;
     LANGTYPE LANGCODE;
     _PROCEDURE SEMANTICS;
     LANGKEYREC KEYTABLE[128];
@@ -306,11 +300,11 @@ typedef union descriprec {
 	uchar id;
 	unsigned twosets : 1, abscoords : 1, size16 : 1, hasprompts : 1,
 		 ext_desc : 1, security : 1, numaxes : 2;
-	Signed int counts : 16, maxcountx : 16, maxcounty : 16,
+	signed int counts : 16, maxcountx : 16, maxcounty : 16,
 		   maxcountz : 16;
 	unsigned promptack : 1, nprompts : 3, proximity : 1, nbuttons : 3;
     } U1;
-    Char darray[11];
+    char darray[11];
 } descriprec;
 
 typedef struct devicerec {
@@ -328,11 +322,11 @@ typedef struct loopdriverrec {
 } loopdriverrec;
 
 typedef struct LOOPCONTROLREC {
-    boolean rawmode;
+    int rawmode;
     devicerec loopdevices[lmaxdevices];
     char loopdevice;
     uchar loopcmd, loopdata;
-    boolean looperror, loopinconfig, loopcmddone, loopisok, loopdevreading;
+    int looperror, loopinconfig, loopcmddone, loopisok, loopdevreading;
 } LOOPCONTROLREC;
 
 
@@ -370,21 +364,21 @@ typedef union HPHIL_COMM_REC_TYPE {
     struct {
 	short dvr_type;
 	char dev_addr;
-	boolean latch, active, reading;
+	int latch, active, reading;
 	uchar devices;
 	_PROCEDURE update;
 	union HPHIL_COMM_REC_TYPE *link;
 	long extend;
 	short xloc, yloc, zloc, codetype, ncodes;
-	Char codes[16];
+	char codes[16];
     } U1;
-    Char barray[54];
+    char barray[54];
 } HPHIL_COMM_REC_TYPE;
 
 
 
 vextern psysenviron *SYSCOM;
-vextern boolean ALPHASTATE, GRAPHICSTATE;
+vextern int ALPHASTATE, GRAPHICSTATE;
 vextern _PROCEDURE CRTIOHOOK;
 vextern _PROCEDURE TOGGLEALPHAHOOK;
 vextern _PROCEDURE TOGGLEGRAPHICSHOOK;
@@ -405,13 +399,13 @@ vextern _PROCEDURE KBDPOLLHOOK;
 vextern KEYBOARDTYPE KBDTYPE;
 vextern uchar KBDCONFIG;
 vextern LANGTYPE KBDLANG;
-vextern Char *SYSMENU, *SYSMENUSHIFT;
+vextern char *SYSMENU, *SYSMENUSHIFT;
 vextern MENUTYPE MENUSTATE;
 vextern _PROCEDURE MASKOPSHOOK, BEEPERHOOK;
 vextern uchar BFREQUENCY, BDURATION;
 vextern _PROCEDURE RPGREQHOOK;
 vextern _PROCEDURE RPGISRHOOK;
-vextern boolean BATTERYPRESENT;
+vextern int BATTERYPRESENT;
 vextern _PROCEDURE BATCMDHOOK;
 vextern _PROCEDURE BATREADHOOK;
 vextern _PROCEDURE CLOCKREQHOOK;
@@ -421,13 +415,13 @@ vextern _PROCEDURE TIMERISRHOOK;
 vextern KBUFREC *KEYBUFFER;
 vextern _PROCEDURE KBDWAITHOOK;
 vextern _PROCEDURE KBDRELEASEHOOK;
-vextern Char STATUSLINE[8];
+vextern char STATUSLINE[8];
 vextern LANGCOMREC LANGCOM;
 vextern LANGRECORD *LANGTABLE[2];
 vextern char LANGINDEX;
 vextern _PROCEDURE KBDTRANSHOOK;
 vextern KEYTRANSTYPE TRANSMODE;
-vextern boolean KBDSYSMODE, KBDALTLOCK, KBDCAPSLOCK;
+vextern int KBDSYSMODE, KBDALTLOCK, KBDCAPSLOCK;
 vextern loopdriverrec *loopdriverlist;
 vextern LOOPCONTROLREC *LOOPCONTROL;
 vextern _PROCEDURE HPHILCMDHOOK;
@@ -439,47 +433,47 @@ vextern HPHIL_COMM_REC_TYPE *HPHIL_DATA_LINK;
 /*4/6/84 SFB*/
 /*3/13/85 SFB*/
 /*-----------------------------------------------------------------------------*/
-extern Void SYSDEV_INIT PV();
+extern void SYSDEV_INIT ();
 
 /** BEEPER ***********************************************/
-extern Void BEEP PV();
-extern Void BEEPER PP((int FREQUENCY, int DURATION));
+extern void BEEP ();
+extern void BEEPER (int FREQUENCY, int DURATION);
 
 /** RPG **************************************************/
-extern Void SETRPGRATE PP((int RATE));
+extern void SETRPGRATE (int RATE);
 
 /** KEYBOARD *********************************************/
-extern Void KBDSETUP PP((int CMD, int VALUE));
-extern Void KBDIO PP((fib *FP, int REQUEST, Char *BUFFER, long BUFSIZE,
-		      long POSITION));
-extern Void lockedaction PP((_PROCEDURE a));
+extern void KBDSETUP (int CMD, int VALUE);
+extern void KBDIO (fib *FP, int REQUEST, char *BUFFER, long BUFSIZE,
+		      long POSITION);
+extern void lockedaction (_PROCEDURE a);
 
 /** CRT **************************************************/
-extern Void CRTIO PP((fib *FP, int REQUEST, Char *BUFFER, long BUFSIZE,
-		      long POSITION));
-extern Void DUMMYCRTLL PP((int OP, long *POSITION, int C));
+extern void CRTIO (fib *FP, int REQUEST, char *BUFFER, long BUFSIZE,
+		      long POSITION);
+extern void DUMMYCRTLL (int OP, long *POSITION, int C);
 
 /** BATTERY **********************************************/
-extern Void BATCOMMAND PP((int CMD, long NUMDATA, int B1, int B2, int B3,
-			   int B4, int B5));
-extern uchar BATBYTERECEIVED PV();
+extern void BATCOMMAND (int CMD, long NUMDATA, int B1, int B2, int B3,
+			   int B4, int B5);
+extern uchar BATBYTERECEIVED ();
 
 /** CLOCK ************************************************/
-extern long sysclock PV();
+extern long sysclock ();
 
 /*centiseconds from midnight*/
-extern Void sysdate PP((daterec *thedate));
-extern Void systime PP((timerec *thetime));
-extern Void setsysdate PP((daterec thedate));
-extern Void setsystime PP((timerec thetime));
+extern void sysdate (daterec *thedate);
+extern void systime (timerec *thetime);
+extern void setsysdate (daterec thedate);
+extern void setsystime (timerec thetime);
 
 /** KEYBUFFER ********************************************/
-extern Void KEYBUFOPS PP((int OP, Char *C));
+extern void KEYBUFOPS (int OP, char *C);
 
 /** STATUSLINE *******************************************/
-extern Void SETSTATUS PP((long N, int C));
-extern Char RUNLIGHT PV();
-extern Void SETRUNLIGHT PP((int C));
+extern void SETSTATUS (long N, int C);
+extern char RUNLIGHT ();
+extern void SETRUNLIGHT (int C);
 
 
 
diff --git a/psys/include/p2c/sysglobals.h b/psys/include/p2c/sysglobals.h
index df5b3c7..42f0857 100644
--- a/psys/include/p2c/sysglobals.h
+++ b/psys/include/p2c/sysglobals.h
@@ -1,24 +1,18 @@
-/* Header for module sysglobals, generated by p2c */
 #ifndef SYSGLOBALS_H
 #define SYSGLOBALS_H
 
 
-
 #ifdef SYSGLOBALS_G
 # define vextern
 #else
 # define vextern extern
 #endif
 
-
-
-typedef Char fsidctype[20];
-
-
+/*20 CHARS: VERSION,DATE,TIME OF FILE SYS*/
+typedef char fsidctype[20];
 
 #define fsidc           "Rev.  3.1  18-Jul-85"
 
-/*20 CHARS: VERSION,DATE,TIME OF FILE SYS*/
 #define mminint         (-32768L)
 
 /*MINIMUM SHORT INTEGER VALUE*/
@@ -164,7 +158,7 @@ typedef enum {
     lastfkind
 } filekind;
 
-typedef Char window[];
+typedef char window[];
 
 typedef enum {
     readbytes, writebytes, flush, writeeol, readtoeol, clearunit, setcursor,
@@ -172,7 +166,7 @@ typedef enum {
 } amrequesttype;
 
 typedef struct fib {
-    Char *fwindow;
+    char *fwindow;
     struct fib *flistptr;
     long frecsize;
     short feft;
@@ -184,12 +178,12 @@ typedef struct fib {
     short freptcnt;
     _PROCEDURE am;
     long fstartaddress;
-    Char fvid[vidleng + 1];
-    Char ffpw[passleng + 1];
-    Char ftid[tidleng + 1];
+    char fvid[vidleng + 1];
+    char ffpw[passleng + 1];
+    char ftid[tidleng + 1];
     long pathid;
     short fanonctr;
-    Char *foptstring;
+    char *foptstring;
     long fileid;
     unsigned fb0 : 1, fb1 : 1, fnosrmtemp : 1, fwaitonlock : 1,
 	     fpurgeoldlink : 1, foverwritten : 1, fsavepathid : 1,
@@ -199,8 +193,8 @@ typedef struct fib {
     long fextra[3];
     short fextra2;
     union {
-	Char ftitle[fidleng + 1];
-	Char fbuffer[fblksize];
+	char ftitle[fidleng + 1];
+	char fbuffer[fblksize];
     } UU;
 } fib;
 
@@ -217,10 +211,10 @@ typedef struct unitentry {
     _PROCEDURE tm;
     uchar sc, ba, du, dv;
     long byteoffset, devid;
-    Char uvid[vidleng + 1];
+    char uvid[vidleng + 1];
     long dvrtemp;
     short dvrtemp2;
-    Char letter;
+    char letter;
     unsigned offline : 1, uisinteractive : 1, umediavalid : 1, uuppercase : 1,
 	     uisfixed : 1, ureportchange : 1, pad : 1, uisblkd : 1;
     union {
@@ -232,7 +226,7 @@ typedef unitentry unitabletype[maxunit + 1];
 
 typedef _PROCEDURE amtabletype[16];
 
-typedef Char suftabletype[16][6];
+typedef char suftabletype[16][6];
 
 typedef short efttabletype[16];
 
@@ -250,7 +244,7 @@ typedef enum {
 } iorsltwd;
 
 typedef struct isrib {
-    Char *intregaddr;
+    char *intregaddr;
     uchar intregmask, intregvalue;
     unsigned chainflag : 1;
     _PROCEDURE proc;
@@ -273,27 +267,25 @@ typedef struct datetimerec {
     timerec time;
 } datetimerec;
 
-
-
 vextern short sysescapecode;
-vextern Anyptr *openfileptr, *recoverblock, *heapmax, *heapbase;
+vextern void* *openfileptr, *recoverblock, *heapmax, *heapbase;
 vextern long sysioresult, hardwarestatus, locklevel;
 vextern unitentry *unitable;
 vextern inttabletype interrupttable;
 vextern long endisrhook, actionspending;
 vextern FILE **gfiles[6];
 vextern _PROCEDURE *amtable;
-vextern Char (*suffixtable)[6];
+vextern char (*suffixtable)[6];
 vextern short *efttable;
 vextern long sysunit;
-vextern Char syvid[vidleng + 1], dkvid[vidleng + 1];
-vextern Char syslibrary[fidleng + 1];
+vextern char syvid[vidleng + 1], dkvid[vidleng + 1];
+vextern char syslibrary[fidleng + 1];
 vextern _PROCEDURE debugger;
 vextern _PROCEDURE cleariohook;
 vextern inttabletype perminttable;
 vextern _PROCEDURE deferredaction[10];
 vextern _PROCEDURE serialtextamhook;
-vextern Char sysname[10];
+vextern char sysname[10];
 vextern struct {
     unsigned reserved1 : 1, reserved2 : 1, nointhpib : 1, crtconfigreg : 1,
 	     nokeyboard : 1, highlightsxorbiggraphics : 1, biggraphics : 1,
@@ -306,7 +298,6 @@ vextern struct {
 vextern short endsysvars;
 
 
-
 #undef vextern
 
 #endif /*SYSGLOBALS_H*/
diff --git a/psys/src/Makefile b/psys/src/Makefile
index 251ebc1..f4e6803 100644
--- a/psys/src/Makefile
+++ b/psys/src/Makefile
@@ -109,6 +109,7 @@ OBJS = sysdevs.o \
        hpib_2.o \
        mylib.o \
        newkbd.o \
+	   strings.o \
        newasmlib.o \
        newcrt.o \
        math.o \
@@ -172,7 +173,6 @@ FONTS =
 ## Solaris 1.X (SunOS)              -DBSD
 ## HP series 800 (gcc)
 ## HP series 800 (cc)                -w -Aa -D_HPUX_SOURCE -DF_OK=0
-## IBM RS/6000 (xlc)                 -DBSD=0 -Drs6000 -D_POSIX_SOURCE
 ## Apple AU/X                        -Daux
 ## Apple MachTen                     -DBSD -DF_OK=0  
 ## DEC Alpha (Linux or OSF)          -DBSD -Dlinux -DF_OK=0 -D__GCC__
@@ -194,7 +194,9 @@ FONTS =
 
 CHIPMUNKFLAGS = -m32 -DBSD -Dlinux -DF_OK=0 
 
-CFLAGS = $(CHIPMUNKFLAGS) $(FONTS) -I$(LOCINC) -I$(XINCLUDEDIR) -DCHIPLIB=\"`$(CD) $(LIBDIR); pwd`\"
+OPTIONS = -Wall -Wextra
+
+CFLAGS = $(CHIPMUNKFLAGS) $(OPTIONS) $(FONTS) -I$(LOCINC) -I$(XINCLUDEDIR) -DCHIPLIB=\"`$(CD) $(LIBDIR); pwd`\"
 
 P2CFLAGS = -DLOCAL_INIT=_local_p2c_init
 
@@ -262,7 +264,6 @@ pdistrib:
 
 psysinc:
 	cp ../include/p2c/p2c.h psys/include/p2c
-	cp ../include/p2c/asm.h psys/include/p2c
 	cp ../include/p2c/sysglobals.h psys/include/p2c
 	cp ../include/p2c/sysdevs.h psys/include/p2c
 	cp ../include/p2c/misc.h psys/include/p2c
@@ -332,10 +333,3 @@ psyssrc:
 	sed -e "s;1.61;$(VERSION);" Makefile.os2 >psys/src/Makefile.os2
 	cp COPYING psys/src/COPYING
 
-
-
-
-
-
-
-
diff --git a/psys/src/Makefile.os2 b/psys/src/Makefile.os2
deleted file mode 100644
index c78e413..0000000
--- a/psys/src/Makefile.os2
+++ /dev/null
@@ -1,170 +0,0 @@
-
-# "PSYS", p-system emulation libraries for the Caltech tools,
-#
-#   Copyright (C) 1983, 1990, 1993 California Institute of Technology.
-#   Authors: Dave Gillespie, Rick Koshi, Glenn Gribble, Adam Greenblatt
-#   Maintainers: John Lazzaro and Dave Gillespie
-#   Maintainers's address: lazzaro@cs.berkeley.edu;
-#                          EECS/571 Evans Hall/UCB/Berkeley CA 94720
-#                          daveg@synaptics.com;
-#                          Send questions, bug fixes, to these addresses.
-#
-#
-#This program is free software; you can redistribute it and/or modify
-#it under the terms of the GNU General Public License as published by
-#the Free Software Foundation (Version 1, 1989).
-#
-#This program is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#GNU General Public License for more details.
-#
-#You should have received a copy of the GNU General Public License
-#along with this program; see the file COPYING.  If not, write to
-#the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-# Makefile for Chipmunk CAD Pascal emulation libraries.  Version 1.61
-
-##
-## OS Makefile changes made by Michael Godfrey, godfrey@isl.stanford.edu
-##
-##
-## Comment blocks in this Makefile point to possible changes that need
-## to be made for different OS installations. Its a good idea to look it
-## over first before starting your compilation
-
-## if your OS/2 doesn't have these common Unix commands installed, you'l
-## need to change these definitions.
-
-CD = cd
-CP = copy
-CPR = xcopy
-RM = rm
-RMF = rm -f
-
-# replace these two definitions with absolute paths for your system
-
-LIBDIR = E:\lib
-BINDIR = ..\..\bin
-
-# 
-
-
-LIB = ..\libp2c.a.lib
-
-LOCINC = ..\include
-XINCLUDEDIR = e:\x11\include
-
-##
-##  (1) Choosing your compiler
-##  ---------------------------
-##
-## The original OS/2 port was done with the icc compiler; while we expect
-## only changes for the differences in compiler flags, it might be possible
-## source or Makefile changes will be needed as well. Please let us know of
-## any such changes if you are using a different compiler, so we can update
-## the release.
-
-OBJ = obj
-
-CHIPMUNKCC = icc
-
-OBJS = sysdevs.$(OBJ) \
-       rnd.$(OBJ) \
-      markrelease.$(OBJ) \
-      misc.$(OBJ) \
-      newci.$(OBJ) \
-      mamplot.$(OBJ) \
-      plot.$(OBJ) \
-      filepack.$(OBJ) \
-      fs.$(OBJ) \
-      iodecl.$(OBJ) \
-      loader.$(OBJ) \
-      lunix_pas.$(OBJ) \
-      newtablet.$(OBJ) \
-      general_1.$(OBJ) \
-      general_2.$(OBJ) \
-      general_3.$(OBJ) \
-      hpib_2.$(OBJ) \
-      mylib.$(OBJ) \
-      newkbd.$(OBJ) \
-      newasmlib.$(OBJ) \
-      newcrt.$(OBJ) \
-      math.$(OBJ) \
-      regex.$(OBJ) \
-      numex.$(OBJ) \
-      p2clib.$(OBJ) \
-      loc.p2clib.$(OBJ)
-
-LOBJS = +sysdevs.$(OBJ) \
-       +rnd.$(OBJ) \
-      +markrelease.$(OBJ) \
-      +misc.$(OBJ) \
-      +newci.$(OBJ) \
-      +mamplot.$(OBJ) \
-      +plot.$(OBJ) \
-      +filepack.$(OBJ) \
-      +fs.$(OBJ) \
-      +iodecl.$(OBJ) \
-      +loader.$(OBJ) \
-      +lunix_pas.$(OBJ) \
-      +newtablet.$(OBJ) \
-      +general_1.$(OBJ) \
-      +general_2.$(OBJ) \
-      +general_3.$(OBJ) \
-      +hpib_2.$(OBJ) \
-      +mylib.$(OBJ) \
-      +newkbd.$(OBJ) \
-      +newasmlib.$(OBJ) \
-      +newcrt.$(OBJ) \
-      +math.$(OBJ) \
-      +regex.$(OBJ) \
-      +numex.$(OBJ) \
-      +p2clib.$(OBJ) \
-      +loc.p2clib.$(OBJ)
-
-
-CC = $(CHIPMUNKCC)
-
-CD = cd
-
-
-##
-## (3) Adding appropriate flags
-## -----------------------------
-##
-## The CFLAGS below should be correct for compilation with the icc compiler.
-## Note the function of these two special flags:
-##
-##  -Ti   for symbolic debug
-##  -O+   for optimizer
-##
-
-CFLAGS = -O+ -Wpro- -Ti -Sa -Ms -Ss -Gm -DOS2 -I$(LOCINC) -I$(XINCLUDEDIR) -DCHIPLIB="\"$(LIBDIR)\"" -q -Se
-
-P2CFLAGS = -DLOCAL_INIT=_local_p2c_init
-
-
-all: setup libp2c.a
-
-setup:
-	-mkdir $(LIBDIR)
-
-install: setup all
-	$(CP) libp2c.a.lib $(LIB)
-	$(CP) texstuff.ps $(LIBDIR)
-	$(CP) untilstuff.ps $(LIBDIR)
-	$(CP) plot.font $(LIBDIR)
-	-mkdir $(BINDIR)
-
-libp2c.a: $(OBJS)
-	-$(RM) libp2c.a.lib
-	ilib /q /NOI /NOE libp2c.a.lib +e:\tcpip\lib\Xlib_Globals.obj +e:\tcpip\lib\Xext_Globals.obj $(LOBJS),,
-
-
-p2clib.$(OBJ): p2clib.c
-	$(CC) -c $(CFLAGS) $(P2CFLAGS) p2clib.c
-
-clean:
-	-$(RM) -f *.$(OBJ) libp2c.a.lib ../libp2c.a.lib
- 
diff --git a/psys/src/asm.c b/psys/src/asm.c
deleted file mode 100644
index 8ac9553..0000000
--- a/psys/src/asm.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#define ASM_G
-
-#include <stdio.h>
-#include <p2c/p2c.h>
-#include <p2c/asm.h>
-
-void asm_newbytes(p, n)
-Anyptr *p;
-long n;
-{
-  *p = malloc(n);
-}
diff --git a/psys/src/filepack.c b/psys/src/filepack.c
index b24f614..0dc7945 100644
--- a/psys/src/filepack.c
+++ b/psys/src/filepack.c
@@ -4,40 +4,26 @@
 #include <math.h>
 #include <p2c/p2c.h>
 #include <p2c/filepack.h>
-
-#ifndef SYSDEVS_H
 #include <p2c/sysdevs.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
 
-void fp_open_dir(dirfib, dirname, dirinfo)
-fib *dirfib;
-char *dirname;
-misc_catentry *dirinfo;
+void fp_open_dir(fib *dirfib, char *dirname, misc_catentry *dirinfo)
 {
   fprintf(stderr, "FILEPACK kluge: fp_open_dir not yet supported\n");
 }
 
-void fp_close_dir(dfib)
-fib *dfib;
+void fp_close_dir(fib *dfib)
 {
   fprintf(stderr, "FILEPACK kluge: fp_close_dir not yet supported\n");
 }
 
-void fp_cat_dir(dfib, numfiles, where)
-fib *dfib;
-short *numfiles;
-Anyptr *where;
+void fp_cat_dir(fib *dfib, short *numfiles, void **where)
 {
   fprintf(stderr, "FILEPACK kluge: fp_cat_dir not yet supported\n");
   *numfiles = 0;
 }
 
-void fp_change(filename1, filename2)
-char *filename1, *filename2;
+void fp_change(char* filename1, char *filename2)
 {
   char filename3[256];
   char *cp;
@@ -59,17 +45,14 @@ char *filename1, *filename2;
     unlink(filename1);
 }
 
-boolean fp_getwd(path, rootname)
-char *path, *rootname;
+int fp_getwd(char *path, char *rootname)
 {
   rootname[0] = '\0';
   return((getcwd(path, fidleng+1) != NULL));
 }
 
-void fp_remove(filename)
-char *filename;
+void fp_remove(char *filename)
 {
   unlink(filename);
 }
 
-
diff --git a/psys/src/fs.c b/psys/src/fs.c
index 322d35e..940589a 100644
--- a/psys/src/fs.c
+++ b/psys/src/fs.c
@@ -1,12 +1,8 @@
-#define FS_G
-
-
 #include <p2c/p2c.h>
 #include <p2c/fs.h>
 
 
-
-Void fs_zapspaces(Char *s)
+void fs_remove_spaces(char *s)
 {
   char *cp1 = s;
   char *cp2 = s;
@@ -20,7 +16,7 @@ Void fs_zapspaces(Char *s)
 }
 
 
-Void fs_fstripname(Char *s, Char *pvname, Char *ppath, Char *pfname)
+void fs_fstripname(char *s, char *pvname, char *ppath, char *pfname)
 {
   char *cp;
 
diff --git a/psys/src/general_1.c b/psys/src/general_1.c
index c8e1ab3..5602512 100644
--- a/psys/src/general_1.c
+++ b/psys/src/general_1.c
@@ -4,8 +4,6 @@
 #include <p2c/p2c.h>
 #include <p2c/general_1.h>
 
-void set_timeout(sc, sec)
-int sc;
-double sec;
+void set_timeout(int sc, double sec)
 {
 }
diff --git a/psys/src/general_2.c b/psys/src/general_2.c
index 7f088b9..4caed96 100644
--- a/psys/src/general_2.c
+++ b/psys/src/general_2.c
@@ -4,21 +4,15 @@
 #include <p2c/p2c.h>
 #include <p2c/general_2.h>
 
-void P_readstring(sc, s)
-long sc;
-Char *s;
+void P_readstring(long sc, char *s)
 {
 }
 
-void P_writestring(sc, s)
-long sc;
-Char *s;
+void P_writestring(long sc, char *s)
 {
 }
 
-void P_writestringln(sc, s)
-long sc;
-Char *s;
+void P_writestringln(long sc, char *s)
 {
 }
 
diff --git a/psys/src/general_3.c b/psys/src/general_3.c
index cd716c7..bad40c9 100644
--- a/psys/src/general_3.c
+++ b/psys/src/general_3.c
@@ -4,9 +4,7 @@
 #include <p2c/p2c.h>
 #include <p2c/general_3.h>
 
-char *ioerror_message(s, err)
-char *s;
-long err;
+char *ioerror_message(char *s, long err)
 {
   sprintf(s, "ioerror_message ERROR number %ld", err);
   return s;
diff --git a/psys/src/hpib_2.c b/psys/src/hpib_2.c
index 9827754..5e0a05a 100644
--- a/psys/src/hpib_2.c
+++ b/psys/src/hpib_2.c
@@ -5,8 +5,7 @@
 #include <p2c/hpib_2.h>
 
 
-void abort_hpib(sc)
-int sc;
+void abort_hpib(int sc)
 {
 }
 
diff --git a/psys/src/loader.c b/psys/src/loader.c
index 16fd4fc..c71cc2f 100644
--- a/psys/src/loader.c
+++ b/psys/src/loader.c
@@ -7,8 +7,7 @@
 #endif
 
 
-
-void markuser(void)
+void markuser()
 {
 }
 
diff --git a/psys/src/loc.p2clib.c b/psys/src/loc.p2clib.c
index fcc9ec8..36d76ba 100644
--- a/psys/src/loc.p2clib.c
+++ b/psys/src/loc.p2clib.c
@@ -1,4 +1,3 @@
-
 /* "p2c"  Copyright 1989  Dave Gillespie */
 
 
@@ -18,44 +17,13 @@ long P_citSystem;
 static P_citinforec citinfo;
 
 
-#ifdef citPWS
-pascal char citinfomod;
-#endif
-
-
-
-
-
 void _local_p2c_init()
 {
-#ifdef citPWS
-    struct pasc_citinfo {
-        char username[32];
-        char homepath[122];
-        char loginat[6];
-        short node;
-        short userid;
-        short groupid;
-        char machine[20];
-        char novice;
-    } *pcit = P__var(citinfomod, -4, struct pasc_citinfo *);
-    P_citinfo = &citinfo;
-    str_ptoc(P_citinfo->username, pcit->username);
-    P_citinfo->node = pcit->node;
-    P_citinfo->userid = pcit->userid;
-    *P_citinfo->machine = 0;
-    P_citSystem = P__var(citinfomod, -16, int);
-#else
     char *getlogin();
     P_citinfo = &citinfo;
     cuserid(P_citinfo->username);
 
-#ifdef OS2
-    if( getenv("HOME") != NULL)
-      strcpy(P_citinfo->homepath, getenv("HOME"));
-#else
     strcpy(P_citinfo->homepath, getenv("HOME"));
-#endif
 
     /* should initialize loginat somehow */
     P_citinfo->node = 0;
@@ -63,12 +31,6 @@ void _local_p2c_init()
     P_citinfo->groupid = getgid();
     *P_citinfo->machine = 0;
     P_citinfo->novice = 0;
-#endif
 }
 
-
-
-
-
 /* End. */
-
diff --git a/psys/src/lunix_pas.c b/psys/src/lunix_pas.c
index ac78455..bcae92c 100644
--- a/psys/src/lunix_pas.c
+++ b/psys/src/lunix_pas.c
@@ -13,7 +13,7 @@
 
 
 
-Void lunix_intToDate (long idate, daterec *date, timerec *time)
+void lunix_intToDate (long idate, daterec *date, timerec *time)
 {
   struct tm *temp_tm;
 
diff --git a/psys/src/mamplot.c b/psys/src/mamplot.c
index b4f9c20..0508dab 100644
--- a/psys/src/mamplot.c
+++ b/psys/src/mamplot.c
@@ -1,66 +1,3 @@
-/* Output from p2c, the Pascal-to-C translator */
-/* From input file "mamplot.text" */
-
-
-/* shouldn't this be the FIRST line in the file? - DAVE */
-
-/*caged_date='I{ Last edit by $U on $X (Various fixes) $]'*/
-/* Last edit by dave on Mar 5, 1989 5:13 pm (Various fixes) */
-/* Last edit by dave on Mar 5, 1989 5:12 pm (Various fixes) */
-/* Last edit by dave on Mar 5, 1989 4:55 pm (Various fixes) */
-/* Last edit by dave on Mar 5, 1989 4:52 pm (Various fixes) */
-/* Last edit by dave on Oct 21, 1988 1:34 pm (Various fixes) */
-/* Last edit by dave on Feb 29, 1988 6:36 pm (Various fixes) */
-/* Last edit by dave on Feb 29, 1988 6:28 pm (Various fixes) */
-/* Last edit by dave on Feb 29, 1988 6:27 pm (Various fixes) */
-/* Last edit by dave on Feb 29, 1988 6:26 pm (Various fixes) */
-/* Last edit by dave on Feb 29, 1988 6:24 pm (Various fixes) */
-/* Last edit by dave on Feb 29, 1988 6:21 pm (Various fixes) */
-/* Last edit by dave on Feb 29, 1988 5:22 pm (Various fixes) */
-/* Last edit by dave on Feb 29, 1988 4:44 pm (Various fixes) */
-/* Last edit by dave on Feb 29, 1988 3:54 pm (Various fixes) */
-/* Last edit by dave on Feb 29, 1988 3:25 pm (Various fixes) */
-/* Last edit by dave on Jan 21, 1988 1:12 am (Fix TeX mode) */
-/* Last edit by dave on Nov 30, 1987 5:28 pm (Various fixes for View) */
-/* Last edit by dave on Nov 30, 1987 2:53 pm (Various fixes for View) */
-/* Last edit by dave on Nov 24, 1987 4:57 pm (Various fixes for View) */
-/* Last edit by dave on Nov 11, 1987 4:03 am (Various fixes for View) */
-/* Last edit by dave on Nov 8, 1987 9:29 am (Changed 2*pi to pi+pi to avoid compiler bug) */
-/* Last edit by dave on Nov 2, 1987 9:23 pm (Changed 2*pi to pi+pi to avoid compiler bug) */
-/* Last edit by dave on Oct 21, 1987 4:35 pm (Changed 2*pi to pi+pi to avoid compiler bug) */
-/* Last edit by mass on Dec 8, 1986 2:32 pm (To add the above comment) */
-/* Last edit by mass on Dec 8, 1986 2:30 pm (To add the above comment) */
-/* Last edit by mass on Dec 8, 1986 2:15 pm (To add the above comment) */
-/* Last edit by dave on Nov 15, 1986 3:12 am (To add the above comment) */
-
-
-/* DAVE 3/5/89 fixes:
-    * changed mam_date to print current directory instead
-*/
-/* DAVE 2/29/88 fixes:
-    * changed origins of certain labels
-    * added mam_mirroraxis
-    * added mam_fltlabel, mam_fixlabel
-    * fixed subticks on log plots when plot_interval > 1.0
-*/
-/* DAVE 11/10/87 fixes:
-    * completed the half-implemented mam_fullrange
-    * fixed the infinite loop when datamin=datamax
-    * engineering mode uses 10^3 if no units, K if units
-    * engineering mode does not round values to integers!
-    * added mam_transform and mam_untransform
-    * added mam_gridaxis stuff
-    * added mam_tex mode
-    * added username to mam_date display
-    * added mam_drawborder and mam_drawaxes
-*/
-
-
-/*$debug on${*/
-
-
-
-
 #include <p2c/p2c.h>
 
 
@@ -68,26 +5,10 @@
 #include <p2c/plot_routines.h>
 
 /*file support*/
-
-#ifndef FS_H
 #include <p2c/fs.h>
-#endif
-
-#ifndef PASSWORDMOD_H
 #include <p2c/passmod.h>
-#endif
-
-#ifndef CITINFOMOD_H
 #include <p2c/citinfomod.h>
-#endif
-
-#ifndef SYSDEVS_H
 #include <p2c/sysdevs.h>
-#endif
-
-#ifndef MATH_H
-#include <p2c/math.h>
-#endif
 
 
 typedef enum {
@@ -105,10 +26,10 @@ typedef struct _REC_axis_limits {
   long dpower;
   double plot_interval;
   long intpower;
-  Char title[256], units[256];
+  char title[256], units[256];
   plottype dplotype;
   double scale, offset;
-  boolean integerlabel, engineering, selfscale, floating, fixed;
+  int integerlabel, engineering, selfscale, floating, fixed;
 } _REC_axis_limits;
 
 typedef _REC_axis_limits axis_limits[3];
@@ -123,31 +44,27 @@ typedef struct char_limits {
 typedef double clip_bcarray[4];   /*left, right, bottom, top*/
 
 
-Static axis_limits DATALIMIT;
-Static device_limits PLOTLIMIT;
-
-Static char_limits axischar, labelchar, titlechar, symbolchar;
-Static double symbolxoff, symbolyoff, ticksize;
-Static long bordercolor, tickcolor, TICKFRAC, datacolor, datastyle;
-
-Static double logdif[8];
+static axis_limits DATALIMIT;
+static device_limits PLOTLIMIT;
 
-Static long num_axes;
-Static boolean wallpaper;
-Static boolean grid[3], mirrored[3];
-Static boolean drewborder, drewaxes, texmode;
+static char_limits axischar, labelchar, titlechar, symbolchar;
+static double symbolxoff, symbolyoff, ticksize;
+static long bordercolor, tickcolor, TICKFRAC, datacolor, datastyle;
 
-Static double clip_oldx, clip_oldy;
-Static clip_bcarray clip_oldbc;
-Static long clip_oldoc;
-Static boolean clip_there;
+static double logdif[8];
 
+static long num_axes;
+static int wallpaper;
+static int grid[3], mirrored[3];
+static int drewborder, drewaxes, texmode;
 
+static double clip_oldx, clip_oldy;
+static clip_bcarray clip_oldbc;
+static long clip_oldoc;
+static int clip_there;
 
 
-double mam_mean(x, len)
-double **x;
-long len;
+double mam_mean(double **x, long len)
 {
   double result;
   long i;
@@ -160,9 +77,7 @@ long len;
 }
 
 
-double mam_stddev(x, len)
-double **x;
-long len;
+double mam_stddev(double **x, long len)
 {
   double result, sumxsquared, sumsquaredx;
   long i;
@@ -182,8 +97,7 @@ long len;
 #define pi              3.1415926
 
 
-double mam_normal(mean, stddev, x)
-double mean, stddev, x;
+double mam_normal(double mean, double stddev, double x)
 {
   /* return the probability density of value x, with a distribution
      of mean and stddev */
@@ -196,8 +110,7 @@ double mean, stddev, x;
 #undef pi
 
 
-double mam_log(x)
-double x;
+double mam_log(double x)
 {
   double Result;
 
@@ -210,48 +123,36 @@ double x;
 }
 
 
-
 /* Convert from fraction of paper height to window units */
-Static long fraction(frac)
-double frac;
+static long fraction(double frac)
 {
   return ((long)((PLOTLIMIT[1].titlemax - PLOTLIMIT[1].titlemin) * frac));
 }
 
-
-
-
-
 /*Procedures for User defined stuff here*/
 /*****/
 
 
 /*Vector memory management*/
-Void mam_new(vec, size)
-double **vec;
-long size;
+void mam_new(double **vec, long size)
 {
   *vec = (double *)Malloc(size * sizeof(double));
 }
 
-
-Void mam_dispose(vec, size)
-double **vec;
-long size;
+void mam_dispose(double **vec, long size)
 {
   Free(*vec);
 }
 
 
-Void mam_gridaxis(axis)
-long axis;
+void mam_gridaxis(long axis)
 {
   /*DAVE 11/10/87*/
   grid[axis - 1] = true;
 }
 
 
-Void mam_grid()
+void mam_grid()
 {
   long i;
 
@@ -260,53 +161,40 @@ Void mam_grid()
 }
 
 
-Void mam_mirroraxis(axis)
-long axis;
+void mam_mirroraxis(long axis)
 {
   mirrored[axis - 1] = true;
 }
 
-
-Void mam_tex()
+void mam_tex()
 {
   texmode = true;
 }
 
-
 /*Specify Integer Labels*/
-Void mam_intlabel(axis)
-long axis;
+void mam_intlabel(long axis)
 {
   DATALIMIT[axis - 1].integerlabel = true;
 }
 
-
-Void mam_englabel(axis)
-long axis;
+void mam_englabel(long axis)
 {
   DATALIMIT[axis - 1].engineering = true;
 }
 
-
-Void mam_fltlabel(axis)
-long axis;
+void mam_fltlabel(long axis)
 {
   DATALIMIT[axis - 1].floating = true;
 }
 
 
-Void mam_fixlabel(axis)
-long axis;
+void mam_fixlabel(long axis)
 {
   DATALIMIT[axis - 1].fixed = true;
 }
 
-
-
 /*Let the user define the scaling parameters and set flag*/
-Void mam_range(axis, min, max)
-long axis;
-double min, max;
+void mam_range(long axis, double min, double max)
 {
   DATALIMIT[axis - 1].datamin = min;
   DATALIMIT[axis - 1].datamax = max;
@@ -315,9 +203,7 @@ double min, max;
 }
 
 
-Void mam_fullrange(axis, min, max, interval)
-long axis;
-double min, max, interval;
+void mam_fullrange(long axis, double min, double max, double interval)
 {
   DATALIMIT[axis - 1].datamin = min;
   DATALIMIT[axis - 1].datamax = max;
@@ -328,9 +214,7 @@ double min, max, interval;
 }
 
 
-Void mam_getrange(axis, min, max, interval)
-long axis;
-double *min, *max, *interval;
+void mam_getrange(long axis, double *min, double *max, double *interval)
 {
   *min = DATALIMIT[axis - 1].datamin;
   if (DATALIMIT[axis - 1].dplotype == pt_log)   /*from MATH module*/
@@ -341,168 +225,115 @@ double *min, *max, *interval;
   *interval = DATALIMIT[axis - 1].plot_interval;
 }
 
-
-
-Void mam_quality()
+void mam_quality()
 {
   plot_quality();
 }
 
-
-
-
-
-Void mam_axissize(frac)
-double frac;
+void mam_axissize(double frac)
 {
   axischar.height_frac = frac;
 }
 
-
-Void mam_axisfont(num)
-long num;
+void mam_axisfont(long num)
 {
   axischar.font = num;
 }
 
-
-Void mam_axiscolor(col)
-long col;
+void mam_axiscolor(long col)
 {
   axischar.color = col;
 }
 
-
-Void mam_labelsize(frac)
-double frac;
+void mam_labelsize(double frac)
 {
   labelchar.height_frac = frac;
 }
 
-
-Void mam_labelfont(num)
-long num;
+void mam_labelfont(long num)
 {
   labelchar.font = num;
 }
 
-
-Void mam_labelcolor(col)
-long col;
+void mam_labelcolor(long col)
 {
   labelchar.color = col;
 }
 
-
-Void mam_titlesize(frac)
-double frac;
+void mam_titlesize(double frac)
 {
   titlechar.height_frac = frac;
 }
 
-
-Void mam_titlefont(num)
-long num;
+void mam_titlefont(long num)
 {
   titlechar.font = num;
 }
 
-
-Void mam_titlecolor(col)
-long col;
+void mam_titlecolor(long col)
 {
   titlechar.color = col;
 }
 
-
-Void mam_symbolsize(frac)
-double frac;
+void mam_symbolsize(double frac)
 {
   symbolchar.height_frac = frac;
 }
 
-
-Void mam_symbolfont(num)
-long num;
+void mam_symbolfont(long num)
 {
   symbolchar.font = num;
 }
 
-
-Void mam_symbolcolor(col)
-long col;
+void mam_symbolcolor(long col)
 {
   symbolchar.color = col;
 }
 
-
-Void mam_symboloffset(xfrac, yfrac)
-double xfrac, yfrac;
+void mam_symboloffset(double xfrac, double yfrac)
 {
   symbolxoff = xfrac;
   symbolyoff = yfrac;
 }
 
-
-
-
-Void mam_setfontfile(fn)
-Char *fn;
+void mam_setfontfile(char *fn)
 {
   plot_fontfile(fn);
 }
 
-
-
-Void mam_ticksize(frac)
-double frac;
+void mam_ticksize(double frac)
 {
   ticksize = frac;
 }
 
-
-Void mam_tickcolor(col)
-long col;
+void mam_tickcolor(long col)
 {
   tickcolor = col;
 }
 
-
-Void mam_bordercolor(col)
-long col;
+void mam_bordercolor(long col)
 {
   bordercolor = col;
 }
 
-
-
-Void mam_datacolor(col)
-long col;
+void mam_datacolor(long col)
 {
   datacolor = col;
 }
 
-
-Void mam_datastyle(style)
-long style;
+void mam_datastyle(long style)
 {
   datastyle = style;
 }
 
-
-
-
-Void mam_charsize(frac)
-double frac;
+void mam_charsize(double frac)
 {
   mam_axissize(frac);
   mam_labelsize(frac);
   mam_titlesize(frac);
 }
 
-
-Void mam_font(num)
-long num;
+void mam_font(long num)
 {
   mam_axisfont(num);
   mam_labelfont(num);
@@ -510,9 +341,7 @@ long num;
   mam_symbolfont(num);
 }
 
-
-Void mam_color(col)
-long col;
+void mam_color(long col)
 {
   mam_axiscolor(col);
   mam_labelcolor(col);
@@ -523,14 +352,7 @@ long col;
   mam_bordercolor(col);
 }
 
-
-
-
-
-Static Void initcharlimits(rec, size, font, color)
-char_limits *rec;
-double size;
-long font, color;
+static void initcharlimits(char_limits *rec, double size, long font, long color)
 {
   rec->height_frac = size;
   rec->font = font;
@@ -538,8 +360,7 @@ long font, color;
 }
 
 
-Static Void computecharlimits(rec)
-char_limits *rec;
+static void computecharlimits(char_limits *rec)
 {
   rec->height = fraction(rec->height_frac);
   plot_selfont(rec->font);
@@ -549,9 +370,7 @@ char_limits *rec;
   rec->width = plot_stringwidth("0");
 }
 
-
-Static Void setupcharlimits(rec)
-char_limits *rec;
+static void setupcharlimits(char_limits *rec)
 {
   computecharlimits(rec);
   plot_charorient(0.0, false);
@@ -559,14 +378,11 @@ char_limits *rec;
 }
 
 
-
-
-
 /*Initialization routines go here*/
 /*****/
 /**************************************************/
 
-Void mam_setup_generic()
+void mam_setup_generic()
 {
   long i;
 
@@ -592,11 +408,7 @@ Void mam_setup_generic()
   drewaxes = false;
 }
 
-
-
-
-
-Void mam_init_generic()
+void mam_init_generic()
 {
   long i;
   _REC_axis_limits *WITH;
@@ -643,12 +455,8 @@ $end$*/
 }
 
 
-
-
-
-
 /**************************************************/
-Void mam_init_plotter()
+void mam_init_plotter()
 {
   mam_setup_generic();
   plot_init_fast();
@@ -656,10 +464,8 @@ Void mam_init_plotter()
 }
 
 
-
-
-Void mam_init_file(fname)
-Char *fname;
+void mam_init_file(fname)
+char *fname;
 {
   mam_setup_generic();
   plot_initfile_fast(fname);
@@ -667,9 +473,8 @@ Char *fname;
 }
 
 
-
-Void mam_init_ps(fname)
-Char *fname;
+void mam_init_ps(fname)
+char *fname;
 {
   mam_setup_generic();
   plot_initps_fast(fname);
@@ -677,8 +482,7 @@ Char *fname;
 }
 
 
-
-Void mam_init_screen()
+void mam_init_screen()
 {
   mam_setup_generic();
   plot_initscreen_fast();
@@ -686,10 +490,7 @@ Void mam_init_screen()
 }
 
 
-
-
-
-Void mam_close()
+void mam_close()
 {
   mam_close_generic();
   plot_view();
@@ -697,20 +498,13 @@ Void mam_close()
 }
 
 
-
-
-
-
-
 /************************************************************/
-Static Void transform(from_origin, from_corner, to_origin, to_corner, scale,
-		      offset)
-double from_origin, from_corner, to_origin, to_corner, *scale, *offset;
+static void transform(double from_origin, double from_corner, double to_origin, double to_corner, double *scale,
+		      double *offset)
 {
   *scale = (to_corner - to_origin) / (from_corner - from_origin);
   *offset = (to_corner * from_origin - to_origin * from_corner) /
 	    (from_origin - from_corner);
-
 }
 
 
@@ -719,11 +513,7 @@ double from_origin, from_corner, to_origin, to_corner, *scale, *offset;
 /*length len returns sorted = true if the input is*/
 /*not monotonically increasing                    */
 
-Static Void maxmin(x, xlen, max, min, amax, amin, sorted)
-double *x;
-long xlen;
-double *max, *min, *amax, *amin;
-boolean *sorted;
+static void maxmin(double *x, long xlen, double *max, double *min, double *amax, double *amin, int *sorted)
 {
   long i;
 
@@ -756,8 +546,7 @@ boolean *sorted;
 
 /**************************************************/
 
-Static long mag(x)
-double x;
+static long mag(double x)
 {
   /*returns the power needed to normalize x*/
   double logval;
@@ -772,12 +561,9 @@ double x;
   return (0L);
 }
 
-
 /**************************************************/
 
-Static double expon(x, power)
-double x;
-long power;
+static double expon(double x, long power)
 {
   /*return x times ten to the power power*/
   long i;
@@ -799,9 +585,7 @@ long power;
 
 /*******************************************************************/
 
-Static double normal(x, power)
-double x;
-long power;
+static double normal(double x, long power)
 {
   /*yow!  normal(x,i) = expon(x,-i)*/
   long i;
@@ -817,15 +601,11 @@ long power;
   return x;
 }
 
-
-
 /*Scaling routines go here*/
-Static Void scale_data(x, y, ytype, len)
-double **x, **y;
-long ytype, len;
+static void scale_data(double **x, double **y, long ytype, long len)
 {
   double localmax, localmin, localamax, localamin;
-  boolean sorted;
+  int sorted;
   _REC_axis_limits *WITH;
 
   WITH = DATALIMIT;
@@ -858,13 +638,10 @@ long ytype, len;
 
 /**************************************************/
 
-Void mam_scale_generic(axis, x, len)
-long axis;
-double **x;
-long len;
+void mam_scale_generic(long axis, double **x, long len)
 {
   double localmax, localmin, localamax, localamin;
-  boolean sorted;
+  int sorted;
   _REC_axis_limits *WITH;
 
   WITH = &DATALIMIT[axis - 1];
@@ -882,28 +659,20 @@ long len;
 
 /**************************************************/
 
-Void mam_scale(x, y, len)
-double **x, **y;
-long len;
+void mam_scale(double **x, double **y, long len)
 {
   scale_data(x, y, 2L, len);
 }
 
 
-Void mam_scalenormal(x, y, len, normalx)
-double **x, **y;
-long len;
-double **normalx;
+void mam_scalenormal(double **x, double **y, long len, double **normalx)
 {
   scale_data(x, y, 2L, len);
 }
 
-
 /**************************************************/
 
-Void mam_rscale(x, y, len)
-double **x, **y;
-long len;
+void mam_rscale(double **x, double **y, long len)
 {
   /*scale data for right axis*/
   num_axes = 3;
@@ -913,50 +682,37 @@ long len;
 
 /***************************************************/
 
-Static double rtran(x, xscale, xoffset)
-double x, xscale, xoffset;
+static double rtran(double x, double xscale, double xoffset)
 {
   return (xscale * x + xoffset);
 }
 
-
-Static double rtranx(x)
-double x;
+static double rtranx(double x)
 {
   return (rtran(x, DATALIMIT[0].scale, DATALIMIT[0].offset));
 }
 
 
-Static double rtrany(y, yaxis)
-double y;
-long yaxis;
+static double rtrany(double y, long yaxis)
 {
   return (rtran(y, DATALIMIT[yaxis - 1].scale, DATALIMIT[yaxis - 1].offset));
 }
 
 
-Static long tranx(x)
-double x;
+static long tranx(double x)
 {
   return ((long)rtranx(x));
 }
 
-
-Static long trany(y, yaxis)
-double y;
-long yaxis;
+static long trany(double y, long yaxis)
 {
   return ((long)rtrany(y, yaxis));
 }
 
 
-
 /**************************************************/
 
-Void mam_transform(x, y, yaxis, tx, ty)
-double x, y;
-long yaxis;
-double *tx, *ty;
+void mam_transform(double x, double y, long yaxis, double *tx, double *ty)
 {
   if (DATALIMIT[0].dplotype == pt_log)
     x = mam_log(x);
@@ -966,21 +722,14 @@ double *tx, *ty;
   *ty = rtrany(y, yaxis);
 }
 
-
-Void mam_rtransform(dx, dy, yaxis, tdx, tdy)
-double dx, dy;
-long yaxis;
-double *tdx, *tdy;
+void mam_rtransform(double dx, double dy, long yaxis, double *tdx, double *tdy)
 {
   *tdx = dx * DATALIMIT[0].scale;
   *tdy = dy * DATALIMIT[yaxis - 1].scale;
 }
 
 
-Void mam_untransform(tx, ty, yaxis, x, y)
-double tx, ty;
-long yaxis;
-double *x, *y;
+void mam_untransform(double tx, double ty, long yaxis, double *x, double *y)
 {
   *x = (tx - DATALIMIT[0].offset) / DATALIMIT[0].scale;
   *y = (ty - DATALIMIT[yaxis - 1].offset) / DATALIMIT[yaxis - 1].scale;
@@ -991,55 +740,37 @@ double *x, *y;
 }
 
 
-Void mam_runtransform(tdx, tdy, yaxis, dx, dy)
-double tdx, tdy;
-long yaxis;
-double *dx, *dy;
+void mam_runtransform(double tdx, double tdy, long yaxis, double *dx, double *dy)
 {
   *dx = tdx / DATALIMIT[0].scale;
   *dy = tdy / DATALIMIT[yaxis - 1].scale;
 }
 
 
-
 /**************************************************/
 
-Static Void movabs(x, y)
-long x, y;
+static void movabs(long x, long y)
 {
   plot_move(x, y);
 }
 
-
-Static Void drawabs(x, y)
-long x, y;
+static void drawabs(long x, long y)
 {
   plot_draw(x, y);
 }
 
-
-
-
-Static Void rmovabs(x, y)
-double x, y;
+static void rmovabs(double x, double y)
 {
   plot_move((long)x, (long)y);
 }
 
-
-Static Void rdrawabs(x, y)
-double x, y;
+static void rdrawabs(double x, double y)
 {
   plot_draw((long)x, (long)y);
 }
 
-
-
-
 /*Clipper from Dave G.'s CS274 project*/
-Static Void clippoint(x, y, pendn)
-double x, y;
-boolean pendn;
+static void clippoint(double x, double y, int pendn)
 {
   clip_bcarray bc;   /* Boundary conditions */
   long oc;   /* Out code */
@@ -1105,49 +836,30 @@ boolean pendn;
   clip_oldoc = oc;
 }
 
-
-
-
 /**************************************************/
 
-Void move_(xto, yto, yaxis)
-double xto, yto;
-long yaxis;
+void move_(double xto, double yto, long yaxis)
 {
   clippoint(rtranx(xto), rtrany(yto, yaxis), false);
 }
 
 
-Void draw(xto, yto, yaxis)
-double xto, yto;
-long yaxis;
+void draw(double xto, double yto, long yaxis)
 {
   clippoint(rtranx(xto), rtrany(yto, yaxis), true);
 }
 
-
-Void mam_move(xto, yto, yaxis)
-double xto, yto;
-long yaxis;
+void mam_move(double xto, double yto, long yaxis)
 {
   move_(xto, yto, yaxis);
 }
 
-
-Void mam_draw(xto, yto, yaxis)
-double xto, yto;
-long yaxis;
+void mam_draw(double xto, double yto, long yaxis)
 {
   draw(xto, yto, yaxis);
 }
 
-
-
-
-
-
-Void mam_lower_title(s)
-Char *s;
+void mam_lower_title(char *s)
 {
   long xmid;
 
@@ -1156,10 +868,7 @@ Char *s;
   plot_centerstring(xmid, PLOTLIMIT[1].titlemin, s);
 }
 
-
-
-Void mam_title(s)
-Char *s;
+void mam_title(char *s)
 {
   long xmid;
 
@@ -1168,23 +877,20 @@ Char *s;
   plot_centerstring(xmid, PLOTLIMIT[1].plotmax + titlechar.height, s);
 }
 
+typedef char monlist[16][4];
 
-typedef Char monlist[16][4];
-
-
-Const monlist months = {
+const monlist months = {
   "000", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct",
   "Nov", "Dec", "013", "014", "015"
 };
 
 
-Static Char *get_date_string(Result)
-Char *Result;
+static char *get_date_string(char *Result)
 {
   long pos;
-  Char ampm[4];
+  char ampm[4];
   datetimerec datetime;
-  Char date_string[256];
+  char date_string[256];
 
   sysdate(&datetime.date);
   systime(&datetime.time);
@@ -1212,18 +918,17 @@ Char *Result;
 }
 
 
-Static Char *pwd(Result)
-Char *Result;
+static char *pwd(char *Result)
 {
      getcwd(Result, 255);
   return Result;
 }
 
 
-Void mam_date()
+void mam_date()
 {
-  Char STR1[256], STR3[256];
-  Char STR4[256];
+  char STR1[256], STR3[256];
+  char STR4[256];
 
   setupcharlimits(&titlechar);
   plot_charscale(2L);
@@ -1235,9 +940,7 @@ Void mam_date()
 }
 
 
-Void mam_plotstring(s, x, y)
-Char *s;
-double x, y;
+void mam_plotstring(char *s, double x, double y)
 {
   /* plot a string, centered at x,y, where x and y are in the range (0,1) */
   long xmid, ymid;
@@ -1250,18 +953,14 @@ double x, y;
 }
 
 
-Static Char *plottype_NAMES[] = {
+static char *plottype_NAMES[] = {
   "PT_LOG", "PT_LINEAR"
 } ;
 
-
-
-
 /*Axis definition Procedures go here*/
 /*****/
 /**************************************************/
-Static Void define_axis(axis_type)
-long axis_type;
+static void define_axis(long axis_type)
 {
   char plot_range;
   double diff, rdiv;
@@ -1374,16 +1073,11 @@ long axis_type;
     printf("%s  %12ld  %12ld  %12ld% .5E  % .5E\n",
 	   plottype_NAMES[(long)WITH->dplotype], axis_type, WITH->dpower,
 	   WITH->intpower, WITH->datamax, WITH->datamin);
-
 }
 
-
-
 /***************************************************************************/
 
-Static Void tick(tickpos, axis_type, tickstart, tickstart2, ticklength)
-double tickpos;
-long axis_type, tickstart, tickstart2, ticklength;
+static void tick(double tickpos, long axis_type, long tickstart, long tickstart2, long ticklength)
 {
   long ty, tx;
   _REC_device_limits *WITH;
@@ -1432,9 +1126,7 @@ long axis_type, tickstart, tickstart2, ticklength;
 }
 
 
-Static Void subtick(labelpos, axis_type, labelstart, labelstart2)
-double labelpos;
-long axis_type, labelstart, labelstart2;
+static void subtick(double labelpos, long axis_type, long labelstart, long labelstart2)
 {
   long i, j;
   double lpos2;
@@ -1455,12 +1147,9 @@ long axis_type, labelstart, labelstart2;
   }
 }
 
-
-
 /*****************************************************************/
 
-Static Char *superscript(Result, base, sup)
-Char *Result, *base, *sup;
+static char *superscript(char *Result, char *base, char *sup)
 {
   if (texmode) {
     if (strlen(sup) > 1) {
@@ -1476,16 +1165,9 @@ Char *Result, *base, *sup;
   }
 }
 
-
-Static Void plotter_label(label_pos, axis_type, labelstart, label_string,
-			  ndigs, plotype)
-double label_pos;
-long axis_type, labelstart;
-Char *label_string;
-long ndigs;
-plottype plotype;
+static void plotter_label(double label_pos, long axis_type, long labelstart, char *label_string, long ndigs, plottype plotype)
 {
-  Char STR1[256];
+  char STR1[256];
 
   setupcharlimits(&labelchar);
   switch (axis_type) {
@@ -1546,19 +1228,10 @@ plottype plotype;
     }
     break;
   }
-
-
-
-
 }
 
-
-
-
-
 /************************************************************/
-Static long needdigits(axis)
-long axis;
+static long needdigits(long axis)
 {
   long ndigs;
   _REC_axis_limits *WITH;
@@ -1571,19 +1244,15 @@ long axis;
 }
 
 
-
-
 /************************************************************/
-Static Void label_axis(plotype, axis_type, labelstart, labelstart2)
-plottype plotype;
-long axis_type, labelstart, labelstart2;
+static void label_axis(plottype plotype, long axis_type, long labelstart, long labelstart2)
 {
-  Char labelstr[256];
+  char labelstr[256];
   long ndigs, len, ilabel;
   double labelpos, labelval;
   _REC_axis_limits *WITH;
   long FORLIM;
-  Char STR1[256];
+  char STR1[256];
 
   ndigs = needdigits(axis_type);
   ilabel = 1;
@@ -1616,10 +1285,7 @@ long axis_type, labelstart, labelstart2;
   }
 }
 
-
-
-
-Static Void set_axis()
+static void set_axis()
 {
   long ndigs, i, j, FORLIM;
   _REC_axis_limits *WITH;
@@ -1673,10 +1339,7 @@ Static Void set_axis()
 
 }
 
-
-Local Char *findstr(Result, i)
-Char *Result;
-long i;
+static char *findstr(char *Result, long i)
 {
   switch (i) {
 
@@ -1718,17 +1381,13 @@ long i;
   return Result;
 }
 
-
-
-
-
-Void mam_drawaxes()
+void mam_drawaxes()
 {
   long xmid, ymid, len;
-  Char out[256];
+  char out[256];
   _REC_device_limits *WITH;
   _REC_axis_limits *WITH1;
-  Char STR1[256], STR2[256], STR3[256];
+  char STR1[256], STR2[256], STR3[256];
 
 
   if (drewaxes) {
@@ -1850,8 +1509,7 @@ Void mam_drawaxes()
 
 }
 
-
-Void mam_drawborder()
+void mam_drawborder()
 {
   if (drewborder)
     return;
@@ -1869,24 +1527,16 @@ Void mam_drawborder()
 }
 
 
-
-Void mam_close_generic()
+void mam_close_generic()
 {
   mam_drawaxes();
   mam_drawborder();
 }
 
-
-
-
-
-
-
-
-Static plottype readplottype(name)
-Char *name;
+static plottype readplottype(name)
+char *name;
 {
-  Char STR1[256];
+  char STR1[256];
 
   if (!strcmp(strlower(STR1, name), "log"))
     return pt_log;
@@ -1896,8 +1546,7 @@ Char *name;
 
 
 /**************************************************/
-Void mam_axis(xtitle, xunits, xplottype, ytitle, yunits, yplottype)
-Char *xtitle, *xunits, *xplottype, *ytitle, *yunits, *yplottype;
+void mam_axis(char *xtitle, char *xunits, char *xplottype, char *ytitle, char *yunits, char *yplottype)
 {
   num_axes = 2;
   strcpy(DATALIMIT[0].title, xtitle);
@@ -1914,10 +1563,8 @@ Char *xtitle, *xunits, *xplottype, *ytitle, *yunits, *yplottype;
 
 
 /**************************************************/
-Void mam_axis3(xtitle, xunits, xplottype, y1title, y1units, y1plottype,
-	       y2title, y2units, y2plottype)
-Char *xtitle, *xunits, *xplottype, *y1title, *y1units, *y1plottype, *y2title,
-     *y2units, *y2plottype;
+void mam_axis3(char *xtitle, char *xunits, char *xplottype, char *y1title, char *y1units, char *y1plottype,
+	       char *y2title, char *y2units, char *y2plottype)
 {
   num_axes = 3;
   strcpy(DATALIMIT[0].title, xtitle);
@@ -1935,10 +1582,7 @@ Char *xtitle, *xunits, *xplottype, *y1title, *y1units, *y1plottype, *y2title,
 
 /*******************************************************************/
 
-Void mam_plotnormal(x, y, len, normalx)
-double **x, **y;
-long len;
-double **normalx;
+void mam_plotnormal(double **x, double **y, long len, double **normalx)
 {
   long i;
   double xval, yval;
@@ -1976,9 +1620,7 @@ double **normalx;
 
 /*******************************************************************/
 
-Void mam_plot(x, y, len)
-double **x, **y;
-long len;
+void mam_plot(double **x, double **y, long len)
 {
   long i;
   double xval, yval;
@@ -2014,9 +1656,7 @@ long len;
 
 
 /*******************************************************************/
-Void mam_plot3(x, y, len)
-double **x, **y;
-long len;
+void mam_plot3(double **x, double **y, long len)
 {
   long i;
   double xval, yval;
@@ -2051,14 +1691,11 @@ long len;
 
 /*******************************************************************/
 
-Void mam_splot(x, y, len, symbol)
-double **x, **y;
-long len;
-Char symbol;
+void mam_splot(double **x, double**y, long len, int symbol)
 {
   long i, fudgex, fudgey;
   double xval, yval;
-  Char STR1[2];
+  char STR1[2];
 
   setupcharlimits(&symbolchar);
   /*fudgex := trunc(symbolchar.height * symbolxoff);*/
@@ -2087,16 +1724,11 @@ Char symbol;
 
 /*******************************************************************/
 
-
-
-Void mam_splot3(x, y, len, symbol)
-double **x, **y;
-long len;
-Char symbol;
+void mam_splot3(double **x, double **y, long len, int symbol)
 {
   long i, fudgex, fudgey;
   double xval, yval;
-  Char STR2[2];
+  char STR2[2];
 
   setupcharlimits(&symbolchar);
   /*fudgex := trunc(symbolchar.height * symbolxoff);*/
@@ -2126,25 +1758,10 @@ Char symbol;
     printf("got through splot3\n");
 }
 
-
-
-
-Void mam_drawlabel(x, y, lbl)
-double x, y;
-Char *lbl;
+void mam_drawlabel(double x, double y, char *lbl)
 {
   setupcharlimits(&axischar);
   plot_string(tranx(x), trany(y, 2L), lbl);
 }
 
-
-
-
-
-
-
-
-
-
-
 /* End. */
diff --git a/psys/src/markrelease.c b/psys/src/markrelease.c
index 751305d..b1a99dd 100644
--- a/psys/src/markrelease.c
+++ b/psys/src/markrelease.c
@@ -1,5 +1,3 @@
-#define MARKRELEASE_G
-
 #include <stdio.h>
 #include <p2c/p2c.h>
 #include <p2c/markrelease.h>
@@ -8,29 +6,12 @@ struct record {
   struct record *prev;
 } *mark_first_mallocced_info;
 
-char *fakemalloc(size)
-long size;
-{
-  struct record *retval;
-
-#undef malloc
-  retval = (struct record *) malloc(size + sizeof(struct record));
-#define malloc(x) fakemalloc(x)
-
-  retval->prev = mark_first_mallocced_info;
-  mark_first_mallocced_info = retval;
-
-  return ((char *)(retval) + sizeof(struct record) / sizeof(char));
-}
-
-void mark(state)
-struct record **state;
+void mark(struct record **state)
 {
   *state = mark_first_mallocced_info;
 }
 
-void release(state)
-struct record **state;
+void release(struct record **state)
 {
   struct record *save;
 
diff --git a/psys/src/math.c b/psys/src/math.c
index fa86ef0..79b05c5 100644
--- a/psys/src/math.c
+++ b/psys/src/math.c
@@ -1,10 +1,3 @@
-/* Output from P2C, the Pascal-to-C translator */
-/* p2c: math.text, line 17: Note: Overflow checking is OFF */
-/* p2c: math.text, line 17: Note: Range checking is OFF */
-/* p2c: math.text, line 17: Note: Stack checking is OFF */
-/* From input file "math.text" */
-
-
 #include <p2c/p2c.h>
 
 
@@ -12,43 +5,35 @@
 #include <p2c/math.h>
 
 
-Const ma_complex ma_c0 = {
+const ma_complex ma_c0 = {
   0.0, 0.0
 };
 
-Const ma_complex ma_c1 = {
+const ma_complex ma_c1 = {
   1.0, 0.0
 };
 
-Const ma_complex ma_cm1 = {
+const ma_complex ma_cm1 = {
   -1.0, 0.0
 };
 
-Const ma_complex ma_cI = {
+const ma_complex ma_cI = {
   0.0, 1.0
 };
 
-Const ma_complex ma_cmI = {
+const ma_complex ma_cmI = {
   0.0, -1.0
 };
 
-Const ma_complex ma_cpi = {
+const ma_complex ma_cpi = {
   ma_pi, 0.0
 };
 
 
 
-#ifndef NEWCI_H
 #include <p2c/newci.h>
-#endif
-
-#ifndef RND_H
 #include <p2c/rnd.h>
-#endif
-
-#ifndef SYSGLOBALS_H
 #include <p2c/sysglobals.h>
-#endif
 
 
 #define rshufsize       17
@@ -66,35 +51,28 @@ typedef struct rstaterec {
 } rstaterec;
 
 
-Static rstaterec sysrstaterec, *sysrstate;
-Static boolean sysrstinit;   /*will be initialized to zero by the loader*/
-Static double lnfactcache[lnfactcachesize - 1];
-
-
-
-
+static rstaterec sysrstaterec, *sysrstate;
+static int sysrstinit;   /*will be initialized to zero by the loader*/
+static double lnfactcache[lnfactcachesize - 1];
 
 /* Global flags */
 
-boolean ma_trapuf(flag)
-boolean flag;
+int ma_trapuf(flag)
+int flag;
 {
-  boolean ma_Result;
+  int ma_Result;
 
   ma_Result = false;
   return ma_Result;
 }
 
 
-
-
-
 /* General operations on reals */
 
 double ma_rround(r)
 double r;
 {
-  boolean minus;
+  int minus;
   double r2;
   long scale;
 
@@ -132,7 +110,7 @@ double r;
 double ma_rrounde(r)
 double r;
 {
-  boolean minus;
+  int minus;
   double r2;
   long scale;
 
@@ -177,7 +155,7 @@ double r;
 double ma_rtrunc(r)
 double r;
 {
-  boolean minus;
+  int minus;
   double r2;
   long scale;
 
@@ -257,14 +235,14 @@ double r;
 
 /* Handy predicates */
 
-boolean ma_isinteger(r)
+int ma_isinteger(r)
 double r;
 {
   return (r >= LONG_MIN && r <= LONG_MAX && (long)floor(r + 0.5) == r);
 }
 
 
-boolean ma_isint(r)
+int ma_isint(r)
 double r;
 {
   if (r >= LONG_MIN && r <= LONG_MAX)
@@ -274,7 +252,7 @@ double r;
 }
 
 
-boolean ma_rnequal(a, b, eps)
+int ma_rnequal(a, b, eps)
 double a, b, eps;
 {
   if (a == b)
@@ -570,7 +548,7 @@ double a, b, c, d;
 
 
 
-Void ma_rswap2(a, b)
+void ma_rswap2(a, b)
 double *a, *b;
 {
   double t;
@@ -581,7 +559,7 @@ double *a, *b;
 }
 
 
-Void ma_rsort2(a, b)
+void ma_rsort2(a, b)
 double *a, *b;
 {
   double t;
@@ -594,7 +572,7 @@ double *a, *b;
 }
 
 
-Void ma_rsort3(a, b, c)
+void ma_rsort3(a, b, c)
 double *a, *b, *c;
 {
   double t;
@@ -617,7 +595,7 @@ double *a, *b, *c;
 }
 
 
-Void ma_rsort4(a, b, c, d)
+void ma_rsort4(a, b, c, d)
 double *a, *b, *c, *d;
 {
   double t;
@@ -664,14 +642,14 @@ double min, r, max;
 }
 
 
-boolean ma_between(min, r, max)
+int ma_between(min, r, max)
 double min, r, max;
 {
   return ((min <= r && r <= max) || (max <= r && r <= min));
 }
 
 
-boolean ma_betweenm(min, r, max, margin)
+int ma_betweenm(min, r, max, margin)
 double min, r, max, margin;
 {
   if (min < max)
@@ -681,7 +659,7 @@ double min, r, max, margin;
 }
 
 
-Void ma_amin(min, r)
+void ma_amin(min, r)
 double *min, r;
 {
   if (r < *min)
@@ -689,7 +667,7 @@ double *min, r;
 }
 
 
-Void ma_amax(max, r)
+void ma_amax(max, r)
 double *max, r;
 {
   if (r > *max)
@@ -697,7 +675,7 @@ double *max, r;
 }
 
 
-Void ma_aminmax(min, max, r)
+void ma_aminmax(min, max, r)
 double *min, *max, r;
 {
   if (r < *min)
@@ -773,18 +751,18 @@ double r;
 
 /* String munching */
 
-static Void formatreal(buf, r, wid, prec, flags, minv, maxv)
-Char *buf;
+static void formatreal(buf, r, wid, prec, flags, minv, maxv)
+char *buf;
 double r;
 long wid, prec, flags;
 double minv, maxv;
 {
   long i, j, pwid, maxlen, expon;
-  boolean nowid, carry, minus;
-  Char *STR1;
-  Char STR2[256];
-  Char STR3[256];
-  Char STR4[256];
+  int nowid, carry, minus;
+  char *STR1;
+  char STR2[256];
+  char STR3[256];
+  char STR4[256];
 
   buf[0] = '\0';
   nowid = (wid < 0);
@@ -965,25 +943,25 @@ double minv, maxv;
 
 
 
-Char *ma_strfmtreal(ma_Result, r, wid, prec)
-Char *ma_Result;
+char *ma_strfmtreal(ma_Result, r, wid, prec)
+char *ma_Result;
 double r;
 long wid, prec;
 {
-  Char s[256];
+  char s[256];
 
   formatreal(s, r, wid, prec, 0L, 1e-2, 0.0);
   return strcpy(ma_Result, s);
 }
 
 
-Char *ma_strfmtreal2(ma_Result, r, wid, prec, flags, min, max)
-Char *ma_Result;
+char *ma_strfmtreal2(ma_Result, r, wid, prec, flags, min, max)
+char *ma_Result;
 double r;
 long wid, prec, flags;
 double min, max;
 {
-  Char s[256];
+  char s[256];
 
   formatreal(s, r, wid, prec, flags, min, max);
   return strcpy(ma_Result, s);
@@ -1167,7 +1145,7 @@ double a, b;
 }
 
 
-Void ma_quadrsolve(a, b, c, x1, x2)
+void ma_quadrsolve(a, b, c, x1, x2)
 double a, b, c, *x1, *x2;
 {
   double d, q;
@@ -1206,7 +1184,7 @@ double a, b, c, *x1, *x2;
 
 /* Trigonometric and inverse trigonometric functions */
 
-Void ma_sincos(r, s, c)
+void ma_sincos(r, s, c)
 double r, *s, *c;
 {
   *s = sin(r);
@@ -1269,7 +1247,7 @@ double r;
 /* Trigonometric functions in degrees */
 /* Warning: these may be slightly non-monotonic */
 
-Void ma_sincosd(r, s, c)
+void ma_sincosd(r, s, c)
 double r, *s, *c;
 {
   long i;
@@ -1546,7 +1524,7 @@ double r;
 
 double ma_lngamma(x, minus)
 double x;
-boolean *minus;
+int *minus;
 {
   double ma_Result, xx, sinpix, val, val2;
   long ival, form;
@@ -1618,7 +1596,7 @@ boolean *minus;
 double ma_rgamma(x)
 double x;
 {
-  boolean minus;
+  int minus;
   double val;
   long ival;
 
@@ -1638,7 +1616,7 @@ double x;
 typedef long tabletype[ifactmaxfast + 1];
 
 
-Const tabletype table = {
+const tabletype table = {
   1, 1, 2, 6, 24, 120, 720, 5040, 40320L, 362880L, 3628800L, 39916800L,
   479001600L
 };
@@ -1664,7 +1642,7 @@ long n;
 double ma_lnfactorial(n)
 long n;
 {
-  boolean minus;
+  int minus;
   long i;
   double val;
 
@@ -1868,14 +1846,14 @@ ma_complex a;
 }
 
 
-boolean ma_cequal(a, b)
+int ma_cequal(a, b)
 ma_complex a, b;
 {
   return (a.re == b.re && a.im == b.im);
 }
 
 
-boolean ma_cnequal(a, b, epssq)
+int ma_cnequal(a, b, epssq)
 ma_complex a, b;
 double epssq;
 {
@@ -2204,17 +2182,17 @@ ma_complex a;
 
 
 
-Char *ma_strfmtcomplex2(ma_Result, a, wid, prec, flags, min, max)
-Char *ma_Result;
+char *ma_strfmtcomplex2(ma_Result, a, wid, prec, flags, min, max)
+char *ma_Result;
 ma_complex a;
 long wid, prec, flags;
 double min, max;
 {
-  Char buf[256], buf2[256];
+  char buf[256], buf2[256];
   long i;
-  boolean rz, iz, flag, usespace, useparen;
+  int rz, iz, flag, usespace, useparen;
   long FORLIM;
-  Char STR1[256];
+  char STR1[256];
 
   formatreal(buf, a.re, -1L, prec, flags, min, max);
   formatreal(buf2, a.im, -1L, prec, flags, min, max);
@@ -2291,8 +2269,8 @@ double min, max;
 }
 
 
-Char *ma_strfmtcomplex(ma_Result, a, wid, prec)
-Char *ma_Result;
+char *ma_strfmtcomplex(ma_Result, a, wid, prec)
+char *ma_Result;
 ma_complex a;
 long wid, prec;
 {
@@ -2300,29 +2278,29 @@ long wid, prec;
 }
 
 
-Char *ma_strcomplex(ma_Result, a)
-Char *ma_Result;
+char *ma_strcomplex(ma_Result, a)
+char *ma_Result;
 ma_complex a;
 {
   return (ma_strfmtcomplex2(ma_Result, a, -1L, -1L, 0L, 1e-2, 0.0));
 }
 
 
-/* Local variables for ma_strsubreadcomplex: */
+/* variables for ma_strsubreadcomplex: */
 struct LOC_ma_strsubreadcomplex {
-  Char *buf;
+  char *buf;
   double sign;
   long i;
 } ;
 
-Local Void skipspc(LINK)
+void skipspc(LINK)
 struct LOC_ma_strsubreadcomplex *LINK;
 {
   while (LINK->i <= strlen(LINK->buf) && LINK->buf[LINK->i - 1] == ' ')
     LINK->i++;
 }
 
-Local Void getsign(LINK)
+void getsign(LINK)
 struct LOC_ma_strsubreadcomplex *LINK;
 {
   LINK->sign = 1.0;
@@ -2342,8 +2320,8 @@ struct LOC_ma_strsubreadcomplex *LINK;
 }
 
 
-Void ma_strsubreadcomplex(buf_, first, pos, a)
-Char *buf_;
+void ma_strsubreadcomplex(buf_, first, pos, a)
+char *buf_;
 long first, *pos;
 ma_complex *a;
 {
@@ -2351,8 +2329,8 @@ ma_complex *a;
   double r;
   ma_complex val;
   long j;
-  boolean comma, parens, hasleft;
-  Char *STR1;
+  int comma, parens, hasleft;
+  char *STR1;
 
   V.buf = buf_;
   V.i = first;
@@ -2460,11 +2438,10 @@ _L2: ;
 }
 
 
-
 ma_complex ma_strreadcomplex(buf_)
-Char *buf_;
+char *buf_;
 {
-  Char buf[256];
+  char buf[256];
   ma_complex c;
   long i;
 
@@ -2480,19 +2457,11 @@ Char *buf_;
     _Escape(-10);
   return c;
 }
-/* p2c: math.text, line 2477: Note: Range checking is ON */
-
-
-
-
-
-
-
 
 /* Shuffled/seeded random number generator */
 /* Various algorithms taken from chapter 7 of "Numerical Recipes" */
 
-static Void seedrand(st, seed)
+static void seedrand(st, seed)
 rstaterec *st;
 long seed;
 {
@@ -2512,34 +2481,34 @@ long seed;
 }
 
 
-Void ma_seedrandom(s, seed)
-Anyptr *s;
+void ma_seedrandom(s, seed)
+void **s;
 long seed;
 {
   rstaterec *rs;
 
   if (*s == NULL) {
     rs = (rstaterec *)Malloc(sizeof(rstaterec));
-    *s = (Anyptr)rs;
+    *s = (void *)rs;
   } else
     rs = (rstaterec *)(*s);
   seedrand(rs, seed);
 }
 
 
-Void ma_initrandom(s)
-Anyptr *s;
+void ma_initrandom(s)
+void **s;
 {
   rstaterec *rs;
 
   rs = (rstaterec *)Malloc(sizeof(rstaterec));
-  *s = (Anyptr)rs;
+  *s = (void *)rs;
   seedrand(rs, 0L);
 }
 
 
-Void ma_duprandom(d, s)
-Anyptr d, s;
+void ma_duprandom(d, s)
+void *d, *s;
 {
   rstaterec *rsd, *rss;
 
@@ -2550,7 +2519,7 @@ Anyptr d, s;
 
 
 double ma_urandom(s)
-Anyptr s;
+void *s;
 {
   long i;
   double v;
@@ -2571,7 +2540,7 @@ Anyptr s;
 
 
 double ma_rrandom(s, min, max)
-Anyptr s;
+void *s;
 double min, max;
 {
   if (max <= min)
@@ -2582,7 +2551,7 @@ double min, max;
 
 
 long ma_irandom(s, min, max)
-Anyptr s;
+void *s;
 long min, max;
 {
   long i, diff;
@@ -2607,7 +2576,7 @@ long min, max;
 
 
 double ma_nrandom(s, mean, sdev)
-Anyptr s;
+void *s;
 double mean, sdev;
 {
   double ma_Result, v1, v2, r, fac;
@@ -2633,13 +2602,9 @@ double mean, sdev;
 }
 
 
-
-
-
-
 /* Non-seedable random number generator */
 
-static Void seedsysrand()
+static void seedsysrand()
 {
   seedrand(&sysrstaterec, 0L);
   sysrstate = &sysrstaterec;
@@ -2652,7 +2617,7 @@ long min, max;
 {
   if (!sysrstinit)
     seedsysrand();
-  return (ma_irandom((Anyptr)sysrstate, min, max));
+  return (ma_irandom((void *)sysrstate, min, max));
 }
 
 
@@ -2660,7 +2625,7 @@ double ma_rrand()
 {
   if (!sysrstinit)
     seedsysrand();
-  return (ma_urandom((Anyptr)sysrstate));
+  return (ma_urandom((void *)sysrstate));
 }
 
 
@@ -2669,7 +2634,7 @@ double min, max;
 {
   if (!sysrstinit)
     seedsysrand();
-  return (ma_rrandom((Anyptr)sysrstate, min, max));
+  return (ma_rrandom((void *)sysrstate, min, max));
 }
 
 
@@ -2678,15 +2643,7 @@ double mean, sdev;
 {
   if (!sysrstinit)
     seedsysrand();
-  return (ma_nrandom((Anyptr)sysrstate, mean, sdev));
+  return (ma_nrandom((void *)sysrstate, mean, sdev));
 }
 
-
-
-
-
-
-
-
-
 /* End. */
diff --git a/psys/src/misc.c b/psys/src/misc.c
index e3be6f5..23eb72f 100644
--- a/psys/src/misc.c
+++ b/psys/src/misc.c
@@ -8,7 +8,7 @@
 #include <pwd.h>
 #endif
 
-Void misc_upc(Char *s)
+void misc_upc(char *s)
 {
   for (; *s; s++)
     if (islower(*s))
@@ -16,91 +16,18 @@ Void misc_upc(Char *s)
 }
 
 
-void misc_getioerrmsg(s, i)
-char *s;
-long i;
+void misc_getioerrmsg(char *s, long i)
 {
   sprintf(s, "misc_getioerrmsg Error number %ld", i);
 }
 
-void misc_printerror(esc, ior)
-long esc, ior;
+void misc_printerror(long esc, long ior)
 {
 }
 
 
-#ifdef OS2
-/* Here are things OS/2 does not know about that anaLOG needs */
-
-int getuid()
-{
-   return 1000;
-}
-
-int getgid()
-{
-   return 1000;
-}
-
-char *cuserid(s)
-char *s;
-{
-   char *sp;
-   static char sbuf[L_cuserid + 1];
- 
-   if ((sp = getenv("USER")) == NULL) {
-     if (s != NULL)
-       s[0] = '\0';
-     return NULL;
-   }
-   return strncpy(s != NULL ? s : sbuf, sp, L_cuserid);
-}
-
-long lrand48()
-{
-   return rand();
-}
- 
-void srand48(seedv)
-long seedv;
-{
-   srand( (int)seedv);
-}
-
-int _cfree(ptr)
-char *ptr;
-{
-   printf("Call to _cfree.\n");
-   free(ptr);
-   return 0;
-}
-
-int link(path1, path2)
-char *path1, *path2;
-{
-   printf("Call to link. %s to %s\n", path1, path2);
-   rename(path1, path2);
-   return 0;
-}
-
-int fork()
-{
-   printf("Call to fork.\n");
-   return 0;
-}
-void _flsbuf(ptr, ch)
-char *ptr;
-char ch;
-{
-   printf("Call to _flsbuf.\n");
-   return;
-}
-
-#endif /* OS/2 */
-
 #ifdef __bsdi__
-char *cuserid(s)
-char *s;
+char *cuserid(char *s)
 {
    char *sp;
    static char sbuf[L_cuserid + 1];
@@ -118,21 +45,18 @@ long lrand48()
    return random();
 }
  
-void srand48(seedv)
-long seedv;
+void srand48(long seedv)
 {
    srandom( (int)seedv);
 }
 
-int cfree(ptr)
-char *ptr;
+int cfree(char *ptr)
 {
    free(ptr);
    return 0;
 }
 
-int _cfree(ptr)
-char *ptr;
+int _cfree(char *ptr)
 {
    printf("Call to _cfree.\n");
    free(ptr);
@@ -142,23 +66,20 @@ char *ptr;
 
 #ifdef freebsd
 
-int cfree(ptr)
-char *ptr;
+int cfree(char *ptr)
 {
    free(ptr);
    return 0;
 }
 
-int _cfree(ptr)
-char *ptr;
+int _cfree(char *ptr)
 {
    printf("Call to _cfree.\n");
    free(ptr);
    return 0;
 }
 
-char *cuserid(s)
-char *s;
+char *cuserid(char *s)
 {
    char *sp;
    static char sbuf[L_cuserid + 1];
@@ -171,8 +92,7 @@ char *s;
    return strncpy(s != NULL ? s : sbuf, sp, L_cuserid);
 }
 
-char *_cuserid(s)
-char *s;
+char *_cuserid(char *s)
 {
    char *sp;
    static char sbuf[L_cuserid + 1];
@@ -189,8 +109,7 @@ char *s;
 
 #ifdef __MACHTEN__
 
-char *cuserid(s)
-char *s;
+char *cuserid(char *s)
 {
    char *sp;
    static char sbuf[L_cuserid + 1];
@@ -208,21 +127,18 @@ long lrand48()
    return random();
 }
  
-void srand48(seedv)
-long seedv;
+void srand48(long seedv)
 {
    srandom( (int)seedv);
 }
 
-int cfree(ptr)
-char *ptr;
+int cfree(char *ptr)
 {
    free(ptr);
    return 0;
 }
 
-int _cfree(ptr)
-char *ptr;
+int _cfree(char *ptr)
 {
    printf("Call to _cfree.\n");
    free(ptr);
@@ -239,11 +155,10 @@ char *ptr;
  * or, ~foo with foo's home directory, if foo is a recognised user.
  */
 
-Char *tilde_expand(s)
-Char *s;
+char *tilde_expand(char* s)
 {
-Char *name;
-Char *ret = NULL;
+char *name;
+char *ret = NULL;
 int len = 0;
 struct passwd *pw;
 
@@ -251,7 +166,7 @@ struct passwd *pw;
     if (strlen(s) > 1)
       len = strcspn(s+1, "/");
     if (len > 0) {
-      name = (Char *) Malloc(len + 1);
+      name = (char *) Malloc(len + 1);
       strncpy(name, s+1, len);
       name[len] = '\0';
       pw = getpwnam(name);
@@ -260,7 +175,7 @@ struct passwd *pw;
       pw = getpwuid( geteuid() );
     } 
     if (pw != NULL) {
-      ret = (Char *) Malloc(strlen(pw->pw_dir) + strlen(s) - len);
+      ret = (char *) Malloc(strlen(pw->pw_dir) + strlen(s) - len);
       strcpy(ret,pw->pw_dir);
       if (strlen(s) > len + 1)
         strcat(ret, s + len + 1);
@@ -276,14 +191,13 @@ struct passwd *pw;
 /* simple tilde expansion for platforms without usernames/password mechanisms.
  * replace a leading '~' with the value of the $HOME environment variable.
  */
-Char *tilde_expand(s)
-Char *s;
+char *tilde_expand(char *s)
 {
-Char *hp;
-Char *ret = NULL;
+char *hp;
+char *ret = NULL;
 
   if (*s == '~' && (hp = getenv("HOME")) != NULL) {
-    if ((ret = (Char *) Malloc(strlen(hp) + strlen(s))) != NULL) {
+    if ((ret = (char *) Malloc(strlen(hp) + strlen(s))) != NULL) {
       strcpy(ret, hp);
       if (strlen(s) > 1)
         strcat(ret, s + 1);
diff --git a/psys/src/mylib.c b/psys/src/mylib.c
index 179eed5..087715c 100644
--- a/psys/src/mylib.c
+++ b/psys/src/mylib.c
@@ -24,29 +24,16 @@
 # include <sys/types.h>   
 # include <sys/time.h>
 # include <time.h>
-#elif defined(__sgi)
-# include <sys/types.h>   
-# include <sys/time.h>
-# include <time.h>
-#elif defined(rs6000)
-# include <sys/time.h>
-# include <time.h>
 #elif defined(BSD)
 # include <sys/time.h>
 #else
 # include <time.h>
 #endif
-#ifdef OS2
-# include <sys/timeb.h>
-#endif
 
 #include <p2c/p2c.h>
 #include <p2c/mylib.h>
   
 #include <X11/X.h>
-#ifdef OS2
-#include <X11/Xlib.h>
-#endif  /* OS2 */
 #include <X11/Xutil.h>
 #include <X11/cursorfont.h>
 #include <X11/keysymdef.h>
@@ -70,25 +57,6 @@ unsigned long grPixels[256];
 GR_CURRENT grCurrent;
 #endif  /* HIRES */
 
-#if 0
-/* previously missing defs in keysymdef */
-#define XK_Reset                0x1000FF6C  /* HP -- The shift of Break */
-#endif
-
-
-#if defined(rs6000)
-/* previously missing defs in keysymdef -- may be needed for RS/6000 */
-#define XK_System               0x1000FF6D  /* HP */
-#define XK_User                 0x1000FF6E  /* HP */
-#define XK_ClearLine            0x1000FF6F  /* HP */
-#define XK_InsertLine           0x1000FF70  /* HP */
-#define XK_DeleteLine           0x1000FF71  /* HP */
-#define XK_InsertChar           0x1000FF72  /* HP */
-#define XK_DeleteChar           0x1000FF73  /* HP */
-#define XK_BackTab              0x1000FF74  /* HP */
-#define XK_KP_BackTab           0x1000FF75  /* HP */
-#endif
-
 
 /* daveg, 10/6/89:  Just to improve readability of the rest of the code! */
 
@@ -109,9 +77,9 @@ static void init_debug_flags()
   sync_all_calls = (getenv("SYNC_ALL_CALLS") != NULL);
 }
 
-extern void nc_refreshScreen PP((void));
-extern void nc_cursor_on PP((void));
-extern void nc_cursor_off PP((void));
+extern void nc_refreshScreen (void);
+extern void nc_cursor_on (void);
+extern void nc_cursor_off (void);
 
 #define zfprintf fprintf        /* MDG */
 extern int zfprintf(FILE *, const char *, ... );
@@ -174,12 +142,8 @@ extern int nc_initialized;
 #endif
 
 
-#ifdef OS2
-static struct timeb first, second, lapsed;
-#else   
 static struct timeval first, second, lapsed;
 static struct timezone tzp;
-#endif
 
 static char *timername;
 
@@ -189,31 +153,13 @@ char *name;
 
   timername = name;
 
-#ifdef OS2
-  _ftime(&first);
-#else
   gettimeofday(&first, &tzp);
-#endif
 
 }
 
 void stoptimer()
 {
 
-#ifdef OS2
-  _ftime(&second);
-
-  if (first.millitm  > second.millitm) {
-     second.millitm += 1000;
-     second.time--;
-  }
-  lapsed.time = second.time - first.time;
-  lapsed.millitm = second.millitm - first.millitm;
-  printf("%s:  %f seconds\n", timername,
-                              lapsed.time+lapsed.millitm/1000.0);
- 
-#else
-
   gettimeofday(&second, &tzp);
 
   if (first.tv_usec > second.tv_usec) {
@@ -225,7 +171,6 @@ void stoptimer()
 
   printf("%s:  %f seconds\n", timername,
                               lapsed.tv_sec+lapsed.tv_usec/1000000.0);
-#endif
 }
 
 /* Added for command line display specification. - stafford 7/17/91 */
@@ -235,7 +180,7 @@ char  m_display_name[DISPLAY_NAME_LENGTH] = "";
 
 /* Added flag for window pop-up mode -- jl */
 
-boolean m_autoraise = false;
+int m_autoraise = false;
 
 Display *m_display;
 Window m_window;
@@ -586,11 +531,7 @@ void DisplayInitialize()
     fprintf(stderr, "Vendor Release: %d\n", VendorRelease(m_display));
     fprintf(stderr, "Protocol Version: %d\n", ProtocolVersion(m_display));
     fprintf(stderr, "Protocol Revision: %d\n", ProtocolRevision(m_display));
-#ifdef OS2
-    fprintf(stderr, "HOSTTYPE: i386-OS/2\n");
-#else
     fprintf(stderr, "HOSTTYPE: %s\n", getenv("HOSTTYPE"));
-#endif  /* OS2 */
 #endif  /* HIRESDB */
 
 /* Discover properties of Server.  */
@@ -3552,7 +3493,7 @@ long chord;
   double a, c1, s1, c2, s2, c3, s3, rc, rs, d, th1, th2, start, stop,
   rcc1, rcs1, rsc1, rss1, rcc2, rcs2, rsc2, rss2, temp;
   long q, quad1, quad2, chx, chy;
-  boolean rotflag;
+  int rotflag;
   
   Mfprintf(stderr, "m_drawarc(%ld, %ld, %ld, %ld, %f, %f, %f, %ld)\n",
                                x,   y,  rx, ry, theta1, theta2, rotate, chord);
@@ -3714,7 +3655,7 @@ long chord;
   pts xp, yp;
   double ss, cc, rs, rc, rsx, rsy, rcx, rcy, th, temp;
   long i, n;
-  boolean rotflag, fullflag;
+  int rotflag, fullflag;
 
   Mfprintf(stderr, "m_fillarc(%ld, %ld, %ld, %ld, %f, %f, %f, %ld)\n",
                                x,   y,  rx, ry, theta1, theta2, rotate, chord);
@@ -3898,7 +3839,7 @@ static XPoint bezbuf[2048];
 static int bezbufp;
 static int bezthresh;
 
-int hitdet_bezier(x1, y1, x2, y2, x3, y3, x4, y4)
+int hitdet_bezier(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
 {
   int minx, maxx, miny, maxy;
 
@@ -4904,7 +4845,7 @@ m_tablet_info *pen;
 }
 
 
-boolean m_pollkbd()
+int m_pollkbd()
 {
   XEvent event;
   char buf[10];
@@ -5120,8 +5061,8 @@ uchar m_testkey()
 #define popuph          70
 
 
-boolean m_yes_or_no(prompt)
-Char *prompt;
+int m_yes_or_no(prompt)
+char *prompt;
 {
   Window root, popup, yesbutton, nobutton;
   char buf[10];
@@ -5328,21 +5269,21 @@ Char *prompt;
 
 
 void m_makechar(cp, a, b, c, d, e, f)
-Anyptr *cp;
+void* *cp;
 long a, b, c, d, e, f;
 {
 }
 
 
 void m_changechar(cp, a, b, c, d, e)
-Anyptr *cp;
+void* *cp;
 long a, b, c, d, e;
 {
 }
 
 
 void m_drawchar(cp)
-Anyptr *cp;
+void* *cp;
 {
 }
 
diff --git a/psys/src/newasmlib.c b/psys/src/newasmlib.c
index 8721e80..10a3e7d 100644
--- a/psys/src/newasmlib.c
+++ b/psys/src/newasmlib.c
@@ -7,10 +7,7 @@
 
 #define KEEP_P2C_DECLS
 
-#if defined(rs6000)
-# include <sys/time.h>
-# include <time.h>
-#elif defined(BSD)
+#if defined(BSD)
 # include <time.h>
 # include <sys/time.h>
 #else
@@ -42,12 +39,9 @@
 #define VASR_L(v,n)   ((v) = ASR_L(v,n))
 
 
-
-
-
 /* Fill a block of memory with a repeating 4-byte pattern */
 
-Void na_fill(d, w, n)
+void na_fill(d, w, n)
 register long *d, w, n;
 {
     if (n <= 0)
@@ -95,7 +89,7 @@ register long *d, w, n;
 
 /* Fill a block of memory with a word pattern */
 
-Void na_fillword(d, w, n)
+void na_fillword(d, w, n)
 long *d;
 long w, n;
 {
@@ -107,7 +101,7 @@ long w, n;
 
 /* Exchange two blocks of memory */
 
-Void na_exch(s, d, size)
+void na_exch(s, d, size)
 long *s, *d;
 register long size;
 {
@@ -198,8 +192,8 @@ register long size;
 
 /* Stack-based allocation; approximate with malloc */
 
-Void na_alloc(p, s)
-Anyptr *p;
+void na_alloc(p, s)
+void* *p;
 long s;
 {
     *p = malloc(s);
@@ -207,8 +201,8 @@ long s;
 
 
 
-Void na_outeralloc(p, s, parframe)
-Anyptr *p;
+void na_outeralloc(p, s, parframe)
+void* *p;
 long s, parframe;
 {
     *p = malloc(s);
@@ -216,8 +210,8 @@ long s, parframe;
 
 
 
-Void na_free(p)
-Anyptr *p;
+void na_free(p)
+void* *p;
 {
     free(*p);
     *p = NULL;
@@ -228,7 +222,7 @@ Anyptr *p;
 
 /* Bit operations */
 
-boolean na_test(n, x)
+int na_test(n, x)
 register long n;
 long x;
 {
@@ -238,7 +232,7 @@ long x;
 }
 
 
-Void na_set(n, x)
+void na_set(n, x)
 register long n;
 long *x;
 {
@@ -249,7 +243,7 @@ long *x;
 
 
 
-Void na_clear(n, x)
+void na_clear(n, x)
 register long n;
 long *x;
 {
@@ -369,7 +363,7 @@ register long n, x;
 
 
 /* Clear a bit-field to zeros */
-Void na_bfclr(v, offset, size)
+void na_bfclr(v, offset, size)
 register long *v, offset, size;
 {
     if (size <= 0) return;
@@ -392,7 +386,7 @@ register long *v, offset, size;
 
 
 /* Set a bit-field to ones */
-Void na_bfset(v, offset, size)
+void na_bfset(v, offset, size)
 register long *v, offset, size;
 {
     if (size <= 0) return;
@@ -415,7 +409,7 @@ register long *v, offset, size;
 
 
 /* Toggle the bits in a bit-field */
-Void na_bfchg(v, offset, size)
+void na_bfchg(v, offset, size)
 register long *v, offset, size;
 {
     if (size <= 0) return;
@@ -438,7 +432,7 @@ register long *v, offset, size;
 
 
 /* Test if a bit-field contains any ones */
-boolean na_bftst(v, offset, size)
+int na_bftst(v, offset, size)
 register long *v, offset, size;
 {
     if (size <= 0) return 0;
@@ -459,10 +453,10 @@ register long *v, offset, size;
 
 
 
-/* Set or clear a bit-field according to a boolean value */
-Void na_bffill(v, offset, size, b)
+/* Set or clear a bit-field according to a int value */
+void na_bffill(v, offset, size, b)
 long *v, offset, size;
-boolean b;
+int b;
 {
     if (b)
         na_bfset(v, offset, size);
@@ -473,7 +467,7 @@ boolean b;
 
 
 /* Move a bit-field into another bit-field */
-Void na_bfmove(s, soff, d, doff, size)
+void na_bfmove(s, soff, d, doff, size)
 register long *s, soff, *d, doff, size;
 {
     if (size <= 0) return;
@@ -503,7 +497,7 @@ register long *s, soff, *d, doff, size;
 
 
 /* Bitwise AND two bit fields */
-Void na_bfand(s, soff, d, doff, size)
+void na_bfand(s, soff, d, doff, size)
 register long *s, soff, *d, doff, size;
 {
     if (size <= 0) return;
@@ -531,7 +525,7 @@ register long *s, soff, *d, doff, size;
 
 
 /* Bitwise AND-NOT two bit fields */
-Void na_bfbic(s, soff, d, doff, size)
+void na_bfbic(s, soff, d, doff, size)
 register long *s, soff, *d, doff, size;
 {
     if (size <= 0) return;
@@ -557,7 +551,7 @@ register long *s, soff, *d, doff, size;
 
 
 /* Bitwise OR two bit fields */
-Void na_bfor(s, soff, d, doff, size)
+void na_bfor(s, soff, d, doff, size)
 register long *s, soff, *d, doff, size;
 {
     if (size <= 0) return;
@@ -583,7 +577,7 @@ register long *s, soff, *d, doff, size;
 
 
 /* Bitwise XOR two bit fields */
-Void na_bfxor(s, soff, d, doff, size)
+void na_bfxor(s, soff, d, doff, size)
 register long *s, soff, *d, doff, size;
 {
     if (size <= 0) return;
@@ -609,7 +603,7 @@ register long *s, soff, *d, doff, size;
 
 
 /* Reverse a bit field LSB-for-MSB */
-Void na_bfrev(v, offset, size)
+void na_bfrev(v, offset, size)
 register long *v, offset, size;
 {
     if (size <= 1) return;
@@ -660,7 +654,7 @@ register long *v, offset, size;
 
 
 /* Insert a value (up to 32 bits) into a bit-field */
-Void na_bfins(v, offset, size, val)
+void na_bfins(v, offset, size, val)
 register long *v, offset, size, val;
 {
     register long mask;
@@ -1022,7 +1016,7 @@ register long a, b, c, d;
 
 
 
-Void P_iswap2(a, b)
+void P_iswap2(a, b)
 register long *a, *b;
 {
     register long t;
@@ -1034,7 +1028,7 @@ register long *a, *b;
 
 
 
-Void P_isort2(a, b)
+void P_isort2(a, b)
 register long *a, *b;
 {
     register long t;
@@ -1048,7 +1042,7 @@ register long *a, *b;
 
 
 
-Void P_isort3(a, b, c)
+void P_isort3(a, b, c)
 register long *a, *b, *c;
 {
     register long t;
@@ -1081,7 +1075,7 @@ register long *a, *b, *c;
 
 
 
-Void P_isort4(a, b, c, d)
+void P_isort4(a, b, c, d)
 register long *a, *b, *c, *d;
 {
     register long t;
@@ -1116,7 +1110,7 @@ register long min, i, max;
 
 
 
-boolean P_ibetween(min, i, max)
+int P_ibetween(min, i, max)
 register long min, i, max;
 {
     if (min <= i)
@@ -1127,7 +1121,7 @@ register long min, i, max;
 
 
 
-boolean P_ibetweenm(min, i, max, margin)
+int P_ibetweenm(min, i, max, margin)
 register long min, i, max, margin;
 {
     return ((min-margin <= i) && (i <= max+margin)) ||
@@ -1136,7 +1130,7 @@ register long min, i, max, margin;
 
 
 
-Void P_iamin(min, i)
+void P_iamin(min, i)
 register long *min, i;
 {
     if (i < *min)
@@ -1145,7 +1139,7 @@ register long *min, i;
 
 
 
-Void P_iamax(max, i)
+void P_iamax(max, i)
 register long *max, i;
 {
     if (i > *max)
@@ -1154,7 +1148,7 @@ register long *max, i;
 
 
 
-Void P_iaminmax(min, max, i)
+void P_iaminmax(min, max, i)
 register long *min, *max, i;
 {
     if (i < *min)
@@ -1223,9 +1217,9 @@ register long y, x;
 
 
 
-Void na_addc(a, b, c)
+void na_addc(a, b, c)
 long *a, b;
-boolean *c;
+int *c;
 {
     *a += b + *c;
     *c = ((unsigned long)*a < (unsigned long)b);
@@ -1233,11 +1227,11 @@ boolean *c;
 
 
 
-Void na_subc(a, b, c)
+void na_subc(a, b, c)
 long *a, b;
-boolean *c;
+int *c;
 {
-    boolean newc = ((unsigned long)*a < (unsigned long)b);
+    int newc = ((unsigned long)*a < (unsigned long)b);
 
     *a -= b - *c;
     *c = newc;
@@ -1290,7 +1284,7 @@ long a, b;
     na_quadword q;
     unsigned short ah = a >> 16, al = a;
     unsigned short bh = b >> 16, bl = b;
-    boolean c;
+    int c;
     unsigned long t;
 
     q.U1.i1 = al * bl;
@@ -1311,7 +1305,7 @@ long a, b;
 /* Quick-sort */
 
 static int (*userqsortfunc)();
-static Anyptr userqsortlink;
+static void* userqsortlink;
 
 static int qsortfunc(a, b)
 long *a, *b;
@@ -1325,7 +1319,7 @@ long *a, *b;
     return (*userqsortfunc)(*a, *b, userqsortlink);
 }
 
-Void na_qsort(a, n, comp)
+void na_qsort(a, n, comp)
 na_long *a;
 long n;
 _PROCEDURE comp;
@@ -1335,600 +1329,21 @@ _PROCEDURE comp;
         userqsortfunc = (int (*)())comp.proc;
         userqsortlink = comp.link;
 
-#ifndef OS2
 	qsort(a, n, 4, (int (*)())qsortfunc2);
-#endif
 
       }
      else 
        {
 	 userqsortfunc = (int (*)())comp.proc;
 
-#ifndef OS2
 	 qsort(a, n, 4, (int (*)())qsortfunc);
-#endif
 	 
        }
   }
 
-
-
-
-
-/* String operations */
-
-Void strsafeappend(s, s2)
-register Char *s, *s2;
-{
-    register Char *cp;
-
-    cp = s;
-    while (*cp) cp++;
-    s += 255;
-    while (cp < s && *s2)
-        *cp++ = *s2++;
-    *cp = 0;
-}
-
-
-
-Char *strupper(res, s)
-register Char *res, *s;
-{
-    register Char *d = res;
-    while (*s)
-        *d++ = toupper(*s++);
-    *d = 0;
-    return res;
-}
-
-
-
-Char *strlower(res, s)
-register Char *res, *s;
-{
-    register Char *d = res;
-    while (*s)
-        *d++ = tolower(*s++);
-    *d = 0;
-    return res;
-}
-
-
-
-Char *strpart(res, s, first, last)
-Char *res, *s;
-long first, last;
-{
-    return strsub(res, s, first, last-first+1);
-}
-
-
-
-Char *strlast(res, s, num)
-Char *res, *s;
-long num;
-{
-    register Char *cp;
-
-    cp = s + strlen(s) - num;
-    if (cp <= s)
-        return strcpy(res, s);
-    else
-        return strcpy(res, cp);
-}
-
-
-
-Char *strcjust(res, s, wid)
-register Char *res, *s;
-register long wid;
-{
-    register int len = strlen(s), wid2;
-    register char *cp = res;
-
-    if (wid > 255)
-        wid = 255;
-    wid -= len;
-    if (wid <= 0)
-        return strcpy(res, s);
-    wid2 = wid >> 1;
-    while (--wid2 >= 0)
-        *cp++ = ' ';
-    while (*s)
-        *cp++ = *s++;
-    wid2 = (wid + 1) >> 1;
-    while (--wid2 >= 0)
-        *cp++ = ' ';
-    *cp = 0;
-    return res;
-}
-
-
-
-boolean strbegins(s1, s2)
-register Char *s1, *s2;
-{
-    while (*s2)
-        if (*s1++ != *s2++)
-            return 0;
-    return 1;
-}
-
-
-
-boolean strends(s1, s2)
-register Char *s1, *s2;
-{
-    register int skip = strlen(s1) - strlen(s2);
-
-    if (skip < 0)
-        return 0;
-    return (strcmp(s1 + skip, s2) == 0);
-}
-
-
-
-boolean strcibegins(s1, s2)
-register Char *s1, *s2;
-{
-    while (*s2)
-        if (isalpha(*s1) ? (toupper(*s1++) != toupper(*s2++))
-                         : (*s1++ != *s2++))
-            return 0;
-    return 1;
-}
-
-
-
-boolean strciends(s1, s2)
-register Char *s1, *s2;
-{
-    register int skip = strlen(s1) - strlen(s2);
-
-    if (skip < 0)
-        return 0;
-    return !strcicmp(s1 + skip, s2);
-}
-
-
-
-#if 0   /* now in p2clib.c */
-int strcicmp(s1, s2)
-register Char *s1, *s2;
-{
-    register Char ch;
-
-    while (*s2)
-        if (isalpha(ch = *s1++) ? (toupper(ch) != toupper(*s2++))
-                         : (ch != *s2++))
-            return (toupper(ch) > toupper(*--s2)) ? 1 : -1;
-    return (*s1 == 0) ? 0 : 1;
-}
-#endif
-
-
-
-long strsubcmp(n, s1, i1, s2, i2)
-register Char *s1, *s2;
-register long n, i1, i2;
-{
-    if (i1 <= 0) s1 = (Char *)"";
-    if (i2 <= 0) s2 = (Char *)"";
-    while (--i1 > 0) {
-        if (!*s1++) {
-            s1--;
-            break;
-        }
-    }
-    while (--i2 > 0) {
-        if (!*s2++) {
-            s2--;
-            break;
-        }
-    }
-    return strncmp(s1, s2, (int)n);
-}
-
-
-
-boolean strcisubcmp(n, s1, i1, s2, i2)
-register Char *s1, *s2;
-register long n, i1, i2;
-{
-    if (i1 <= 0) s1 = (Char *)"";
-    if (i2 <= 0) s2 = (Char *)"";
-    while (--i1 > 0) {
-        if (!*s1++) {
-            s1--;
-            break;
-        }
-    }
-    while (--i2 > 0) {
-        if (!*s2++) {
-            s2--;
-            break;
-        }
-    }
-    while (--n >= 0) {
-        if (toupper(*s1++) != toupper(*s2++))
-            return 0;
-    }
-    return 1;
-}
-
-
-
-Void strsubst(repl, s, index, size)
-register Char *repl, *s;
-register long index, size;
-{
-    register int len = strlen(repl);
-
-    s += index - 1;
-    size -= len;
-    if (size < 0) {
-        register Char *cp;
-        for (cp = s + strlen(s); cp >= s; cp--)
-            *cp = cp[size];
-    } else if (size > 0) {
-        register Char *cp;
-        for (cp = s; (*cp = cp[size]); cp++) ;
-    }
-    strncpy(s, repl, len);
-}
-
-
-
-Char *strint2(res, i, w)
-Char *res;
-long i, w;
-{
-    if (w < 0)
-        sprintf(res, "%0*ld", (int)(-w), i);
-    else
-        sprintf(res, "%*ld", (int)w, i);
-    return res;
-}
-
-
-
-long strposb(s1, s2, i)
-register Char *s1, *s2;
-register long i;
-{
-    register int len1, len2;
-
-    len1 = strlen(s1);
-    len2 = strlen(s2);
-    if (--i > len1 - len2)
-        i = len1 - len2;
-    if (i < 0 || !len2)
-        return 0;
-    while (i >= 0 && strncmp(s1 + i, s2, len2))
-        i--;
-    return i + 1;
-}
-
-
-
-long strposc(s1, ch, i)
-register Char *s1, ch;
-register long i;
-{
-    register Char *cp = s1;
-
-    if (i <= 0)
-        return 0;
-    while (--i > 0)
-        if (!*cp++)
-            return 0;
-    while (*cp)
-        if (*cp++ == ch)
-            return cp - s1;
-    return 0;
-}
-
-
-
-long strcipos2(s1, s2, i)
-register Char *s1, *s2;
-register long i;
-{
-    register Char *cp = s1;
-    register int len = strlen(s2);
-
-    if (i <= 0 || !len)
-        return 0;
-    while (--i > 0)
-        if (!*cp++)
-            return 0;
-    while (*cp)
-        if (!strncmp(cp++, s2, len))
-            return cp - s1;
-    return 0;
-}
-
-
-
-long strciposb(s1, s2, i)
-register Char *s1, *s2;
-register long i;
-{
-    register int len;
-
-    len = strlen(s1) - strlen(s2);
-    if (--i > len)
-        i = len;
-    if (i < 0 || !*s2)
-        return 0;
-    while (i >= 0 && !strcibegins(s1 + i, s2))
-        i--;
-    return i + 1;
-}
-
-
-
-long strposcset(s1, s2, i)
-register Char *s1, *s2;
-register long i;
-{
-    register Char *cp = s1, *cp2;
-    register Char ch, ch2;
-
-    if (i <= 0)
-        return 0;
-    while (--i > 0)
-        if (!*cp++)
-            return 0;
-    while ((ch = *cp++)) {
-        for (cp2 = s2; (ch2 = *cp2); cp2++)
-            if (ch == ch2)
-                return cp - s1;
-    }
-    return 0;
-}
-
-
-
-long strposbcset(s1, s2, i)
-register Char *s1, *s2;
-register long i;
-{
-    register Char *cp2;
-    register Char ch, ch2;
-    register int len;
-
-    len = strlen(s1);
-    if (i >= len)
-        i = len;
-    if (i <= 0)
-        return 0;
-    while (--i >= 0) {
-        ch = s1[i];
-        for (cp2 = s2; (ch2 = *cp2); cp2++)
-            if (ch == ch2)
-                return i + 1;
-    }
-    return 0;
-}
-
-
-
-boolean strsubset(s1, s2)
-register Char *s1, *s2;
-{
-    register Char *cp, ch, ch2;
-
-    while ((ch = *s1++)) {
-        for (cp = s2; (ch2 = *s2++) != ch; cp++)
-            if (!ch2)
-                return 0;
-    }
-    return 1;
-}
-
-
-
-boolean strcommon(s1, s2)
-register Char *s1, *s2;
-{
-    return strsubset(s1, s2) && strsubset(s2, s1);
-}
-
-
-
-long strlenv(s1)
-register Char *s1;
-{
-    register int len = 0;
-    register Char ch;
-
-    while ((ch = *s1++)) {
-        switch (ch) {
-
-            case 0:
-            case 7:
-                break;
-
-            case 8:
-                if (--len < 0)
-                    ++len;
-                break;
-
-            case 9:
-                len = (len | 7) + 1;
-                break;
-
-            case 12:
-            case 13:
-                len = 0;
-                break;
-
-            default:
-                ++len;
-        }
-    }
-    return len;
-}
-
-
-
-Char *strhex(res, i, w)
-Char *res;
-long i, w;
-{
-    if (w < 1 || w > 8)
-        sprintf(res, "%lX", i);
-    else
-        sprintf(res, "%.*lX", (int)w, i);
-    return res;
-}
-
-
-
-Char *strbinary(res, i, w)
-Char *res;
-register long i, w;
-{
-    if (w < 1 || w > 32) {
-        if (i) {
-            register long i2 = i;
-            w = 32;
-            while (i2 >= 0) {
-                w--;
-                i2 <<= 1;
-            }
-        } else
-            w = 1;
-    }
-    res[w] = 0;
-    while (w > 0) {
-        --w;
-        res[w] = '0' + (i & 1);
-        i >>= 1;
-    }
-    return res;
-}
-
-
-
-Char *strdate(res, opts)    /* ignore opts for now */
-Char *res, *opts;
-{
-    time_t t = time((long *)0);
-    strcpy(res, (char *) ctime(&t));
-    res[strlen(res)-1] = 0;    /* eat the \n */
-    return res;
-}
-
-
-
-Void strword(s, word)
-register Char *s, *word;
-{
-    register Char *s1 = s;
-
-    while (isspace(*s1)) s1++;
-    while (*s1 && !isspace(*s1))
-        *word++ = *s1++;
-    while (isspace(*s1)) s1++;
-    *word = 0;
-    while (*s1)
-        *s++ = *s1++;
-    *s = 0;
-}
-
-
-
-Void strword2(s, word)
-register Char *s, *word;
-{
-    register Char *s1 = s;
-    register Char ch;
-
-    while (isspace(*s1)) s1++;
-    if (*s1 == '\'' || *s1 == '"') {
-        ch = *s1++;
-        while (*s1 && *s1 != ch)
-            *word++ = *s1++;
-        if (*s1 == ch)
-            s1++;
-    } else {
-        while (*s1 && !isspace(*s1))
-            *word++ = *s1++;
-    }
-    while (isspace(*s1)) s1++;
-    *word = 0;
-    while (*s1)
-        *s++ = *s1++;
-    *s = 0;
-}
-
-
-
-Void strcomment(s, bracket)
-register Char *s;
-Char *bracket;
-{
-    register Char *cp;
-    register char ch1, ch2;
-
-    ch1 = bracket[0];
-    ch2 = bracket[1];
-    while (*s && *s != ch1) s++;
-    if (*s) {
-        cp = s;
-        while (*s) {
-            if (*s == ch1) {
-                if (ch2) {
-                    s++;
-                    while (*s && *s != ch2) s++;
-                    if (*s)
-                        s++;
-                } else
-                    break;
-            } else
-                *cp++ = *s++;
-        }
-        *cp = 0;
-    }
-}
-
-
-
-Void strcompress(s, chars, all)
-register Char *s, *chars;
-boolean all;
-{
-    register Char *cp = s, *cp2;
-    register Char ch;
-
-    while ((ch = *s)) {
-        for (cp2 = chars; *cp2 && *cp2 != ch; cp2++) ;
-        if (*cp2) {
-            if (!all)
-                *cp++ = ch;
-            do {
-                if (!(ch = *++s))
-                    break;
-                for (cp2 = chars; *cp2 && *cp2 != ch; cp2++) ;
-            } while (*cp2);
-        } else {
-            *cp++ = ch;
-            s++;
-        }
-    }
-    *cp = 0;
-}
-
-
-
-
-
 /* Variable-length string allocation */
 
-static Void outmem()
+static void outmem()
 {
     fprintf(stderr, "Memory full!\n");
     exit(1);
@@ -1936,13 +1351,13 @@ static Void outmem()
 
 
 #ifdef LACKS_STRDUP
-Char *strdup(s)
-Char *s;
+char *strdup(s)
+char *s;
 {
-    Char *sp;
+    char *sp;
     int len = strlen(s);
 
-    sp = (Char *)malloc(len + 1);
+    sp = (char *)malloc(len + 1);
     if (!sp) outmem();
     strcpy(sp, s);
     return sp;
@@ -1950,62 +1365,30 @@ Char *s;
 #endif
 
 
-
-Void strdispose(sp)
-Char **sp;
-{
-    if (*sp)
-        free(*sp);
-    *sp = NULL;
-}
-
-
-
-Void strchange(sp, s)
-Char **sp, *s;
-{
-    int len1, len2 = strlen(s);
-    if (*sp) {
-        len1 = strlen(*sp);
-        if (len1 != len2)
-            *sp = (Char *)realloc(*sp, len2 + 1);
-    } else
-        *sp = (Char *)malloc(len2 + 1);
-    if (!*sp) outmem();
-    strcpy(*sp, s);
-}
-
-
-
-
-
-
-
 /* String lists */
 
-
-Void strlist_init(base)
-na_strlist **base;
+void strlist_init(base)
+na_strlist_t **base;
 {
     *base = NULL;
 }
 
 
 
-na_strlist *strlist_add(base, s)
-register na_strlist **base;
-register Char *s;
+na_strlist_t *strlist_add(base, s)
+register na_strlist_t **base;
+register char *s;
 {
-    register na_strlist *lp;
+    register na_strlist_t *lp;
     register int len = strlen(s);
 
     while ((lp = *base) && strcmp(lp->s, s) < 0)
         base = &lp->next;
     if (!lp || strcmp(lp->s, s)) {
 #ifdef __alpha__
-        lp = (na_strlist *)malloc(sizeof(na_strlistrec));
+        lp = (na_strlist_t *)malloc(sizeof(na_strlist_t));
 #else
-        lp = (na_strlist *)malloc(sizeof(na_strlistrec) - 255 + len);
+        lp = (na_strlist_t *)malloc(sizeof(na_strlist_t) - 255 + len);
 #endif
         if (!lp) outmem();
         lp->next = *base;
@@ -2020,19 +1403,19 @@ register Char *s;
 
 
 
-na_strlist *strlist_append(base, s)
-register na_strlist **base;
-register Char *s;
+na_strlist_t *strlist_append(base, s)
+register na_strlist_t **base;
+register char *s;
 {
-    register na_strlist *lp;
+    register na_strlist_t *lp;
     register int len = strlen(s);
 
     while ((lp = *base))
         base = &lp->next;
 #ifdef __alpha__
-    lp = (na_strlist *)malloc(sizeof(na_strlistrec));
+    lp = (na_strlist_t *)malloc(sizeof(na_strlist_t));
 #else
-    lp = (na_strlist *)malloc(sizeof(na_strlistrec) - 255 + len);
+    lp = (na_strlist_t *)malloc(sizeof(na_strlist_t) - 255 + len);
 #endif
     if (!lp) outmem();
     lp->next = NULL;
@@ -2046,17 +1429,17 @@ register Char *s;
 
 
 
-na_strlist *strlist_insert(base, s)
-register na_strlist **base;
-register Char *s;
+na_strlist_t *strlist_insert(base, s)
+register na_strlist_t **base;
+register char *s;
 {
-    register na_strlist *lp;
+    register na_strlist_t *lp;
     register int len = strlen(s);
 
 #ifdef __alpha__
-    lp = (na_strlist *)malloc(sizeof(na_strlistrec));
+    lp = (na_strlist_t *)malloc(sizeof(na_strlist_t));
 #else
-    lp = (na_strlist *)malloc(sizeof(na_strlistrec) - 255 + len);
+    lp = (na_strlist_t *)malloc(sizeof(na_strlist_t) - 255 + len);
 #endif
     if (!lp) outmem();
     lp->next = *base;
@@ -2070,20 +1453,18 @@ register Char *s;
 
 
 
-na_strlist *strlist_find(base, s)
-register na_strlist *base;
-register Char *s;
+na_strlist_t *strlist_find(base, s)
+register na_strlist_t *base;
+register char *s;
 {
     while (base && strcmp(base->s, s))
         base = base->next;
     return base;
 }
 
-
-
-na_strlist *strlist_cifind(base, s)
-register na_strlist *base;
-register Char *s;
+na_strlist_t *strlist_cifind(base, s)
+register na_strlist_t *base;
+register char *s;
 {
     while (base && strcicmp(base->s, s))
         base = base->next;
@@ -2091,12 +1472,11 @@ register Char *s;
 }
 
 
-
-Void strlist_change(base, lp, s)
-register na_strlist **base, **lp;
-register Char *s;
+void strlist_change(base, lp, s)
+register na_strlist_t **base, **lp;
+register char *s;
 {
-    register na_strlist *lp2 = *lp, *lp3;
+    register na_strlist_t *lp2 = *lp, *lp3;
     register int len = strlen(s);
 
     while ((lp3 = *base) != lp2) {
@@ -2106,7 +1486,7 @@ register Char *s;
             return;   /* wasn't in the list */
     }
     if (len > lp3->len) {       /* must reallocate */
-        lp3 = (na_strlist *)realloc(lp3, sizeof(na_strlistrec) - 255 + len);
+        lp3 = (na_strlist_t *)realloc(lp3, sizeof(na_strlist_t) - 255 + len);
         if (!lp3) outmem();
         lp3->len = len;
         *lp = lp3;
@@ -2117,12 +1497,11 @@ register Char *s;
 }
 
 
-
-Void strlist_remove(base, s)
-register na_strlist **base;
-register Char *s;
+void strlist_remove(base, s)
+register na_strlist_t **base;
+register char *s;
 {
-    register na_strlist *lp;
+    register na_strlist_t *lp;
 
     while ((lp = *base)) {
         if (!strcmp(lp->s, s)) {
@@ -2135,11 +1514,10 @@ register Char *s;
 }
 
 
-
-Void strlist_delete(base, lp)
-register na_strlist **base, *lp;
+void strlist_delete(base, lp)
+register na_strlist_t **base, *lp;
 {
-    register na_strlist *lp2;
+    register na_strlist_t *lp2;
 
     while ((lp2 = *base)) {
         if (lp2 == lp) {
@@ -2152,9 +1530,8 @@ register na_strlist **base, *lp;
 }
 
 
-
-Void strlist_dispose(ptr)
-register na_strlist **ptr;
+void strlist_dispose(ptr)
+register na_strlist_t **ptr;
 {
     free(*ptr);
     *ptr = NULL;
@@ -2162,10 +1539,10 @@ register na_strlist **ptr;
 
 
 
-Void strlist_empty(base)
-register na_strlist **base;
+void strlist_empty(base)
+register na_strlist_t **base;
 {
-    register na_strlist *lp;
+    register na_strlist_t *lp;
 
     while ((lp = *base)) {
         *base = lp->next;
@@ -2174,17 +1551,16 @@ register na_strlist **base;
 }
 
 
-
-Void strlist_copy(dest, src)
-register na_strlist **dest, *src;
+void strlist_copy(dest, src)
+register na_strlist_t **dest, *src;
 {
-    register na_strlist *lp;
+    register na_strlist_t *lp;
 
     while (src) {
 #ifdef __alpha__
-        lp = (na_strlist *)malloc(sizeof(na_strlistrec));
+        lp = (na_strlist_t *)malloc(sizeof(na_strlist_t));
 #else
-        lp = (na_strlist *)malloc(sizeof(na_strlistrec) - 255 + src->len);
+        lp = (na_strlist_t *)malloc(sizeof(na_strlist_t) - 255 + src->len);
 #endif
         lp->len = src->len;
         lp->kind = src->kind;
@@ -2199,9 +1575,9 @@ register na_strlist **dest, *src;
 
 
 
-Void strlist_dump(f, base)
+void strlist_dump(f, base)
 register FILE *f;
-register na_strlist *base;
+register na_strlist_t *base;
 {
     while (base) {
         fprintf(f, "\"%s\" %d, %ld\n", base->s, base->kind, (long)base->value);
@@ -2210,25 +1586,24 @@ register na_strlist *base;
 }
 
 
-
 double na_srtor(x)
-Anyptr x;
+void* x;
 {
   return(*((float *) &x));
 }
 
 
-Anyptr na_rtosr(x)
+void* na_rtosr(x)
 double x;
 {
   float y = x;
 
-  return(*((Anyptr *) &y));
+  return(*((void* *) &y));
 }
 
 /* added in 2013, to replace strcpy calls with undefined semantics */
 
-char * strcpy_overlap(char * dst, char * src)
+char *strcpy_overlap(char * dst, char * src)
 
 {
   int i = 0;
@@ -2242,5 +1617,3 @@ char * strcpy_overlap(char * dst, char * src)
 }
 
 /* End. */
-
-
diff --git a/psys/src/newci.c b/psys/src/newci.c
index d5c618d..4aa6fcc 100644
--- a/psys/src/newci.c
+++ b/psys/src/newci.c
@@ -7,13 +7,6 @@
 # include <sys/types.h>   
 # include <sys/time.h>
 # include <time.h>
-#elif defined(__sgi)
-# include <sys/types.h>   
-# include <sys/time.h>
-# include <time.h>
-#elif defined(rs6000)
-# include <sys/time.h>
-# include <time.h>
 #elif defined(BSD)
 # include <sys/types.h>
 # include <sys/wait.h>
@@ -22,9 +15,6 @@
 #else
 # include <time.h>
 #endif
-#ifdef OS2
-# include <sys/timeb.h>
-#endif
 
 #include <p2c/p2c.h>
 #include <p2c/newci.h>
@@ -32,23 +22,23 @@
 #include <p2c/newasm.h>
 
 
-boolean newci_findprocedure(name, start)
-Char *name;
+int newci_findprocedure(name, start)
+char *name;
 _PROCEDURE *start;
 {
   return(0);
 }
 
 
-boolean newci_findprogram(name)
-Char *name;
+int newci_findprogram(name)
+char *name;
 {
   return(0);
 }
 
 
 void newci_loadprogram(name)
-Char *name;
+char *name;
 {
   return;
 }
@@ -73,18 +63,18 @@ long *id;
 /*
    procedure inputstring(var s : string; mode : newci_imode;
                          possterm : newci_argstr; var term : char;
-                         echoterm : boolean; var pos : integer);
+                         echoterm : int; var pos : integer);
 */
-extern Void newci_inputstring PP((Char *s, int mode, Char *possterm,
-				  Char *term, int echoterm, long *pos));
+extern void newci_inputstring (char *s, int mode, char *possterm,
+				  char *term, int echoterm, long *pos);
 
      
 /*  This procedure should be made to do something real.  */
 void newci_inputstring(s, mode, possterm, term, echoterm, pos)
-Char *s;
+char *s;
 int mode;
-Char *possterm;
-Char *term;
+char *possterm;
+char *term;
 int echoterm;
 long *pos;
 {
@@ -99,14 +89,14 @@ long *pos;
 }
 
 
-Static Void goodfixname(name, ext, home, force)
-Char *name;
-Char *ext, *home;
-boolean force;
+static void goodfixname(name, ext, home, force)
+char *name;
+char *ext, *home;
+int force;
 {
   long i;
-  boolean hassuffix;
-  Char STR1[256];
+  int hassuffix;
+  char STR1[256];
   long FORLIM;
 
  /* fs_zapspaces(name); */
@@ -149,13 +139,13 @@ boolean force;
 }
 
 
-Void newci_fixfname(Char * s, Char * ext, Char * home)
+void newci_fixfname(char * s, char * ext, char * home)
 {
   goodfixname(s, ext, home, 0);
 }
 
-Void newci_forcefname(s, ext, home)
-Char *s, *ext, *home;
+void newci_forcefname(s, ext, home)
+char *s, *ext, *home;
 {
   goodfixname(s, ext, home, 1);
 }
@@ -254,24 +244,12 @@ char *bad;
 long timers_sysclock()
 {
 
-#ifdef OS2
-  struct timeb tm;
-
-  _ftime(&tm);
-
-  return((long)(tm.time % 86400) * 100 + tm.millitm / 10);
-
-#else
-
   struct timeval time;
   struct timezone tz;
 
   gettimeofday(&time, &tz);
 
   return((time.tv_sec % 86400) * 100 + time.tv_usec / 10000);
-
-#endif
-
 }
 
 
diff --git a/psys/src/newcrt.c b/psys/src/newcrt.c
index f1327a3..688cf22 100644
--- a/psys/src/newcrt.c
+++ b/psys/src/newcrt.c
@@ -21,9 +21,6 @@
 #endif
 
 #include <X11/X.h>
-#ifdef OS2
-#include <X11/Xlib.h>
-#endif  /* OS2 */
 #include <X11/Xutil.h>
 #include <X11/cursorfont.h>
 
@@ -507,7 +504,7 @@ int newhighlight;
 
 void nc_putStr(x, y, str)
 int x, y;
-Char *str;
+char *str;
 {
   if (! nc_text_in_window) {
     fprintf(stderr, "Warning!  nc_putStr(%d,%d,'", x, y);
@@ -546,7 +543,7 @@ Char *str;
 
 void nc_writeStr(x, y, str_)
 int x, y;
-Char *str_;
+char *str_;
 {
   int i, len;
   unsigned char *str = (unsigned char *)str_;
@@ -852,13 +849,13 @@ void nc_printf(va_alist)
 va_dcl
 {
   va_list args;
-  Char *fmt, fmt2[1024];
-  Char printbuffer[2000], printbuffer2[2000];
-  Char *p1, *p2;
+  char *fmt, fmt2[1024];
+  char printbuffer[2000], printbuffer2[2000];
+  char *p1, *p2;
 
 /*  fprintf(stderr, "nc_printf() called, cursor at (%d,%d)\n", XPOS, YPOS);  */
   va_start(args);
-  fmt = va_arg(args, Char *);
+  fmt = va_arg(args, char *);
 
   if (! nc_text_in_window) {
     fix_string((unsigned char *) fmt, (unsigned char *) fmt2);
@@ -879,13 +876,13 @@ va_dcl
 
 #else
 
-void nc_printf(Char * fmt, ...)
+void nc_printf(char * fmt, ...)
 
 {
   va_list args;
-  Char fmt2[1024];
-  Char printbuffer[2000], printbuffer2[2000];
-  Char *p1, *p2;
+  char fmt2[1024];
+  char printbuffer[2000], printbuffer2[2000];
+  char *p1, *p2;
 
 /*  fprintf(stderr, "nc_printf() called, cursor at (%d,%d)\n", XPOS, YPOS);  */
 
@@ -919,26 +916,26 @@ va_dcl
 {
   va_list args;
   FILE *outfile;
-  Char *fmt;
-  Char fmt2[1024];
-  Char printbuffer[2000], printbuffer2[2000];
-  Char *p1, *p2;
+  char *fmt;
+  char fmt2[1024];
+  char printbuffer[2000], printbuffer2[2000];
+  char *p1, *p2;
 
   va_start(args);
   outfile = va_arg(args, FILE *);
-  fmt = va_arg(args, Char *);
+  fmt = va_arg(args, char *);
   vfprintf(outfile, fmt, args);
 }
 
 #else
 
-void zfprintf(FILE * outfile, Char * fmt, ...)
+void zfprintf(FILE * outfile, char * fmt, ...)
 
 {
   va_list args;
-  Char fmt2[1024];
-  Char printbuffer[2000], printbuffer2[2000];
-  Char *p1, *p2;
+  char fmt2[1024];
+  char printbuffer[2000], printbuffer2[2000];
+  char *p1, *p2;
 
   va_start(args, fmt);
 /* This leaves OS2 a no-op  */
@@ -953,13 +950,13 @@ va_dcl
 {
   va_list args;
   FILE *outfile;
-  Char *fmt, fmt2[1024];
-  Char printbuffer[2000], printbuffer2[2000];
-  Char *p1, *p2;
+  char *fmt, fmt2[1024];
+  char printbuffer[2000], printbuffer2[2000];
+  char *p1, *p2;
 
   va_start(args);
   outfile = va_arg(args, FILE *);
-  fmt = va_arg(args, Char *);
+  fmt = va_arg(args, char *);
 /*  
   vfprintf(outfile, fmt, args);
 */
@@ -981,13 +978,13 @@ va_dcl
 
 #else
 
-void nc_fprintf(FILE * outfile, Char * fmt, ...)
+void nc_fprintf(FILE * outfile, char * fmt, ...)
 
 {
   va_list args;
-  Char fmt2[1024];
-  Char printbuffer[2000], printbuffer2[2000];
-  Char *p1, *p2;
+  char fmt2[1024];
+  char printbuffer[2000], printbuffer2[2000];
+  char *p1, *p2;
 
   va_start(args, fmt);
 
@@ -1009,7 +1006,7 @@ void nc_fprintf(FILE * outfile, Char * fmt, ...)
 
 #endif
 
-void nc_puts(Char * s)
+void nc_puts(char * s)
 
 {
   char str2[1024];
@@ -1027,12 +1024,12 @@ void nc_puts(Char * s)
 /*  fprintf(stderr, "nc_puts() exits, cursor at (%d,%d)\n", XPOS, YPOS);  */
 }
   
-void nc_fputs(Char * s, FILE *outfile)
+void nc_fputs(char * s, FILE *outfile)
 
 {
-  Char printbuffer[2000];
-  Char *p;
-  Char str2[1024];
+  char printbuffer[2000];
+  char *p;
+  char str2[1024];
 
   if (nc_text_in_window && ((outfile == stdout) || (outfile == stderr))) {
     for (p = printbuffer; *s != '\0'; s++, p++)
@@ -1052,7 +1049,7 @@ void nc_fputs(Char * s, FILE *outfile)
 void nc_putchar(uchar c)
 
 {
-  Char buffer[2];
+  char buffer[2];
 
   if (! nc_text_in_window) {
     if (c <= 127)
@@ -1140,12 +1137,6 @@ char *buf;
 	pos--;
 	nc_writeStr(XPOS, YPOS, "\b \b");
       }
-#if 0
-      XDrawImageString(m_display, nc_window, nc_gc,
-		       nc_curWindow->gleft+nc_fontwidth*XPOS,
-		       nc_curWindow->gtop+nc_fontheight*YPOS + ascent,
-		       space, 1);
-#endif
     } else if (c == 'U' - '@') {
       while (pos > 0) {
 	pos--;
@@ -1158,27 +1149,10 @@ char *buf;
 	nc_scrollUp();
       }
       buf[pos] = '\0';
-#if 0
-      XDrawImageString(m_display, nc_window, nc_gc,
-		       nc_curWindow->gleft+nc_fontwidth*XPOS,
-		       nc_curWindow->gtop+nc_fontheight*YPOS + ascent,
-		       space, 1);
-#endif
       return(buf);
-#if 0
-    } else if (c == 'C' - '@') {
-      kill(getpid(), SIGINT);
-#endif
     } else if (c >= ' ' && c < 127) {
       buf[pos++] = c;
       nc_putChar(XPOS, YPOS, c);
-#if 0
-      NC_SCREEN(YPOS*TextW+XPOS).i = nc_highlight + c;
-      XDrawImageString(m_display, nc_window, nc_gc,
-		       nc_curWindow->gleft+nc_fontwidth*XPOS,
-		       nc_curWindow->gtop+nc_fontheight*YPOS + ascent,
-		       &c, 1);
-#endif
       if (++XPOS == nc_curWindow->width) {
 	XPOS = 0;
 	if (++YPOS == nc_curWindow->height) {
@@ -1186,12 +1160,6 @@ char *buf;
 	  YPOS--;
 	}
       }
-#if 0
-      XDrawImageString(m_display, nc_window, nc_gc,
-		       nc_curWindow->gleft+nc_fontwidth*XPOS,
-		       nc_curWindow->gtop+nc_fontheight*YPOS + ascent,
-		       cursor, 1);
-#endif
     }
   }
 }
@@ -1219,7 +1187,7 @@ short nc_gType()
   return nc_g300;
 }
 
-boolean nc_alphashared()
+int nc_alphashared()
 {
   return false;
 }
diff --git a/psys/src/newtablet.c b/psys/src/newtablet.c
index 8d352cd..aa84a35 100644
--- a/psys/src/newtablet.c
+++ b/psys/src/newtablet.c
@@ -8,7 +8,7 @@
 #include <p2c/mylib.h>
 #endif
 
-boolean nt_init(device)
+int nt_init(device)
 long device;
 {
   return(1);
@@ -28,7 +28,7 @@ long *xl, *yl, *xh, *yh;
   *yh = m_down;
 }
 
-boolean nt_read(x, y, status)
+int nt_read(x, y, status)
 long *x, *y, *status;
 {
   m_tablet_info pen;
diff --git a/psys/src/numex.c b/psys/src/numex.c
index 0999fe1..dfbeeba 100644
--- a/psys/src/numex.c
+++ b/psys/src/numex.c
@@ -21,7 +21,7 @@
 typedef ne_datatype typetab[76];
 
 
-static Const typetab types = {
+static const typetab types = {
   ne_notype, ne_integer, ne_real, ne_string, ne_integer, ne_real, ne_string,
   ne_integer, ne_real, ne_string, ne_integer, ne_real, ne_string, ne_integer,
   ne_integer, ne_integer, ne_integer, ne_integer, ne_real, ne_real, ne_real,
@@ -47,8 +47,8 @@ static Const typetab types = {
 
 
 typedef struct builtinrec {
-  Char name[9];
-  Char kind;
+  char name[9];
+  char kind;
   ne_opkind op;
 } builtinrec;
 
@@ -61,7 +61,7 @@ static builtintab builtins;
 
 
 typedef struct opersymrec {
-  Char name;
+  char name;
   uchar lprec, rprec;
   unsigned iop : 7, rop : 7, sop : 7;
 /* p2c: numex.text, line 302:
@@ -71,7 +71,7 @@ typedef struct opersymrec {
 typedef opersymrec opersymtab[numopersyms];
 
 
-static Const opersymtab opers = {
+static const opersymtab opers = {
   { '?', 30, 29, ne_icond, ne_rcond, ne_scond },
   { '\b', 40, 40, ne_error, ne_rxor, ne_error },
   { '\005', 40, 40, ne_ior, ne_ror, ne_sor },
@@ -101,30 +101,18 @@ static Const opersymtab opers = {
 #define lnot_prec       140
 
 
-#ifdef rs6000
-char *strdup(string)
-     char *string;
-{
-  char *ptr;
-  ptr=malloc((strlen(string)+1)*sizeof(char));
-  if(ptr!=NULL)strcpy(ptr,string);
-  return(ptr);
-}
-#endif
-
-
-Static boolean readreal(s, i, r, desc)
-Char *s;
+static int readreal(s, i, r, desc)
+char *s;
 long *i;
 double *r;
 ne_desc *desc;
 {
-  boolean Result;
+  int Result;
   long j;
-  Char ch;
-  Char buf[256];
-  Char *STR1;
-  Char STR2[256];
+  char ch;
+  char buf[256];
+  char *STR1;
+  char STR2[256];
 
   while (s[*i - 1] == ' ')
     (*i)++;
@@ -152,7 +140,7 @@ ne_desc *desc;
   buf[*i - j] = '\0';
 /* p2c: numex.text, line 394:
  * Note: Modification of string length may translate incorrectly [146] */
-  memmove((Anyptr)buf, (Anyptr)(&s[j - 1]), *i - j);
+  memmove((void*)buf, (void*)(&s[j - 1]), *i - j);
   *r = strtod(buf, &STR1);
   j = STR1 - buf + 1;
   Result = true;
@@ -212,14 +200,14 @@ ne_desc *desc;
 
 
 
-boolean ne_readreal(s_, r, desc)
-Char *s_;
+int ne_readreal(s_, r, desc)
+char *s_;
 double *r;
 ne_desc *desc;
 {
-  Char s[256];
+  char s[256];
   long i;
-  Char STR1[256];
+  char STR1[256];
 
 /* p2c: numex.text, line 475:
  * Note: Null character at end of sprintf control string [148] */
@@ -233,13 +221,13 @@ ne_desc *desc;
 
 
 
-Static Char *realunit(Result, r, u)
-Char *Result;
+static char *realunit(Result, r, u)
+char *Result;
 double r;
-Char *u;
+char *u;
 {
-  Char s[256];
-  Char STR2[256];
+  char s[256];
+  char STR2[256];
 
   if (r == 0 || fabs(r) >= 1e15 || fabs(r) < 1e-16)
     *s = '\0';
@@ -283,17 +271,17 @@ Char *u;
 
 
 
-Static Void dummysymproc(name, desc, symptr)
-Char *name;
+static void dummysymproc(name, desc, symptr)
+char *name;
 ne_desc *desc;
-na_strlist **symptr;
+na_strlist_t **symptr;
 {
   *symptr = strlist_find(desc->symtab, name);
 }
 
 
 
-Void ne_init(desc)
+void ne_init(desc)
 ne_desc *desc;
 {
   strcpy(builtins[0].name,"ROUND");
@@ -343,15 +331,15 @@ ne_desc *desc;
   P_addsetr(desc->ident, 'a', 'z');
   P_addsetr(desc->ident, '0', '9');
   P_addset(desc->ident, '_');
-  desc->symproc.proc = (Anyptr)dummysymproc;
-  desc->symproc.link = (Anyptr)NULL;
+  desc->symproc.proc = (void*)dummysymproc;
+  desc->symproc.link = (void*)NULL;
   desc->isfunc = false;
 }
 
 
 
 
-Static Void newnexrec(nex, nargs, op)
+static void newnexrec(nex, nargs, op)
 ne_nexrec **nex;
 long nargs;
 ne_opkind op;
@@ -366,7 +354,7 @@ ne_opkind op;
 }
 
 
-Static Void disposenexrec(nex)
+static void disposenexrec(nex)
 ne_nexrec **nex;
 {
 /* p2c: numex.text, line 588:
@@ -376,7 +364,7 @@ ne_nexrec **nex;
 
 
 
-Void ne_copy(nex, newnex)
+void ne_copy(nex, newnex)
 ne_nexrec *nex, **newnex;
 {
   ne_opkind op;
@@ -398,7 +386,7 @@ ne_nexrec *nex, **newnex;
 
 
 
-Void ne_dispose(nex)
+void ne_dispose(nex)
 ne_nexrec **nex;
 {
   long i, FORLIM;
@@ -414,13 +402,13 @@ ne_nexrec **nex;
 }
 
 
-Static Char *ne_errorkind_NAMES[] = {
+static char *ne_errorkind_NAMES[] = {
   "NE_NOERROR", "NE_SYNTAX", "NE_OVERFLOW", "NE_UNDERFLOW", "NE_DIVZERO",
   "NE_STRLONG", "NE_BADTYPES", "NE_UNDEF", "NE_BADVAL"
 } ;
 
 
-Static Char *ne_opkind_NAMES[] = {
+static char *ne_opkind_NAMES[] = {
   "NE_ERROR", "NE_IC", "NE_RC", "NE_SC", "NE_IP", "NE_RP", "NE_SP", "NE_IF",
   "NE_RF", "NE_SF", "NE_IARG", "NE_RARG", "NE_SARG", "NE_IADD", "NE_ISUB",
   "NE_IMUL", "NE_IDIV", "NE_INEG", "NE_RADD", "NE_RSUB", "NE_RMUL", "NE_RDIV",
@@ -436,13 +424,13 @@ Static Char *ne_opkind_NAMES[] = {
 
 
 
-Void ne_dump(nex)
+void ne_dump(nex)
 ne_nexrec *nex;
 {
-  Char buf[256];
+  char buf[256];
   long i;
   ne_opkind op;
-  Char STR1[256];
+  char STR1[256];
   long FORLIM;
 
   if (nex == NULL) {
@@ -534,7 +522,7 @@ ne_nexrec *nex;
 
 
 
-Static boolean integerp(nex)
+static int integerp(nex)
 ne_nexrec *nex;
 {
   return (nex != NULL && types[nex->op] == ne_integer);
@@ -542,7 +530,7 @@ ne_nexrec *nex;
 
 
 
-Static boolean realp(nex)
+static int realp(nex)
 ne_nexrec *nex;
 {
   return (nex != NULL && types[nex->op] == ne_real);
@@ -550,7 +538,7 @@ ne_nexrec *nex;
 
 
 
-Static boolean stringp(nex)
+static int stringp(nex)
 ne_nexrec *nex;
 {
   return (nex != NULL && types[nex->op] == ne_string);
@@ -571,18 +559,18 @@ ne_errorkind err;
 }
 
 
-Static Void optimize PP((ne_nexrec **nex, ne_desc *desc, na_strlist *which,
-			 long mode));
+static void optimize (ne_nexrec **nex, ne_desc *desc, na_strlist_t *which,
+			 long mode);
 
 /* Local variables for optimize: */
 struct LOC_optimize {
   ne_desc *desc;
-  na_strlist *which;
+  na_strlist_t *which;
   long mode;
   ne_errorkind err;
   long ires;
   double rres;
-  Char sres[256];
+  char sres[256];
 } ;
 
 /* Local variables for opt: */
@@ -591,8 +579,8 @@ struct LOC_opt {
   ne_nexrec **nex;
 } ;
 
-Local boolean makeconstant(name, LINK)
-Char *name;
+static int makeconstant(name, LINK)
+char *name;
 struct LOC_opt *LINK;
 {
   if (LINK->LINK->mode == 1 || LINK->LINK->mode == 2)
@@ -602,7 +590,7 @@ struct LOC_opt *LINK;
     return false;
 }
 
-Local Void error(errk, LINK)
+static void error(errk, LINK)
 ne_errorkind errk;
 struct LOC_opt *LINK;
 {
@@ -610,7 +598,7 @@ struct LOC_opt *LINK;
   _Escape(2345);
 }
 
-Local Void collapsehalf(px, py, LINK)
+static void collapsehalf(px, py, LINK)
 ne_nexrec *px, *py;
 struct LOC_opt *LINK;
 {
@@ -620,7 +608,7 @@ struct LOC_opt *LINK;
   *LINK->nex = px;
 }
 
-Local Void collapsecond(px, py, pz, LINK)
+static void collapsecond(px, py, pz, LINK)
 ne_nexrec *px, *py, *pz;
 struct LOC_opt *LINK;
 {
@@ -631,7 +619,7 @@ struct LOC_opt *LINK;
   *LINK->nex = py;
 }
 
-Local Void collapseint(res, LINK)
+static void collapseint(res, LINK)
 long res;
 struct LOC_opt *LINK;
 {
@@ -640,7 +628,7 @@ struct LOC_opt *LINK;
   (*LINK->nex)->UU.i = res;
 }
 
-Local Void collapsereal(res, LINK)
+static void collapsereal(res, LINK)
 double res;
 struct LOC_opt *LINK;
 {
@@ -649,8 +637,8 @@ struct LOC_opt *LINK;
   (*LINK->nex)->UU.r = res;
 }
 
-Local Void collapsestr(res, LINK)
-Char *res;
+static void collapsestr(res, LINK)
+char *res;
 struct LOC_opt *LINK;
 {
   ne_dispose(LINK->nex);
@@ -658,11 +646,11 @@ struct LOC_opt *LINK;
   (*LINK->nex)->UU.s = (char *)strdup(res);
 }
 
-Local boolean istrue(nex, LINK)
+static int istrue(nex, LINK)
 ne_nexrec *nex;
 struct LOC_opt *LINK;
 {
-  boolean Result;
+  int Result;
 
   switch ((ne_opkind)nex->op) {
 
@@ -685,11 +673,11 @@ struct LOC_opt *LINK;
   return Result;
 }
 
-Local boolean isfalse(nex, LINK)
+static int isfalse(nex, LINK)
 ne_nexrec *nex;
 struct LOC_opt *LINK;
 {
-  boolean Result;
+  int Result;
 
   switch ((ne_opkind)nex->op) {
 
@@ -716,10 +704,10 @@ struct LOC_opt *LINK;
   return Result;
 }
 
-Local boolean foldfunction(LINK)
+static int foldfunction(LINK)
 struct LOC_opt *LINK;
 {
-  boolean Result;
+  int Result;
   long i1;
   ne_nexrec *WITH;
   long FORLIM;
@@ -738,7 +726,7 @@ struct LOC_opt *LINK;
   return Result;
 }
 
-Local ne_nexrec *opt(nex_, LINK)
+static ne_nexrec *opt(nex_, LINK)
 ne_nexrec **nex_;
 struct LOC_optimize *LINK;
 {
@@ -746,7 +734,7 @@ struct LOC_optimize *LINK;
   long i1;
   ne_nexrec *WITH;
   long FORLIM;
-  Char STR1[256];
+  char STR1[256];
 
   V.LINK = LINK;
   V.nex = nex_;
@@ -802,11 +790,11 @@ struct LOC_optimize *LINK;
   case ne_if:
     if (foldfunction(&V)) {
       if (WITH->UU.U15.fp->UU.U5.ipr.link != NULL)
-	(*(Void(*) PP((ne_nexrec *nex, long *res, Anyptr _link)))
+	(*(void(*) (ne_nexrec *nex, long *res, void* _link))
 	  WITH->UU.U15.fp->UU.U5.ipr.proc)(*V.nex, &LINK->ires,
 					   WITH->UU.U15.fp->UU.U5.ipr.link);
       else
-	(*(Void(*) PP((ne_nexrec *nex, long *res)))
+	(*(void(*) (ne_nexrec *nex, long *res))
 	  WITH->UU.U15.fp->UU.U5.ipr.proc)(*V.nex, &LINK->ires);
       collapseint(LINK->ires, &V);
     }
@@ -815,11 +803,11 @@ struct LOC_optimize *LINK;
   case ne_rf:
     if (foldfunction(&V)) {
       if (WITH->UU.U15.fp->UU.rpr.link != NULL)
-	(*(Void(*) PP((ne_nexrec *nex, double *res, Anyptr _link)))
+	(*(void(*) (ne_nexrec *nex, double *res, void* _link))
 	  WITH->UU.U15.fp->UU.rpr.proc)(*V.nex, &LINK->rres,
 					WITH->UU.U15.fp->UU.rpr.link);
       else
-	(*(Void(*) PP((ne_nexrec *nex, double *res)))
+	(*(void(*) (ne_nexrec *nex, double *res))
 	  WITH->UU.U15.fp->UU.rpr.proc)(*V.nex, &LINK->rres);
       collapsereal(LINK->rres, &V);
     }
@@ -828,11 +816,11 @@ struct LOC_optimize *LINK;
   case ne_sf:
     if (foldfunction(&V)) {
       if (WITH->UU.U15.fp->UU.spr.link != NULL)
-	(*(Void(*) PP((ne_nexrec *nex, Char *res, Anyptr _link)))
+	(*(void(*) (ne_nexrec *nex, char *res, void* _link))
 	  WITH->UU.U15.fp->UU.spr.proc)(*V.nex, LINK->sres,
 					WITH->UU.U15.fp->UU.spr.link);
       else
-	(*(Void(*) PP((ne_nexrec *nex, Char *res)))
+	(*(void(*) (ne_nexrec *nex, char *res))
 	  WITH->UU.U15.fp->UU.spr.proc)(*V.nex, LINK->sres);
       collapsestr(LINK->sres, &V);
     }
@@ -1326,7 +1314,7 @@ struct LOC_optimize *LINK;
 
   case ne_tan:
     if ((ne_opkind)WITH->UU.U10.p1->op == ne_rc)
-      collapsereal(ma_tan(WITH->UU.U10.p1->UU.r), &V);
+      collapsereal(tan(WITH->UU.U10.p1->UU.r), &V);
     break;
 
   case ne_arctan:
@@ -1342,10 +1330,10 @@ struct LOC_optimize *LINK;
 
 
 
-Static Void optimize(nex, desc_, which_, mode_)
+static void optimize(nex, desc_, which_, mode_)
 ne_nexrec **nex;
 ne_desc *desc_;
-na_strlist *which_;
+na_strlist_t *which_;
 long mode_;
 {
   struct LOC_optimize V;
@@ -1387,14 +1375,14 @@ long mode_;
 
 
 
-Void ne_constant(nex, desc, which_)
+void ne_constant(nex, desc, which_)
 ne_nexrec **nex;
 ne_desc *desc;
-Char *which_;
+char *which_;
 {
-  Char which[256];
-  na_strlist *l1, *l2;
-  Char buf[256];
+  char which[256];
+  na_strlist_t *l1, *l2;
+  char buf[256];
 
   strcpy(which, which_);
   if (!desc->casesens)
@@ -1411,14 +1399,14 @@ Char *which_;
 
 
 
-Void ne_notconstant(nex, desc, which_)
+void ne_notconstant(nex, desc, which_)
 ne_nexrec **nex;
 ne_desc *desc;
-Char *which_;
+char *which_;
 {
-  Char which[256];
-  na_strlist *l1, *l2;
-  Char buf[256];
+  char which[256];
+  na_strlist_t *l1, *l2;
+  char buf[256];
 
   strcpy(which, which_);
   if (!desc->casesens)
@@ -1435,27 +1423,27 @@ Char *which_;
 
 
 
-Void ne_constantlist(nex, desc, which)
+void ne_constantlist(nex, desc, which)
 ne_nexrec **nex;
 ne_desc *desc;
-na_strlist *which;
+na_strlist_t *which;
 {
   optimize(nex, desc, which, 1L);
 }
 
 
 
-Void ne_notconstantlist(nex, desc, which)
+void ne_notconstantlist(nex, desc, which)
 ne_nexrec **nex;
 ne_desc *desc;
-na_strlist *which;
+na_strlist_t *which;
 {
   optimize(nex, desc, which, 2L);
 }
 
 
 
-Static ne_nexrec *make2(op, nex, nex2)
+static ne_nexrec *make2(op, nex, nex2)
 ne_opkind op;
 ne_nexrec *nex, *nex2;
 {
@@ -1470,7 +1458,7 @@ ne_nexrec *nex, *nex2;
 }
 
 
-Static ne_nexrec *make3(op, nex, nex2, nex3)
+static ne_nexrec *make3(op, nex, nex2, nex3)
 ne_opkind op;
 ne_nexrec *nex, *nex2, *nex3;
 {
@@ -1533,14 +1521,14 @@ ne_datatype typ;
 
 /* Local variables for ne_intcompile: */
 struct LOC_ne_intcompile {
-  Char *ex;
+  char *ex;
   ne_desc *desc;
   long p;
 } ;
 
-Local ne_nexrec *expr PP((long prec, struct LOC_ne_intcompile *LINK));
+static ne_nexrec *expr (long prec, struct LOC_ne_intcompile *LINK);
 
-Local Void seterror(errk, LINK)
+static void seterror(errk, LINK)
 ne_errorkind errk;
 struct LOC_ne_intcompile *LINK;
 {
@@ -1551,7 +1539,7 @@ struct LOC_ne_intcompile *LINK;
     LINK->p++;
 }
 
-Local Void error_(errk, nex1, nex2, LINK)
+static void error_(errk, nex1, nex2, LINK)
 ne_errorkind errk;
 ne_nexrec **nex1, *nex2;
 struct LOC_ne_intcompile *LINK;
@@ -1561,7 +1549,7 @@ struct LOC_ne_intcompile *LINK;
   seterror(errk, LINK);
 }
 
-Local Char skipspc(LINK)
+static char skipspc(LINK)
 struct LOC_ne_intcompile *LINK;
 {
   while (LINK->ex[LINK->p - 1] == ' ')
@@ -1574,11 +1562,11 @@ struct LOC_expr {
   struct LOC_ne_intcompile *LINK;
 } ;
 
-Local ne_nexrec *parexp(LINK)
+static ne_nexrec *parexp(LINK)
 struct LOC_expr *LINK;
 {
   ne_nexrec *nex;
-  Char ch, ch2;
+  char ch, ch2;
 
   nex = NULL;
   ch = skipspc(LINK->LINK);
@@ -1596,25 +1584,25 @@ struct LOC_expr *LINK;
   return nex;
 }
 
-Local ne_nexrec *factor(LINK)
+static ne_nexrec *factor(LINK)
 struct LOC_expr *LINK;
 {
-  Char ch, ch2, kind;
-  Char name[256];
+  char ch, ch2, kind;
+  char name[256];
   ne_nexrec *nex;
   ne_nexrec **args;
   ne_datatype atype;
   na_long value;
-  na_strlist *l1;
+  na_strlist_t *l1;
   double *rp;
   ne_functionrec *fp;
   long i, p0;
   double r;
-  boolean done;
-  Char TEMP;
+  int done;
+  char TEMP;
   long FORLIM;
   int allocdone; /* flag for deallocation */
-  Anyptr tryalloc;
+  void* tryalloc;
 
   nex = NULL;
   allocdone = 0;
@@ -1634,18 +1622,18 @@ struct LOC_expr *LINK;
     kind = ' ';
     l1 = NULL;
     if (LINK->LINK->desc->symproc.link != NULL)
-      (*(Void(*) PP((Char *name, ne_desc *desc, na_strlist **symptr,
-		     Anyptr _link)))LINK->LINK->desc->symproc.proc)(name,
+      (*(void(*) (char *name, ne_desc *desc, na_strlist_t **symptr,
+		     void* _link))LINK->LINK->desc->symproc.proc)(name,
 	LINK->LINK->desc, &l1, LINK->LINK->desc->symproc.link);
     else
-      (*(Void(*) PP((Char *name, ne_desc *desc, na_strlist **symptr)))
+      (*(void(*) (char *name, ne_desc *desc, na_strlist_t **symptr))
 	LINK->LINK->desc->symproc.proc)(name, LINK->LINK->desc, &l1);
     if (l1 != NULL) {
       kind = l1->kind;
       value = l1->value;
     } else {
       kind = 255;
-/* p2c: numex.text, line 1448: Note: Character >= 128 encountered [281] */
+/* p2c: numex.text, line 1448: Note: character >= 128 encountered [281] */
     }
     switch (kind) {
 
@@ -1691,18 +1679,18 @@ struct LOC_expr *LINK;
 
     case ne_kind_strconst:
       nex = make2(ne_sc, NULL, NULL);
-      nex->UU.s = (char *)strdup((Char *)value);
+      nex->UU.s = (char *)strdup((char *)value);
       break;
 
     case ne_kind_strvalue:
       nex = make2(ne_sp, NULL, NULL);
-      nex->UU.U12.sp = (Char **)(&l1->value);
+      nex->UU.U12.sp = (char **)(&l1->value);
       nex->UU.U12.sps = l1;
       break;
 
     case ne_kind_strptr:
       nex = make2(ne_sp, NULL, NULL);
-      nex->UU.U12.sp = (Char **)value;
+      nex->UU.U12.sp = (char **)value;
       nex->UU.U12.sps = l1;
       break;
 
@@ -1711,7 +1699,7 @@ struct LOC_expr *LINK;
     case ne_kind_strfunc:
       fp = (ne_functionrec *)value;
 /* p2c: numex.text, line 1510: Note: Call to NA_ALLOC [501] */
-      tryalloc = (Anyptr *)(&args); /*G. Liu + */
+      tryalloc = (void* *)(&args); /*G. Liu + */
       /* na_alloc(&args, fp->maxargs * sizeof(ne_nexrec *));*/
       na_alloc(tryalloc,fp->maxargs *sizeof(ne_nexrec *));  /* G. Liu + */
       allocdone = 1;
@@ -1839,14 +1827,14 @@ struct LOC_expr *LINK;
       break;
     }
     if (allocdone) 
-      na_free((Anyptr)&args);
+      na_free((void*)&args);
     return nex;
   }
   if (ch == '+') {
     LINK->LINK->p++;
     nex = expr((long)neg_prec, LINK->LINK);
     if (allocdone) 
-      na_free((Anyptr)&args);
+      na_free((void*)&args);
     return nex;
   }
   if (ch == '-') {
@@ -1855,7 +1843,7 @@ struct LOC_expr *LINK;
     if (realp(nex)) {
       nex = make2(ne_rneg, nex, NULL);
       if (allocdone) 
-	na_free((Anyptr)&args);
+	na_free((void*)&args);
       return nex;
     }
     if (integerp(nex))
@@ -1863,7 +1851,7 @@ struct LOC_expr *LINK;
     else
       error_(ne_badtypes, &nex, NULL, LINK->LINK);
     if (allocdone) 
-      na_free((Anyptr)&args);
+      na_free((void*)&args);
     return nex;
   }
   if (ch == '!') {
@@ -1871,7 +1859,7 @@ struct LOC_expr *LINK;
     nex = ne_typecast(expr((long)lnot_prec, LINK->LINK), ne_boolean);
     nex = make2(ne_lnot, nex, NULL);
     if (allocdone) 
-      na_free((Anyptr)&args);
+      na_free((void*)&args);
     return nex;
   }
   if (ch == '~') {
@@ -1884,7 +1872,7 @@ struct LOC_expr *LINK;
     else
       error_(ne_badtypes, &nex, NULL, LINK->LINK);
     if (allocdone) 
-      na_free((Anyptr)&args);
+      na_free((void*)&args);
     return nex;
   }
   if (ch == '#' || ch == '\'' || ch == '"') {
@@ -1904,7 +1892,7 @@ struct LOC_expr *LINK;
 	    i = i * 10 + LINK->LINK->ex[LINK->LINK->p - 1] - 48;
 	    LINK->LINK->p++;
 	  }
-	  sprintf(name + strlen(name), "%c", (Char)(i & 255));
+	  sprintf(name + strlen(name), "%c", (char)(i & 255));
 	} else
 	  done = true;
       } else if (ch == '\'' || ch == '"') {
@@ -1932,19 +1920,19 @@ struct LOC_expr *LINK;
     nex = make2(ne_sc, nex, NULL);
     nex->UU.s = (char *)strdup(name);
     if (allocdone) 
-      na_free((Anyptr)&args);
+      na_free((void*)&args);
     return nex;
   }
   if (ch == '[' || ch == '(') {
     nex = parexp(LINK);
     if (allocdone) 
-      na_free((Anyptr)&args);
+      na_free((void*)&args);
     return nex;
   }
   if (!(ch == '.' || isdigit(ch))) {
     error_(ne_syntax, &nex, NULL, LINK->LINK);
     if (allocdone) 
-      na_free((Anyptr)&args);
+      na_free((void*)&args);
     return nex;
   }
   i = 0;
@@ -1960,7 +1948,7 @@ struct LOC_expr *LINK;
     nex = make2(ne_ic, NULL, NULL);
     nex->UU.i = i;
     if (allocdone) 
-      na_free((Anyptr)&args);
+      na_free((void*)&args);
     return nex;
   }
   LINK->LINK->p = p0;
@@ -1970,17 +1958,17 @@ struct LOC_expr *LINK;
   } else
     error_(ne_syntax, &nex, NULL, LINK->LINK);
   if (allocdone) 
-    na_free((Anyptr)&args);
+    na_free((void*)&args);
   return nex;
 }
 
-Local ne_nexrec *expr(prec, LINK)
+static ne_nexrec *expr(prec, LINK)
 long prec;
 struct LOC_ne_intcompile *LINK;
 {
   struct LOC_expr V;
   ne_nexrec *nex, *nex2, *nex3;
-  Char ch;
+  char ch;
   long opn, dp;
 
   V.LINK = LINK;
@@ -2079,8 +2067,8 @@ struct LOC_ne_intcompile *LINK;
 
 
 
-Void ne_intcompile(ex_, endp, nex, desc_)
-Char *ex_;
+void ne_intcompile(ex_, endp, nex, desc_)
+char *ex_;
 long *endp;
 ne_nexrec **nex;
 ne_desc *desc_;
@@ -2105,14 +2093,14 @@ ne_desc *desc_;
 }
 
 
-Void ne_compile(ex_, nex, desc)
-Char *ex_;
+void ne_compile(ex_, nex, desc)
+char *ex_;
 ne_nexrec **nex;
 ne_desc *desc;
 {
-  Char ex[256];
+  char ex[256];
   long len, endp;
-  Char STR1[256];
+  char STR1[256];
 
   strcpy(ex, ex_);
   if (strlen(ex) == 255) {
@@ -2140,18 +2128,18 @@ ne_desc *desc;
 
 /* Local variables for ne_uncompile: */
 struct LOC_ne_uncompile {
-  Char *ex;
+  char *ex;
   ne_desc *desc;
   ne_opkind lastop;
-  Char ch;
-  boolean flag;
+  char ch;
+  int flag;
 } ;
 
-Local Void uncompile PP((ne_nexrec *nex, int prec,
-			 struct LOC_ne_uncompile *LINK));
+static void uncompile (ne_nexrec *nex, int prec,
+			 struct LOC_ne_uncompile *LINK);
 
-Local Void append(s, LINK)
-Char *s;
+static void append(s, LINK)
+char *s;
 struct LOC_ne_uncompile *LINK;
 {
   long i;
@@ -2168,8 +2156,8 @@ struct LOC_ne_uncompile *LINK;
   LINK->desc->error = (unsigned)ne_strlong;
 }
 
-Local Void appendc(ch, LINK)
-Char ch;
+static void appendc(ch, LINK)
+char ch;
 struct LOC_ne_uncompile *LINK;
 {
   if (strlen(LINK->ex) < 255)
@@ -2180,13 +2168,13 @@ struct LOC_ne_uncompile *LINK;
  * Note: STRMAX of "ex" wants VarStrings=1 [151] */
 }
 
-Local Void appenderrname(nex, LINK)
+static void appenderrname(nex, LINK)
 ne_nexrec *nex;
 struct LOC_ne_uncompile *LINK;
 {
-  Char buf[256];
+  char buf[256];
   long i;
-  Char STR1[256];
+  char STR1[256];
 
   strcpy(buf, ne_errorkind_NAMES[nex->UU.err]);
   i = strlen(buf) + 1;
@@ -2203,7 +2191,7 @@ struct LOC_uncompile {
   ne_nexrec *nex;
 } ;
 
-Local Void args(LINK)
+static void args(LINK)
 struct LOC_uncompile *LINK;
 {
   long i1;
@@ -2223,15 +2211,15 @@ struct LOC_uncompile *LINK;
   appendc(')', LINK->LINK);
 }
 
-Local Void func(name, LINK)
-Char *name;
+static void func(name, LINK)
+char *name;
 struct LOC_uncompile *LINK;
 {
   append(name, LINK->LINK);
   args(LINK);
 }
 
-Local Void uncompile(nex_, prec, LINK)
+static void uncompile(nex_, prec, LINK)
 ne_nexrec *nex_;
 short prec;
 struct LOC_ne_uncompile *LINK;
@@ -2240,7 +2228,7 @@ struct LOC_ne_uncompile *LINK;
   ne_nexrec *nex2;
   long j;
   ne_nexrec *WITH;
-  Char STR1[256];
+  char STR1[256];
   long FORLIM;
 
   V.LINK = LINK;
@@ -2487,9 +2475,9 @@ struct LOC_ne_uncompile *LINK;
 
 
 
-Void ne_uncompile(nex, ex_, desc_)
+void ne_uncompile(nex, ex_, desc_)
 ne_nexrec *nex;
-Char *ex_;
+char *ex_;
 ne_desc *desc_;
 {
   struct LOC_ne_uncompile V;
@@ -2519,15 +2507,15 @@ ne_desc *desc_;
 
 
 
-Static Void evalargs(nex)
+static void evalargs(nex)
 ne_nexrec *nex;
 {
   long i;
-  Char buf[256];
+  char buf[256];
   long FORLIM;
 
 /* p2c: numex.text, line 2201: Note: Call to NA_OUTERALLOC [502] */
-  na_outeralloc((Anyptr *)(&ne_argarray), nex->nargs * 8L, (long)framesize);
+  na_outeralloc((void* *)(&ne_argarray), nex->nargs * 8L, (long)framesize);
   FORLIM = nex->nargs;
   for (i = 0; i < FORLIM; i++) {
     if (nex->UU.U15.fp->nargs == 0)
@@ -2548,7 +2536,7 @@ ne_nexrec *nex;
       case ne_string:
 	ne_seval(buf, nex->UU.U99.pvals[i]);
 /* p2c: numex.text, line 2215: Note: Call to NA_OUTERALLOC [502] */
-	na_outeralloc((Anyptr *)(&ne_argarray[i].U16.sp1), strlen(buf) + 1L,
+	na_outeralloc((void* *)(&ne_argarray[i].U16.sp1), strlen(buf) + 1L,
 		      (long)framesize);
 	strcpy(ne_argarray[i].U16.sp1, buf);
 	break;
@@ -2563,10 +2551,9 @@ ne_nexrec *nex;
 #undef framesize
 
 
-boolean ne_condeval(nex)
-ne_nexrec *nex;
+int ne_condeval(ne_nexrec *nex)
 {
-  boolean Result;
+  int Result = -1;
 
   TRY(try2);
     Result = (ne_ieval(nex) != 0);
@@ -2580,13 +2567,12 @@ ne_nexrec *nex;
 }
 
 
-long ne_ieval(nex)
-ne_nexrec *nex;
+long ne_ieval(ne_nexrec *nex)
 {
   long Result, i1;
   na_quadword *saveargarr;
   ne_nexrec *WITH;
-  Char STR1[256], STR2[256];
+  char STR1[256], STR2[256];
 
   WITH = nex;
   switch ((ne_opkind)nex->op) {
@@ -2626,11 +2612,11 @@ ne_nexrec *nex;
       ENDTRY(try3);
     } else {
       if (WITH->UU.U15.fp->UU.U5.ipr.link != NULL)
-	(*(Void(*) PP((ne_nexrec *nex, long *res, Anyptr _link)))
+	(*(void(*) (ne_nexrec *nex, long *res, void* _link))
 	  WITH->UU.U15.fp->UU.U5.ipr.proc)(nex, &i1,
 					   WITH->UU.U15.fp->UU.U5.ipr.link);
       else
-	(*(Void(*) PP((ne_nexrec *nex, long *res)))
+	(*(void(*) (ne_nexrec *nex, long *res))
 	  WITH->UU.U15.fp->UU.U5.ipr.proc)(nex, &i1);
       Result = i1;
     }
@@ -2849,8 +2835,7 @@ ne_nexrec *nex;
 }
 
 
-double ne_reval(nex)
-ne_nexrec *nex;
+double ne_reval(ne_nexrec *nex)
 {
   double Result, r1;
   na_quadword *saveargarr;
@@ -2900,11 +2885,11 @@ ne_nexrec *nex;
       ENDTRY(try7);
     } else {
       if (WITH->UU.U15.fp->UU.rpr.link != NULL)
-	(*(Void(*) PP((ne_nexrec *nex, double *res, Anyptr _link)))
+	(*(void(*) (ne_nexrec *nex, double *res, void* _link))
 	  WITH->UU.U15.fp->UU.rpr.proc)(nex, &r1,
 					WITH->UU.U15.fp->UU.rpr.link);
       else
-	(*(Void(*) PP((ne_nexrec *nex, double *res)))
+	(*(void(*) (ne_nexrec *nex, double *res))
 	  WITH->UU.U15.fp->UU.rpr.proc)(nex, &r1);
       Result = r1;
     }
@@ -2970,7 +2955,7 @@ ne_nexrec *nex;
     break;
 
   case ne_tan:
-    Result = ma_tan(ne_reval(WITH->UU.U10.p1));
+    Result = tan(ne_reval(WITH->UU.U10.p1));
     break;
 
   case ne_arctan:
@@ -3023,6 +3008,7 @@ ne_nexrec *nex;
     break;
 
   default:
+	Result  = 0;
     _Escape(-9);
     break;
   }
@@ -3030,14 +3016,14 @@ ne_nexrec *nex;
 }
 
 
-Char *ne_seval(Result, nex)
-Char *Result;
+char *ne_seval(Result, nex)
+char *Result;
 ne_nexrec *nex;
 {
-  Char s1[256];
+  char s1[256];
   na_quadword *saveargarr;
   ne_nexrec *WITH;
-  Char STR1[256], STR2[256];
+  char STR1[256], STR2[256];
 
   WITH = nex;
   switch ((ne_opkind)nex->op) {
@@ -3063,10 +3049,10 @@ ne_nexrec *nex;
       ENDTRY(try11);
     } else {
       if (WITH->UU.U15.fp->UU.spr.link != NULL)
-	(*(Void(*) PP((ne_nexrec *nex, Char *res, Anyptr _link)))
+	(*(void(*) (ne_nexrec *nex, char *res, void* _link))
 	  WITH->UU.U15.fp->UU.spr.proc)(nex, s1, WITH->UU.U15.fp->UU.spr.link);
       else
-	(*(Void(*) PP((ne_nexrec *nex, Char *res)))
+	(*(void(*) (ne_nexrec *nex, char *res))
 	  WITH->UU.U15.fp->UU.spr.proc)(nex, s1);
       strcpy(Result, s1);
     }
@@ -3141,10 +3127,10 @@ ne_nexrec *nex;
 
 
 
-Void ne_evaluate(nex, res)
+void ne_evaluate(nex, res)
 ne_nexrec *nex, *res;
 {
-  Char STR1[256];
+  char STR1[256];
 
   TRY(try14);
     switch ((int)types[nex->op]) {
@@ -3200,7 +3186,7 @@ ne_nexrec *nex, *res;
 
 
 
-Static Void faileval(nex, desc, esc)
+static void faileval(nex, desc, esc)
 ne_nexrec *nex;
 ne_desc *desc;
 long esc;
@@ -3259,8 +3245,8 @@ ne_desc *desc;
 }
 
 
-Char *ne_sevaluate(Result, nex, desc)
-Char *Result;
+char *ne_sevaluate(Result, nex, desc)
+char *Result;
 ne_nexrec *nex;
 ne_desc *desc;
 {
@@ -3274,7 +3260,7 @@ ne_desc *desc;
 
 
 long ne_ievalexpr(ex, desc)
-Char *ex;
+char *ex;
 ne_desc *desc;
 {
   long Result;
@@ -3295,7 +3281,7 @@ ne_desc *desc;
 
 
 double ne_revalexpr(ex, desc)
-Char *ex;
+char *ex;
 ne_desc *desc;
 {
   double Result;
@@ -3315,8 +3301,8 @@ ne_desc *desc;
 }
 
 
-Char *ne_sevalexpr(Result, ex, desc)
-Char *Result, *ex;
+char *ne_sevalexpr(Result, ex, desc)
+char *Result, *ex;
 ne_desc *desc;
 {
   ne_nexrec *nex;
@@ -3338,8 +3324,8 @@ ne_desc *desc;
 
 
 
-Void ne_makeintconst(sym, i)
-na_strlist *sym;
+void ne_makeintconst(sym, i)
+na_strlist_t *sym;
 long i;
 {
   sym->kind = ne_kind_intconst;
@@ -3347,8 +3333,8 @@ long i;
 }
 
 
-Void ne_makesrealconst(sym, r)
-na_strlist *sym;
+void ne_makesrealconst(sym, r)
+na_strlist_t *sym;
 double r;
 {
   sym->kind = ne_kind_srealconst;
@@ -3356,8 +3342,8 @@ double r;
 }
 
 
-Void ne_makerealconst(sym, r)
-na_strlist *sym;
+void ne_makerealconst(sym, r)
+na_strlist_t *sym;
 double r;
 {
   double *rp;
@@ -3365,67 +3351,67 @@ double r;
   sym->kind = ne_kind_realconst;
   rp = (double *)Malloc(sizeof(double));
   *rp = r;
-  sym->value = (Anyptr)rp;
+  sym->value = (void*)rp;
 }
 
 
-Void ne_makestrconst(sym, s)
-na_strlist *sym;
-Char *s;
+void ne_makestrconst(sym, s)
+na_strlist_t *sym;
+char *s;
 {
   sym->kind = ne_kind_strconst;
-  *(Char **)((Char **)(&sym->value)) = (char *)strdup(s);
+  *(char **)((char **)(&sym->value)) = (char *)strdup(s);
 }
 
 
-Void ne_makeintvar(sym, i)
-na_strlist *sym;
+void ne_makeintvar(sym, i)
+na_strlist_t *sym;
 long *i;
 {
   sym->kind = ne_kind_intptr;
-  sym->value = (Anyptr)i;
+  sym->value = (void*)i;
 }
 
 
-Void ne_makerealvar(sym, r)
-na_strlist *sym;
+void ne_makerealvar(sym, r)
+na_strlist_t *sym;
 double *r;
 {
   sym->kind = ne_kind_realptr;
-  sym->value = (Anyptr)r;
+  sym->value = (void*)r;
 }
 
 
-Void ne_makerealxvar(sym, r)
-na_strlist *sym;
+void ne_makerealxvar(sym, r)
+na_strlist_t *sym;
 double *r;
 {
   sym->kind = ne_kind_realxptr;
-  sym->value = (Anyptr)r;
+  sym->value = (void*)r;
 }
 
 
-Void ne_makestrvar(sym, s)
-na_strlist *sym;
-Char *s;
+void ne_makestrvar(sym, s)
+na_strlist_t *sym;
+char *s;
 {
   sym->kind = ne_kind_strvalue;
-  sym->value = (Anyptr)s;
+  sym->value = (void*)s;
 }
 
 
-Void ne_makestrptrvar(sym, sp)
-na_strlist *sym;
-Char **sp;
+void ne_makestrptrvar(sym, sp)
+na_strlist_t *sym;
+char **sp;
 {
   sym->kind = ne_kind_strptr;
-  sym->value = (Anyptr)sp;
+  sym->value = (void*)sp;
 }
 
 
 
-Static Void setupfunc(sym, fp, nargs, args)
-na_strlist *sym;
+static void setupfunc(sym, fp, nargs, args)
+na_strlist_t *sym;
 ne_functionrec **fp;
 long nargs;
 ne_datatype *args;
@@ -3443,12 +3429,12 @@ ne_datatype *args;
   (*fp)->static_ = false;
   (*fp)->minargs = nargs;
   (*fp)->maxargs = nargs;
-  sym->value = (Anyptr)(*fp);
+  sym->value = (void*)(*fp);
 }
 
 
-Void ne_makeintmfunc(sym, nargs, args, pr)
-na_strlist *sym;
+void ne_makeintmfunc(sym, nargs, args, pr)
+na_strlist_t *sym;
 long nargs;
 ne_datatype *args;
 _PROCEDURE pr;
@@ -3462,8 +3448,8 @@ _PROCEDURE pr;
 }
 
 
-Void ne_makerealmfunc(sym, nargs, args, pr)
-na_strlist *sym;
+void ne_makerealmfunc(sym, nargs, args, pr)
+na_strlist_t *sym;
 long nargs;
 ne_datatype *args;
 _PROCEDURE pr;
@@ -3477,8 +3463,8 @@ _PROCEDURE pr;
 }
 
 
-Void ne_makestrmfunc(sym, nargs, args, pr)
-na_strlist *sym;
+void ne_makestrmfunc(sym, nargs, args, pr)
+na_strlist_t *sym;
 long nargs;
 ne_datatype *args;
 _PROCEDURE pr;
@@ -3492,8 +3478,8 @@ _PROCEDURE pr;
 }
 
 
-Void ne_makeintfunc(sym, t1, t2, t3, pr)
-na_strlist *sym;
+void ne_makeintfunc(sym, t1, t2, t3, pr)
+na_strlist_t *sym;
 ne_datatype t1, t2, t3;
 _PROCEDURE pr;
 {
@@ -3508,8 +3494,8 @@ _PROCEDURE pr;
 }
 
 
-Void ne_makerealfunc(sym, t1, t2, t3, pr)
-na_strlist *sym;
+void ne_makerealfunc(sym, t1, t2, t3, pr)
+na_strlist_t *sym;
 ne_datatype t1, t2, t3;
 _PROCEDURE pr;
 {
@@ -3524,8 +3510,8 @@ _PROCEDURE pr;
 }
 
 
-Void ne_makestrfunc(sym, t1, t2, t3, pr)
-na_strlist *sym;
+void ne_makestrfunc(sym, t1, t2, t3, pr)
+na_strlist_t *sym;
 ne_datatype t1, t2, t3;
 _PROCEDURE pr;
 {
@@ -3540,8 +3526,8 @@ _PROCEDURE pr;
 }
 
 
-Void ne_makeintsfunc(sym, nargs, args, nex)
-na_strlist *sym;
+void ne_makeintsfunc(sym, nargs, args, nex)
+na_strlist_t *sym;
 long nargs;
 ne_datatype *args;
 ne_nexrec **nex;
@@ -3555,8 +3541,8 @@ ne_nexrec **nex;
 }
 
 
-Void ne_makerealsfunc(sym, nargs, args, nex)
-na_strlist *sym;
+void ne_makerealsfunc(sym, nargs, args, nex)
+na_strlist_t *sym;
 long nargs;
 ne_datatype *args;
 ne_nexrec **nex;
@@ -3570,8 +3556,8 @@ ne_nexrec **nex;
 }
 
 
-Void ne_makestrsfunc(sym, nargs, args, nex)
-na_strlist *sym;
+void ne_makestrsfunc(sym, nargs, args, nex)
+na_strlist_t *sym;
 long nargs;
 ne_datatype *args;
 ne_nexrec **nex;
@@ -3585,8 +3571,8 @@ ne_nexrec **nex;
 }
 
 
-Void ne_makeintarg(sym, i)
-na_strlist *sym;
+void ne_makeintarg(sym, i)
+na_strlist_t *sym;
 long i;
 {
   sym->kind = ne_kind_intarg;
@@ -3594,8 +3580,8 @@ long i;
 }
 
 
-Void ne_makerealarg(sym, i)
-na_strlist *sym;
+void ne_makerealarg(sym, i)
+na_strlist_t *sym;
 long i;
 {
   sym->kind = ne_kind_realarg;
@@ -3603,8 +3589,8 @@ long i;
 }
 
 
-Void ne_makestrarg(sym, i)
-na_strlist *sym;
+void ne_makestrarg(sym, i)
+na_strlist_t *sym;
 long i;
 {
   sym->kind = ne_kind_strarg;
@@ -3613,8 +3599,8 @@ long i;
 
 
 
-Void ne_setminargs(sym, minargs)
-na_strlist *sym;
+void ne_setminargs(sym, minargs)
+na_strlist_t *sym;
 long minargs;
 {
   ne_functionrec *fp;
@@ -3624,8 +3610,8 @@ long minargs;
 }
 
 
-Void ne_setmaxargs(sym, maxargs)
-na_strlist *sym;
+void ne_setmaxargs(sym, maxargs)
+na_strlist_t *sym;
 long maxargs;
 {
   ne_functionrec *fp;
@@ -3635,8 +3621,8 @@ long maxargs;
 }
 
 
-Void ne_makestaticfunc(sym)
-na_strlist *sym;
+void ne_makestaticfunc(sym)
+na_strlist_t *sym;
 {
   ne_functionrec *fp;
 
@@ -3646,8 +3632,8 @@ na_strlist *sym;
 
 
 
-Void ne_disposesym(sym)
-na_strlist *sym;
+void ne_disposesym(sym)
+na_strlist_t *sym;
 {
   double *rp;
   ne_functionrec *fp;
@@ -3673,10 +3659,10 @@ na_strlist *sym;
 }
 
 
-Void ne_disposesymtab(symtab)
-na_strlist **symtab;
+void ne_disposesymtab(symtab)
+na_strlist_t **symtab;
 {
-  na_strlist *l1;
+  na_strlist_t *l1;
 
   l1 = *symtab;
   while (l1 != NULL) {
diff --git a/psys/src/p2clib.c b/psys/src/p2clib.c
index 0741d71..be49105 100644
--- a/psys/src/p2clib.c
+++ b/psys/src/p2clib.c
@@ -7,7 +7,6 @@
  */
 
 
-
 #ifndef NO_TIME
 # include <time.h>
 # ifdef aux
@@ -30,7 +29,7 @@ int bigendian;
 
 long EXCP_LINE;    /* Used by Pascal workstation system */
 
-Anyptr __MallocTemp__;
+void* __MallocTemp__;
 
 __p2c_jmp_buf *__top_jb;
 
@@ -47,9 +46,7 @@ int isbigendian()
 }
 
 
-void PASCAL_MAIN(argc, argv)
-int argc;
-char **argv;
+void PASCAL_MAIN(int argc, char **argv)
 {
     P_argc = argc;
     P_argv = argv;
@@ -61,93 +58,31 @@ char **argv;
 #endif
 }
 
-
-
-#ifdef LACK_LABS
-
-/* In case your system lacks these... */
-
-long labs(x)
-long x;
-{
-    return((x > 0) ? x : -x);
-}
-
-#endif
-
-#if (!defined(solaris) && !defined(__MACHTEN__))
-
-#ifdef LACK_MEMMOVE
-
-#if defined(__STDC__) || defined(OS2)
-Anyptr memmove(Anyptr d, Constptr s, size_t n)
-#else
-Anyptr memmove(d, s, n)
-Anyptr d, s;
-register long n;
-#endif
-{
-    if (d < s || d - s >= n) {
-	memcpy(d, s, n);
-	return d;
-    } else if (n > 0) {
-	register char *dd = d + n, *ss = s + n;
-	while (--n >= 0)
-	    *--dd = *--ss;
-    }
-    return d;
-}
-
-#endif
-#endif
-
-int my_toupper(int c)
-
-{
-    if (islower(c))
-	return _toupper(c);
-    else
-	return c;
-}
-
-
-int my_tolower(int c)
-
-{
-    if (isupper(c))
-	return _tolower(c);
-    else
-	return c;
-}
-
-
-
-
-long ipow(a, b)
-long a, b;
+long ipow(long a, long b)
 {
     long v;
 
     if (a == 0 || a == 1)
-	return a;
+		return a;
+
     if (a == -1)
-	return (b & 1) ? -1 : 1;
+		return (b & 1) ? -1 : 1;
+
     if (b < 0)
-	return 0;
+		return 0;
+
     if (a == 2)
-	return 1 << b;
-    v = (b & 1) ? a : 1;
-    while ((b >>= 1) > 0) {
-	a *= a;
-	if (b & 1)
-	    v *= a;
-    }
+		return 1 << b;
+    
+	v = (b & 1) ? a : 1;
+	while ((b >>= 1) > 0) {
+		a *= a;
+		if (b & 1)
+		    v *= a;
+	}
     return v;
 }
 
-
-
-
 /* Common string functions: */
 
 /* Store in "ret" the substring of length "len" starting from "pos" (1-based).
@@ -207,30 +142,6 @@ register int pos;
 }
 
 
-/* Case-insensitive version of strcmp. */
-
-int strcicmp(char * s1, char * s2)
-{
-    register unsigned char c1, c2;
-
-    while (*s1) {
-	if (*s1++ != *s2++) {
-	    if (!s2[-1])
-		return 1;
-	    c1 = toupper(s1[-1]);
-	    c2 = toupper(s2[-1]);
-	    if (c1 != c2)
-		return c1 - c2;
-	}
-    }
-    if (*s2)
-	return -1;
-    return 0;
-}
-
-
-
-
 /* HP and Turbo Pascal string functions: */
 
 /* Trim blanks at left end of string. */
@@ -242,7 +153,6 @@ register char *s;
     return s - 1;
 }
 
-
 /* Trim blanks at right end of string. */
 
 char *strrtrim(s)
@@ -260,7 +170,6 @@ register char *s;
 
 
 /* Store in "ret" "num" copies of string "s".  Return "ret". */
-
 char *strrpt(ret, s, num)
 char *ret;
 register char *s;
@@ -279,7 +188,6 @@ register int num;
 
 
 /* Store in "ret" string "s" with enough pad chars added to reach "size". */
-
 char *strpad(ret, s, padchar, num)
 char *ret;
 register char *s;
@@ -368,9 +276,6 @@ register int pos;
         *dst++ = *src++;
 }
 
-
-
-
 /* File functions */
 
 /* Peek at next character of input stream; return EOF at end-of-file. */
@@ -426,7 +331,7 @@ FILE *f;
 
 /* Read a packed array of characters from a file. */
 
-Void P_readpaoc(f, s, len)
+void P_readpaoc(f, s, len)
 FILE *f;
 char *s;
 int len;
@@ -448,7 +353,7 @@ int len;
 	ungetc(ch, f);
 }
 
-Void P_readlnpaoc(f, s, len)
+void P_readlnpaoc(f, s, len)
 FILE *f;
 char *s;
 int len;
@@ -488,12 +393,12 @@ FILE *f;
 
 /* Use packed array of char for a file name. */
 
-Char *P_trimname(fn, len)
-register Char *fn;
+char *P_trimname(fn, len)
+register char *fn;
 register int len;
 {
-    static Char fnbuf[256];
-    register Char *cp = fnbuf;
+    static char fnbuf[256];
+    register char *cp = fnbuf;
     
     while (--len >= 0 && *fn && !isspace(*fn))
 	*cp++ = *fn++;
@@ -503,7 +408,6 @@ register int len;
 
 
 
-
 /* Pascal's "memavail" doesn't make much sense in Unix with virtual memory.
    We fix memory size as 10Meg as a reasonable compromise. */
 
@@ -517,9 +421,6 @@ long maxavail()
     return memavail();
 }
 
-
-
-
 /* Sets are stored as an array of longs.  S[0] is the size of the set;
    S[N] is the N'th 32-bit chunk of the set.  S[0] equals the maximum
    I such that S[I] is nonzero.  S[0] is zero for an empty set.  Within
@@ -670,7 +571,7 @@ register unsigned val;
     register int bit;
     bit = val % SETBITS;
     val /= SETBITS;
-    if (++val <= *s) {
+    if ((long)++val <= *s) {
 	if (!(s[val] &= ~(1<<bit)))
 	    while (*s && !s[*s])
 		(*s)--;
@@ -748,15 +649,11 @@ register long *s;
         return 0;
 }
 
-
-
-
-
 /* Oregon Software Pascal extensions, courtesy of William Bader */
 
 int P_getcmdline(l, h, line)
 int l, h;
-Char *line;
+char *line;
 {
     int i, len;
     char *s;
@@ -775,7 +672,7 @@ Char *line;
     return len;
 }
 
-Void TimeStamp(Day, Month, Year, Hour, Min, Sec)
+void TimeStamp(Day, Month, Year, Hour, Min, Sec)
 int *Day, *Month, *Year, *Hour, *Min, *Sec;
 {
 #ifndef NO_TIME
@@ -795,18 +692,15 @@ int *Day, *Month, *Year, *Hour, *Min, *Sec;
 #endif
 }
 
-
-
-
 /* SUN Berkeley Pascal extensions */
 
-Void P_sun_argv(s, len, n)
+void P_sun_argv(s, len, n)
 register char *s;
 register int len, n;
 {
     register char *cp;
 
-    if ((unsigned)n < P_argc)
+    if (n < P_argc)
 	cp = P_argv[n];
     else
 	cp = "";
@@ -817,8 +711,6 @@ register int len, n;
 }
 
 
-
-
 int _OutMem()
 {
     return _Escape(-2);
@@ -834,10 +726,6 @@ int _NilCheck()
     return _Escape(-3);
 }
 
-
-
-
-
 /* The following is suitable for the HP Pascal operating system.
    It might want to be revised when emulating another system. */
 
@@ -927,8 +815,7 @@ int code, ior;
 }
 
 
-int _Escape(code)
-int code;
+int _Escape(int code)
 {
     char buf[100];
 
@@ -953,29 +840,10 @@ int code;
     return _Escape(-10);
 }
 
-/* the following functions were contributed by Marwan Jabri for Ultrix port */
-/* added Sun Jul 26 14:43:44 PDT 1992 */
-
 #ifndef NULL
 #define NULL 0
 #endif
 
-#ifdef ultrix
-char *strdup(s)
-char *s;
-{
-    char *s1;
-
-    if (s == (char *) NULL) return (char *) NULL;
-    if ((s1 = (char *) malloc(strlen(s) + 1)) == (char *) NULL) {
-        perror("out of memory");
-        exit(1);
-    }
-    strcpy(s1, s);
-    return s1;
-}
-#endif
-
 char *GetChipmunkPath(ev, deft)
 char *ev, *deft;
 {
@@ -1076,8 +944,4 @@ long usec;                     /* delay in microseconds */
 
 #endif
 
-
 /* End. */
-
-
-
diff --git a/psys/src/plot.c b/psys/src/plot.c
index 56842bc..8c0a568 100644
--- a/psys/src/plot.c
+++ b/psys/src/plot.c
@@ -90,7 +90,7 @@
 
 
 
-typedef Char pac8[8];
+typedef char pac8[8];
 
 
 typedef enum {
@@ -99,9 +99,9 @@ typedef enum {
 
 typedef struct point {
   unsigned circ : 1;
-  Signed int px : 7;
+  signed int px : 7;
   unsigned drw : 1;
-  Signed int py : 7;
+  signed int py : 7;
 } point;
 
 typedef point ptarr[1000000L];
@@ -127,7 +127,7 @@ typedef union swap4 {
 } swap4;
 
 
-Local short getshortsw(c)
+static short getshortsw(c)
   char *c;
   {
     swap2 s;
@@ -146,7 +146,7 @@ Local short getshortsw(c)
      return s.ival;
 }
 
-Local long getintsw(c)
+static long getintsw(c)
 char *c;
 {
     swap4 s;
@@ -170,32 +170,32 @@ char *c;
 }
 
 
-Static short w1x, w1y, w2x, w2y, pp1x, pp1y, pp2x, pp2y, p1x, p1y, p2x, p2y,
+static short w1x, w1y, w2x, w2y, pp1x, pp1y, pp2x, pp2y, p1x, p1y, p2x, p2y,
 	     pltc, pltcolr, pltpat, plotter;
-Static long csnum, csden, csn, csnxx, csnxy, csnyx, csnyy, sbo, spo, sod,
+static long csnum, csden, csn, csnxx, csnxy, csnyx, csnyy, sbo, spo, sod,
 	    csns, csnc, csah, csav, csad, csd, csdsc, cssc, cscsc, orgx,
             orgy, pltx, plty, xpos, ypos, sc;
-Static long b1x, b1y, b2x, b2y;
-Static double csth;
-Static boolean quality, fast, rotate, fancy, pendn, spendn, hasellipse;
-Static Char prefchar[11], ctrlchars[11], ctrllchars[11];
-Static outmodekind outmode;
+static long b1x, b1y, b2x, b2y;
+static double csth;
+static int quality, fast, rotate, fancy, pendn, spendn, hasellipse;
+static char prefchar[11], ctrlchars[11], ctrllchars[11];
+static outmodekind outmode;
 
-Static long ps_curx, ps_cury, ps_curstyle, ps_veccount;
-Static boolean ps_flag, ps_needinit;
-Static Char *ff_title;
+static long ps_curx, ps_cury, ps_curstyle, ps_veccount;
+static int ps_flag, ps_needinit;
+static char *ff_title;
 
-Static _PROCEDURE proc;
-Static plot_devrec rec;
+static _PROCEDURE proc;
+static plot_devrec rec;
 
-Static chardesc **ix;
-Static plot_fontrec *curft;
-Static long loadft[9];
-Static Char fontfn[256], headerfn[256]=PSLIB"/texstuff.ps";
-Static boolean headerincflag;
-Static FILE **outf, **foutf;
-Static boolean foutfopen;
-Static double ps_linewidth = 7.0;
+static chardesc **ix;
+static plot_fontrec *curft;
+static long loadft[9];
+static char fontfn[256], headerfn[256]=PSLIB"/texstuff.ps";
+static int headerincflag;
+static FILE **outf, **foutf;
+static int foutfopen;
+static double ps_linewidth = 7.0;
 
 
 /*$if false$
@@ -204,13 +204,13 @@ procedure graphics_crt_zlptn(c1, c2 : char; n : shortint);
 $end$*/
 
 
-Static Void copyfile(fn)
-Char *fn;
+static void copyfile(fn)
+char *fn;
 {
   FILE *f;
-  Char buf[256];
-  boolean okay;
-  Char *TEMP;
+  char buf[256];
+  int okay;
+  char *TEMP;
 
   f = NULL;
   TRY(try1);
@@ -244,10 +244,10 @@ Char *fn;
 }
 
 
-Void plot_out(s)
-Char *s;
+void plot_out(s)
+char *s;
 {
-  Char STR1[256];
+  char STR1[256];
 
   if (outf == NULL) {
     if (outmode == out_hpgl)
@@ -262,8 +262,8 @@ Char *s;
 
 
 
-Void plot_in(s)
-Char *s;
+void plot_in(s)
+char *s;
 {
 }
 
@@ -271,10 +271,10 @@ Char *s;
 
 
 
-Static Void hpgl_proc(rec)
+static void hpgl_proc(rec)
 plot_devrec *rec;
 {
-  Char s[256];
+  char s[256];
   long i;
 
   switch (rec->act) {
@@ -431,13 +431,13 @@ plot_devrec *rec;
 /* Local variables for ps_proc: */
 struct LOC_ps_proc {
 
-  Char s[256];
+  char s[256];
 } ;
 
-Local Void init(LINK)
+static void init(LINK)
 struct LOC_ps_proc *LINK;
 {
-  Char STR1[256], STR3[256];
+  char STR1[256], STR3[256];
 
   plot_out("save");
   sprintf(STR1, "%% $ Include %s", headerfn);
@@ -489,7 +489,7 @@ struct LOC_ps_proc *LINK;
   ps_needinit = false;
 }
 
-Local Void dostroke(LINK)
+static void dostroke(LINK)
 struct LOC_ps_proc *LINK;
 {
   if (ps_needinit)
@@ -500,7 +500,7 @@ struct LOC_ps_proc *LINK;
   ps_flag = true;
 }
 
-Local Void writecoord(x, LINK)
+static void writecoord(x, LINK)
 long x;
 struct LOC_ps_proc *LINK;
 {
@@ -508,7 +508,7 @@ struct LOC_ps_proc *LINK;
   strcat(LINK->s, " ");
 }
 
-Local Void writereal(x, LINK)
+static void writereal(x, LINK)
 double x;
 struct LOC_ps_proc *LINK;
 {
@@ -525,22 +525,22 @@ struct LOC_ps_proc *LINK;
 /* Local variables for showstring: */
 struct LOC_showstring {
   struct LOC_ps_proc *LINK;
-  Char msg[256];
-  boolean hassubscr;
+  char msg[256];
+  int hassubscr;
 } ;
 
 /* Local variables for showstr: */
 struct LOC_showstr {
   struct LOC_showstring *LINK;
-  boolean showit;
+  int showit;
   long where;
-  Char buf[256];
+  char buf[256];
 } ;
 
-Local Void dumpbuf(LINK)
+static void dumpbuf(LINK)
 struct LOC_showstr *LINK;
 {
-  Char STR1[256];
+  char STR1[256];
 
   if (*LINK->buf == '\0')
     return;
@@ -574,8 +574,8 @@ struct LOC_showstr *LINK;
   *LINK->buf = '\0';
 }
 
-Local Void showstr(showit_, LINK)
-boolean showit_;
+static void showstr(showit_, LINK)
+int showit_;
 struct LOC_showstring *LINK;
 {
   /*cheap subset of $ formats*/
@@ -628,8 +628,8 @@ struct LOC_showstring *LINK;
   dumpbuf(&V);
 }
 
-Local Void showstring(msg_, x, y, mode, font, num, den, sc, theta, LINK)
-Char *msg_;
+static void showstring(msg_, x, y, mode, font, num, den, sc, theta, LINK)
+char *msg_;
 long x, y, mode, font, num, den, sc;
 double theta;
 struct LOC_ps_proc *LINK;
@@ -730,7 +730,7 @@ struct LOC_ps_proc *LINK;
 
 
 
-Static Void ps_proc(rec)
+static void ps_proc(rec)
 plot_devrec *rec;
 {
   struct LOC_ps_proc V;
@@ -896,15 +896,15 @@ plot_devrec *rec;
 
 /* Local variables for ff_proc: */
 struct LOC_ff_proc {
-  Char s[256];
+  char s[256];
 } ;
 
-Local Void dofigs(col, c1, c2, c3)
+static void dofigs(col, c1, c2, c3)
 long col;
-Char c1, c2, c3;
+char c1, c2, c3;
 {
-  Char STR1[12];
-  Char STR2[256];
+  char STR1[12];
+  char STR2[256];
 
   sprintf(STR1, "F ``%c` [](", c1);
   plot_out(STR1);
@@ -926,10 +926,10 @@ Char c1, c2, c3;
   plot_out(")");
 }
 
-Local Void init_(LINK)
+static void init_(LINK)
 struct LOC_ff_proc *LINK;
 {
-  Char STR2[256];
+  char STR2[256];
 
   dofigs(2L, 'A', 'C', 'E');
   dofigs(5L, 'B', 'D', 'F');
@@ -938,7 +938,7 @@ struct LOC_ff_proc *LINK;
   ps_needinit = false;
 }
 
-Local Void dostroke_(LINK)
+static void dostroke_(LINK)
 struct LOC_ff_proc *LINK;
 {
   if (ps_needinit)
@@ -948,7 +948,7 @@ struct LOC_ff_proc *LINK;
   ps_flag = true;
 }
 
-Local Void writecoord_(x, LINK)
+static void writecoord_(x, LINK)
 long x;
 struct LOC_ff_proc *LINK;
 {
@@ -956,18 +956,18 @@ struct LOC_ff_proc *LINK;
   strcat(LINK->s, " ");
 }
 
-Local Void writereal_(x, LINK)
+static void writereal_(x, LINK)
 double x;
 struct LOC_ff_proc *LINK;
 {
   writecoord_((long)floor(x + 0.5), LINK);
 }
 
-Local Void writestr(s1, LINK)
-Char *s1;
+static void writestr(s1, LINK)
+char *s1;
 struct LOC_ff_proc *LINK;
 {
-  Char ch;
+  char ch;
 
   ch = '`';
   while (strposc(s1, ch, 1L) != 0)
@@ -979,18 +979,18 @@ struct LOC_ff_proc *LINK;
 
 
 
-Static Void ff_proc(rec)
+static void ff_proc(rec)
 plot_devrec *rec;
 {
   struct LOC_ff_proc V;
-  Char STR1[256];
+  char STR1[256];
 
   switch (rec->act) {
 
   case plot_act_init:
     ps_needinit = true;
     ps_flag = true;
-    ff_title = (Char *)Malloc(256);
+    ff_title = (char *)Malloc(256);
     strcpy(ff_title, "UNTITLED");
     break;
 
@@ -1146,7 +1146,7 @@ $end$*/
 
 
 
-Static Void graphics_proc(rec)
+static void graphics_proc(rec)
 plot_devrec *rec;
 {
   long i;
@@ -1245,8 +1245,8 @@ plot_devrec *rec;
 
 
 
-Static Void ucase(s)
-Char *s;
+static void ucase(s)
+char *s;
 {
   long i, FORLIM;
 
@@ -1259,8 +1259,8 @@ Char *s;
 
 
 
-Static Void lcase(s)
-Char *s;
+static void lcase(s)
+char *s;
 {
   long i, FORLIM;
 
@@ -1273,7 +1273,7 @@ Char *s;
 
 
 
-Static Void init__()
+static void init__()
 {
   char STR1[256];
   curft = NULL;
@@ -1324,8 +1324,8 @@ Static Void init__()
 
 
 
-Static Void setsize(sizecode)
-Char sizecode;
+static void setsize(sizecode)
+char sizecode;
 {
   switch (sizecode) {
 
@@ -1359,7 +1359,7 @@ Char sizecode;
 
 
 
-Void plot_p1p2(x1, y1, x2, y2)
+void plot_p1p2(x1, y1, x2, y2)
 long x1, y1, x2, y2;
 {
   pp1x = x1;
@@ -1371,10 +1371,10 @@ long x1, y1, x2, y2;
 
 
 
-Void plot_figtitle(title_)
-Char *title_;
+void plot_figtitle(title_)
+char *title_;
 {
-  Char title[256];
+  char title[256];
   long i;
 
   strcpy(title, title_);
@@ -1399,17 +1399,17 @@ Char *title_;
 
 
 
-Void plot_init(addr, sizecode)
+void plot_init(addr, sizecode)
 long addr;
-Char sizecode;
+char sizecode;
 {
   long i;
-  Char s[256];
-  Char ch;
-  boolean exists;
+  char s[256];
+  char ch;
+  int exists;
 
-  proc.proc = (Anyptr)hpgl_proc;
-  proc.link = (Anyptr)NULL;
+  proc.proc = (void*)hpgl_proc;
+  proc.link = (void*)NULL;
   outmode = out_hpgl;
   outf = NULL;
   if (addr == 0)
@@ -1447,7 +1447,7 @@ Char sizecode;
 
 
 
-Void plot_init_fast()
+void plot_init_fast()
 {
   plot_init(0L, 'X');
   plot_initfonts();
@@ -1458,13 +1458,13 @@ Void plot_init_fast()
 
 
 
-Void plot_warminitscreen(x1, y1, x2, y2)
+void plot_warminitscreen(x1, y1, x2, y2)
 long x1, y1, x2, y2;
 {
   long i;
 
-  proc.proc = (Anyptr)graphics_proc;
-  proc.link = (Anyptr)NULL;
+  proc.proc = (void*)graphics_proc;
+  proc.link = (void*)NULL;
   outmode = out_normal;
   outf = NULL;
   pp1x = x1;
@@ -1489,7 +1489,7 @@ $end$*/
 
 
 
-Void plot_initscreen(x1, y1, x2, y2)
+void plot_initscreen(x1, y1, x2, y2)
 long x1, y1, x2, y2;
 {
   /*$if false$
@@ -1506,7 +1506,7 @@ $end$*/
 }
 
 
-Void plot_initscreen_fast()
+void plot_initscreen_fast()
 {
   plot_initscreen(0L, 0L, 0L, 0L);
   plot_initfonts();
@@ -1516,11 +1516,11 @@ Void plot_initscreen_fast()
 
 
 
-Void plot_initps(f)
+void plot_initps(f)
 FILE **f;
 {
-  proc.proc = (Anyptr)ps_proc;
-  proc.link = (Anyptr)NULL;
+  proc.proc = (void*)ps_proc;
+  proc.link = (void*)NULL;
   outmode = out_ps;
   plotter = 0;
   plot_p1p2(ps_fudge, ps_fudge, ps_maxx - ps_fudge, ps_maxy - ps_fudge);
@@ -1529,9 +1529,9 @@ FILE **f;
   fancy = false;
   rec.act = plot_act_init;
   if (proc.link != NULL)
-    (*(Void(*) PP((plot_devrec *rec, Anyptr _link)))proc.proc)(&rec, proc.link);
+    (*(void(*) (plot_devrec *rec, void* _link))proc.proc)(&rec, proc.link);
   else
-    (*(Void(*) PP((plot_devrec *rec)))proc.proc)(&rec);
+    (*(void(*) (plot_devrec *rec))proc.proc)(&rec);
   hasellipse = true;
 }
 
@@ -1540,11 +1540,11 @@ FILE **f;
 
 
 
-Void plot_initff(f)
+void plot_initff(f)
 FILE **f;
 {
-  proc.proc = (Anyptr)ff_proc;
-  proc.link = (Anyptr)NULL;
+  proc.proc = (void*)ff_proc;
+  proc.link = (void*)NULL;
   outmode = out_ff;
   plotter = 0;
   plot_p1p2((long)(-maxz), (long)(-maxz), (long)maxz, (long)maxz);
@@ -1554,9 +1554,9 @@ FILE **f;
   fancy = false;
   rec.act = plot_act_init;
   if (proc.link != NULL)
-    (*(Void(*) PP((plot_devrec *rec, Anyptr _link)))proc.proc)(&rec, proc.link);
+    (*(void(*) (plot_devrec *rec, void* _link))proc.proc)(&rec, proc.link);
   else
-    (*(Void(*) PP((plot_devrec *rec)))proc.proc)(&rec);
+    (*(void(*) (plot_devrec *rec))proc.proc)(&rec);
   hasellipse = true;
 }
 
@@ -1564,13 +1564,13 @@ FILE **f;
 
 
 
-Void plot_initfile(f, sizecode, hascircles)
+void plot_initfile(f, sizecode, hascircles)
 FILE **f;
-Char sizecode;
-boolean hascircles;
+char sizecode;
+int hascircles;
 {
-  proc.proc = (Anyptr)hpgl_proc;
-  proc.link = (Anyptr)NULL;
+  proc.proc = (void*)hpgl_proc;
+  proc.link = (void*)NULL;
   outmode = out_hpgl;
   plotter = 0;
   if (sizecode == 'x' || sizecode == 'X') {
@@ -1585,10 +1585,10 @@ boolean hascircles;
 }
 
 
-Void plot_initgen(fn_)
-Char *fn_;
+void plot_initgen(fn_)
+char *fn_;
 {
-  Char fn[256];
+  char fn[256];
 
   strcpy(fn, fn_);
   foutf = (FILE **)Malloc(sizeof(FILE *));
@@ -1611,8 +1611,8 @@ Char *fn_;
 }
 
 
-Void plot_initgen_fast(fn)
-Char *fn;
+void plot_initgen_fast(fn)
+char *fn;
 {
   plot_initgen(fn);
   plot_initfonts();
@@ -1620,10 +1620,10 @@ Char *fn;
 }
 
 
-Void plot_initfile_fast(fn_)
-Char *fn_;
+void plot_initfile_fast(fn_)
+char *fn_;
 {
-  Char fn[256];
+  char fn[256];
 
   strcpy(fn, fn_);
   if (*fn == '\0')
@@ -1633,10 +1633,10 @@ Char *fn_;
 }
 
 
-Void plot_initps_fast(fn_)
-Char *fn_;
+void plot_initps_fast(fn_)
+char *fn_;
 {
-  Char fn[256];
+  char fn[256];
 
   strcpy(fn, fn_);
   if (*fn == '\0') {
@@ -1650,7 +1650,7 @@ Char *fn_;
 
 
 
-Void plot_inituser(devproc)
+void plot_inituser(devproc)
 _PROCEDURE devproc;
 {
   proc = devproc;
@@ -1660,9 +1660,9 @@ _PROCEDURE devproc;
   rec.q1.U1.i2 = 0;
   rec.act = plot_act_init;
   if (proc.link != NULL)
-    (*(Void(*) PP((plot_devrec *rec, Anyptr _link)))proc.proc)(&rec, proc.link);
+    (*(void(*) (plot_devrec *rec, void* _link))proc.proc)(&rec, proc.link);
   else
-    (*(Void(*) PP((plot_devrec *rec)))proc.proc)(&rec);
+    (*(void(*) (plot_devrec *rec))proc.proc)(&rec);
   pp1x = rec.x1;
   pp1y = rec.y1;
   pp2x = rec.x2;
@@ -1673,9 +1673,9 @@ _PROCEDURE devproc;
 
 
 
-Static Void window_(x1, y1, x2, y2, rot)
+static void window_(x1, y1, x2, y2, rot)
 long x1, y1, x2, y2;
-boolean rot;
+int rot;
 {
   long sc1, i;
   short tx;
@@ -1728,7 +1728,7 @@ boolean rot;
 
 
 
-Void plot_window(x1, y1, x2, y2)
+void plot_window(x1, y1, x2, y2)
 long x1, y1, x2, y2;
 {
   window_(x1, y1, x2, y2, labs(x2 - x1) < labs(y2 - y1));
@@ -1736,7 +1736,7 @@ long x1, y1, x2, y2;
 
 
 
-Void plot_nrwindow(x1, y1, x2, y2)
+void plot_nrwindow(x1, y1, x2, y2)
 long x1, y1, x2, y2;
 {
   window_(x1, y1, x2, y2, false);
@@ -1744,7 +1744,7 @@ long x1, y1, x2, y2;
 
 
 
-Void plot_pwindow(x1, y1, x2, y2)
+void plot_pwindow(x1, y1, x2, y2)
 long x1, y1, x2, y2;
 {
   window_(x1, y1, x2, y2, pp2x - pp1x >= pp2y - pp1y);
@@ -1752,7 +1752,7 @@ long x1, y1, x2, y2;
 
 
 
-Void plot_lwindow(x1, y1, x2, y2)
+void plot_lwindow(x1, y1, x2, y2)
 long x1, y1, x2, y2;
 {
   window_(x1, y1, x2, y2, pp2x - pp1x < pp2y - pp1y);
@@ -1761,7 +1761,7 @@ long x1, y1, x2, y2;
 
 
 
-Void plot_getwindow(x1, y1, x2, y2)
+void plot_getwindow(x1, y1, x2, y2)
 long *x1, *y1, *x2, *y2;
 {
   *x1 = w1x;
@@ -1772,37 +1772,37 @@ long *x1, *y1, *x2, *y2;
 
 
 
-Void plot_quality()
+void plot_quality()
 {
   quality = true;
   rec.act = plot_act_quality;
   if (proc.link != NULL)
-    (*(Void(*) PP((plot_devrec *rec, Anyptr _link)))proc.proc)(&rec, proc.link);
+    (*(void(*) (plot_devrec *rec, void* _link))proc.proc)(&rec, proc.link);
   else
-    (*(Void(*) PP((plot_devrec *rec)))proc.proc)(&rec);
+    (*(void(*) (plot_devrec *rec))proc.proc)(&rec);
 }
 
 
 
-Void plot_fast()
+void plot_fast()
 {
   fast = true;
   rec.act = plot_act_fast;
   if (proc.link != NULL)
-    (*(Void(*) PP((plot_devrec *rec, Anyptr _link)))proc.proc)(&rec, proc.link);
+    (*(void(*) (plot_devrec *rec, void* _link))proc.proc)(&rec, proc.link);
   else
-    (*(Void(*) PP((plot_devrec *rec)))proc.proc)(&rec);
+    (*(void(*) (plot_devrec *rec))proc.proc)(&rec);
 }
 
 
 
-Void plot_velocity(vel)
+void plot_velocity(vel)
 double vel;
 {
-  Char s[21];
+  char s[21];
   long i;
-  Char STR1[256];
-  Char STR3[256];
+  char STR1[256];
+  char STR3[256];
 
   if (outmode != out_hpgl)
     return;
@@ -1821,35 +1821,35 @@ double vel;
 
 
 
-Static Void raisepen()
+static void raisepen()
 {
   if (pendn) {
     rec.act = plot_act_raise;
     if (proc.link != NULL)
-      (*(Void(*) PP((plot_devrec *rec, Anyptr _link)))proc.proc)(&rec, proc.link);
+      (*(void(*) (plot_devrec *rec, void* _link))proc.proc)(&rec, proc.link);
     else
-      (*(Void(*) PP((plot_devrec *rec)))proc.proc)(&rec);
+      (*(void(*) (plot_devrec *rec))proc.proc)(&rec);
   }
   pendn = false;
 }
 
 
 
-Static Void lowerpen()
+static void lowerpen()
 {
   if (!pendn) {
     rec.act = plot_act_lower;
     if (proc.link != NULL)
-      (*(Void(*) PP((plot_devrec *rec, Anyptr _link)))proc.proc)(&rec, proc.link);
+      (*(void(*) (plot_devrec *rec, void* _link))proc.proc)(&rec, proc.link);
     else
-      (*(Void(*) PP((plot_devrec *rec)))proc.proc)(&rec);
+      (*(void(*) (plot_devrec *rec))proc.proc)(&rec);
   }
   pendn = true;
 }
 
 
 
-Void plot_lift()
+void plot_lift()
 {
   if (outf == NULL)
     raisepen();
@@ -1857,14 +1857,14 @@ Void plot_lift()
 
 
 
-Void plot_view()
+void plot_view()
 {
   raisepen();
   rec.act = plot_act_view;
   if (proc.link != NULL)
-    (*(Void(*) PP((plot_devrec *rec, Anyptr _link)))proc.proc)(&rec, proc.link);
+    (*(void(*) (plot_devrec *rec, void* _link))proc.proc)(&rec, proc.link);
   else
-    (*(Void(*) PP((plot_devrec *rec)))proc.proc)(&rec);
+    (*(void(*) (plot_devrec *rec))proc.proc)(&rec);
   pltc = -1;
   pltx = LONG_MAX;
   plty = LONG_MAX;
@@ -1872,14 +1872,14 @@ Void plot_view()
 
 
 
-Void plot_finish()
+void plot_finish()
 {
   raisepen();
   rec.act = plot_act_finish;
   if (proc.link != NULL)
-    (*(Void(*) PP((plot_devrec *rec, Anyptr _link)))proc.proc)(&rec, proc.link);
+    (*(void(*) (plot_devrec *rec, void* _link))proc.proc)(&rec, proc.link);
   else
-    (*(Void(*) PP((plot_devrec *rec)))proc.proc)(&rec);
+    (*(void(*) (plot_devrec *rec))proc.proc)(&rec);
   if (foutfopen) {
     if (*foutf != NULL)
       fclose(*foutf);
@@ -1890,20 +1890,20 @@ Void plot_finish()
 
 
 
-Static Void pattern(pat)
+static void pattern(pat)
 long pat;
 {
   rec.act = plot_act_pattern;
   rec.x1 = pat;
   if (proc.link != NULL)
-    (*(Void(*) PP((plot_devrec *rec, Anyptr _link)))proc.proc)(&rec, proc.link);
+    (*(void(*) (plot_devrec *rec, void* _link))proc.proc)(&rec, proc.link);
   else
-    (*(Void(*) PP((plot_devrec *rec)))proc.proc)(&rec);
+    (*(void(*) (plot_devrec *rec))proc.proc)(&rec);
 }
 
 
 
-Static Void pmove(x, y)
+static void pmove(x, y)
 long x, y;
 {
   if (x == pltx && y == plty)
@@ -1918,16 +1918,16 @@ long x, y;
   }
   rec.act = plot_act_move;
   if (proc.link != NULL)
-    (*(Void(*) PP((plot_devrec *rec, Anyptr _link)))proc.proc)(&rec, proc.link);
+    (*(void(*) (plot_devrec *rec, void* _link))proc.proc)(&rec, proc.link);
   else
-    (*(Void(*) PP((plot_devrec *rec)))proc.proc)(&rec);
+    (*(void(*) (plot_devrec *rec))proc.proc)(&rec);
   pltx = x;
   plty = y;
 }
 
 
 
-Static Void pdraw(x, y)
+static void pdraw(x, y)
 long x, y;
 {
   lowerpen();
@@ -1940,20 +1940,20 @@ long x, y;
   }
   rec.act = plot_act_draw;
   if (proc.link != NULL)
-    (*(Void(*) PP((plot_devrec *rec, Anyptr _link)))proc.proc)(&rec, proc.link);
+    (*(void(*) (plot_devrec *rec, void* _link))proc.proc)(&rec, proc.link);
   else
-    (*(Void(*) PP((plot_devrec *rec)))proc.proc)(&rec);
+    (*(void(*) (plot_devrec *rec))proc.proc)(&rec);
   pltx = x;
   plty = y;
 }
 
 
 
-Static Void pcircle(pat, rx, ry)
+static void pcircle(pat, rx, ry)
 long pat;
 double rx, ry;
 {
-  Char s[256];
+  char s[256];
   long nseg, i, cx, cy, r;
   double theta, dth;
 
@@ -2000,9 +2000,9 @@ double rx, ry;
     rec.x2 = pat;
     rec.act = plot_act_ellipse;
     if (proc.link != NULL)
-      (*(Void(*) PP((plot_devrec *rec, Anyptr _link)))proc.proc)(&rec, proc.link);
+      (*(void(*) (plot_devrec *rec, void* _link))proc.proc)(&rec, proc.link);
     else
-      (*(Void(*) PP((plot_devrec *rec)))proc.proc)(&rec);
+      (*(void(*) (plot_devrec *rec))proc.proc)(&rec);
     return;
   }
   cx = pltx;
@@ -2019,7 +2019,7 @@ double rx, ry;
 
 
 
-Void plot_color(c)
+void plot_color(c)
 long c;
 {
   pltcolr = c;
@@ -2027,7 +2027,7 @@ long c;
 
 
 
-Static Void defpen()
+static void defpen()
 {
   if (pltc == pltcolr)
     return;
@@ -2035,21 +2035,21 @@ Static Void defpen()
   rec.act = plot_act_color;
   rec.x1 = pltcolr;
   if (proc.link != NULL)
-    (*(Void(*) PP((plot_devrec *rec, Anyptr _link)))proc.proc)(&rec, proc.link);
+    (*(void(*) (plot_devrec *rec, void* _link))proc.proc)(&rec, proc.link);
   else
-    (*(Void(*) PP((plot_devrec *rec)))proc.proc)(&rec);
+    (*(void(*) (plot_devrec *rec))proc.proc)(&rec);
   pltc = pltcolr;
 }
 
 
-Void plot_prepare()
+void plot_prepare()
 {
   defpen();
 }
 
 
 
-Void plot_clip()
+void plot_clip()
 {
   long x1, y1, x2, y2;
 
@@ -2070,14 +2070,14 @@ Void plot_clip()
   }
   rec.act = plot_act_clip;
   if (proc.link != NULL)
-    (*(Void(*) PP((plot_devrec *rec, Anyptr _link)))proc.proc)(&rec, proc.link);
+    (*(void(*) (plot_devrec *rec, void* _link))proc.proc)(&rec, proc.link);
   else
-    (*(Void(*) PP((plot_devrec *rec)))proc.proc)(&rec);
+    (*(void(*) (plot_devrec *rec))proc.proc)(&rec);
 }
 
 
 
-Void plot_noclip()
+void plot_noclip()
 {
   rec.x1 = pp1y;
   rec.x2 = pp1y;
@@ -2085,9 +2085,9 @@ Void plot_noclip()
   rec.y2 = pp1x;
   rec.act = plot_act_clip;
   if (proc.link != NULL)
-    (*(Void(*) PP((plot_devrec *rec, Anyptr _link)))proc.proc)(&rec, proc.link);
+    (*(void(*) (plot_devrec *rec, void* _link))proc.proc)(&rec, proc.link);
   else
-    (*(Void(*) PP((plot_devrec *rec)))proc.proc)(&rec);
+    (*(void(*) (plot_devrec *rec))proc.proc)(&rec);
 }
 
 
@@ -2105,7 +2105,7 @@ double cm;
 
 
 
-Void plot_xform(x, y, xx, yy)
+void plot_xform(x, y, xx, yy)
 long x, y, *xx, *yy;
 {
   x = (x - orgx) * sc / scale_;
@@ -2120,7 +2120,7 @@ long x, y, *xx, *yy;
 }
 
 
-Void plot_rxform(x, y, xx, yy)
+void plot_rxform(x, y, xx, yy)
 double x, y;
 long *xx, *yy;
 {
@@ -2139,7 +2139,7 @@ long *xx, *yy;
 
 
 
-Void plot_unxform(xx, yy, x, y)
+void plot_unxform(xx, yy, x, y)
 long xx, yy, *x, *y;
 {
   if (rotate) {
@@ -2155,7 +2155,7 @@ long xx, yy, *x, *y;
 
 
 
-Void plot_relxform(x, y, xx, yy)
+void plot_relxform(x, y, xx, yy)
 long x, y, *xx, *yy;
 {
   x = x * sc / scale_;
@@ -2170,7 +2170,7 @@ long x, y, *xx, *yy;
 }
 
 
-Void plot_rrelxform(x, y, xx, yy)
+void plot_rrelxform(x, y, xx, yy)
 double x, y;
 long *xx, *yy;
 {
@@ -2189,7 +2189,7 @@ long *xx, *yy;
 
 
 
-Void plot_relunxform(xx, yy, x, y)
+void plot_relunxform(xx, yy, x, y)
 long xx, yy, *x, *y;
 {
   if (rotate) {
@@ -2205,20 +2205,20 @@ long xx, yy, *x, *y;
 
 
 
-Void plot_linestyle(num)
+void plot_linestyle(num)
 long num;
 {
   rec.act = plot_act_style;
   rec.x1 = num;
   if (proc.link != NULL)
-    (*(Void(*) PP((plot_devrec *rec, Anyptr _link)))proc.proc)(&rec, proc.link);
+    (*(void(*) (plot_devrec *rec, void* _link))proc.proc)(&rec, proc.link);
   else
-    (*(Void(*) PP((plot_devrec *rec)))proc.proc)(&rec);
+    (*(void(*) (plot_devrec *rec))proc.proc)(&rec);
 }
 
 
 
-Void plot_linewidth(n)
+void plot_linewidth(n)
 double n;
 {
   ps_linewidth = n;
@@ -2226,7 +2226,7 @@ double n;
 
 
 
-Void plot_move(x, y)
+void plot_move(x, y)
 long x, y;
 {
   xpos = x;
@@ -2235,7 +2235,7 @@ long x, y;
 }
 
 
-Void plot_rmove(x, y)
+void plot_rmove(x, y)
 double x, y;
 {
   xpos = (long)floor(x + 0.5);
@@ -2246,7 +2246,7 @@ double x, y;
 
 
 
-Void plot_draw(x, y)
+void plot_draw(x, y)
 long x, y;
 {
   defpen();
@@ -2256,7 +2256,7 @@ long x, y;
 }
 
 
-Void plot_rdraw(x, y)
+void plot_rdraw(x, y)
 double x, y;
 {
   defpen();
@@ -2268,7 +2268,7 @@ double x, y;
 
 
 
-Void plot_moverel(dx, dy)
+void plot_moverel(dx, dy)
 long dx, dy;
 {
   plot_move(xpos + dx, ypos + dy);
@@ -2276,7 +2276,7 @@ long dx, dy;
 
 
 
-Void plot_drawrel(dx, dy)
+void plot_drawrel(dx, dy)
 long dx, dy;
 {
   plot_draw(xpos + dx, ypos + dy);
@@ -2284,7 +2284,7 @@ long dx, dy;
 
 
 
-Void plot_line(x1, y1, x2, y2)
+void plot_line(x1, y1, x2, y2)
 long x1, y1, x2, y2;
 {
   defpen();
@@ -2294,7 +2294,7 @@ long x1, y1, x2, y2;
 
 
 
-Void plot_roundbox(x1, y1, x2, y2, rx, ry, pat)
+void plot_roundbox(x1, y1, x2, y2, rx, ry, pat)
 long x1, y1, x2, y2, rx, ry, pat;
 {
   defpen();
@@ -2306,9 +2306,9 @@ long x1, y1, x2, y2, rx, ry, pat;
   rec.q1.U1.i1 = pat;
   rec.q1.U1.i2 = 0;
   if (proc.link != NULL)
-    (*(Void(*) PP((plot_devrec *rec, Anyptr _link)))proc.proc)(&rec, proc.link);
+    (*(void(*) (plot_devrec *rec, void* _link))proc.proc)(&rec, proc.link);
   else
-    (*(Void(*) PP((plot_devrec *rec)))proc.proc)(&rec);
+    (*(void(*) (plot_devrec *rec))proc.proc)(&rec);
   if (rec.q1.U1.i1 != pat)
     return;
   plot_move(x1, y1);
@@ -2319,7 +2319,7 @@ long x1, y1, x2, y2, rx, ry, pat;
 }
 
 
-Void plot_rroundbox(x1, y1, x2, y2, rx, ry, pat)
+void plot_rroundbox(x1, y1, x2, y2, rx, ry, pat)
 double x1, y1, x2, y2, rx, ry;
 long pat;
 {
@@ -2332,9 +2332,9 @@ long pat;
   rec.q1.U1.i1 = pat;
   rec.q1.U1.i2 = 0;
   if (proc.link != NULL)
-    (*(Void(*) PP((plot_devrec *rec, Anyptr _link)))proc.proc)(&rec, proc.link);
+    (*(void(*) (plot_devrec *rec, void* _link))proc.proc)(&rec, proc.link);
   else
-    (*(Void(*) PP((plot_devrec *rec)))proc.proc)(&rec);
+    (*(void(*) (plot_devrec *rec))proc.proc)(&rec);
   if (rec.q1.U1.i1 != pat)
     return;
   plot_rmove(x1, y1);
@@ -2345,7 +2345,7 @@ long pat;
 }
 
 
-Void plot_box(x1, y1, x2, y2, pat)
+void plot_box(x1, y1, x2, y2, pat)
 long x1, y1, x2, y2, pat;
 {
   plot_roundbox(x1, y1, x2, y2, 0L, 0L, pat);
@@ -2353,7 +2353,7 @@ long x1, y1, x2, y2, pat;
 
 
 
-Void plot_circle(x1, y1, r, pat)
+void plot_circle(x1, y1, r, pat)
 long x1, y1, r, pat;
 {
   defpen();
@@ -2364,7 +2364,7 @@ long x1, y1, r, pat;
 
 
 
-Void plot_rellipse(x1, y1, rx, ry, pat)
+void plot_rellipse(x1, y1, rx, ry, pat)
 long x1, y1;
 double rx, ry;
 long pat;
@@ -2377,7 +2377,7 @@ long pat;
 }
 
 
-Void plot_rrellipse(x1, y1, rx, ry, pat)
+void plot_rrellipse(x1, y1, rx, ry, pat)
 double x1, y1, rx, ry;
 long pat;
 {
@@ -2394,7 +2394,7 @@ struct LOC_plot_rbezier {
   long epsilon;
 } ;
 
-Local Void bezier(x1, y1, x2, y2, x3, y3, x4, y4, LINK)
+static void bezier(x1, y1, x2, y2, x3, y3, x4, y4, LINK)
 long x1, y1, x2, y2, x3, y3, x4, y4;
 struct LOC_plot_rbezier *LINK;
 {
@@ -2431,15 +2431,15 @@ struct LOC_plot_rbezier *LINK;
 
 
 
-Void plot_rbezier(x1, y1, x2, y2, x3, y3, x4, y4, epsilon_)
+void plot_rbezier(x1, y1, x2, y2, x3, y3, x4, y4, epsilon_)
 double x1, y1, x2, y2, x3, y3, x4, y4;
 long epsilon_;
 {
   struct LOC_plot_rbezier V;
   long smalle, xx, yy, ix1, iy1, ix2, iy2, ix3, iy3, ix4, iy4;
   double reps;
-  Char STR1[256], STR2[256];
-  Char STR3[256];
+  char STR1[256], STR2[256];
+  char STR3[256];
 
   V.epsilon = epsilon_;
   defpen();
@@ -2483,7 +2483,7 @@ long epsilon_;
 
 
 
-Void plot_bezier(x1, y1, x2, y2, x3, y3, x4, y4, epsilon)
+void plot_bezier(x1, y1, x2, y2, x3, y3, x4, y4, epsilon)
 long x1, y1, x2, y2, x3, y3, x4, y4, epsilon;
 {
   plot_rbezier((double)x1, (double)y1, (double)x2, (double)y2, (double)x3,
@@ -2492,14 +2492,15 @@ long x1, y1, x2, y2, x3, y3, x4, y4, epsilon;
 
 
 
-Void plot_polygon(n, x, y, pat)
+void plot_polygon(n, x, y, pat)
 long n;
 long *x, *y;
 long pat;
 {
   long *xx, *yy;
   long i;
-  Anyptr xxptr=&xx,yyptr=&yy;
+  void* xxptr=&xx;
+  void* yyptr=&yy;
 
   if (n < 2)
     return;
@@ -2514,12 +2515,12 @@ long pat;
   rec.act = plot_act_polygon;
   rec.x1 = n;
   rec.x2 = pat;
-  rec.q1.U17.p1 = (Anyptr)xx;
-  rec.q1.U17.p2 = (Anyptr)yy;
+  rec.q1.U17.p1 = (void*)xx;
+  rec.q1.U17.p2 = (void*)yy;
   if (proc.link != NULL)
-    (*(Void(*) PP((plot_devrec *rec, Anyptr _link)))proc.proc)(&rec, proc.link);
+    (*(void(*) (plot_devrec *rec, void* _link))proc.proc)(&rec, proc.link);
   else
-    (*(Void(*) PP((plot_devrec *rec)))proc.proc)(&rec);
+    (*(void(*) (plot_devrec *rec))proc.proc)(&rec);
   if (rec.x1 != n)
     return;
   plot_move(x[n - 1], y[n - 1]);
@@ -2531,7 +2532,7 @@ long pat;
 
 
 
-Void plot_initfonts()
+void plot_initfonts()
 {
   char STR1[256];
 
@@ -2546,14 +2547,14 @@ Void plot_initfonts()
 
 
 
-Void plot_fontfile(fn)
-Char *fn;
+void plot_fontfile(fn)
+char *fn;
 {
   strcpy(fontfn, fn);
 }
 
 
-Void plot_headerfile(Char * fn, boolean incflag)
+void plot_headerfile(char * fn, int incflag)
 {
   strcpy(headerfn, fn);
   headerincflag = incflag;
@@ -2561,8 +2562,8 @@ Void plot_headerfile(Char * fn, boolean incflag)
 
 
 
-Static Void warning(msg)
-Char *msg;
+static void warning(msg)
+char *msg;
 {
   puts(msg);
   printf("\007Press return to continue.\n");
@@ -2586,7 +2587,7 @@ typedef struct fontdesc {
 typedef fontdesc ffontarr[1000000L];
 
 typedef struct fchardesc {
-  Char ch;
+  char ch;
   uchar reserved;
   short num;
 } fchardesc;
@@ -2598,7 +2599,7 @@ typedef struct fname {
 
 typedef fname fnamearr[1000000L];
 
- Void readchardesc(f,fd,siz)
+ void readchardesc(f,fd,siz)
  int f;
  chardesc *fd;
  int siz;
@@ -2615,15 +2616,15 @@ typedef fname fnamearr[1000000L];
          if (read(f, x, 2) <= 0)
              fprintf(stderr,"file read error (readchardesc)\n");
          pp1->drw = (x[1] >>7) & 1;
-         pp1->py = (Signed int)(x[1] & 0x7f);
+         pp1->py = (signed int)(x[1] & 0x7f);
    pp1->circ = (x[0] >>7) & 1;
-         pp1->px = (Signed int)(x[0]  & 0x7f);
+         pp1->px = (signed int)(x[0]  & 0x7f);
          pp1 += 1;
    }
  }
 
 
-Void plot_loadfonts(which_)
+void plot_loadfonts(which_)
 long *which_;
 {
   long which[9];
@@ -2640,15 +2641,15 @@ long *which_;
   chardesc **oldix;
   short oldnc, newnc, nn, nf;       
   chardesc *loadme;
-  Char fn[256], fn2[256];
-  boolean all, warned, failed;
+  char fn[256], fn2[256];
+  int all, warned, failed;
   long SET[257];
-  Char STR1[256];
+  char STR1[256];
   short FORLIM;
   long SET1[257];
   short TEMP;
   short FORLIM1;
-  Char STR4[256];
+  char STR4[256];
   point *pp1;
   chardesc *cd1;
 
@@ -2663,18 +2664,10 @@ long *which_;
     failed = true;
     TRY(try3);
       if (f != NULL)
-#ifdef OS2
-        f = freopen(fn2, "rb", f);
-#else
         f = freopen(fn2, "r", f);
-#endif  
       else
-#ifdef OS2
-        f = fopen(fn2, "rb");
-#else
         f = fopen(fn2, "r");
-#endif
-      if (f == NULL) {
+    if (f == NULL) {
 	P_escapecode = -10;
 	P_ioresult = FileNotFound;
 	goto _Ltry3;
@@ -2873,9 +2866,9 @@ long *which_;
 	for (j=0;j<((fix[i].siz-6)/2);j++) {
 	  fread(STR1,2,1,f); /* reading fields */
 	  pp1[j].drw = (STR1[1] >>7) & 1;
-	  pp1[j].py = (Signed int)(STR1[1] & 0x7f);
+	  pp1[j].py = (signed int)(STR1[1] & 0x7f);
 	  pp1[j].circ = (STR1[0] >>7) & 1;
-	  pp1[j].px = (Signed int)(STR1[0]  & 0x7f);
+	  pp1[j].px = (signed int)(STR1[0]  & 0x7f);
 	}
 
 	/* end of replaced code */    
@@ -2900,8 +2893,8 @@ long *which_;
 
 
 
-Void plot_morefontset(fn, which)
-Char *fn;
+void plot_morefontset(fn, which)
+char *fn;
 long *which;
 {
   plot_fontfile(fn);
@@ -2910,8 +2903,8 @@ long *which;
 
 
 
-Void plot_readfontset(fn, which)
-Char *fn;
+void plot_readfontset(fn, which)
+char *fn;
 long *which;
 {
   plot_initfonts();
@@ -2920,8 +2913,8 @@ long *which;
 
 
 
-Void plot_readfont(fn)
-Char *fn;
+void plot_readfont(fn)
+char *fn;
 {
   long SET[9];
 
@@ -2930,10 +2923,10 @@ Char *fn;
 
 
 
-Void plot_ctrlchars(pref, chrs_)
-Char *pref, *chrs_;
+void plot_ctrlchars(pref, chrs_)
+char *pref, *chrs_;
 {
-  Char chrs[256];
+  char chrs[256];
 
   strcpy(chrs, chrs_);
   if (strlen(prefchar) > 1)
@@ -2949,7 +2942,7 @@ Char *pref, *chrs_;
 
 
 
-Void plot_selfont(num)
+void plot_selfont(num)
 long num;
 {
   plot_fontrec *ft;
@@ -2975,7 +2968,7 @@ long plot_height()
 
 
 
-Static Void plotsize()
+static void plotsize()
 {
   csn = cscsc * csnum;
   csd = cssc * csden;
@@ -2988,7 +2981,7 @@ Static Void plotsize()
 
 
 
-Void plot_charsize(num, den, scale)
+void plot_charsize(num, den, scale)
 long num, den, scale;
 {
   if (den == 0)
@@ -3005,7 +2998,7 @@ long num, den, scale;
 
 
 
-Void plot_charscale(scale)
+void plot_charscale(scale)
 long scale;
 {
   cscsc = scale;
@@ -3014,9 +3007,9 @@ long scale;
 
 
 
-Void plot_charorient(theta, mirrorx)
+void plot_charorient(theta, mirrorx)
 double theta;
-boolean mirrorx;
+int mirrorx;
 {
   if (theta == 0) {
     csnc = scale_;
@@ -3046,7 +3039,7 @@ boolean mirrorx;
 
 
 
-Void plot_charaspect(horiz, vert, den)
+void plot_charaspect(horiz, vert, den)
 long horiz, vert, den;
 {
   csah = horiz;
@@ -3058,7 +3051,7 @@ long horiz, vert, den;
 
 
 long plot_charnum(ch)
-Char ch;
+char ch;
 {
   if (curft == NULL)
     return -1;
@@ -3069,7 +3062,7 @@ Char ch;
 
 
 long plot_charname(s)
-Char *s;
+char *s;
 {
   plot_namerec *nm;
 
@@ -3084,7 +3077,7 @@ Char *s;
 
 
 
-Void plot_ssoffset(sub, sup, den)
+void plot_ssoffset(sub, sup, den)
 long sub, sup, den;
 {
   sbo = sub;
@@ -3094,7 +3087,7 @@ long sub, sup, den;
 
 
 
-Static Void plotchar(x, y, num)
+static void plotchar(x, y, num)
 long *x, *y, num;
 {
   short i;
@@ -3141,7 +3134,7 @@ long *x, *y, num;
 
 
 
-Void plot_char(x, y, num)
+void plot_char(x, y, num)
 long x, y, num;
 {
   if (csd == 0)
@@ -3155,14 +3148,14 @@ long x, y, num;
 /* Local variables for plotstring: */
 struct LOC_plotstring {
   long *x, *y;
-  Char *s;
-  boolean plotit;
+  char *s;
+  int plotit;
   short i, j;
 } ;
 
-Local long strnum(binary, term, LINK)
-boolean binary;
-Char term;
+static long strnum(binary, term, LINK)
+int binary;
+char term;
 struct LOC_plotstring *LINK;
 {
   long Result, n;
@@ -3187,13 +3180,13 @@ struct LOC_plotstring *LINK;
   return Result;
 }
 
-Local Void substr_(LINK)
+static void substr_(LINK)
 struct LOC_plotstring *LINK;
 {
-  Char ch;
+  char ch;
   long x0, y0, num;
   plot_fontrec *orgft;
-  boolean done, flag;
+  int done, flag;
   chardesc *WITH;
 
   done = false;
@@ -3311,10 +3304,10 @@ struct LOC_plotstring *LINK;
 
 
 
-Static Void plotstring(x_, y_, s_, plotit_)
+static void plotstring(x_, y_, s_, plotit_)
 long *x_, *y_;
-Char *s_;
-boolean plotit_;
+char *s_;
+int plotit_;
 {
   struct LOC_plotstring V;
 
@@ -3339,11 +3332,11 @@ boolean plotit_;
 }
 
 
-Static Void stringlen(x, y, s_)
+static void stringlen(x, y, s_)
 long *x, *y;
-Char *s_;
+char *s_;
 {
-  Char s[256];
+  char s[256];
 
   strcpy(s, s_);
   *x = 0;
@@ -3353,10 +3346,10 @@ Char *s_;
 
 
 
-Void plot_stringrel(s_)
-Char *s_;
+void plot_stringrel(s_)
+char *s_;
 {
-  Char s[256];
+  char s[256];
   long x, y;
 
   strcpy(s, s_);
@@ -3369,9 +3362,9 @@ Char *s_;
 
 
 
-Static boolean candotext(x, y, s, mode)
+static int candotext(x, y, s, mode)
 long x, y;
-Char *s;
+char *s;
 long mode;
 {
   defpen();
@@ -3393,18 +3386,18 @@ long mode;
   rec.q3.U1.i1 = csnum * sc;
   rec.q3.U1.i2 = csden * scale_;
   if (proc.link != NULL)
-    (*(Void(*) PP((plot_devrec *rec, Anyptr _link)))proc.proc)(&rec, proc.link);
+    (*(void(*) (plot_devrec *rec, void* _link))proc.proc)(&rec, proc.link);
   else
-    (*(Void(*) PP((plot_devrec *rec)))proc.proc)(&rec);
+    (*(void(*) (plot_devrec *rec))proc.proc)(&rec);
   return (rec.q1.U1.i1 == 0);
 }
 
 
-Void plot_string(x, y, s_)
+void plot_string(x, y, s_)
 long x, y;
-Char *s_;
+char *s_;
 {
-  Char s[256];
+  char s[256];
 
   strcpy(s, s_);
   if (candotext(x, y, s, 1L))
@@ -3415,11 +3408,11 @@ Char *s_;
 }
 
 
-Void plot_rightstring(x, y, s_)
+void plot_rightstring(x, y, s_)
 long x, y;
-Char *s_;
+char *s_;
 {
-  Char s[256];
+  char s[256];
   long x1, y1;
 
   strcpy(s, s_);
@@ -3432,11 +3425,11 @@ Char *s_;
 }
 
 
-Void plot_centerstring(x, y, s_)
+void plot_centerstring(x, y, s_)
 long x, y;
-Char *s_;
+char *s_;
 {
-  Char s[256];
+  char s[256];
   long x1, y1;
 
   strcpy(s, s_);
@@ -3449,11 +3442,11 @@ Char *s_;
 }
 
 
-Void plot_genstring(x, y, orient_, s_)
+void plot_genstring(x, y, orient_, s_)
 long x, y;
-Char *orient_, *s_;
+char *orient_, *s_;
 {
-  Char orient[256], s[256];
+  char orient[256], s[256];
   long i, x1, y1;
 
   strcpy(orient, orient_);
@@ -3507,7 +3500,7 @@ Char *orient_, *s_;
 
 
 long plot_stringwidth(s)
-Char *s;
+char *s;
 {
   long x1, y1;
 
diff --git a/psys/src/regex.c b/psys/src/regex.c
index 2332ea0..d42f088 100644
--- a/psys/src/regex.c
+++ b/psys/src/regex.c
@@ -62,23 +62,23 @@
 
 /* Local variables for compile: */
 struct LOC_compile {
-  Char *ex, *rex;
-  Char chars[256];
-  boolean cimode;
+  char *ex, *rex;
+  char chars[256];
+  int cimode;
   long i, parcnt;
 } ;
 
-Local Void expr PP((int parenflag, struct LOC_compile *link));
+static void expr (int parenflag, struct LOC_compile *link);
 
-Local Char *parsebunch(rval, link)
-Char *rval;
+static char *parsebunch(rval, link)
+char *rval;
 struct LOC_compile *link;
 {
   uchar a[32];
   long j;
-  Char ch;
-  boolean inverted, flag;
-  Char s[256];
+  char ch;
+  int inverted, flag;
+  char s[256];
   long FORLIM;
   int TEMP;
 
@@ -122,26 +122,26 @@ struct LOC_compile *link;
   for (j = 0; j <= 255; j++) {
     if (P_getbits_UB(a, j, 0, 3) != flag) {
       if (flag)
-	sprintf(s + strlen(s), "%c", (Char)(j - 1));
+	sprintf(s + strlen(s), "%c", (char)(j - 1));
       else
-	sprintf(s + strlen(s), "%c", (Char)j);
+	sprintf(s + strlen(s), "%c", (char)j);
       flag = P_getbits_UB(a, j, 0, 3);
     }
   }
   if (flag)
     strcat(s, "\377");
-  sprintf(rval, "%c%s", (Char)(strlen(s) / 2), s);
-/* p2c: regex.text, line 140: Note: Character >= 128 encountered [281] */
+  sprintf(rval, "%c%s", (char)(strlen(s) / 2), s);
+/* p2c: regex.text, line 140: Note: character >= 128 encountered [281] */
   return rval;
 }
 
-Local Char *parsecount(rval, link)
-Char *rval;
+static char *parsecount(rval, link)
+char *rval;
 struct LOC_compile *link;
 {
   long min, max;
-  Char STR1[2];
-  Char *STR2;
+  char STR1[2];
+  char *STR2;
 
   min = 0;
   max = 255;
@@ -167,7 +167,7 @@ struct LOC_compile *link;
     max = 255;
   if (min > max)
     min = max;
-  sprintf(rval, "%s%c%c", count_, (Char)min, (Char)max);
+  sprintf(rval, "%s%c%c", count_, (char)min, (char)max);
   return rval;
 }
 
@@ -181,13 +181,13 @@ struct LOC_term {
   struct LOC_expr *link;
 } ;
 
-Local Void factor(parenflag, link)
-boolean parenflag;
+static void factor(parenflag, link)
+int parenflag;
 struct LOC_term *link;
 {
   long save;
-  Char ch;
-  Char STR1[256];
+  char ch;
+  char STR1[256];
 
   if (link->link->link->i > strlen(link->link->link->ex))
     return;
@@ -255,11 +255,11 @@ struct LOC_term *link;
       save = link->link->link->parcnt;
       strcat(link->link->link->rex, "\f");
       sprintf(link->link->link->rex + strlen(link->link->link->rex), "%c",
-	      (Char)save);
+	      (char)save);
       expr(true, link->link->link);
       strcat(link->link->link->rex, "\015");
       sprintf(link->link->link->rex + strlen(link->link->link->rex), "%c",
-	      (Char)save);
+	      (char)save);
     }
     if (link->link->link->i <= strlen(link->link->link->ex) &&
 	link->link->link->ex[link->link->link->i - 1] == link->link->link->
@@ -280,16 +280,16 @@ struct LOC_term *link;
   /*end of line*/
 }  /*factor*/
 
-Local Void term(parenflag, link)
-boolean parenflag;
+static void term(parenflag, link)
+int parenflag;
 struct LOC_expr *link;
 {
   struct LOC_term V;
   long save;
-  Char ch;
-  boolean notflag;
-  Char STR1[256];
-  Char STR2[256];
+  char ch;
+  int notflag;
+  char STR1[256];
+  char STR2[256];
 
   V.link = link;
   while (link->link->i <= strlen(link->link->ex) &&
@@ -347,13 +347,13 @@ struct LOC_expr *link;
   /*count*/
 }  /*term*/
 
-Local Void expr(parenflag, link)
-boolean parenflag;
+static void expr(parenflag, link)
+int parenflag;
 struct LOC_compile *link;
 {
   struct LOC_expr V;
   long save;
-  Char STR1[256];
+  char STR1[256];
 
   V.link = link;
   save = strlen(link->rex) + 1;
@@ -377,10 +377,10 @@ struct LOC_compile *link;
 
 
 
-Static Void compile(ex_, rex_, chars_, cimode_)
-Char *ex_, *rex_;
-Char *chars_;
-boolean cimode_;
+static void compile(ex_, rex_, chars_, cimode_)
+char *ex_, *rex_;
+char *chars_;
+int cimode_;
 {
   struct LOC_compile V;
 
@@ -404,12 +404,12 @@ boolean cimode_;
 
 
 
-Void re_compile(ex_, rex, chars)
-Char *ex_;
-Char *rex;
-Char *chars;
+void re_compile(ex_, rex, chars)
+char *ex_;
+char *rex;
+char *chars;
 {
-  Char ex[256];
+  char ex[256];
 
   strcpy(ex, ex_);
   compile(ex, rex, chars, false);
@@ -417,25 +417,25 @@ Char *chars;
 
 
 
-Void re_cicompile(ex_, rex, chars)
-Char *ex_;
-Char *rex;
-Char *chars;
+void re_cicompile(ex_, rex, chars)
+char *ex_;
+char *rex;
+char *chars;
 {
-  Char ex[256];
+  char ex[256];
 
   strcpy(ex, ex_);
   compile(ex, rex, chars, true);
 }
 
 
-Local Char *charconv(rval, ch)
-Char *rval;
-Char ch;
+static char *charconv(rval, ch)
+char *rval;
+char ch;
 {
   if (ch > ' ' && (ch & (~127)) == 0) {
     sprintf(rval, "%c", ch);
-/* p2c: regex.text, line 370: Note: Character >= 128 encountered [281] */
+/* p2c: regex.text, line 370: Note: character >= 128 encountered [281] */
     return rval;
   } else if (ch == ' ')
     return strcpy(rval, "sp");
@@ -449,11 +449,11 @@ Char ch;
 
 
 
-Void re_dump(rex)
-Char *rex;
+void re_dump(rex)
+char *rex;
 {
   long i, n;
-  Char STR2[256], STR3[256];
+  char STR2[256], STR3[256];
 
   if (*rex == '\0')
     printf("<null>");
@@ -570,23 +570,23 @@ Char *rex;
 
 /* Local variables for compare: */
 struct LOC_compare {
-  Char *s, *rex, *rpl;
+  char *s, *rex, *rpl;
   long *p, i, savep, countleft, countright;
   long par[2][10];
-  boolean parflag, cimode;
-  Char matchchar;
+  int parflag, cimode;
+  char matchchar;
 } ;
 
-Local boolean comp PP((struct LOC_compare *link));
+static int comp (struct LOC_compare *link);
 
 /* p2c: regex.text, line 462: Note: Range checking is OFF [216] */
 /* p2c: regex.text, line 463: Note: Overflow checking is OFF [219] */
 
-Local Void skiprex(rex, link)
-Char *rex;
+static void skiprex(rex, link)
+char *rex;
 struct LOC_compare *link;
 {
-  Char STR1[256];
+  char STR1[256];
 
   while (strcmp((sprintf(STR1, "%c", rex[link->i - 1]), STR1), end_)) {
     switch (rex[link->i - 1]) {
@@ -627,7 +627,7 @@ struct LOC_compare *link;
 /* Local variables for comp: */
 struct LOC_comp {
   struct LOC_compare *link;
-  boolean wrong;
+  int wrong;
   long tempright;
 } ;
 
@@ -635,10 +635,10 @@ struct LOC_comp {
 struct LOC_count__ {
   struct LOC_comp *link;
   long min, max, i1;
-  boolean flag;
+  int flag;
 } ;
 
-Local boolean subcount(num, link)
+static int subcount(num, link)
 long num;
 struct LOC_count__ *link;
 {
@@ -663,7 +663,7 @@ struct LOC_count__ *link;
   return link->flag;
 }  /*subcount*/
 
-Local Void count__(min_, max_, link)
+static void count__(min_, max_, link)
 long min_, max_;
 struct LOC_comp *link;
 {
@@ -685,15 +685,15 @@ struct LOC_comp *link;
     link->link->countright = link->tempright;
 }  /*count*/
 
-Local boolean comp(link)
+static int comp(link)
 struct LOC_compare *link;
 {
   struct LOC_comp V;
-  boolean flag;
-  Char ch, ch1;
+  int flag;
+  char ch, ch1;
   long j, n, savei, savep;
-  Char STR1[256], STR2[256];
-  Char STR3[256], STR4[256];
+  char STR1[256], STR2[256];
+  char STR3[256], STR4[256];
 
   V.link = link;
   /*      write('Comp "', strsub(s,p,999), '" against "'); re_dump(strsub(rex,i,999)); writeln('"'); {****/
@@ -876,17 +876,17 @@ struct LOC_compare *link;
 /* Local variables for replace: */
 struct LOC_replace {
   struct LOC_compare *link;
-  Char temps[256];
+  char temps[256];
   long notnum;
 } ;
 
-Local Void getrepl(link)
+static void getrepl(link)
 struct LOC_replace *link;
 {
-  Char ch;
+  char ch;
   long j, n;
-  Char STR1[256], STR2[256], STR3[256];
-  Char FORLIM;
+  char STR1[256], STR2[256], STR3[256];
+  char FORLIM;
 
   while (strcmp((sprintf(STR1, "%c", link->link->rpl[link->link->i - 1]),
 		 STR1), end_)) {
@@ -981,12 +981,12 @@ struct LOC_replace *link;
 
 
 
-Local Void replace(link)
+static void replace(link)
 struct LOC_compare *link;
 {
   struct LOC_replace V;
-  Char STR1[256];
-  Char STR2[256];
+  char STR1[256];
+  char STR2[256];
 
   V.link = link;
   link->i = 1;
@@ -1012,10 +1012,10 @@ struct LOC_compare *link;
 
 
 
-Static Void compare(s_, rex_, rpl_, p_, found)
-Char *s_, *rex_, *rpl_;
+static void compare(s_, rex_, rpl_, p_, found)
+char *s_, *rex_, *rpl_;
 long *p_;
-boolean *found;
+int *found;
 {
   struct LOC_compare V;
 
@@ -1045,12 +1045,12 @@ boolean *found;
 
 
 
-Void re_search(s, rex, pos, last, dir)
-Char *s, *rex;
+void re_search(s, rex, pos, last, dir)
+char *s, *rex;
 long *pos, *last, dir;
 {
-  boolean found, fast, vfast;
-  Char rpl[2];
+  int found, fast, vfast;
+  char rpl[2];
 
   found = false;
   fast = (rex[0] >= ' ');
@@ -1079,12 +1079,12 @@ long *pos, *last, dir;
 
 
 
-boolean re_compare(s, rex)
-Char *s, *rex;
+int re_compare(s, rex)
+char *s, *rex;
 {
   long p;
-  boolean found;
-  Char rpl[2];
+  int found;
+  char rpl[2];
 
   p = 1;
   rpl[0] = '\0';
@@ -1094,11 +1094,11 @@ Char *s, *rex;
 
 
 
-Void re_replace(s, rex, rpl, pos, last)
-Char *s, *rex, *rpl;
+void re_replace(s, rex, rpl, pos, last)
+char *s, *rex, *rpl;
 long *pos, *last;
 {
-  boolean found;
+  int found;
 
   *last = *pos;
   compare(s, rex, rpl, last, &found);
@@ -1112,10 +1112,10 @@ long *pos, *last;
 
 
 
-boolean re_matchstr(s_, pat)
-Char *s_, *pat;
+int re_matchstr(s_, pat)
+char *s_, *pat;
 {
-  Char s[256], rex[256];
+  char s[256], rex[256];
 
   strcpy(s, s_);
   re_compile(pat, rex, "");
@@ -1124,11 +1124,11 @@ Char *s_, *pat;
 
 
 
-boolean re_matchsubstr(s_, pat, start, last)
-Char *s_, *pat;
+int re_matchsubstr(s_, pat, start, last)
+char *s_, *pat;
 long start, *last;
 {
-  Char s[256], rex[256], rpl[256];
+  char s[256], rex[256], rpl[256];
 
   strcpy(s, s_);
   re_compile(pat, rex, "");
@@ -1139,11 +1139,11 @@ long start, *last;
 
 
 
-Void re_grepl(s, pat, rpl)
-Char *s;
-Char *pat, *rpl;
+void re_grepl(s, pat, rpl)
+char *s;
+char *pat, *rpl;
 {
-  Char srex[256], rrex[256];
+  char srex[256], rrex[256];
   long pos, last;
 
   pos = 1;
diff --git a/psys/src/rnd.c b/psys/src/rnd.c
index a82ee82..c1dbbbc 100644
--- a/psys/src/rnd.c
+++ b/psys/src/rnd.c
@@ -1,11 +1,8 @@
-#define RND_G
-
 #include <stdlib.h>
 #include <p2c/rnd.h>
 
 
-void P_random(seed)
-long *seed;
+void P_random(long *seed)
 {
   static short xsubi[3];
   
@@ -14,9 +11,7 @@ long *seed;
 }
 
 
-long P_rand(seed, limit)
-long *seed;
-long limit;
+long P_rand(long *seed, long limit)
 {
   long ret;
 
diff --git a/psys/src/strings.c b/psys/src/strings.c
new file mode 100644
index 0000000..85cb7b4
--- /dev/null
+++ b/psys/src/strings.c
@@ -0,0 +1,535 @@
+#include <p2c/p2c.h>
+#include <p2c/strings.h>
+
+void strsafeappend (char *s, char *s2)
+{
+	char *cp = s;
+	while (*cp)
+		cp++;
+	s += 255;
+	while(cp < s && *s2)
+		*cp++ = *s2++;
+	*cp = 0;
+}
+
+char *strupper(char *result, char *s)
+{
+	char *d = result;
+	while (*s)
+		*d++ = toupper(*s++);
+	*d = 0;
+	return result;
+}
+
+char *strlower(char *result, char *s)
+{
+	char *d = result;
+	while (*s)
+		*d++ = tolower(*s++);
+	*d = 0;
+	return result;
+}
+
+char *strpart(char *result, char *s, long first, long last)
+{
+	return strsub(result, s, first, last-first+1);
+}
+
+char *strlast(char *result, char *s, long num)
+{
+	char *cp = s + strlen(s) - num;
+	if (cp <= s)
+		return strcpy(result, s);
+	else
+		return strcpy(result, cp);
+}
+
+char *strjust(char *result, char *s, long wid)
+{
+	int len = strlen(s);
+	int wid2;
+	char *cp = result;
+
+	if (wid > 255)
+		wid = 255;
+	wid -= len;
+	if (wid <=0)
+		return strcpy(result, s);
+	wid2 = wid >> 1;
+	while (--wid2 >= 0)
+		*cp++ = ' ';
+	while (*s)
+		*cp++ = *s++;
+	wid2 = (wid +1) >> 1;
+	while (--wid2 >= 0)
+		*cp++ = ' ';
+	*cp = 0;
+	return result;
+}
+
+int strbegins(char *s1, char *s2)
+{
+	while (*s2)
+		if (*s1++ != *s2++)
+			return false;
+	return true;
+}
+
+int strends(char *s1, char *s2)
+{
+	int skip = strlen(s1) - strlen(s2);
+
+	if (skip < 0)
+		return 0;
+	return (strcmp(s1 + skip, s2) == 0);
+}
+
+int strcibegins(char *s1, char *s2)
+{
+	while (*s2)
+		if (isalpha(*s1) ? (toupper(*s1++) != toupper(*s2++)) : (*s1++ != *s2++))
+			return false;
+	return true;
+}
+
+int strciends(char *s1, char *s2)
+{
+	int skip = strlen(s1) - strlen(s2);
+
+	if (skip < 0)
+		return 0;
+	return strcicmp(s1 + skip, s2);
+}
+
+/* case insensitive version of strcmp. */
+int strcicmp(char *s1, char *s2)
+{
+	char c1;
+	char c2;
+
+	while (*s1)
+	{
+		if(*s1++ != *s2++)
+		{
+			if(!s2[-1])
+				return 1;
+			c1 = toupper(s1[-1]);
+			c2 = toupper(s2[-1]);
+			if(c1 != c2)
+				return c1 -c2;
+		}
+	}
+	if (*s2)
+		return -1;
+	return 0;
+}
+
+long strsubcmp(long n, char *s1, long i1, char *s2, long i2)
+{
+	if (i1 <= 0) s1 = (char *) "";
+	if (i2 <= 0) s2 = (char *) "";
+	while (--i1 > 0)
+	{
+		if(!*s1++)
+		{
+			s1--;
+			break;
+		}
+	}
+	while (--i2 > 0)
+	{
+		if(!*s2++)
+		{
+			s2--;
+			break;
+		}
+	}
+	return strncmp(s1, s2, n);
+}
+
+int strcisubcmp(long n, char * s1, long i1, char * s2, long i2)
+{
+	if (i1 <= 0) s1 = (char *) "";
+	if (i2 <= 0) s2 = (char *) "";
+	while (--i1 > 0)
+	{
+		if(!*s1++)
+		{
+			s1--;
+			break;
+		}
+	}
+	while (--i2 > 0)
+	{
+		if(!*s2++)
+		{
+			s2--;
+			break;
+		}
+	}
+	while (--n >= 0)
+	{
+		if (toupper(*s1++) != toupper(*s2++))
+			return 0;
+	}
+	return 1;
+}
+
+void strsubst(char *repl, char *s, long index, long size)
+{
+	int len = strlen(repl);
+
+	s += index - 1;
+	if (size < 0) 
+	{
+		char* cp;
+		for (cp = s + strlen(s); cp >= s; cp--)
+			*cp = cp[size];
+	}
+	else if (size > 0)
+	{
+		char *cp;
+		for (cp = s; (*cp = cp[size]); cp++) ;
+	}
+	strncpy(s, repl, len);
+}
+
+char *strint2(char *res, long i, long w)
+{
+	if (w < 0)
+		sprintf(res, "%0*ld", (int)(-w), i);
+	else
+		sprintf(res, "%*ld", (int)w, i);
+	return res;
+}
+
+long strposb(char *s1, char *s2, long i)
+{
+	int len1;
+	int len2;
+
+	if (--i > len1 - len2)
+		i = len1 - len2;
+	if (i < 0 || !len2)
+		return 0;
+	while (i > 0 && strncmp(s1 +i, s2, len2))
+		i--;
+	return i+1;
+}
+
+long strposc (char *s1, char ch, long i)
+{
+	char *cp = s1;
+
+	if (i <= 0)
+		return 0;
+	while (--i > 0)
+		if (!*cp++)
+			return 0;
+	while (*cp)
+		if (*cp++ == ch)
+			return cp - s1;
+	return 0;
+}
+
+long strcipos2(char *s1, char *s2, long i)
+{
+	char *cp = s1;
+	int len = strlen(s2);
+
+	if (i <= 0 || ! len)
+		return 0;
+	while (--i > 0)
+		if (!*cp++)
+			return 0;
+	while (*cp)
+		if (!strncmp(cp++, s2, len))
+			return cp -s1;
+	return 0;
+}
+
+long strciposb(char *s1, char *s2, long i)
+{
+	int len = strlen(s1) - strlen(s2);
+
+	if(--i > len)
+		i = len;
+	if (i < 0 || !*s2)
+		return 0;
+	while (i >= 0 && !! strcibegins(s1 + i, s2))
+		i--;
+	return i + 1;
+}
+
+long strposcset(char *s1, char *s2, long i)
+{
+	char *cp = s1;
+	char *cp2;
+	char ch;
+	char ch2;
+
+	if (i <= 0)
+		return 0;
+	while (--i > 0)
+		if(!*cp++)
+			return 0;
+	while (ch = *cp++)
+	{
+		for (cp2 = s2; ch2 = *cp2; cp2++)
+			if (ch == ch2)
+				return cp - s1;
+	}
+	return 0;
+}
+
+long strposbcset(char *s1, char *s2, long i)
+{
+	char *cp2;
+	char ch;
+	char ch2;
+	int len;
+
+	len = strlen(s1);
+	if (i >= len)
+		i = len;
+	if (i <= 0)
+		i = 0;
+	while (--i >= 0)
+	{
+		ch = s1[i];
+		for (cp2 =s2; ch2 = *cp2; cp2++)
+			if (ch == ch2)
+				return i + 1;
+	}
+	return 0;
+}
+
+int strsubset( char *s1, char *s2)
+{
+	char *cp;
+	char* ch;
+	char *ch2;
+
+	while (ch = *s1++)
+	{
+		for (cp = s2; (ch2 = *s2++) != ch; cp++)
+			if (!ch2)
+				return 0;
+	}
+	return 1;
+}
+
+int strcommon(char *s1, char *s2)
+{
+	return strsubset(s1, s2) && strsubset(s2,s1);
+}
+
+long strlenv(char *s1)
+{
+	int len = 0;
+	char ch;
+	while (ch = *s1++)
+	{
+		switch (ch)
+		{
+			case 0:
+			case 7:
+				break;
+
+			case 8:
+				if (--len < 0)
+					++len;
+				break;
+			case 9:
+				len = (len | 7) + 1;
+				break;
+			case 12:
+			case 13:
+				len = 0;
+				break;
+
+			default:
+				++ len;
+		}
+	}
+	return len;
+}
+
+char *strhex(char *res, long i, long w)
+{
+	if (w < 1 || w > 8)
+		sprintf(res, "%IX", i);
+	else
+		sprintf(res, "%.*IX", (int)w, i);
+	return res;
+}
+
+char *strbinary(char *res, long i, long w)
+{
+	if (w < 1 || w > 32)
+	{
+		if (i)
+		{
+			long i2 = i;
+			w = 32;
+			while (i2 >= 0)
+			{
+				w--;
+				i2 <<= 1;
+			}
+		}
+		else
+		{
+			w = 1;
+		}
+	}
+	res [w] = 0;
+	while (w > 0)
+	{
+		--w;
+		res[w] = '0' + (i & 1);
+		i >>= 1;
+	}
+	return res;
+}
+
+char *strdate(char*res, char* opts) /* ignore opts for now */
+{
+	time_t t = time(NULL);
+	strcpy(res, (char*) ctime(&t));
+	res[strlen(res)-1] = 0;  /* eat the \n */
+	return res;
+}
+
+void strword(char *s, char *word)
+{
+	char *s1 = s;
+	while (*s1 == ' ') s1++;
+	while (*s1 && *s1 != ' ')
+		*word++ = *s1++;
+	while (*s1 == ' ') s1++;
+	while (*s1)
+		*s++ = *s1++;
+	*s = 0;
+}
+
+void strword2(char* s, char* word)
+{
+	char *s1 =s;
+	char ch;
+
+	while (*s1 == ' ') s1++;
+	if (*s1 == '\'' || *s1 == '"')
+	{
+		ch = *s1++;
+		while (*s1 && *s1 != ch)
+			*word++ = *s1++;
+		if (*s1 == ch)
+			s1++;
+	}
+	else
+	{
+		while (*s1 && *s1 != ' ')
+			*word++ =  *s1++;
+	}
+	while (*s1 == ' ') s1++;
+	*word = 0;
+	while (*s1)
+		*s++ = *s1++;
+	*s = 0;
+}
+
+void strcomment(char *s, char* bracket)
+{
+	char *cp;
+	char ch1;
+	char ch2;
+
+	ch1 = bracket[0];
+	ch2 = bracket[1];
+	while (*s && *s != ch1) s++;
+	if (*s)
+	{
+		cp = s;
+		while (*s)
+		{
+			if (*s == ch1)
+			{
+				if (ch2)
+				{
+					s++;
+					while (*s && *s != ch2) s++;
+					if (*s);
+						s++;
+				}
+				else
+				{
+					break;
+				}
+			}
+			else
+			{
+				*cp++ = *s++;
+			}
+		}
+		*cp = 0;
+	}
+}
+
+void strcompress(char *s, char *chars, int all)
+{
+	char *cp = s;
+	char *cp2;
+	char ch;
+
+	while (ch = *s)
+	{
+		for (cp2 = chars; *cp2 && *cp2 != ch; cp2++) ;
+		if (*cp2)
+		{
+			if (!all)
+				*cp++ = ch;
+			do
+			{
+				if (!(ch = *++s))
+					break;
+				for(cp2 = chars; *cp2 && *cp2 != ch; cp2++) ;
+			} while (*cp2);
+		}
+		else
+		{
+			*cp ++ = ch;
+			s++;
+		}
+	}
+	*cp = 0;
+}
+
+void strdispose(char **sp)
+{
+	if (*sp)
+		free(*sp);
+	*sp = NULL;
+}
+
+void strchange(char **sp, char *s)
+{
+	int len1;
+	int len2 = strlen(s);
+	if (*sp)
+	{
+		len1 = strlen(*sp);
+		if (len1 != len2)
+		{
+			*sp = (char *) realloc(*sp, len2 +1);
+		}
+	}
+	else
+	{
+		*sp = (char *) malloc(len2 + 1);
+	}
+	if (!*sp)
+		outmem();
+	strcpy(*sp, s);
+}
+
diff --git a/psys/src/sysdevs.c b/psys/src/sysdevs.c
index a23b834..ad69109 100644
--- a/psys/src/sysdevs.c
+++ b/psys/src/sysdevs.c
@@ -5,13 +5,6 @@
 # include <sys/types.h>  /* A/UX needs this. */
 # include <time.h>
 # include <sys/time.h>   /* A/UX needs this, too! */
-#elif defined(__sgi)
-# include <sys/types.h>  
-# include <time.h>
-# include <sys/time.h>   
-#elif defined(rs6000)
-# include <sys/time.h>
-# include <time.h>
 #elif defined(BSD)
 # include <time.h>
 # include <sys/time.h>
@@ -19,9 +12,6 @@
 #else
 # include <time.h>
 #endif
-#ifdef OS2
-# include <sys/timeb.h>
-#endif
   
 #include <p2c/p2c.h>
 
@@ -33,34 +23,16 @@
 #include <p2c/sysdevs.h>
 #endif
 
-#ifdef OS2
-
-long sysclock()
+long systclock()
 {
-
-  struct timeb tm;
-
-  _ftime(&tm);
-
-  return((long)(tm.time % 86400) * 100 + tm.millitm / 10);
-
-}
-
-#else
-
-long sysclock()
-{
-
   struct timeval time;
   struct timezone tz;
 
   gettimeofday(&time, &tz);
 
-  return(time.tv_sec % 86400 * 100 + time.tv_usec / 10000);   
-
+  return(time.tv_sec % 86400 * 100 + time.tv_usec / 10000);
 }
 
-#endif
 
 void sysdate(thedate)
 daterec *thedate;
@@ -75,26 +47,6 @@ daterec *thedate;
   thedate->month = t->tm_mon+1;
 }
 
-#ifdef OS2
-void systime(thetime)
-     timerec *thetime;
-{
-  
-  struct timeb time;
-  struct tm *t;
-  long temp; /* G. Liu + */
-  
-  _ftime(&time);
-  temp = time.time;
-  t = localtime(&temp);
-  thetime->hour = t->tm_hour;
-  thetime->minute = t->tm_min;
-  thetime->centisecond = t->tm_sec*100 + time.millitm/10;
-
-}
-
-#else
-
 void systime(thetime)
      timerec *thetime;
 {
@@ -111,8 +63,6 @@ void systime(thetime)
   thetime->centisecond = t->tm_sec*100 + time.tv_usec/10000;
 }
 
-#endif
-
 void SETRUNLIGHT(c)
 char c;
 {
-- 
GitLab