diff --git a/pkg/cl/unop.c b/pkg/cl/unop.c
index 45d64b9..44004c5 100644
--- a/pkg/cl/unop.c
+++ b/pkg/cl/unop.c
@@ -260,7 +260,7 @@ int	opcode;
 	    break;
 	case OP_NINT:
 	    if (in_type == OT_REAL)
-		iresult = nint (rval);
+	        iresult = (int)(rval + 0.5);
 	    else
 		iresult = ival;
 	    break;
diff --git a/pkg/ecl/mkpkg b/pkg/ecl/mkpkg
index b6b75b6..95fd3c0 100644
--- a/pkg/ecl/mkpkg
+++ b/pkg/ecl/mkpkg
@@ -6,9 +6,10 @@ $exit
 update:					# make ecl.e and install in bin$
         $ifeq (MACH, sparc) then
             $set    XFLAGS          = "$(XFLAGS) -/DNO_READLINE"
-        $else
+        $else $ifneq (MACH, linux, linux64) then
             $call   libs@readline
         $endif
+        $endif
 	$call	relink
 	$call	install
 	;
@@ -26,7 +27,7 @@ relink:
 	    $endif
 	    $ifolder (ytab.c,  grammar.y)
 		$echo "rebuilding ytab.c"
-		$ifeq (MACH, linux, redhat, suse)
+		$ifeq (MACH, linux, linux64, redhat, suse)
 		    !yacc -vd grammar.y; 
 		    !egrep -v "\<stdlib.h\>" y.tab.c > ytab.c; 
 		    !egrep -v "\<stdio.h\>" ytab.c > ntab.c; mv ntab.c ytab.c
@@ -53,8 +54,9 @@ relink:
 
 	$ifeq (MACH, sparc) then
 	    $set    XFLAGS          = "$(XFLAGS) -/DNO_READLINE"
-	$else
+	$else  $ifneq (MACH, linux, linux64) then
 	    $call	libs@readline
+        $endif
 	$endif
 
 	$update libpkg.a
@@ -71,10 +73,13 @@ link:
 	$set	LIBS = "-lc -lcur -lds -lstg"
 	$ifneq (MACH, sparc) then
 	  $ifeq (MACH, linux) then
-	    $set	LIBS2 = "libreadline.a -/L/usr/lib32 -lncurses"
-	  $else
+	    $set	LIBS2 = "-lreadline -/L/usr/lib32 -lncurses"
+	  $else $ifeq (MACH, linux64) then
+	    $set	LIBS2 = "-lreadline -lncurses"
+    	  $else
 	    $set	LIBS2 = "libreadline.a -lncurses"
 	  $endif
+	  $endif
 	$else
 	$set	LIBS2 = ""
 	$endif
diff --git a/pkg/ecl/unop.c b/pkg/ecl/unop.c
index 1e944b5..862bd8d 100644
--- a/pkg/ecl/unop.c
+++ b/pkg/ecl/unop.c
@@ -294,7 +294,7 @@ unop (int opcode)
 	    break;
 	case OP_NINT:
 	    if (in_type == OT_REAL)
-		iresult = nint (rval);
+	        iresult = (int)(rval + 0.5);
 	    else
 		iresult = ival;
 	    break;
diff --git a/pkg/vocl/mkpkg b/pkg/vocl/mkpkg
index 316efc4..f52fd6f 100644
--- a/pkg/vocl/mkpkg
+++ b/pkg/vocl/mkpkg
@@ -6,9 +6,10 @@ $exit
 update:					# make vocl.e and install in bin$
         $ifeq (MACH, sparc) then
             $set    XFLAGS          = "$(XFLAGS) -/DNO_READLINE"
-        $else
+        $else $ifneq (MACH, linux, linux64) then
             $call   libs@readline
         $endif
+        $endif
 	$call	relink
 	$call	install
 	;
@@ -26,7 +27,7 @@ relink:
 	    $endif
 	    $ifolder (ytab.c,  grammar.y)
 		$echo "rebuilding ytab.c"
-		$ifeq (MACH, linux, redhat, suse)
+		$ifeq (MACH, linux, linux64, redhat, suse)
 		    !yacc -vd grammar.y; 
 		    !egrep -v "\<stdlib.h\>" y.tab.c > ytab.c; 
 		    !egrep -v "\<stdio.h\>" ytab.c > ntab.c; mv ntab.c ytab.c
@@ -53,8 +54,9 @@ relink:
 
 	$ifeq (MACH, sparc) then
 	    $set    XFLAGS          = "$(XFLAGS) -/DNO_READLINE"
-	$else
+	$else  $ifneq (MACH, linux, linux64) then
 	    $call	libs@readline
+        $endif
 	$endif
 
 	$update libpkg.a
@@ -71,10 +73,13 @@ link:
 	$set	LIBS = "-lc -lcur -lds -lstg"
 	$ifneq (MACH, sparc) then
 	  $ifeq (MACH, linux) then
-	    $set	LIBS2 = "libreadline.a -/L/usr/lib32 -lncurses"
-	  $else
+	    $set	LIBS2 = "-lreadline -/L/usr/lib32 -lncurses"
+	  $else $ifeq (MACH, linux64) then
+	    $set	LIBS2 = "-lreadline -lncurses"
+    	  $else
 	    $set	LIBS2 = "libreadline.a -lncurses"
 	  $endif
+	  $endif
 	$else
 	$set	LIBS2 = ""
 	$endif
diff --git a/pkg/vocl/unop.c b/pkg/vocl/unop.c
index 9289341..8427bd44 100644
--- a/pkg/vocl/unop.c
+++ b/pkg/vocl/unop.c
@@ -294,7 +294,7 @@ unop (int opcode)
 	    break;
 	case OP_NINT:
 	    if (in_type == OT_REAL)
-		iresult = nint (rval);
+   	        iresult = (int)(rval + 0.5);
 	    else
 		iresult = ival;
 	    break;
diff --git a/unix/boot/mkpkg/fncache.c b/unix/boot/mkpkg/fncache.c
index 3f4cb00..f7ff12f 100644
--- a/unix/boot/mkpkg/fncache.c
+++ b/unix/boot/mkpkg/fncache.c
@@ -68,7 +68,7 @@ int	maxch;
 	 */
 	fn_misses++;
 	fnlen = os_sysfile (lname, fname, maxch);
-	if (fnlen > SZ_FNAME || strlen(lname) > SZ_LNAME)
+	if (strlen(fname) > SZ_FNAME || strlen(lname) > SZ_LNAME)
 	    return (fnlen);
 
 	/* Put fname in the cache.  Reuse slot at tail of list.
diff --git a/unix/boot/spp/rpp/ratlibf/delete.f b/unix/boot/spp/rpp/ratlibf/delete.f
index 92d5fb3..66abca3 100644
--- a/unix/boot/spp/rpp/ratlibf/delete.f
+++ b/unix/boot/spp/rpp/ratlibf/delete.f
@@ -1,7 +1,7 @@
       subroutine delete (symbol, st)
       integer symbol (100)
       integer st
-      integer mem( 1)
+      integer mem( 60000)
       common/cdsmem/mem
       integer stlu
       integer node, pred
diff --git a/unix/boot/spp/rpp/ratlibf/dsdbiu.f b/unix/boot/spp/rpp/ratlibf/dsdbiu.f
index 62efd56..db6f9ff 100644
--- a/unix/boot/spp/rpp/ratlibf/dsdbiu.f
+++ b/unix/boot/spp/rpp/ratlibf/dsdbiu.f
@@ -1,7 +1,7 @@
       subroutine dsdbiu (b, form)
       integer b
       integer form
-      integer mem( 1)
+      integer mem( 60000)
       common/cdsmem/mem
       integer l, s, lmax
       integer blanks(6)
diff --git a/unix/boot/spp/rpp/ratlibf/dsdump.f b/unix/boot/spp/rpp/ratlibf/dsdump.f
index 366bd5c..80f60b0 100644
--- a/unix/boot/spp/rpp/ratlibf/dsdump.f
+++ b/unix/boot/spp/rpp/ratlibf/dsdump.f
@@ -1,6 +1,6 @@
       subroutine dsdump (form)
       integer form
-      integer mem( 1)
+      integer mem( 60000)
       common/cdsmem/mem
       integer p, t, q
       t = 2
diff --git a/unix/boot/spp/rpp/ratlibf/dsfree.f b/unix/boot/spp/rpp/ratlibf/dsfree.f
index 8ab2f2a..ef8ea9d 100644
--- a/unix/boot/spp/rpp/ratlibf/dsfree.f
+++ b/unix/boot/spp/rpp/ratlibf/dsfree.f
@@ -1,6 +1,6 @@
       subroutine dsfree (block)
       integer block
-      integer mem( 1)
+      integer mem( 60000)
       common/cdsmem/mem
       integer p0, p, q
       integer n, junk
diff --git a/unix/boot/spp/rpp/ratlibf/dsget.f b/unix/boot/spp/rpp/ratlibf/dsget.f
index ef4fbcf..e53cab4 100644
--- a/unix/boot/spp/rpp/ratlibf/dsget.f
+++ b/unix/boot/spp/rpp/ratlibf/dsget.f
@@ -1,6 +1,6 @@
       integer function dsget (w)
       integer w
-      integer mem( 1)
+      integer mem( 60000)
       common/cdsmem/mem
       integer p, q, l
       integer n, k, junk
diff --git a/unix/boot/spp/rpp/ratlibf/dsinit.f b/unix/boot/spp/rpp/ratlibf/dsinit.f
index 9eb0eba..dd143b2 100644
--- a/unix/boot/spp/rpp/ratlibf/dsinit.f
+++ b/unix/boot/spp/rpp/ratlibf/dsinit.f
@@ -1,6 +1,6 @@
       subroutine dsinit (w)
       integer w
-      integer mem( 1)
+      integer mem( 60000)
       common/cdsmem/mem
       integer t
       if (.not.(w .lt. 2 * 2 + 2))goto 23000
diff --git a/unix/boot/spp/rpp/ratlibf/enter.f b/unix/boot/spp/rpp/ratlibf/enter.f
index 6711c57..d605967 100644
--- a/unix/boot/spp/rpp/ratlibf/enter.f
+++ b/unix/boot/spp/rpp/ratlibf/enter.f
@@ -2,7 +2,7 @@
       integer symbol (100)
       integer info (100)
       integer st
-      integer mem( 1)
+      integer mem( 60000)
       common/cdsmem/mem
       integer i, nodsiz, j
       integer stlu, length
diff --git a/unix/boot/spp/rpp/ratlibf/length.f b/unix/boot/spp/rpp/ratlibf/length.f
index 4bf20e4..fa6ff66 100644
--- a/unix/boot/spp/rpp/ratlibf/length.f
+++ b/unix/boot/spp/rpp/ratlibf/length.f
@@ -1,5 +1,5 @@
       integer function length (str)
-      integer str (100)
+      integer str (*)
       length = 0
 23000 if (.not.(str (length+1) .ne. -2))goto 23002
 23001 length = length + 1
diff --git a/unix/boot/spp/rpp/ratlibf/lookup.f b/unix/boot/spp/rpp/ratlibf/lookup.f
index f70e984..1e7a33b 100644
--- a/unix/boot/spp/rpp/ratlibf/lookup.f
+++ b/unix/boot/spp/rpp/ratlibf/lookup.f
@@ -2,7 +2,7 @@
       integer symbol (100)
       integer info (100)
       integer st
-      integer mem( 1)
+      integer mem( 60000)
       common/cdsmem/mem
       integer i, nodsiz, kluge
       integer stlu
diff --git a/unix/boot/spp/rpp/ratlibf/mktabl.f b/unix/boot/spp/rpp/ratlibf/mktabl.f
index 9c3e790..6e7c83f 100644
--- a/unix/boot/spp/rpp/ratlibf/mktabl.f
+++ b/unix/boot/spp/rpp/ratlibf/mktabl.f
@@ -1,6 +1,6 @@
       integer function mktabl (nodsiz)
       integer nodsiz
-      integer mem( 1)
+      integer mem( 60000)
       common/cdsmem/mem
       integer st
       integer dsget
diff --git a/unix/boot/spp/rpp/ratlibf/rmtabl.f b/unix/boot/spp/rpp/ratlibf/rmtabl.f
index 5b552ca..e6d62d5 100644
--- a/unix/boot/spp/rpp/ratlibf/rmtabl.f
+++ b/unix/boot/spp/rpp/ratlibf/rmtabl.f
@@ -1,6 +1,6 @@
       subroutine rmtabl (st)
       integer st
-      integer mem( 1)
+      integer mem( 60000)
       common/cdsmem/mem
       integer i
       integer walker, bucket, node
diff --git a/unix/boot/spp/rpp/ratlibf/scopy.f b/unix/boot/spp/rpp/ratlibf/scopy.f
index a16bc5e..8d0e686 100644
--- a/unix/boot/spp/rpp/ratlibf/scopy.f
+++ b/unix/boot/spp/rpp/ratlibf/scopy.f
@@ -1,5 +1,5 @@
       subroutine scopy (from, i, to, j)
-      integer from (100), to (100)
+      integer from (*), to (*)
       integer i, j
       integer k1, k2
       k2 = j
diff --git a/unix/boot/spp/rpp/ratlibf/sctabl.f b/unix/boot/spp/rpp/ratlibf/sctabl.f
index 1ba1689..4e04a91 100644
--- a/unix/boot/spp/rpp/ratlibf/sctabl.f
+++ b/unix/boot/spp/rpp/ratlibf/sctabl.f
@@ -2,7 +2,7 @@
       integer table, posn
       integer sym (100)
       integer info (100)
-      integer mem( 1)
+      integer mem( 60000)
       common/cdsmem/mem
       integer bucket, walker
       integer dsget
diff --git a/unix/boot/spp/rpp/ratlibf/stlu.f b/unix/boot/spp/rpp/ratlibf/stlu.f
index 6cfbd0a..cacc6cd 100644
--- a/unix/boot/spp/rpp/ratlibf/stlu.f
+++ b/unix/boot/spp/rpp/ratlibf/stlu.f
@@ -1,7 +1,7 @@
       integer function stlu (symbol, node, pred, st)
       integer symbol (100)
       integer node, pred, st
-      integer mem( 1)
+      integer mem( 60000)
       common/cdsmem/mem
       integer hash, i, j, nodsiz
       nodsiz = mem (st)
diff --git a/unix/boot/spp/rpp/rppfor/ludef.f b/unix/boot/spp/rpp/rppfor/ludef.f
index 3db6c8f..a525f51 100644
--- a/unix/boot/spp/rpp/rppfor/ludef.f
+++ b/unix/boot/spp/rpp/rppfor/ludef.f
@@ -1,5 +1,5 @@
       integer function ludef (id, defn, table)
-      integer id (100), defn (100)
+      integer id (*), defn (*)
       integer table
       common /cdefio/ bp, buf (4096)
       integer bp
diff --git a/unix/boot/spp/rpp/rppfor/pbstr.f b/unix/boot/spp/rpp/rppfor/pbstr.f
index da3a12a..08529d6 100644
--- a/unix/boot/spp/rpp/rppfor/pbstr.f
+++ b/unix/boot/spp/rpp/rppfor/pbstr.f
@@ -1,8 +1,11 @@
       subroutine pbstr (s)
-      integer s(100)
+      integer s(*)
       integer lenstr, i
       integer length
       lenstr = length (s)
+      if (lenstr .eq. 0) then 
+         return
+      endif
       if (.not.(s(1) .eq. 46 .and. s(lenstr) .eq. 46))goto 23000
       if (.not.(lenstr .eq. 4))goto 23002
       if (.not.(s(2) .eq. 103))goto 23004
diff --git a/unix/boot/spp/rpp/rppfor/puttok.f b/unix/boot/spp/rpp/rppfor/puttok.f
index 41d4df6..70f9672 100644
--- a/unix/boot/spp/rpp/rppfor/puttok.f
+++ b/unix/boot/spp/rpp/rppfor/puttok.f
@@ -1,5 +1,5 @@
       subroutine puttok (str)
-      integer str (100)
+      integer str (*)
       integer i
       i = 1
 23000 if (.not.(str (i) .ne. -2))goto 23002
diff --git a/unix/boot/spp/rpp/rppfor/sdupl.f b/unix/boot/spp/rpp/rppfor/sdupl.f
index 0d35237..e711d42 100644
--- a/unix/boot/spp/rpp/rppfor/sdupl.f
+++ b/unix/boot/spp/rpp/rppfor/sdupl.f
@@ -1,5 +1,5 @@
       integer function sdupl (str)
-      integer str (100)
+      integer str (*)
       integer mem( 60000)
       common/cdsmem/mem
       integer i
diff --git a/unix/boot/spp/xc.c b/unix/boot/spp/xc.c
index 813df0e..f901638 100644
--- a/unix/boot/spp/xc.c
+++ b/unix/boot/spp/xc.c
@@ -1213,7 +1213,12 @@ passflag:		    mkobject = YES;
 		arglist[nargs++] = mkfname (IRAFLIB6);
 	    }
 	}
-
+#ifdef HOST_CURL
+	arglist[nargs++] = "-lcurl";
+#endif
+#ifdef HOST_EXPAT
+	arglist[nargs++] = "-lexpat";
+#endif
 	/* Host libraries, searched after iraf libraries. */
 	for (i=0;  i < nhlibs;  i++)
 	    arglist[nargs++] = hlibs[i];
