diff -N -b -u3 -r plptools-0.6/Makefile.in plptools-0.6-mjg+jh/Makefile.in
--- plptools-0.6/Makefile.in	Mon Jan 17 23:06:30 2000
+++ plptools-0.6-mjg+jh/Makefile.in	Tue Jul 18 21:39:12 2000
@@ -69,6 +69,7 @@
 CXX = @CXX@
 DBASEDIR = @DBASEDIR@
 DDEV = @DDEV@
+DDIR = @DDIR@
 DDRIVE = @DDRIVE@
 DLLTOOL = @DLLTOOL@
 DPORT = @DPORT@
@@ -102,14 +103,14 @@
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
-TAR = gtar
+TAR = tar
 GZIP_ENV = --best
 all: all-redirect
 .SUFFIXES:
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps Makefile
+	cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile
 
-Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
@@ -276,6 +277,11 @@
 	-rm -rf $(distdir)
 	mkdir $(distdir)
 	-chmod 777 $(distdir)
+	here=`cd $(top_builddir) && pwd`; \
+	top_distdir=`cd $(distdir) && pwd`; \
+	distdir=`cd $(distdir) && pwd`; \
+	cd $(top_srcdir) \
+	  && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign Makefile
 	$(mkinstalldirs) $(distdir)/etc $(distdir)/include
 	@for file in $(DISTFILES); do \
 	  d=$(srcdir); \
diff -N -b -u3 -r plptools-0.6/README plptools-0.6-mjg+jh/README
--- plptools-0.6/README	Mon Jan 17 11:49:38 2000
+++ plptools-0.6-mjg+jh/README	Tue Jul 18 21:39:12 2000
@@ -88,7 +88,9 @@
  basic PLP/NCP services for the other two programs. It auto-
  connects to the psion, even after unplugging/switching off
  therefore it can run always in background (if you have a
- spare serial-device)
+ spare serial-device). If supplied, the -e option will cause ncpd to
+ automatically exit when the connection to the Psion is lost. This is useful
+ when used with a patch to mgetty (see the patches directory).
 
  plpftp is a FTP-like program for manipulating files on the Psion.
 
diff -N -b -u3 -r plptools-0.6/README.0.6-mjg plptools-0.6-mjg+jh/README.0.6-mjg
--- plptools-0.6/README.0.6-mjg	Thu Jan  1 01:00:00 1970
+++ plptools-0.6-mjg+jh/README.0.6-mjg	Tue Jul 18 22:09:21 2000
@@ -0,0 +1,62 @@
+Patches to plptools-0.6, collected by Matt Gumbley
+--------------------------------------------------
+
+1) Compilation patches to enable builds on Solaris. ftp.cc and ppsocket.cc
+2) Christof Meerwald's patches so that ncpd can autoterminate (-e option), and
+   patch for mgetty PLP autodetection (in the new patches directory), also a
+   patch to make the connection more stable.
+3) Peter Cherriman's patch which fixes the "one hour out" bug, which "...is that
+   a file timestamp is sometimes different when you do a "ls -l" on a mounted
+   psion, than the timestamp listed by the properties box on the psion.
+
+   My previous fix, no longer worked when the daylight saving changed. Linux 
+   stores timestamps internally as the number of seconds since the EPOC in 
+   UTC(GMT). However the psion seems stores timestamps as the number of seconds 
+   since the EPOC. However the EPOC in defined relative to the currently set 
+   timezone on the psion.
+
+   My new fix takes into account the timezone and DST status provided by the 
+   linux system, it now works in by GMT(UTC+0) and BST(UTC+0+DST), but I 
+   haven't tested it very much in other timezones, but I think it works. 
+
+   It provides the correct timestamps apart from files created within a hour 
+   of a DST change, however this can't be helped due to the strange way the 
+   psion stores timestamps and handles timezone and DST."
+4) Added --with-mountdir option to configure to allow the plpnfsd mount point
+   to be specified at build time. Default is /mnt/psion.
+5) Added /dev/psion at the start of the serial ports probed for.
+6) Peter Cherriman's patch that fixes compilation of ftp.cc on some platforms.
+7) Jim Hague's patches for SIBO, and later Linux Kernels, from Feb 2000. 
+   My apologies to Jim for not merging these sooner.  He says:
+
+   "I've been doing a little work on getting plptools working with my 3a. ...
+    I have plpftp working for file transfer and plpnsfd also working, at least 
+    sufficiently to back up my 3a.
+
+    I have also modified the include files required for the Linux build so 
+    that it works with a 2.2 series kernels with the NFSv3 patch applied; 
+    actually, all I've done is copy the relevant bits of the old NFSv2 headers.
+
+    It all seems to work with my 3a, though compared to p3nfsd plpnsfd seems 
+    very slow at listing directories - when time permits I shall take a 
+    closer look.
+
+    In addition to my English 3a (v3.22F) I have also tried it on an Italian 3a
+    (v3.40F). The latter exhibits some curious behaviour - if you start ncpd, 
+    run up plpftp and quit plpftp, the 3a closes its serial port down (drops 
+    CTS and DSR) and seems to need a reset before it will re-open the serial 
+    port. Again, when time permits I shall see if it does this when using 
+    PsiWin."
+
+    Other parts of Jim's patch:
+    "Which reminds me - 0.6 doesn't seem to have working copyFromPsion and
+     copyToPsion. I've fixed it up and tidied up the retrieval of Owner 
+     Infomation a little - 3as anyway send lots of \0\0\0\0\0, each of which 
+     was being displayed in plpftp as a blank line. "
+
+    Jim's patch removes lots of diagnostics in the rfsv16 code, and looks like
+    it fixes lots of stuff I hadn't got round to <hides head in shame>.
+    Splendid.
+
+Last patch update: 18/07/00.
+
diff -N -b -u3 -r plptools-0.6/configure plptools-0.6-mjg+jh/configure
--- plptools-0.6/configure	Mon Jan 17 23:06:31 2000
+++ plptools-0.6-mjg+jh/configure	Tue Jul 18 21:39:12 2000
@@ -163,6 +163,8 @@
   --with-drive=DRIVE      override default Psion drive [AUTO]"
 ac_help="$ac_help
   --with-basedir=DIR      override default Psion directory [\\\\]"
+ac_help="$ac_help
+  --with-mountdir=DDIR    override default mount point [/mnt/psion]"
 
 # Initialize some variables set by options.
 # The variables have the same names as the options, with
@@ -707,7 +709,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:711: checking for a BSD compatible install" >&5
+echo "configure:713: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -760,7 +762,7 @@
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:764: checking whether build environment is sane" >&5
+echo "configure:766: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -817,7 +819,7 @@
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:821: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:823: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -863,7 +865,7 @@
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:867: checking for working aclocal" >&5
+echo "configure:869: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -876,7 +878,7 @@
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:880: checking for working autoconf" >&5
+echo "configure:882: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -889,7 +891,7 @@
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:893: checking for working automake" >&5
+echo "configure:895: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -902,7 +904,7 @@
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:906: checking for working autoheader" >&5
+echo "configure:908: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -915,7 +917,7 @@
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:919: checking for working makeinfo" >&5
+echo "configure:921: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1004,7 +1006,7 @@
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1008: checking host system type" >&5
+echo "configure:1010: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -1025,7 +1027,7 @@
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1029: checking build system type" >&5
+echo "configure:1031: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -1045,7 +1047,7 @@
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1049: checking for $ac_word" >&5
+echo "configure:1051: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1075,7 +1077,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1079: checking for $ac_word" >&5
+echo "configure:1081: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1105,7 +1107,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1109: checking for $ac_word" >&5
+echo "configure:1111: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1156,7 +1158,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1160: checking for $ac_word" >&5
+echo "configure:1162: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1188,7 +1190,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1192: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1194: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1199,12 +1201,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 1203 "configure"
+#line 1205 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1230,12 +1232,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1234: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1236: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1239: checking whether we are using GNU C" >&5
+echo "configure:1241: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1244,7 +1246,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1248: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1250: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1263,7 +1265,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1267: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1269: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1306,7 +1308,7 @@
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1310: checking for ld used by GCC" >&5
+echo "configure:1312: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
     # Accept absolute paths.
@@ -1330,10 +1332,10 @@
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1334: checking for GNU ld" >&5
+echo "configure:1336: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1337: checking for non-GNU ld" >&5
+echo "configure:1339: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1369,7 +1371,7 @@
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1373: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1375: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1385,7 +1387,7 @@
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1389: checking for BSD-compatible nm" >&5
+echo "configure:1391: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1423,7 +1425,7 @@
 
 # Check for command to grab the raw symbol name followed by C symbol from nm.
 echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
-echo "configure:1427: checking command to parse $NM output" >&5
+echo "configure:1429: checking command to parse $NM output" >&5
 if eval "test \"`echo '$''{'ac_cv_sys_global_symbol_pipe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1486,11 +1488,11 @@
 int main(){nm_test_var='a';nm_test_func;return 0;}
 EOF
 