@@ -1360,6 +1365,7 @@ int *p_nargs;
 		    link_static = 1;
 	        } else if (strcmp (lflag, F_SHARED) == 0) {
 		    link_static = 0;
+#ifndef HOST_F2C
 #if defined(LINUX) || defined(BSD) || defined(X86) || defined(MACOSX)
 	        } else if ((strcmp (lflag, "-lf2c") == 0) || 
 	    	    (strcmp (lflag, "-lcompat") == 0)) {
@@ -1369,8 +1375,10 @@ int *p_nargs;
 		        arglist[nargs++] = mkfname (lflag);
 		        *p_nargs = nargs;
 		        return (1);
-	        }
 #endif
+#endif
+	        }
+
 #ifdef SOLARIS
 	        else if (strcmp (lflag, "-ldl") == 0) {
 		    /* This beastie has to be linked dynamic on Solaris, but
diff --git a/unix/hlib/irafuser.csh b/unix/hlib/irafuser.csh
index a72270a..cf6d4d5 100644
--- a/unix/hlib/irafuser.csh
+++ b/unix/hlib/irafuser.csh
@@ -1,59 +1,8 @@
 # IRAF definitions for the UNIX/csh user.  The additional variables iraf$ and
 # home$ should be defined in the user's .login file.
 
-
-set old_method		= 0
-
-if ($old_method == 1) then
-
-setenv OS_MACH	`uname -s | tr '[A-Z]' '[a-z]' | cut -c1-6`
-
-if (`uname -m` == "x86_64") then
-    if ($OS_MACH == "darwin") then
-        setenv MACH darwin
-        setenv IRAFARCH darwin
-    else
-        setenv MACH linux64
-        setenv IRAFARCH linux64
-    endif
-else if (-f /etc/redhat-release) then
-    setenv MACH redhat
-else
-    setenv MACH		`uname -s | tr '[A-Z]' '[a-z]'`
-endif
-
-if ($MACH == "darwin") then
-    # Let the IRAFARCH override the machine to support cross compilation.
-    if ($?IRAFARCH) then
-        if ("$IRAFARCH" == "macosx") then
-	    setenv MACH macosx
-        else if ("$IRAFARCH" == "macintel") then
-	    setenv MACH macintel
-        endif
-    else
-        if ("`uname -m`" == "i386") then
-            setenv MACH macosx
-            setenv IRAFARCH macosx
-        else if ("`uname -m`" == "x86_64") then
-            setenv MACH macintel
-            setenv IRAFARCH macintel
-        else 
-            setenv MACH ipad
-            setenv IRAFARCH ipad
-        endif
-    endif
-else if ($OS_MACH == "cygwin") then
-    setenv MACH cygwin
-endif
-
-else		# old_method
-            
-    setenv MACH 	`$iraf/unix/hlib/irafarch.csh`
-    setenv IRAFARCH 	`$iraf/unix/hlib/irafarch.csh`
-            
-endif		# old_method
-
-
+setenv MACH 	`$iraf/unix/hlib/irafarch.csh`
+setenv IRAFARCH 	`$iraf/unix/hlib/irafarch.csh`
 
 setenv	hostid	unix
 setenv	host	${iraf}unix/
@@ -64,7 +13,7 @@ setenv	tmp	/tmp/
 # Default to GCC for compilation.
 setenv	CC	gcc
 setenv	F77	$hlib/f77.sh
-setenv	F2C	$hbin/f2c.e
+setenv	F2C	/usr/bin/f2c
 setenv	RANLIB	ranlib
 
 switch ($MACH)
@@ -123,8 +72,8 @@ case ipad:
     breaksw
 
 case linux64:
-    setenv HSI_CF "-g -DLINUX -DREDHAT -DPOSIX -DSYSV -DLINUX64 -DMACH64 -w -m64"
-    setenv HSI_XF "-g -Inolibc -w -/m64 -/Wunused"
+    setenv HSI_CF "-g -O2 -I/usr/include -I${hlib}libc -DLINUX -DREDHAT -DPOSIX -DSYSV -DLINUX64 -DMACH64 -w -m64 -DNOLIBCNAMES -DHOST_F2C -DHOST_CURL -DHOST_EXPAT"
+    setenv HSI_XF "-g -Inolibc -I${hlib}libc -w -/m64 -/Wunused"
     setenv HSI_FF "-g -m64 -DBLD_KERNEL"
     setenv HSI_LF "-m64 "
     setenv HSI_F77LIBS ""
@@ -135,8 +84,8 @@ case linux64:
 
 case linux:
 case redhat:
-    setenv HSI_CF "-O -DLINUX -DREDHAT -DPOSIX -DSYSV -w -m32 -Wunused"
-    setenv HSI_XF "-Inolibc -w -/Wunused -/m32"
+    setenv HSI_CF "-g -O2 -I/usr/include -I${hlib}libc -DLINUX -DREDHAT -DPOSIX -DSYSV -w -m32 -Wunused -DHOST_F2C -DHOST_CURL -DHOST_EXPAT -DHOST_XMLRPC"
+    setenv HSI_XF "-Inolibc -I${hlib}libc -w -/Wunused -/m32"
     setenv HSI_FF "-O -DBLD_KERNEL -m32"
     setenv HSI_LF "-m32"
     setenv HSI_F77LIBS ""
@@ -191,10 +140,10 @@ setenv HSI_XF  "-I${HOME}/.iraf/ $HSI_XF"
 # The following determines whether or not the VOS is used for filename mapping.
 if (-f ${iraf}lib/libsys.a) then
 	setenv	HSI_LIBS\
-    "${hlib}libboot.a ${iraf}lib/libsys.a ${iraf}lib/libvops.a ${hlib}libos.a ${hbin}libf2c.a -lm"
+    "${hbin}libboot.a ${iraf}lib/libsys.a ${iraf}lib/libvops.a -lf2c ${hbin}libos.a"
 else
 	setenv	HSI_CF "$HSI_CF -DNOVOS"
-	setenv	HSI_LIBS "${hlib}libboot.a ${hlib}libos.a"
+	setenv	HSI_LIBS "${hbin}libboot.a ${hbin}libos.a"
 endif
 
 setenv HSI_LIBS "$HSI_LIBS $HSI_OSLIBS"
diff --git a/unix/hlib/libc/ctype.h b/unix/hlib/libc/ctype.h
deleted file mode 100644
index e2d3fb5..0000000
--- a/unix/hlib/libc/ctype.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#define	_U	01
-#define	_L	02
-#define	_N	04
-#define	_S	010
-#define _P	020
-#define _C	040
-#define _X	0100
-
-#ifdef vms
-globalvalue   vms_ctype_defs;
-#endif
-extern	char	u_ctype_[];
-
-#define	isalpha(c)	((u_ctype_+1)[(unsigned int)(c)]&(_U|_L))
-#define	isupper(c)	((u_ctype_+1)[(unsigned int)(c)]&_U)
-#define	islower(c)	((u_ctype_+1)[(unsigned int)(c)]&_L)
-#define	isdigit(c)	((u_ctype_+1)[(unsigned int)(c)]&_N)
-#define	isxdigit(c)	((u_ctype_+1)[(unsigned int)(c)]&(_N|_X))
-#define	isspace(c)	((u_ctype_+1)[(unsigned int)(c)]&_S)
-#define ispunct(c)	((u_ctype_+1)[(unsigned int)(c)]&_P)
-#define isalnum(c)	((u_ctype_+1)[(unsigned int)(c)]&(_U|_L|_N))
-#define isprint(c)	((u_ctype_+1)[(unsigned int)(c)]&(_P|_U|_L|_N))
-#define iscntrl(c)	((u_ctype_+1)[(unsigned int)(c)]&_C)
-#define isascii(c)	((unsigned)((int)(c))<=0177)
-
-#define toupper(c)	((c)-'a'+'A')
-#define tolower(c)	((c)-'A'+'a')
-#define toascii(c)	((c)&0177)
-#define	tointeg(c)	((c)-'0')
-#define	todigit(c)	((c)+'0')
-
-#define D_ctype
diff --git a/unix/hlib/libc/iraf.h b/unix/hlib/libc/iraf.h
index 9e5ee88..9e8b7a4 100644
--- a/unix/hlib/libc/iraf.h
+++ b/unix/hlib/libc/iraf.h
@@ -5,6 +5,8 @@
  * scans this file at run time to get the logical directory definitions.
  */
 
+#undef abs
+
 #ifndef D_iraf
 /* ### Start of run time definitions */
 #define	HOST		"/iraf/iraf/unix/"
@@ -12,7 +14,7 @@
 #define	TMP		"/tmp/"
 /* ### End of run time definitions */
 
-/* Compile time definitions (for C #ifdefs).
+/* Compile time definitions 
  */
 /* #define BSDUNIX */
 /* #define SUNOS4 */
@@ -20,89 +22,90 @@
 #define D_iraf
 #endif
 
-/* Include any header files specified in "#define import_XXX" statements
+/* Include any header files specified in #define import_XXX statements
  * before we were called.
  */
 #ifdef import_libc
 #ifndef D_libc
-#include "/iraf/iraf/unix/hlib/libc/libc.h"
+#include "libc.h"
 #endif
 #undef import_libc
 #endif
 
 #ifdef import_spp
 #ifndef D_spp
-#include "/iraf/iraf/unix/hlib/libc/spp.h"
+#include "spp.h"
 #endif
 #undef import_spp
 #endif
 
 #ifdef import_main
 #ifndef D_main
-#include "/iraf/iraf/unix/hlib/libc/main.h"
+#include "main.h"
 #endif
 #undef import_main
 #endif
 
 #ifdef import_stdio
 #ifndef D_stdio
-#include "/iraf/iraf/unix/hlib/libc/stdio.h"
+
+#include "iraf/stdio.h"
 #endif
 #undef import_stdio
 #endif
 
 #ifdef import_error
 #ifndef D_error
-#include "/iraf/iraf/unix/hlib/libc/error.h"
+#include "error.h"
 #endif
 #undef import_error
 #endif
 
 #ifdef import_ctype
 #ifndef D_ctype
-#include "/iraf/iraf/unix/hlib/libc/ctype.h"
+#include "iraf/ctype.h"
 #endif
 #undef import_ctype
 #endif
 
 #ifdef import_finfo
 #ifndef D_finfo
-#include "/iraf/iraf/unix/hlib/libc/finfo.h"
+#include "finfo.h"
 #endif
 #undef import_finfo
 #endif
 
 #ifdef import_fset
 #ifndef D_fset
-#include "/iraf/iraf/unix/hlib/libc/fset.h"
+#include "fset.h"
 #endif
 #undef import_fset
 #endif
 
 #ifdef import_fpoll
 #ifndef D_fpoll
-#include "/iraf/iraf/unix/hlib/libc/fpoll.h"
+#include "fpoll.h"
 #endif
 #undef import_fpoll
 #endif
 
 #ifdef import_kernel
 #ifndef D_kernel
-#include "/iraf/iraf/unix/hlib/libc/kernel.h"
+#include "kernel.h"
 #endif
 #undef import_kernel
 #endif
 
 #ifdef import_xnames
 #ifndef D_xnames
-#include "/iraf/iraf/unix/hlib/libc/xnames.h"
+#include "xnames.h"
 #endif
 #undef import_xnames
 #endif
 
 #ifdef import_knames
 #ifndef D_knames
-#include "/iraf/iraf/unix/hlib/libc/knames.h"
+#include "knames.h"
 /*
 #include "/iraf/iraf/unix/hlib/libc/kproto.h"
 */
@@ -112,77 +115,77 @@
 
 #ifdef import_setjmp
 #ifndef D_setjmp
-#include "/iraf/iraf/unix/hlib/libc/setjmp.h"
+#include <setjmp.h>
 #endif
 #undef import_setjmp
 #endif
 
 #ifdef import_xwhen
 #ifndef D_xwhen
-#include "/iraf/iraf/unix/hlib/libc/xwhen.h"
+#include "xwhen.h"
 #endif
 #undef import_xwhen
 #endif
 
 #ifdef import_protect
 #ifndef D_protect
-#include "/iraf/iraf/unix/hlib/libc/protect.h"
+#include "protect.h"
 #endif
 #undef import_protect
 #endif
 
 #ifdef import_prtype
 #ifndef D_prtype
-#include "/iraf/iraf/unix/hlib/libc/prtype.h"
+#include "prtype.h"
 #endif
 #undef import_prtype
 #endif
 
 #ifdef import_zfstat
 #ifndef D_zfstat
-#include "/iraf/iraf/unix/hlib/libc/zfstat.h"
+#include "zfstat.h"
 #endif
 #undef import_zfstat
 #endif
 
 #ifdef import_alloc
 #ifndef D_alloc
-#include "/iraf/iraf/unix/hlib/libc/alloc.h"
+#include "alloc.h"
 #endif
 #undef import_alloc
 #endif
 
 #ifdef import_math
 #ifndef D_math
-#include "/iraf/iraf/unix/hlib/libc/math.h"
+#include <math.h>
 #endif
 #undef import_math
 #endif
 
 #ifdef import_prstat
 #ifndef D_prstat
-#include "/iraf/iraf/unix/hlib/libc/prstat.h"
+#include "prstat.h"
 #endif
 #undef import_prstat
 #endif
 
 #ifdef import_lexnum
 #ifndef D_lexnum
-#include "/iraf/iraf/unix/hlib/libc/lexnum.h"
+#include "lexnum.h"
 #endif
 #undef import_lexnum
 #endif
 
 #ifdef import_ttset
 #ifndef D_ttset
-#include "/iraf/iraf/unix/hlib/libc/ttset.h"
+#include "ttset.h"
 #endif
 #undef import_ttset
 #endif
 
 #ifdef import_stdarg
 #ifndef D_stdarg
-#include "/iraf/iraf/unix/hlib/libc/stdarg.h"
+#include <stdarg.h>
 #endif
 #undef import_stdarg
 #endif
diff --git a/unix/hlib/libc/iraf/ctype.h b/unix/hlib/libc/iraf/ctype.h
new file mode 100644
index 0000000..e2d3fb5
--- /dev/null
+++ b/unix/hlib/libc/iraf/ctype.h
@@ -0,0 +1,32 @@
+#define	_U	01
+#define	_L	02
+#define	_N	04
+#define	_S	010
+#define _P	020
+#define _C	040
+#define _X	0100
+
+#ifdef vms
+globalvalue   vms_ctype_defs;
+#endif
+extern	char	u_ctype_[];
+
+#define	isalpha(c)	((u_ctype_+1)[(unsigned int)(c)]&(_U|_L))
+#define	isupper(c)	((u_ctype_+1)[(unsigned int)(c)]&_U)
+#define	islower(c)	((u_ctype_+1)[(unsigned int)(c)]&_L)
+#define	isdigit(c)	((u_ctype_+1)[(unsigned int)(c)]&_N)
+#define	isxdigit(c)	((u_ctype_+1)[(unsigned int)(c)]&(_N|_X))
+#define	isspace(c)	((u_ctype_+1)[(unsigned int)(c)]&_S)
+#define ispunct(c)	((u_ctype_+1)[(unsigned int)(c)]&_P)
+#define isalnum(c)	((u_ctype_+1)[(unsigned int)(c)]&(_U|_L|_N))
+#define isprint(c)	((u_ctype_+1)[(unsigned int)(c)]&(_P|_U|_L|_N))
+#define iscntrl(c)	((u_ctype_+1)[(unsigned int)(c)]&_C)
+#define isascii(c)	((unsigned)((int)(c))<=0177)
+
+#define toupper(c)	((c)-'a'+'A')
+#define tolower(c)	((c)-'A'+'a')
+#define toascii(c)	((c)&0177)
+#define	tointeg(c)	((c)-'0')
+#define	todigit(c)	((c)+'0')
+
+#define D_ctype
diff --git a/unix/hlib/libc/iraf/stdio.h b/unix/hlib/libc/iraf/stdio.h
new file mode 100644
index 0000000..c3cc0bd
--- /dev/null
+++ b/unix/hlib/libc/iraf/stdio.h
@@ -0,0 +1,99 @@
+/*
+ * U_STDIO.H -- C defines used to emulate the UNIX standard i/o package upon
+ * IRAF file i/o.  These definitions are portable, but highly dependent on
+ * the guts of IRAF FIO.
+ */
+
+#ifndef D_libc
+#ifndef import_libc
+#include "libc.h"
+#endif
+#endif
+
+#define	BUFSIZ		SZ_DEFIOBUF
+#define	_NFILE		FIO_MAXFD
+#define	FILE		struct _iobuf
+
+# ifndef NULL
+#define	NULL		0
+# endif
+# ifndef EOF
+#define	EOF		(-1)
+# endif
+
+/* Filler space is defined here to reduce clutter in the struct def below.
+ */
+#define	_F1		_filler1[_NFILE-1]
+#define	_F2		_filler2[_NFILE-1]
+#define	_F3		_filler3[_NFILE-1]
+#define	_F4		_filler4[_NFILE-1]
+#define	_F5		_filler5[_NFILE-1]
+#define	_F6		_filler6[_NFILE-1]
+#define	_F7		_filler7[_NFILE-1]
+
+/* The _iobuf structure is the C version of the FIO common /fiocom/, which
+ * contains all the FIO buffer and i/o pointers.  Each structure field is
+ * maintained in the common as an array of length _NFILE, hence in terms of
+ * C the structures are interleaved.  The file pointers are indices into
+ * the array Memc, an array of XCHAR.
+ */
+struct _iobuf {
+	XLONG	_boffset, _F1;		/* XCHAR file offset of buffer	*/
+	XINT	_bufptr,  _F2;		/* buffer pointer		*/
+	XINT	_buftop,  _F3;		/* pointer to top of buffer + 1	*/
+	XINT	_iop,     _F4;		/* pointer to next XCHAR	*/
+	XINT	_itop,    _F5;		/* call filbuf when _iop >=	*/
+	XINT	_otop,    _F6;		/* call flsbuf when _iop >=	*/
+	XINT	_fiodes,  _F7;		/* FIO file descriptor		*/
+	XINT	_fflags;		/* bit flags			*/
+};
+
+extern	XINT FIOCOM[];			/* the FIO common		*/
+
+#define	_FFLUSHNL	01		/* flush buffer on newline	*/
+#define	_FREAD		02		/* read perm on file		*/
+#define	_FWRITE		04		/* read perm on file		*/
+#define	_FEOF		010		/* file positioned to EOF	*/
+#define	_FERR		020		/* i/o error on file		*/
+#define _FKEEP		040		/* keep file open at exit	*/
+#define	_FFLUSH		0100		/* write to device on newline	*/
+#define	_FRAW		0200		/* raw input mode		*/
+#define	_FNDELAY	0400		/* nonblocking i/o		*/
+#define	_FPUSH		01000		/* data is pushed back		*/
+#define	_FIPC		02000		/* file is an IPC channel	*/
+
+/* Convert FILE pointers to and from FIO integer file descriptors.
+ */
+#define	FDTOFP(fd)	((FILE *)(&FIOCOM[(fd)-1]))
+#define	FPTOFD(fp)	((XINT)((XINT *)(fp) - FIOCOM + 1))
+
+#define	stdin		(FDTOFP(3))
+#define	stdout		(FDTOFP(4))
+#define	stderr		(FDTOFP(5))
+
+
+/* I/O macro defines.  I/O is assumed to be sequential, i.e., we do not check
+ * for _iop < _bufptr.  This is consistent with UNIX usage.  The getc and putc
+ * macros are quite efficient despite their complex appearance.
+ */
+#define	getchar()	fgetc(stdin)
+#define	getc(fp) \
+(((fp)->_iop >= (fp)->_itop) ? c_filbuf((fp)) : Memc[(fp)->_iop++] & 0377)
+
+#define	putchar(ch)	fputc((ch),stdout)
+#define	putc(ch,fp) \
+(((fp)->_iop >= (fp)->_otop || ((ch) == '\n' && (fp)->_fflags&_FFLUSH)) ? \
+c_flsbuf((unsigned)(ch),(fp)) : ((int)(Memc[(fp)->_iop++] = (unsigned)(ch))))
+
+#define	fileno(fp)	(FPTOFD((fp)))
+#define	feof(fp)	((fp)->_fflags & _FEOF)
+#define	ferror(fp)	((fp)->_fflags & _FERR)
+#define	clearerr(fp)	((fp)->_fflags &= ~_FERR)
+
+
+FILE	*fopen();
+FILE	*fdopen();
+char	*fgets();
+char	*gets();
+
+#define	D_stdio
diff --git a/unix/hlib/libc/kproto.h b/unix/hlib/libc/kproto.h
deleted file mode 100644
index df300f8..0000000
--- a/unix/hlib/libc/kproto.h
+++ /dev/null
@@ -1,496 +0,0 @@
-/*
- *  KPROTO.H -- IRAF Kernel prototype definitions.
- */
-
-#include <stdio.h>
-#include <time.h>               /* for time_t                   */
-#include <signal.h>             /* for siginfo_t                */
-
-#ifndef MACH64
-
-
-/* alloc.c */
-extern int main(int argc, char *argv[]);
-extern int alloc(char *argv[], int statonly);
-extern int dealloc(char *argv[]);
-extern int findsfs(char *argv[]);
-/* dio.c */
-extern int directio(int fd, int advice);
-/* getproc.c */
-extern int uid_executing(int uid);
-/* gmttolst.c */
-extern time_t gmt_to_lst(time_t gmt);
-/* irafpath.c */
-extern char *irafpath(char *fname);
-/* prwait.c */
-extern void pr_enter(int pid, int inchan, int outchan);
-extern int pr_wait(int pid);
-extern int pr_getipc(int pid, int *inchan, int *outchan);
-extern struct proctable *pr_findpid(int pid);
-extern void pr_release(int pid);
-/* tape.c */
-extern int main(int argc, char *argv[]);
-extern void mtop(int op, int count);
-extern char *nextcmd(FILE *in);
-extern char *gettok(void);
-extern char *prompt(void);
-extern void pstatus(void);
-extern void output(char *text);
-extern void phelp(void);
-/* zalloc.c */
-extern int zdvall_(shortint *aliases, int *allflg, int *status);
-extern int zdvown_(shortint *device, shortint *owner, int *maxch, int *status);
-extern int loggedin(int uid);
-/* zawset.c */
-extern int zawset_(int *best_size, int *new_size, int *old_size, int *max_size);
-/* zcall.c */
-extern int zcall0_(int *proc);
-extern int zcall1_(int *proc, void *arg1);
-extern int zcall2_(int *proc, void *arg1, void *arg2);
-extern int zcall3_(int *proc, void *arg1, void *arg2, void *arg3);
-extern int zcall4_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4);
-extern int zcall5_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5);
-extern int zcall6_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6);
-extern int zcall7_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7);
-extern int zcall8_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8);
-extern int zcall9_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8, void *arg9);
-extern int zcalla_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8, void *arg9, void *arg10);
-/* zdojmp.c */
-extern void zdojmp_(int *jmpbuf, int *status);
-/* zfacss.c */
-extern int zfacss_(shortint *fname, int *mode, int *type, int *status);
-/* zfaloc.c */
-extern int zfaloc_(shortint *fname, int *nbytes, int *status);
-/* zfchdr.c */
-extern int zfchdr_(shortint *newdir, int *status);
-/* zfdele.c */
-extern int zfdele_(shortint *fname, int *status);
-/* zfgcwd.c */
-extern int zfgcwd_(shortint *outstr, int *maxch, int *status);
-/* zfinfo.c */
-extern int zfinfo_(shortint *fname, int *finfo_struct, int *status);
-/* zfiobf.c */
-extern int zopnbf_(shortint *osfn, int *mode, int *chan);
-extern int zclsbf_(int *fd, int *status);
-extern int zardbf_(int *chan, shortint *buf, int *maxbytes, int *offset);
-extern int zawrbf_(int *chan, shortint *buf, int *nbytes, int *offset);
-extern int zawtbf_(int *fd, int *status);
-extern int zsttbf_(int *fd, int *param, int *lvalue);
-extern int _u_fmode(int mode);
-extern int vm_access(char *fname, int mode);
-extern int vm_delete(char *fname, int force);
-extern int vm_reservespace(long nbytes);
-extern int vm_largefile(long nbytes);
-extern int vm_directio(int fd, int flag);
-/* zfioks.c */
-extern int zopnks_(shortint *x_server, int *mode, int *chan);
-extern int zclsks_(int *chan, int *status);
-extern int zardks_(int *chan, shortint *buf, int *totbytes, int *loffset);
-extern int zawrks_(int *chan, shortint *buf, int *totbytes, int *loffset);
-extern int zawtks_(int *chan, int *status);
-extern int zsttks_(int *chan, int *param, int *lvalue);
-extern void pr_mask(char *str);
-/* zfiolp.c */
-extern int zopnlp_(shortint *printer, int *mode, int *chan);
-extern int zclslp_(int *chan, int *status);
-extern int zardlp_(int *chan, shortint *buf, int *maxbytes, int *offset);
-extern int zawrlp_(int *chan, shortint *buf, int *nbytes, int *offset);
-extern int zawtlp_(int *chan, int *status);
-extern int zsttlp_(int *chan, int *param, int *lvalue);
-/* zfiomt.c */
-extern int zzopmt_(shortint *device, int *acmode, shortint *devcap, int *devpos, int *newfile, int *chan);
-extern int zzclmt_(int *chan, int *devpos, int *o_status);
-extern int zzrdmt_(int *chan, shortint *buf, int *maxbytes, int *offset);
-extern int zzwrmt_(int *chan, shortint *buf, int *nbytes, int *offset);
-extern int zzwtmt_(int *chan, int *devpos, int *o_status);
-extern int zzstmt_(int *chan, int *param, int *lvalue);
-extern int zzrwmt_(shortint *device, shortint *devcap, int *o_status);
-/* zfiond.c */
-extern int zopnnd_(shortint *pk_osfn, int *mode, int *chan);
-extern int zclsnd_(int *fd, int *status);
-extern int zardnd_(int *chan, shortint *buf, int *maxbytes, int *offset);
-extern int zawrnd_(int *chan, shortint *buf, int *nbytes, int *offset);
-extern int zawtnd_(int *fd, int *status);
-extern int zsttnd_(int *fd, int *param, int *lvalue);
-/* zfiopl.c */
-extern int zopnpl_(shortint *plotter, int *mode, int *chan);
-extern int zclspl_(int *chan, int *status);
-extern int zardpl_(int *chan, shortint *buf, int *maxbytes, int *offset);
-extern int zawrpl_(int *chan, shortint *buf, int *nbytes, int *offset);
-extern int zawtpl_(int *chan, int *status);
-extern int zsttpl_(int *chan, int *param, int *lvalue);
-/* zfiopr.c */
-extern int zopcpr_(shortint *osfn, int *inchan, int *outchan, int *pid);
-extern int zclcpr_(int *pid, int *exit_status);
-extern int zardpr_(int *chan, shortint *buf, int *maxbytes, int *loffset);
-extern int zawrpr_(int *chan, shortint *buf, int *nbytes, int *loffset);
-extern int zawtpr_(int *chan, int *status);
-extern int zsttpr_(int *chan, int *param, int *lvalue);
-/* zfiosf.c */
-extern int zopnsf_(shortint *osfn, int *mode, int *chan);
-extern int zclssf_(int *fd, int *status);
-extern int zardsf_(int *chan, shortint *buf, int *maxbytes, int *offset);
-extern int zawrsf_(int *chan, shortint *buf, int *nbytes, int *offset);
-extern int zawtsf_(int *fd, int *status);
-extern int zsttsf_(int *fd, int *param, int *lvalue);
-/* zfiotx.c */
-extern int zopntx_(shortint *osfn, int *mode, int *chan);
-extern int zclstx_(int *fd, int *status);
-extern int zflstx_(int *fd, int *status);
-extern int zgettx_(int *fd, shortint *buf, int *maxchars, int *status);
-extern int znottx_(int *fd, int *offset);
-extern int zputtx_(int *fd, shortint *buf, int *nchars, int *status);
-extern int zsektx_(int *fd, int *znottx_offset, int *status);
-extern int zstttx_(int *fd, int *param, int *value);
-/* zfioty.c */
-extern int zopnty_(shortint *osfn, int *mode, int *chan);
-extern int zclsty_(int *fd, int *status);
-extern int zflsty_(int *fd, int *status);
-extern int zgetty_(int *fd, shortint *buf, int *maxchars, int *status);
-extern int znotty_(int *fd, int *offset);
-extern int zputty_(int *fd, shortint *buf, int *nchars, int *status);
-extern int zsekty_(int *fd, int *znotty_offset, int *status);
-extern int zsttty_(int *fd, int *param, int *value);
-/* zfmkcp.c */
-extern int zfmkcp_(shortint *osfn, shortint *new_osfn, int *status);
-/* zfmkdr.c */
-extern int zfmkdr_(shortint *newdir, int *status);
-/* zfnbrk.c */
-extern int zfnbrk_(shortint *vfn, int *uroot_offset, int *uextn_offset);
-/* zfpath.c */
-extern int zfpath_(shortint *osfn, shortint *pathname, int *maxch, int *nchars);
-/* zfpoll.c */
-extern int zfpoll_(int *pfds, int *nfds, int *timeout, int *npoll, int *status);
-/* zfprot.c */
-extern int zfprot_(shortint *fname, int *action, int *status);
-/* zfrnam.c */
-extern int zfrnam_(shortint *oldname, shortint *newname, int *status);
-/* zfrmdr.c */
-extern int zfrmdr_(shortint *dir, int *status);
-/* zfsubd.c */
-extern int zfsubd_(shortint *osdir, int *maxch, shortint *subdir, int *nchars);
-/* zfunc.c */
-extern int zfunc0_(int *proc);
-extern int zfunc1_(int *proc, void *arg1);
-extern int zfunc2_(int *proc, void *arg1, void *arg2);
-extern int zfunc3_(int *proc, void *arg1, void *arg2, void *arg3);
-extern int zfunc4_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4);
-extern int zfunc5_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5);
-extern int zfunc6_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6);
-extern int zfunc7_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7);
-extern int zfunc8_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8);
-extern int zfunc9_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8, void *arg9);
-extern int zfunca_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8, void *arg9, void *arg10);
-/* zfutim.c */
-extern int zfutim_(shortint *fname, int *atime, int *mtime, int *status);
-/* zfxdir.c */
-extern int zfxdir_(shortint *osfn, shortint *osdir, int *maxch, int *nchars);
-/* zgcmdl.c */
-extern int zgcmdl_(shortint *cmd, int *maxch, int *status);
-/* zghost.c */
-extern int zghost_(shortint *outstr, int *maxch);
-/* zglobl.c */
-/* zgmtco.c */
-extern int zgmtco_(int *gmtcor);
-/* zgtenv.c */
-extern int zgtenv_(shortint *envvar, shortint *outstr, int *maxch, int *status);
-/* zgtime.c */
-extern int zgtime_(int *clock_time, int *cpu_time);
-/* zgtpid.c */
-extern int zgtpid_(int *pid);
-/* zintpr.c */
-extern int zintpr_(int *pid, int *exception, int *status);
-/* zlocpr.c 
-extern int zlocpr_(PFI proc, int *o_epa);
-*/
-/* zlocva.c */
-extern int zlocva_(shortint *variable, int *location);
-/* zmain.c */
-extern int main(int argc, char *argv[]);
-/* zmaloc.c */
-extern int zmaloc_(int *buf, int *nbytes, int *status);
-/* zmfree.c */
-extern int zmfree_(int *buf, int *status);
-/* zopdir.c */
-extern int zopdir_(shortint *fname, int *chan);
-extern int zcldir_(int *chan, int *status);
-extern int zgfdir_(int *chan, shortint *outstr, int *maxch, int *status);
-/* zopdpr.c */
-extern int zopdpr_(shortint *osfn, shortint *bkgfile, shortint *queue, int *jobcode);
-extern int zcldpr_(int *jobcode, int *killflag, int *exit_status);
-/* zoscmd.c */
-extern int zoscmd_(shortint *oscmd, shortint *stdin_file, shortint *stdout_file, shortint *stderr_file, int *status);
-extern int pr_onint(int usig, int *hwcode, int *scp);
-/* zpanic.c */
-extern int zpanic_(int *errcode, shortint *errmsg);
-extern int kernel_panic(char *errmsg);
-/* zraloc.c */
-extern int zraloc_(int *buf, int *nbytes, int *status);
-/* zshlib.c */
-extern void vlibinit_(void);
-/* zwmsec.c */
-extern int zwmsec_(int *msec);
-/* zxwhen.c */
-extern int zxwhen_(int *sig_code, int *epa, int *old_epa);
-extern void ex_handler(int unix_signal, siginfo_t *info, void *ucp);
-extern int zxgmes_(int *os_exception, shortint *errmsg, int *maxch);
-/* zzepro.c */
-extern int zzepro_(void);
-/* zzexit.c */
-extern int exit_(int *code);
-/* zzpstr.c */
-extern int spp_debug(void);
-extern int zzpstr_(shortint *s1, shortint *s2);
-extern int zzlstr_(shortint *s1, shortint *s2);
-extern void spp_printstr(shortint *s);
-extern void spp_printmemc(int memc_ptr);
-/* zzsetk.c */
-extern int zzsetk_(char *ospn, char *osbfn, int prtype, int isatty, int in, int out);
-/* zzstrt.c */
-extern int zzstrt_(void);
-extern int zzstop_(void);
-extern void ready_(void);
-extern void mdump_(int *buf, int *nbytes);
-
-
-
-#else
-
-
-
-/* dio.c */
-extern int directio(int fd, int advice);
-/* getproc.c */
-extern int uid_executing(int uid);
-/* gmttolst.c */
-extern time_t gmt_to_lst(time_t gmt);
-/* irafpath.c */
-extern char *irafpath(char *fname);
-/* prwait.c */
-extern void pr_enter(int pid, int inchan, int outchan);
-extern int pr_wait(int pid);
-extern int pr_getipc(int pid, int *inchan, int *outchan);
-extern struct proctable *pr_findpid(int pid);
-extern void pr_release(int pid);
-/* zalloc.c */
-extern int zdvall_(shortint *aliases, long *allflg, long *status);
-extern int zdvown_(shortint *device, shortint *owner, long *maxch, long *status);
-extern int loggedin(int uid);
-/* zawset.c */
-extern int zawset_(long *best_size, long *new_size, long *old_size, long *max_size);
-/* zcall.c */
-/*
-extern int zcall0_(long *proc);
-extern int zcall1_(long *proc, void *arg1);
-extern int zcall2_(long *proc, void *arg1, void *arg2);
-extern int zcall3_(long *proc, void *arg1, void *arg2, void *arg3);
-extern int zcall4_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4);
-extern int zcall5_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5);
-extern int zcall6_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6);
-extern int zcall7_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7);
-extern int zcall8_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8);
-extern int zcall9_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8, void *arg9);
-extern int zcalla_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8, void *arg9, void *arg10);
-*/
-/* zdojmp.c */
-extern void zdojmp_(long *jmpbuf, long *status);
-/* zfacss.c */
-extern int zfacss_(shortint *fname, long *mode, long *type, long *status);
-/* zfaloc.c */
-extern int zfaloc_(shortint *fname, long *nbytes, long *status);
-/* zfchdr.c */
-extern int zfchdr_(shortint *newdir, long *status);
-/* zfdele.c */
-extern int zfdele_(shortint *fname, long *status);
-/* zfgcwd.c */
-extern int zfgcwd_(shortint *outstr, long *maxch, long *status);
-/* zfinfo.c */
-extern int zfinfo_(shortint *fname, long *finfo_struct, long *status);
-/* zfiobf.c */
-extern int zopnbf_(shortint *osfn, long *mode, long *chan);
-extern int zclsbf_(long *fd, long *status);
-extern int zardbf_(long *chan, shortint *buf, long *maxbytes, long *offset);
-extern int zawrbf_(long *chan, shortint *buf, long *nbytes, long *offset);
-extern int zawtbf_(long *fd, long *status);
-extern int zsttbf_(long *fd, long *param, long *lvalue);
-extern int _u_fmode(int mode);
-extern int vm_access(char *fname, int mode);
-extern int vm_delete(char *fname, int force);
-extern int vm_reservespace(long nbytes);
-extern int vm_largefile(long nbytes);
-extern int vm_directio(int fd, int flag);
-/* zfioks.c */
-extern int zopnks_(shortint *x_server, long *mode, long *chan);
-extern int zclsks_(long *chan, long *status);
-extern int zardks_(long *chan, shortint *buf, long *totbytes, long *loffset);
-extern int zawrks_(long *chan, shortint *buf, long *totbytes, long *loffset);
-extern int zawtks_(long *chan, long *status);
-extern int zsttks_(long *chan, long *param, long *lvalue);
-extern void pr_mask(char *str);
-/* zfiolp.c */
-extern int zopnlp_(shortint *printer, long *mode, long *chan);
-extern int zclslp_(long *chan, long *status);
-extern int zardlp_(long *chan, shortint *buf, long *maxbytes, long *offset);
-extern int zawrlp_(long *chan, shortint *buf, long *nbytes, long *offset);
-extern int zawtlp_(long *chan, long *status);
-extern int zsttlp_(long *chan, long *param, long *lvalue);
-/* zfiomt.c */
-extern int zzopmt_(shortint *device, long *acmode, shortint *devcap, long *devpos, long *newfile, long *chan);
-extern int zzclmt_(long *chan, long *devpos, long *o_status);
-extern int zzrdmt_(long *chan, shortint *buf, long *maxbytes, long *offset);
-extern int zzwrmt_(long *chan, shortint *buf, long *nbytes, long *offset);
-extern int zzwtmt_(long *chan, long *devpos, long *o_status);
-extern int zzstmt_(long *chan, long *param, long *lvalue);
-extern int zzrwmt_(shortint *device, shortint *devcap, long *o_status);
-/* zfiond.c */
-extern int zopnnd_(shortint *pk_osfn, long *mode, long *chan);
-extern int zclsnd_(long *fd, long *status);
-extern int zardnd_(long *chan, shortint *buf, long *maxbytes, long *offset);
-extern int zawrnd_(long *chan, shortint *buf, long *nbytes, long *offset);
-extern int zawtnd_(long *fd, long *status);
-extern int zsttnd_(long *fd, long *param, long *lvalue);
-/* zfiopl.c */
-extern int zopnpl_(shortint *plotter, long *mode, long *chan);
-extern int zclspl_(long *chan, long *status);
-extern int zardpl_(long *chan, shortint *buf, long *maxbytes, long *offset);
-extern int zawrpl_(long *chan, shortint *buf, long *nbytes, long *offset);
-extern int zawtpl_(long *chan, long *status);
-extern int zsttpl_(long *chan, long *param, long *lvalue);
-/* zfiopr.c */
-extern int zopcpr_(shortint *osfn, long *inchan, long *outchan, long *pid);
-extern int zclcpr_(long *pid, long *exit_status);
-extern int zardpr_(long *chan, shortint *buf, long *maxbytes, long *loffset);
-extern int zawrpr_(long *chan, shortint *buf, long *nbytes, long *loffset);
-extern int zawtpr_(long *chan, long *status);
-extern int zsttpr_(long *chan, long *param, long *lvalue);
-/* zfiosf.c */
-extern int zopnsf_(shortint *osfn, long *mode, long *chan);
-extern int zclssf_(long *fd, long *status);
-extern int zardsf_(long *chan, shortint *buf, long *maxbytes, long *offset);
-extern int zawrsf_(long *chan, shortint *buf, long *nbytes, long *offset);
-extern int zawtsf_(long *fd, long *status);
-extern int zsttsf_(long *fd, long *param, long *lvalue);
-/* zfiotx.c */
-extern int zopntx_(shortint *osfn, long *mode, long *chan);
-extern int zclstx_(long *fd, long *status);
-extern int zflstx_(long *fd, long *status);
-extern int zgettx_(long *fd, shortint *buf, long *maxchars, long *status);
-extern int znottx_(long *fd, long *offset);
-extern int zputtx_(long *fd, shortint *buf, long *nchars, long *status);
-extern int zsektx_(long *fd, long *znottx_offset, long *status);
-extern int zstttx_(long *fd, long *param, long *value);
-/* zfioty.c */
-extern int zopnty_(shortint *osfn, long *mode, long *chan);
-extern int zclsty_(long *fd, long *status);
-extern int zflsty_(long *fd, long *status);
-extern int zgetty_(long *fd, shortint *buf, long *maxchars, long *status);
-extern int znotty_(long *fd, long *offset);
-extern int zputty_(long *fd, shortint *buf, long *nchars, long *status);
-extern int zsekty_(long *fd, long *znotty_offset, long *status);
-extern int zsttty_(long *fd, long *param, long *value);
-/* zfmkcp.c */
-extern int zfmkcp_(shortint *osfn, shortint *new_osfn, long *status);
-/* zfmkdr.c */
-extern int zfmkdr_(shortint *newdir, long *status);
-/* zfnbrk.c */
-extern int zfnbrk_(shortint *vfn, long *uroot_offset, long *uextn_offset);
-/* zfpath.c */
-extern int zfpath_(shortint *osfn, shortint *pathname, long *maxch, long *nchars);
-/* zfpoll.c */
-extern int zfpoll_(long *pfds, long *nfds, long *timeout, long *npoll, long *status);
-/* zfprot.c */
-extern int zfprot_(shortint *fname, long *action, long *status);
-/* zfrnam.c */
-extern int zfrnam_(shortint *oldname, shortint *newname, long *status);
-/* zfsubd.c */
-extern int zfsubd_(shortint *osdir, long *maxch, shortint *subdir, long *nchars);
-/* zfunc.c */
-extern long zfunc0_(long *proc);
-extern long zfunc1_(long *proc, void *arg1);
-extern long zfunc2_(long *proc, void *arg1, void *arg2);
-extern long zfunc3_(long *proc, void *arg1, void *arg2, void *arg3);
-extern long zfunc4_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4);
-extern long zfunc5_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5);
-extern long zfunc6_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6);
-extern long zfunc7_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7);
-extern long zfunc8_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8);
-extern long zfunc9_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8, void *arg9);
-extern long zfunca_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8, void *arg9, void *arg10);
-/* zfutim.c */
-extern int zfutim_(shortint *fname, long *atime, long *mtime, long *status);
-/* zfxdir.c */
-extern int zfxdir_(shortint *osfn, shortint *osdir, long *maxch, long *nchars);
-/* zgcmdl.c */
-extern int zgcmdl_(shortint *cmd, long *maxch, long *status);
-/* zghost.c */
-extern int zghost_(shortint *outstr, long *maxch);
-/* zglobl.c */
-/* zgmtco.c */
-extern int zgmtco_(long *gmtcor);
-/* zgtenv.c */
-extern int zgtenv_(shortint *envvar, shortint *outstr, long *maxch, long *status);
-/* zgtime.c */
-extern int zgtime_(long *clock_time, long *cpu_time);
-/* zgtpid.c */
-extern int zgtpid_(long *pid);
-/* zintpr.c */
-extern int zintpr_(long *pid, long *exception, long *status);
-/* zlocpr.c */
-/*
-extern int zlocpr_(PFI proc, long *o_epa);
-*/
-/* zlocva.c */
-extern int zlocva_(shortint *variable, long *location);
-/* zmain.c */
-extern int main(int argc, char *argv[]);
-/* zmaloc.c */
-extern int zmaloc_(long *buf, long *nbytes, long *status);
-/* zmfree.c */
-extern int zmfree_(long *buf, long *status);
-/* zopdir.c */
-extern int zopdir_(shortint *fname, long *chan);
-extern int zcldir_(long *chan, long *status);
-extern int zgfdir_(long *chan, shortint *outstr, long *maxch, long *status);
-/* zopdpr.c */
-extern int zopdpr_(shortint *osfn, shortint *bkgfile, shortint *queue, long *jobcode);
-extern int zcldpr_(long *jobcode, long *killflag, long *exit_status);
-/* zoscmd.c */
-extern int zoscmd_(shortint *oscmd, shortint *stdin_file, shortint *stdout_file, shortint *stderr_file, long *status);
-extern int pr_onint(int usig, int *hwcode, int *scp);
-/* zpanic.c */
-extern int zpanic_(long *errcode, shortint *errmsg);
-extern int kernel_panic(char *errmsg);
-/* zraloc.c */
-extern int zraloc_(long *buf, long *nbytes, long *status);
-/* zshlib.c */
-extern void vlibinit_(void);
-/* zwmsec.c */
-extern int zwmsec_(long *msec);
-/* zxwhen.c */
-extern int zxwhen_(long *sig_code, long *epa, long *old_epa);
-extern void ex_handler(int unix_signal, siginfo_t *info, void *ucp);
-extern int zxgmes_(long *os_exception, shortint *errmsg, long *maxch);
-extern int gfpucw_(long *xcw);
-extern int sfpucw_(long *xcw);
-/* zzepro.c */
-/*
-extern int zzepro_(void);
-*/
-/* zzexit.c */
-extern int exit_(long *code);
-/* zzpstr.c */
-extern int spp_debug(void);
-extern int zzpstr_(shortint *s1, shortint *s2);
-extern int zzlstr_(shortint *s1, shortint *s2);
-extern void spp_printstr(shortint *s);
-extern void spp_printmemc(int memc_ptr);
-/* zzsetk.c */
-extern int zzsetk_(char *ospn, char *osbfn, int prtype, int isatty, int in, int out);
-/* zzstrt.c */
-extern int zzstrt_(void);
-extern int zzstop_(void);
-extern void ready_(void);
-extern void mdump_(long *buf, long *nbytes);
-
-
-#endif
diff --git a/unix/hlib/libc/kproto.h.bak b/unix/hlib/libc/kproto.h.bak
deleted file mode 100644
index adde5ec..0000000
--- a/unix/hlib/libc/kproto.h.bak
+++ /dev/null
@@ -1,494 +0,0 @@
-/*
- *  KPROTO.H -- IRAF Kernel prototype definitions.
- */
-
-#include <stdio.h>
-#include <time.h>               /* for time_t                   */
-#include <signal.h>             /* for siginfo_t                */
-
-#ifndef MACH64
-
-
-/* alloc.c */
-extern int main(int argc, char *argv[]);
-extern int alloc(char *argv[], int statonly);
-extern int dealloc(char *argv[]);
-extern int findsfs(char *argv[]);
-/* dio.c */
-extern int directio(int fd, int advice);
-/* getproc.c */
-extern int uid_executing(int uid);
-/* gmttolst.c */
-extern time_t gmt_to_lst(time_t gmt);
-/* irafpath.c */
-extern char *irafpath(char *fname);
-/* prwait.c */
-extern void pr_enter(int pid, int inchan, int outchan);
-extern int pr_wait(int pid);
-extern int pr_getipc(int pid, int *inchan, int *outchan);
-extern struct proctable *pr_findpid(int pid);
-extern void pr_release(int pid);
-/* tape.c */
-extern int main(int argc, char *argv[]);
-extern void mtop(int op, int count);
-extern char *nextcmd(FILE *in);
-extern char *gettok(void);
-extern char *prompt(void);
-extern void pstatus(void);
-extern void output(char *text);
-extern void phelp(void);
-/* zalloc.c */
-extern int zdvall_(short *aliases, int *allflg, int *status);
-extern int zdvown_(short *device, short *owner, int *maxch, int *status);
-extern int loggedin(int uid);
-/* zawset.c */
-extern int zawset_(int *best_size, int *new_size, int *old_size, int *max_size);
-/* zcall.c */
-extern int zcall0_(int *proc);
-extern int zcall1_(int *proc, void *arg1);
-extern int zcall2_(int *proc, void *arg1, void *arg2);
-extern int zcall3_(int *proc, void *arg1, void *arg2, void *arg3);
-extern int zcall4_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4);
-extern int zcall5_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5);
-extern int zcall6_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6);
-extern int zcall7_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7);
-extern int zcall8_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8);
-extern int zcall9_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8, void *arg9);
-extern int zcalla_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8, void *arg9, void *arg10);
-/* zdojmp.c */
-extern void zdojmp_(int *jmpbuf, int *status);
-/* zfacss.c */
-extern int zfacss_(short *fname, int *mode, int *type, int *status);
-/* zfaloc.c */
-extern int zfaloc_(short *fname, int *nbytes, int *status);
-/* zfchdr.c */
-extern int zfchdr_(short *newdir, int *status);
-/* zfdele.c */
-extern int zfdele_(short *fname, int *status);
-/* zfgcwd.c */
-extern int zfgcwd_(short *outstr, int *maxch, int *status);
-/* zfinfo.c */
-extern int zfinfo_(short *fname, int *finfo_struct, int *status);
-/* zfiobf.c */
-extern int zopnbf_(short *osfn, int *mode, int *chan);
-extern int zclsbf_(int *fd, int *status);
-extern int zardbf_(int *chan, short *buf, int *maxbytes, int *offset);
-extern int zawrbf_(int *chan, short *buf, int *nbytes, int *offset);
-extern int zawtbf_(int *fd, int *status);
-extern int zsttbf_(int *fd, int *param, int *lvalue);
-extern int _u_fmode(int mode);
-extern int vm_access(char *fname, int mode);
-extern int vm_delete(char *fname, int force);
-extern int vm_reservespace(long nbytes);
-extern int vm_largefile(long nbytes);
-extern int vm_directio(int fd, int flag);
-/* zfioks.c */
-extern int zopnks_(short *x_server, int *mode, int *chan);
-extern int zclsks_(int *chan, int *status);
-extern int zardks_(int *chan, short *buf, int *totbytes, int *loffset);
-extern int zawrks_(int *chan, short *buf, int *totbytes, int *loffset);
-extern int zawtks_(int *chan, int *status);
-extern int zsttks_(int *chan, int *param, int *lvalue);
-extern void pr_mask(char *str);
-/* zfiolp.c */
-extern int zopnlp_(short *printer, int *mode, int *chan);
-extern int zclslp_(int *chan, int *status);
-extern int zardlp_(int *chan, short *buf, int *maxbytes, int *offset);
-extern int zawrlp_(int *chan, short *buf, int *nbytes, int *offset);
-extern int zawtlp_(int *chan, int *status);
-extern int zsttlp_(int *chan, int *param, int *lvalue);
-/* zfiomt.c */
-extern int zzopmt_(short *device, int *acmode, short *devcap, int *devpos, int *newfile, int *chan);
-extern int zzclmt_(int *chan, int *devpos, int *o_status);
-extern int zzrdmt_(int *chan, short *buf, int *maxbytes, int *offset);
-extern int zzwrmt_(int *chan, short *buf, int *nbytes, int *offset);
-extern int zzwtmt_(int *chan, int *devpos, int *o_status);
-extern int zzstmt_(int *chan, int *param, int *lvalue);
-extern int zzrwmt_(short *device, short *devcap, int *o_status);
-/* zfiond.c */
-extern int zopnnd_(short *pk_osfn, int *mode, int *chan);
-extern int zclsnd_(int *fd, int *status);
-extern int zardnd_(int *chan, short *buf, int *maxbytes, int *offset);
-extern int zawrnd_(int *chan, short *buf, int *nbytes, int *offset);
-extern int zawtnd_(int *fd, int *status);
-extern int zsttnd_(int *fd, int *param, int *lvalue);
-/* zfiopl.c */
-extern int zopnpl_(short *plotter, int *mode, int *chan);
-extern int zclspl_(int *chan, int *status);
-extern int zardpl_(int *chan, short *buf, int *maxbytes, int *offset);
-extern int zawrpl_(int *chan, short *buf, int *nbytes, int *offset);
-extern int zawtpl_(int *chan, int *status);
-extern int zsttpl_(int *chan, int *param, int *lvalue);
-/* zfiopr.c */
-extern int zopcpr_(short *osfn, int *inchan, int *outchan, int *pid);
-extern int zclcpr_(int *pid, int *exit_status);
-extern int zardpr_(int *chan, short *buf, int *maxbytes, int *loffset);
-extern int zawrpr_(int *chan, short *buf, int *nbytes, int *loffset);
-extern int zawtpr_(int *chan, int *status);
-extern int zsttpr_(int *chan, int *param, int *lvalue);
-/* zfiosf.c */
-extern int zopnsf_(short *osfn, int *mode, int *chan);
-extern int zclssf_(int *fd, int *status);
-extern int zardsf_(int *chan, short *buf, int *maxbytes, int *offset);
-extern int zawrsf_(int *chan, short *buf, int *nbytes, int *offset);
-extern int zawtsf_(int *fd, int *status);
-extern int zsttsf_(int *fd, int *param, int *lvalue);
-/* zfiotx.c */
-extern int zopntx_(short *osfn, int *mode, int *chan);
-extern int zclstx_(int *fd, int *status);
-extern int zflstx_(int *fd, int *status);
-extern int zgettx_(int *fd, short *buf, int *maxchars, int *status);
-extern int znottx_(int *fd, int *offset);
-extern int zputtx_(int *fd, short *buf, int *nchars, int *status);
-extern int zsektx_(int *fd, int *znottx_offset, int *status);
-extern int zstttx_(int *fd, int *param, int *value);
-/* zfioty.c */
-extern int zopnty_(short *osfn, int *mode, int *chan);
-extern int zclsty_(int *fd, int *status);
-extern int zflsty_(int *fd, int *status);
-extern int zgetty_(int *fd, short *buf, int *maxchars, int *status);
-extern int znotty_(int *fd, int *offset);
-extern int zputty_(int *fd, short *buf, int *nchars, int *status);
-extern int zsekty_(int *fd, int *znotty_offset, int *status);
-extern int zsttty_(int *fd, int *param, int *value);
-/* zfmkcp.c */
-extern int zfmkcp_(short *osfn, short *new_osfn, int *status);
-/* zfmkdr.c */
-extern int zfmkdr_(short *newdir, int *status);
-/* zfnbrk.c */
-extern int zfnbrk_(short *vfn, int *uroot_offset, int *uextn_offset);
-/* zfpath.c */
-extern int zfpath_(short *osfn, short *pathname, int *maxch, int *nchars);
-/* zfpoll.c */
-extern int zfpoll_(int *pfds, int *nfds, int *timeout, int *npoll, int *status);
-/* zfprot.c */
-extern int zfprot_(short *fname, int *action, int *status);
-/* zfrnam.c */
-extern int zfrnam_(short *oldname, short *newname, int *status);
-/* zfsubd.c */
-extern int zfsubd_(short *osdir, int *maxch, short *subdir, int *nchars);
-/* zfunc.c */
-extern int zfunc0_(int *proc);
-extern int zfunc1_(int *proc, void *arg1);
-extern int zfunc2_(int *proc, void *arg1, void *arg2);
-extern int zfunc3_(int *proc, void *arg1, void *arg2, void *arg3);
-extern int zfunc4_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4);
-extern int zfunc5_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5);
-extern int zfunc6_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6);
-extern int zfunc7_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7);
-extern int zfunc8_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8);
-extern int zfunc9_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8, void *arg9);
-extern int zfunca_(int *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8, void *arg9, void *arg10);
-/* zfutim.c */
-extern int zfutim_(short *fname, int *atime, int *mtime, int *status);
-/* zfxdir.c */
-extern int zfxdir_(short *osfn, short *osdir, int *maxch, int *nchars);
-/* zgcmdl.c */
-extern int zgcmdl_(short *cmd, int *maxch, int *status);
-/* zghost.c */
-extern int zghost_(short *outstr, int *maxch);
-/* zglobl.c */
-/* zgmtco.c */
-extern int zgmtco_(int *gmtcor);
-/* zgtenv.c */
-extern int zgtenv_(short *envvar, short *outstr, int *maxch, int *status);
-/* zgtime.c */
-extern int zgtime_(int *clock_time, int *cpu_time);
-/* zgtpid.c */
-extern int zgtpid_(int *pid);
-/* zintpr.c */
-extern int zintpr_(int *pid, int *exception, int *status);
-/* zlocpr.c 
-extern int zlocpr_(PFI proc, int *o_epa);
-*/
-/* zlocva.c */
-extern int zlocva_(short *variable, int *location);
-/* zmain.c */
-extern int main(int argc, char *argv[]);
-/* zmaloc.c */
-extern int zmaloc_(int *buf, int *nbytes, int *status);
-/* zmfree.c */
-extern int zmfree_(int *buf, int *status);
-/* zopdir.c */
-extern int zopdir_(short *fname, int *chan);
-extern int zcldir_(int *chan, int *status);
-extern int zgfdir_(int *chan, short *outstr, int *maxch, int *status);
-/* zopdpr.c */
-extern int zopdpr_(short *osfn, short *bkgfile, short *queue, int *jobcode);
-extern int zcldpr_(int *jobcode, int *killflag, int *exit_status);
-/* zoscmd.c */
-extern int zoscmd_(short *oscmd, short *stdin_file, short *stdout_file, short *stderr_file, int *status);
-extern int pr_onint(int usig, int *hwcode, int *scp);
-/* zpanic.c */
-extern int zpanic_(int *errcode, short *errmsg);
-extern int kernel_panic(char *errmsg);
-/* zraloc.c */
-extern int zraloc_(int *buf, int *nbytes, int *status);
-/* zshlib.c */
-extern void vlibinit_(void);
-/* zwmsec.c */
-extern int zwmsec_(int *msec);
-/* zxwhen.c */
-extern int zxwhen_(int *sig_code, int *epa, int *old_epa);
-extern void ex_handler(int unix_signal, siginfo_t *info, void *ucp);
-extern int zxgmes_(int *os_exception, short *errmsg, int *maxch);
-/* zzepro.c */
-extern int zzepro_(void);
-/* zzexit.c */
-extern int exit_(int *code);
-/* zzpstr.c */
-extern int spp_debug(void);
-extern int zzpstr_(short *s1, short *s2);
-extern int zzlstr_(short *s1, short *s2);
-extern void spp_printstr(short *s);
-extern void spp_printmemc(int memc_ptr);
-/* zzsetk.c */
-extern int zzsetk_(char *ospn, char *osbfn, int prtype, int isatty, int in, int out);
-/* zzstrt.c */
-extern int zzstrt_(void);
-extern int zzstop_(void);
-extern void ready_(void);
-extern void mdump_(int *buf, int *nbytes);
-
-
-
-#else
-
-
-
-/* dio.c */
-extern int directio(int fd, int advice);
-/* getproc.c */
-extern int uid_executing(int uid);
-/* gmttolst.c */
-extern time_t gmt_to_lst(time_t gmt);
-/* irafpath.c */
-extern char *irafpath(char *fname);
-/* prwait.c */
-extern void pr_enter(int pid, int inchan, int outchan);
-extern int pr_wait(int pid);
-extern int pr_getipc(int pid, int *inchan, int *outchan);
-extern struct proctable *pr_findpid(int pid);
-extern void pr_release(int pid);
-/* zalloc.c */
-extern int zdvall_(short *aliases, long *allflg, long *status);
-extern int zdvown_(short *device, short *owner, long *maxch, long *status);
-extern int loggedin(int uid);
-/* zawset.c */
-extern int zawset_(long *best_size, long *new_size, long *old_size, long *max_size);
-/* zcall.c */
-/*
-extern int zcall0_(long *proc);
-extern int zcall1_(long *proc, void *arg1);
-extern int zcall2_(long *proc, void *arg1, void *arg2);
-extern int zcall3_(long *proc, void *arg1, void *arg2, void *arg3);
-extern int zcall4_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4);
-extern int zcall5_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5);
-extern int zcall6_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6);
-extern int zcall7_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7);
-extern int zcall8_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8);
-extern int zcall9_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8, void *arg9);
-extern int zcalla_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8, void *arg9, void *arg10);
-*/
-/* zdojmp.c */
-extern void zdojmp_(long *jmpbuf, long *status);
-/* zfacss.c */
-extern int zfacss_(short *fname, long *mode, long *type, long *status);
-/* zfaloc.c */
-extern int zfaloc_(short *fname, long *nbytes, long *status);
-/* zfchdr.c */
-extern int zfchdr_(short *newdir, long *status);
-/* zfdele.c */
-extern int zfdele_(short *fname, long *status);
-/* zfgcwd.c */
-extern int zfgcwd_(short *outstr, long *maxch, long *status);
-/* zfinfo.c */
-extern int zfinfo_(short *fname, long *finfo_struct, long *status);
-/* zfiobf.c */
-extern int zopnbf_(short *osfn, long *mode, long *chan);
-extern int zclsbf_(long *fd, long *status);
-extern int zardbf_(long *chan, short *buf, long *maxbytes, long *offset);
-extern int zawrbf_(long *chan, short *buf, long *nbytes, long *offset);
-extern int zawtbf_(long *fd, long *status);
-extern int zsttbf_(long *fd, long *param, long *lvalue);
-extern int _u_fmode(int mode);
-extern int vm_access(char *fname, int mode);
-extern int vm_delete(char *fname, int force);
-extern int vm_reservespace(long nbytes);
-extern int vm_largefile(long nbytes);
-extern int vm_directio(int fd, int flag);
-/* zfioks.c */
-extern int zopnks_(short *x_server, long *mode, long *chan);
-extern int zclsks_(long *chan, long *status);
-extern int zardks_(long *chan, short *buf, long *totbytes, long *loffset);
-extern int zawrks_(long *chan, short *buf, long *totbytes, long *loffset);
-extern int zawtks_(long *chan, long *status);
-extern int zsttks_(long *chan, long *param, long *lvalue);
-extern void pr_mask(char *str);
-/* zfiolp.c */
-extern int zopnlp_(short *printer, long *mode, long *chan);
-extern int zclslp_(long *chan, long *status);
-extern int zardlp_(long *chan, short *buf, long *maxbytes, long *offset);
-extern int zawrlp_(long *chan, short *buf, long *nbytes, long *offset);
-extern int zawtlp_(long *chan, long *status);
-extern int zsttlp_(long *chan, long *param, long *lvalue);
-/* zfiomt.c */
-extern int zzopmt_(short *device, long *acmode, short *devcap, long *devpos, long *newfile, long *chan);
-extern int zzclmt_(long *chan, long *devpos, long *o_status);
-extern int zzrdmt_(long *chan, short *buf, long *maxbytes, long *offset);
-extern int zzwrmt_(long *chan, short *buf, long *nbytes, long *offset);
-extern int zzwtmt_(long *chan, long *devpos, long *o_status);
-extern int zzstmt_(long *chan, long *param, long *lvalue);
-extern int zzrwmt_(short *device, short *devcap, long *o_status);
-/* zfiond.c */
-extern int zopnnd_(short *pk_osfn, long *mode, long *chan);
-extern int zclsnd_(long *fd, long *status);
-extern int zardnd_(long *chan, short *buf, long *maxbytes, long *offset);
-extern int zawrnd_(long *chan, short *buf, long *nbytes, long *offset);
-extern int zawtnd_(long *fd, long *status);
-extern int zsttnd_(long *fd, long *param, long *lvalue);
-/* zfiopl.c */
-extern int zopnpl_(short *plotter, long *mode, long *chan);
-extern int zclspl_(long *chan, long *status);
-extern int zardpl_(long *chan, short *buf, long *maxbytes, long *offset);
-extern int zawrpl_(long *chan, short *buf, long *nbytes, long *offset);
-extern int zawtpl_(long *chan, long *status);
-extern int zsttpl_(long *chan, long *param, long *lvalue);
-/* zfiopr.c */
-extern int zopcpr_(short *osfn, long *inchan, long *outchan, long *pid);
-extern int zclcpr_(long *pid, long *exit_status);
-extern int zardpr_(long *chan, short *buf, long *maxbytes, long *loffset);
-extern int zawrpr_(long *chan, short *buf, long *nbytes, long *loffset);
-extern int zawtpr_(long *chan, long *status);
-extern int zsttpr_(long *chan, long *param, long *lvalue);
-/* zfiosf.c */
-extern int zopnsf_(short *osfn, long *mode, long *chan);
-extern int zclssf_(long *fd, long *status);
-extern int zardsf_(long *chan, short *buf, long *maxbytes, long *offset);
-extern int zawrsf_(long *chan, short *buf, long *nbytes, long *offset);
-extern int zawtsf_(long *fd, long *status);
-extern int zsttsf_(long *fd, long *param, long *lvalue);
-/* zfiotx.c */
-extern int zopntx_(short *osfn, long *mode, long *chan);
-extern int zclstx_(long *fd, long *status);
-extern int zflstx_(long *fd, long *status);
-extern int zgettx_(long *fd, short *buf, long *maxchars, long *status);
-extern int znottx_(long *fd, long *offset);
-extern int zputtx_(long *fd, short *buf, long *nchars, long *status);
-extern int zsektx_(long *fd, long *znottx_offset, long *status);
-extern int zstttx_(long *fd, long *param, long *value);
-/* zfioty.c */
-extern int zopnty_(short *osfn, long *mode, long *chan);
-extern int zclsty_(long *fd, long *status);
-extern int zflsty_(long *fd, long *status);
-extern int zgetty_(long *fd, short *buf, long *maxchars, long *status);
-extern int znotty_(long *fd, long *offset);
-extern int zputty_(long *fd, short *buf, long *nchars, long *status);
-extern int zsekty_(long *fd, long *znotty_offset, long *status);
-extern int zsttty_(long *fd, long *param, long *value);
-/* zfmkcp.c */
-extern int zfmkcp_(short *osfn, short *new_osfn, long *status);
-/* zfmkdr.c */
-extern int zfmkdr_(short *newdir, long *status);
-/* zfnbrk.c */
-extern int zfnbrk_(short *vfn, long *uroot_offset, long *uextn_offset);
-/* zfpath.c */
-extern int zfpath_(short *osfn, short *pathname, long *maxch, long *nchars);
-/* zfpoll.c */
-extern int zfpoll_(long *pfds, long *nfds, long *timeout, long *npoll, long *status);
-/* zfprot.c */
-extern int zfprot_(short *fname, long *action, long *status);
-/* zfrnam.c */
-extern int zfrnam_(short *oldname, short *newname, long *status);
-/* zfsubd.c */
-extern int zfsubd_(short *osdir, long *maxch, short *subdir, long *nchars);
-/* zfunc.c */
-extern long zfunc0_(long *proc);
-extern long zfunc1_(long *proc, void *arg1);
-extern long zfunc2_(long *proc, void *arg1, void *arg2);
-extern long zfunc3_(long *proc, void *arg1, void *arg2, void *arg3);
-extern long zfunc4_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4);
-extern long zfunc5_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5);
-extern long zfunc6_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6);
-extern long zfunc7_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7);
-extern long zfunc8_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8);
-extern long zfunc9_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8, void *arg9);
-extern long zfunca_(long *proc, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8, void *arg9, void *arg10);
-/* zfutim.c */
-extern int zfutim_(short *fname, long *atime, long *mtime, long *status);
-/* zfxdir.c */
-extern int zfxdir_(short *osfn, short *osdir, long *maxch, long *nchars);
-/* zgcmdl.c */
-extern int zgcmdl_(short *cmd, long *maxch, long *status);
-/* zghost.c */
-extern int zghost_(short *outstr, long *maxch);
-/* zglobl.c */
-/* zgmtco.c */
-extern int zgmtco_(long *gmtcor);
-/* zgtenv.c */
-extern int zgtenv_(short *envvar, short *outstr, long *maxch, long *status);
-/* zgtime.c */
-extern int zgtime_(long *clock_time, long *cpu_time);
-/* zgtpid.c */
-extern int zgtpid_(long *pid);
-/* zintpr.c */
-extern int zintpr_(long *pid, long *exception, long *status);
-/* zlocpr.c */
-/*
-extern int zlocpr_(PFI proc, long *o_epa);
-*/
-/* zlocva.c */
-extern int zlocva_(short *variable, long *location);
-/* zmain.c */
-extern int main(int argc, char *argv[]);
-/* zmaloc.c */
-extern int zmaloc_(long *buf, long *nbytes, long *status);
-/* zmfree.c */
-extern int zmfree_(long *buf, long *status);
-/* zopdir.c */
-extern int zopdir_(short *fname, long *chan);
-extern int zcldir_(long *chan, long *status);
-extern int zgfdir_(long *chan, short *outstr, long *maxch, long *status);
-/* zopdpr.c */
-extern int zopdpr_(short *osfn, short *bkgfile, short *queue, long *jobcode);
-extern int zcldpr_(long *jobcode, long *killflag, long *exit_status);
-/* zoscmd.c */
-extern int zoscmd_(short *oscmd, short *stdin_file, short *stdout_file, short *stderr_file, long *status);
-extern int pr_onint(int usig, int *hwcode, int *scp);
-/* zpanic.c */
-extern int zpanic_(long *errcode, short *errmsg);
-extern int kernel_panic(char *errmsg);
-/* zraloc.c */
-extern int zraloc_(long *buf, long *nbytes, long *status);
-/* zshlib.c */
-extern void vlibinit_(void);
-/* zwmsec.c */
-extern int zwmsec_(long *msec);
-/* zxwhen.c */
-extern int zxwhen_(long *sig_code, long *epa, long *old_epa);
-extern void ex_handler(int unix_signal, siginfo_t *info, void *ucp);
-extern int zxgmes_(long *os_exception, short *errmsg, long *maxch);
-extern int gfpucw_(long *xcw);
-extern int sfpucw_(long *xcw);
-/* zzepro.c */
-/*
-extern int zzepro_(void);
-*/
-/* zzexit.c */
-extern int exit_(long *code);
-/* zzpstr.c */
-extern int spp_debug(void);
-extern int zzpstr_(short *s1, short *s2);
-extern int zzlstr_(short *s1, short *s2);
-extern void spp_printstr(short *s);
-extern void spp_printmemc(int memc_ptr);
-/* zzsetk.c */
-extern int zzsetk_(char *ospn, char *osbfn, int prtype, int isatty, int in, int out);
-/* zzstrt.c */
-extern int zzstrt_(void);
-extern int zzstop_(void);
-extern void ready_(void);
-extern void mdump_(long *buf, long *nbytes);
-
-
-#endif
diff --git a/unix/hlib/libc/libc.h b/unix/hlib/libc/libc.h
index cf3b1c1..747b370 100644
--- a/unix/hlib/libc/libc.h
+++ b/unix/hlib/libc/libc.h
@@ -42,7 +42,7 @@ extern	char		MEMCOM[];
 
 /* External names.
  */
-#ifndef NOLIBCNAMES
+#ifndef NOLIBCNAMES*/
 
 #define	getenv		envget
 #define	sys_nerr	u_sysnerr
@@ -320,8 +320,9 @@ extern void	c_xwhen (int exception, PFI new_handler, PFI *old_handler);
 
 /*
 */
-#include "/iraf/iraf/unix/bin/f2c.h"
-#include "/iraf/iraf/unix/hlib/libc/vosproto.h"
+#include "f2c.h"
+#undef abs
+#include "vosproto.h"
 
 #define	D_libc
 #define	D_libc_proto
diff --git a/unix/hlib/libc/setjmp.h b/unix/hlib/libc/setjmp.h
deleted file mode 100644
index a92d6b4..0000000
--- a/unix/hlib/libc/setjmp.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* SETJMP, LONGJMP -- Non local goto.  Requires libc.h and knames.h.
- * Note that jmp_buf must be at least one int larger than necessary to
- */
-#ifndef D_libc
-#ifndef import_libc
-#include "libc.h"
-#endif
-#ifndef import_knames
-#include "knames.h"
-#endif
-#endif
-
-typedef	int	jmp_buf[LEN_JUMPBUF];
-static	int	u_jmpstat;
-
-#define	setjmp(e)	(ZSVJMP((e),&u_jmpstat),u_jmpstat)
-#define	longjmp(e,v)	(u_jmpstat=(v),ZDOJMP((e),&u_jmpstat))
-
-/* The following is necessary to prevent to prevent the optimizer from
- * doing unwise things with setjmp on a Sun-4.
- */
-extern	int zsvjmp_();
-#pragma unknown_control_flow(zsvjmp_)
-
-#define	D_setjmp
diff --git a/unix/hlib/libc/stdarg.h b/unix/hlib/libc/stdarg.h
deleted file mode 100644
index a52889d..0000000
--- a/unix/hlib/libc/stdarg.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* STDARG.H -- Interface to the Unix variable argument-list interface.
- * This version replaces <varargs.h>, but is NOT backwards compatible.
- *
- * We pick up the local UNIX definitions for dealing with a variable
- * number of arguments.  This is done via indirection through this file so
- * that any problems can be dealt with by changing only this file.
- *
- * Usage: Include this file using import_stdarg.  If USE_STDARG is
- * defined use the stdarg interface, otherwise use the varargs
- * interface (ifdef the code accordingly).  Old code which uses
- * varargs directly is unaffected.
- */
-#ifndef D_stdarg
-
-
-#ifdef MACOSX
-#include "stdarg-osx.h"
-#else
-#ifdef __CYGWIN__
-#include "stdarg-cygwin.h"
-#else
-#ifdef LINUX
-#include "stdarg-linux.h"
-#else
-#ifdef SOLARIS
-#include "stdarg-solaris.h"
-#else
-#ifdef BSD
-#include "stdarg-freebsd.h"
-#else
-#include <stdarg.h>
-#endif
-#endif
-#endif
-#endif
-#endif
-
-
-#define	D_stdarg
-#endif
diff --git a/unix/hlib/libc/stdio.h b/unix/hlib/libc/stdio.h
deleted file mode 100644
index c3cc0bd..0000000
--- a/unix/hlib/libc/stdio.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * U_STDIO.H -- C defines used to emulate the UNIX standard i/o package upon
- * IRAF file i/o.  These definitions are portable, but highly dependent on
- * the guts of IRAF FIO.
- */
-
-#ifndef D_libc
-#ifndef import_libc
-#include "libc.h"
-#endif
-#endif
-
-#define	BUFSIZ		SZ_DEFIOBUF
-#define	_NFILE		FIO_MAXFD
-#define	FILE		struct _iobuf
-
-# ifndef NULL
-#define	NULL		0
-# endif
-# ifndef EOF
-#define	EOF		(-1)
-# endif
-
-/* Filler space is defined here to reduce clutter in the struct def below.
- */
-#define	_F1		_filler1[_NFILE-1]
-#define	_F2		_filler2[_NFILE-1]
-#define	_F3		_filler3[_NFILE-1]
-#define	_F4		_filler4[_NFILE-1]
-#define	_F5		_filler5[_NFILE-1]
-#define	_F6		_filler6[_NFILE-1]
-#define	_F7		_filler7[_NFILE-1]
-
-/* The _iobuf structure is the C version of the FIO common /fiocom/, which
- * contains all the FIO buffer and i/o pointers.  Each structure field is
- * maintained in the common as an array of length _NFILE, hence in terms of
- * C the structures are interleaved.  The file pointers are indices into
- * the array Memc, an array of XCHAR.
- */
-struct _iobuf {
-	XLONG	_boffset, _F1;		/* XCHAR file offset of buffer	*/
-	XINT	_bufptr,  _F2;		/* buffer pointer		*/
-	XINT	_buftop,  _F3;		/* pointer to top of buffer + 1	*/
-	XINT	_iop,     _F4;		/* pointer to next XCHAR	*/
-	XINT	_itop,    _F5;		/* call filbuf when _iop >=	*/
-	XINT	_otop,    _F6;		/* call flsbuf when _iop >=	*/
-	XINT	_fiodes,  _F7;		/* FIO file descriptor		*/
-	XINT	_fflags;		/* bit flags			*/
-};
-
-extern	XINT FIOCOM[];			/* the FIO common		*/
-
-#define	_FFLUSHNL	01		/* flush buffer on newline	*/
-#define	_FREAD		02		/* read perm on file		*/
-#define	_FWRITE		04		/* read perm on file		*/
-#define	_FEOF		010		/* file positioned to EOF	*/
-#define	_FERR		020		/* i/o error on file		*/
-#define _FKEEP		040		/* keep file open at exit	*/
-#define	_FFLUSH		0100		/* write to device on newline	*/
-#define	_FRAW		0200		/* raw input mode		*/
-#define	_FNDELAY	0400		/* nonblocking i/o		*/
-#define	_FPUSH		01000		/* data is pushed back		*/
-#define	_FIPC		02000		/* file is an IPC channel	*/
-
-/* Convert FILE pointers to and from FIO integer file descriptors.
- */
-#define	FDTOFP(fd)	((FILE *)(&FIOCOM[(fd)-1]))
-#define	FPTOFD(fp)	((XINT)((XINT *)(fp) - FIOCOM + 1))
-
-#define	stdin		(FDTOFP(3))
-#define	stdout		(FDTOFP(4))
-#define	stderr		(FDTOFP(5))
-
-
-/* I/O macro defines.  I/O is assumed to be sequential, i.e., we do not check
- * for _iop < _bufptr.  This is consistent with UNIX usage.  The getc and putc
- * macros are quite efficient despite their complex appearance.
- */
-#define	getchar()	fgetc(stdin)
-#define	getc(fp) \
-(((fp)->_iop >= (fp)->_itop) ? c_filbuf((fp)) : Memc[(fp)->_iop++] & 0377)
-
-#define	putchar(ch)	fputc((ch),stdout)
-#define	putc(ch,fp) \
-(((fp)->_iop >= (fp)->_otop || ((ch) == '\n' && (fp)->_fflags&_FFLUSH)) ? \
-c_flsbuf((unsigned)(ch),(fp)) : ((int)(Memc[(fp)->_iop++] = (unsigned)(ch))))
-
-#define	fileno(fp)	(FPTOFD((fp)))
-#define	feof(fp)	((fp)->_fflags & _FEOF)
-#define	ferror(fp)	((fp)->_fflags & _FERR)
-#define	clearerr(fp)	((fp)->_fflags &= ~_FERR)
-
-
-FILE	*fopen();
-FILE	*fdopen();
-char	*fgets();
-char	*gets();
-
-#define	D_stdio
diff --git a/unix/mkpkg.sh b/unix/mkpkg.sh
index 3ea7596..cc78b29 100644
--- a/unix/mkpkg.sh
+++ b/unix/mkpkg.sh
@@ -22,3 +22,8 @@ echo "----------------------- GDEV ---------------------------"
 # Install the newly created executables.
 echo "install HSI executables in $host/bin.$MACH"
 mv -f hlib/*.e bin.$MACH
+pushd bin.$MACH
+for i in *.e
+do ln -sf $i ${i%.*}
+done
+popd
diff --git a/unix/os/zzstrt.c b/unix/os/zzstrt.c
index a6f5808..33791ed 100644
--- a/unix/os/zzstrt.c
+++ b/unix/os/zzstrt.c
@@ -101,7 +101,12 @@ int	BSS_kludge[256];
 
 void 	ready_ (void);
 
-
+#ifdef HOST_F2C
+extern int MAIN__();
+int MAIN__() {
+  exit(0);
+}
+#endif
 
 /* ZZSTRT -- Initialize the IRAF kernel at process startup time.
  */