-  if { (eval echo configure:1490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  if { (eval echo configure:1492: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     # Now try to grab the symbols.
     ac_nlist=conftest.nm
   
-    if { (eval echo configure:1494: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+    if { (eval echo configure:1496: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
 
       # Try sorting and uniquifying the output.
       if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
@@ -1542,7 +1544,7 @@
 	  ac_save_CFLAGS="$CFLAGS"
 	  LIBS="conftestm.$ac_objext"
 	  CFLAGS="$CFLAGS$no_builtin_flag"
-	  if { (eval echo configure:1546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+	  if { (eval echo configure:1548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
 	    ac_pipe_works=yes
 	  else
 	    echo "configure: failed program was:" >&5
@@ -1588,7 +1590,7 @@
 echo "$ac_t""$ac_result" 1>&6
 
 echo $ac_n "checking for _ prefix in compiled symbols""... $ac_c" 1>&6
-echo "configure:1592: checking for _ prefix in compiled symbols" >&5
+echo "configure:1594: checking for _ prefix in compiled symbols" >&5
 if eval "test \"`echo '$''{'ac_cv_sys_symbol_underscore'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1597,10 +1599,10 @@
 void nm_test_func(){}
 int main(){nm_test_func;return 0;}
 EOF
-if { (eval echo configure:1601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   # Now try to grab the symbols.
   ac_nlist=conftest.nm
-  if { (eval echo configure:1604: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+  if { (eval echo configure:1606: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
     # See whether the symbols have a leading underscore.
     if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
       ac_cv_sys_symbol_underscore=yes
@@ -1626,7 +1628,7 @@
 USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1630: checking whether ln -s works" >&5
+echo "configure:1632: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1673,8 +1675,8 @@
 case "$host" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 1677 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:1678: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 1679 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:1680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -1695,19 +1697,19 @@
   SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:1699: checking whether the C compiler needs -belf" >&5
+echo "configure:1701: checking whether the C compiler needs -belf" >&5
 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1704 "configure"
+#line 1706 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:1711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   lt_cv_cc_needs_belf=yes
 else
@@ -1730,7 +1732,7 @@
   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1734: checking for $ac_word" >&5
+echo "configure:1736: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1762,7 +1764,7 @@
   # Extract the first word of "dlltool", so it can be a program name with args.
 set dummy dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1766: checking for $ac_word" >&5
+echo "configure:1768: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1797,7 +1799,7 @@
 # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
 set dummy ${ac_tool_prefix}as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1801: checking for $ac_word" >&5
+echo "configure:1803: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1829,7 +1831,7 @@
   # Extract the first word of "as", so it can be a program name with args.
 set dummy as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1833: checking for $ac_word" >&5
+echo "configure:1835: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1961,7 +1963,7 @@
 
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:1965: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:1967: checking whether to enable maintainer-specific portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -1985,7 +1987,7 @@
 
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1989: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1991: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2043,13 +2045,13 @@
 
 
   echo $ac_n "checking for a C-Compiler""... $ac_c" 1>&6
-echo "configure:2047: checking for a C-Compiler" >&5
+echo "configure:2049: checking for a C-Compiler" >&5
     echo "$ac_t""$CC" 1>&6 
  
   if test -z "$CC"; then # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2053: checking for $ac_word" >&5
+echo "configure:2055: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2078,7 +2080,7 @@
   if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2082: checking for $ac_word" >&5
+echo "configure:2084: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2126,7 +2128,7 @@
   if test -z "$CC"; then # Extract the first word of "xlc", so it can be a program name with args.
 set dummy xlc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2130: checking for $ac_word" >&5
+echo "configure:2132: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2155,7 +2157,7 @@
   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
   echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2159: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2161: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -2166,12 +2168,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 2170 "configure"
+#line 2172 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:2175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -2197,12 +2199,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2201: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2203: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
   echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:2206: checking whether we are using GNU C" >&5
+echo "configure:2208: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2211,7 +2213,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2215: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -2229,7 +2231,7 @@
   if test -z "$CFLAGS"; then
     if test "$ac_use_debug_code" = "yes"; then
       echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2233: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2235: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2276,7 +2278,7 @@
 
 
   echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2280: checking how to run the C preprocessor" >&5
+echo "configure:2282: checking how to run the C preprocessor" >&5
   # On Suns, sometimes $CPP names a directory.
   if test -n "$CPP" && test -d "$CPP"; then
     CPP=
@@ -2291,13 +2293,13 @@
     # On the NeXT, cc -E runs the code through the compiler's parser,
     # not just through cpp.
             cat > conftest.$ac_ext <<EOF
-#line 2295 "configure"
+#line 2297 "configure"
 #include "confdefs.h"
 #include <assert.h>
     Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2301: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2303: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2308,13 +2310,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
     cat > conftest.$ac_ext <<EOF
-#line 2312 "configure"
+#line 2314 "configure"
 #include "confdefs.h"
 #include <assert.h>
     Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2318: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2320: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2338,13 +2340,13 @@
   
 
   echo $ac_n "checking for a C++-Compiler""... $ac_c" 1>&6
-echo "configure:2342: checking for a C++-Compiler" >&5
+echo "configure:2344: checking for a C++-Compiler" >&5
     echo "$ac_t""$CXX" 1>&6 
  
   if test -z "$CXX"; then # Extract the first word of "g++", so it can be a program name with args.
 set dummy g++; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2348: checking for $ac_word" >&5
+echo "configure:2350: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2373,7 +2375,7 @@
   if test -z "$CXX"; then # Extract the first word of "CC", so it can be a program name with args.
 set dummy CC; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2377: checking for $ac_word" >&5
+echo "configure:2379: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2402,7 +2404,7 @@
   if test -z "$CXX"; then # Extract the first word of "xlC", so it can be a program name with args.
 set dummy xlC; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2406: checking for $ac_word" >&5
+echo "configure:2408: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2431,7 +2433,7 @@
   if test -z "$CXX"; then # Extract the first word of "DCC", so it can be a program name with args.
 set dummy DCC; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2435: checking for $ac_word" >&5
+echo "configure:2437: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2460,7 +2462,7 @@
   test -z "$CXX" && { echo "configure: error: no acceptable C++-compiler found in \$PATH" 1>&2; exit 1; }
 
   echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2464: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+echo "configure:2466: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
 
 ac_ext=C
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -2471,12 +2473,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 2475 "configure"
+#line 2477 "configure"
 #include "confdefs.h"
 
 int main(){return(0);}
 EOF
-if { (eval echo configure:2480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cxx_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -2502,12 +2504,12 @@
   { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2506: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2508: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
 cross_compiling=$ac_cv_prog_cxx_cross
 
   echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:2511: checking whether we are using GNU C++" >&5
+echo "configure:2513: checking whether we are using GNU C++" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2516,7 +2518,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:2520: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:2522: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gxx=yes
 else
   ac_cv_prog_gxx=no
@@ -2529,7 +2531,7 @@
     GXX=yes
   else
     echo $ac_n "checking whether we are using SPARC CC""... $ac_c" 1>&6
-echo "configure:2533: checking whether we are using SPARC CC" >&5
+echo "configure:2535: checking whether we are using SPARC CC" >&5
     GXX=
     cat > conftest.C << EOF
 #ifdef __SUNPRO_CC
@@ -2549,7 +2551,7 @@
   if test -z "$CXXFLAGS"; then 
     if test "$ac_use_debug_code" = "yes"; then
       echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:2553: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:2555: checking whether ${CXX-g++} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2603,7 +2605,7 @@
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2607: checking for $ac_word" >&5
+echo "configure:2609: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2636,7 +2638,7 @@
 # Extract the first word of "$CC", so it can be a program name with args.
 set dummy $CC; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2640: checking for $ac_word" >&5
+echo "configure:2642: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_CC_PATH'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2671,11 +2673,11 @@
 test "$CC_PATH" = /opt/SUNWspro/bin/cc && CFLAGS="-xO2 -v"
 
 echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:2675: checking for AIX" >&5
+echo "configure:2677: checking for AIX" >&5
 if test "`uname -s 2>/dev/null`" = AIX ; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for hostname in -lbsd""... $ac_c" 1>&6
-echo "configure:2679: checking for hostname in -lbsd" >&5
+echo "configure:2681: checking for hostname in -lbsd" >&5
 ac_lib_var=`echo bsd'_'hostname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2683,7 +2685,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lbsd  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2687 "configure"
+#line 2689 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2694,7 +2696,7 @@
 hostname()
 ; return 0; }
 EOF
-if { (eval echo configure:2698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2729,7 +2731,7 @@
 
 
 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
-echo "configure:2733: checking for readline in -lreadline" >&5
+echo "configure:2735: checking for readline in -lreadline" >&5
 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2737,7 +2739,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lreadline  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2741 "configure"
+#line 2743 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2748,7 +2750,7 @@
 readline()
 ; return 0; }
 EOF
-if { (eval echo configure:2752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2776,7 +2778,7 @@
 fi
 
 echo $ac_n "checking for add_history in -lhistory""... $ac_c" 1>&6
-echo "configure:2780: checking for add_history in -lhistory" >&5
+echo "configure:2782: checking for add_history in -lhistory" >&5
 ac_lib_var=`echo history'_'add_history | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2784,7 +2786,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lhistory  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2788 "configure"
+#line 2790 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2795,7 +2797,7 @@
 add_history()
 ; return 0; }
 EOF
-if { (eval echo configure:2799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2824,7 +2826,7 @@
 
 
 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:2828: checking for socket in -lsocket" >&5
+echo "configure:2830: checking for socket in -lsocket" >&5
 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2832,7 +2834,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2836 "configure"
+#line 2838 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2843,7 +2845,7 @@
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:2847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2871,7 +2873,7 @@
 fi
 
 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:2875: checking for gethostbyname in -lnsl" >&5
+echo "configure:2877: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2879,7 +2881,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2883 "configure"
+#line 2885 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2890,7 +2892,7 @@
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:2894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2919,7 +2921,7 @@
 
 ac_save_LDFLAGS=$LDFLAGS; LDFLAGS="-L/usr/ucblib -R/usr/ucblib $LDFLAGS"
 echo $ac_n "checking for svcudp_create in -lrpcsoc""... $ac_c" 1>&6
-echo "configure:2923: checking for svcudp_create in -lrpcsoc" >&5
+echo "configure:2925: checking for svcudp_create in -lrpcsoc" >&5
 ac_lib_var=`echo rpcsoc'_'svcudp_create | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2927,7 +2929,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lrpcsoc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2931 "configure"
+#line 2933 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2938,7 +2940,7 @@
 svcudp_create()
 ; return 0; }
 EOF
-if { (eval echo configure:2942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2968,7 +2970,7 @@
 
 
 echo $ac_n "checking for mount table""... $ac_c" 1>&6
-echo "configure:2972: checking for mount table" >&5
+echo "configure:2974: checking for mount table" >&5
 
 MTAB=NO
 for i in /etc/mnttab /etc/mtab; do
@@ -2986,17 +2988,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2990: checking for $ac_hdr" >&5
+echo "configure:2992: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2995 "configure"
+#line 2997 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3002: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3032,10 +3034,10 @@
     
 else
    echo $ac_n "checking for default serial line""... $ac_c" 1>&6
-echo "configure:3036: checking for default serial line" >&5
+echo "configure:3038: checking for default serial line" >&5
       
 DDEV=NO
-for i in /dev/tty0p0 /dev/tty00 /dev/ttyS0 /dev/term/a /dev/ttyfa /dev/ttya /dev/tty0 /dev/ttyf1 /dev/cuaa1; do
+for i in /dev/psion /dev/tty0p0 /dev/tty00 /dev/ttyS0 /dev/term/a /dev/ttyfa /dev/ttya /dev/tty0 /dev/ttyf1 /dev/cuaa1; do
   if test -c "$i" ; then
     DDEV=$i
     break 2
@@ -3106,6 +3108,21 @@
 
 
 
+# Check whether --with-mountdir or --without-mountdir was given.
+if test "${with_mountdir+set}" = set; then
+  withval="$with_mountdir"
+   DDIR="$withval"
+      echo "$ac_t""Overriding mount point: $DDIR" 1>&6 
+else
+   DDIR="/mnt/psion"
+      echo "$ac_t""Using default mount point: $DDIR" 1>&6
+    
+
+fi
+
+
+
+
 trap '' 1 2 15
 cat > confcache <<\EOF
 # This file is a shell script that caches the results of configure
@@ -3290,6 +3307,7 @@
 s%@DPORT@%$DPORT%g
 s%@DDRIVE@%$DDRIVE%g
 s%@DBASEDIR@%$DBASEDIR%g
+s%@DDIR@%$DDIR%g
 
 CEOF
 EOF
diff -N -b -u3 -r plptools-0.6/configure.in plptools-0.6-mjg+jh/configure.in
--- plptools-0.6/configure.in	Mon Jan 17 23:04:34 2000
+++ plptools-0.6-mjg+jh/configure.in	Tue Jul 18 21:39:12 2000
@@ -61,7 +61,7 @@
       AC_MSG_RESULT(Overriding serial line: $DDEV)
     ],
     [ AC_MSG_CHECKING(for default serial line)
-      AC_FIND_CDEV(/dev/tty0p0 /dev/tty00 /dev/ttyS0 /dev/term/a /dev/ttyfa /dev/ttya /dev/tty0 /dev/ttyf1 /dev/cuaa1, DDEV)
+      AC_FIND_CDEV(/dev/psion /dev/tty0p0 /dev/tty00 /dev/ttyS0 /dev/term/a /dev/ttyfa /dev/ttya /dev/tty0 /dev/ttyf1 /dev/cuaa1, DDEV)
       AC_MSG_RESULT($DDEV)
       test "$DDEV" = "NO" && AC_MSG_ERROR(NO serial lines. Use --with-serial.)
     ]
@@ -107,6 +107,17 @@
     ]
 )
 AC_SUBST(DBASEDIR)
+
+AC_ARG_WITH(mountdir,
+    [  --with-mountdir=DDIR    override default mount point [/mnt/psion]],
+    [ DDIR="$withval"
+      AC_MSG_RESULT(Overriding mount point: $DDIR) ],
+    [ DDIR="/mnt/psion"
+      AC_MSG_RESULT(Using default mount point: $DDIR)
+    ]
+)
+AC_SUBST(DDIR)
+
 
 AC_OUTPUT(
 	Makefile
diff -N -b -u3 -r plptools-0.6/include/config.h plptools-0.6-mjg+jh/include/config.h
--- plptools-0.6/include/config.h	Mon Jan 17 23:06:46 2000
+++ plptools-0.6-mjg+jh/include/config.h	Thu Jan  1 01:00:00 1970
@@ -1,39 +0,0 @@
-/* include/config.h.  Generated automatically by configure.  */
-/* include/config.h.in.  Generated automatically from configure.in by autoheader.  */
-
-/* Define if you have the <stdlib.h> header file.  */
-#define HAVE_STDLIB_H 1
-
-/* Define if you have the <sys/errno.h> header file.  */
-#define HAVE_SYS_ERRNO_H 1
-
-/* Define if you have the <sys/ioctl.h> header file.  */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define if you have the <sys/ttold.h> header file.  */
-/* #undef HAVE_SYS_TTOLD_H */
-
-/* Define if you have the bsd library (-lbsd).  */
-/* #undef HAVE_LIBBSD */
-
-/* Define if you have the history library (-lhistory).  */
-#define HAVE_LIBHISTORY 1
-
-/* Define if you have the nsl library (-lnsl).  */
-#define HAVE_LIBNSL 1
-
-/* Define if you have the readline library (-lreadline).  */
-#define HAVE_LIBREADLINE 1
-
-/* Define if you have the rpcsoc library (-lrpcsoc).  */
-/* #undef HAVE_LIBRPCSOC */
-
-/* Define if you have the socket library (-lsocket).  */
-/* #undef HAVE_LIBSOCKET */
-
-/* Name of package */
-#define PACKAGE "plptools"
-
-/* Version number of package */
-#define VERSION "0.6"
-
diff -N -b -u3 -r plptools-0.6/include/defs.h plptools-0.6-mjg+jh/include/defs.h
--- plptools-0.6/include/defs.h	Mon Jan 17 23:06:45 2000
+++ plptools-0.6-mjg+jh/include/defs.h	Tue Jul 18 21:39:13 2000
@@ -4,11 +4,11 @@
 /*
  * NFS related stuff
  */
-#define MTAB_PATH	"/etc/mtab"
+#define MTAB_PATH	"/etc/mnttab"
 #ifdef linux
-# define MTAB_TMP	"/etc/mtab~"
+# define MTAB_TMP	"/etc/mnttab~"
 #else
-# define MTAB_TMP	"/etc/mtab.p3nfsd"
+# define MTAB_TMP	"/etc/mnttab.p3nfsd"
 #endif
 
 #ifdef _IBMR2
@@ -17,10 +17,6 @@
 
 #define DUSER "root"
 
-#ifndef DDIR
-# define DDIR "/mnt/psion"
-#endif
-
 #ifndef PSIONHOSTNAME
 # define PSIONHOSTNAME "localhost"
 #endif
@@ -33,11 +29,13 @@
 /*
  * defaults for ncpd
  */
-#define DDEV		"/dev/ttyS0"
+#define DDEV		"/dev/term/a"
 #define DSPEED		115200
 #define DPORT		7501
 #define DDRIVE		"AUTO"
 #define DBASEDIR	"\\"
+#define DDIR		"/mnt/psion"
+
 
 /* Debugging */
 
diff -N -b -u3 -r plptools-0.6/include/defs.h.in plptools-0.6-mjg+jh/include/defs.h.in
--- plptools-0.6/include/defs.h.in	Wed Jan 12 16:34:48 2000
+++ plptools-0.6-mjg+jh/include/defs.h.in	Tue Jul 18 21:39:13 2000
@@ -17,10 +17,6 @@
 
 #define DUSER "root"
 
-#ifndef DDIR
-# define DDIR "/mnt/psion"
-#endif
-
 #ifndef PSIONHOSTNAME
 # define PSIONHOSTNAME "localhost"
 #endif
@@ -38,6 +34,8 @@
 #define DPORT		@DPORT@
 #define DDRIVE		"@DDRIVE@"
 #define DBASEDIR	"@DBASEDIR@"
+#define DDIR		"@DDIR@"
+
 
 /* Debugging */
 
diff -N -b -u3 -r plptools-0.6/include/linux-misc.h plptools-0.6-mjg+jh/include/linux-misc.h
--- plptools-0.6/include/linux-misc.h	Thu Jan  1 01:00:00 1970
+++ plptools-0.6-mjg+jh/include/linux-misc.h	Tue Jul 18 21:40:24 2000
@@ -0,0 +1,52 @@
+/*
+ * Linux nfs_mount_data version 3 (as expected by mp_mount.c).
+ *
+ * We extract it here to avoid some rather nasty fiddling necessary
+ * to compile with v3 and v4 (the latter as found in the NFS v3 stuff).
+ */
+
+#ifndef	LINUX_MISC_H
+#define	LINUX_MISC_H
+
+/*
+ * WARNING!  Do not delete or change the order of these fields.  If
+ * a new field is required then add it to the end.  The version field
+ * tracks which fields are present.  This will ensure some measure of
+ * mount-to-kernel version compatibility.  Some of these aren't used yet
+ * but here they are anyway.
+ */
+#define NFS_MOUNT_VERSION       3
+
+struct nfs_mount_data {
+        int             version;                /* 1 */
+        int             fd;                     /* 1 */
+        struct nfs_fh   root;                   /* 1 */
+        int             flags;                  /* 1 */
+        int             rsize;                  /* 1 */
+        int             wsize;                  /* 1 */
+        int             timeo;                  /* 1 */
+        int             retrans;                /* 1 */
+        int             acregmin;               /* 1 */
+        int             acregmax;               /* 1 */
+        int             acdirmin;               /* 1 */
+        int             acdirmax;               /* 1 */
+        struct sockaddr_in addr;                /* 1 */
+        char            hostname[256];          /* 1 */
+        int             namlen;                 /* 2 */
+        unsigned int    bsize;                  /* 3 */
+};
+
+/* bits in the flags field */
+
+#define NFS_MOUNT_SOFT          0x0001  /* 1 */
+#define NFS_MOUNT_INTR          0x0002  /* 1 */
+#define NFS_MOUNT_SECURE        0x0004  /* 1 */
+#define NFS_MOUNT_POSIX         0x0008  /* 1 */
+#define NFS_MOUNT_NOCTO         0x0010  /* 1 */
+#define NFS_MOUNT_NOAC          0x0020  /* 1 */
+#define NFS_MOUNT_TCP           0x0040  /* 2 */
+#define NFS_MOUNT_VER3          0x0080  /* 3 */
+#define NFS_MOUNT_KERBEROS      0x0100  /* 3 */
+#define NFS_MOUNT_NONLM         0x0200  /* 3 */
+ 
+#endif
diff -N -b -u3 -r plptools-0.6/include/nfs_prot.h plptools-0.6-mjg+jh/include/nfs_prot.h
--- plptools-0.6/include/nfs_prot.h	Mon Jun 28 09:55:06 1999
+++ plptools-0.6-mjg+jh/include/nfs_prot.h	Tue Jul 18 21:40:24 2000
@@ -9,7 +9,6 @@
 #endif
 #ifdef linux
 # include <sys/time.h>
-# include <linux/nfs.h>
 #endif
 #ifdef __sgi
 # include <rpc/types.h>
@@ -42,7 +41,7 @@
 #define NFSMODE_SOCK 0140000
 #define NFSMODE_FIFO 0010000
 
-#if !defined(hpux) && !defined(linux) && !defined(__sgi)
+#if !defined(hpux) && !defined(__sgi)
 enum nfsstat {
 	NFS_OK = 0,
 	NFSERR_PERM = 1,
@@ -63,16 +62,12 @@
 	NFSERR_STALE = 70,
 	NFSERR_WFLUSH = 99
 };
-#endif /* !hpux, linux */
+#endif /* !hpux, sgi */
 
-#ifdef linux
-typedef enum nfs_stat nfsstat;
-#else
 typedef enum nfsstat nfsstat;
-#endif
 bool_t xdr_nfsstat();
 
-#if !defined(hpux) && !defined(linux) && !defined(__sgi)
+#if !defined(hpux) && !defined(__sgi)
 enum ftype {
 	NFNON = 0,
 	NFREG = 1,
@@ -85,7 +80,7 @@
 	NFFIFO = 8
 };
 typedef enum ftype ftype;
-#endif /* !linux, hpux */
+#endif /* !hpux, sgi */
 
 #ifdef __sgi
 typedef enum nfsftype ftype;
@@ -94,17 +89,12 @@
 #ifdef hpux
 typedef enum nfsftype ftype;
 #endif
-#ifdef linux
-typedef enum nfs_ftype ftype;
-#endif
 
 bool_t xdr_ftype();
 
-#ifndef linux
 struct nfs_fh {
 	char data[NFS_FHSIZE];
 };
-#endif
 typedef struct nfs_fh nfs_fh;
 bool_t xdr_nfs_fh();
 
diff -N -b -u3 -r plptools-0.6/include/stamp-h plptools-0.6-mjg+jh/include/stamp-h
--- plptools-0.6/include/stamp-h	Thu Jan  1 01:00:00 1970
+++ plptools-0.6-mjg+jh/include/stamp-h	Tue Jul 18 21:39:13 2000
@@ -0,0 +1 @@
+timestamp
diff -N -b -u3 -r plptools-0.6/lib/Makefile.in plptools-0.6-mjg+jh/lib/Makefile.in
--- plptools-0.6/lib/Makefile.in	Mon Jan 17 23:06:30 2000
+++ plptools-0.6-mjg+jh/lib/Makefile.in	Tue Jul 18 21:39:13 2000
@@ -66,6 +66,7 @@
 CXX = @CXX@
 DBASEDIR = @DBASEDIR@
 DDEV = @DDEV@
+DDIR = @DDIR@
 DDRIVE = @DDRIVE@
 DLLTOOL = @DLLTOOL@
 DPORT = @DPORT@
@@ -114,8 +115,12 @@
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
-TAR = gtar
+TAR = tar
 GZIP_ENV = --best
+DEP_FILES =  .deps/bufferarray.P .deps/bufferstore.P .deps/iowatch.P \
+.deps/log.P .deps/ppsocket.P .deps/rfsv.P .deps/rfsv16.P .deps/rfsv32.P \
+.deps/rfsvfactory.P .deps/rpcs.P .deps/rpcs16.P .deps/rpcs32.P \
+.deps/rpcsfactory.P
 SOURCES = $(libplp_la_SOURCES)
 OBJECTS = $(libplp_la_OBJECTS)
 
@@ -123,9 +128,9 @@
 .SUFFIXES:
 .SUFFIXES: .S .c .cc .lo .o .s
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps lib/Makefile
+	cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile
 
-Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
@@ -155,9 +160,6 @@
 	  $(LIBTOOL)  --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
 	done
 
-.c.o:
-	$(COMPILE) -c $<
-
 .s.o:
 	$(COMPILE) -c $<
 
@@ -174,9 +176,6 @@
 
 maintainer-clean-compile:
 
-.c.lo:
-	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
-
 .s.lo:
 	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
 
@@ -234,6 +233,11 @@
 subdir = lib
 
 distdir: $(DISTFILES)
+	here=`cd $(top_builddir) && pwd`; \
+	top_distdir=`cd $(top_distdir) && pwd`; \
+	distdir=`cd $(distdir) && pwd`; \
+	cd $(top_srcdir) \
+	  && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu lib/Makefile
 	@for file in $(DISTFILES); do \
 	  d=$(srcdir); \
 	  if test -d $$d/$$file; then \
@@ -244,6 +248,57 @@
 	    || cp -p $$d/$$file $(distdir)/$$file || :; \
 	  fi; \
 	done
+
+DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
+
+-include $(DEP_FILES)
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+	-rm -rf .deps
+
+maintainer-clean-depend:
+
+%.o: %.c
+	@echo '$(COMPILE) -c $<'; \
+	$(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-cp .deps/$(*F).pp .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm .deps/$(*F).pp
+
+%.lo: %.c
+	@echo '$(LTCOMPILE) -c $<'; \
+	$(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-sed -e 's/^\([^:]*\)\.o[ 	]*:/\1.lo \1.o :/' \
+	  < .deps/$(*F).pp > .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm -f .deps/$(*F).pp
+
+%.o: %.cc
+	@echo '$(CXXCOMPILE) -c $<'; \
+	$(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-cp .deps/$(*F).pp .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm .deps/$(*F).pp
+
+%.lo: %.cc
+	@echo '$(LTCXXCOMPILE) -c $<'; \
+	$(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-sed -e 's/^\([^:]*\)\.o[ 	]*:/\1.lo \1.o :/' \
+	  < .deps/$(*F).pp > .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm -f .deps/$(*F).pp
 info-am:
 info: info-am
 dvi-am:
@@ -281,27 +336,27 @@
 
 maintainer-clean-generic:
 mostlyclean-am:  mostlyclean-libLTLIBRARIES mostlyclean-compile \
-		mostlyclean-libtool mostlyclean-tags \
+		mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
 		mostlyclean-generic
 
 mostlyclean: mostlyclean-am
 
 clean-am:  clean-libLTLIBRARIES clean-compile clean-libtool clean-tags \
-		clean-generic mostlyclean-am
+		clean-depend clean-generic mostlyclean-am
 
 clean: clean-am
 
 distclean-am:  distclean-libLTLIBRARIES distclean-compile \
-		distclean-libtool distclean-tags distclean-generic \
-		clean-am
+		distclean-libtool distclean-tags distclean-depend \
+		distclean-generic clean-am
 	-rm -f libtool
 
 distclean: distclean-am
 
 maintainer-clean-am:  maintainer-clean-libLTLIBRARIES \
 		maintainer-clean-compile maintainer-clean-libtool \
-		maintainer-clean-tags maintainer-clean-generic \
-		distclean-am
+		maintainer-clean-tags maintainer-clean-depend \
+		maintainer-clean-generic distclean-am
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
 
@@ -313,12 +368,13 @@
 distclean-compile clean-compile maintainer-clean-compile \
 mostlyclean-libtool distclean-libtool clean-libtool \
 maintainer-clean-libtool tags mostlyclean-tags distclean-tags \
-clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
-check-am installcheck-am installcheck install-exec-am install-exec \
-install-data-am install-data install-am install uninstall-am uninstall \
-all-redirect all-am all installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+clean-tags maintainer-clean-tags distdir mostlyclean-depend \
+distclean-depend clean-depend maintainer-clean-depend info-am info \
+dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+install-exec install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff -N -b -u3 -r plptools-0.6/lib/bufferstore.cc plptools-0.6-mjg+jh/lib/bufferstore.cc
--- plptools-0.6/lib/bufferstore.cc	Sun Jan 16 19:05:13 2000
+++ plptools-0.6-mjg+jh/lib/bufferstore.cc	Tue Jul 18 21:40:24 2000
@@ -54,6 +54,7 @@
 	len = a.getLen();
 	memcpy(buff, a.getString(0), len);
 	start = 0;
+	return *this;
 }
 
 void bufferStore::init() {
diff -N -b -u3 -r plptools-0.6/lib/ppsocket.cc plptools-0.6-mjg+jh/lib/ppsocket.cc
--- plptools-0.6/lib/ppsocket.cc	Wed Jan 12 17:30:34 2000
+++ plptools-0.6-mjg+jh/lib/ppsocket.cc	Tue Jul 18 21:39:13 2000
@@ -181,7 +181,11 @@
 ppsocket *ppsocket::
 accept(char *Peer, int MaxLen)
 {
+#ifdef sun
+	int len;
+#else
 	socklen_t len;
+#endif
 	ppsocket *accepted;
 	char *peer;
 
diff -N -b -u3 -r plptools-0.6/lib/rfsv.h plptools-0.6-mjg+jh/lib/rfsv.h
--- plptools-0.6/lib/rfsv.h	Sun Jan 16 22:04:41 2000
+++ plptools-0.6-mjg+jh/lib/rfsv.h	Tue Jul 18 21:40:24 2000
@@ -46,6 +46,9 @@
 		virtual long rename(const char *, const char *) = 0;
 		virtual long remove(const char *) = 0;
 
+		virtual long attr2std(long) = 0;
+		virtual long std2attr(long) = 0;
+		
 		char *opErr(long);
 
 		enum seek_mode {
@@ -144,6 +147,27 @@
 
 			// Special error code for "Operation not permitted in RFSV16"
 			E_PSI_NOT_SIBO = -200
+		};
+
+		enum file_attribs {
+			// Common
+			PSI_A_RDONLY = 0x0001,
+			PSI_A_HIDDEN = 0x0002,
+			PSI_A_SYSTEM = 0x0004,
+			PSI_A_DIR = 0x0008,
+			PSI_A_ARCHIVE = 0x0010,
+			PSI_A_VOLUME = 0x0020,
+
+			// EPOC only
+			PSI_A_NORMAL = 0x0040,
+			PSI_A_TEMP = 0x0080,
+			PSI_A_COMPRESSED = 0x0100,
+
+			// SIBO only
+			PSI_A_READ = 0x0200,
+			PSI_A_EXEC = 0x0400,
+			PSI_A_STREAM = 0x0800,
+			PSI_A_TEXT = 0x1000
 		};
 };
 
diff -N -b -u3 -r plptools-0.6/lib/rfsv16.cc plptools-0.6-mjg+jh/lib/rfsv16.cc
--- plptools-0.6/lib/rfsv16.cc	Mon Jan 17 23:16:05 2000
+++ plptools-0.6-mjg+jh/lib/rfsv16.cc	Tue Jul 18 21:40:24 2000
@@ -37,6 +37,8 @@
 #include "ppsocket.h"
 #include "bufferarray.h"
 
+#define	RFSV16_MAXDATALEN	852	// 640
+
 rfsv16::rfsv16(ppsocket *_skt) : serNum(0)
 {
 	skt = _skt;
@@ -57,7 +59,6 @@
 void rfsv16::
 reconnect()
 {
-cerr << "rfsv16::reconnect" << endl;
 	skt->closeSocket();
 	skt->reconnect();
 	serNum = 0;
@@ -68,7 +69,6 @@
 void rfsv16::
 reset()
 {
-cerr << "rfsv16::reset" << endl;
 	bufferStore a;
 	status = E_PSI_FILE_DISC;
 	a.addStringT(getConnectName());
@@ -91,7 +91,7 @@
 const char *rfsv16::
 getConnectName()
 {
-	return "SYS$RFSV.*";
+	return "SYS$RFSV";
 }
 
 int rfsv16::
@@ -148,14 +148,10 @@
 		return E_PSI_FILE_DISC;
   
 	long res = getResponse(a);
-	// cerr << "fopen, getword 0 is " << hex << setw(2) << a.getWord(0) << endl;
-	// cerr << "fopen, getlen is " << hex << setw(2) << a.getLen() << endl;
-	// cerr << "fopen, res is " << hex << setw(2) << res << endl;
-	if (!res && a.getLen() == 4 && a.getWord(0) == 0) {
-		handle = (long)a.getWord(2);
+	if (res == 0) {
+		handle = (long)a.getWord(0);
 		return 0;
 	}
-	// cerr << "fopen: Unknown response (" << attr << "," << name << ") " << a <<endl;
 	return res;
 }
 
@@ -163,24 +159,38 @@
 long rfsv16::
 mktemp(long *handle, char *tmpname)
 {
-cerr << "rfsv16::mktemp ***" << endl;
+	bufferStore a;
+
+	// FIXME: anything that calls fopen should NOT do the name
+	// conversion - it's just done here. 
+
+	a.addWord(P_FUNIQUE);
+	a.addString("TMP");
+	a.addByte(0x00); // Needs to be manually Null-Terminated.
+	if (!sendCommand(OPENUNIQUE, a))
+		return E_PSI_FILE_DISC;
+  
+	long res = getResponse(a);
+	if (res == 0) {
+		handle = (long)a.getWord(0);
+		strcpy(tmpname, a.getString(2));
 	return 0;
+	}
+	return res;
 }
 
 // internal and external
 long rfsv16::
 fcreatefile(long attr, const char *name, long &handle)
 {
-cerr << "rfsv16::fcreatefile ***" << endl;
-	return 0;
+	return fopen(attr | P_FCREATE, name, handle);
 }
 
 // this is internal - not used by plpnfsd, unlike fcreatefile
 long rfsv16::
 freplacefile(long attr, const char *name, long &handle)
 {
-cerr << "rfsv16::freplacefile ***" << endl;
-	return 0;
+	return fopen(attr | P_FREPLACE, name, handle);
 }
 
 // internal
@@ -198,11 +208,7 @@
 	a.addWord(fileHandle & 0xFFFF);
 	if (!sendCommand(FCLOSE, a))
 		return E_PSI_FILE_DISC;
-	long res = getResponse(a);
-	if (!res && a.getLen() == 2)
-		return (long)a.getWord(0);
-	cerr << "fclose: Unknown response "<< a <<endl;
-	return 1;
+	return getResponse(a);
 }
 
 long rfsv16::
@@ -224,7 +230,7 @@
 		res = getResponse(a);
 		if (res)
 			break;
-		a.discardFirstBytes(4); // Don't know what these mean!
+		a.discardFirstBytes(2); // Don't know what these mean!
 		while (a.getLen() > 16) {
 			int version = a.getWord(0);
 			if (version != 2) {
@@ -300,15 +306,13 @@
 		return E_PSI_FILE_DISC;
   
 	long res = getResponse(a);
-	if (res != 0)
+	if (res != 0) {
+		cerr << "fgetmtime: Error " << res << " on file " << name << endl;	    
 		return res;
-	if (a.getLen() == 2) {
-		cerr << "fgetmtime: Error " << a.getWord(0) << " on file " << name << endl;
-		return 1;
 	}
-	else if (a.getLen() == 18 && a.getWord(0) == 0) {
-		*mtime = a.getDWord(10);
-		return a.getWord(0);
+	else if (a.getLen() == 16) {
+		*mtime = a.getDWord(8);
+		return res;
 	}
 	cerr << "fgetmtime: Unknown response (" << name << ") " << a <<endl;
 	return 1;
@@ -338,15 +342,13 @@
 		return E_PSI_FILE_DISC;
   
 	long res = getResponse(a);
-	if (res != 0)
+	if (res != 0) {
+		cerr << "fgetattr: Error " << res << " on file " << name << endl;	    
 		return res;
-	if (a.getLen() == 2) {
-		cerr << "fgetattr: Error " << a.getWord(0) << " on file " << name << endl;
-		return 1;
 	}
-	else if (a.getLen() == 18 && a.getWord(0) == 0) {
-		*attr = (long)(a.getWord(4));
-		return a.getWord(0);
+	else if (a.getLen() == 16) {
+		*attr = (long)(a.getWord(2));
+		return res;
 	}
 	cerr << "fgetattr: Unknown response (" << name << ") " << a <<endl;
 	return 1;
@@ -366,17 +368,15 @@
 		return E_PSI_FILE_DISC;
   
 	long res = getResponse(a);
-	if (res != 0)
-		return res;
-	if (a.getLen() == 2) {
+	if (res != 0) {
 		cerr << "fgeteattr: Error " << a.getWord(0) << " on file " << name << endl;
-		return 1;
+		return res;
 	}
-	else if (a.getLen() == 18 && a.getWord(0) == 0) {
-		*attr = (long)(a.getWord(4));
-		*size = a.getDWord(6);
-		*time = a.getDWord(10);
-		return a.getWord(0);
+	else if (a.getLen() == 16) {
+		*attr = (long)(a.getWord(2));
+		*size = a.getDWord(4);
+		*time = a.getDWord(8);
+		return res;
 	}
 	cerr << "fgeteattr: Unknown response (" << name << ") " << a <<endl;
 	return 1;
@@ -429,7 +429,7 @@
 		res = getResponse(a);
 		if (res)
 			break;
-		a.discardFirstBytes(4); // Don't know what these mean!
+		a.discardFirstBytes(2); // Don't know what these mean!
 		while (a.getLen() > 16) {
 			int version = a.getWord(0);
 			if (version != 2) {
@@ -475,7 +475,7 @@
 
 	// Find the drive to FOPEN
 	char name[4] = { 'x', ':', '\\', '\0' } ;
-	a.discardFirstBytes(8); // Result, fsys, dev, path, file, file, ending, flag
+	a.discardFirstBytes(6); // Result, fsys, dev, path, file, file, ending, flag
 	/* This leaves R E M : : M : \ */
 	name[0] = (char) a.getByte(5); // the M
 	long status = fopen(P_FDEVICE, name, fileHandle);
@@ -491,7 +491,6 @@
 		res = getResponse(a);
 		if (res)
 			break;
-		a.discardFirstBytes(2); // Result
 		int version = a.getWord(0);
 		if (version != 2) {
 			cerr << "devlist: not version 2" << endl;
@@ -551,7 +550,6 @@
 		// cerr << "devinfo STATUSDEVICE res is " << dec << (signed short int) res << endl;
 		return NULL;
 	}
-	a.discardFirstBytes(2); // Result
 	int type = a.getWord(2);
 	int changeable = a.getWord(4);
 	long size = a.getDWord(6);
@@ -571,14 +569,24 @@
 bool rfsv16::
 sendCommand(enum commands cc, bufferStore & data)
 {
+	if (status == E_PSI_FILE_DISC) {
+		reconnect();
+		if (status == E_PSI_FILE_DISC)
+			return FALSE;
+	}
+	
 	bool result;
 	bufferStore a;
 	a.addWord(cc);
 	a.addWord(data.getLen());
 	a.addBuff(data);
 	result = skt->sendBufferStore(a);
+	if (!result) {
+		reconnect();
+		result = skt->sendBufferStore(a);
 	if (!result)
 		status = E_PSI_FILE_DISC;
+	}
 	return result;
 }
 
@@ -589,17 +597,22 @@
 	// getWord(2) is the size field
 	// which is the body of the response not counting the command (002a) and
 	// the size word.
-	if (skt->getBufferStore(data) == 1 &&
-	    data.getWord(0) == 0x2a &&
+	if (skt->getBufferStore(data) != 1) {
+		cerr << "rfsv16::getResponse: duff response. "
+			"getBufferStore failed." << endl;
+	} else if (data.getWord(0) == 0x2a &&
 	    data.getWord(2) == data.getLen()-4) {
-		data.discardFirstBytes(4);
-		long ret = data.getWord(0);
+		long ret = (short)data.getWord(4);
+		data.discardFirstBytes(6);
 		return ret;
-	} else
-		status = E_PSI_FILE_DISC;
+	} else {
 	cerr << "rfsv16::getResponse: duff response. Size field:" <<
-data.getWord(2) << " Frame size:" << data.getLen()-4 << " Result field:" <<
-data.getWord(4) << endl;
+			data.getWord(2) << " Frame size:" <<
+			data.getLen()-4 << " Result field:" <<
+			data.getWord(4) << endl;
+	}
+
+	status = E_PSI_FILE_DISC;
 	return status;
 }
 
@@ -614,61 +627,88 @@
 long rfsv16::
 fread(long handle, unsigned char *buf, long len)
 {
-cerr << "rfsv16::fread ***" << endl;
+	long res;
+	long count = 0;
+
+	while (count < len) {
 	bufferStore a;
-	long remaining = len;
-	// Read in blocks of 291 bytes; the maximum payload for an RFSV frame.
-	// ( As seen in traces ) - this isn't optimal: RFSV can handle
-	// fragmentation of frames, where only the first FREAD RESPONSE frame
-	// has a RESPONSE (00 2A), SIZE and RESULT field. Every subsequent frame
+
+		// Read in blocks of 291 bytes; the maximum payload for
+		// an RFSV frame. ( As seen in traces ) - this isn't optimal:
+		// RFSV can handle fragmentation of frames, where only the
+		// first FREAD RESPONSE frame has a RESPONSE (00 2A), SIZE
+		// and RESULT field. Every subsequent frame
 	// just has data, 297 bytes (or less) of it.
-	const int maxblock = 291;
-	long readsofar = 0;
-	while (remaining) {
-		long thisblock = (remaining > maxblock) ? maxblock : remaining;
-cerr << "fread: " << dec << remaining << " bytes remain. This block is " << thisblock
-<< " bytes." << endl;
-		a.init();
 		a.addWord(handle);
-		a.addWord(thisblock);
+		a.addWord((len - count) > RFSV16_MAXDATALEN
+			  ? RFSV16_MAXDATALEN
+			  : (len - count));
 		sendCommand(FREAD, a);
-		long res = getResponse(a);
-		remaining -= a.getLen();
-// copy the data to buf
+		res = getResponse(a);
 
-cerr << "fread getResponse returned " << dec<< (signed short int) res << " data: " << a << dec <<endl;
-		if (res) {
+		// The rest of the code treats a 0 return from here
+		// as meaning EOF, so we'll arrange for that to happen.
+		if (res == E_PSI_FILE_EOF)
+			return count;
+		else if (res < 0)
 			return res;
+
+		res = a.getLen();
+		memcpy(buf, a.getString(), res);
+		count += res;
+		buf += res;
 		}
-	}
-	return len;
+	return count;
 }
 
 long rfsv16::
 fwrite(long handle, unsigned char *buf, long len)
 {
-cerr << "rfsv16::fwrite ***" << endl;
-	return 0;
+	long res;
+	long count = 0;
+
+	while (count < len) {
+		bufferStore a;
+		int nbytes;
+
+		// Write in blocks of 291 bytes; the maximum payload for
+		// an RFSV frame. ( As seen in traces ) - this isn't optimal:
+		// RFSV can handle fragmentation of frames, where only the
+		// first FREAD RESPONSE frame has a RESPONSE (00 2A), SIZE
+		// and RESULT field. Every subsequent frame
+		// just has data, 297 bytes (or less) of it.
+		nbytes = (len - count) > RFSV16_MAXDATALEN
+		    ? RFSV16_MAXDATALEN
+		    : (len - count);
+		a.addWord(handle);
+		a.addBytes(buf, nbytes);
+		sendCommand(FWRITE, a);
+		res = getResponse(a);
+		if (res != 0)
+			return res;
+		
+		count += nbytes;
+		buf += nbytes;
+	}
+	return count;
 }
 
 long rfsv16::
 copyFromPsion(const char *from, const char *to, cpCallback_t cb)
 {
-cerr << "rfsv16::copyFromPsion" << endl;
 	long handle;
 	long res;
 	long len;
 
 	if ((res = fopen(P_FSHARE | P_FSTREAM, from, handle)) != 0)
 		return res;
-cerr << "fopen response is " << dec << (signed short int)res << endl;
 	ofstream op(to);
 	if (!op) {
 		fclose(handle);
 		return -1;
 	}
 	do {
-		unsigned char buf[2000];
+		unsigned char buf[RFSV_SENDLEN];
 		if ((len = fread(handle, buf, sizeof(buf))) > 0)
 			op.write(buf, len);
 		if (cb) {
@@ -681,13 +721,12 @@
 
 	fclose(handle);
 	op.close();
-	return len;
+	return len == E_PSI_FILE_EOF ? 0 : len;
 }
 
 long rfsv16::
 copyToPsion(const char *from, const char *to, cpCallback_t cb)
 {
-cerr << "rfsv16::copyToPsion" << endl;
 	long handle;
 	long res;
 
@@ -701,50 +740,30 @@
 			return res;
 	}
 	unsigned char *buff = new unsigned char[RFSV_SENDLEN];
-	int total = 0;
-	while (ip && !ip.eof()) {
+	while (res >= 0 && ip && !ip.eof()) {
 		ip.read(buff, RFSV_SENDLEN);
-		bufferStore tmp(buff, ip.gcount());
-		int len = tmp.getLen();
-		total += len;
-		if (len == 0)
-			break;
-		bufferStore a;
-		a.addDWord(handle);
-		a.addBuff(tmp);
-		if (!sendCommand(FWRITE, a)) { // FIXME: need to check params
-			fclose(handle);
-			ip.close();
-			delete[]buff;
-			return E_PSI_FILE_DISC;
+		res = fwrite(handle, buff, ip.gcount());
+		if (cb)
+			if (!cb(res)) {
+				res = E_PSI_FILE_CANCEL;
 		}
-		res = getResponse(a);
-		if (res) {
-			fclose(handle);
-			ip.close();
-			delete[]buff;
-			return res;
 		}
-		if (cb) {
-			if (!cb(len)) {
-				fclose(handle);
-				ip.close();
+
 				delete[]buff;
-				return E_PSI_FILE_CANCEL;
-			}
-		}
-	}
 	fclose(handle);
 	ip.close();
-	delete[]buff;
 	return 0;
 }
 
 long rfsv16::
 fsetsize(long handle, long size)
 {
-cerr << "rfsv16::fsetsize ***" << endl;
-	return 0;
+	bufferStore a;
+	a.addWord(handle);
+	a.addDWord(size);
+	if (!sendCommand(FSETEOF, a))
+		return E_PSI_FILE_DISC;
+	return getResponse(a);
 }
 
 /*
@@ -755,8 +774,92 @@
 long rfsv16::
 fseek(long handle, long pos, long mode)
 {
-cerr << "rfsv16::fseek ***" << endl;
-	return 0;
+	bufferStore a;
+	long res;
+	long savpos = 0;
+	long realpos;
+	long calcpos = 0;
+
+/*
+   seek-parameter for psion:
+   dword position
+   dword handle
+   dword mode
+   1 = from start
+   2 = from current pos
+   3 = from end
+   ??no more?? 4 = sense recpos
+   ??no more?? 5 = set recpos
+   ??no more?? 6 = text-rewind
+ */
+
+	if ((mode < PSI_SEEK_SET) || (mode > PSI_SEEK_END))
+		return E_PSI_GEN_ARG;
+
+	if ((mode == PSI_SEEK_CUR) && (pos >= 0)) {
+		/* get and save current position */
+		a.init();
+		a.addWord(handle);
+		a.addDWord(0);
+		a.addWord(PSI_SEEK_CUR);
+		if (!sendCommand(FSEEK, a))
+			return E_PSI_FILE_DISC;
+		if ((res = getResponse(a)) != 0)
+			return res;
+		savpos = a.getDWord(0);
+		if (pos == 0)
+			return savpos;
+	}
+	if ((mode == PSI_SEEK_END) && (pos >= 0)) {
+		/* get and save end position */
+		a.init();
+		a.addWord(handle);
+		a.addDWord(0);
+		a.addWord(PSI_SEEK_END);
+		if (!sendCommand(FSEEK, a))
+			return E_PSI_FILE_DISC;
+		if ((res = getResponse(a)) != 0)
+			return res;
+		savpos = a.getDWord(0);
+		if (pos == 0)
+			return savpos;
+	}
+	/* Now the real seek */
+	a.addWord(handle);
+	a.addDWord(pos);
+	a.addWord(mode);
+	if (!sendCommand(FSEEK, a))
+		return E_PSI_FILE_DISC;
+	if ((res = getResponse(a)) != 0)
+		return res;
+	realpos = a.getDWord(0);
+	switch (mode) {
+		case PSI_SEEK_SET:
+			calcpos = pos;
+			break;
+		case PSI_SEEK_CUR:
+			calcpos = savpos + pos;
+			break;
+		case PSI_SEEK_END:
+			return realpos;
+			break;
+	}
+	if (calcpos > realpos) {
+		/* Beyond end of file */
+		res = fsetsize(handle, calcpos);
+		if (res != 0)
+			return res;
+		a.init();
+		a.addWord(handle);
+		a.addDWord(calcpos);
+		a.addWord(PSI_SEEK_SET);
+		if (!sendCommand(FSEEK, a))
+			return E_PSI_FILE_DISC;
+		if ((res = getResponse(a)) != 0)
+			return res;
+		realpos = a.getDWord(0);
+	}
+	return realpos;
 }
 
 long rfsv16::
@@ -771,11 +874,11 @@
 				// and this needs sending in the length word.
 	sendCommand(MKDIR, a);
 	long res = getResponse(a);
-	if (!res && a.getLen() == 2) {
+	if (!res) {
 		// Correct response
-		return a.getWord(0);
+		return res;
 	}
-	cerr << "Unknown response from mkdir "<< a <<endl;
+	cerr << "Unknown response from mkdir "<< res <<endl;
 	return 1;
 }
 
@@ -806,11 +909,11 @@
 				// and this needs sending in the length word.
 	sendCommand(RENAME, a);
 	long res = getResponse(a);
-	if (!res && a.getLen() == 2) {
+	if (!res) {
 		// Correct response
-		return a.getWord(0);
+		return res;
 	}
-	cerr << "Unknown response from rename "<< a <<endl;
+	cerr << "Unknown response from rename "<< res <<endl;
 	return 1;
 }
 
@@ -826,12 +929,85 @@
 				// and this needs sending in the length word.
 	sendCommand(DELETE, a);
 	long res = getResponse(a);
-	if (!res && a.getLen() == 2) {
+	if (!res) {
 		// Correct response
-		return a.getWord(0);
+		return res;
 	}
-	cerr << "Unknown response from delete "<< a <<endl;
+	cerr << "Unknown response from delete "<< res <<endl;
 	return 1;
+}
+
+/*
+ * Translate SIBO attributes to standard attributes.
+ */
+long rfsv16::
+attr2std(long attr)
+{
+	long res = 0;
+
+	// Common attributes
+	if (!(attr & P_FAWRITE))
+		res |= PSI_A_RDONLY;
+	if (attr & P_FAHIDDEN)
+		res |= PSI_A_HIDDEN;
+	if (attr & P_FASYSTEM)
+		res |= PSI_A_SYSTEM;
+	if (attr & P_FADIR)
+		res |= PSI_A_DIR;
+	if (attr & P_FAMOD)
+		res |= PSI_A_ARCHIVE;
+	if (attr & P_FAVOLUME)
+		res |= PSI_A_VOLUME;
+
+	// SIBO-specific
+	if (attr & P_FAREAD)
+		res |= PSI_A_READ;
+	if (attr & P_FAEXEC)
+		res |= PSI_A_EXEC;
+	if (attr & P_FASTREAM)
+		res |= PSI_A_STREAM;
+	if (attr & P_FATEXT)
+		res |= PSI_A_TEXT;
+
+	// Do what we can for EPOC
+	res |= PSI_A_NORMAL;
+
+	return res;
+}
+
+/*
+ * Translate standard attributes to SIBO attributes.
+ */
+long rfsv16::
+std2attr(long attr)
+{
+	long res = 0;
+
+	// Common attributes
+	if (!(attr & PSI_A_RDONLY))
+		res |= P_FAWRITE;
+	if (attr & PSI_A_HIDDEN)
+		res |= P_FAHIDDEN;
+	if (attr & PSI_A_SYSTEM)
+		res |= P_FASYSTEM;
+	if (attr & PSI_A_DIR)
+		res |= P_FADIR;
+	if (attr & PSI_A_ARCHIVE)
+		res |= P_FAMOD;
+	if (attr & PSI_A_VOLUME)
+		res |= P_FAVOLUME;
+
+	// SIBO-specific
+	if (attr & PSI_A_READ)
+		res |= P_FAREAD;
+	if (attr & PSI_A_EXEC)
+		res |= P_FAEXEC;
+	if (attr & PSI_A_STREAM)
+		res |= P_FASTREAM;
+	if (attr & PSI_A_TEXT)
+		res |= P_FATEXT;
+
+	return res;
 }
 
 
diff -N -b -u3 -r plptools-0.6/lib/rfsv16.h plptools-0.6-mjg+jh/lib/rfsv16.h
--- plptools-0.6/lib/rfsv16.h	Fri Jan 14 22:34:11 2000
+++ plptools-0.6-mjg+jh/lib/rfsv16.h	Tue Jul 18 21:40:24 2000
@@ -46,6 +46,9 @@
 	char *opAttr(long);
 	long opMode(long);
 
+	long attr2std(long);
+	long std2attr(long);
+
 private:
   enum commands {
     FOPEN = 0, // File Open
diff -N -b -u3 -r plptools-0.6/lib/rfsv32.cc plptools-0.6-mjg+jh/lib/rfsv32.cc
--- plptools-0.6/lib/rfsv32.cc	Mon Jan 17 21:13:46 2000
+++ plptools-0.6-mjg+jh/lib/rfsv32.cc	Tue Jul 18 21:40:24 2000
@@ -203,8 +203,17 @@
 	micro /= 1000000;
 	micro -= pes;
 	micro += EPOCH_DIFF_SECS;
-	micro -= EPOCH_2H;
-	micro += 3600; /* 1 hour PJC */
+
+        /* Adjust for timezone and daylight saving time */
+        { 
+          struct tm *t;
+          long date=micro;
+
+          t = localtime(&date);
+          micro += timezone;                 /* Adjust for timezone */
+          if (t->tm_isdst) micro -= (60*60); /* Adjust for DST */
+        }
+
 	return (long) micro;
 }
 
@@ -216,8 +225,17 @@
 	pes <<= 8;
 	micro += pes;
 	micro -= EPOCH_DIFF_SECS;
-	micro += EPOCH_2H;
-	micro -= 3600; /* 1 hour PJC */
+
+        /* Adjust for timezone and daylight saving time */
+        { 
+          struct tm *t;
+          long date=time;
+
+          t = localtime(&date);
+          micro -= timezone;                 /* Adjust for timezone */
+          if (t->tm_isdst) micro += (60*60); /* Adjust for DST */
+        }
+
 	micro *= (unsigned long long)1000000;
 	microLo = (micro & (unsigned long long)0x0FFFFFFFF);
 	micro >>= 32;
@@ -495,8 +513,12 @@
 		serNum = 0;
 	a.addBuff(data);
 	result = skt->sendBufferStore(a);
+	if (!result) {
+		reconnect();
+		result = skt->sendBufferStore(a);
 	if (!result)
 		status = E_PSI_FILE_DISC;
+	}
 	return result;
 }
 
@@ -887,4 +909,74 @@
 		return -999;
 	}
 	return e2psi[status - E_EPOC_DIR_FULL];
+}
+
+
+/*
+ * Translate EPOC attributes to standard attributes.
+ */
+long rfsv32::
+attr2std(long attr)
+{
+	long res = 0;
+
+	// Common attributes
+	if (attr & EPOC_ATTR_RONLY)
+		res |= PSI_A_RDONLY;
+	if (attr & EPOC_ATTR_HIDDEN)
+		res |= PSI_A_HIDDEN;
+	if (attr & EPOC_ATTR_SYSTEM)
+		res |= PSI_A_SYSTEM;
+	if (attr & EPOC_ATTR_DIRECTORY)
+		res |= PSI_A_DIR;
+	if (attr & EPOC_ATTR_ARCHIVE)
+		res |= PSI_A_ARCHIVE;
+	if (attr & EPOC_ATTR_VOLUME)
+		res |= PSI_A_VOLUME;
+
+	// EPOC-specific
+	if (attr & EPOC_ATTR_NORMAL)
+		res |= PSI_A_NORMAL;
+	if (attr & EPOC_ATTR_TEMPORARY)
+		res |= PSI_A_TEMP;
+	if (attr & EPOC_ATTR_COMPRESSED)
+		res |= PSI_A_COMPRESSED;
+	
+	// Do what we can for SIBO
+	res |= PSI_A_READ;
+
+	return res;
+}
+
+/*
+ * Translate standard attributes to EPOC attributes.
+ */
+long rfsv32::
+std2attr(long attr)
+{
+	long res = 0;
+
+	// Common attributes
+	if (!(attr & PSI_A_RDONLY))
+		res |= EPOC_ATTR_RONLY;
+	if (attr & PSI_A_HIDDEN)
+		res |= EPOC_ATTR_HIDDEN;
+	if (attr & PSI_A_SYSTEM)
+		res |= EPOC_ATTR_SYSTEM;
+	if (attr & PSI_A_DIR)
+		res |= EPOC_ATTR_DIRECTORY;
+	if (attr & PSI_A_ARCHIVE)
+		res |= EPOC_ATTR_ARCHIVE;
+	if (attr & PSI_A_VOLUME)
+		res |= EPOC_ATTR_VOLUME;
+
+	// EPOC-specific
+	if (attr & PSI_A_NORMAL)
+		res |= EPOC_ATTR_NORMAL;
+	if (attr & PSI_A_TEMP)
+		res |= EPOC_ATTR_TEMPORARY;
+	if (attr & PSI_A_COMPRESSED)
+		res |= EPOC_ATTR_COMPRESSED;
+
+	return res;
 }
diff -N -b -u3 -r plptools-0.6/lib/rfsv32.h plptools-0.6-mjg+jh/lib/rfsv32.h
--- plptools-0.6/lib/rfsv32.h	Fri Jan 14 23:35:39 2000
+++ plptools-0.6-mjg+jh/lib/rfsv32.h	Tue Jul 18 21:40:24 2000
@@ -44,6 +44,9 @@
 	char *opAttr(long);
 	long opMode(long);
 
+	long attr2std(long);
+	long std2attr(long);
+
 	private:
 	
 	enum file_attrib {
diff -N -b -u3 -r plptools-0.6/lib/rpcs.cc plptools-0.6-mjg+jh/lib/rpcs.cc
--- plptools-0.6/lib/rpcs.cc	Sun Jan 16 23:21:27 2000
+++ plptools-0.6-mjg+jh/lib/rpcs.cc	Tue Jul 18 21:40:24 2000
@@ -91,8 +91,12 @@
 	a.addByte(cc);
 	a.addBuff(data);
 	result = skt->sendBufferStore(a);
+	if (!result) {
+		reconnect();
+		result = skt->sendBufferStore(a);
 	if (!result)
 		status = E_PSI_FILE_DISC;
+	}
 	return result;
 }
 
@@ -227,11 +231,17 @@
 			s[i] = 0;
 	ret.clear();
 	while (l > 0) {
+		if (*s != '\0') {
 		bufferStore b;
 		b.addStringT(s);
 		ret += b;
 		l -= (strlen(s) + 1);
 		s += (strlen(s) + 1);
+		} else {
+			l--;
+			s++;
+		}
+		
 	}
 	return res;
 }
diff -N -b -u3 -r plptools-0.6/ncpd/Makefile.in plptools-0.6-mjg+jh/ncpd/Makefile.in
--- plptools-0.6/ncpd/Makefile.in	Mon Jan 17 23:06:30 2000
+++ plptools-0.6-mjg+jh/ncpd/Makefile.in	Tue Jul 18 21:39:13 2000
@@ -69,6 +69,7 @@
 CXX = @CXX@
 DBASEDIR = @DBASEDIR@
 DDEV = @DDEV@
+DDIR = @DDIR@
 DDRIVE = @DDRIVE@
 DLLTOOL = @DLLTOOL@
 DPORT = @DPORT@
@@ -123,8 +124,10 @@
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
-TAR = gtar
+TAR = tar
 GZIP_ENV = --best
+DEP_FILES =  .deps/channel.P .deps/link.P .deps/linkchan.P .deps/main.P \
+.deps/mp_serial.P .deps/ncp.P .deps/packet.P .deps/socketchan.P
 SOURCES = $(ncpd_SOURCES)
 OBJECTS = $(ncpd_OBJECTS)
 
@@ -132,9 +135,9 @@
 .SUFFIXES:
 .SUFFIXES: .S .c .cc .lo .o .s
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps ncpd/Makefile
+	cd $(top_srcdir) && $(AUTOMAKE) --gnu ncpd/Makefile
 
-Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
@@ -164,9 +167,6 @@
 	  rm -f $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
 	done
 
-.c.o:
-	$(COMPILE) -c $<
-
 .s.o:
 	$(COMPILE) -c $<
 
@@ -183,9 +183,6 @@
 
 maintainer-clean-compile:
 
-.c.lo:
-	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
-
 .s.lo:
 	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
 
@@ -244,6 +241,11 @@
 subdir = ncpd
 
 distdir: $(DISTFILES)
+	here=`cd $(top_builddir) && pwd`; \
+	top_distdir=`cd $(top_distdir) && pwd`; \
+	distdir=`cd $(distdir) && pwd`; \
+	cd $(top_srcdir) \
+	  && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu ncpd/Makefile
 	@for file in $(DISTFILES); do \
 	  d=$(srcdir); \
 	  if test -d $$d/$$file; then \
@@ -254,6 +256,57 @@
 	    || cp -p $$d/$$file $(distdir)/$$file || :; \
 	  fi; \
 	done
+
+DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
+
+-include $(DEP_FILES)
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+	-rm -rf .deps
+
+maintainer-clean-depend:
+
+%.o: %.c
+	@echo '$(COMPILE) -c $<'; \
+	$(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-cp .deps/$(*F).pp .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm .deps/$(*F).pp
+
+%.lo: %.c
+	@echo '$(LTCOMPILE) -c $<'; \
+	$(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-sed -e 's/^\([^:]*\)\.o[ 	]*:/\1.lo \1.o :/' \
+	  < .deps/$(*F).pp > .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm -f .deps/$(*F).pp
+
+%.o: %.cc
+	@echo '$(CXXCOMPILE) -c $<'; \
+	$(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-cp .deps/$(*F).pp .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm .deps/$(*F).pp
+
+%.lo: %.cc
+	@echo '$(LTCXXCOMPILE) -c $<'; \
+	$(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-sed -e 's/^\([^:]*\)\.o[ 	]*:/\1.lo \1.o :/' \
+	  < .deps/$(*F).pp > .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm -f .deps/$(*F).pp
 info-am:
 info: info-am
 dvi-am:
@@ -291,27 +344,27 @@
 
 maintainer-clean-generic:
 mostlyclean-am:  mostlyclean-sbinPROGRAMS mostlyclean-compile \
-		mostlyclean-libtool mostlyclean-tags \
+		mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
 		mostlyclean-generic
 
 mostlyclean: mostlyclean-am
 
 clean-am:  clean-sbinPROGRAMS clean-compile clean-libtool clean-tags \
-		clean-generic mostlyclean-am
+		clean-depend clean-generic mostlyclean-am
 
 clean: clean-am
 
 distclean-am:  distclean-sbinPROGRAMS distclean-compile \
-		distclean-libtool distclean-tags distclean-generic \
-		clean-am
+		distclean-libtool distclean-tags distclean-depend \
+		distclean-generic clean-am
 	-rm -f libtool
 
 distclean: distclean-am
 
 maintainer-clean-am:  maintainer-clean-sbinPROGRAMS \
 		maintainer-clean-compile maintainer-clean-libtool \
-		maintainer-clean-tags maintainer-clean-generic \
-		distclean-am
+		maintainer-clean-tags maintainer-clean-depend \
+		maintainer-clean-generic distclean-am
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
 
@@ -323,11 +376,13 @@
 clean-compile maintainer-clean-compile mostlyclean-libtool \
 distclean-libtool clean-libtool maintainer-clean-libtool tags \
 mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
-distdir info-am info dvi-am dvi check check-am installcheck-am \
-installcheck install-exec-am install-exec install-data-am install-data \
-install-am install uninstall-am uninstall all-redirect all-am all \
-installdirs mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+distdir mostlyclean-depend distclean-depend clean-depend \
+maintainer-clean-depend info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff -N -b -u3 -r plptools-0.6/ncpd/main.cc plptools-0.6-mjg+jh/ncpd/main.cc
--- plptools-0.6/ncpd/main.cc	Mon Jan 17 11:49:40 2000
+++ plptools-0.6-mjg+jh/ncpd/main.cc	Tue Jul 18 21:40:25 2000
@@ -79,7 +79,7 @@
 void
 usage()
 {
-	cerr << "Usage : ncpd [-V] [-v logclass] [-d] [-p <port>] [-s <device>] [-b <baudrate>]\n";
+	cerr << "Usage : ncpd [-V] [-v logclass] [-d] [-e] [-p <port>] [-s <device>] [-b <baudrate>]\n";
 	exit(1);
 }
 
@@ -90,6 +90,7 @@
 	IOWatch iow;
 	int pid;
 	bool dofork = true;
+	bool autoexit = false;
 
 	// Command line parameter processing
 	int sockNum = DPORT;
@@ -120,7 +121,7 @@
 			if (!strcmp(argv[i], "pd"))
 				pverbose |= PKT_DEBUG_DUMP;
 			if (!strcmp(argv[i], "ph"))
-				lverbose |= PKT_DEBUG_HANDSHAKE;
+				pverbose |= PKT_DEBUG_HANDSHAKE;
 			if (!strcmp(argv[i], "m"))
 				verbose = true;
 			if (!strcmp(argv[i], "all")) {
@@ -133,6 +134,8 @@
 			baudRate = atoi(argv[++i]);
 		} else if (!strcmp(argv[i], "-d")) {
 			dofork = 0;
+		} else if (!strcmp(argv[i], "-e")) {
+			autoexit = true;
 		} else if (!strcmp(argv[i], "-V")) {
 			cout << "ncpd version " << VERSION << endl;
 			exit(0);
@@ -180,6 +183,9 @@
 						iow.watch(1, 0);
 
 					if (a->hasFailed()) {
+						if (autoexit)
+							break;
+
 						iow.watch(5, 0);
 						if (verbose)
 							cout << "ncp: restarting\n";
diff -N -b -u3 -r plptools-0.6/ncpd/mp_serial.c plptools-0.6-mjg+jh/ncpd/mp_serial.c
--- plptools-0.6/ncpd/mp_serial.c	Mon Jul  5 22:48:56 1999
+++ plptools-0.6-mjg+jh/ncpd/mp_serial.c	Tue Jul 18 21:40:25 2000
@@ -153,7 +153,7 @@
 #endif
 #if defined(sun) || defined(linux) || defined(__sgi) || defined(__NetBSD__)
 	ti.c_cflag = CS8 | HUPCL | clocal | CRTSCTS | CREAD;
-	ti.c_iflag = IGNBRK | IGNPAR;
+	ti.c_iflag = IGNBRK | IGNPAR | IXON | IXOFF;
 	ti.c_cc[VMIN] = 1;
 	ti.c_cc[VTIME] = 0;
 #endif
diff -N -b -u3 -r plptools-0.6/ncpd/packet.cc plptools-0.6-mjg+jh/ncpd/packet.cc
--- plptools-0.6/ncpd/packet.cc	Mon Jan 17 11:49:40 2000
+++ plptools-0.6-mjg+jh/ncpd/packet.cc	Tue Jul 18 21:40:25 2000
@@ -54,6 +54,7 @@
 	inPtr = inBuffer = new unsigned char[BUFFERLEN + 1];
 	outPtr = outBuffer = new unsigned char[BUFFERLEN + 1];
 	inLen = outLen = termLen = 0;
+	foundSync = 0;
 	esc = false;
 	crcIn = crcOut = 0;
 
@@ -87,7 +88,7 @@
 send(unsigned char type, const bufferStore & b)
 {
 	if (verbose & PKT_DEBUG_LOG) {
-		cout << "packet: >> ";
+		cout << "packet: type " << hex << (int) type << " >> ";
 		if (verbose & PKT_DEBUG_DUMP)
 			cout << b << endl;
 		else
@@ -185,7 +186,7 @@
 	if (verbose & PKT_DEBUG_LOG) {
 		cout << "packet: get ";
 		if (verbose & PKT_DEBUG_DUMP) {
-			for (int i = 0; i < termLen; i++)
+			for (int i = foundSync - 3; i < termLen; i++)
 				cout << hex << setw(2) << setfill('0') << (int) inBuffer[i] << " ";
 		} else
 			cout << "len=" << dec << termLen;
@@ -193,6 +194,7 @@
 	}
 	inLen -= termLen;
 	termLen = 0;
+	foundSync = 0;
 	bool crcOk = (endPtr[0] == ((crcIn >> 8) & 0xff) && endPtr[1] == (crcIn & 0xff));
 	if (inLen > 0)
 		memmove(inBuffer, &endPtr[2], inLen);
@@ -218,15 +220,29 @@
 	if (inLen < 6)
 		return false;
 	p = inBuffer + termLen;
-	if (termLen == 0) {
+	if (!foundSync) {
+	  while (!foundSync && (inLen - termLen >= 6))
+	  {
+		termLen++;
 		if (*p++ != 0x16)
-			return false;
+			continue;
+		termLen++;
 		if (*p++ != 0x10)
-			return false;
+			continue;
+		termLen++;
 		if (*p++ != 0x02)
+			continue;
+		foundSync = termLen;
+	  }
+	  if (!foundSync)
 			return false;
+
+	if (verbose & PKT_DEBUG_LOG) {
+	  if (foundSync != 3)
+	    cout << "packet: terminated found sync at " << foundSync << endl;
+	}
 		esc = false;
-		termLen = 3;
+		// termLen = 3;
 		crcIn = 0;
 		rcv.init();
 	}
diff -N -b -u3 -r plptools-0.6/ncpd/packet.h plptools-0.6-mjg+jh/ncpd/packet.h
--- plptools-0.6/ncpd/packet.h	Mon Jan 17 11:49:40 2000
+++ plptools-0.6-mjg+jh/ncpd/packet.h	Tue Jul 18 21:39:13 2000
@@ -63,6 +63,7 @@
 		int inLen;
 		int outLen;
 		int termLen;
+		int foundSync;
 		int fd;
 		short int verbose;
 		bool esc;
diff -N -b -u3 -r plptools-0.6/patches/README plptools-0.6-mjg+jh/patches/README
--- plptools-0.6/patches/README	Thu Jan  1 01:00:00 1970
+++ plptools-0.6-mjg+jh/patches/README	Tue Jul 18 21:39:13 2000
@@ -0,0 +1,16 @@
+The following patches may be applied to other programs to allow them to operate
+better with plptools.
+
+mgetty-1.1.21-plp.diff is from Christof Meerwald, and adds autodetection 
+support for the PLP-protocol to mgetty - thus mgetty can autodetect a
+Psion connected to the serial port and execute ncpd (with the autoexit
+option). Having mgetty watch the serial port makes it a lot more easy to
+switch between a PLP (file transfer) and a PPP (TCP/IP) connection. Christof
+used the following login.conf for mgetty:
+
+/AutoPPP/ -     -       /usr/sbin/pppd
+/PLP/   -       -       /usr/sbin/ncpd -d -e
+*       -       -       /bin/login @
+
+
+-- MJG
diff -N -b -u3 -r plptools-0.6/patches/mgetty-1.1.21-plp.diff plptools-0.6-mjg+jh/patches/mgetty-1.1.21-plp.diff
--- plptools-0.6/patches/mgetty-1.1.21-plp.diff	Thu Jan  1 01:00:00 1970
+++ plptools-0.6-mjg+jh/patches/mgetty-1.1.21-plp.diff	Tue Jul 18 21:39:13 2000
@@ -0,0 +1,40 @@
+diff -ur mgetty-1.1.21/logname.c mgetty-1.1.21.new/logname.c
+--- mgetty-1.1.21/logname.c	Tue Sep  1 11:56:19 1998
++++ mgetty-1.1.21.new/logname.c	Sat Jan  1 17:12:11 2000
+@@ -270,6 +270,9 @@
+     static int ppp_level = 0, ppp_escaped = 0;
+     char   ppp_ch;
+ #endif
++#if 1
++    static int plp_level = 0;
++#endif
+     
+     /* read character by character! */
+     tio_save = *tio;
+@@ -413,6 +416,26 @@
+             ppp_level = 0;
+ 	    ppp_escaped = 0;
+         }
++#endif
++#if 1
++	if (ch == '\026')
++	{
++	  plp_level = 1;
++	}
++	else if ((ch == '\020') && (plp_level == 1))
++	{
++	  plp_level = 2;
++	}
++	else if ((ch == '\002') && (plp_level == 2))
++	{
++	  strcpy (buf, "/PLP/");
++	  i=5;
++	  ch = '\r';
++	}
++	else
++	{
++	  plp_level = 0;
++	}
+ #endif
+         
+ #ifdef JANUS
diff -N -b -u3 -r plptools-0.6/plpftp/Makefile.in plptools-0.6-mjg+jh/plpftp/Makefile.in
--- plptools-0.6/plpftp/Makefile.in	Mon Jan 17 23:06:30 2000
+++ plptools-0.6-mjg+jh/plpftp/Makefile.in	Tue Jul 18 21:39:13 2000
@@ -69,6 +69,7 @@
 CXX = @CXX@
 DBASEDIR = @DBASEDIR@
 DDEV = @DDEV@
+DDIR = @DDIR@
 DDRIVE = @DDRIVE@
 DLLTOOL = @DLLTOOL@
 DPORT = @DPORT@
@@ -115,8 +116,9 @@
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
-TAR = gtar
+TAR = tar
 GZIP_ENV = --best
+DEP_FILES =  .deps/ftp.P .deps/main.P
 SOURCES = $(plpftp_SOURCES)
 OBJECTS = $(plpftp_OBJECTS)
 
@@ -124,9 +126,9 @@
 .SUFFIXES:
 .SUFFIXES: .S .c .cc .lo .o .s
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps plpftp/Makefile
+	cd $(top_srcdir) && $(AUTOMAKE) --gnu plpftp/Makefile
 
-Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
@@ -156,9 +158,6 @@
 	  rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
 	done
 
-.c.o:
-	$(COMPILE) -c $<
-
 .s.o:
 	$(COMPILE) -c $<
 
@@ -175,9 +174,6 @@
 
 maintainer-clean-compile:
 
-.c.lo:
-	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
-
 .s.lo:
 	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
 
@@ -236,6 +232,11 @@
 subdir = plpftp
 
 distdir: $(DISTFILES)
+	here=`cd $(top_builddir) && pwd`; \
+	top_distdir=`cd $(top_distdir) && pwd`; \
+	distdir=`cd $(distdir) && pwd`; \
+	cd $(top_srcdir) \
+	  && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu plpftp/Makefile
 	@for file in $(DISTFILES); do \
 	  d=$(srcdir); \
 	  if test -d $$d/$$file; then \
@@ -246,6 +247,57 @@
 	    || cp -p $$d/$$file $(distdir)/$$file || :; \
 	  fi; \
 	done
+
+DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
+
+-include $(DEP_FILES)
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+	-rm -rf .deps
+
+maintainer-clean-depend:
+
+%.o: %.c
+	@echo '$(COMPILE) -c $<'; \
+	$(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-cp .deps/$(*F).pp .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm .deps/$(*F).pp
+
+%.lo: %.c
+	@echo '$(LTCOMPILE) -c $<'; \
+	$(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-sed -e 's/^\([^:]*\)\.o[ 	]*:/\1.lo \1.o :/' \
+	  < .deps/$(*F).pp > .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm -f .deps/$(*F).pp
+
+%.o: %.cc
+	@echo '$(CXXCOMPILE) -c $<'; \
+	$(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-cp .deps/$(*F).pp .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm .deps/$(*F).pp
+
+%.lo: %.cc
+	@echo '$(LTCXXCOMPILE) -c $<'; \
+	$(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-sed -e 's/^\([^:]*\)\.o[ 	]*:/\1.lo \1.o :/' \
+	  < .deps/$(*F).pp > .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm -f .deps/$(*F).pp
 info-am:
 info: info-am
 dvi-am:
@@ -283,26 +335,27 @@
 
 maintainer-clean-generic:
 mostlyclean-am:  mostlyclean-binPROGRAMS mostlyclean-compile \
-		mostlyclean-libtool mostlyclean-tags \
+		mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
 		mostlyclean-generic
 
 mostlyclean: mostlyclean-am
 
 clean-am:  clean-binPROGRAMS clean-compile clean-libtool clean-tags \
-		clean-generic mostlyclean-am
+		clean-depend clean-generic mostlyclean-am
 
 clean: clean-am
 
 distclean-am:  distclean-binPROGRAMS distclean-compile distclean-libtool \
-		distclean-tags distclean-generic clean-am
+		distclean-tags distclean-depend distclean-generic \
+		clean-am
 	-rm -f libtool
 
 distclean: distclean-am
 
 maintainer-clean-am:  maintainer-clean-binPROGRAMS \
 		maintainer-clean-compile maintainer-clean-libtool \
-		maintainer-clean-tags maintainer-clean-generic \
-		distclean-am
+		maintainer-clean-tags maintainer-clean-depend \
+		maintainer-clean-generic distclean-am
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
 
@@ -313,12 +366,14 @@
 mostlyclean-compile distclean-compile clean-compile \
 maintainer-clean-compile mostlyclean-libtool distclean-libtool \
 clean-libtool maintainer-clean-libtool tags mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
-dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
-install-exec install-data-am install-data install-am install \
-uninstall-am uninstall all-redirect all-am all installdirs \
-mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+distclean-tags clean-tags maintainer-clean-tags distdir \
+mostlyclean-depend distclean-depend clean-depend \
+maintainer-clean-depend info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff -N -b -u3 -r plptools-0.6/plpftp/ftp.cc plptools-0.6-mjg+jh/plpftp/ftp.cc
--- plptools-0.6/plpftp/ftp.cc	Mon Jan 17 11:49:41 2000
+++ plptools-0.6-mjg+jh/plpftp/ftp.cc	Tue Jul 18 22:12:02 2000
@@ -28,6 +28,7 @@
 #include <string.h>
 #include <ctype.h>
 #include <stdlib.h>
+#include <stdio.h>
 #include <iomanip.h>
 #include <unistd.h>
 #include <sys/time.h>
@@ -43,7 +44,6 @@
 
 #if HAVE_LIBREADLINE
 extern "C"  {
-#include <stdio.h>
 #include <readline/readline.h>
 #if HAVE_LIBHISTORY
 #include <readline/history.h>
@@ -53,7 +53,9 @@
 
 static char psionDir[1024];
 static rfsv *comp_a;
+/* not used 
 static rpcs *comp_r;
+*/
 static int continueRunning;
 
 
@@ -205,7 +207,8 @@
 	}
 	if (!once) {
 		bufferArray b;
-		if (!r.getOwnerInfo(b)) {
+		res = r.getOwnerInfo(b);
+		if (!res) {
 			int machType;
 			r.getMachineType(machType);
 			cout << "Connected to ";
@@ -251,7 +254,8 @@
 			while (!b.empty())
 				cout << "  " << b.pop().getString() << endl;
 			cout << endl;
-		}
+		} else
+		    cout << "OwnerInfo returned error " << res << endl;
 	}
 
 	if (!strcmp(DDRIVE, "AUTO")) {
@@ -535,6 +539,8 @@
 				strcat(f2, argv[2]);
 			gettimeofday(&stime, 0L);
 			if ((res = a.copyFromPsion(f1, f2, cab)) != 0) {
+				cerr << "copyFromPsion returned " << res << endl;
+				
 				if (hash)
 					cout << endl;
 				continueRunning = 1;
@@ -913,7 +919,7 @@
 
 	rl_completion_entry_function = (Function *)null_completion;
 	if (start == 0)
-		matches = completion_matches(text, command_generator);
+		matches = completion_matches(text, (char* (*)())command_generator);
 	else {
 		int idx = 0;
 		char *name;
@@ -934,7 +940,7 @@
 				maskAttr = 0x0010;
 		}
 		
-		matches = completion_matches(text, filename_generator);
+		matches = completion_matches(text, (char* (*)())filename_generator);
 	}
 	return matches;
 }
diff -N -b -u3 -r plptools-0.6/plpnfsd/Makefile.in plptools-0.6-mjg+jh/plpnfsd/Makefile.in
--- plptools-0.6/plpnfsd/Makefile.in	Mon Jan 17 23:06:30 2000
+++ plptools-0.6-mjg+jh/plpnfsd/Makefile.in	Tue Jul 18 21:39:13 2000
@@ -69,6 +69,7 @@
 CXX = @CXX@
 DBASEDIR = @DBASEDIR@
 DDEV = @DDEV@
+DDIR = @DDIR@
 DDRIVE = @DDRIVE@
 DLLTOOL = @DLLTOOL@
 DPORT = @DPORT@
@@ -124,8 +125,11 @@
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
-TAR = gtar
+TAR = tar
 GZIP_ENV = --best
+DEP_FILES =  .deps/main.P .deps/mount_aix.P .deps/mp_inode.P \
+.deps/mp_main.P .deps/mp_mount.P .deps/mp_pfs_ops.P \
+.deps/nfs_prot_svc.P .deps/nfs_prot_xdr.P
 SOURCES = $(plpnfsd_SOURCES) $(EXTRA_plpnfsd_SOURCES)
 OBJECTS = $(plpnfsd_OBJECTS)
 
@@ -133,9 +137,9 @@
 .SUFFIXES:
 .SUFFIXES: .S .c .cc .lo .o .s
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps plpnfsd/Makefile
+	cd $(top_srcdir) && $(AUTOMAKE) --gnu plpnfsd/Makefile
 
-Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
@@ -165,9 +169,6 @@
 	  rm -f $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
 	done
 
-.c.o:
-	$(COMPILE) -c $<
-
 .s.o:
 	$(COMPILE) -c $<
 
@@ -184,9 +185,6 @@
 
 maintainer-clean-compile:
 
-.c.lo:
-	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
-
 .s.lo:
 	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
 
@@ -245,6 +243,11 @@
 subdir = plpnfsd
 
 distdir: $(DISTFILES)
+	here=`cd $(top_builddir) && pwd`; \
+	top_distdir=`cd $(top_distdir) && pwd`; \
+	distdir=`cd $(distdir) && pwd`; \
+	cd $(top_srcdir) \
+	  && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu plpnfsd/Makefile
 	@for file in $(DISTFILES); do \
 	  d=$(srcdir); \
 	  if test -d $$d/$$file; then \
@@ -255,6 +258,57 @@
 	    || cp -p $$d/$$file $(distdir)/$$file || :; \
 	  fi; \
 	done
+
+DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
+
+-include $(DEP_FILES)
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+	-rm -rf .deps
+
+maintainer-clean-depend:
+
+%.o: %.c
+	@echo '$(COMPILE) -c $<'; \
+	$(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-cp .deps/$(*F).pp .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm .deps/$(*F).pp
+
+%.lo: %.c
+	@echo '$(LTCOMPILE) -c $<'; \
+	$(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-sed -e 's/^\([^:]*\)\.o[ 	]*:/\1.lo \1.o :/' \
+	  < .deps/$(*F).pp > .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm -f .deps/$(*F).pp
+
+%.o: %.cc
+	@echo '$(CXXCOMPILE) -c $<'; \
+	$(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-cp .deps/$(*F).pp .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm .deps/$(*F).pp
+
+%.lo: %.cc
+	@echo '$(LTCXXCOMPILE) -c $<'; \
+	$(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-sed -e 's/^\([^:]*\)\.o[ 	]*:/\1.lo \1.o :/' \
+	  < .deps/$(*F).pp > .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm -f .deps/$(*F).pp
 info-am:
 info: info-am
 dvi-am:
@@ -294,27 +348,27 @@
 
 maintainer-clean-generic:
 mostlyclean-am:  mostlyclean-sbinPROGRAMS mostlyclean-compile \
-		mostlyclean-libtool mostlyclean-tags \
+		mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
 		mostlyclean-generic
 
 mostlyclean: mostlyclean-am
 
 clean-am:  clean-sbinPROGRAMS clean-compile clean-libtool clean-tags \
-		clean-generic mostlyclean-am
+		clean-depend clean-generic mostlyclean-am
 
 clean: clean-am
 
 distclean-am:  distclean-sbinPROGRAMS distclean-compile \
-		distclean-libtool distclean-tags distclean-generic \
-		clean-am
+		distclean-libtool distclean-tags distclean-depend \
+		distclean-generic clean-am
 	-rm -f libtool
 
 distclean: distclean-am
 
 maintainer-clean-am:  maintainer-clean-sbinPROGRAMS \
 		maintainer-clean-compile maintainer-clean-libtool \
-		maintainer-clean-tags maintainer-clean-generic \
-		distclean-am
+		maintainer-clean-tags maintainer-clean-depend \
+		maintainer-clean-generic distclean-am
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
 
@@ -326,11 +380,13 @@
 clean-compile maintainer-clean-compile mostlyclean-libtool \
 distclean-libtool clean-libtool maintainer-clean-libtool tags \
 mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
-distdir info-am info dvi-am dvi check check-am installcheck-am \
-installcheck install-exec-am install-exec install-data-am install-data \
-install-am install uninstall-am uninstall all-redirect all-am all \
-installdirs mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+distdir mostlyclean-depend distclean-depend clean-depend \
+maintainer-clean-depend info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
 
 
 install-exec-hook:
diff -N -b -u3 -r plptools-0.6/plpnfsd/main.cc plptools-0.6-mjg+jh/plpnfsd/main.cc
--- plptools-0.6/plpnfsd/main.cc	Mon Jan 17 23:10:22 2000
+++ plptools-0.6-mjg+jh/plpnfsd/main.cc	Tue Jul 18 21:40:25 2000
@@ -53,7 +53,7 @@
 			return -1;
 		(*e)->time = s.getDWord(0);
 		(*e)->size = s.getDWord(4);
-		(*e)->attr = s.getDWord(8);
+		(*e)->attr = a->attr2std(s.getDWord(8));
 		(*e)->name = strdup(s.getString(12));
 		(*e)->next = tmp;
 	}
@@ -138,7 +138,6 @@
 }
 
 long rfsv_read(char *buf, long offset, long len, char *name) {
-	// FIXME: this might break on RFSV16?
 	long ret = 0;
 
 	if (!a)
@@ -161,7 +160,6 @@
 }
 
 long rfsv_write(char *buf, long offset, long len, char *name) {
-	// FIXME: this might break on RFSV16?
 	long ret = 0;
 
 	if (!a)
@@ -196,7 +194,6 @@
 long rfsv_setsize(const char *name, long size) {
 	long ph;
 	long ret;
-	// FIXME: this might break on RFSV16?
 
 	if (!a)
 		return -1;
@@ -215,14 +212,19 @@
 		return -1;
 	if (a_filename && !strcmp(name, a_filename))
 		rfsv_closecached();
-	long ret = a->fsetattr(name, dattr, sattr);
-	return ret;
+	dattr = a->std2attr(dattr);
+	sattr = a->std2attr(sattr);
+	return a->fsetattr(name, dattr, sattr);
 }
 
 long rfsv_getattr(const char *name, long *attr, long *size, long *time) {
+	long res, psiattr;
+	
 	if (!a)
 		return -1;
-	return a->fgeteattr(&(*name), &(*attr), &(*size), &(*time));
+	res = a->fgeteattr(&(*name), &psiattr, &(*size), &(*time));
+	*attr = a->attr2std(psiattr);
+	return res;
 }
 
 long rfsv_statdev(char letter) {
diff -N -b -u3 -r plptools-0.6/plpnfsd/mp_mount.c plptools-0.6-mjg+jh/plpnfsd/mp_mount.c
--- plptools-0.6/plpnfsd/mp_mount.c	Mon Jan 17 11:49:41 2000
+++ plptools-0.6-mjg+jh/plpnfsd/mp_mount.c	Tue Jul 18 21:40:25 2000
@@ -66,7 +66,7 @@
 #ifndef __GLIBC__
 #include <linux/fs.h>		/* struct nfs_mount_data */
 #endif
-#include <linux/nfs_mount.h>	/* struct nfs_mount_data */
+#include "linux-misc.h"		/* struct nfs_mount_data */
 #include <arpa/inet.h>		/* inet_addr() */
 #endif
 #ifdef _IBMR2
@@ -74,7 +74,6 @@
 #include "misc-aix3.h"
 #include <sys/vmount.h>
 #endif
-
 
 #ifndef DONT_UPDATE_MTAB
 #if defined(sun) && defined(__SVR4)
diff -N -b -u3 -r plptools-0.6/plpnfsd/mp_pfs_ops.c plptools-0.6-mjg+jh/plpnfsd/mp_pfs_ops.c
--- plptools-0.6/plpnfsd/mp_pfs_ops.c	Mon Jan 17 11:49:41 2000
+++ plptools-0.6-mjg+jh/plpnfsd/mp_pfs_ops.c	Tue Jul 18 21:40:25 2000
@@ -106,29 +106,35 @@
 	 * work properly
 	 */
 	*psisattr = *psidattr = 0;
+	if ((oattr & 0400) != (nattr & 0400)) {
+		if (nattr & 0400)		/* readable */
+			*psidattr |= PSI_A_READ;
+		else
+			*psisattr |= PSI_A_READ;
+	}
 	if ((oattr & 0200) != (nattr & 0200)) {
 		if (nattr & 0200)		/* readonly */
-			*psidattr |= 0x01;
+			*psidattr |= PSI_A_RDONLY;
 		else
-			*psisattr |= 0x01;
+			*psisattr |= PSI_A_RDONLY;
 	}
 	if ((oattr & 0020) != (nattr & 0020)) {
 		if (nattr & 0020)	/* group-write    -> archive */
-			*psisattr |= 0x20;
+			*psisattr |= PSI_A_ARCHIVE;
 		else
-			*psidattr |= 0x20;
+			*psidattr |= PSI_A_ARCHIVE;
 	}
 	if ((oattr & 0004) != (nattr & 0004)) {
 		if (nattr & 0004)		/* Not world-read -> hidden  */
-			*psidattr |= 0x02;
+			*psidattr |= PSI_A_HIDDEN;
 		else
-			*psisattr |= 0x02;
+			*psisattr |= PSI_A_HIDDEN;
 	}
 	if ((oattr & 0002) != (nattr & 0002)) {
 		if (nattr & 0002)		/* world-write    -> system */
-			*psisattr |= 0x04;
+			*psisattr |= PSI_A_SYSTEM;
 		else
-			*psidattr |= 0x04;
+			*psidattr |= PSI_A_SYSTEM;
 	}
 }
 
@@ -137,7 +143,7 @@
 {
 	bzero((char *) fp, sizeof(*fp));
 
-	if (psiattr & 0x10) {
+	if (psiattr & PSI_A_DIR) {
 		fp->type = NFDIR;
 		fp->mode = NFSMODE_DIR | 0700;
 		/*
@@ -159,17 +165,18 @@
 		 * Following flags have to be set in order to let backups
 		 * work properly
 		 */
+		if (psiattr & PSI_A_READ)
 		fp->mode |= 0400;		/* File readable (?) */
-		if (!(psiattr & 0x01))
+		if (!(psiattr & PSI_A_RDONLY))
 			fp->mode |= 0200;	/* File writeable  */
 		/* fp->mode |= 0100;		   File executable */
-		if (!(psiattr & 0x02))
+		if (!(psiattr & PSI_A_HIDDEN))
 			fp->mode |= 0004;	/* Not Hidden  <-> world read */
-		if (psiattr & 0x04)
+		if (psiattr & PSI_A_SYSTEM)
 			fp->mode |= 0002;	/* System      <-> world write */
-		if (psiattr & 0x40)
+		if (psiattr & PSI_A_VOLUME)
 			fp->mode |= 0001;	/* Volume      <-> world exec */
-		if (psiattr & 0x20)
+		if (psiattr & PSI_A_ARCHIVE)
 			fp->mode |= 0020;	/* Modified    <-> group write */
 	/*		fp->mode |= 0040;	 Byte        <-> group read */
 	/*		fp->mode |= 0010;	 Text        <-> group exec */
@@ -189,7 +196,7 @@
 {
 	bzero((char *) fp, sizeof(*fp));
 
-	if (psiattr & 0x10) {
+	if (psiattr & PSI_A_DIR) {
 		fp->type = NFDIR;
 		fp->mode = NFSMODE_DIR | 0700;
 		/*
@@ -211,17 +218,18 @@
 		 * Following flags have to be set in order to let backups
 		 * work properly
 		 */
+		if (psiattr & PSI_A_READ)
 		fp->mode |= 0400;		/* File readable (?) */
-		if (!(psiattr & 0x01))
+		if (!(psiattr & PSI_A_RDONLY))
 			fp->mode |= 0200;	/* File writeable  */
 		/* fp->mode |= 0100;		   File executable */
-		if (!(psiattr & 0x02))
+		if (!(psiattr & PSI_A_HIDDEN))
 			fp->mode |= 0004;	/* Not Hidden  <-> world read */
-		if (psiattr & 0x04)
+		if (psiattr & PSI_A_SYSTEM)
 			fp->mode |= 0002;	/* System      <-> world write */
-		if (psiattr & 0x40)
+		if (psiattr & PSI_A_VOLUME)
 			fp->mode |= 0001;	/* Volume      <-> world exec */
-		if (psiattr & 0x20)
+		if (psiattr & PSI_A_ARCHIVE)
 			fp->mode |= 0020;	/* Modified    <-> group write */
 	/*		fp->mode |= 0040;	 Byte        <-> group read */
 	/*		fp->mode |= 0010;	 Text        <-> group exec */
diff -N -b -u3 -r plptools-0.6/plpnfsd/rfsv_api.h plptools-0.6-mjg+jh/plpnfsd/rfsv_api.h
--- plptools-0.6/plpnfsd/rfsv_api.h	Mon Jan 17 23:10:22 2000
+++ plptools-0.6-mjg+jh/plpnfsd/rfsv_api.h	Tue Jul 18 21:40:25 2000
@@ -29,4 +29,19 @@
 extern long rfsv_isalive();
 extern long rfsv_closecached(void);
 
+/* File attributes, C-style */
+#define	PSI_A_RDONLY		0x0001
+#define	PSI_A_HIDDEN		0x0002
+#define	PSI_A_SYSTEM		0x0004
+#define PSI_A_DIR		0x0008
+#define PSI_A_ARCHIVE		0x0010
+#define PSI_A_VOLUME		0x0020
+#define PSI_A_NORMAL		0x0040
+#define PSI_A_TEMP		0x0080
+#define PSI_A_COMPRESSED	0x0100
+#define PSI_A_READ		0x0200
+#define PSI_A_EXEC		0x0400
+#define PSI_A_STREAM		0x0800
+#define PSI_A_TEXT		0x1000
+
 #endif