diff --git a/util/mksysnovos b/util/mksysnovos
new file mode 100755
index 0000000..bbb387a
--- /dev/null
+++ b/util/mksysnovos
@@ -0,0 +1,34 @@
+#!/bin/csh -f
+#
+
+if (! $?iraf) then
+    #echo ""
+    #echo "Error:  You must have the iraf env variable defined !"
+    #echo ""
+    #exit 1
+
+    set  iraf 	= $cwd/
+endif
+
+
+set  c_start	= `date`
+/bin/rm -f spool */spool
+
+
+#$iraf/util/mkclean				# clean old binaries
+
+echo "=== NOVOS bootstrap ==="
+cd $iraf/unix					# NOVOS bootstrap
+source hlib/irafuser.csh
+sh -x mkpkg.sh |& tee -a spool
+
+echo "=== NOVOS build ==="
+cd $iraf/sys					# build NOVOS
+mkpkg |& tee -a spool
+set  c_end	= `date`
+
+echo ""
+echo ""
+echo ""
+echo "Start:  $c_start"
+echo "  End:  $c_end"
diff --git a/util/mksysvos b/util/mksysvos
new file mode 100755
index 0000000..88a8ec0
--- /dev/null
+++ b/util/mksysvos
@@ -0,0 +1,41 @@
+#!/bin/csh -f
+#
+
+if (! $?iraf) then
+    #echo ""
+    #echo "Error:  You must have the iraf env variable defined !"
+    #echo ""
+    #exit 1
+
+    set  iraf 	= $cwd/
+endif
+
+
+set  c_start	= `date`
+/bin/rm -f spool */spool
+
+
+#$iraf/util/mkclean				# clean old binaries
+
+echo "=== VOS bootstrap ==="
+cd $iraf/unix					# VOS bootstrap
+source hlib/irafuser.csh
+sh -x mkpkg.sh |& tee -a spool
+
+echo "=== VOS core ==="
+cd $iraf/					# build core system
+mkpkg |& tee -a spool
+
+echo "=== NOAO ==="
+cd $iraf/noao					# build NOAO package
+setenv noao $cwd/
+mkpkg -p noao |& tee -a spool
+
+set  c_end	= `date`
+
+
+echo ""
+echo ""
+echo ""
+echo "Start:  $c_start"
+echo "  End:  $c_end"
diff --git a/vendor/voclient/Makefile b/vendor/voclient/Makefile
index 7c3d59a..7be4315 100644
--- a/vendor/voclient/Makefile
+++ b/vendor/voclient/Makefile
@@ -37,50 +37,56 @@ LIBS		= -lm -lc -lpthread
 
 
 all:
-	(cd common      ; make all  ; make install)
-	(cd libvotable  ; make all  ; make install)
-	(cd libsamp     ; make all  ; make install)
-	(cd libvoclient ; make all  ; make install)
-	(cd voapps      ; make all  ; make install)
-	(cd libvo       ; make all  ; make install)
+	(cd common      ; ${MAKE} all  ; ${MAKE} install)
+	(cd libvotable  ; ${MAKE} all  ; ${MAKE} install)
+	(cd libsamp     ; ${MAKE} all  ; ${MAKE} install)
+	(cd libvoclient ; ${MAKE} all  ; ${MAKE} install)
+	(cd voapps      ; ${MAKE} all  ; ${MAKE} install)
+	(cd libvo       ; ${MAKE} all  ; ${MAKE} install)
 
 libs:
-	(cd common      ; make libs)
-	(cd libvotable  ; make libs)
-	(cd libsamp     ; make libs)
-	(cd libvoclient ; make libs)
-	(cd voapps      ; make libs)
-	(cd libvo       ; make libs)
+
+mylib:
+#	(cd common      ; ${MAKE} )
+	mkdir -p include lib
+	(cd libsamp     ; ${MAKE} .BASE lib ; cp *.h ../include ; cp *.a ../lib )
+	(cd libvoclient ; ${MAKE} install )
+	cp libsamp/cfitsio/*.h include
+	(cd libvotable  ; ${MAKE} install)
+	(cd voapps      ; ${MAKE} lib ; cp *.a ../lib )
+	(rm -f *.o ; cd libvo       ; ${MAKE} HOST_CURL=1 lib)
 
 apps:
-	(cd common      ; make apps)
-	(cd libvotable  ; make apps)
-	(cd libsamp     ; make apps)
-	(cd libvoclient ; make apps)
-	(cd voapps      ; make apps)
+	(cd common      ; ${MAKE} apps)
+	(cd libvotable  ; ${MAKE} apps)
+	(cd libsamp     ; ${MAKE} apps)
+	(cd libvoclient ; ${MAKE} apps)
+	(cd voapps      ; ${MAKE} apps)
 
 examples:
-	(cd common      ; make examples)
-	(cd libvotable  ; make examples)
-	(cd libsamp     ; make examples)
-	(cd libvoclient ; make examples)
-	(cd voapps      ; make examples)
+	(cd common      ; ${MAKE} examples)
+	(cd libvotable  ; ${MAKE} examples)
+	(cd libsamp     ; ${MAKE} examples)
+	(cd libvoclient ; ${MAKE} examples)
+	(cd voapps      ; ${MAKE} examples)
 
 install:
-	(cd common      ; make install)
-	(cd libvotable  ; make install)
-	(cd libsamp     ; make install)
-	(cd libvoclient ; make install)
-	(cd voapps      ; make install)
-	(cd libvo       ; make install)
+	(cd common      ; ${MAKE} install)
+	(cd libvotable  ; ${MAKE} install)
+	(cd libsamp     ; ${MAKE} install)
+	(cd libvoclient ; ${MAKE} install)
+	(cd voapps      ; ${MAKE} install)
+	(cd libvo       ; ${MAKE} install)
 
 clean:
-	(cd common      ; make clean)
-	(cd libvotable  ; make clean)
-	(cd libsamp     ; make clean)
-	(cd libvoclient ; make clean)
-	(cd voapps      ; make clean)
-	(cd libvo       ; make clean)
+ifndef HOST_CURL
+	(cd common      ; ${MAKE} clean)
+endif
+	(cd libvotable  ; ${MAKE} clean)
+	(cd libsamp     ; ${MAKE} clean)
+	(cd libvoclient ; ${MAKE} clean)
+	(cd voapps      ; ${MAKE} clean)
+	(cd libvo       ; ${MAKE} clean)
 	/bin/rm -rf voclient/lib/libvoclient.*
 	/bin/rm -rf bin/* lib/* include/* spool
 
diff --git a/vendor/voclient/common/Makefile b/vendor/voclient/common/Makefile
index 5d29ba2..ed6e2da 100644
--- a/vendor/voclient/common/Makefile
+++ b/vendor/voclient/common/Makefile
@@ -38,28 +38,28 @@ all::	curl expat
 
 libs::
 	(/bin/csh -f mklibs)
-	(cd expat ; ./configure --prefix=${HERE}/../; \ make ; make installlib)
+	(cd expat ; ./configure --prefix=${HERE}/.. ; $(MAKE) ; $(MAKE) installlib)
 
 curl::
 	(/bin/csh -f mklibs)
 
 expat::
-	(cd expat ; ./configure --prefix=${HERE}/../; \ make ; make installlib)
+	(cd expat ; ./configure --prefix=${HERE}/.. ; $(MAKE) ; $(MAKE) installlib)
 
 apps:
 
 install:
-	(cd curl  ; make install)
-	#(cd expat ; make install)
+	(cd curl  ; $(MAKE) install)
+	#(cd expat ; $(MAKE) install)
 	(/bin/rm -rf ../man ../share)
 
 clean:
-	(cd curl  	; make clean)
-	(cd expat     	; make clean)
+	(cd curl  	; $(MAKE) clean)
+	(cd expat     	; $(MAKE) clean)
 
 distclean:
-	(cd curl  	; make distclean)
-	(cd expat     	; make distclean)
+	(cd curl  	; $(MAKE) distclean)
+	(cd expat     	; $(MAKE) distclean)
 
 
 
diff --git a/vendor/voclient/libsamp/Makefile b/vendor/voclient/libsamp/Makefile
index c74affb..dee105c 100644
--- a/vendor/voclient/libsamp/Makefile
+++ b/vendor/voclient/libsamp/Makefile
@@ -26,7 +26,7 @@ SHAREDLIB 	= $(LIBDIR)/$(LIBBASE).so.$(VERSION)
 
 # includes, flags and libraries
 CC              = gcc
-CINCS           = -I$(INCDIR)  -I.
+CINCS           = -I$(INCDIR)  -I. -Ilibxrpc/include -Ilibxrpc
 
 ifeq ("$(PLATFORM)", "Darwin")
     ifeq  ("$(PLMACH)", "macintel")
@@ -71,8 +71,8 @@ clean:
 	/bin/rm -f *.o *.a *.e *.so .BASE $(APPS)
 	(cd examples ; make clean)
 	(cd libxrpc  ; make clean)
-	(cd cfitsio  ; make clean)
 	/bin/rm -rf libxrpc/lib/build/* libxrpc/lib/*.dylib
+	(cd cfitsio  ; make clean)
 	/bin/rm -f SWIG* libvot* php_libvot.h
 	/bin/rm -f sampJava.[co]
 	/bin/rm -f sampPerl.[co]
diff --git a/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/curlmulti.c b/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/curlmulti.c
index 526a4db..5503b9f 100644
--- a/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/curlmulti.c
+++ b/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/curlmulti.c
@@ -17,7 +17,6 @@
 #endif
 
 #include <curl/curl.h>
-#include <curl/types.h>
 #include <curl/easy.h>
 #include <curl/multi.h>
 
diff --git a/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/curltransaction.c b/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/curltransaction.c
index 630f318..3086435 100644
--- a/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/curltransaction.c
+++ b/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/curltransaction.c
@@ -15,7 +15,6 @@
 #include "version.h"
 
 #include <curl/curl.h>
-#include <curl/types.h>
 #include <curl/easy.h>
 
 #include "curlversion.h"
diff --git a/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/xmlrpc_curl_transport.c b/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/xmlrpc_curl_transport.c
index 526381d..9b7b530 100644
--- a/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/xmlrpc_curl_transport.c
+++ b/vendor/voclient/libsamp/libxrpc/xmlrpc-c-1.16.29/lib/curl_transport/xmlrpc_curl_transport.c
@@ -83,7 +83,6 @@
 #include "xmlrpc-c/time_int.h"
 
 #include <curl/curl.h>
-#include <curl/types.h>
 #include <curl/easy.h>
 #include <curl/multi.h>
 
diff --git a/vendor/voclient/libvo/Makefile b/vendor/voclient/libvo/Makefile
index 69067e8..d680702 100644
--- a/vendor/voclient/libvo/Makefile
+++ b/vendor/voclient/libvo/Makefile
@@ -70,11 +70,14 @@ zztest: zztest.o $(OBJS)
 ####################################
 
 lib: objs $(INCS)
+	rm -f *.o
 	ar x ../lib/libsamp.a
 	ar x ../lib/libVOTable.a
 	ar x ../lib/libVOClient.a
 	ar x ../lib/libVOApps.a
+ifndef HOST_CURL
 	ar x ../lib/libcurl.a
+endif
 	chmod 644 *.o
 	ar rv libVO.a *.o
 	/bin/rm -f *.o __*
diff --git a/vendor/voclient/libvotable/Makefile b/vendor/voclient/libvotable/Makefile
index 6ee6e95..b0c2741 100644
--- a/vendor/voclient/libvotable/Makefile
+++ b/vendor/voclient/libvotable/Makefile
@@ -15,7 +15,6 @@ BINDIR    	:= ../bin/
 LIBDIR    	:= ../lib/
 INCDIR    	:= ../include/
 
-
 # secondary dependencies
 
 LIBBASE		= lib$(NAME)
@@ -48,9 +47,11 @@ OBJS 		= votParse.o votParse_f77.o votParse_spp.o \
 		  votExpatCB.o votElement.o votAttr.o votStack.o votHandle.o
 INCS 		= votParse.h
 
+ifneq ($(NOVOS),1)
 SPP_SRCS	= votUtil_spp.x
 SPP_OBJS	= votUtil_spp.o
 SPP_INCS 	= votParse_spp.h
+endif
 
 INCS_PRIV	= votParseP.h
 LIBS		= lib$(NAME).a
@@ -92,7 +93,9 @@ apps:
 ####################################
 
 .BASE:
+ifndef HOST_EXPAT
 	(./mkbase $(HERE)/lib$(NAME).a)
+endif
 	touch .BASE
 
 lib: objs
@@ -105,7 +108,7 @@ lib: objs
 ###############################################################################
 
 votUtil_spp.o: votUtil_spp.x votParse_spp.h
-	xc -c votUtil_spp.x
+	xc -c -w votUtil_spp.x
 
 
 ###############################################################################
diff --git a/vendor/voclient/libvotable/votParse.c b/vendor/voclient/libvotable/votParse.c
index d640c06..f60df32 100644
--- a/vendor/voclient/libvotable/votParse.c
+++ b/vendor/voclient/libvotable/votParse.c
@@ -18,7 +18,6 @@
 #include <sys/stat.h>
 
 #include <curl/curl.h>
-#include <curl/types.h>
 #include <curl/easy.h>
 
 #include "votParseP.h"
diff --git a/vendor/voclient/voapps/voInv.c b/vendor/voclient/voapps/voInv.c
index e6d7cb9..19bd64a 100644
--- a/vendor/voclient/voapps/voInv.c
+++ b/vendor/voclient/voapps/voInv.c
@@ -14,7 +14,6 @@
 
 #ifdef VO_INVENTORY
 #include <curl/curl.h>
-#include <curl/types.h>
 #include <curl/easy.h>
 #include "VOClient.h"
 #include "voAppsP.h"
diff --git a/vendor/voclient/voapps/votget.c b/vendor/voclient/voapps/votget.c
index dfd18b7..8e2c6f1 100644
--- a/vendor/voclient/voapps/votget.c
+++ b/vendor/voclient/voapps/votget.c
@@ -52,7 +52,6 @@
 #include <pthread.h>
 
 #include <curl/curl.h>
-#include <curl/types.h>
 #include <curl/easy.h>
 
 #include "votParse.h"
